Scheduled Downtime
On Tuesday 24 October 2023 @ 5pm MT the forums will be in read only mode in preparation for the downtime. On Wednesday 25 October 2023 @ 5am MT, this website will be down for maintenance and expected to return online later in the morning.
Normal Operations
The forums are back online with normal operations. If you notice any issues or errors related to the forums, please reach out to help@ucar.edu

Problems while running CAM with openmpi

shujch03@lzu_cn

New Member
Hi,everyone.I run CAM3.1 well using mpich, but have problems while using openmpi.

I configure the model as:
./models/atm/cam/bld/configure -dyn fv -res 4x5 -mpi_inc /public1/software/mpi/openmpi132-pgi/include -mpi_lib /public1/software/mpi/openmpi132-pgi/lib -nc_inc /home/student/lzutianws1/tools/netcdf/include -nc_lib /home/student/lzutianws1/tools/netcdf/lib -spmd -test

It shows the following errors :
Looking for a valid GNU make... using gmake
Testing for Fortran 90 compatible compiler... using pgf90
Testing NetCDF library... ok
Testing MPI library... **** FAILED ****
Issued the command:
gmake test_mpi 2>&1

The output was:
cat: Srcfiles: No such file or directory
Makefile:1083: /home/student/lzutianws1/wangwk/cam3.1/cam1/Depends: No such file or directory
gmake: Warning: File `Makefile' has modification time 9.8e+02 s in the future
/home/student/lzutianws1/wangwk/cam3.1/cam1/models/atm/cam/bld/mkSrcfiles > /home/student/lzutianws1/wangwk/cam3.1/cam1/Srcfiles
/home/student/lzutianws1/wangwk/cam3.1/cam1/models/atm/cam/bld/mkDepends Filepath Srcfiles > /home/student/lzutianws1/wangwk/cam3.1/cam1/Depends
gmake: Warning: File `/home/student/lzutianws1/wangwk/cam3.1/cam1/Depends' has modification time 9.8e+02 s in the future
pgf90 -c -I. -I/home/student/lzutianws1/wangwk/cam3.1/cam1/models/atm/cam/src/physics/cam1 -I/home/student/lzutianws1/wangwk/cam3.1/cam1/models/atm/cam/src/dynamics/fv -I/home/student/lzutianws1/wangwk/cam3.1/cam1/models/atm/cam/src/control -I/home/student/lzutianws1/wangwk/cam3.1/cam1/models/csm_share/shr -I/home/student/lzutianws1/wangwk/cam3.1/cam1/models/atm/cam/src/utils -I/home/student/lzutianws1/wangwk/cam3.1/cam1/models/utils/timing -I/home/student/lzutianws1/wangwk/cam3.1/cam1/models/utils/pilgrim -I/home/student/lzutianws1/wangwk/cam3.1/cam1/models/atm/cam/src/ocnsice/dom -I/home/student/lzutianws1/wangwk/cam3.1/cam1/models/lnd/clm2/src/main -I/home/student/lzutianws1/wangwk/cam3.1/cam1/models/lnd/clm2/src/biogeophys -I/home/student/lzutianws1/wangwk/cam3.1/cam1/models/lnd/clm2/src/biogeochem -I/home/student/lzutianws1/wangwk/cam3.1/cam1/models/lnd/clm2/src/mksrfdata -I/home/student/lzutianws1/wangwk/cam3.1/cam1/models/lnd/clm2/src/riverroute -I/home/student/lzutianws1/wangwk/cam3.1/cam1/models/ice/csim4 -I/home/student/lzutianws1/tools/netcdf/include -I/public1/software/mpi/openmpi132-pgi/include -I/home/student/lzutianws1/wangwk/cam3.1/cam1/esmf/mod/modO/linux_pgi -I/home/student/lzutianws1/tools/netcdf/lib -r8 -i4 -DCAM -DNO_SHR_VMATH -DHIDE_SHR_MSG -DLINUX -Mdalign -Mextend -DNO_R16 -byteswapio -O1 test_mpi.F
pgf90 -o test_mpi test_mpi.o -L/public1/software/mpi/openmpi132-pgi/lib -lmpi
test_mpi.o: In function `MAIN_':
test_mpi.F:(.text+0x19): undefined reference to `mpi_init_'
gmake: *** [test_mpi] Error 2

the libraries of my openmpi are:
libmca_common_sm.la libmpi_cxx.so.0.0.0 libmpi_f90.so.0 libopenmpi_malloc.so libopen-rte.la libvt.fmpi.a
libmca_common_sm.so libmpi_f77.la libmpi_f90.so.0.0.0 libopenmpi_malloc.so.0 libopen-rte.so libvt.mpi.a
libmca_common_sm.so.0 libmpi_f77.so libmpi.la libopenmpi_malloc.so.0.0.0 libopen-rte.so.0 libvt.omp.a
libmca_common_sm.so.0.0.0 libmpi_f77.so.0 libmpi.so libopen-pal.la libopen-rte.so.0.0.0 libvt.ompi.a
libmpi_cxx.la libmpi_f77.so.0.0.0 libmpi.so.0 libopen-pal.so libotf.a mpi.mod
libmpi_cxx.so libmpi_f90.la libmpi.so.0.0.0 libopen-pal.so.0 libotf.la openmpi
libmpi_cxx.so.0 libmpi_f90.so libopenmpi_malloc.la libopen-pal.so.0.0.0 libvt.a

Are there anybody can help me run CAM with openmpi correct?

Thanks a lot!
 

eaton

CSEG and Liaisons
In the output you posted this is the line that shows the problem:

test_mpi.F90: undefined reference to `mpi_init_'

Look through your mpi libs for the symbol 'mpi_init_'. You do that with a command like the following (substituting in the appropriate names for libmpi.a). You've listed quite a few libs for your openmpi, and it's not obvious to me which one contains the init method.

% nm libmpi.a | grep mpi_init_

If you find it then that particular lib needs to be added to the load command using the appropriate -L and/or -l options. These can be supplied via the -ldflags argument to configure.

If you don't find it, but do find either mpi_init or mpi_init__ then it's an issue that needs to be dealt with in the build of the mpi lib. The fortran compiler used in that build needs to be using the same number of trailing underscores (i.e., have the same Fortran "name mangling" convention) as the compiler that you're using to build CAM.
 
Top