running serpent in parallel

Compiler issues (Intel compiler, mpicc, etc.), data libraries and everything needed to get Serpent running is discussed here
germina

running serpent in parallel

Post by germina » Wed Jan 05, 2011 7:27 pm

Hi Jaakko,

Could you please include in the user's manual more details on how to run Serpent in parallel? That would be very helpful when dealing with large configurations.

Thanks,

Germina

User avatar
Jaakko Leppänen
Site Admin
Posts: 2167
Joined: Thu Mar 18, 2010 10:43 pm
Security question 2: 0
Location: Espoo, Finland
Contact:

Re: running serpent in parallel

Post by Jaakko Leppänen » Wed Jan 05, 2011 10:04 pm

Germina,

This is a good topic for discussion. Running Serpent in parallel is relatively straightforward...

First, you need to make sure that the source code is compiled with the MPI options. In the Makefile there are lines 16-19:

Code: Select all

# Parallel calculation using MPI:

CC  	 = mpicc
CFLAGS  += -DMPI
where the compiler and the MPI flag are set. These lines are commented out by default. Depending on the system, you may need to set up the file paths for the compiler and the external libraries, but this is an issue more related to the MPI installation than Serpent itself. I imagine that most computer clusters that are used for scientific computing have some version of MPI installed and configured, so the best way to figure out the options is probably to consult the system administrator.

If Serpent source code is properly compiled with MPI, command "sss -version" should print a message indicating that parallel mode is available:

Code: Select all

...

PSG2 / Serpent

A Continuous-energy Monte Carlo Reactor Physics Burnup Calculation Code

 - Version 1.1.15 (December 24, 2010) -- Contact: Jaakko.Leppanen@vtt.fi

 - Parallel calculation mode available

 - Geometry and mesh plotting available
Running the code with MPI requires some system tools. I use mpirun, but there are probably other options as well. The command line syntax for running a Serpent calculation in N hosts is:

Code: Select all

mpirun -np N sss <input>
You can also try running:

Code: Select all

sss -mpi N <input>
This does the same thing, but works only if Serpent can find the executable for mpirun.

My experience on setting up parallel runs doesn't really go any further, but I know that there are several options for configuring the hosts for mpirun, sending jobs in a que, etc.that are really useful for large clusters with multiple simultaneous users.

Perhaps there are other Serpent users who have more experience with parallel calculation?
- Jaakko

permanajati
Posts: 4
Joined: Wed Jul 27, 2011 6:04 pm

Re: running serpent in parallel

Post by permanajati » Fri Jan 25, 2013 4:24 am

Hi Jaakko,

After installing serpent 1.1.18, I enabled the parallel calculation in it. BUt when i run with:

mpirun -np 8 sss input

or even

sss -mpi 8 input

I expect to launch a parallel job on eight cores, and single process knows how many processes are running and its rank. Indeed, I obtain eight processes, that are independent from each other, and of course take more time to finish than running a single core.

Can you help me?

My processor is Intel i7 by the way. Does it have connection with the processors?

Thank you very much and best regards!

PJ

User avatar
Jaakko Leppänen
Site Admin
Posts: 2167
Joined: Thu Mar 18, 2010 10:43 pm
Security question 2: 0
Location: Espoo, Finland
Contact:

Re: running serpent in parallel

Post by Jaakko Leppänen » Sat Jan 26, 2013 12:07 am

Did you make clean after you edited the Makefile and enabled MPI parallelization? If all subroutines are not recompiled with the MPI option, you may see some very strange behaviour when running in paralle.
- Jaakko

permanajati
Posts: 4
Joined: Wed Jul 27, 2011 6:04 pm

Re: running serpent in parallel

Post by permanajati » Sat Jan 26, 2013 1:39 am

Yes I did, make clean and recompiled it with mpicc.
But what I got is:

- when i run mpirun -np 8 sss GCFR,

I found that those 8 cores run the job individually,,instead of sharing the job.
Do u think it has the problem with the compiler vs processors? I compiled once in my quad-core AMD laptop and it worked just fine,,
Do u think using intel compiler will fix that?

Thank a lot!

User avatar
Jaakko Leppänen
Site Admin
Posts: 2167
Joined: Thu Mar 18, 2010 10:43 pm
Security question 2: 0
Location: Espoo, Finland
Contact:

Re: running serpent in parallel

Post by Jaakko Leppänen » Sat Jan 26, 2013 1:34 pm

What do you get in output variable MPI_TASKS in the _res.m file?
- Jaakko

permanajati
Posts: 4
Joined: Wed Jul 27, 2011 6:04 pm

Re: running serpent in parallel

Post by permanajati » Sun Jan 27, 2013 8:48 am

Yes, I should realize it before, it says only 1 task given,,
But, I compiled it as ordered, with mpicc,,and when I did "sss -version", it says that parallel mode is available..

One thing that strange also though, I compiled it with no gfx mode but it says that geometry and mesh plotting are available,,

Any idea why? Thank you very much anyway! :-)

User avatar
Jaakko Leppänen
Site Admin
Posts: 2167
Joined: Thu Mar 18, 2010 10:43 pm
Security question 2: 0
Location: Espoo, Finland
Contact:

Re: running serpent in parallel

Post by Jaakko Leppänen » Mon Jan 28, 2013 12:35 am

Are you sure that you are running the same executable that you are compiling? The print statements telling whether geometry and mesh plotting are available are determined by the NOGFX macro set in the Makefile, so it is absolutely impossible that the code prints line:

- Geometry and mesh plotting available

if NOGFX is set. Also, the behaviour that you described earlier is exactly what happens if the code is run with mpirun without compiling it in MPI mode -- mpirun starts independent calculations that write in the same output files.
- Jaakko

Mohamed Salah
Posts: 9
Joined: Sat Jan 21, 2012 12:28 am

Re: running serpent in parallel

Post by Mohamed Salah » Wed Mar 26, 2014 6:20 am

I have the same problem in parallel calculation, have this problem been solved ?

User avatar
Jaakko Leppänen
Site Admin
Posts: 2167
Joined: Thu Mar 18, 2010 10:43 pm
Security question 2: 0
Location: Espoo, Finland
Contact:

Re: running serpent in parallel

Post by Jaakko Leppänen » Wed Mar 26, 2014 3:38 pm

When the code prints the logo, do you see notification saying that parallel calculation mode is available? What do you get in variable MPI_TASKS in the _res.m output file?
- Jaakko

Post Reply