/* Create nprocs processes. Have them exchange data in a cycle. * Command line execution: * civl verify -inputNPROCS_BOUND=10 -inputN_BOUND=5 ring.cvl */ #include #include #include #define TAG 0 $input int NPROCS_BOUND = 2; // upper bound of the number of mpi processes $input int NPROCS; // number of mpi processes $assume(0 < NPROCS && NPROCS <= NPROCS_BOUND); $input int N_BOUND = 2; // upper bound on number times to loop $input int N; // number of times to loop $assume(0 < N && N <= N_BOUND); _Bool initialized = $false; $gcomm MPI_COMM_WORLD; // the default MPI communicator void MPI_Process (int rank) { int left = (rank+NPROCS-1)%NPROCS; int right = (rank+NPROCS+1)%NPROCS; int i=0; int x=rank, y; // send a message from x, recv into y, for checking $message in, out; $comm myComm; //test variables int comm_size; int comm_place; _Bool hasMessage; $message matchedMessage; $when (initialized); myComm = $comm_create($here, MPI_COMM_WORLD, rank); while (i