Distributed Matrix Multiplication
I wrote matrix.cpp to play with MPI and write a program that did something. It multiplies by an n x n matrix by a vector (length n). n is, nonsensically, determined by the number of nodes. Each node originally has a single column of the matrix. To do the operation, each node should have a row. We ship pieces of the column to the appopriate nodes and carry out the multiplication. We then assemble and print the results on node 0.
It can be compiled with
mpCC_r -cpp toy.cpp
and ran with
env MP_LABELIO=yes bsub -I -q debug -W 0:05 -n 8 -P $PROJECT "mpirun.lsf ./a.out"
where $PROJECT is the project to run the job under. You can toggle the -n option to run on more or less processors (and multiply bigger or smaller matrices).
Memory Transfer--Simulation of VDC Creation
To create a more "real-world" scenario, I wrote mem_xfer.cpp. It creates a 128 x 128 x 128 set of data distributed approximately equally between n processors. It then ships the data as required to do a transform on the data. I stopped before moving the data out of the receive buffer, and am reworking the code to do it more intelligently (using some classes, etc.). As it is now, the data sending and receiving only works on 8 processors (so that each processor gets a single superblock). It compiles and rusn similarly to matrix.cpp above.
NetCDF4.0 Parallel Write Test
I ran a simple parallel write test, found here. I removed the line
#include "hdf5.h"
since it shouldn't be needed (and I didn't have it in the directory, anyway). To compile, I ran
mpCC_r -I/ptmp/ddvento/netCDF/include -L/ptmp/ddvento/netCDF/lib -lnetcdf -L/ptmp/ddvento/HDF5/lib -lhdf5_hl -lhdf5 -lz -cpp ncdf_test.cpp
and to run, I ran
env MP_LABELIO=yes bsub -I -q debug -W 0:05 -n 4 -P $PROJECT "mpirun.lsf ./a.out"
where $PROJECT is the project to run the job under. Davide had placed the netCDF/HDF5 libraries and includes in the directories specified above. I read somewhere that the order of -lnetcdf, -lhdf5_hl, etc. was important, but I didn't experiment with it. The parallel write generates a netCDF file, I assume, in parallel.