From c049fb3ec1865c367521e960259e7b47325ac02b Mon Sep 17 00:00:00 2001 From: Fabio Durastante Date: Sun, 14 Apr 2024 22:19:58 +0200 Subject: [PATCH] My first MPI code --- Makefile | 7 +++++++ helloworld.c | 10 ++++++++++ 2 files changed, 17 insertions(+) create mode 100644 Makefile create mode 100644 helloworld.c diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..2b69e95 --- /dev/null +++ b/Makefile @@ -0,0 +1,7 @@ +MPICC = mpicc #The wrapper for the compiler +CFLAGS += -g #Useful for debug symbols +all: helloworld +helloworld: helloworld.c + $(MPICC) $(CFLAGS) $(LDFLAGS) $? $(LDLIBS) -o $@ +clean: + rm -f helloworld diff --git a/helloworld.c b/helloworld.c new file mode 100644 index 0000000..dc7fdcd --- /dev/null +++ b/helloworld.c @@ -0,0 +1,10 @@ +#include"mpi.h" +#include + +int main(int argc, +char **argv){ + MPI_Init( &argc, &argv); + printf("Hello, world!\n"); + MPI_Finalize(); + return 0; +}