#include /* Create NPROCS processes. Have them exchange data in a cycle. * Command line verification example: * civl verify -inputNPROCS_BOUND=10 -inputN_BOUND=5 ring.cvl */ #include #define TAG 0 $input int NPROCS_BOUND = 10; // upper bound of the number of MPI processes $input int NPROCS; // number of MPI processes $assume(0 < NPROCS && NPROCS <= NPROCS_BOUND); $assume(NPROCS >= 2); $input int N_BOUND = 5; // upper bound on number times to loop $input int N; // number of times to loop $assume(0 < N && N <= N_BOUND); $gcomm GCOMM_WORLD = $gcomm_create($here, NPROCS); // global comm object void MPI_Process (int rank) { $comm comm = $comm_create($here, GCOMM_WORLD, rank); int left = (rank+NPROCS-1)%NPROCS; int right = (rank+NPROCS+1)%NPROCS; int x=rank, y; // send a message from x, recv into y $message in, out; for (int i=0; i