how to enable parallel mode?

Everything related to the preinstalled test cases in COHERENS. Additionally, you can find here the necessary files to setup a test case.If you have developed a new test case and you want to share it with other users, feel free to post a new thread.

Moderator: Katrijn

Post Reply
sara.ocean
Posts: 1
Joined: Mon Nov 12, 2018 12:34 pm
Full name: sara.ocean

how to enable parallel mode?

Post 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,
sara
paloma
Posts: 2
Joined: Fri Oct 13, 2017 11:31 am
Full name: Paloma de la vallee

Re: how to enable parallel mode?

Post 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:

pdv_locmpi:
$(MAKE) $(EXEFILE) "FC=mpif90" "FCOPTS=" "FCDEFS=$(FCDEFS)" \
"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,
Paloma
Post Reply