SHMEM\_BROADCAST - Online Linux Manual PageSection : 3
Updated : Jan 21, 2016
Source : 1.10.2
Note : Open MPI

NAMEshmem_broadcast4(3), shmem_broadcast8(3), shmem_broadcast32(3), shmem_broadcast64(3) − Copy a data object from a designated PE to a target location on all other PEs of the active set.

SYNOPSISC or C++: #include <mpp/shmem.h> void shmem_broadcast32(void *target, const void *source, size_t nelems, int PE_root, int PE_start, int logPE_stride, int PE_size, long *pSync); void shmem_broadcast64(void *target, const void *source, size_t nelems, int PE_root, int PE_start, int logPE_stride, int PE_size, long *pSync); Fortran: INCLUDE "mpp/shmem.fh" INTEGER nelems, PE_root, PE_start, logPE_stride, PE_size INTEGER pSync(SHMEM_BCAST_SYNC_SIZE) CALL SHMEM_BROADCAST4(target, source, nelems, PE_root, & PE_start, logPE_stride, PE_size, fIpSync) CALL SHMEM_BROADCAST8(target, source, nelems, PE_root, & PE_start, logPE_stride, PE_size, pSync) CALL SHMEM_BROADCAST32(target, source, nelems, & PE_root, PE_start, logPE_stride, PE_size, pSync) CALL SHMEM_BROADCAST64(target, source, nelems, & PE_root, PE_start, logPE_stride, PE_size, pSync)

DESCRIPTIONThe broadcast routines write the data at address source of the PE specified by PE_root to address target on all other PEs in the active set. The active set of PEs is defined by the triplet PE_start, logPE_stride and PE_size​. The data is not copied to the target address on the PE specified by PE_root​. Before returning, the broadcast routines ensure that the elements of the pSync array are restored to their initial values. As with all SHMEM collective routines, each of these routines assumes that only PEs in the active set call the routine. If a PE not in the active set calls a SHMEM collective routine, undefined behavior results. The arguments are as follows: target  A symmetric data object with one of the following data types: shmem_broadcast8, shmem_broadcast64: Any noncharacter type that  has an element size of 64 bits. No Fortran derived types or C/C++ structures are allowed. shmem_broadcast32: Any noncharacter type that has an element size  of 32 bits. No Fortran derived types or C/C++ structures are allowed. shmem_broadcast4: Any noncharacter type that has an element size  of 32 bits. source  A symmetric data object that can be of any data type that is permissible for the target argument. nelems  The number of elements in source. For shmem_broadcast32 and shmem_broadcast4, this is the number of 32−bit halfwords. nelems must be of type integer. If you are using Fortran, it must be a default integer value. PE_root  Zero−based ordinal of the PE, with respect to the active set, from which the data is copied. Must be greater than or equal to 0 and less than PE_size. PE_root must be of type integer. If you are using Fortran, it must be a default integer value. PE_start  The lowest virtual PE number of the active set of PEs. PE_start must be of type integer. If you are using Fortran, it must be a default integer value. logPE_stride  The log (base 2) of the stride between consecutive virtual PE numbers in the active set. log_PE_stride must be of type integer. If you are using Fortran, it must be a default integer value. PE_size  The number of PEs in the active set. PE_size must be of type integer. If you are using Fortran, it must be a default integer value. pSync  A symmetric work array. In C/C++, pSync must be of type long and size _SHMEM_BCAST_SYNC_SIZE. In Fortran, pSync must be of type integer and size SHMEM_BCAST_SYNC_SIZE. Every element of this array must be initialized with the value _SHMEM_SYNC_VALUE (in C/C++) or SHMEM_SYNC_VALUE (in Fortran) before any of the PEs in the active set enter shmem_barrier(). The values of arguments PE_root, PE_start, logPE_stride, and PE_size must be equal on all PEs in the active set. The same target and source data objects and the same pSync work array must be passed to all PEs in the active set. Before any PE calls a broadcast routine, you must ensure that the following conditions exist (synchronization via a barrier or some other method is often needed to ensure this): The pSync array on all PEs in the active set is not still in use from a prior call to a broadcast routine. The target array on all PEs in the active set is ready to accept the broadcast data. Upon return from a broadcast routine, the following are true for the local PE: If the current PE is not the root PE, the target data object is updated. The values in the pSync array are restored to the original values.

NOTESThe terms collective and symmetric are defined in intro_shmem(3)​. All SHMEM broadcast routines restore pSync to its original contents. Multiple calls to SHMEM routines that use the same pSync array do not require that pSync be reinitialized after the first call. You must ensure the that the pSync array is not being updated by any PE in the active set while any of the PEs participates in processing of a SHMEM broadcast routine. Be careful to avoid these situations: If the pSync array is initialized at run time, some type of synchronization is needed to ensure that all PEs in the working set have initialized pSync before any of them enter a SHMEM routine called with the pSync synchronization array. A pSync array may be reused on a subsequent SHMEM broadcast routine only if none of the PEs in the active set are still processing a prior SHMEM broadcast routine call that used the same pSync array. In general, this can be ensured only by doing some type of synchronization. However, in the special case of SHMEM routines being called with the same active set, you can allocate two pSync arrays and alternate between them on successive calls.

EXAMPLESIn the following examples, the call to shmem_broadcast64 copies source on PE 4 to target on PEs 5, 6, and 7. C/C++ example: for (i=0; i < _SHMEM_BCAST_SYNC_SIZE; i++) { pSync[i] = _SHMEM_SYNC_VALUE; } shmem_barrier_all(); /* Wait for all PEs to initialize pSync */ shmem_broadcast64(target, source, nelems, 0, 4, 0, 4, pSync); Fortran example: INTEGER PSYNC(SHMEM_BCAST_SYNC_SIZE) INTEGER TARGET, SOURCE, NELEMS, PE_ROOT, PE_START, & LOGPE_STRIDE, PE_SIZE, PSYNC COMMON /COM/ TARGET, SOURCE DATA PSYNC /SHMEM_BCAST_SYNC_SIZE*SHMEM_SYNC_VALUE/ CALL SHMEM_BROADCAST64(TARGET, SOURCE, NELEMS, 0, 4, 0, 4, & PSYNC)

SEE ALSOintro_shmem(3)
0
Johanes Gumabo
Data Size   :   15,253 byte
man-shmem_broadcast64.3Build   :   2024-12-05, 20:55   :  
Visitor Screen   :   x
Visitor Counter ( page / site )   :   2 / 198,023
Visitor ID   :     :  
Visitor IP   :   3.147.49.19   :  
Visitor Provider   :   AMAZON-02   :  
Provider Position ( lat x lon )   :   39.962500 x -83.006100   :   x
Provider Accuracy Radius ( km )   :   1000   :  
Provider City   :   Columbus   :  
Provider Province   :   Ohio ,   :   ,
Provider Country   :   United States   :  
Provider Continent   :   North America   :  
Visitor Recorder   :   Version   :  
Visitor Recorder   :   Library   :  
Online Linux Manual Page   :   Version   :   Online Linux Manual Page - Fedora.40 - march=x86-64 - mtune=generic - 24.12.05
Online Linux Manual Page   :   Library   :   lib_c - 24.10.03 - march=x86-64 - mtune=generic - Fedora.40
Online Linux Manual Page   :   Library   :   lib_m - 24.10.03 - march=x86-64 - mtune=generic - Fedora.40
Data Base   :   Version   :   Online Linux Manual Page Database - 24.04.13 - march=x86-64 - mtune=generic - fedora-38
Data Base   :   Library   :   lib_c - 23.02.07 - march=x86-64 - mtune=generic - fedora.36

Very long time ago, I have the best tutor, Wenzel Svojanovsky . If someone knows the email address of Wenzel Svojanovsky , please send an email to johanes_gumabo@yahoo.co.id .
If error, please print screen and send to johanes_gumabo@yahoo.co.id
Under development. Support me via PayPal.

ERROR : Need New Coding :         (rof_escape_sequence|91|shmem_broadcast32.3|14|\_BROADCAST" "3" "Jan 21, 2016" "1.10.2" "Open MPI" |.TH "SHMEM\\_BROADCAST" "3" "Jan 21, 2016" "1.10.2" "Open MPI" )