SHMEM\_PTR - Online Linux Manual PageSection : 3
Updated : Jan 21, 2016
Source : 1.10.2
Note : Open MPI
NAMEshmem_ptr(3) − Returns a pointer to a data object on a specified processing element (PE).
SYNOPSISC or C++: #include <mpp/shmem.h>
void *shmem_ptr(void *target, int pe);
Fortran: INCLUDE "mpp/shmem.fh"
POINTER (PTR, POINTEE)
INTEGER pe
PTR = SHMEM_PTR(target, pe)
DESCRIPTIONThe shmem_ptr routine returns an address that can be used to directly reference target on the remote PE pe. With this address we can perform ordinary loads and stores to the remote address. When a sequence of loads (gets) and stores (puts) to a data object on a remote PE does not match the access pattern provided in a SHMEM data transfer routine like shmem_put32(3) or shmem_real_iget(3), the shmem_ptr function can provide an efficient means to accomplish the communication. The arguments are as follows: target The symmetric data object to be referenced. pe An integer that indicates the PE number on which target is to be accessed. If you are using Fortran, it must be a default integer value.
EXAMPLESThis Fortran program calls shmem_ptr and then PE 0 writes to the BIGD array on PE 1: PROGRAM REMOTEWRITE
INCLUDE 'mpp/shmem.fh'
INTEGER BIGD(100)
SAVE BIGD
INTEGER POINTEE(*)
POINTER (PTR,POINTEE)
CALL START_PES(0)
IF (MY_PE() .EQ. 0) THEN
! initialize PE 1's BIGD array
PTR = SHMEM_PTR(BIGD, 1) ! get address of PE 1's BIGD
! array
DO I=1,100
POINTEE(I) = I
ENDDO
ENDIF
CALL SHMEM_BARRIER_ALL
IF (MY_PE() .EQ. 1) THEN
PRINT *, 'BIGD on PE 1 is: '
PRINT *, BIGD
ENDIF
END
This is the equivalent program written in C: #include <mpp/shmem.h>
main()
{
static int bigd[100];
int *ptr;
int i;
shmem_init();
if (shmem_my_pe() == 0) {
/* initialize PE 1's bigd array */
ptr = shmem_ptr(bigd, 1);
for (i=0; i<100; i++)
*ptr++ = i+1;
}
shmem_barrier_all();
if (shmem_my_pe() == 1) {
printf("bigd on PE 1 is:\n");
for (i=0; i<100; i++)
printf(" %d\n",bigd[i]);
printf("\n");
}
}
NOTESThe shmem_ptr function is available only on systems where ordinary memory loads and stores are used to implement SHMEM put and get operations.
RETURN VALUESshmem_ptr returns a pointer to the data object on the specified remote PE. If target is not remotely accessible, a NULL pointer is returned.
SEE ALSOintro_shmem(3), shmem_put(3), shmem_get(3) 0
Johanes Gumabo
Data Size : 9,417 byte
man-shmem_ptr.3Build : 2024-12-05, 20:55 :
Visitor Screen : x
Visitor Counter ( page / site ) : 2 / 198,291
Visitor ID : :
Visitor IP : 18.119.166.34 :
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_ptr.3|14|\_PTR" "3" "Jan 21, 2016" "1.10.2" "Open MPI" |.TH "SHMEM\\_PTR" "3" "Jan 21, 2016" "1.10.2" "Open MPI"
) (rof_nr_x|149|shmem_ptr.3|107|\n");| printf("bigd on PE 1 is:\\n");
) (rof_nr_x|149|shmem_ptr.3|109|\n",bigd[i]);| printf(" %d\\n",bigd[i]);
) (rof_nr_x|149|shmem_ptr.3|110|\n");| printf("\\n");
)