Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mpich mpif08 #261

Closed
hkershaw-brown opened this issue Jul 30, 2021 · 9 comments · Fixed by #562
Closed

mpich mpif08 #261

hkershaw-brown opened this issue Jul 30, 2021 · 9 comments · Fixed by #562
Assignees
Labels
Derecho issues related to running on NCAR's new supercomputer fortran standards compiler issues and (non) standard-compliant code pmp possible Marlee project

Comments

@hkershaw-brown
Copy link
Member

I think the mpi_utilities errors are mpich using f77 bindings when you use mpi. Hello world mpi (no dart code) will not compile if you have a mpi_send(integer) mpi_send(real) in the same file.

hello.f90.txt
hello_f08.f90.txt

The f08 mpi module use mpi_f08 follows the fortran standard.
There is a branch mpi_f08 which has a version of mpi_utilites_mod.f90 with mpi_f08 bindings. This will work with mpich and gfortran 10+ (only done a quick test).
The cray window module (cray pointers) could get replaced with iso_c_bindings.

or short term solution: port select --set mpi openmpi-mp-fortran

Originally posted by @hkershaw-brown in #158 (comment)

@nancycollins
Copy link
Collaborator

i think that changing our code to 'use mpi_f08' instead of just 'use mpi' is the right solution (also the iso_c_bindings). but i don't how to verify how many of our users have access to mpi with the 2008 bindings compared to older versions only. if this breaks our build for a lot of people then it's bad. if most installations now have 2008 bindings then this allows us to let the compilers do better error checking by removing compile-time flags from our mkmf.templates which is a good thing.

it would be nice if there was an easy way to know whether an mpi had a 2008 module or not. a simple kind of 'configure' command that runs first and checks things out? or just make the change and tell users to edit mpi_utilities_mod.f90 if it doesn't build?

just thinking out loud here. not sure what the right solution is yet.

@hkershaw-brown
Copy link
Member Author

I love these foundation shaking questions from Nancy. Have you played with autoconf to configure/make DART vs. mkmf?

@hkershaw-brown
Copy link
Member Author

hkershaw-brown commented Sep 30, 2021

other notes from #288
review MPI_INTEGER_KIND, COUNT MPI3 as part of this update.
and fixsystem.

Also see #245 namelist standard

mpi_f08 https://github.com/NCAR/DART/tree/mpi_f08

@hkershaw-brown hkershaw-brown added the fortran standards compiler issues and (non) standard-compliant code label Oct 12, 2021
@hkershaw-brown hkershaw-brown self-assigned this Feb 22, 2022
@hkershaw-brown
Copy link
Member Author

note the mpi_f08 branch is a ways behind main so does not have the NAG bug-fix #328.

@hkershaw-brown
Copy link
Member Author

up-to-date now. I think this should go in a f2008(3) update (see #288). Hanging out on the mpi_f08 branch now

@hkershaw-brown
Copy link
Member Author

moved mpi_f08 https://github.com/hkershaw-brown/DART/tree/mpi_f08
someone can grab it or not as needed if they are updating to f08.

@hkershaw-brown hkershaw-brown added the pmp possible Marlee project label Mar 30, 2023
@hkershaw-brown
Copy link
Member Author

Gust gfortran

hkershaw@gust01:~/DART/models/lorenz_96/work.gfortran> module -t list
ncarenv/23.04
craype/2.7.20
gcc/12.2.0
ncarcompilers/0.8.0
hdf5/1.12.2
netcdf/4.9.1
cray-mpich/8.1.25

Screen Shot 2023-05-01 at 6 16 12 PM

@hkershaw-brown hkershaw-brown added the Derecho issues related to running on NCAR's new supercomputer label May 2, 2023
@hkershaw-brown
Copy link
Member Author

To reproduce this on gust you can use the following modules:

hkershaw@gust01:~/DART/models/lorenz_96/work> module load gcc
hkershaw@gust01:~/DART/models/lorenz_96/work> module -t list
ncarenv/23.04
craype/2.7.20
gcc/12.2.0
ncarcompilers/0.8.0
hdf5/1.12.2
netcdf/4.9.1
cray-mpich/8.1.25

./quickbuild.sh gets you:

Error: Type mismatch between actual argument at (1) and actual argument at (2) (REAL(8)/INTEGER(4)).
/glade/u/home/hkershaw/DART/assimilation_code/modules/utilities/mpi_utilities_mod.f90:649:18:

  595 |       call MPI_Ssend(srcarray, int(itemcount,i4), datasize, dest_id, tag, &
      |                     2
......
  649 |    call MPI_Ssend(itime, 2, MPI_INTEGER, dest_id, tag*2, my_local_comm, errcode)
      |                  1
Error: Type mismatch between actual argument at (1) and actual argument at (2) (INTEGER(4)/REAL(8)).

@mjs2369
Copy link
Contributor

mjs2369 commented Sep 28, 2023

Updated the old mpi_f08 branch to main. Updated branch located at https://github.com/NCAR/DART/tree/mpif08

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Derecho issues related to running on NCAR's new supercomputer fortran standards compiler issues and (non) standard-compliant code pmp possible Marlee project
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants