Sophie

Sophie

distrib > Mageia > 7 > armv7hl > media > core-updates > by-pkgid > c40f6e5d921a213f89e1493bacd7e337 > files > 121

libopenmpi-devel-4.0.1-1.1.mga7.armv7hl.rpm

/*
 * Copyright (c) 2014-2016 Mellanox Technologies, Inc.
 *                         All rights reserved.
 * $COPYRIGHT$
 *
 * Additional copyrights may follow
 *
 * $HEADER$
 */

#include <stdio.h>
#include <shmem.h>

int main (void)
{
    static int aaa, bbb;
    int num_pes, my_pe, peer;

    shmem_init();

    num_pes = shmem_n_pes();
    my_pe = shmem_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);
    shmem_finalize();

    return 0;
}