# Different solution between two computer(OS) and MPI problem

**URL:** <https://openmc.discourse.group/t/different-solution-between-two-computer-os-and-mpi-problem/32>\
**Category:** User Support\
**Created:** [June 29, 2013, 5:44am UTC](https://openmc.discourse.group/t/different-solution-between-two-computer-os-and-mpi-problem/32 "2013-06-29T05:44:56Z")\
**Posts on this page:** 8\
**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:** [June 29, 2013, 5:44am UTC](https://openmc.discourse.group/t/different-solution-between-two-computer-os-and-mpi-problem/32/1 "2013-06-29T05:44:56Z")

</div>

Hi,

I have two problems using OpenMC.

1. When I use window and linux on same problem, same cross sections, they show different solution. It was just test file with about 100pcm std, but it shows quite different k value, about 300 pcm difference.  
I used different machines. I thought about random number generator, but I think RNgenerator doesn’t depend on machine, from methodology.  
Is it normal?

2. I’m using MPICH2 for MPI with 24 nodes, 244 core. The command for this is:

mpirun -launcher rsh -np 244 -machinefile ./fullhost openmc

At first, it looks working but the result doesn’t.  
Through the process, it doesn’t spread work but calculate independently. It shows 244 exactly same result without send/receiving each other.  
Is it command problem? or other?

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 2, 2013, 5:19am UTC](https://openmc.discourse.group/t/different-solution-between-two-computer-os-and-mpi-problem/32/2 "2013-07-02T05:19:57Z")

</div>

Do I have to use mpif90 when I compile the source at first?

2013년 6월 29일 토요일 오후 2시 44분 56초 UTC+9, Kyungkwan Noh 님의 말:

---

<div class="post-metadata">

**Author:** ![Adam\_Nelson](https://avatars.discourse-cdn.com/v4/letter/a/8edcca/32.png) [@Adam\_Nelson](https://openmc.discourse.group/u/Adam_Nelson)\
**Post date:** [July 2, 2013, 1:25pm UTC](https://openmc.discourse.group/t/different-solution-between-two-computer-os-and-mpi-problem/32/3 "2013-07-02T13:25:14Z")

</div>

For your 1st question (different answers on different machines/OS’), were the two machines both 64-bit, or was one 32-bit and the other 64?  
On the second question (and your new post), yes you do have to compile using mpif90, i.e., use the command 'make MPI=yes '. MPI=yes will set the compiler to the mpi compiler located in MPI\_DIR (in the Makefile). Also (although I expect you will receive errors during compilation if this is not done correctly), ensure that if your MPI\_DIR points to an MPI wrapper which uses the intel compiler, that the COMPILER flag is set to intel. The converse is true if the MPI wrapper uses gfortran; that is, make sure COMPILER = gnu.

---

<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 2, 2013, 2:26pm UTC](https://openmc.discourse.group/t/different-solution-between-two-computer-os-and-mpi-problem/32/4 "2013-07-02T14:26:41Z")

</div>

Thank you for your response.

On the second question I posted, I set correct path for MPI (opt/applic/mpi/$(COMPILER)-13.1/mpich2-1.4.1p1).  
I also set MPI = yes in ‘MAKEFILE.’

I checked whether there is mpif90 in mpich2-1.4.1p1/bin and there is. What would be the problem?

2013년 7월 2일 화요일 오후 10시 25분 14초 UTC+9, nels…@umich.edu 님의 말:

---

<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 3, 2013, 3:35am UTC](https://openmc.discourse.group/t/different-solution-between-two-computer-os-and-mpi-problem/32/5 "2013-07-03T03:35:33Z")

</div>

Some things to consider:

- Make sure you are using the mpirun/mpiexec command from the same bin/ directory you used mpif90 from (in your case /opt/applic/mpi/$(COMPILER)-13.1/mpich2-1.4.1p1/bin)

- You might need to set your LD\_LIBRARY\_PATH environment variable to the lib/ subdirectory of your MPI installation. It’s possible that a shared library is getting linked to a different MPI distribution.

---

<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 3, 2013, 4:39am UTC](https://openmc.discourse.group/t/different-solution-between-two-computer-os-and-mpi-problem/32/6 "2013-07-03T04:39:16Z")

</div>

Thank you for your response.

Well, I finally used mpif90 compiler and set the right path in .bashrc. However, it still doesn’t work.

This is the command for MPI.

This is a capture of Makefile.

Thank you.

2013년 6월 29일 토요일 오후 2시 44분 56초 UTC+9, Kyungkwan Noh 님의 말:

---

<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 4, 2013, 11:35am UTC](https://openmc.discourse.group/t/different-solution-between-two-computer-os-and-mpi-problem/32/7 "2013-07-04T11:35:52Z")

</div>

I changed the OpenMPI PATH to version 1.2.9 and accepted mpirun command is shown below.

It still, however, runs like serial program which does 24 works independently. I set LD\_Library, and all necessary path.

2013년 6월 29일 토요일 오후 2시 44분 56초 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 5, 2013, 8:23pm UTC](https://openmc.discourse.group/t/different-solution-between-two-computer-os-and-mpi-problem/32/8 "2013-07-05T20:23:36Z")

</div>

You need to make sure that the COMPILER variable in the Makefile is set to gnu, intel, pgi, ibm, or cray (depending on what compiler was used to compile MPICH2. If the COMPILER variable is not correct, it will not run the pre-processor on the code and therefore any blocks of code that have #ifdef MPI around them won’t show up. It looks like your MPICH2 is built off the intel compiler, so I would set COMPILER=intel, MPI=yes, and then run ‘make distclean’, and then ‘make’.
