Hi Ryan, Unfortunately, the attachments that you shared are too low resolution to make out the code. It sounds like you might be looking at the code in OpenSHMEM 1.1 Section 8.1.6 (attached). Is that right?
~Jim. On Thu, Mar 3, 2016 at 1:15 AM, RYAN RAY <ryan....@rediffmail.com> wrote: > > > > From: "RYAN RAY" ryan....@rediffmail.com > Sent: Thu, 03 Mar 2016 12:26:19 +0530 > To: "announce " annou...@open-mpi.org, "ryan.ray " ryan....@rediffmail.com > Subject: Open SHMEM Error > > > On trying a code specified in the manual"OpenSHMEM Specification Draft "a > section8.16 example code , we are facing a problem. > The code is the c version of the example code for the callSHMEM_PTR. > We have written the code exactly as it is in the manual , but we are > getting a segmentation fault. > The code , manual and error snapshots are attached in this mail. > > I will be grateful if you can provide any solution to this problem. > > RYAN SAPTARSHI RAY > > > > Get your own *FREE* website, *FREE* domain & *FREE* mobile app with > Company email. > *Know More >* > <http://track.rediff.com/click?url=___http://businessemail.rediff.com?sc_cid=sign-1-10-13___&cmp=host&lnk=sign-1-10-13&nsrv1=host> > > <https://sigads.rediff.com/RealMedia/ads/click_nx.ads/www.rediffmail.com/signatureline.htm@Middle?> > <https://sigads.rediff.com/RealMedia/ads/click_nx.ads/www.rediffmail.com/signatureline.htm@Middle?> > > Get your own *FREE* website, *FREE* domain & *FREE* mobile app with > Company email. > *Know More >* > <http://track.rediff.com/click?url=___http://businessemail.rediff.com?sc_cid=sign-1-10-13___&cmp=host&lnk=sign-1-10-13&nsrv1=host> > _______________________________________________ > users mailing list > us...@open-mpi.org > Subscription: http://www.open-mpi.org/mailman/listinfo.cgi/users > Link to this post: > http://www.open-mpi.org/community/lists/users/2016/03/28622.php >
#include <stdio.h> #include <shmem.h> int main(void) { static int bigd[100]; int *ptr; int i; start_pes(0); if (_my_pe() == 0) { /* initialize PE 1’s bigd array */ ptr = shmem_ptr(bigd, 1); if (ptr == NULL) printf("can’t use pointer to directly access PE 1’s array\n"); else 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\n",bigd[i]); printf("\n"); } return 1; }