cp2k / dbcsr

DBCSR: Distributed Block Compressed Sparse Row matrix library
https://cp2k.github.io/dbcsr/
GNU General Public License v2.0
135 stars 46 forks source link

Error with mpich 4.1: Type mismatch in argument 'baseptr' at (1); passed TYPE(c_ptr) to INTEGER(4) #661

Closed barracuda156 closed 1 year ago

barracuda156 commented 1 year ago
:info:build FAILED: src/CMakeFiles/dbcsr.dir/mpi/dbcsr_mpiwrap.F.o src/dbcsr_mpiwrap.mod 
:info:build /opt/local/bin/mpif90-mpich-gcc12 -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_math_dbcsr/dbcsr/work/build/src/mpi -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_math_dbcsr/dbcsr/work/dbcsr-2.5.0/src/base -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_math_dbcsr/dbcsr/work/dbcsr-2.5.0/src -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_math_dbcsr/dbcsr/work/build/src -ffree-form -std=f2008ts -fimplicit-none -Werror=aliasing -Werror=ampersand -Werror=c-binding-type -Werror=intrinsic-shadow -Werror=intrinsics-std -Werror=line-truncation -Werror=tabs -Werror=target-lifetime -Werror=underflow -Werror=unused-but-set-parameter -Werror=unused-but-set-variable -Werror=unused-variable -Werror=unused-dummy-argument -Werror=conversion -Werror=zerotrip -Werror=uninitialized -Wno-maybe-uninitialized -Werror=unused-parameter -fallow-argument-mismatch -mmacosx-version-min=10.6 -Jsrc -fopenmp -Wno-error -fpreprocessed -c src/CMakeFiles/dbcsr.dir/mpi/dbcsr_mpiwrap.F-pp.f -o src/CMakeFiles/dbcsr.dir/mpi/dbcsr_mpiwrap.F.o
:info:build /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_math_dbcsr/dbcsr/work/dbcsr-2.5.0/src/mpi/dbcsr_mpiwrap.F:5299:65:
:info:build  5299 |          CALL MPI_ALLOC_MEM(mp_size, mp_info, mp_baseptr, mp_res)
:info:build       |                                                                 1
:info:build Error: Type mismatch in argument 'baseptr' at (1); passed TYPE(c_ptr) to INTEGER(4)
:info:build /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_math_dbcsr/dbcsr/work/dbcsr-2.5.0/src/mpi/dbcsr_mpiwrap.F:5299:65:
:info:build  5299 |          CALL MPI_ALLOC_MEM(mp_size, mp_info, mp_baseptr, mp_res)
:info:build       |                                                                 1
:info:build Error: Type mismatch in argument 'baseptr' at (1); passed TYPE(c_ptr) to INTEGER(4)
:info:build /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_math_dbcsr/dbcsr/work/dbcsr-2.5.0/src/mpi/dbcsr_mpiwrap.F:5299:65:
:info:build  5299 |          CALL MPI_ALLOC_MEM(mp_size, mp_info, mp_baseptr, mp_res)
:info:build       |                                                                 1
:info:build Error: Type mismatch in argument 'baseptr' at (1); passed TYPE(c_ptr) to INTEGER(4)
:info:build /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_math_dbcsr/dbcsr/work/dbcsr-2.5.0/src/mpi/dbcsr_mpiwrap.F:5299:65:
:info:build  5299 |          CALL MPI_ALLOC_MEM(mp_size, mp_info, mp_baseptr, mp_res)
:info:build       |                                                                 1
:info:build Error: Type mismatch in argument 'baseptr' at (1); passed TYPE(c_ptr) to INTEGER(4)
:info:build /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_math_dbcsr/dbcsr/work/dbcsr-2.5.0/src/mpi/dbcsr_mpiwrap.F:5299:65:
:info:build  5299 |          CALL MPI_ALLOC_MEM(mp_size, mp_info, mp_baseptr, mp_res)
:info:build       |                                                                 1
:info:build Error: Type mismatch in argument 'baseptr' at (1); passed TYPE(c_ptr) to INTEGER(4)
:info:build /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_math_dbcsr/dbcsr/work/dbcsr-2.5.0/src/mpi/dbcsr_mpiwrap.F:5299:65:
:info:build  5299 |          CALL MPI_ALLOC_MEM(mp_size, mp_info, mp_baseptr, mp_res)
:info:build       |                                                                 1
:info:build Error: Type mismatch in argument 'baseptr' at (1); passed TYPE(c_ptr) to INTEGER(4)
:info:build [224/346] /opt/local/bin/mpif90-mpich-gcc12 -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_math_dbcsr/dbcsr/work/build/src/tensors -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_math_dbcsr/dbcsr/work/dbcsr-2.5.0/src/base -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_math_dbcsr/dbcsr/work/dbcsr-2.5.0/src -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_math_dbcsr/dbcsr/work/build/src -ffree-form -std=f2008ts -fimplicit-none -Werror=aliasing -Werror=ampersand -Werror=c-binding-type -Werror=intrinsic-shadow -Werror=intrinsics-std -Werror=line-truncation -Werror=tabs -Werror=target-lifetime -Werror=underflow -Werror=unused-but-set-parameter -Werror=unused-but-set-variable -Werror=unused-variable -Werror=unused-dummy-argument -Werror=conversion -Werror=zerotrip -Werror=uninitialized -Wno-maybe-uninitialized -Werror=unused-parameter -fallow-argument-mismatch -mmacosx-version-min=10.6 -Jsrc -fopenmp -fpreprocessed -c src/CMakeFiles/dbcsr.dir/tensors/dbcsr_allocate_wrap.F-pp.f -o src/CMakeFiles/dbcsr.dir/tensors/dbcsr_allocate_wrap.F.o
:info:build ninja: build stopped: subcommand failed.
:info:build Command failed:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_math_dbcsr/dbcsr/work/build" && ninja -j2 all -j2 -v 
:info:build Exit code: 1
:error:build Failed to build dbcsr: command execution failed
:debug:build Error code: CHILDSTATUS 42158 1

With mpich 4.0.2 I get warnings instead:

/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_math_dbcsr/dbcsr/work/dbcsr-2.5.0/src/mpi/dbcsr_mpiwrap.F:5212:50:

 5212 |             CALL MPI_FILE_READ_AT_ALL(fh, offset, msg, msg_len, ${mpi_type1}$, MPI_STATUS_IGNORE, ierr)
      |                                                  1
......
 5234 |          CALL MPI_FILE_READ_AT_ALL(fh, offset, msg, 1, ${mpi_type1}$, MPI_STATUS_IGNORE, ierr)
      |                                               2   
Warning: Rank mismatch between actual argument at (1) and actual argument at (2) (scalar and rank-1)
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_math_dbcsr/dbcsr/work/dbcsr-2.5.0/src/mpi/dbcsr_mpiwrap.F:5157:51:

 5157 |             CALL MPI_FILE_WRITE_AT_ALL(fh, offset, msg, msg_len, ${mpi_type1}$, MPI_STATUS_IGNORE, ierr)
      |                                                   1
......
 5179 |          CALL MPI_FILE_WRITE_AT_ALL(fh, offset, msg, 1, ${mpi_type1}$, MPI_STATUS_IGNORE, ierr)
      |                                                2   
Warning: Rank mismatch between actual argument at (1) and actual argument at (2) (scalar and rank-1)
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_math_dbcsr/dbcsr/work/dbcsr-2.5.0/src/mpi/dbcsr_mpiwrap.F:5105:47:

 5105 |             CALL MPI_FILE_WRITE_AT(fh, offset, msg, msg_len, ${mpi_type1}$, MPI_STATUS_IGNORE, ierr)
      |                                               1
......
 5127 |          CALL MPI_FILE_WRITE_AT(fh, offset, msg, 1, ${mpi_type1}$, MPI_STATUS_IGNORE, ierr)
      |                                            2   
Warning: Rank mismatch between actual argument at (1) and actual argument at (2) (scalar and rank-1)
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_math_dbcsr/dbcsr/work/dbcsr-2.5.0/src/mpi/dbcsr_mpiwrap.F:4875:32:

 4873 |             CALL mpi_win_create(base(1), len, ${bytes1}$, MPI_INFO_NULL, comm, win, ierr)
      |                                2
 4874 |          ELSE
 4875 |             CALL mpi_win_create(foo, len, ${bytes1}$, MPI_INFO_NULL, comm, win, ierr)
      |                                1
Warning: Rank mismatch between actual argument at (1) and actual argument at (2) (scalar and rank-1)
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_math_dbcsr/dbcsr/work/dbcsr-2.5.0/src/mpi/dbcsr_mpiwrap.F:4831:27:

 4828 |             CALL mpi_irecv(msgout(1, 1), msglen, ${mpi_type1}$, source, my_tag, &
      |                           2
......
 4831 |             CALL mpi_irecv(foo, msglen, ${mpi_type1}$, source, my_tag, &
      |                           1
Warning: Rank mismatch between actual argument at (1) and actual argument at (2) (scalar and rank-1)
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_math_dbcsr/dbcsr/work/dbcsr-2.5.0/src/mpi/dbcsr_mpiwrap.F:4779:27:

 4779 |             CALL mpi_irecv(foo, msglen, ${mpi_type1}$, source, my_tag, &
      |                           1
......
 4828 |             CALL mpi_irecv(msgout(1, 1), msglen, ${mpi_type1}$, source, my_tag, &
      |                           2
Warning: Rank mismatch between actual argument at (1) and actual argument at (2) (scalar and rank-1)
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_math_dbcsr/dbcsr/work/dbcsr-2.5.0/src/mpi/dbcsr_mpiwrap.F:4728:27:

 4725 |             CALL mpi_isend(msgin(1, 1), msglen, ${mpi_type1}$, dest, my_tag, &
      |                           2
......
 4728 |             CALL mpi_isend(foo, msglen, ${mpi_type1}$, dest, my_tag, &
      |                           1
Warning: Rank mismatch between actual argument at (1) and actual argument at (2) (scalar and rank-1)
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_math_dbcsr/dbcsr/work/dbcsr-2.5.0/src/mpi/dbcsr_mpiwrap.F:4675:27:

 4675 |             CALL mpi_isend(foo, msglen, ${mpi_type1}$, dest, my_tag, &
      |                           1
......
 4725 |             CALL mpi_isend(msgin(1, 1), msglen, ${mpi_type1}$, dest, my_tag, &
      |                           2
Warning: Rank mismatch between actual argument at (1) and actual argument at (2) (scalar and rank-1)
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_math_dbcsr/dbcsr/work/dbcsr-2.5.0/src/mpi/dbcsr_mpiwrap.F:3959:29:

 3959 |          CALL MPI_IALLGATHER(msgout, scount, ${mpi_type1}$, &
      |                             1
......
 4285 |          CALL MPI_IALLGATHER(msgout, scount, ${mpi_type1}$, &
      |                             2
Warning: Rank mismatch between actual argument at (1) and actual argument at (2) (rank-1 and scalar)
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_math_dbcsr/dbcsr/work/dbcsr-2.5.0/src/mpi/dbcsr_mpiwrap.F:3917:28:

 3917 |          CALL MPI_ALLGATHER(msgout, scount, ${mpi_type1}$, &
      |                            1
......
 4106 |          CALL MPI_ALLGATHER(msgout, scount, ${mpi_type1}$, &
      |                            2
Warning: Rank mismatch between actual argument at (1) and actual argument at (2) (rank-1 and scalar)
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_math_dbcsr/dbcsr/work/dbcsr-2.5.0/src/mpi/dbcsr_mpiwrap.F:3876:28:

 3876 |          CALL MPI_ALLGATHER(msgout, scount, ${mpi_type1}$, &
      |                            1
......
 4106 |          CALL MPI_ALLGATHER(msgout, scount, ${mpi_type1}$, &
      |                            2
Warning: Rank mismatch between actual argument at (1) and actual argument at (2) (rank-1 and scalar)
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_math_dbcsr/dbcsr/work/dbcsr-2.5.0/src/mpi/dbcsr_mpiwrap.F:3712:25:

 3712 |          CALL mpi_gather(msg, msglen, ${mpi_type1}$, msg_gather, &
      |                         1
......
 3784 |          CALL mpi_gather(msg, msglen, ${mpi_type1}$, msg_gather, &
      |                         2
Warning: Rank mismatch between actual argument at (1) and actual argument at (2) (rank-1 and scalar)
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_math_dbcsr/dbcsr/work/dbcsr-2.5.0/src/mpi/dbcsr_mpiwrap.F:3601:61:

 3601 |          CALL mpi_iscatter(msg_scatter, msglen, ${mpi_type1}$, msg, &
      |                                                             1
......
 3637 |          CALL mpi_iscatter(msg_scatter, msglen, ${mpi_type1}$, msg, &
      |                                                             2
Warning: Rank mismatch between actual argument at (1) and actual argument at (2) (rank-1 and scalar)
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_math_dbcsr/dbcsr/work/dbcsr-2.5.0/src/mpi/dbcsr_mpiwrap.F:3538:42:

 3538 |          CALL mpi_allreduce(MPI_IN_PLACE, msg, msglen, ${mpi_type1}$, MPI_MIN, gid, ierr)
      |                                          1
......
 3568 |          CALL mpi_allreduce(MPI_IN_PLACE, msg, msglen, ${mpi_type1}$, MPI_PROD, gid, ierr)
      |                                          2
Warning: Rank mismatch between actual argument at (1) and actual argument at (2) (scalar and rank-1)
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_math_dbcsr/dbcsr/work/dbcsr-2.5.0/src/mpi/dbcsr_mpiwrap.F:3478:42:

 3478 |          CALL mpi_allreduce(MPI_IN_PLACE, msg, msglen, ${mpi_type1}$, MPI_MAX, gid, ierr)
      |                                          1
......
 3568 |          CALL mpi_allreduce(MPI_IN_PLACE, msg, msglen, ${mpi_type1}$, MPI_PROD, gid, ierr)
      |                                          2
Warning: Rank mismatch between actual argument at (1) and actual argument at (2) (scalar and rank-1)
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_math_dbcsr/dbcsr/work/dbcsr-2.5.0/src/mpi/dbcsr_mpiwrap.F:3294:45:

 3294 |             CALL mpi_allreduce(MPI_IN_PLACE, msg, msglen, ${mpi_type1}$, MPI_SUM, gid, ierr)
      |                                             1
......
 3568 |          CALL mpi_allreduce(MPI_IN_PLACE, msg, msglen, ${mpi_type1}$, MPI_PROD, gid, ierr)
      |                                          2   
Warning: Rank mismatch between actual argument at (1) and actual argument at (2) (scalar and rank-4)
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_math_dbcsr/dbcsr/work/dbcsr-2.5.0/src/mpi/dbcsr_mpiwrap.F:3265:45:

 3265 |             CALL mpi_allreduce(MPI_IN_PLACE, msg, msglen, ${mpi_type1}$, MPI_SUM, gid, ierr)
      |                                             1
......
 3568 |          CALL mpi_allreduce(MPI_IN_PLACE, msg, msglen, ${mpi_type1}$, MPI_PROD, gid, ierr)
      |                                          2   
Warning: Rank mismatch between actual argument at (1) and actual argument at (2) (scalar and rank-3)
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_math_dbcsr/dbcsr/work/dbcsr-2.5.0/src/mpi/dbcsr_mpiwrap.F:3161:45:

 3161 |             CALL mpi_allreduce(MPI_IN_PLACE, msg, msglen, ${mpi_type1}$, MPI_SUM, gid, ierr)
      |                                             1
......
 3568 |          CALL mpi_allreduce(MPI_IN_PLACE, msg, msglen, ${mpi_type1}$, MPI_PROD, gid, ierr)
      |                                          2   
Warning: Rank mismatch between actual argument at (1) and actual argument at (2) (scalar and rank-1)
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_math_dbcsr/dbcsr/work/dbcsr-2.5.0/src/mpi/dbcsr_mpiwrap.F:2988:25:

 2988 |          CALL mpi_ibcast(msg, msglen, ${mpi_type1}$, source, gid, request, ierr)
      |                         1
......
 3045 |          CALL mpi_ibcast(msg, msglen, ${mpi_type1}$, source, gid, request, ierr)
      |                         2
Warning: Rank mismatch between actual argument at (1) and actual argument at (2) (rank-1 and scalar)
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_math_dbcsr/dbcsr/work/dbcsr-2.5.0/src/mpi/dbcsr_mpiwrap.F:2955:24:

 2955 |          CALL mpi_bcast(msg, msglen, ${mpi_type1}$, source, gid, ierr)
      |                        1
......
 3100 |          CALL mpi_bcast(msg, msglen, ${mpi_type1}$, source, gid, ierr)
      |                        2
Warning: Rank mismatch between actual argument at (1) and actual argument at (2) (rank-1 and scalar)
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_math_dbcsr/dbcsr/work/dbcsr-2.5.0/src/mpi/dbcsr_mpiwrap.F:2878:23:

 2878 |          CALL mpi_recv(msg, msglen, ${mpi_type1}$, source, tag, gid, status, ierr)
      |                       1
......
 2917 |          CALL mpi_recv(msg, msglen, ${mpi_type1}$, source, tag, gid, status, ierr)
      |                       2
Warning: Rank mismatch between actual argument at (1) and actual argument at (2) (rank-1 and scalar)
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_math_dbcsr/dbcsr/work/dbcsr-2.5.0/src/mpi/dbcsr_mpiwrap.F:2806:23:

 2806 |          CALL mpi_send(msg, msglen, ${mpi_type1}$, dest, tag, gid, ierr)
      |                       1
......
 2837 |          CALL mpi_send(msg, msglen, ${mpi_type1}$, dest, tag, gid, ierr)
      |                       2
Warning: Rank mismatch between actual argument at (1) and actual argument at (2) (rank-1 and scalar)
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_math_dbcsr/dbcsr/work/dbcsr-2.5.0/src/mpi/dbcsr_mpiwrap.F:5317:27-27:

 5317 |          CALL MPI_FREE_MEM(DATA, mp_res)
      |                           1
Warning: Type mismatch between actual argument at (1) and actual argument at (2) (COMPLEX(8)/COMPLEX(4)).
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_math_dbcsr/dbcsr/work/dbcsr-2.5.0/src/mpi/dbcsr_mpiwrap.F:5261:30-30:

 5261 |          CALL MPI_Get_address(ptr, type_descriptor%base, ierr)
      |                              1
Warning: Type mismatch between actual argument at (1) and actual argument at (2) (COMPLEX(8)/COMPLEX(4)).
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_math_dbcsr/dbcsr/work/dbcsr-2.5.0/src/mpi/dbcsr_mpiwrap.F:5234:47-47:

 5234 |          CALL MPI_FILE_READ_AT_ALL(fh, offset, msg, 1, ${mpi_type1}$, MPI_STATUS_IGNORE, ierr)
      |                                               1
Warning: Type mismatch between actual argument at (1) and actual argument at (2) (COMPLEX(8)/COMPLEX(4)).
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_math_dbcsr/dbcsr/work/dbcsr-2.5.0/src/mpi/dbcsr_mpiwrap.F:5179:48-48:

 5179 |          CALL MPI_FILE_WRITE_AT_ALL(fh, offset, msg, 1, ${mpi_type1}$, MPI_STATUS_IGNORE, ierr)
      |                                                1
Warning: Type mismatch between actual argument at (1) and actual argument at (2) (COMPLEX(8)/COMPLEX(4)).
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_math_dbcsr/dbcsr/work/dbcsr-2.5.0/src/mpi/dbcsr_mpiwrap.F:5127:44-44:

 5127 |          CALL MPI_FILE_WRITE_AT(fh, offset, msg, 1, ${mpi_type1}$, MPI_STATUS_IGNORE, ierr)
      |                                            1
Warning: Type mismatch between actual argument at (1) and actual argument at (2) (COMPLEX(8)/COMPLEX(4)).
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_math_dbcsr/dbcsr/work/dbcsr-2.5.0/src/mpi/dbcsr_mpiwrap.F:4952:29-29:

 4952 |                CALL mpi_rget(base(1), origin_len, handle_origin_datatype, source, disp_aint, &
      |                             1
Warning: Type mismatch between actual argument at (1) and actual argument at (2) (COMPLEX(8)/COMPLEX(4)).
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_math_dbcsr/dbcsr/work/dbcsr-2.5.0/src/mpi/dbcsr_mpiwrap.F:4873:32-32:

 4873 |             CALL mpi_win_create(base(1), len, ${bytes1}$, MPI_INFO_NULL, comm, win, ierr)
      |                                1
Warning: Type mismatch between actual argument at (1) and actual argument at (2) (COMPLEX(8)/COMPLEX(4)).
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_math_dbcsr/dbcsr/work/dbcsr-2.5.0/src/mpi/dbcsr_mpiwrap.F:4828:27-27:

 4828 |             CALL mpi_irecv(msgout(1, 1), msglen, ${mpi_type1}$, source, my_tag, &
      |                           1
Warning: Type mismatch between actual argument at (1) and actual argument at (2) (COMPLEX(8)/COMPLEX(4)).
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_math_dbcsr/dbcsr/work/dbcsr-2.5.0/src/mpi/dbcsr_mpiwrap.F:4725:27-27:

 4725 |             CALL mpi_isend(msgin(1, 1), msglen, ${mpi_type1}$, dest, my_tag, &
      |                           1
Warning: Type mismatch between actual argument at (1) and actual argument at (2) (COMPLEX(8)/COMPLEX(4)).
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_math_dbcsr/dbcsr/work/dbcsr-2.5.0/src/mpi/dbcsr_mpiwrap.F:4499:27-27:

 4499 |          CALL mpi_sendrecv(msgin, msglen_in, ${mpi_type1}$, dest, send_tag, msgout, &
      |                           1
Warning: Type mismatch between actual argument at (1) and actual argument at (2) (COMPLEX(8)/COMPLEX(4)).
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_math_dbcsr/dbcsr/work/dbcsr-2.5.0/src/mpi/dbcsr_mpiwrap.F:4499:74-81:

 4499 |          CALL mpi_sendrecv(msgin, msglen_in, ${mpi_type1}$, dest, send_tag, msgout, &
      |                                                                          2      1
Warning: Type mismatch between actual argument at (1) and actual argument at (2) (COMPLEX(8)/COMPLEX(4)).
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_math_dbcsr/dbcsr/work/dbcsr-2.5.0/src/mpi/dbcsr_mpiwrap.F:4464:30-30:

 4464 |          CALL MPI_IALLGATHERV(msgout, scount, ${mpi_type1}$, msgin, rcount, &
      |                              1
Warning: Type mismatch between actual argument at (1) and actual argument at (2) (COMPLEX(8)/COMPLEX(4)).
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_math_dbcsr/dbcsr/work/dbcsr-2.5.0/src/mpi/dbcsr_mpiwrap.F:4464:59-66:

 4464 |          CALL MPI_IALLGATHERV(msgout, scount, ${mpi_type1}$, msgin, rcount, &
      |                                                           2      1
Warning: Type mismatch between actual argument at (1) and actual argument at (2) (COMPLEX(8)/COMPLEX(4)).
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_math_dbcsr/dbcsr/work/dbcsr-2.5.0/src/mpi/dbcsr_mpiwrap.F:4335:29-29:

 4335 |          CALL MPI_ALLGATHERV(msgout, scount, ${mpi_type1}$, msgin, rcount, &
      |                             1
Warning: Type mismatch between actual argument at (1) and actual argument at (2) (COMPLEX(8)/COMPLEX(4)).
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_math_dbcsr/dbcsr/work/dbcsr-2.5.0/src/mpi/dbcsr_mpiwrap.F:4335:58-65:

 4335 |          CALL MPI_ALLGATHERV(msgout, scount, ${mpi_type1}$, msgin, rcount, &
      |                                                          2      1
Warning: Type mismatch between actual argument at (1) and actual argument at (2) (COMPLEX(8)/COMPLEX(4)).
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_math_dbcsr/dbcsr/work/dbcsr-2.5.0/src/mpi/dbcsr_mpiwrap.F:4285:29-29:

 4285 |          CALL MPI_IALLGATHER(msgout, scount, ${mpi_type1}$, &
      |                             1
Warning: Type mismatch between actual argument at (1) and actual argument at (2) (COMPLEX(8)/COMPLEX(4)).
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_math_dbcsr/dbcsr/work/dbcsr-2.5.0/src/mpi/dbcsr_mpiwrap.F:4286:29-29:

 4286 |                              msgin, rcount, ${mpi_type1}$, &
      |                             1
Warning: Type mismatch between actual argument at (1) and actual argument at (2) (COMPLEX(8)/COMPLEX(4)).
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_math_dbcsr/dbcsr/work/dbcsr-2.5.0/src/mpi/dbcsr_mpiwrap.F:4106:28-28:

 4106 |          CALL MPI_ALLGATHER(msgout, scount, ${mpi_type1}$, &
      |                            1
Warning: Type mismatch between actual argument at (1) and actual argument at (2) (COMPLEX(8)/COMPLEX(4)).
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_math_dbcsr/dbcsr/work/dbcsr-2.5.0/src/mpi/dbcsr_mpiwrap.F:4107:28-28:

 4107 |                             msgin, rcount, ${mpi_type1}$, &
      |                            1
Warning: Type mismatch between actual argument at (1) and actual argument at (2) (COMPLEX(8)/COMPLEX(4)).
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_math_dbcsr/dbcsr/work/dbcsr-2.5.0/src/mpi/dbcsr_mpiwrap.F:3831:26-26:

 3831 |          CALL mpi_gatherv(sendbuf, sendcount, ${mpi_type1}$, &
      |                          1
Warning: Type mismatch between actual argument at (1) and actual argument at (2) (COMPLEX(8)/COMPLEX(4)).
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_math_dbcsr/dbcsr/work/dbcsr-2.5.0/src/mpi/dbcsr_mpiwrap.F:3832:26-26:

 3832 |                           recvbuf, recvcounts, displs, ${mpi_type1}$, &
      |                          1
Warning: Type mismatch between actual argument at (1) and actual argument at (2) (COMPLEX(8)/COMPLEX(4)).
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_math_dbcsr/dbcsr/work/dbcsr-2.5.0/src/mpi/dbcsr_mpiwrap.F:3784:25-25:

 3784 |          CALL mpi_gather(msg, msglen, ${mpi_type1}$, msg_gather, &
      |                         1
Warning: Type mismatch between actual argument at (1) and actual argument at (2) (COMPLEX(8)/COMPLEX(4)).
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_math_dbcsr/dbcsr/work/dbcsr-2.5.0/src/mpi/dbcsr_mpiwrap.F:3784:51-58:

 3784 |          CALL mpi_gather(msg, msglen, ${mpi_type1}$, msg_gather, &
      |                                                   2      1
Warning: Type mismatch between actual argument at (1) and actual argument at (2) (COMPLEX(8)/COMPLEX(4)).
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_math_dbcsr/dbcsr/work/dbcsr-2.5.0/src/mpi/dbcsr_mpiwrap.F:3673:28-28:

 3673 |          CALL mpi_iscatterv(msg_scatter, sendcounts, displs, ${mpi_type1}$, msg, &
      |                            1
Warning: Type mismatch between actual argument at (1) and actual argument at (2) (COMPLEX(8)/COMPLEX(4)).
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_math_dbcsr/dbcsr/work/dbcsr-2.5.0/src/mpi/dbcsr_mpiwrap.F:3673:74-81:

 3673 |          CALL mpi_iscatterv(msg_scatter, sendcounts, displs, ${mpi_type1}$, msg, &
      |                                                                          2      1
Warning: Type mismatch between actual argument at (1) and actual argument at (2) (COMPLEX(8)/COMPLEX(4)).
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_math_dbcsr/dbcsr/work/dbcsr-2.5.0/src/mpi/dbcsr_mpiwrap.F:3637:27-27:

 3637 |          CALL mpi_iscatter(msg_scatter, msglen, ${mpi_type1}$, msg, &
      |                           1
Warning: Type mismatch between actual argument at (1) and actual argument at (2) (COMPLEX(8)/COMPLEX(4)).
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_math_dbcsr/dbcsr/work/dbcsr-2.5.0/src/mpi/dbcsr_mpiwrap.F:3637:61-68:

 3637 |          CALL mpi_iscatter(msg_scatter, msglen, ${mpi_type1}$, msg, &
      |                                                             2      1
Warning: Type mismatch between actual argument at (1) and actual argument at (2) (COMPLEX(8)/COMPLEX(4)).
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_math_dbcsr/dbcsr/work/dbcsr-2.5.0/src/mpi/dbcsr_mpiwrap.F:3568:42-42:

 3568 |          CALL mpi_allreduce(MPI_IN_PLACE, msg, msglen, ${mpi_type1}$, MPI_PROD, gid, ierr)
      |                                          1
Warning: Type mismatch between actual argument at (1) and actual argument at (2) (COMPLEX(8)/COMPLEX(4)).
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_math_dbcsr/dbcsr/work/dbcsr-2.5.0/src/mpi/dbcsr_mpiwrap.F:3418:26-26:

 3418 |             CALL mpi_scan(msg, res, msglen, ${mpi_type1}$, MPI_SUM, gid, ierr)
      |                          1
Warning: Type mismatch between actual argument at (1) and actual argument at (2) (COMPLEX(8)/COMPLEX(4)).
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_math_dbcsr/dbcsr/work/dbcsr-2.5.0/src/mpi/dbcsr_mpiwrap.F:3418:31-31:

 3418 |             CALL mpi_scan(msg, res, msglen, ${mpi_type1}$, MPI_SUM, gid, ierr)
      |                               1
Warning: Type mismatch between actual argument at (1) and actual argument at (2) (COMPLEX(8)/COMPLEX(4)).
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_math_dbcsr/dbcsr/work/dbcsr-2.5.0/src/mpi/dbcsr_mpiwrap.F:3378:28-28:

 3378 |             CALL mpi_reduce(msg, res, msglen, ${mpi_type1}$, MPI_SUM, root, gid, ierr)
      |                            1
Warning: Type mismatch between actual argument at (1) and actual argument at (2) (COMPLEX(8)/COMPLEX(4)).
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_math_dbcsr/dbcsr/work/dbcsr-2.5.0/src/mpi/dbcsr_mpiwrap.F:3378:33-33:

 3378 |             CALL mpi_reduce(msg, res, msglen, ${mpi_type1}$, MPI_SUM, root, gid, ierr)
      |                                 1
Warning: Type mismatch between actual argument at (1) and actual argument at (2) (COMPLEX(8)/COMPLEX(4)).
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_math_dbcsr/dbcsr/work/dbcsr-2.5.0/src/mpi/dbcsr_mpiwrap.F:3194:46-46:

 3194 |             CALL mpi_iallreduce(MPI_IN_PLACE, msg, msglen, ${mpi_type1}$, MPI_SUM, gid, request, ierr)
      |                                              1
Warning: Type mismatch between actual argument at (1) and actual argument at (2) (COMPLEX(8)/COMPLEX(4)).
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_math_dbcsr/dbcsr/work/dbcsr-2.5.0/src/mpi/dbcsr_mpiwrap.F:3100:24-24:

 3100 |          CALL mpi_bcast(msg, msglen, ${mpi_type1}$, source, gid, ierr)
      |                        1
Warning: Type mismatch between actual argument at (1) and actual argument at (2) (COMPLEX(8)/COMPLEX(4)).
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_math_dbcsr/dbcsr/work/dbcsr-2.5.0/src/mpi/dbcsr_mpiwrap.F:3045:25-25:

 3045 |          CALL mpi_ibcast(msg, msglen, ${mpi_type1}$, source, gid, request, ierr)
      |                         1
Warning: Type mismatch between actual argument at (1) and actual argument at (2) (COMPLEX(8)/COMPLEX(4)).
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_math_dbcsr/dbcsr/work/dbcsr-2.5.0/src/mpi/dbcsr_mpiwrap.F:2917:23-23:

 2917 |          CALL mpi_recv(msg, msglen, ${mpi_type1}$, source, tag, gid, status, ierr)
      |                       1
Warning: Type mismatch between actual argument at (1) and actual argument at (2) (COMPLEX(8)/COMPLEX(4)).
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_math_dbcsr/dbcsr/work/dbcsr-2.5.0/src/mpi/dbcsr_mpiwrap.F:2837:23-23:

 2837 |          CALL mpi_send(msg, msglen, ${mpi_type1}$, dest, tag, gid, ierr)
      |                       1
Warning: Type mismatch between actual argument at (1) and actual argument at (2) (COMPLEX(8)/COMPLEX(4)).
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_math_dbcsr/dbcsr/work/dbcsr-2.5.0/src/mpi/dbcsr_mpiwrap.F:2768:27-27:

 2768 |          CALL mpi_alltoall(sb, count, ${mpi_type1}$, &
      |                           1
Warning: Type mismatch between actual argument at (1) and actual argument at (2) (COMPLEX(8)/COMPLEX(4)).
hfp commented 1 year ago

@alazzaro: for instance dbcsr_mpiwrap.F:5299, could it be we need to use C_LOC(mp_baseptr)? Currently it seems we rely on passing arguments by pointer, i.e., mp_baseptr is passed by pointer (and hence it should work also).

@barracuda156: I wonder if the basepointer issue is "just a warning" or if the related code actually crashes...

barracuda156 commented 1 year ago

@barracuda156: I wonder if the basepointer issue is "just a warning" or if the related code actually crashes...

@hfp There is a topic with test results: https://github.com/cp2k/dbcsr/issues/645 If there is something more specific to check, I could do that.

barracuda156 commented 1 year ago

@alazzaro Could you please take a look?

alazzaro commented 1 year ago

@barracuda156 I'm sorry, it cannot be today, likely next week. MPICH 4.1 is still not supported in our tests, so it is not a surprise you see this error.

fstein93 commented 1 year ago

I am currently working on the MPI backend and try to upgrade DBCSR to the new mpi_f08 module. The warnings might be related to missing explicit interfaces on the library side which are to be expected here. I wonder about the errors in case of MPICH 4.1. The MPI standard (including MPI 3.0 and MPI 3.1) requires in case of the mpi module (not mpi_f08) to overload MPI_Alloc_mem with a TYPE(C_PTR) version if TYPE(C_PTR) is available compiler-wise. DBCSR's wrapper is in accordance to the example provided in the standard itself and thus should work in my opinion. I am still glancing through Google what it might be related to.

hfp commented 1 year ago

Maybe unrelated, sometimes it matters if TYPE(C_PTR) is passed as TYPE(C_PTR), VALUE because the opposite side expects the pointer address and not a pointer to the pointer...

fstein93 commented 1 year ago

I have observed it already in a different context but in the given case, even the MPI standard does not use the VALUE attribute indicating that actually a pointer to the pointer is expected. I have just checked the build-files of MPICH 4.0.3. In case of the mpi_f08 module, TYPE(C_PTR) is used whereas for the mpi module, MPICH uses a placeholder which seems to be any possible type/kind/rank-combination (not standard-compliant). My impression is that we should switch to the mpi_f08 module. I have code ready based on my currently opened PR. From CP2K, it could be that MPICH is not compatible with certain versions of gcc, but it worked with IntelMPI and OpenMPI (see cp2k/cp2k#2486).

alazzaro commented 1 year ago

@barracuda156 I've just merged https://github.com/cp2k/dbcsr/pull/678 so now the problem of this issue should go away if you build DCBSR with -DUSE_MPI_F08=ON. Can you confirm that?

barracuda156 commented 1 year ago

@barracuda156 I've just merged #678 so now the problem of this issue should go away if you build DCBSR with -DUSE_MPI_F08=ON. Can you confirm that?

Thank you very much! I will test that tonight.

barracuda156 commented 1 year ago

@alazzaro Unfortunately, still fails:

FAILED: src/CMakeFiles/dbcsr.dir/mpi/dbcsr_mpiwrap.F.o src/dbcsr_mpiwrap.mod 
/opt/local/bin/mpif90-mpich-gcc12 -I/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_math_dbcsr/dbcsr/work/build/src/mpi -I/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_math_dbcsr/dbcsr/work/dbcsr-397bf0f80c293a0c6088a1314931a748cff4b5b6/src/base -I/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_math_dbcsr/dbcsr/work/dbcsr-397bf0f80c293a0c6088a1314931a748cff4b5b6/src -I/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_math_dbcsr/dbcsr/work/build/src -ffree-form -std=f2008ts -fimplicit-none -Werror=aliasing -Werror=ampersand -Werror=c-binding-type -Werror=intrinsic-shadow -Werror=intrinsics-std -Werror=line-truncation -Werror=tabs -Werror=target-lifetime -Werror=underflow -Werror=unused-but-set-parameter -Werror=unused-but-set-variable -Werror=unused-variable -Werror=unused-dummy-argument -Werror=conversion -Werror=zerotrip -Werror=uninitialized -Wno-maybe-uninitialized -Werror=unused-parameter -fallow-argument-mismatch -mmacosx-version-min=10.6 -Jsrc -fPIC -fopenmp -Wno-error -fpreprocessed -c src/CMakeFiles/dbcsr.dir/mpi/dbcsr_mpiwrap.F-pp.f -o src/CMakeFiles/dbcsr.dir/mpi/dbcsr_mpiwrap.F.o
/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_math_dbcsr/dbcsr/work/dbcsr-397bf0f80c293a0c6088a1314931a748cff4b5b6/src/mpi/dbcsr_mpiwrap.F:5543:65:

 5543 |          CALL MPI_ALLOC_MEM(mp_size, mp_info, mp_baseptr, mp_res)
      |                                                                 1
Error: Type mismatch in argument 'baseptr' at (1); passed TYPE(c_ptr) to INTEGER(4)
/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_math_dbcsr/dbcsr/work/dbcsr-397bf0f80c293a0c6088a1314931a748cff4b5b6/src/mpi/dbcsr_mpiwrap.F:5543:65:

 5543 |          CALL MPI_ALLOC_MEM(mp_size, mp_info, mp_baseptr, mp_res)
      |                                                                 1
Error: Type mismatch in argument 'baseptr' at (1); passed TYPE(c_ptr) to INTEGER(4)
/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_math_dbcsr/dbcsr/work/dbcsr-397bf0f80c293a0c6088a1314931a748cff4b5b6/src/mpi/dbcsr_mpiwrap.F:5543:65:

 5543 |          CALL MPI_ALLOC_MEM(mp_size, mp_info, mp_baseptr, mp_res)
      |                                                                 1
Error: Type mismatch in argument 'baseptr' at (1); passed TYPE(c_ptr) to INTEGER(4)
/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_math_dbcsr/dbcsr/work/dbcsr-397bf0f80c293a0c6088a1314931a748cff4b5b6/src/mpi/dbcsr_mpiwrap.F:5543:65:

 5543 |          CALL MPI_ALLOC_MEM(mp_size, mp_info, mp_baseptr, mp_res)
      |                                                                 1
Error: Type mismatch in argument 'baseptr' at (1); passed TYPE(c_ptr) to INTEGER(4)
/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_math_dbcsr/dbcsr/work/dbcsr-397bf0f80c293a0c6088a1314931a748cff4b5b6/src/mpi/dbcsr_mpiwrap.F:5543:65:

 5543 |          CALL MPI_ALLOC_MEM(mp_size, mp_info, mp_baseptr, mp_res)
      |                                                                 1
Error: Type mismatch in argument 'baseptr' at (1); passed TYPE(c_ptr) to INTEGER(4)
/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_math_dbcsr/dbcsr/work/dbcsr-397bf0f80c293a0c6088a1314931a748cff4b5b6/src/mpi/dbcsr_mpiwrap.F:5543:65:

 5543 |          CALL MPI_ALLOC_MEM(mp_size, mp_info, mp_baseptr, mp_res)
      |                                                                 1
Error: Type mismatch in argument 'baseptr' at (1); passed TYPE(c_ptr) to INTEGER(4)
[239/346] /opt/local/bin/mpicxx-mpich-gcc12  -I/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_math_dbcsr/dbcsr/work/build/src -I/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_math_dbcsr/dbcsr/work/dbcsr-397bf0f80c293a0c6088a1314931a748cff4b5b6/src -pipe -Os -DNDEBUG -I/opt/local/include -D_GLIBCXX_USE_CXX11_ABI=0 -std=gnu++11 -arch ppc -mmacosx-version-min=10.6 -MD -MT tests/CMakeFiles/dbcsr_test.dir/dbcsr_test.cpp.o -MF tests/CMakeFiles/dbcsr_test.dir/dbcsr_test.cpp.o.d -o tests/CMakeFiles/dbcsr_test.dir/dbcsr_test.cpp.o -c /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_math_dbcsr/dbcsr/work/dbcsr-397bf0f80c293a0c6088a1314931a748cff4b5b6/tests/dbcsr_test.cpp

This is the latest commit DBCSR, gcc 12.3.0, mpich-gcc12 @4.1.1_0+fortran

To the config in the portfile https://github.com/macports/macports-ports/blob/master/math/dbcsr/Portfile I have added -DUSE_MPI_F08=ON.

mkrack commented 1 year ago

@alazzaro Building DBCSR with MPICH 4.1.2 and GCC 13.1.0 using the cmake flag -DUSE_MPI_F08=ON works fine for me. With -DUSE_MPI_F08=OFF, compilation errors as shown above and as reported in the CP2K issue #2808 occur: Error: Type mismatch in argument 'baseptr'. However, make test reports that one test (test 18 out of 19) is failing, but that is also the case with MPICH 4.0.3.

alazzaro commented 1 year ago

@mkrack thanks for confirmation, I did a similar test on MacOS (GCC 13.1, MPICH 4.1.2) and it works.

@barracuda156 just for confirmation, I don't see -DUSE_MPI_F08=ON in https://github.com/macports/macports-ports/blob/master/math/dbcsr/Portfile.... There is another interesting consideration. I used brew to install MPICH. When I use -DUSE_MPI_F08=ON, cmake reports the following:

-- Found MPI: TRUE (found version "4.0") found components: C CXX Fortran 
CMake Warning at CMakeLists.txt:203 (message):
  The listed MPI implementation does not provide the required mpi_f08.mod
  interface.  The Fortran 90 bindings will be used instead.

So basically the brew version of MPICH is missing the F08 interface and we are back to the original problem of the F77 MPI interface (we will fix it). Can you check your MPI has the F08 module? My understanding is that only new GCC can compile MPICH with F08 support (see for example here). In my case I have to recompile MPICH via:

brew reinstall --build-from-source mpich

to make sure I have the F08 module.

barracuda156 commented 1 year ago

@alazzaro This is an awesome point. Indeed, it is disabled: https://github.com/macports/macports-ports/blob/100bdfdca9908a07bb07a92663434f401c1f71f9/science/mpich/Portfile#L179-L180 I recall taking part in the related discussion – we disabled it for a reason, it failed to build.

Need to review why it failed, but we do have new GCC (all tested systems use 12.3.0 now, including my PowerPC ones).

barracuda156 commented 1 year ago

@alazzaro I have built MPICH 4.1.2 with enabled F08 now, and DBCSR built fine. Your solution works.

alazzaro commented 1 year ago

OK, then we have a solution.

My summary is the following:

@barracuda156 is this something reasonable for you? In your case it requires MPICH 4.1 with F08 support, add the flag -DUSE_MPI_F08=ON and a recent GCC compiler.

I would like to thank @fstein93 who did the F08 porting of the MPI code and @mkrack for testing it.

barracuda156 commented 1 year ago

@alazzaro I do not control MPICH port in Macports, while I am a maintainer of DBCSR port, so I can only say I hope that will work. I have requested maintainers of MPICH to enable F08 in the next update to the port (that will have to be tested on other systems – I only verified it builds for me locally). If that is done, I will add the fix to DBCSR, so that it can be built again normally.

Requirement for a new GCC will temporarily leave PowerPC builds broken on < 10.6, but I plan to update those to GCC 12 anyway, hopefully soon. (Technically everything ready for that, but changes to toolchain aren’t the easiest to push through.)

alazzaro commented 1 year ago

Well, this is only required for the new MPICH 4.1. In all other cases, the default will work...

barracuda156 commented 1 year ago

Well, this is only required for the new MPICH 4.1. In all other cases, the default will work...

Well, MPICH 4.x is the current reality. (Introducing back a legacy MPICH just to build one port is too much. I hope we can sort out enabling F08 instead.)

alazzaro commented 1 year ago

I'm going to close this issue, please open a new for further discussions

haampie commented 11 months ago

@alazzaro what's the current status of this?

I'm running into this issue with spack install dbcsr@2.6.0 ^mpich@4.1.2 and would like to add the relevant conflicts / defines.

So:

  1. dbcsr < 2.6.0 doesn't have the USE_MPI_F08 define, meaning it's incompatible with all mpich 4.1 and higher? Or is it also conditional on the underlying gcc?
  2. for dbcsr 2.6.0 and above, it's sufficient to set -DUSE_MPI_F08=ON when using mpich@4.1: for all compilers? Or only recent gcc?
alazzaro commented 11 months ago

The problem is in the new MPICH, so nothing to do with compilers. Saying that, only new compilers support the F08 API.

haampie commented 11 months ago

Could you take a look at https://github.com/spack/spack/pull/40494?

alazzaro commented 11 months ago

Could you take a look at spack/spack#40494?

Seems reasonable. Do you have any other question?

haampie commented 11 months ago

Do you have any other question?

I didn't understand whether the CP2K build issue with mpich 4.1 is because CP2K builds vendored DBCSR and hits the issue in this thread, or because it also needs fixes inside CP2K itself?

alazzaro commented 11 months ago

The latter... this is due to MPICH 4.1 to be strictly complainant with the standard, therefore they enforce the full F77 interface, unless you ask for the F08. You get the first error in DBCSR simply because it is the first to compile...

barracuda156 commented 11 months ago

For the record, Macports still stuck with non-F08 MPICH, waiting for it to be updated. Locally I have MPICH 4.1.2 with F08 and gcc13, works fine on the old 10.6 PowerPC :)