Page 1 of 1

how to enable parallel mode?

Posted: Mon Nov 12, 2018 1:13 pm
by sara.ocean
Dear all users,
I have read in the user guide that "Simulations can (optionally) be performed on parallel clusters
using the MPI (Message Passing Interface) communication library". It is a good feature in new version and using it can save time too much. could you please tell me more details about it?
how can I do it? My system is running slowly so using this feature is so useful for me.
Any help would be greatly appreciated.

Kind Regards,

Re: how to enable parallel mode?

Posted: Tue Nov 13, 2018 8:20 am
by paloma
Hello Sara,
Here is how I do:
-> You must decide in how many parts you want to slice the domain (Number of columns and number of rows). This leads to a number of instruction in Usrdef_Model.f90; it looks like this for me: (2 columns * 2 rows)
!7. Parallel setup
write(*,*)"iopt_MPI = ",iopt_MPI
parallel_set = .TRUE.
nprocsx = 2
nprocsy = 2
nprocs = 4
npworld = 4
IF (npworld.GT.1) nprocscoh = 4

!---communication switches
! was iopt_MPI_partit = 2
iopt_MPI_partit = 1

-> then, you need to compile with mpif90, with the option -DMPI
So, in physics/comps/compilers.comp:

"FCDEBUG=-fbounds-check -Wall -ffpe-trap=invalid,zero,overflow\
-fimplicit-none -fbacktrace -g -fdump-core -finit-real=inf" \
"CPP=" "CPPF=cpp" "CPPOPTS=-traditional-cpp" "CPPDEFS=$(CPPDFLAGS) -DMPI"

I run <make pdv_locmpi> to compile

-> Finally, I run the code with this command:
mpirun -np 4 ./coherens

That should do it.
Have fun,