I have access to a cluster running Torque, but installing the MATLAB Distributed Computing Engine is not an option. I am wondering if it is possible to use the MPI commands in MATLAB without the extra features like distributed arrays. Is it possible to use the MATLAB lab* commands in conjunction with the mpirun commands if you don’t have the Distributed Computing Engine?
I have access to a cluster running Torque, but installing the MATLAB Distributed Computing
Share
If your MPI implmentation is Open MPI you can use the Poor Man’s Parallel Toolbox ™ which allows you to run many MATLAB instances in parallel on many nodes and have each of them do something different, e.g. run a different script. The key to success lies in the fact that Open MPI exports the rank of current process in the environment variable
OMPI_COMM_WORLD_RANKand a simple shell script can be used to wrap around the execution. Here is a sample:One would launch this as:
This will launch 24 copies of MATLAB, each receiving input from different scripts. The first one would get commands from
script001.m, the second one fromscript002.m, and so on.Of course, you can always write your parallel code in C or C++, or even Fortran, and use MPI there. Then compile the code into a shared library, loadable and callable from MATLAB.