NCAR / DART

Data Assimilation Research Testbed
https://dart.ucar.edu/
Apache License 2.0
187 stars 140 forks source link

Updating mpi_utilities_mod to use the mpi_f08 module #552

Closed mjs2369 closed 11 months ago

mjs2369 commented 11 months ago

Description:

Errors from mpi_utilities_mod are produced when cray-mpich and gfortran use f77 bindings with use mpi

The f08 mpi module use mpi_f08 follows the fortran standard. mpi_utilites_mod has been updated to use the mpi_f08 module with mpi_f08 bindings.

This fixes the issues with mpich and gfortran 10+

The following items were mentioned in the corresponding issues, but will not be addressed in the PR and will be a part of a larger refactor of our MPI code:

Fixes issue

Fixes #261 #551

Types of changes

Documentation changes needed?

Tests

Ran quickbuild.sh using cray-mpich and the gfortran compiler with full debugging flags on Derecho; executed filter Repeated this process for the Intel and cce compilers to ensure these changes didn't affect the other compilers' ability to compile and run.

Checklist for merging

Checklist for release

Testing Datasets

hkershaw-brown commented 11 months ago

@mjs2369 Thanks Marlee! I'm going to live dangerously and amend the commit message on this to describe the changes.

hkershaw-brown commented 11 months ago

Cheyenne: for mpt use mpif08

MPIFC = mpif08
MPILD = mpif08
FC = ifort
LD = ifort
hkershaw-brown commented 11 months ago
/glade/scratch/hkershaw/DART/pull_requests/pull_552/DART.intel/assimilation_code/modules/utilities/mpi_utilities_mod.f90(1989): warning #8100: The actual argument is an array section or assumed-shape array, corresponding dummy argument that has either the VOLATILE or ASYNCHRONOUS attribute shall be an assumed-shape array.   [X]
call mpi_get(x, num_rows, datasize, owner, target_disp, num_rows, datasize, window, errcode)
-------------^
nancycollins commented 11 months ago

i forgot to mention that there are test programs in the developer_test directory that are very simple standalone MPI and NetCDF programs that i used to point people having problems to. they aren't as complex as compiling any of the main dart code - they're standalone and help people who have system configuration problems. maybe have these 'use mpi_f08' if they don't still compile, and have some comments about 'use mpi' vs 'use mpi_f08' for users trying to track down problems. they're in developer_tests/mpi_utilities/tests

hkershaw-brown commented 11 months ago

Derecho nvfotran ftn:

NVFORTRAN-F-0004-Unable to open MODULE file mpi_f08.mod (/glade/derecho/scratch/hkershaw/DART/pull_reqeuests/pull_552/DART.nvhpc/assimilation_code/modules/utilities/mpi_utilities_mod.f90: 53)
NVFORTRAN/x86-64 Linux 23.1-0: compilation aborted

Derecho nvfortran mpif08

mpif08 -O -Mbackslash -Kieee -I/glade/u/apps/derecho/23.06/spack/opt/spack/netcdf/4.9.2/nvhpc/23.1/qwj3/include  -c /glade/derecho/scratch/hkershaw/DART/pull_reqeuests/pull_552/DART.nvhpc/assimilation_code/modules/utilities/types_mod.f90
NCAR_ERROR: wrapper cannot locate path to mpif08
ls /glade/u/apps/derecho/23.06/spack/opt/spack/ncarcompilers/1.0.0/nvhpc/23.1/rqst/bin/mpi/mpif08
/glade/u/apps/derecho/23.06/spack/opt/spack/ncarcompilers/1.0.0/nvhpc/23.1/rqst/bin/mpi/mpif08
$ mpif08
NCAR_ERROR: wrapper cannot locate path to mpif08
hkershaw-brown commented 11 months ago

@mjs2369 I'm going to close this pull request. The fix is good for compiler + mpi combos that have an mpi_f08.mod but we still have a lot of compiler mpi combinations that don't support mpif08.

I'm thinking maybe a mpif08 option is the way to go, so you can build with the f08 or f90 bindings for mpi. quickbuild.sh mpif08