From 8404639a2b4d92776e9e00b9b1e943c62620b797 Mon Sep 17 00:00:00 2001 From: "nicolas.marie" <nicolas.marie@ensiie.eu> Date: Tue, 10 Oct 2023 16:18:58 +0200 Subject: [PATCH] add test1 --- Makefile | 1 + src/test/test.c | 41 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+) create mode 100644 src/test/test.c diff --git a/Makefile b/Makefile index 00300bc..68519fe 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 0000000..c4be068 --- /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; +} -- GitLab