MPI_PREFIX = ~tyang_class/local/bin/
make -f Makefile-CSIL run-mv_mult_test_mpi
A valid running result can be:
Test 1: Wall clock time = 0.000035 at Proc 0 of 2 processes
Test 2: Wall clock time = 0.001825 at Proc 0 of 2 processes
Summary: Failed 0 out of 2 tests
Open a terminal before you start. Go to your root directory ($HOME) and type the following commands:
mkdir -p local/src # You can choose another directory.
wget https://download.open-mpi.org/release/open-mpi/v4.1/openmpi-4.1.2.tar.gz
tar xvzf openmpi-4.1.2.tar.gz
cd openmpi-4.1.2/
./configure --prefix=$HOME/local # Also you can choose another prefix.
make all
make install
How to test after installation
ls $HOME/local/bin # You should find 'mpicc' and 'mpirun' here.
cat hello.c # Now let us test our installation.
#include <stdio.h>
#include <mpi.h>
int main(int argc, char** argv) {
  MPI_Init(NULL, NULL);
  int rank;
  int world;
  MPI_Comm_rank(MPI_COMM_WORLD, &rank);
  MPI_Comm_size(MPI_COMM_WORLD, &world);
  printf("Hello: rank %d, world: %d\n",rank, world);
  MPI_Finalize();
}
$HOME/local/bin/mpicc -o hello hello.c
$HOME/local/bin/mpirun -np 2 hello # You can have more than 2 processes, but sometime your laptop may not allow that.
If you use the MPI package installed in the tyang_class account, then you can use ~tyang_class/local/bin/mpicc and ~tyang_class/local/bin/mpirun to compile and run the above hello.c file.
Here is a reference on this subject.
An example to run your code with 8 processes is:
Your path/mpiexec --allow-run-as-root --hostfile hostfile -np 8 prog32_pi_test_mpi
When your code running on a CSIL machine has a bug, the possibility of leaving some active background processes exists, which could overload CSIL machines and affect other users. Please use no more than 8 processes to debug on CSIL (considering the environment is shared), and there is no need to use more than 16 (our grading script will not test it).
Please use "ps -a" to find background/failed MPI processes and "kill -9
Also please note using more processes than the available number of cores is for a functionality debugging
on CSIL machines and you will not get a speedup of 8 with 8 processes when the number of
cores available is 4 or less. For the performance report, please use Expanse.