From b57a6cd86e76c696a0429ef9002b3162de002d1c Mon Sep 17 00:00:00 2001 From: Arnaud Giersch Date: Wed, 17 Jul 2019 11:03:35 +0200 Subject: [PATCH] Add simple support for MPI_Rsend, MPI_Rsend_init. --- ChangeLog | 2 +- src/smpi/bindings/smpi_mpi.cpp | 4 ++-- src/smpi/bindings/smpi_pmpi_request.cpp | 11 +++++++++++ teshsuite/smpi/mpich3-test/f77/pt2pt/allpairf.f | 4 ++-- teshsuite/smpi/mpich3-test/f90/pt2pt/allpairf90.f90 | 4 ++-- teshsuite/smpi/mpich3-test/pt2pt/CMakeLists.txt | 4 ++-- teshsuite/smpi/mpich3-test/pt2pt/testlist | 3 +-- 7 files changed, 21 insertions(+), 11 deletions(-) diff --git a/ChangeLog b/ChangeLog index 205b12e3ee..974a18cb44 100644 --- a/ChangeLog +++ b/ChangeLog @@ -12,7 +12,7 @@ MSG: SMPI: - Fortran bindings for DVFS have been removed. - - Add support for MPI_Irsend + - Add support for MPI_Irsend, MPI_Rsend, MPI_Rsend_init - SMPI can now be selected by cmake's find_module(MPI) with MPI_C_COMPILER, MPI_CXX_COMPILER, MPI_Fortran_COMPILER variables. diff --git a/src/smpi/bindings/smpi_mpi.cpp b/src/smpi/bindings/smpi_mpi.cpp index 9f5700ed13..357e4f6c2a 100644 --- a/src/smpi/bindings/smpi_mpi.cpp +++ b/src/smpi/bindings/smpi_mpi.cpp @@ -203,6 +203,8 @@ WRAPPED_PMPI_CALL(int,MPI_Sendrecv,(const void *sendbuf, int sendcount, MPI_Data WRAPPED_PMPI_CALL(int,MPI_Send,(const void *buf, int count, MPI_Datatype datatype, int dst, int tag, MPI_Comm comm),(buf, count, datatype, dst, tag, comm)) WRAPPED_PMPI_CALL(int,MPI_Ssend_init,(const void* buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm, MPI_Request* request),(buf, count, datatype, dest, tag, comm, request)) WRAPPED_PMPI_CALL(int,MPI_Ssend,(const void* buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm) ,(buf, count, datatype, dest, tag, comm)) +WRAPPED_PMPI_CALL(int,MPI_Rsend_init,(const void* buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm, MPI_Request* request),(buf, count, datatype, dest, tag, comm, request)) +WRAPPED_PMPI_CALL(int,MPI_Rsend,(const void* buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm) ,(buf, count, datatype, dest, tag, comm)) WRAPPED_PMPI_CALL(int,MPI_Startall,(int count, MPI_Request * requests),(count, requests)) WRAPPED_PMPI_CALL(int,MPI_Start,(MPI_Request * request),(request)) WRAPPED_PMPI_CALL(int,MPI_Testall,(int count, MPI_Request* requests, int* flag, MPI_Status* statuses) ,(count, requests, flag, statuses)) @@ -410,8 +412,6 @@ UNIMPLEMENTED_WRAPPED_PMPI_CALL(int,MPI_Pack_external,(char *datarep, void *inbu UNIMPLEMENTED_WRAPPED_PMPI_CALL(int,MPI_Pack_external_size,(char *datarep, int incount, MPI_Datatype datatype, MPI_Aint *size),(datarep, incount, datatype, size)) UNIMPLEMENTED_WRAPPED_PMPI_CALL(int,MPI_Pcontrol,(const int level, ... ),(level)) UNIMPLEMENTED_WRAPPED_PMPI_CALL(int,MPI_Publish_name,( char *service_name, MPI_Info info, char *port_name),( service_name, info, port_name)) -UNIMPLEMENTED_WRAPPED_PMPI_CALL(int,MPI_Rsend_init,(const void* buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm, MPI_Request* request),(buf, count, datatype, dest, tag, comm, request)) -UNIMPLEMENTED_WRAPPED_PMPI_CALL(int,MPI_Rsend,(const void* buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm) ,(buf, count, datatype, dest, tag, comm)) UNIMPLEMENTED_WRAPPED_PMPI_CALL(int,MPI_Topo_test,(MPI_Comm comm, int* top_type) ,(comm, top_type)) UNIMPLEMENTED_WRAPPED_PMPI_CALL(int,MPI_Type_create_darray,(int size, int rank, int ndims, int* array_of_gsizes, int* array_of_distribs, int* array_of_dargs, int* array_of_psizes,int order, MPI_Datatype oldtype, MPI_Datatype *newtype) ,(size, rank, ndims, array_of_gsizes,array_of_distribs, array_of_dargs, array_of_psizes,order,oldtype, newtype)) UNIMPLEMENTED_WRAPPED_PMPI_CALL(int,MPI_Type_get_contents,(MPI_Datatype datatype, int max_integers, int max_addresses, int max_datatypes, int* array_of_integers, MPI_Aint* array_of_addresses, MPI_Datatype *array_of_datatypes),(datatype, max_integers, max_addresses,max_datatypes, array_of_integers, array_of_addresses, array_of_datatypes)) diff --git a/src/smpi/bindings/smpi_pmpi_request.cpp b/src/smpi/bindings/smpi_pmpi_request.cpp index a04d91d8e4..5d36e12925 100644 --- a/src/smpi/bindings/smpi_pmpi_request.cpp +++ b/src/smpi/bindings/smpi_pmpi_request.cpp @@ -66,6 +66,12 @@ int PMPI_Recv_init(void *buf, int count, MPI_Datatype datatype, int src, int tag return retval; } +int PMPI_Rsend_init(const void* buf, int count, MPI_Datatype datatype, int dst, int tag, MPI_Comm comm, + MPI_Request* request) +{ + return PMPI_Send_init(buf, count, datatype, dst, tag, comm, request); +} + int PMPI_Ssend_init(const void* buf, int count, MPI_Datatype datatype, int dst, int tag, MPI_Comm comm, MPI_Request* request) { int retval = 0; @@ -396,6 +402,11 @@ int PMPI_Send(const void *buf, int count, MPI_Datatype datatype, int dst, int ta return retval; } +int PMPI_Rsend(const void* buf, int count, MPI_Datatype datatype, int dst, int tag, MPI_Comm comm) +{ + return PMPI_Send(buf, count, datatype, dst, tag, comm); +} + int PMPI_Ssend(const void* buf, int count, MPI_Datatype datatype, int dst, int tag, MPI_Comm comm) { int retval = 0; diff --git a/teshsuite/smpi/mpich3-test/f77/pt2pt/allpairf.f b/teshsuite/smpi/mpich3-test/f77/pt2pt/allpairf.f index e6d46aa2d9..a9ea69d68c 100644 --- a/teshsuite/smpi/mpich3-test/f77/pt2pt/allpairf.f +++ b/teshsuite/smpi/mpich3-test/f77/pt2pt/allpairf.f @@ -23,9 +23,9 @@ C verbose = .true. do while ( mtestGetIntraComm( comm, 2, .false. ) ) call test_pair_send( comm, errs ) call test_pair_ssend( comm, errs ) - !call test_pair_rsend( comm, errs ) + call test_pair_rsend( comm, errs ) call test_pair_isend( comm, errs ) - !call test_pair_irsend( comm, errs ) + !call test_pair_irsend( comm, errs ) !FIXME call test_pair_issend( comm, errs ) !call test_pair_psend( comm, errs ) !call test_pair_prsend( comm, errs ) diff --git a/teshsuite/smpi/mpich3-test/f90/pt2pt/allpairf90.f90 b/teshsuite/smpi/mpich3-test/f90/pt2pt/allpairf90.f90 index a0cfd21b23..037f601e32 100644 --- a/teshsuite/smpi/mpich3-test/f90/pt2pt/allpairf90.f90 +++ b/teshsuite/smpi/mpich3-test/f90/pt2pt/allpairf90.f90 @@ -24,9 +24,9 @@ call test_pair_send( comm, errs ) call test_pair_ssend( comm, errs ) - !call test_pair_rsend( comm, errs ) + call test_pair_rsend( comm, errs ) call test_pair_isend( comm, errs ) - !call test_pair_irsend( comm, errs ) + !call test_pair_irsend( comm, errs ) !FIXME call test_pair_issend( comm, errs ) call test_pair_psend( comm, errs ) !call test_pair_prsend( comm, errs ) diff --git a/teshsuite/smpi/mpich3-test/pt2pt/CMakeLists.txt b/teshsuite/smpi/mpich3-test/pt2pt/CMakeLists.txt index 50ad8f502c..46fce2334a 100644 --- a/teshsuite/smpi/mpich3-test/pt2pt/CMakeLists.txt +++ b/teshsuite/smpi/mpich3-test/pt2pt/CMakeLists.txt @@ -10,9 +10,9 @@ if(enable_smpi AND enable_smpi_MPICH3_testsuite) include_directories("${CMAKE_CURRENT_SOURCE_DIR}/../include/") foreach(file anyall bottom eagerdt huge_anysrc huge_underflow inactivereq isendself isendirecv isendselfprobe issendselfcancel cancelanysrc pingping probenull - dtype_send greq1 probe-unexp rqstatus sendall sendflood sendrecv1 sendrecv2 sendrecv3 waitany-null waittestnull many_isend manylmt recv_any scancel scancel2 rcancel) + dtype_send greq1 probe-unexp rqstatus sendall sendflood sendrecv1 sendrecv2 sendrecv3 waitany-null waittestnull many_isend manylmt recv_any sendself scancel scancel2 rcancel) # not compiled files: big_count_status bsend1 bsend2 bsend3 bsend4 bsend5 bsendalign bsendfrag bsendpending mprobe - # cancelrecv icsend large_message pscancel rqfreeb sendself scancel_unmatch + # cancelrecv icsend large_message pscancel rqfreeb scancel_unmatch add_executable(${file} EXCLUDE_FROM_ALL ${file}.c) add_dependencies(tests ${file}) target_link_libraries(${file} simgrid mtest_c) diff --git a/teshsuite/smpi/mpich3-test/pt2pt/testlist b/teshsuite/smpi/mpich3-test/pt2pt/testlist index 7672745886..0e47cb17fc 100644 --- a/teshsuite/smpi/mpich3-test/pt2pt/testlist +++ b/teshsuite/smpi/mpich3-test/pt2pt/testlist @@ -2,8 +2,7 @@ sendrecv1 4 sendrecv2 2 sendrecv3 2 sendflood 8 timeLimit=600 -#needs rsend -#sendself 1 +sendself 1 sendall 4 anyall 2 eagerdt 2 -- 2.20.1