# MPI Problem

**URL:** <https://openmc.discourse.group/t/mpi-problem/37>\
**Category:** User Support\
**Created:** [July 15, 2013, 11:28am UTC](https://openmc.discourse.group/t/mpi-problem/37 "2013-07-15T11:28:15Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kyungkwan\_Noh](https://avatars.discourse-cdn.com/v4/letter/k/48db29/32.png) [@Kyungkwan\_Noh](https://openmc.discourse.group/u/Kyungkwan_Noh)\
**Post date:** [July 15, 2013, 11:28am UTC](https://openmc.discourse.group/t/mpi-problem/37/1 "2013-07-15T11:28:15Z")

</div>

Hi, I have weird problem running mpi.

When I use main computer only, mpi works perfectly.  
However, when using two or more nodes, it works independently. I’m not sure what the problem is.

Thank you.

---

<div class="post-metadata">

**Author:** ![Kyungkwan\_Noh](https://avatars.discourse-cdn.com/v4/letter/k/48db29/32.png) [@Kyungkwan\_Noh](https://openmc.discourse.group/u/Kyungkwan_Noh)\
**Post date:** [July 15, 2013, 11:43am UTC](https://openmc.discourse.group/t/mpi-problem/37/2 "2013-07-15T11:43:10Z")

</div>

I’m using OpenMPI 1.6.4 (2013 version), by the way.

2013년 7월 15일 월요일 오후 8시 28분 15초 UTC+9, Kyungkwan Noh 님의 말:

---

<div class="post-metadata">

**Author:** ![paulromano](https://yyz2.discourse-cdn.com/free1/user_avatar/openmc.discourse.group/paulromano/32/486_2.png) [@paulromano](https://openmc.discourse.group/u/paulromano)\
**Post date:** [July 15, 2013, 11:37pm UTC](https://openmc.discourse.group/t/mpi-problem/37/3 "2013-07-15T23:37:35Z")

</div>

Let’s say your MPI is installed in /opt/openmpi/1.6. You would need to do the following to get it to compile and run correctly:

1. Change the MPI variable in the Makefile to yes
2. Change the MPI\_DIR variable in the Makefile to /opt/openmpi/1.6
3. Execute ‘make’ to compile
4. To run, execute ‘/opt/openmpi/1.6/bin/mpiexec -n _NPROCS_ openmc’ where NPROCS is the number of processors you want

If you have problems compiling, try running ‘make distclean’ and then re-compiling. If you get the following error when compiling:

…/xml-fortran/xmlreader: error while loading shared libraries: libmpi\_f90.so.1: cannot open shared object file: No such file or directory

Then add /opt/openmpi/1.6/lib to the LD\_LIBRARY\_PATH environment variable.

Best regards,  
Paul

---

<div class="post-metadata">

**Author:** ![smharper](https://avatars.discourse-cdn.com/v4/letter/s/f475e1/32.png) [@smharper](https://openmc.discourse.group/u/smharper)\
**Post date:** [July 16, 2013, 2:13am UTC](https://openmc.discourse.group/t/mpi-problem/37/4 "2013-07-16T02:13:34Z")

</div>

FYI, I have had the same problem with OpenMPI. I had to switch to MPICH. If you like, I can try to recreate the problem, and give you more details.

---

<div class="post-metadata">

**Author:** ![paulromano](https://yyz2.discourse-cdn.com/free1/user_avatar/openmc.discourse.group/paulromano/32/486_2.png) [@paulromano](https://openmc.discourse.group/u/paulromano)\
**Post date:** [July 16, 2013, 2:23am UTC](https://openmc.discourse.group/t/mpi-problem/37/5 "2013-07-16T02:23:55Z")

</div>

It should work fine if everything is set up properly. I just confirmed that I am able to compile/run successfully using OpenMPI on my own machine. Typically you will see the multiple processes running independently if you are using the wrong mpiexec/mpirun executable. A few more questions to narrow this down (for either of you):

- What OS are you on?
- Did you install OpenMPI from source, or through a package manager? (or a binary if on Windows?)
- If you installed from source, what compiler did you use to compile OpenMPI?
- If you installed from source, what did you put for --with-mpi-f90-size?
- What version (or commit) of OpenMC are you trying to compile/run?

---

<div class="post-metadata">

**Author:** ![Kyungkwan\_Noh](https://avatars.discourse-cdn.com/v4/letter/k/48db29/32.png) [@Kyungkwan\_Noh](https://openmc.discourse.group/u/Kyungkwan_Noh)\
**Post date:** [July 17, 2013, 8:26am UTC](https://openmc.discourse.group/t/mpi-problem/37/6 "2013-07-17T08:26:47Z")

</div>

1. I’m using Linux Red hat
2. I guess from source.
3. I used intel 13.1.1
4. I put small for --with-mpi-f90-size
5. I think the newest version since I installed through git.

Well, if I use the command ‘/opt/openmpi/1.6/bin/mpiexec -n _NPROCS_ openmc’, it operates only on main computer, not on different nodes.  
So, I try to use mpiexec -hostfile [hostfile name] openmc.  
The host file may look like this:  
node01 slots=8  
node02 slots=8

I guess my settings are right, but it still doesn’t work.

Thank you.

2013년 7월 15일 월요일 오후 8시 28분 15초 UTC+9, Kyungkwan Noh 님의 말:
