README
If we try to compile with gcc
, we get
gcc hwp.c -o hwp
mpi/hwp.c:1:10: fatal error: mpi.h: No such file or directory
#include "mpi.h"
^~~~~~~
compilation terminated.
However, we can compile with mpicc
mpicc hwp.c -o hwp
Simply running the executable will run the serial program.
./hwp
Hello from rank 0 / 1
But when with mpirun
, we can set the number of processes.
mpirun -np 3 ./hwp
Hello from rank 0 / 3
Hello from rank 1 / 3
Hello from rank 2 / 3