An example using mpich in a cluster (updated 10.2016)
Here is a C program that shows an example of setting up a different task for each processor core in a cluster of computers. It's very simple but shows the minimum needed to be useful. /* domath.c - test of mpich on multi-processor system k theis 3/31/2016 to run: mpicc -o domath domath.c -lm mv domath /mnt/nfs/dist/domath cd /mnt/nfs/dist/ mpiexec -n 6 -f machinefile ./domath make sure machinefile exists in /mnt/nfs/dist */ #include <stdio.h> #include <stdlib.h> #include <math.h> #include <mpi.h> #define PI 3.141592654 int do_sin(void){ double n, res; FILE *sout; int err; sout = fopen("sin.txt","w"); if (sout == NULL) return 1; fprintf(sout,"Sin Table\n\n"); err = system("/bin/uname -a > sin_s.txt"); // show machine this is on n = 0.0; while (n <= PI/2.0){ ...