1
1
openmpi/examples/oshmem_circular_shift.c
Igor Ivanov 07e79441b3 oshmem: Align OSHMEM API with spec v1.2 (change examples)
ring_oshmem_c.c and hello_oshmem_c.c support new api
other examples support legacy api but warning message
is provided during compilation
2015-11-24 18:58:28 +02:00

37 строки
693 B
C

/*
* Copyright (c) 2014 Mellanox Technologies, Inc.
* All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
#include <stdio.h>
#include <shmem.h>
#warning This application uses deprecated API see http://www.open-mpi.org/
int main (void)
{
static int aaa, bbb;
int num_pes, my_pe, peer;
start_pes(0);
num_pes = _num_pes();
my_pe = _my_pe();
peer = (my_pe + 1) % num_pes;
printf("Process %d gets message from %d (%d processes in ring)\n", my_pe, peer, num_pes);
shmem_int_get(&aaa, &bbb, 1, peer);
shmem_barrier_all();
printf("Process %d exiting\n", my_pe);
return 0;
}