The MPI trapezoid rule program is in the MPI program zip file found on at Message Passing using MPI. Download from the MPI_examples link to get the program files. Be sure to read the description of this program on this website. You will use other files from this set later.
When the instructions say to run the program and record the results, you need to record the average of at least 3 runs. Sometimes a spike in network traffic or CPU load can make one run last longer than it might otherwise. For this reason, always run the same command at least 3 times and record the average of the runs. NOTE: If one run is an outlier (say, 3 times larger or smaller than the others), don't include it in the average. Throw the result out and run again.
maketo build the program
mpirun, run the program on one process, with a million trapezoids. Record the result in a file. For example:
mpiexec -n 1 ./mpi_trap 1000000
-f host_fileoption. Make sure you have an appropriate host_file in the directory with your executable program.
host_filefirst to add a 4th computer to the list. Then, modify it before the 8 and 16 process runs to select the number of cores on each machine (see below). This ensures the proper number of cores are being used per host. Record these results as well.
As we may have discussed in lecture, the entries in
host_file can include the number of cores to use. Simply add
:4 after each name.