root/examples/oshmem_circular_shift.c

/* [<][>][^][v][top][bottom][index][help] */

DEFINITIONS

This source file includes following definitions.
  1. main

   1 /*
   2  * Copyright (c) 2014-2016 Mellanox Technologies, Inc.
   3  *                         All rights reserved.
   4  * $COPYRIGHT$
   5  *
   6  * Additional copyrights may follow
   7  *
   8  * $HEADER$
   9  */
  10 
  11 #include <stdio.h>
  12 #include <shmem.h>
  13 
  14 int main (void)
  15 {
  16     static int aaa, bbb;
  17     int num_pes, my_pe, peer;
  18 
  19     shmem_init();
  20 
  21     num_pes = shmem_n_pes();
  22     my_pe = shmem_my_pe();
  23 
  24     peer = (my_pe + 1) % num_pes;
  25 
  26     printf("Process %d gets message from %d (%d processes in ring)\n", my_pe, peer, num_pes);
  27     shmem_int_get(&aaa, &bbb, 1, peer);
  28 
  29     shmem_barrier_all();
  30     printf("Process %d exiting\n", my_pe);
  31     shmem_finalize();
  32 
  33     return 0;
  34 }
  35 

/* [<][>][^][v][top][bottom][index][help] */