Compiling Error for COAWST

Discussion on computers, ROMS installation and compiling

Moderators: arango, robertson

Post Reply
Message
Author
engahmedadawy
Posts: 2
Joined: Mon Jan 18, 2021 5:14 pm
Location: Tokyo institute of technlogy

Compiling Error for COAWST

#1 Unread post by engahmedadawy »

Dear All,
While I was compiling a COAWST project I got the following errors
| 1
......
4843 | CALL mpi_bcast (A, Asize, MP_FLOAT, MyMaster, OCN_COMM_WORLD, &
| 2
Error: Type mismatch between actual argument at (1) and actual argument at (2) (INTEGER(4)/REAL(8)).
distribute.f90:187:22:

187 | CALL mpi_bcast (A, 1, MP_FLOAT, MyMaster, OCN_COMM_WORLD, MyError)
| 1
......
4843 | CALL mpi_bcast (A, Asize, MP_FLOAT, MyMaster, OCN_COMM_WORLD, &
| 2
Error: Rank mismatch between actual argument at (1) and actual argument at (2) (rank-1 and scalar)
make: *** [ROMS/Utility/Module.mk:15: /home/Loric/COAWST_gittest/Projects/Coral_Triangle/Build/distribute.o] Error 1

stef
Posts: 192
Joined: Tue Mar 13, 2007 6:38 pm
Location: Independent researcher
Contact:

Re: Compiling Error for COAWST

#2 Unread post by stef »

I had a similar error, using gcc 10. Adding the '-fallow-argument-mismatch' to FFLAGS solved it for me. See also here:

viewtopic.php?f=17&t=5696&p=22037&hilit ... tch#p22037

https://github.com/Unidata/netcdf-fortran/issues/212

But then I had other errors with 'nf-config'. I had to hard-code NETCDF_INCDIR and LIBS in Linux-gfortran.mk, nf-config apparently didn't yield the right result.

jcwarner
Posts: 1200
Joined: Wed Dec 31, 2003 6:16 pm
Location: USGS, USA

Re: Compiling Error for COAWST

#3 Unread post by jcwarner »

yes, the compiler flags might be set too strict, and reducing that can help.

But fundamentally there is a potential issue that an integer is being broadcasted as a real.

I did a search in distribute.F for
"CALL mpi_bcast (A, Asize"
and the only place that shows up is once near the bottom in the routine mp_scatter_state.

That is called from packing.F we have
CALL mp_scatter_state (ng, iADM, Mstr, Mend, Mstate(ng), &
& Swork, ad_state)
and actually iADM is an integer and it is trying to be scattered as a real.
Maybe this was updated but lets ask Hernan.
--j

User avatar
arango
Site Admin
Posts: 1367
Joined: Wed Feb 26, 2003 4:41 pm
Location: DMCS, Rutgers University
Contact:

Re: Compiling Error for COAWST

#4 Unread post by arango »

Hmm, the call to mp_scatter_state is correct. It is only used for the adjoint-based propagator analysis, which I doubt Users using those algorithms that compact the full ROMS state (zeta, u, v, T, S) into a 1D array for matrix operations with the ARPACK library.

I think that the issue here is that version of distribute.F in COAWST that have:

Code: Select all

     CALL mpi_bcast (A, 1, MP_FLOAT, MyMaster, OCN_COMM_WORLD, MyError)
I don't have such a statement in my version. This is a compiler bug. Although the second argument is always an integer indicating the size of array A, we need to avoid numerical arguments. I use instead:

Code: Select all

     Npts=1 
     CALL mpi_bcast (A, Npts, MP_FLOAT, MyMaster, OCN_COMM_WORLD, MyError)
Recall that the MPI library is written in C, and we don't know what version is being used. There may be issues with the biding and the C-descriptors. For robustness, it is not a good idea to pass numerical arguments to such libraries. I recommend always use dummy variables, as shown above. Nowadays, we have modules, module procedures, and interfaces with strict checking of the argument kind, shape, and size. Notice that functions like mpi_bcast are polymorphic with the same name overloading. By the way, polymorphism was introduced in the Fortran 2003 standard.

stef
Posts: 192
Joined: Tue Mar 13, 2007 6:38 pm
Location: Independent researcher
Contact:

Re: Compiling Error for COAWST

#5 Unread post by stef »

I don't understand much of this, but for the record I'm posting error messages when compiling the following version of Roms Rutgers on a recently updated Arch Linux distribution:

Code: Select all

>>git log
commit 697c77dc4836919704033f970a1b051f24c595d0 (grafted, HEAD -> master, origin/master, origin/HEAD)
Author: Hernan G. Arango <arango@marine.rutgers.edu>
Date:   Mon Dec 28 19:59:46 2020 -0500

    src:ticket:876
Libraries on my Linux machine:

netcdf-fortran-openmpi 4.5.3
netcdf-openmpi 4.7.4
gcc 10.2.0
gcc-libs 10.2.0

there are many more dependencies, not sure what's relevant.

Let me know if you need more info (cpp switches?).

Code: Select all

/usr/bin/mpif90 -c -frepack-arrays -O3 -ffast-math -ffree-form -ffree-line-length-none distribute.f90
distribute.f90:4621:26:

 4621 |       CALL mpi_allreduce (Asend, Areduce, Npts, MP_FLOAT, handle,       &
      |                          1
......
 4868 |         CALL mpi_allreduce (Asend, Areduce, Isize,                      &
      |                            2
Error: Rank mismatch between actual argument at (1) and actual argument at (2) (rank-1 and scalar)
distribute.f90:4391:26:

 4391 |       CALL mpi_allgather (my_bounds, 4, MPI_INTEGER,                    &
      |                          1
......
 6091 |       CALL mpi_allgather (Asend, Npts, MP_FLOAT, Arecv, Npts, MP_FLOAT, &
      |                          2
Error: Type mismatch between actual argument at (1) and actual argument at (2) (INTEGER(4)/REAL(8)).
distribute.f90:4173:26:

 4173 |       CALL mpi_allgather (my_bounds, 2, MPI_INTEGER,                    &
      |                          1
......
 6091 |       CALL mpi_allgather (Asend, Npts, MP_FLOAT, Arecv, Npts, MP_FLOAT, &
      |                          2
Error: Type mismatch between actual argument at (1) and actual argument at (2) (INTEGER(4)/REAL(8)).
distribute.f90:3958:26:

 3958 |       CALL mpi_allgather (my_bounds, 4, MPI_INTEGER,                    &
      |                          1
......
 6091 |       CALL mpi_allgather (Asend, Npts, MP_FLOAT, Arecv, Npts, MP_FLOAT, &
      |                          2
Error: Type mismatch between actual argument at (1) and actual argument at (2) (INTEGER(4)/REAL(8)).
distribute.f90:3746:26:

 3746 |       CALL mpi_allgather (my_bounds, 2, MPI_INTEGER,                    &
      |                          1
......
 6091 |       CALL mpi_allgather (Asend, Npts, MP_FLOAT, Arecv, Npts, MP_FLOAT, &
      |                          2
Error: Type mismatch between actual argument at (1) and actual argument at (2) (INTEGER(4)/REAL(8)).
distribute.f90:3589:26:

 3589 |       CALL mpi_allgather (my_bounds, 2, MPI_INTEGER, Abounds, 2,        &
      |                          1
......
 6091 |       CALL mpi_allgather (Asend, Npts, MP_FLOAT, Arecv, Npts, MP_FLOAT, &
      |                          2
Error: Type mismatch between actual argument at (1) and actual argument at (2) (INTEGER(4)/REAL(8)).
distribute.f90:2830:26:

 2830 |           CALL mpi_irecv (Arecv, Npts, MPI_INTEGER, rank, rank+5,       &
      |                          1
......
 5482 |           CALL mpi_irecv (Arecv, Asize, MP_FLOAT, rank, rank+5,         &
      |                          2
Error: Type mismatch between actual argument at (1) and actual argument at (2) (INTEGER(4)/REAL(8)).
distribute.f90:2849:24:

 2849 |         CALL mpi_isend (A, Npts, MPI_INTEGER, MyMaster, MyRank+5,       &
      |                        1
......
 5502 |         CALL mpi_isend (A, Asize, MP_FLOAT, MyMaster, MyRank+5,         &
      |                        2
Error: Type mismatch between actual argument at (1) and actual argument at (2) (INTEGER(4)/REAL(8)).
distribute.f90:2863:22:

 2863 |       CALL mpi_bcast (A, Npts, MPI_INTEGER, MyMaster, MyCOMM, MyError)
      |                      1
......
 5516 |       CALL mpi_bcast (A, Asize, MP_FLOAT, MyMaster, OCN_COMM_WORLD,     &
      |                      2
Error: Type mismatch between actual argument at (1) and actual argument at (2) (INTEGER(4)/REAL(8)).
distribute.f90:2540:26:

 2540 |           CALL mpi_irecv (Arecv, Npts, MPI_INTEGER, rank, rank+5,       &
      |                          1
......
 5482 |           CALL mpi_irecv (Arecv, Asize, MP_FLOAT, rank, rank+5,         &
      |                          2
Error: Type mismatch between actual argument at (1) and actual argument at (2) (INTEGER(4)/REAL(8)).
distribute.f90:2563:24:

 2563 |         CALL mpi_isend (Asend, Npts, MPI_INTEGER, MyMaster, MyRank+5,   &
      |                        1
......
 5502 |         CALL mpi_isend (A, Asize, MP_FLOAT, MyMaster, MyRank+5,         &
      |                        2
Error: Type mismatch between actual argument at (1) and actual argument at (2) (INTEGER(4)/REAL(8)).
distribute.f90:2577:22:

 2577 |       CALL mpi_bcast (A, Npts, MPI_INTEGER, MyMaster, MyCOMM, MyError)
      |                      1
......
 5516 |       CALL mpi_bcast (A, Asize, MP_FLOAT, MyMaster, OCN_COMM_WORLD,     &
      |                      2
Error: Type mismatch between actual argument at (1) and actual argument at (2) (INTEGER(4)/REAL(8)).
distribute.f90:2368:26:

 2368 |           CALL mpi_irecv (Arecv, Npts, MPI_INTEGER, rank, rank+5,       &
      |                          1
......
 5482 |           CALL mpi_irecv (Arecv, Asize, MP_FLOAT, rank, rank+5,         &
      |                          2
Error: Type mismatch between actual argument at (1) and actual argument at (2) (INTEGER(4)/REAL(8)).
distribute.f90:2387:24:

 2387 |         CALL mpi_isend (A, Npts, MPI_INTEGER, MyMaster, MyRank+5,       &
      |                        1
......
 5502 |         CALL mpi_isend (A, Asize, MP_FLOAT, MyMaster, MyRank+5,         &
      |                        2
Error: Type mismatch between actual argument at (1) and actual argument at (2) (INTEGER(4)/REAL(8)).
distribute.f90:2401:22:

 2401 |       CALL mpi_bcast (A, Npts, MPI_INTEGER, MyMaster, MyCOMM, MyError)
      |                      1
......
 5516 |       CALL mpi_bcast (A, Asize, MP_FLOAT, MyMaster, OCN_COMM_WORLD,     &
      |                      2
Error: Type mismatch between actual argument at (1) and actual argument at (2) (INTEGER(4)/REAL(8)).
distribute.f90:1513:22:

 1513 |       CALL mpi_bcast (buffer, 5, MPI_INTEGER, MyMaster,                 &
      |                      1
......
 5516 |       CALL mpi_bcast (A, Asize, MP_FLOAT, MyMaster, OCN_COMM_WORLD,     &
      |                      2
Error: Type mismatch between actual argument at (1) and actual argument at (2) (INTEGER(4)/REAL(8)).
distribute.f90:1534:22:

 1534 |       CALL mpi_bcast (S(ng)%Vid, Npts, MPI_INTEGER, MyMaster,           &
      |                      1
......
 5516 |       CALL mpi_bcast (A, Asize, MP_FLOAT, MyMaster, OCN_COMM_WORLD,     &
      |                      2
Error: Type mismatch between actual argument at (1) and actual argument at (2) (INTEGER(4)/REAL(8)).
distribute.f90:1547:22:

 1547 |       CALL mpi_bcast (S(ng)%head, Nchars, MPI_BYTE, MyMaster,           &
      |                      1
......
 5516 |       CALL mpi_bcast (A, Asize, MP_FLOAT, MyMaster, OCN_COMM_WORLD,     &
      |                      2
Error: Type mismatch between actual argument at (1) and actual argument at (2) (CHARACTER(256)/REAL(8)).
distribute.f90:1558:22:

 1558 |       CALL mpi_bcast (S(ng)%base, Nchars, MPI_BYTE, MyMaster,           &
      |                      1
......
 5516 |       CALL mpi_bcast (A, Asize, MP_FLOAT, MyMaster, OCN_COMM_WORLD,     &
      |                      2
Error: Type mismatch between actual argument at (1) and actual argument at (2) (CHARACTER(256)/REAL(8)).
distribute.f90:1569:22:

 1569 |       CALL mpi_bcast (S(ng)%name, Nchars, MPI_BYTE, MyMaster,           &
      |                      1
......
 5516 |       CALL mpi_bcast (A, Asize, MP_FLOAT, MyMaster, OCN_COMM_WORLD,     &
      |                      2
Error: Type mismatch between actual argument at (1) and actual argument at (2) (CHARACTER(256)/REAL(8)).
distribute.f90:1580:22:

 1580 |       CALL mpi_bcast (S(ng)%files, Nchars, MPI_BYTE, MyMaster,          &
      |                      1
......
 5516 |       CALL mpi_bcast (A, Asize, MP_FLOAT, MyMaster, OCN_COMM_WORLD,     &
      |                      2
Error: Type mismatch between actual argument at (1) and actual argument at (2) (CHARACTER(256)/REAL(8)).
distribute.f90:1421:22:

 1421 |       CALL mpi_bcast (A, Nchars, MPI_BYTE, MyMaster, MyCOMM, MyError)
      |                      1
......
 5516 |       CALL mpi_bcast (A, Asize, MP_FLOAT, MyMaster, OCN_COMM_WORLD,     &
      |                      2
Error: Type mismatch between actual argument at (1) and actual argument at (2) (CHARACTER(0)/REAL(8)).
distribute.f90:1334:22:

 1334 |       CALL mpi_bcast (A, Nchars, MPI_BYTE, MyMaster, MyCOMM, MyError)
      |                      1
......
 5516 |       CALL mpi_bcast (A, Asize, MP_FLOAT, MyMaster, OCN_COMM_WORLD,     &
      |                      2
Error: Type mismatch between actual argument at (1) and actual argument at (2) (CHARACTER(0)/REAL(8)).
distribute.f90:1248:22:

 1248 |       CALL mpi_bcast (A, Nchars, MPI_BYTE, MyMaster, MyCOMM, MyError)
      |                      1
......
 5516 |       CALL mpi_bcast (A, Asize, MP_FLOAT, MyMaster, OCN_COMM_WORLD,     &
      |                      2
Error: Type mismatch between actual argument at (1) and actual argument at (2) (CHARACTER(0)/REAL(8)).
distribute.f90:1162:22:

 1162 |       CALL mpi_bcast (A, Nchars, MPI_BYTE, MyMaster, MyCOMM, MyError)
      |                      1
......
 5516 |       CALL mpi_bcast (A, Asize, MP_FLOAT, MyMaster, OCN_COMM_WORLD,     &
      |                      2
Error: Type mismatch between actual argument at (1) and actual argument at (2) (CHARACTER(0)/REAL(8)).
distribute.f90:1077:22:

 1077 |       CALL mpi_bcast (A, Npts, MPI_LOGICAL, MyMaster, MyCOMM, MyError)
      |                      1
......
 5516 |       CALL mpi_bcast (A, Asize, MP_FLOAT, MyMaster, OCN_COMM_WORLD,     &
      |                      2
Error: Type mismatch between actual argument at (1) and actual argument at (2) (LOGICAL(4)/REAL(8)).
distribute.f90:990:22:

  990 |       CALL mpi_bcast (A, Npts, MPI_LOGICAL, MyMaster, MyCOMM, MyError)
      |                      1
......
 5516 |       CALL mpi_bcast (A, Asize, MP_FLOAT, MyMaster, OCN_COMM_WORLD,     &
      |                      2
Error: Type mismatch between actual argument at (1) and actual argument at (2) (LOGICAL(4)/REAL(8)).
distribute.f90:906:22:

  906 |       CALL mpi_bcast (A, Npts, MPI_LOGICAL, MyMaster, MyCOMM, MyError)
      |                      1
......
 5516 |       CALL mpi_bcast (A, Asize, MP_FLOAT, MyMaster, OCN_COMM_WORLD,     &
      |                      2
Error: Type mismatch between actual argument at (1) and actual argument at (2) (LOGICAL(4)/REAL(8)).
distribute.f90:822:22:

  822 |       CALL mpi_bcast (A, Npts, MPI_INTEGER, MyMaster, MyCOMM, MyError)
      |                      1
......
 5516 |       CALL mpi_bcast (A, Asize, MP_FLOAT, MyMaster, OCN_COMM_WORLD,     &
      |                      2
Error: Type mismatch between actual argument at (1) and actual argument at (2) (INTEGER(4)/REAL(8)).
distribute.f90:736:22:

  736 |       CALL mpi_bcast (A, Npts, MPI_INTEGER, MyMaster, MyCOMM, MyError)
      |                      1
......
 5516 |       CALL mpi_bcast (A, Asize, MP_FLOAT, MyMaster, OCN_COMM_WORLD,     &
      |                      2
Error: Type mismatch between actual argument at (1) and actual argument at (2) (INTEGER(4)/REAL(8)).
distribute.f90:653:22:

  653 |       CALL mpi_bcast (A, Npts, MPI_INTEGER, MyMaster, OCN_COMM_WORLD,   &
      |                      1
......
 5516 |       CALL mpi_bcast (A, Asize, MP_FLOAT, MyMaster, OCN_COMM_WORLD,     &
      |                      2
Error: Type mismatch between actual argument at (1) and actual argument at (2) (INTEGER(4)/REAL(8)).
distribute.f90:224:22:

  224 |       CALL mpi_bcast (A, Npts, MP_FLOAT, MyMaster, MyCOMM, MyError)
      |                      1
......
 5516 |       CALL mpi_bcast (A, Asize, MP_FLOAT, MyMaster, OCN_COMM_WORLD,     &
      |                      2
Error: Rank mismatch between actual argument at (1) and actual argument at (2) (rank-1 and scalar)
make: *** [ROMS/Utility/Module.mk:16: /mypath/../roms_build/distribute.o] Error 1

jcwarner
Posts: 1200
Joined: Wed Dec 31, 2003 6:16 pm
Location: USGS, USA

Re: Compiling Error for COAWST

#6 Unread post by jcwarner »

are you still having this problem?
can you send the full output of the std out.
-j

stef
Posts: 192
Joined: Tue Mar 13, 2007 6:38 pm
Location: Independent researcher
Contact:

Re: Compiling Error for COAWST

#7 Unread post by stef »

(In case this is directed to me, not the original poster...)

For me everything seems to work using the flag mentioned above! Let me know if you still want the output. Thanks!

Post Reply