# OpenMPI support

**URL:** <https://openmc.discourse.group/t/openmpi-support/128>\
**Category:** User Support\
**Created:** [February 8, 2015, 7:02pm UTC](https://openmc.discourse.group/t/openmpi-support/128 "2015-02-08T19:02:41Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![John\_Xia](https://avatars.discourse-cdn.com/v4/letter/j/4bbf92/32.png) [@John\_Xia](https://openmc.discourse.group/u/John_Xia)\
**Post date:** [February 8, 2015, 7:02pm UTC](https://openmc.discourse.group/t/openmpi-support/128/1 "2015-02-08T19:02:41Z")

</div>

Hi folks,

I’d like to run OpenMC with multiple threads, so I built OpenMC with MPI support like so:

cd src

mkdir build

cd build

FC=mpif90 cmake -DCMAKE\_INSTALL\_PREFIX=$HOME/.virtualenv/cnerg …

make install

It all builds and installs without complaint. But when I try to run

openmc -s 3

It warns me about ignoring the number of threads passed in on the command line, and says it’s running one MPI process. If I set the environment variable OMP\_NUM\_THREADS to 3, it doesn’t give any warnings but also only runs one MPI process. There is no threads element in settings.xml.

What do I need to do next?

John

Appendix - I’m on the develop branch. Here’s the relevant part of stdout:

Version: 0.6.1  
Git SHA1: fa775430133cc9915b2c3431cf96aec2d6e57c6f  
Date/Time: 2015-02-08 12:58:32  
MPI Processes: 1

---

<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:** [February 8, 2015, 7:08pm UTC](https://openmc.discourse.group/t/openmpi-support/128/2 "2015-02-08T19:08:51Z")

</div>

Hi John,

You just need to add -Dopenmp=on to the cmake line. Let me know if you’re still having issues after that!

Paul

---

<div class="post-metadata">

**Author:** ![John\_Xia](https://avatars.discourse-cdn.com/v4/letter/j/4bbf92/32.png) [@John\_Xia](https://openmc.discourse.group/u/John_Xia)\
**Post date:** [February 8, 2015, 7:10pm UTC](https://openmc.discourse.group/t/openmpi-support/128/3 "2015-02-08T19:10:51Z")

</div>

Thanks Paul, that worked great!
