home *** CD-ROM | disk | FTP | other *** search
-
- SHMEM_PTR(3) SHMEM_PTR(3)
-
-
- NNNNAAAAMMMMEEEE
- sssshhhhmmmmeeeemmmm____ppppttttrrrr - Returns a pointer to a data object on a specified
- processing element (PE)
-
- SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
- C or C++:
-
- ####iiiinnnncccclllluuuuddddeeee <<<<mmmmpppppppp////sssshhhhmmmmeeeemmmm....hhhh>>>>
-
- vvvvooooiiiidddd ****sssshhhhmmmmeeeemmmm____ppppttttrrrr((((vvvvooooiiiidddd ****_t_a_r_g_e_t,,,, iiiinnnntttt _p_e))));;;;
-
- Fortran:
-
- IIIINNNNCCCCLLLLUUUUDDDDEEEE """"mmmmpppppppp////sssshhhhmmmmeeeemmmm....ffffhhhh""""
-
- PPPPOOOOIIIINNNNTTTTEEEERRRR ((((PPPPTTTTRRRR,,,, PPPPOOOOIIIINNNNTTTTEEEEEEEE))))
- IIIINNNNTTTTEEEEGGGGEEEERRRR _p_e
- PPPPTTTTRRRR ==== SSSSHHHHMMMMEEEEMMMM____PPPPTTTTRRRR((((_t_a_r_g_e_t,,,, _p_e))))
-
- DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
- sssshhhhmmmmeeeemmmm____ppppttttrrrr returns the address of _t_a_r_g_e_t on the specified PE. This
- address can be assigned to a pointer. After that, ordinary loads and
- stores to this remote address may be performed.
-
- 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 sssshhhhmmmmeeeemmmm____ppppuuuutttt33332222(3) or sssshhhhmmmmeeeemmmm____rrrreeeeaaaallll____iiiiggggeeeetttt(3), the
- sssshhhhmmmmeeeemmmm____ppppttttrrrr function can provide an efficient means to accomplish the
- communication.
-
- The arguments are as follows:
-
- _t_a_r_g_e_t The remotely accessible integer data object on the remote
- PE.
-
- _p_e An integer that indicates the PE number on which _t_a_r_g_e_t is
- to be accessed. If you are using Fortran, it must be a
- default integer value.
-
- EEEEXXXXAAAAMMMMPPPPLLLLEEEESSSS
- This two-PE Fortran program calls sssshhhhmmmmeeeemmmm____ppppttttrrrr:
-
- PROGRAM PEEK
- INCLUDE 'mpp/shmem.fh'
-
- INTEGER BIGD(100)
- SAVE BIGD
-
- INTEGER POINTEE(*)
- POINTER (PTR,POINTEE)
-
- CALL START_PES(2)
-
-
- 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 two-PE C program calls sssshhhhmmmmeeeemmmm____ppppttttrrrr:
-
- #include <mpp/shmem.h>
- main()
- {
- static int bigd[100];
- int *ptr;
- int i;
-
- start_pes(2);
-
- if (_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 (_my_pe() == 1) {
- printf("bigd on PE 1 is:\n");
- for (i=0; i<100; i++)
- printf(" %d",bigd[i]);
- printf("\n");
- }
- }
-
- NNNNOOOOTTTTEEEESSSS
- The sssshhhhmmmmeeeemmmm____ppppttttrrrr function is available only on systems where ordinary
- memory loads and stores are used to implement SHMEM put and get
- operations.
-
- RRRREEEETTTTUUUURRRRNNNN VVVVAAAALLLLUUUUEEEESSSS
- sssshhhhmmmmeeeemmmm____ppppttttrrrr returns a pointer to the data object on the specified remote
- PE.
-
- SSSSEEEEEEEE AAAALLLLSSSSOOOO
- iiiinnnnttttrrrroooo____sssshhhhmmmmeeeemmmm(3), sssshhhhmmmmeeeemmmm____ppppuuuutttt(3), sssshhhhmmmmeeeemmmm____ggggeeeetttt(3),
-