diff --git a/Makefile b/Makefile index 00300bc1a4dfd782f4e2ef3263f5dc542c630d4f..68519fe9175161a6581c3f8046f83f8f1ebbb581 100644 --- a/Makefile +++ b/Makefile @@ -52,6 +52,7 @@ plugin: test: mkdir -p $(TESTD) mkdir -p $(DOTD) + $(MAKE) $(TESTD)/test $(MAKE) $(TESTD)/test2 $(MAKE) $(TESTD)/test3 diff --git a/src/test/test.c b/src/test/test.c new file mode 100644 index 0000000000000000000000000000000000000000..c4be068f00b67b6ae241adf745700803b26f48c3 --- /dev/null +++ b/src/test/test.c @@ -0,0 +1,41 @@ +#include <stdio.h> +#include <stdlib.h> + +#include <mpi.h> + +void mpi_call(int c) +{ + MPI_Barrier(MPI_COMM_WORLD); + + if(c<10) + { + printf("je suis dans le if (c=%d)\n", c); + } + else + { + printf("je suis dans le else (c=%d)\n", c); + } +} + + +int main(int argc, char * argv[]) +{ + MPI_Init(&argc, &argv); + + int i; + int a = 2; + int b = 3; + int c=0; + + for(i=0; i<10; i++) + { + + mpi_call(c); + c+= (a+b); + } + + printf("c=%d\n", c); + + MPI_Finalize(); + return 1; +}