Added other example

main
Fabio Durastante 10 months ago
parent 83363cdb49
commit a5f3ed981f

@ -1,7 +1,10 @@
MPICC = mpicc #The wrapper for the compiler
CFLAGS += -g #Useful for debug symbols
all: helloworld
all: helloworld hamlet
helloworld: helloworld.c
$(MPICC) $(CFLAGS) $(LDFLAGS) $? $(LDLIBS) -o $@
hamlet: hamlet.c
$(MPICC) $(CFLAGS) $(LDFLAGS) $? $(LDLIBS) -o $@
clean:
rm -f helloworld

@ -0,0 +1,13 @@
#include "mpi.h"
#include <stdio.h>
int main( int argc, char **argv ){
int rank, size;
MPI_Init( &argc, &argv );
MPI_Comm_rank( MPI_COMM_WORLD, &rank );
MPI_Comm_size( MPI_COMM_WORLD, &size );
printf( "Hello world! I'm process %d of %d\n",rank, size );
MPI_Finalize();
return 0;
}
Loading…
Cancel
Save