source: CIVL/examples/contracts/contractsMPI/simpleMpiAgree.c@ 63e3b2e

1.23 2.0 acw/focus-triggers main test-branch
Last change on this file since 63e3b2e was 7bbef04, checked in by Ziqing Luo <ziqing@…>, 10 years ago

add implementation for mpi contract expressions
add implementation for $comm_empty_in/out
get rid of old contracts implementation code
add new examples

git-svn-id: svn://vsl.cis.udel.edu/civl/trunk@3512 fb995dde-84ed-4084-dfe6-e5aef3e2452c

  • Property mode set to 100644
File size: 351 bytes
Line 
1#include<mpi.h>
2#include<assert.h>
3
4
5#define comm MPI_COMM_WORLD
6
7/*@ requires \valid(x);
8 @ \mpi_collective(comm, P2P):
9 @ ensures \mpi_agree(*x);
10 @*/
11int bcast(int * x) {
12 return 0;
13}
14
15
16/*@
17 @ \mpi_collective(comm, P2P):
18 @ ensures \mpi_agree(\result);
19 @*/
20int target() {
21 int rank;
22
23 $havoc(&rank);
24 bcast(&rank);
25 return rank;
26}
Note: See TracBrowser for help on using the repository browser.