begin model simpleMPI
| begin input variables
| | MPIX_COMM_RECORD_NULL : Record[MPIX_Comm_Record; id:int];
| | | libmpi.c 74.13--75.53: "inputMPIX_Comm_Record MPIX_COMM_RECORD_NULL = { .id = 0 };"
| | MPI_REQUEST_NULL : pointer(0)<Record[MPIX_Comm_Record; id:int]>;
| | | libmpi.c 76.13--77.60: "inputMPIX_Comm_Record* MPI_REQUEST_NULL = &MPIX_COMM_RECORD_NULL;"
| | MPIX_STATUS_NULL : Record[MPI_Status; MPI_SOURCE:int, MPI_TAG:int, SIZE:int];
| | | libmpi.c 80.13--81.72: "inputMPI_Status MPIX_STATUS_NULL = { .MPI_SOURCE=-1, .MPI_TAG=-1, .SIZE=-1 };"
| | MPI_STATUS_IGNORE : pointer(1)<Record[MPI_Status; MPI_SOURCE:int, MPI_TAG:int, SIZE:int]>;
| | | libmpi.c 82.13--83.50: "inputMPI_Status *MPI_STATUS_IGNORE = &MPIX_STATUS_NULL;"
| | argc : int;
| | | simpleMPI.c 3.13--4.9: "input {argc > 0}int argc;"
| end input variables;
| begin output variables
| end output variables;
| begin process 0
| | main function : main;
| | begin process variables
| | | MPIX_State : int;
| | | | libmpi.c 88.0--88.15: "int MPIX_State;"
| | | argv : pointer(3)<pointer(2)<char>>;
| | | | simpleMPI.c 5.0--5.12: "char **argv;"
| | | nprocs : int;
| | | | simpleMPI.c 6.0--6.11: "int nprocs;"
| | | myrank : int;
| | | | simpleMPI.c 7.0--7.11: "int myrank;"
| | end process variables;
| | begin function main
| | | | simpleMPI.c 9.0--9.11: "void main()"
| | | begin proper local variables
| | | | buf : real;
| | | | | simpleMPI.c 10.2--10.13: "double buf;"
| | | end proper local variables;
| | | start location : 0;
| | | begin location 0
| | | | kind : INVOCATION;
| | | | MPI_Init(&argc,&argv); goto location 1;
| | | | | simpleMPI.c 12.2--12.25: "MPI_Init(&argc, &argv);"
| | | end location 0;
| | | begin location 1
| | | | kind : INVOCATION;
| | | | MPI_Comm_rank(MPI_COMM_WORLD,&myrank); goto location 2;
| | | | | simpleMPI.c 13.2--13.41: "MPI_Comm_rank(MPI_COMM_WORLD, &myrank);"
| | | end location 1;
| | | begin location 2
| | | | kind : CHOICE;
| | | | when myrank==0 goto location 3;
| | | | | simpleMPI.c 14.2--14.17: "if(myrank == 0)"
| | | | when !(myrank==0) goto location 5;
| | | | | simpleMPI.c 14.2--14.17: "if(myrank == 0)"
| | | end location 2;
| | | begin location 3
| | | | kind : ASSIGNMENT;
| | | | buf = 1; goto location 4;
| | | | | simpleMPI.c 15.4--15.14: "buf = 1.0;"
| | | end location 3;
| | | begin location 4
| | | | kind : INVOCATION;
| | | | MPI_Send(&buf,1,MPI_DOUBLE,1,0,MPI_COMM_WORLD); goto location 6;
| | | | | simpleMPI.c 16.4--16.56: "MPI_Send(&buf, 1, MPI_DOUBLE, 1, 0, MPI_COMM_WORLD);"
| | | end location 4;
| | | begin location 5
| | | | kind : INVOCATION;
| | | | MPI_Recv(&buf,1,MPI_DOUBLE,0,0,MPI_COMM_WORLD,MPI_STATUS_IGNORE); goto location 6;
| | | | | simpleMPI.c 18.4--18.75: "MPI_Recv(&buf, 1, MPI_DOUBLE, 0, 0, MPI_COMM_WORLD, MPI_STATUS_IGNORE);"
| | | end location 5;
| | | begin location 6
| | | | kind : INVOCATION;
| | | | MPI_Finalize(); goto location 7;
| | | | | simpleMPI.c 20.2--20.17: "MPI_Finalize();"
| | | end location 6;
| | | begin location 7
| | | | kind : RETURN;
| | | | return null; goto location 8;
| | | | | simpleMPI.c 21.0--21.0: ""
| | | end location 7;
| | | begin location 8
| | | | kind : TERMINAL;
| | | end location 8;
| | end function main;
| | begin function MPI_Init
| | | | libmpi.c 95.0--95.37: "int MPI_Init(int *argc, char ***argv)"
| | | begin formal parameters
| | | | argc : pointer(4)<int>;
| | | | | libmpi.c 95.13--95.22: "int *argc"
| | | | argv : pointer(5)<pointer(3)<pointer(2)<char>>>;
| | | | | libmpi.c 95.24--95.36: "char ***argv"
| | | end formal parameters;
| | | start location : 0;
| | | begin location 0
| | | | kind : RETURN;
| | | | return 0; goto location 1;
| | | | | null
| | | end location 0;
| | | begin location 1
| | | | kind : TERMINAL;
| | | end location 1;
| | end function MPI_Init;
| | begin function MPI_Comm_rank
| | | | libmpi.c 101.0--101.43: "int MPI_Comm_rank(MPI_Comm comm, int *rank)"
| | | begin formal parameters
| | | | comm : int;
| | | | | libmpi.c 101.18--101.31: "MPI_Comm comm"
| | | | rank : pointer(4)<int>;
| | | | | libmpi.c 101.33--101.42: "int *rank"
| | | end formal parameters;
| | | start location : 0;
| | | begin location 0
| | | | kind : ASSERTION;
| | | | assert comm==MPI_COMM_WORLD; goto location 1;
| | | | | libmpi.c 103.15--103.45: "assert comm == MPI_COMM_WORLD;"
| | | end location 0;
| | | begin location 1
| | | | kind : ASSIGNMENT;
| | | | *rank = 0; goto location 2;
| | | | | libmpi.c 104.2--104.14: "*rank = PID;"
| | | end location 1;
| | | begin location 2
| | | | kind : TERMINAL;
| | | end location 2;
| | end function MPI_Comm_rank;
| | begin function MPI_Send
| | | | libmpi.c 125.0--126.27: "int MPI_Send(void* buf, int count, MPI_Datatype datatype, int dest, int tag,             MPI_Comm comm)"
| | | begin formal parameters
| | | | buf : pointer(6)<void>;
| | | | | libmpi.c 125.13--125.22: "void* buf"
| | | | count : int;
| | | | | libmpi.c 125.24--125.33: "int count"
| | | | datatype : int;
| | | | | libmpi.c 125.35--125.56: "MPI_Datatype datatype"
| | | | dest : int;
| | | | | libmpi.c 125.58--125.66: "int dest"
| | | | tag : int;
| | | | | libmpi.c 125.68--125.75: "int tag"
| | | | comm : int;
| | | | | libmpi.c 126.13--126.26: "MPI_Comm comm"
| | | end formal parameters;
| | | begin proper local variables
| | | | result : int;
| | | | | libmpi.c 127.2--127.13: "int result;"
| | | end proper local variables;
| | | start location : 0;
| | | begin location 0
| | | | kind : ASSERTION;
| | | | assert comm==MPI_COMM_WORLD; goto location 1;
| | | | | libmpi.c 129.15--129.45: "assert comm == MPI_COMM_WORLD;"
| | | end location 0;
| | | begin location 1
| | | | kind : CHOICE;
| | | | when datatype==MPI_DOUBLE goto location 2;
| | | | | libmpi.c 130.2--130.29: "if (datatype == MPI_DOUBLE)"
| | | | when !(datatype==MPI_DOUBLE) goto location 3;
| | | | | libmpi.c 130.2--130.29: "if (datatype == MPI_DOUBLE)"
| | | end location 1;
| | | begin location 2
| | | | kind : INVOCATION;
| | | | result = MPIX_Send_double((pointer(7)<real>)buf,count,dest,tag,comm); goto location 4;
| | | | | libmpi.c 131.4--131.68: "result = MPIX_Send_double((double*)buf, count, dest, tag, comm);"
| | | end location 2;
| | | begin location 3
| | | | kind : ASSERTION;
| | | | assert false; goto location 4;
| | | | | libmpi.c 133.17--133.30: "assert false;"
| | | end location 3;
| | | begin location 4
| | | | kind : RETURN;
| | | | return result; goto location 5;
| | | | | libmpi.c 134.2--134.16: "return result;"
| | | end location 4;
| | | begin location 5
| | | | kind : TERMINAL;
| | | end location 5;
| | end function MPI_Send;
| | begin function MPIX_Send_double
| | | | libmpi.c 137.0--137.78: "int MPIX_Send_double(double* buf, int count, int dest, int tag, MPI_Comm comm)"
| | | begin formal parameters
| | | | buf : pointer(7)<real>;
| | | | | libmpi.c 137.21--137.32: "double* buf"
| | | | count : int;
| | | | | libmpi.c 137.34--137.43: "int count"
| | | | dest : int;
| | | | | libmpi.c 137.45--137.53: "int dest"
| | | | tag : int;
| | | | | libmpi.c 137.55--137.62: "int tag"
| | | | comm : int;
| | | | | libmpi.c 137.64--137.77: "MPI_Comm comm"
| | | end formal parameters;
| | | begin proper local variables
| | | | tmp : real[count];
| | | | | libmpi.c 138.2--138.20: "double tmp[count];"
| | | | i : int;
| | | | | libmpi.c 139.2--139.8: "int i;"
| | | end proper local variables;
| | | start location : 0;
| | | begin location 0
| | | | kind : ASSIGNMENT;
| | | | i = 0; goto location 1;
| | | | | libmpi.c 141.7--141.10: "i=0"
| | | end location 0;
| | | begin location 1
| | | | kind : CHOICE;
| | | | when i < count goto location 2;
| | | | | libmpi.c 141.2--141.25: "for (i=0; i<count; i++)"
| | | | when !i < count goto location 4;
| | | | | libmpi.c 141.2--141.25: "for (i=0; i<count; i++)"
| | | end location 1;
| | | begin location 2
| | | | kind : ASSIGNMENT;
| | | | tmp[i] = *(buf+i); goto location 3;
| | | | | libmpi.c 141.26--141.42: "tmp[i] = buf[i];"
| | | end location 2;
| | | begin location 3
| | | | kind : ASSIGNMENT;
| | | | i = i+1; goto location 1;
| | | | | libmpi.c 141.21--141.24: "i++"
| | | end location 3;
| | | begin location 4
| | | | kind : SEND;
| | | | send(buf,dest,tag); goto location 5;
| | | | | libmpi.c 142.2--142.23: "send(buf, dest, tag);"
| | | end location 4;
| | | begin location 5
| | | | kind : RETURN;
| | | | return 0; goto location 6;
| | | | | libmpi.c 143.2--143.11: "return 0;"
| | | end location 5;
| | | begin location 6
| | | | kind : TERMINAL;
| | | end location 6;
| | end function MPIX_Send_double;
| | begin function MPI_Recv
| | | | libmpi.c 147.0--148.47: "int MPI_Recv(void* buf, int count, MPI_Datatype datatype, int source, int tag,             MPI_Comm comm, MPI_Status *status)"
| | | begin formal parameters
| | | | buf : pointer(6)<void>;
| | | | | libmpi.c 147.13--147.22: "void* buf"
| | | | count : int;
| | | | | libmpi.c 147.24--147.33: "int count"
| | | | datatype : int;
| | | | | libmpi.c 147.35--147.56: "MPI_Datatype datatype"
| | | | source : int;
| | | | | libmpi.c 147.58--147.68: "int source"
| | | | tag : int;
| | | | | libmpi.c 147.70--147.77: "int tag"
| | | | comm : int;
| | | | | libmpi.c 148.13--148.26: "MPI_Comm comm"
| | | | status : pointer(1)<Record[MPI_Status; MPI_SOURCE:int, MPI_TAG:int, SIZE:int]>;
| | | | | libmpi.c 148.28--148.46: "MPI_Status *status"
| | | end formal parameters;
| | | begin proper local variables
| | | | result : int;
| | | | | libmpi.c 149.2--149.13: "int result;"
| | | end proper local variables;
| | | start location : 0;
| | | begin location 0
| | | | kind : ASSERTION;
| | | | assert comm==MPI_COMM_WORLD; goto location 1;
| | | | | libmpi.c 151.15--151.45: "assert comm == MPI_COMM_WORLD;"
| | | end location 0;
| | | begin location 1
| | | | kind : CHOICE;
| | | | when datatype==MPI_DOUBLE goto location 2;
| | | | | libmpi.c 152.2--152.29: "if (datatype == MPI_DOUBLE)"
| | | | when !(datatype==MPI_DOUBLE) goto location 3;
| | | | | libmpi.c 152.2--152.29: "if (datatype == MPI_DOUBLE)"
| | | end location 1;
| | | begin location 2
| | | | kind : INVOCATION;
| | | | result = MPIX_Recv_double((pointer(7)<real>)buf,count,source,tag,comm); goto location 4;
| | | | | libmpi.c 153.4--153.70: "result = MPIX_Recv_double((double*)buf, count, source, tag, comm);"
| | | end location 2;
| | | begin location 3
| | | | kind : ASSERTION;
| | | | assert false; goto location 4;
| | | | | libmpi.c 155.17--155.30: "assert false;"
| | | end location 3;
| | | begin location 4
| | | | kind : RETURN;
| | | | return result; goto location 5;
| | | | | libmpi.c 156.2--156.16: "return result;"
| | | end location 4;
| | | begin location 5
| | | | kind : TERMINAL;
| | | end location 5;
| | end function MPI_Recv;
| | begin function MPIX_Recv_double
| | | | libmpi.c 159.0--159.80: "int MPIX_Recv_double(double *buf, int count, int source, int tag, MPI_Comm comm)"
| | | begin formal parameters
| | | | buf : pointer(7)<real>;
| | | | | libmpi.c 159.21--159.32: "double *buf"
| | | | count : int;
| | | | | libmpi.c 159.34--159.43: "int count"
| | | | source : int;
| | | | | libmpi.c 159.45--159.55: "int source"
| | | | tag : int;
| | | | | libmpi.c 159.57--159.64: "int tag"
| | | | comm : int;
| | | | | libmpi.c 159.66--159.79: "MPI_Comm comm"
| | | end formal parameters;
| | | begin proper local variables
| | | | tmp : real[count];
| | | | | libmpi.c 160.2--160.20: "double tmp[count];"
| | | | i : int;
| | | | | libmpi.c 161.2--161.8: "int i;"
| | | end proper local variables;
| | | start location : 0;
| | | begin location 0
| | | | kind : RECEIVE;
| | | | recv(tmp,source,tag); goto location 1;
| | | | | libmpi.c 163.2--163.25: "recv(tmp, source, tag);"
| | | end location 0;
| | | begin location 1
| | | | kind : ASSIGNMENT;
| | | | i = 0; goto location 2;
| | | | | libmpi.c 164.7--164.10: "i=0"
| | | end location 1;
| | | begin location 2
| | | | kind : CHOICE;
| | | | when i < count goto location 3;
| | | | | libmpi.c 164.2--164.25: "for (i=0; i<count; i++)"
| | | | when !i < count goto location 5;
| | | | | libmpi.c 164.2--164.25: "for (i=0; i<count; i++)"
| | | end location 2;
| | | begin location 3
| | | | kind : ASSIGNMENT;
| | | | *(buf+i) = tmp[i]; goto location 4;
| | | | | libmpi.c 164.26--164.42: "buf[i] = tmp[i];"
| | | end location 3;
| | | begin location 4
| | | | kind : ASSIGNMENT;
| | | | i = i+1; goto location 2;
| | | | | libmpi.c 164.21--164.24: "i++"
| | | end location 4;
| | | begin location 5
| | | | kind : RETURN;
| | | | return 0; goto location 6;
| | | | | libmpi.c 165.2--165.11: "return 0;"
| | | end location 5;
| | | begin location 6
| | | | kind : TERMINAL;
| | | end location 6;
| | end function MPIX_Recv_double;
| | begin function MPI_Finalize
| | | | libmpi.c 98.0--98.18: "int MPI_Finalize()"
| | | start location : 0;
| | | begin location 0
| | | | kind : RETURN;
| | | | return 0; goto location 1;
| | | | | null
| | | end location 0;
| | | begin location 1
| | | | kind : TERMINAL;
| | | end location 1;
| | end function MPI_Finalize;
| end process 0;
end model simpleMPI.
