mpi and gfortran

Bug reports, work arounds and fixes

Moderators: arango, robertson

Post Reply
Message
Author
redhat007

mpi and gfortran

#1 Unread post by redhat007 »

hi dear
i am trying to compile latte test in disturbed memory. ihave installed all needed promram (such as netcdf, ncl, mpich2 and so on) with gcc and gfortran compilers. i want to know it is possible choosing FORT=gfortran when uncomment USE_mpi=on and USE_MPIF90=on in build.bash file?
all the best
thanks

User avatar
kate
Posts: 4091
Joined: Wed Jul 02, 2003 5:29 pm
Location: CFOS/UAF, USA

Re: mpi and gfortran

#2 Unread post by kate »

We have OpenMPI and I can compile and run in parallel with gfortran. Is it not working for you?

redhat007

Re: mpi and gfortran

#3 Unread post by redhat007 »

hi dear kate
no. it give me some errors that i am trying to solve them :? . but would you please tell me for parallel compiling as well as mpi(mpich2 for me) other libraries (such as PARPACK ) are necessary or not.
thanks in advance for your kindly attention
cheers

User avatar
kate
Posts: 4091
Joined: Wed Jul 02, 2003 5:29 pm
Location: CFOS/UAF, USA

Re: mpi and gfortran

#4 Unread post by kate »

Are you running the forward model only? If so, you don't need parpack. What is the nature of the error you are seeing?

User avatar
m.hadfield
Posts: 521
Joined: Tue Jul 01, 2003 4:12 am
Location: NIWA

Re: mpi and gfortran

#5 Unread post by m.hadfield »

Just backing up Kate: I have run ROMS+MPI+Gfortran using MPICH2 and OpenMPI at different times, no worries. Using mpif90 is definitely recommended: the mpif90 script ensures that environment variables & libraries are correctly set up for compiling and linking. It doesn't handle run-time environment variables. You may need to set LD_LIBRARY_PATH so that the run-time libraries can be be found for both Gfortran itself and the MPI implementation.

redhat007

Re: mpi and gfortran

#6 Unread post by redhat007 »

first of all thanks for your attention.
Dear kate forgive me, but your meaning about forward model is stand alone model :oops:?
are you running forward model only:?
in my recent test there is not coupling. I uncomment USE_MPI=on, USE_MPIF90=on and which_MPI=mpich2 for distributed-memory parallelism but after typing

Code: Select all

./build.bash -j 4 
(in my test NtileI and NtileJ is equal to 2)
it seems that there are not any errors but oceanG is created in project directory instead of of oceanM.
I have pasted end paragraph which replied after compiling:
/home/fkomijani/mpich2_install_new/bin/mpif90 -frepack-arrays -g -fbounds-check /home/fkomijani/projects/Latte2/Build/roms_import.o /home/fkomijani/projects/Latte2/Build/propagator.o /home/fkomijani/projects/Latte2/Build/master.o /home/fkomijani/projects/Latte2/Build/roms_export.o /home/fkomijani/projects/Latte2/Build/ocean_coupler.o /home/fkomijani/projects/Latte2/Build/esmf_roms.o /home/fkomijani/projects/Latte2/Build/ocean_control.o -o /home/fkomijani/projects/Latte2/oceanG /home/fkomijani/projects/Latte2/Build/libUTIL.a /home/fkomijani/projects/Latte2/Build/libNLM.a /home/fkomijani/projects/Latte2/Build/libNLM_bio.a /home/fkomijani/projects/Latte2/Build/libNLM_sed.a /home/fkomijani/projects/Latte2/Build/libANA.a /home/fkomijani/projects/Latte2/Build/libUTIL.a /home/fkomijani/projects/Latte2/Build/libMODS.a -L/home/fkomijani/NETCD4.2.1.1/lib -lnetcdff -lnetcdf -lnetcdf

Would you please tell me why?
All the best

User avatar
kate
Posts: 4091
Joined: Wed Jul 02, 2003 5:29 pm
Location: CFOS/UAF, USA

Re: mpi and gfortran

#7 Unread post by kate »

The forward model is the "forward in time" regular model, as opposed to the data assimilation versions with the adjoint, tangent linear, etc.

You got that oceanG because you must have turned on USE_DEBUG somewhere. Another key to it is "-g -fbounds-check" instead of something like "-O2" for optimization. You should be able to run that oceanG, though, just more slowly than oceanM.

redhat007

Re: mpi and gfortran

#8 Unread post by redhat007 »

Dear kate
again i am so grateful for your kindly replay.
Base on different posts in forum, compiling and running my test in distributed memory state, i got that n values in compiling command is independent of Ntilei and NtileJ values, but N value for running is produced by Ntilei* NtileJ, of course both of them are depend to number of system's cpu. there for it is possible that n does not be equat to N.

Code: Select all

./build.bash -j n
mpirun -np N ./oceanM ocean_XXX.in > run.log
Would you please tell me that this understanding is true or not.

Thanks in advance

User avatar
m.hadfield
Posts: 521
Joined: Tue Jul 01, 2003 4:12 am
Location: NIWA

Re: mpi and gfortran

#9 Unread post by m.hadfield »

The "n" in "build.bash -j n" has nothing to do with the number of processes in which you intend to run the model. It merely sets the number of processes (threads) that Gnu make can call on when it is compiling and building the model.

There are two quite different concepts being referred to here. Parallel execution (via the -j switch) is the term used in the Gnu make documentation for the facility that lets several different targets be built at the same time. See:

http://www.gnu.org/software/make/manual ... l#Parallel

What you want is to compile and build an executable that will execute in parallel using MPI. (There is a comment in build.bash that refers to this as "parallel compilation": this is misleading.) For that you need to set the USE_MPI environment variable (and you will normally also want to set USE_MPIF90). It is not necessary to set the number of processes the executable will run on until run time.
Last edited by m.hadfield on Mon Sep 23, 2013 11:05 am, edited 1 time in total.

redhat007

Re: mpi and gfortran

#10 Unread post by redhat007 »

many many thanks for your nice reply and also good link.
best regard

redhat007

Re: mpi and gfortran

#11 Unread post by redhat007 »

Dear kate
Your reply about forward model makes another question in my mind
The forward model is the "forward in time" regular model, as opposed to the data assimilation versions with the adjoint, tangent linear, etc.
I check manual I have got that forward model is NONLINEAR model. And it is default way for roms modeling also for upwelling test
Are you running the forward model only? If so, you don't need parpack.
But I have compiled this test without parpack and arpack libraries.
What happen?
Truly yours
redhat

User avatar
kate
Posts: 4091
Joined: Wed Jul 02, 2003 5:29 pm
Location: CFOS/UAF, USA

Re: mpi and gfortran

#12 Unread post by kate »

You are aware that "don't" means "do not"? You do not need those libraries.

Post Reply