Added other example
parent
83363cdb49
commit
a5f3ed981f
@ -1,7 +1,10 @@
|
|||||||
MPICC = mpicc #The wrapper for the compiler
|
MPICC = mpicc #The wrapper for the compiler
|
||||||
CFLAGS += -g #Useful for debug symbols
|
CFLAGS += -g #Useful for debug symbols
|
||||||
all: helloworld
|
all: helloworld hamlet
|
||||||
helloworld: helloworld.c
|
helloworld: helloworld.c
|
||||||
$(MPICC) $(CFLAGS) $(LDFLAGS) $? $(LDLIBS) -o $@
|
$(MPICC) $(CFLAGS) $(LDFLAGS) $? $(LDLIBS) -o $@
|
||||||
|
hamlet: hamlet.c
|
||||||
|
$(MPICC) $(CFLAGS) $(LDFLAGS) $? $(LDLIBS) -o $@
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -f helloworld
|
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…
Reference in New Issue