Skip to content

Commit 2f47ed6

Browse files
committed
fortran/use-mpi-f08: mrecv/imrecv
Signed-off-by: Gilles Gouaillardet <[email protected]>
1 parent 4b9c01d commit 2f47ed6

11 files changed

+159
-24
lines changed

ompi/mpi/fortran/use-mpi-f08/bindings/mpi-f-interfaces-bind.h.in

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3335,9 +3335,9 @@ subroutine ompi_mprobe_f(source,tag,comm,message,status,ierror) &
33353335
end subroutine ompi_mprobe_f
33363336

33373337
subroutine ompi_imrecv_f(buf,count,datatype,message,request,ierror) &
3338-
BIND(C, name="ompi_imrecv_f")
3338+
BIND(C, name="ompi_imrecv_@OMPI_F08_BINDINGS_EXTENSION@")
33393339
implicit none
3340-
OMPI_FORTRAN_IGNORE_TKR_TYPE OMPI_ASYNCHRONOUS :: buf
3340+
OMPI_F08_IGNORE_TKR_TYPE OMPI_ASYNCHRONOUS :: buf
33413341
INTEGER, INTENT(IN) :: count
33423342
INTEGER, INTENT(IN) :: datatype
33433343
INTEGER, INTENT(INOUT) :: message
@@ -3346,10 +3346,10 @@ subroutine ompi_imrecv_f(buf,count,datatype,message,request,ierror) &
33463346
end subroutine ompi_imrecv_f
33473347

33483348
subroutine ompi_mrecv_f(buf,count,datatype,message,status,ierror) &
3349-
BIND(C, name="ompi_mrecv_f")
3349+
BIND(C, name="ompi_mrecv_@OMPI_F08_BINDINGS_EXTENSION@")
33503350
use :: mpi_f08_types, only : MPI_Status
33513351
implicit none
3352-
OMPI_FORTRAN_IGNORE_TKR_TYPE :: buf
3352+
OMPI_F08_IGNORE_TKR_TYPE :: buf
33533353
INTEGER, INTENT(IN) :: count
33543354
INTEGER, INTENT(IN) :: datatype
33553355
INTEGER, INTENT(INOUT) :: message

ompi/mpi/fortran/use-mpi-f08/cdesc/Makefile.am

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,12 @@ libforce_usempif08_internal_cdesc_to_be_built_la_SOURCES = \
4646
bsend_cdesc.c \
4747
bsend_init_cdesc.c \
4848
ibsend_cdesc.c \
49+
imrecv_cdesc.c \
4950
irecv_cdesc.c \
5051
irsend_cdesc.c \
5152
isend_cdesc.c \
5253
issend_cdesc.c \
54+
mrecv_cdesc.c \
5355
recv_cdesc.c \
5456
rsend_cdesc.c \
5557
rsend_init_cdesc.c \

ompi/mpi/fortran/use-mpi-f08/cdesc/bindings.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ void ompi_ibsend_cdesc(CFI_cdesc_t* x, MPI_Fint *count, MPI_Fint *datatype,
2929
MPI_Fint *dest, MPI_Fint *tag, MPI_Fint *comm,
3030
MPI_Fint *request, MPI_Fint *ierr);
3131

32+
void ompi_imrecv_cdesc(CFI_cdesc_t* x, MPI_Fint *count, MPI_Fint *datatype,
33+
MPI_Fint *message, MPI_Fint *request, MPI_Fint *ierr);
34+
3235
void ompi_irecv_cdesc(CFI_cdesc_t *x, MPI_Fint *count, MPI_Fint *datatype,
3336
MPI_Fint *source, MPI_Fint *tag, MPI_Fint *comm,
3437
MPI_Fint *request, MPI_Fint *ierr);
@@ -45,6 +48,9 @@ void ompi_issend_cdesc(CFI_cdesc_t* x, MPI_Fint *count, MPI_Fint *datatype,
4548
MPI_Fint *dest, MPI_Fint *tag, MPI_Fint *comm,
4649
MPI_Fint *request, MPI_Fint *ierr);
4750

51+
void ompi_mrecv_cdesc(CFI_cdesc_t* x, MPI_Fint *count, MPI_Fint *datatype,
52+
MPI_Fint *message, MPI_Fint *status, MPI_Fint *ierr);
53+
4854
void ompi_recv_cdesc(CFI_cdesc_t *x, MPI_Fint *count, MPI_Fint *datatype,
4955
MPI_Fint *source, MPI_Fint *tag, MPI_Fint *comm,
5056
MPI_Fint *status, MPI_Fint *ierr);
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
/*
2+
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
3+
* University Research and Technology
4+
* Corporation. All rights reserved.
5+
* Copyright (c) 2004-2005 The University of Tennessee and The University
6+
* of Tennessee Research Foundation. All rights
7+
* reserved.
8+
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
9+
* University of Stuttgart. All rights reserved.
10+
* Copyright (c) 2004-2005 The Regents of the University of California.
11+
* All rights reserved.
12+
* Copyright (c) 2012 Cisco Systems, Inc. All rights reserved.
13+
* Copyright (c) 2015-2019 Research Organization for Information Science
14+
* and Technology (RIST). All rights reserved.
15+
* Copyright (c) 2015 FUJITSU LIMITED. All rights reserved.
16+
* $COPYRIGHT$
17+
*
18+
* Additional copyrights may follow
19+
*
20+
* $HEADER$
21+
*/
22+
23+
#include "ompi_config.h"
24+
25+
#include "ompi/mpi/fortran/mpif-h/bindings.h"
26+
#include "ompi/mpi/fortran/use-mpi-f08/cdesc/bindings.h"
27+
#include "ompi/mpi/fortran/base/constants.h"
28+
29+
void ompi_imrecv_cdesc(CFI_cdesc_t* x, MPI_Fint *count, MPI_Fint *datatype,
30+
MPI_Fint *message, MPI_Fint *request, MPI_Fint *ierr)
31+
{
32+
int c_ierr;
33+
MPI_Datatype c_datatype, c_type = PMPI_Type_f2c(*datatype);
34+
MPI_Request c_req;
35+
MPI_Message c_message;
36+
void *buf = x->base_addr;
37+
int c_count = OMPI_FINT_2_INT(*count);
38+
39+
c_message = PMPI_Message_f2c(*message);
40+
41+
if (x->rank != 0 && !CFI_is_contiguous(x)) {
42+
c_ierr = cdesc_create_datatype(x, c_count, c_type, &c_datatype);
43+
if (MPI_SUCCESS != c_ierr) {
44+
if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr);
45+
return;
46+
}
47+
c_count = 1;
48+
}
49+
c_ierr = OMPI_INT_2_FINT(PMPI_Imrecv(OMPI_F2C_BOTTOM(buf), c_count,
50+
c_datatype, &c_message, &c_req));
51+
if (c_datatype != c_type) {
52+
ompi_datatype_destroy(&c_datatype);
53+
}
54+
if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr);
55+
56+
if (MPI_SUCCESS == c_ierr) {
57+
*request = PMPI_Request_c2f(c_req);
58+
/* message is an INOUT, and may be updated by the recv */
59+
*message = PMPI_Message_c2f(c_message);
60+
}
61+
}
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
/*
2+
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
3+
* University Research and Technology
4+
* Corporation. All rights reserved.
5+
* Copyright (c) 2004-2005 The University of Tennessee and The University
6+
* of Tennessee Research Foundation. All rights
7+
* reserved.
8+
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
9+
* University of Stuttgart. All rights reserved.
10+
* Copyright (c) 2004-2005 The Regents of the University of California.
11+
* All rights reserved.
12+
* Copyright (c) 2012 Cisco Systems, Inc. All rights reserved.
13+
* Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved.
14+
* Copyright (c) 2015-2019 Research Organization for Information Science
15+
* and Technology (RIST). All rights reserved.
16+
* Copyright (c) 2015 FUJITSU LIMITED. All rights reserved.
17+
* $COPYRIGHT$
18+
*
19+
* Additional copyrights may follow
20+
*
21+
* $HEADER$
22+
*/
23+
24+
#include "ompi_config.h"
25+
26+
#include "ompi/mpi/fortran/mpif-h/bindings.h"
27+
#include "ompi/mpi/fortran/use-mpi-f08/cdesc/bindings.h"
28+
#include "ompi/mpi/fortran/mpif-h/status-conversion.h"
29+
#include "ompi/mpi/fortran/base/constants.h"
30+
#include "ompi/communicator/communicator.h"
31+
32+
void ompi_mrecv_cdesc(CFI_cdesc_t* x, MPI_Fint *count, MPI_Fint *datatype,
33+
MPI_Fint *message, MPI_Fint *status, MPI_Fint *ierr)
34+
{
35+
int c_ierr;
36+
OMPI_FORTRAN_STATUS_DECLARATION(c_status,c_status2)
37+
MPI_Message c_message = PMPI_Message_f2c(*message);
38+
MPI_Datatype c_datatype, c_type = PMPI_Type_f2c(*datatype);
39+
void *buf = x->base_addr;
40+
int c_count = OMPI_FINT_2_INT(*count);
41+
42+
OMPI_FORTRAN_STATUS_SET_POINTER(c_status,c_status2,status)
43+
44+
/* Call the C function */
45+
if (x->rank != 0 && !CFI_is_contiguous(x)) {
46+
c_ierr = cdesc_create_datatype(x, c_count, c_type, &c_datatype);
47+
if (MPI_SUCCESS != c_ierr) {
48+
if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr);
49+
return;
50+
}
51+
c_count = 1;
52+
}
53+
c_ierr = OMPI_INT_2_FINT(PMPI_Mrecv(OMPI_F2C_BOTTOM(buf), c_count,
54+
c_datatype, &c_message,
55+
c_status));
56+
if (c_datatype != c_type) {
57+
ompi_datatype_destroy(&c_datatype);
58+
}
59+
if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr);
60+
61+
if (MPI_SUCCESS == c_ierr) {
62+
OMPI_FORTRAN_STATUS_RETURN(c_status,c_status2,status,c_ierr)
63+
/* message is an INOUT, and may be updated by the recv */
64+
*message = PMPI_Message_c2f(c_message);
65+
}
66+
}

ompi/mpi/fortran/use-mpi-f08/imrecv_f08.F90

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
! Copyright (c) 2009-2012 Cisco Systems, Inc. All rights reserved.
44
! Copyright (c) 2009-2012 Los Alamos National Security, LLC.
55
! All Rights reserved.
6-
! Copyright (c) 2018 Research Organization for Information Science
6+
! Copyright (c) 2018-2019 Research Organization for Information Science
77
! and Technology (RIST). All rights reserved.
88
! $COPYRIGHT$
99

@@ -13,7 +13,7 @@ subroutine MPI_Imrecv_f08(buf,count,datatype,message,request,ierror)
1313
use :: mpi_f08_types, only : MPI_Datatype, MPI_Message, MPI_Request
1414
use :: ompi_mpifh_bindings, only : ompi_imrecv_f
1515
implicit none
16-
OMPI_FORTRAN_IGNORE_TKR_TYPE OMPI_ASYNCHRONOUS :: buf
16+
OMPI_F08_IGNORE_TKR_TYPE OMPI_ASYNCHRONOUS :: buf
1717
INTEGER, INTENT(IN) :: count
1818
TYPE(MPI_Datatype), INTENT(IN) :: datatype
1919
TYPE(MPI_Message), INTENT(INOUT) :: message

ompi/mpi/fortran/use-mpi-f08/mod/mpi-f08-interfaces.F90

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -401,11 +401,11 @@ subroutine MPI_Ssend_init_f08(buf,count,datatype,dest,tag,comm,request,ierror)
401401
use :: mpi_f08_types, only : MPI_Datatype, MPI_Comm, MPI_Request
402402
implicit none
403403
!DEC$ ATTRIBUTES NO_ARG_CHECK :: buf
404-
!GCC$ ATTRIBUTES NO_ARG_CHECK :: buf
404+
OMPI_F08_GCC_ATTRIBUTES(buf)
405405
!$PRAGMA IGNORE_TKR buf
406406
!DIR$ IGNORE_TKR buf
407407
!IBM* IGNORE_TKR buf
408-
OMPI_FORTRAN_IGNORE_TKR_TYPE :: buf
408+
OMPI_F08_IGNORE_TKR_TYPE :: buf
409409
INTEGER, INTENT(IN) :: count, dest, tag
410410
TYPE(MPI_Datatype), INTENT(IN) :: datatype
411411
TYPE(MPI_Comm), INTENT(IN) :: comm
@@ -4507,11 +4507,11 @@ subroutine MPI_Imrecv_f08(buf,count,datatype,message,request,ierror)
45074507
use :: mpi_f08_types, only : MPI_Datatype, MPI_Message, MPI_Request
45084508
implicit none
45094509
!DEC$ ATTRIBUTES NO_ARG_CHECK :: buf
4510-
!GCC$ ATTRIBUTES NO_ARG_CHECK :: buf
4510+
OMPI_F08_GCC_ATTRIBUTES(buf)
45114511
!$PRAGMA IGNORE_TKR buf
45124512
!DIR$ IGNORE_TKR buf
45134513
!IBM* IGNORE_TKR buf
4514-
OMPI_FORTRAN_IGNORE_TKR_TYPE :: buf
4514+
OMPI_F08_IGNORE_TKR_TYPE :: buf
45154515
INTEGER, INTENT(IN) :: count
45164516
TYPE(MPI_Datatype), INTENT(IN) :: datatype
45174517
TYPE(MPI_Message), INTENT(INOUT) :: message
@@ -4525,11 +4525,11 @@ subroutine MPI_Mrecv_f08(buf,count,datatype,message,status,ierror)
45254525
use :: mpi_f08_types, only : MPI_Datatype, MPI_Message, MPI_Status
45264526
implicit none
45274527
!DEC$ ATTRIBUTES NO_ARG_CHECK :: buf
4528-
!GCC$ ATTRIBUTES NO_ARG_CHECK :: buf
4528+
OMPI_F08_GCC_ATTRIBUTES(buf)
45294529
!$PRAGMA IGNORE_TKR buf
45304530
!DIR$ IGNORE_TKR buf
45314531
!IBM* IGNORE_TKR buf
4532-
OMPI_FORTRAN_IGNORE_TKR_TYPE :: buf
4532+
OMPI_F08_IGNORE_TKR_TYPE :: buf
45334533
INTEGER, INTENT(IN) :: count
45344534
TYPE(MPI_Datatype), INTENT(IN) :: datatype
45354535
TYPE(MPI_Message), INTENT(INOUT) :: message

ompi/mpi/fortran/use-mpi-f08/mod/pmpi-f08-interfaces.F90

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -401,11 +401,11 @@ subroutine PMPI_Ssend_init_f08(buf,count,datatype,dest,tag,comm,request,ierror)
401401
use :: mpi_f08_types, only : MPI_Datatype, MPI_Comm, MPI_Request
402402
implicit none
403403
!DEC$ ATTRIBUTES NO_ARG_CHECK :: buf
404-
!GCC$ ATTRIBUTES NO_ARG_CHECK :: buf
404+
OMPI_F08_GCC_ATTRIBUTES(buf)
405405
!$PRAGMA IGNORE_TKR buf
406406
!DIR$ IGNORE_TKR buf
407407
!IBM* IGNORE_TKR buf
408-
OMPI_FORTRAN_IGNORE_TKR_TYPE :: buf
408+
OMPI_F08_IGNORE_TKR_TYPE :: buf
409409
INTEGER, INTENT(IN) :: count, dest, tag
410410
TYPE(MPI_Datatype), INTENT(IN) :: datatype
411411
TYPE(MPI_Comm), INTENT(IN) :: comm
@@ -4507,11 +4507,11 @@ subroutine PMPI_Imrecv_f08(buf,count,datatype,message,request,ierror)
45074507
use :: mpi_f08_types, only : MPI_Datatype, MPI_Message, MPI_Request
45084508
implicit none
45094509
!DEC$ ATTRIBUTES NO_ARG_CHECK :: buf
4510-
!GCC$ ATTRIBUTES NO_ARG_CHECK :: buf
4510+
OMPI_F08_GCC_ATTRIBUTES(buf)
45114511
!$PRAGMA IGNORE_TKR buf
45124512
!DIR$ IGNORE_TKR buf
45134513
!IBM* IGNORE_TKR buf
4514-
OMPI_FORTRAN_IGNORE_TKR_TYPE :: buf
4514+
OMPI_F08_IGNORE_TKR_TYPE :: buf
45154515
INTEGER, INTENT(IN) :: count
45164516
TYPE(MPI_Datatype), INTENT(IN) :: datatype
45174517
TYPE(MPI_Message), INTENT(INOUT) :: message
@@ -4525,11 +4525,11 @@ subroutine PMPI_Mrecv_f08(buf,count,datatype,message,status,ierror)
45254525
use :: mpi_f08_types, only : MPI_Datatype, MPI_Message, MPI_Status
45264526
implicit none
45274527
!DEC$ ATTRIBUTES NO_ARG_CHECK :: buf
4528-
!GCC$ ATTRIBUTES NO_ARG_CHECK :: buf
4528+
OMPI_F08_GCC_ATTRIBUTES(buf)
45294529
!$PRAGMA IGNORE_TKR buf
45304530
!DIR$ IGNORE_TKR buf
45314531
!IBM* IGNORE_TKR buf
4532-
OMPI_FORTRAN_IGNORE_TKR_TYPE :: buf
4532+
OMPI_F08_IGNORE_TKR_TYPE :: buf
45334533
INTEGER, INTENT(IN) :: count
45344534
TYPE(MPI_Datatype), INTENT(IN) :: datatype
45354535
TYPE(MPI_Message), INTENT(INOUT) :: message

ompi/mpi/fortran/use-mpi-f08/mrecv_f08.F90

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
! Copyright (c) 2009-2012 Cisco Systems, Inc. All rights reserved.
44
! Copyright (c) 2009-2012 Los Alamos National Security, LLC.
55
! All Rights reserved.
6-
! Copyright (c) 2018 Research Organization for Information Science
6+
! Copyright (c) 2018-2019 Research Organization for Information Science
77
! and Technology (RIST). All rights reserved.
88
! $COPYRIGHT$
99

@@ -13,7 +13,7 @@ subroutine MPI_Mrecv_f08(buf,count,datatype,message,status,ierror)
1313
use :: mpi_f08_types, only : MPI_Datatype, MPI_Message, MPI_Status
1414
use :: ompi_mpifh_bindings, only : ompi_mrecv_f
1515
implicit none
16-
OMPI_FORTRAN_IGNORE_TKR_TYPE :: buf
16+
OMPI_F08_IGNORE_TKR_TYPE :: buf
1717
INTEGER, INTENT(IN) :: count
1818
TYPE(MPI_Datatype), INTENT(IN) :: datatype
1919
TYPE(MPI_Message), INTENT(INOUT) :: message

ompi/mpi/fortran/use-mpi-f08/profile/pimrecv_f08.F90

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
! Copyright (c) 2009-2012 Cisco Systems, Inc. All rights reserved.
44
! Copyright (c) 2009-2012 Los Alamos National Security, LLC.
55
! All Rights reserved.
6-
! Copyright (c) 2018 Research Organization for Information Science
6+
! Copyright (c) 2018-2019 Research Organization for Information Science
77
! and Technology (RIST). All rights reserved.
88
! $COPYRIGHT$
99

@@ -13,7 +13,7 @@ subroutine PMPI_Imrecv_f08(buf,count,datatype,message,request,ierror)
1313
use :: mpi_f08_types, only : MPI_Datatype, MPI_Message, MPI_Request
1414
use :: ompi_mpifh_bindings, only : ompi_imrecv_f
1515
implicit none
16-
OMPI_FORTRAN_IGNORE_TKR_TYPE OMPI_ASYNCHRONOUS :: buf
16+
OMPI_F08_IGNORE_TKR_TYPE OMPI_ASYNCHRONOUS :: buf
1717
INTEGER, INTENT(IN) :: count
1818
TYPE(MPI_Datatype), INTENT(IN) :: datatype
1919
TYPE(MPI_Message), INTENT(INOUT) :: message

ompi/mpi/fortran/use-mpi-f08/profile/pmrecv_f08.F90

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
! Copyright (c) 2009-2012 Cisco Systems, Inc. All rights reserved.
44
! Copyright (c) 2009-2012 Los Alamos National Security, LLC.
55
! All Rights reserved.
6-
! Copyright (c) 2018 Research Organization for Information Science
6+
! Copyright (c) 2018-2019 Research Organization for Information Science
77
! and Technology (RIST). All rights reserved.
88
! $COPYRIGHT$
99

@@ -13,7 +13,7 @@ subroutine PMPI_Mrecv_f08(buf,count,datatype,message,status,ierror)
1313
use :: mpi_f08_types, only : MPI_Datatype, MPI_Message, MPI_Status
1414
use :: ompi_mpifh_bindings, only : ompi_mrecv_f
1515
implicit none
16-
OMPI_FORTRAN_IGNORE_TKR_TYPE :: buf
16+
OMPI_F08_IGNORE_TKR_TYPE :: buf
1717
INTEGER, INTENT(IN) :: count
1818
TYPE(MPI_Datatype), INTENT(IN) :: datatype
1919
TYPE(MPI_Message), INTENT(INOUT) :: message

0 commit comments

Comments
 (0)