jeffhammond / vapaa

A standalone implementation of the MPI Fortran 2018 module
MIT License
19 stars 1 forks source link

use correct names for private fields of OMPI status #44

Closed jeffhammond closed 2 weeks ago

jeffhammond commented 2 weeks ago

@ivan-pi try this please

ivan-pi commented 2 weeks ago

The file mpi_datatype.c passes now, but an error pops up in a different place:

ifx -warn all -g -std08 -DHAVE_CFI -fPIE -Os -c mpi_status_f.F90
mpi_status_f.F90(13): warning #6843: A dummy argument with an explicit INTENT(OUT) declaration is not given an explicit value.   [COUNT]
        subroutine MPI_Status_set_elements_f08(status, datatype, count, ierror)
-----------------------------------------------------------------^
mpicc -Wall -Wextra -Werror -g -std=c11 -DHAVE_CFI -fPIE -Os -c mpi_core.c
mpi_core.c: In function 'C_MPI_Init':
mpi_core.c:23:5: error: 'MPI_Errhandler_set' is deprecated: MPI_Errhandler_set was removed in MPI-3.0.  Use MPI_Comm_set_errhandler instead.  continuing... [-Werror=deprecated-declarations]
   23 |     MPI_Errhandler_set(MPI_COMM_WORLD, MPI_ERRORS_RETURN);
      |     ^~~~~~~~~~~~~~~~~~
In file included from mpi_core.c:6:
/dss/dsshome1/lrz/sys/spack/release/23.1.0/opt/haswell/openmpi/4.1.5-gcc-l2ivcy3/include/mpi.h:2838:20: note: declared here
 2838 | OMPI_DECLSPEC  int MPI_Errhandler_set(MPI_Comm comm, MPI_Errhandler errhandler)
      |                    ^~~~~~~~~~~~~~~~~~
mpi_core.c:24:5: error: 'MPI_Errhandler_set' is deprecated: MPI_Errhandler_set was removed in MPI-3.0.  Use MPI_Comm_set_errhandler instead.  continuing... [-Werror=deprecated-declarations]
   24 |     MPI_Errhandler_set(MPI_COMM_SELF, MPI_ERRORS_RETURN);
      |     ^~~~~~~~~~~~~~~~~~
/dss/dsshome1/lrz/sys/spack/release/23.1.0/opt/haswell/openmpi/4.1.5-gcc-l2ivcy3/include/mpi.h:2838:20: note: declared here
 2838 | OMPI_DECLSPEC  int MPI_Errhandler_set(MPI_Comm comm, MPI_Errhandler errhandler)
      |                    ^~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors

The fix is

diff --git a/source/mpi_core.c b/source/mpi_core.c
index e821b3f..16bc20a 100644
--- a/source/mpi_core.c
+++ b/source/mpi_core.c
@@ -20,8 +20,8 @@ void C_MPI_Init(int * ierror)
     C_MPI_RC_FIX(*ierror);

     // DEBUG
-    MPI_Errhandler_set(MPI_COMM_WORLD, MPI_ERRORS_RETURN);
-    MPI_Errhandler_set(MPI_COMM_SELF, MPI_ERRORS_RETURN);
+    MPI_Comm_set_errhandler(MPI_COMM_WORLD, MPI_ERRORS_RETURN);
+    MPI_Comm_set_errhandler(MPI_COMM_SELF, MPI_ERRORS_RETURN);
 }

Next breakage,

mpicc -Wall -Wextra -Werror -g -std=c11 -DHAVE_CFI -fPIE -Os -c mpi_p2p.c
mpi_p2p.c: In function 'CFI_MPI_Sendrecv':
mpi_p2p.c:451:32: error: 'desc' undeclared (first use in this function); did you mean 'rdesc'?
  451 |     if (1 == CFI_is_contiguous(desc)) {
      |                                ^~~~
      |                                rdesc
mpi_p2p.c:451:32: note: each undeclared identifier is reported only once for each function it appears in

(Not sure if it should be sdesc or rdesc?)

And finally,

ifx -warn all -g -std08 -DHAVE_CFI -fPIE -Os -c mpi_p2p_f.F90
mpi_p2p_f.F90(324): remark #5140: Unrecognized directive
!dir$ ignore_tkr buffer
-----------------------^
mpi_p2p_f.F90(361): remark #5140: Unrecognized directive
!dir$ ignore_tkr buffer
-----------------------^
mpi_p2p_f.F90(398): remark #5140: Unrecognized directive
!dir$ ignore_tkr buffer
-----------------------^
mpi_p2p_f.F90(435): remark #5140: Unrecognized directive
!dir$ ignore_tkr buffer
-----------------------^
mpi_p2p_f.F90(474): remark #5140: Unrecognized directive
!dir$ ignore_tkr sbuffer, rbuffer
------------------------^
mpi_p2p_f.F90(527): remark #5140: Unrecognized directive
!dir$ ignore_tkr inbuf
----------------------^
mpi_p2p_f.F90(531): remark #5140: Unrecognized directive
!dir$ ignore_tkr outbuf
-----------------------^
mpi_p2p_f.F90(569): remark #5140: Unrecognized directive
!dir$ ignore_tkr inbuf
----------------------^
mpi_p2p_f.F90(573): remark #5140: Unrecognized directive
!dir$ ignore_tkr outbuf
-----------------------^
mpi_p2p_f.F90(511): error #6404: This name does not have a type, and must have an explicit type.   [SCOUNT_C]
            scount_c = scount
------------^
mpi_p2p_f.F90(513): error #6404: This name does not have a type, and must have an explicit type.   [STAG_C]
            stag_c = stag
------------^
mpi_p2p_f.F90(514): error #6404: This name does not have a type, and must have an explicit type.   [RCOUNT_C]
            rcount_c = rcount
------------^
mpi_p2p_f.F90(515): error #6404: This name does not have a type, and must have an explicit type.   [SRC_C]
            src_c = src 
------------^
mpi_p2p_f.F90(516): error #6404: This name does not have a type, and must have an explicit type.   [RTAG_C]
            rtag_c = rtag
------------^
mpi_p2p_f.F90(509): remark #7712: This variable has not been used.   [TAG_C]
            integer(kind=c_int) :: count_c, dest_c, tag_c, ierror_c
----------------------------------------------------^
mpi_p2p_f.F90(509): remark #7712: This variable has not been used.   [COUNT_C]
            integer(kind=c_int) :: count_c, dest_c, tag_c, ierror_c
-----------------------------------^
compilation aborted for mpi_p2p_f.F90 (code 1)

I suppose the matching directive for Intel is ATTRIBUTES NO_ARG_CHECK. Perhaps type(*) can be used?

jeffhammond commented 2 weeks ago

sorry, it seems i only tested the no-CFI code path because of flang-new. i have fixed the bugs. you will need to disable -Werror for now.

ivan-pi commented 2 weeks ago

Thanks! That worked and I now have libmpi_f08.a.

I only get warnings about the unused functions.

cfi_util.c: In function 'VAPAA_CREATE_MPIX_IOV':
cfi_util.c:91:10: warning: #warning Not MPICH [-Wcpp]
   91 |         #warning Not MPICH
      |          ^~~~~~~
cfi_util.c: In function 'VAPAA_MPIDT_PRINT_INFO':
cfi_util.c:160:10: warning: #warning Not MPICH [-Wcpp]
  160 |         #warning Not MPICH
      |          ^~~~~~~
cfi_util.c: In function 'VAPAA_CFI_CREATE_INDEXED':
cfi_util.c:543:10: warning: #warning Not MPICH [-Wcpp]
  543 |         #warning Not MPICH
      |          ^~~~~~~
cfi_util.c: At top level:
cfi_util.c:358:22: warning: 'VAPAA_CFI_CREATE_ELEMENT_ADDRESSES' defined but not used [-Wunused-function]
  358 | static const void ** VAPAA_CFI_CREATE_ELEMENT_ADDRESSES(const CFI_cdesc_t * desc)
      |                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cfi_util.c:49:15: warning: 'VAPAA_CREATE_MPIX_IOV' defined but not used [-Wunused-function]
   49 | static void * VAPAA_CREATE_MPIX_IOV(MPI_Datatype dt, size_t * total_len, size_t * total_bytes)
      |               ^~~~~~~~~~~~~~~~~~~~~
jeffhammond commented 2 weeks ago

yeah, that's what i see as well and i don't intend to fix those warnings. i could add the maybe_unused attributed but it's not really useful.