From f6361035ba2972dede69bcdf16bc6724bd50bf7d Mon Sep 17 00:00:00 2001 From: degomme Date: Wed, 3 Apr 2019 10:11:04 +0200 Subject: [PATCH] add some coverage in fortran bindings --- include/smpi/mpif.h.in | 6 ++---- src/smpi/bindings/smpi_f77.cpp | 21 +++++++++++++++---- src/smpi/include/private.hpp | 6 ++++-- .../smpi/mpich3-test/f77/coll/nonblockingf.f | 18 ++++++++++++++++ .../smpi/mpich3-test/f77/rma/CMakeLists.txt | 11 +++++----- teshsuite/smpi/mpich3-test/f77/rma/testlist | 6 +++--- .../smpi/mpich3-test/f90/rma/CMakeLists.txt | 10 ++++----- teshsuite/smpi/mpich3-test/f90/rma/testlist | 6 +++--- 8 files changed, 57 insertions(+), 27 deletions(-) diff --git a/include/smpi/mpif.h.in b/include/smpi/mpif.h.in index 786e2268fc..fa9c17d2d9 100644 --- a/include/smpi/mpif.h.in +++ b/include/smpi/mpif.h.in @@ -81,11 +81,8 @@ parameter(MPI_COMM_NULL_DELETE_FN =0) integer MPI_COMM_DUP_FN parameter(MPI_COMM_DUP_FN =1) - integer MPI_WIN_NULL_COPY_FN, MPI_WIN_NULL_DELETE_FN - parameter(MPI_WIN_NULL_COPY_FN =0) + integer MPI_WIN_NULL_DELETE_FN parameter(MPI_WIN_NULL_DELETE_FN =0) - integer MPI_WIN_DUP_FN - parameter(MPI_WIN_DUP_FN =1) integer MPI_TYPE_NULL_COPY_FN, MPI_TYPE_NULL_DELETE_FN parameter(MPI_TYPE_NULL_COPY_FN =0) parameter(MPI_TYPE_NULL_DELETE_FN =0) @@ -274,6 +271,7 @@ external MPI_BCAST, MPI_BARRIER, MPI_REDUCE, MPI_ALLREDUCE external MPI_SCATTER, MPI_GATHER, MPI_ALLGATHER, MPI_SCAN external MPI_ALLTOALL, MPI_GATHERV, MPI_SENDRECV + external MPI_WIN_DUP_FN, MPI_WIN_NULL_COPY_FN external MPI_WTIME external MPI_WTICK diff --git a/src/smpi/bindings/smpi_f77.cpp b/src/smpi/bindings/smpi_f77.cpp index 9f3ce44427..934f517585 100644 --- a/src/smpi/bindings/smpi_f77.cpp +++ b/src/smpi/bindings/smpi_f77.cpp @@ -226,15 +226,15 @@ void mpi_win_get_group_(int* win, int* group, int* ierr){ } } -void mpi_win_get_attr_(int* win, int* type_keyval, int* attribute_val, int* flag, int* ierr){ - int* value = nullptr; +void mpi_win_get_attr_(int* win, int* type_keyval, MPI_Aint* attribute_val, int* flag, int* ierr){ + MPI_Aint* value = nullptr; *ierr = MPI_Win_get_attr(simgrid::smpi::Win::f2c(*win), *type_keyval, &value, flag); if (*flag == 1) *attribute_val = *value; } -void mpi_win_set_attr_(int* win, int* type_keyval, int* att, int* ierr){ - int* val = (int*)xbt_malloc(sizeof(int)); +void mpi_win_set_attr_(int* win, int* type_keyval, MPI_Aint* att, int* ierr){ + MPI_Aint* val = (MPI_Aint*)xbt_malloc(sizeof(MPI_Aint)); *val=*att; *ierr = MPI_Win_set_attr(simgrid::smpi::Win::f2c(*win), *type_keyval, val); } @@ -284,6 +284,19 @@ void mpi_win_flush_local_all_(int* win, int* ierr){ *ierr = MPI_Win_flush_local_all(simgrid::smpi::Win::f2c(*win)); } +void mpi_win_null_copy_fn_( int* win, int* keyval, int* extrastate, MPI_Aint* valin, MPI_Aint* valout, + int* flag, int* ierr ){ + *flag=0; + *ierr=MPI_SUCCESS; +} + +void mpi_win_dup_fn_( int* win, int* keyval, int* extrastate, MPI_Aint* valin, MPI_Aint* valout, + int* flag, int* ierr ){ + *flag=1; + *valout=*valin; + *ierr=MPI_SUCCESS; +} + void mpi_info_create_( int *info, int* ierr){ MPI_Info tmp; *ierr = MPI_Info_create(&tmp); diff --git a/src/smpi/include/private.hpp b/src/smpi/include/private.hpp index de6dff608a..6adc8704cb 100644 --- a/src/smpi/include/private.hpp +++ b/src/smpi/include/private.hpp @@ -229,8 +229,8 @@ void mpi_win_detach_(int* win, int* base, int* ierr); void mpi_win_set_info_(int* win, int* info, int* ierr); void mpi_win_get_info_(int* win, int* info, int* ierr); void mpi_win_get_group_(int* win, int* group, int* ierr); -void mpi_win_get_attr_(int* win, int* type_keyval, int* attribute_val, int* flag, int* ierr); -void mpi_win_set_attr_(int* win, int* type_keyval, int* att, int* ierr); +void mpi_win_get_attr_(int* win, int* type_keyval, MPI_Aint* attribute_val, int* flag, int* ierr); +void mpi_win_set_attr_(int* win, int* type_keyval, MPI_Aint* att, int* ierr); void mpi_win_delete_attr_(int* win, int* comm_keyval, int* ierr); void mpi_win_create_keyval_(void* copy_fn, void* delete_fn, int* keyval, void* extra_state, int* ierr); void mpi_win_free_keyval_(int* keyval, int* ierr); @@ -242,6 +242,8 @@ void mpi_win_flush_(int* rank, int* win, int* ierr); void mpi_win_flush_local_(int* rank, int* win, int* ierr); void mpi_win_flush_all_(int* win, int* ierr); void mpi_win_flush_local_all_(int* win, int* ierr); +void mpi_win_dup_fn_( int* win, int* keyval, int* extrastate, MPI_Aint* valin, MPI_Aint* valout, int* flag, int* ierr ); +void mpi_win_null_copy_fn_( int* win, int* keyval, int* extrastate, MPI_Aint* valin, MPI_Aint* valout, int* flag, int* ierr ); void mpi_info_create_(int* info, int* ierr); void mpi_info_set_(int* info, char* key, char* value, int* ierr, unsigned int keylen, unsigned int valuelen); void mpi_info_free_(int* info, int* ierr); diff --git a/teshsuite/smpi/mpich3-test/f77/coll/nonblockingf.f b/teshsuite/smpi/mpich3-test/f77/coll/nonblockingf.f index c491c8b2f2..b2785bbbae 100644 --- a/teshsuite/smpi/mpich3-test/f77/coll/nonblockingf.f +++ b/teshsuite/smpi/mpich3-test/f77/coll/nonblockingf.f @@ -93,6 +93,24 @@ C . MPI_SUM, comm, req, ierr) call MPI_Wait(req, MPI_STATUS_IGNORE, ierr) + call MPI_Iscatter(sbuf, NUM_INTS, MPI_INTEGER, rbuf, + . NUM_INTS, MPI_INTEGER, 0, comm, req, ierr) + call MPI_Wait(req, MPI_STATUS_IGNORE, ierr) + + call MPI_Iscatterv(sbuf, scounts, sdispls, MPI_INTEGER, + . rbuf, NUM_INTS, MPI_INTEGER, + . 0, comm, req, ierr) + call MPI_Wait(req, MPI_STATUS_IGNORE, ierr) + + call MPI_Iallgather(sbuf, NUM_INTS, MPI_INTEGER, + . rbuf, NUM_INTS, MPI_INTEGER, comm, req, ierr) + call MPI_Wait(req, MPI_STATUS_IGNORE, ierr) + + call MPI_Iallgatherv(sbuf, NUM_INTS, MPI_INTEGER, + . rbuf, rcounts, rdispls, MPI_INTEGER, + . comm, req, ierr) + call MPI_Wait(req, MPI_STATUS_IGNORE, ierr) + call mtest_finalize( errs ) call MPI_Finalize( ierr ) end diff --git a/teshsuite/smpi/mpich3-test/f77/rma/CMakeLists.txt b/teshsuite/smpi/mpich3-test/f77/rma/CMakeLists.txt index e34c19d445..1cadf23029 100644 --- a/teshsuite/smpi/mpich3-test/f77/rma/CMakeLists.txt +++ b/teshsuite/smpi/mpich3-test/f77/rma/CMakeLists.txt @@ -9,12 +9,11 @@ if(enable_smpi AND enable_smpi_MPICH3_testsuite AND SMPI_FORTRAN) include_directories(BEFORE "${CMAKE_HOME_DIRECTORY}/include/smpi") foreach(test winaccf - # winerrf - winfencef wingroupf - # baseattrwinf winattr2f winattrf - wingetf winnamef winscale1f - # winscale2f - ) + winfencef wingroupf + baseattrwinf winattr2f winattrf + wingetf winnamef winscale1f + # winscale2f winerrf + ) add_executable(${test} EXCLUDE_FROM_ALL ${test}.f) add_dependencies(tests ${test}) target_link_libraries(${test} simgrid mtest_f77) diff --git a/teshsuite/smpi/mpich3-test/f77/rma/testlist b/teshsuite/smpi/mpich3-test/f77/rma/testlist index 9141374e16..db7670b78f 100644 --- a/teshsuite/smpi/mpich3-test/f77/rma/testlist +++ b/teshsuite/smpi/mpich3-test/f77/rma/testlist @@ -9,6 +9,6 @@ winnamef 1 wingroupf 4 needs_privatization=1 winaccf 4 needs_privatization=1 c2f2cwinf 1 -#baseattrwinf 1 -#winattrf 1 -#winattr2f 1 +baseattrwinf 1 +winattrf 1 +winattr2f 1 diff --git a/teshsuite/smpi/mpich3-test/f90/rma/CMakeLists.txt b/teshsuite/smpi/mpich3-test/f90/rma/CMakeLists.txt index 2dbd9552f7..44b91b15c7 100644 --- a/teshsuite/smpi/mpich3-test/f90/rma/CMakeLists.txt +++ b/teshsuite/smpi/mpich3-test/f90/rma/CMakeLists.txt @@ -10,11 +10,11 @@ if(enable_smpi AND enable_smpi_MPICH3_testsuite AND SMPI_FORTRAN) foreach(test winaccf90 # winerrf90 - winfencef90 wingroupf90 - # baseattrwinf90 winattr2f90 winattrf90 - wingetf90 winnamef90 winscale1f90 - # winscale2f90 - ) + winfencef90 wingroupf90 + baseattrwinf90 winattr2f90 winattrf90 + wingetf90 winnamef90 winscale1f90 + # winscale2f90 + ) add_executable(${test} EXCLUDE_FROM_ALL ${test}.f90) add_dependencies(tests ${test}) target_link_libraries(${test} simgrid mtest_f90) diff --git a/teshsuite/smpi/mpich3-test/f90/rma/testlist b/teshsuite/smpi/mpich3-test/f90/rma/testlist index 0686c7359a..80be34444f 100644 --- a/teshsuite/smpi/mpich3-test/f90/rma/testlist +++ b/teshsuite/smpi/mpich3-test/f90/rma/testlist @@ -9,6 +9,6 @@ winnamef90 1 wingroupf90 4 needs_privatization=1 winaccf90 4 needs_privatization=1 c2f2cwinf90 1 -#baseattrwinf90 1 -#winattrf90 1 -#winattr2f90 1 +baseattrwinf90 1 +winattrf90 1 +winattr2f90 1 -- 2.20.1