source: CIVL/examples/contracts/contractsMPI/mpiValid.c@ d1cfebe

1.23 2.0 main test-branch
Last change on this file since d1cfebe was 452331f, checked in by Ziqing Luo <ziqing@…>, 10 years ago

add more examples

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

  • Property mode set to 100644
File size: 457 bytes
Line 
1#include <mpi.h>
2#include <civl-mpi.cvh>
3
4
5#define
6
7int main() {
8 MPI_Init(NULL, NULL);
9
10 MPI_Datatype datatype;
11 void * buf = NULL;
12 double * dbuf;
13
14 $havoc(&datatype);
15 $assume(datatype == MPI_DOUBLE || datatype == MPI_INT || datatype == MPI_CHAR || datatype == MPI_2INT);
16 buf = $mpi_valid(2, datatype);
17 if (datatype == MPI_DOUBLE) {
18 dbuf = (double *)buf;
19 dbuf[0] = 2.0;
20 $assert(dbuf[0] > 0);
21 }
22 $free(buf);
23 MPI_Finalize();
24}
Note: See TracBrowser for help on using the repository browser.