# How to Run MPI-3.0 in shared memory mode like OpenMP

I am parallelizing code to numerically solve a 5 Dimensional population balance model. Currently I have a very good MPICH2 parallelized code in FORTRAN but as we increase parameter values the arrays become too large to run in distributed memory mode.

I have access to a cluster with 15 nodes, where each node has two 8 core CPUs and 128GB of RAM. I want to write run a program with MPI-3.0 in shared memory mode so that each process does not generate its own copy of each array.

Before I can run anything on the cluster I have to test it on a desktop running Ubuntu. It is essentially one blade of the cluster in that it has two 8 core CPUs and 128 GBs of RAM. I will be writing and testing my code on it, so please gear your responses towards running programs on the Ubuntu computer.

I have read that there is a way to run MPI-3.0 in shared memory mode like OpenMP instead of its default distributed memory mode.

Questions:

1. How will I have to alter my code? Do I need to add in calls to other MPI functions like MPI_WIN_ALLOCATE?

2. How do I compile my code to run MPI-3.0 in shared memory mode? Will this be different if it is over several nodes?

Please give sample compilation scripts if you can. I also have only GNU compilers. The cluster I use does not support Intel compilers.

• Yes you should be able to run MPI on a shared memory system. However, the way that it is actually programmed will be identical. Your code should be the same for both shared and distributed memory systems. How it is run is the only difference. Aug 16 '15 at 18:14
• Furthermore, although I have not tested this, I believe that you should be able to run your code using the command mpiexec -n 8 /path/to/application to fake your computer into thinking it has 8 different nodes. Aug 16 '15 at 18:17
• I have already run it on a shared memory system but I want the computing cores to share RAM, like in OpenMP. Some of my arrays are 6 GB so I need all the cores on each node to operate in shared memory mode. Aug 17 '15 at 15:29
• Well this is for a research project. So I need to scale the problem size up. I already have working code so the only thing preventing scale up is the memory needed. I have come across some documents and powerpoints from MPI conferences which suggest MPI-3.0 can share memory with new call funtions that have been added under the one-sided communication catagory. Functions like MPI_WIN_ALLOCATE_SHARE Aug 17 '15 at 16:21
• www.eurompi2014.org/tutorials/hoefler-advanced-mpi-eurompi14.pdf cs.utexas.edu/users/flame/BLISRetreat2014/slides/… Aug 17 '15 at 16:31