Skip to content

Commit 4c9b4ba

Browse files
committed
fortran/use-mpi-f08: ssend/issend/ssend_init
Signed-off-by: Gilles Gouaillardet <gilles@rist.or.jp>
1 parent f283554 commit 4c9b4ba

File tree

14 files changed

+221
-27
lines changed

14 files changed

+221
-27
lines changed

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -266,9 +266,9 @@ subroutine ompi_isend_f(buf,count,datatype,dest,tag,comm,request,ierror) &
266266
end subroutine ompi_isend_f
267267

268268
subroutine ompi_issend_f(buf,count,datatype,dest,tag,comm,request,ierror) &
269-
BIND(C, name="ompi_issend_f")
269+
BIND(C, name="ompi_issend_@OMPI_F08_BINDINGS_EXTENSION@")
270270
implicit none
271-
OMPI_FORTRAN_IGNORE_TKR_TYPE, INTENT(IN) :: buf
271+
OMPI_F08_IGNORE_TKR_TYPE, INTENT(IN) :: buf
272272
INTEGER, INTENT(IN) :: count, dest, tag
273273
INTEGER, INTENT(IN) :: datatype
274274
INTEGER, INTENT(IN) :: comm
@@ -387,19 +387,19 @@ subroutine ompi_send_init_f(buf,count,datatype,dest,tag,comm,request,ierror) &
387387
end subroutine ompi_send_init_f
388388

389389
subroutine ompi_ssend_f(buf,count,datatype,dest,tag,comm,ierror) &
390-
BIND(C, name="ompi_ssend_f")
390+
BIND(C, name="ompi_ssend_@OMPI_F08_BINDINGS_EXTENSION@")
391391
implicit none
392-
OMPI_FORTRAN_IGNORE_TKR_TYPE, INTENT(IN) :: buf
392+
OMPI_F08_IGNORE_TKR_TYPE, INTENT(IN) :: buf
393393
INTEGER, INTENT(IN) :: count, dest, tag
394394
INTEGER, INTENT(IN) :: datatype
395395
INTEGER, INTENT(IN) :: comm
396396
INTEGER, INTENT(OUT) :: ierror
397397
end subroutine ompi_ssend_f
398398

399399
subroutine ompi_ssend_init_f(buf,count,datatype,dest,tag,comm,request,ierror) &
400-
BIND(C, name="ompi_ssend_init_f")
400+
BIND(C, name="ompi_ssend_init_@OMPI_F08_BINDINGS_EXTENSION@")
401401
implicit none
402-
OMPI_FORTRAN_IGNORE_TKR_TYPE, INTENT(IN) :: buf
402+
OMPI_F08_IGNORE_TKR_TYPE, INTENT(IN) :: buf
403403
INTEGER, INTENT(IN) :: count, dest, tag
404404
INTEGER, INTENT(IN) :: datatype
405405
INTEGER, INTENT(IN) :: comm

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,13 @@ libforce_usempif08_internal_cdesc_to_be_built_la_SOURCES = \
4444
cdesc.c \
4545
irecv_cdesc.c \
4646
isend_cdesc.c \
47+
issend_cdesc.c \
4748
recv_cdesc.c \
4849
send_cdesc.c \
4950
send_init_cdesc.c \
5051
sendrecv_cdesc.c \
51-
sendrecv_replace_cdesc.c
52+
sendrecv_replace_cdesc.c \
53+
ssend_cdesc.c \
54+
ssend_init_cdesc.c
5255

5356
endif

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

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ void ompi_isend_cdesc(CFI_cdesc_t *x, MPI_Fint *count, MPI_Fint *datatype,
2525
MPI_Fint *dest, MPI_Fint *tag, MPI_Fint *comm,
2626
MPI_Fint *request, MPI_Fint *ierr);
2727

28+
void ompi_issend_cdesc(CFI_cdesc_t* x, MPI_Fint *count, MPI_Fint *datatype,
29+
MPI_Fint *dest, MPI_Fint *tag, MPI_Fint *comm,
30+
MPI_Fint *request, MPI_Fint *ierr);
31+
2832
void ompi_recv_cdesc(CFI_cdesc_t *x, MPI_Fint *count, MPI_Fint *datatype,
2933
MPI_Fint *source, MPI_Fint *tag, MPI_Fint *comm,
3034
MPI_Fint *status, MPI_Fint *ierr);
@@ -46,4 +50,13 @@ void ompi_sendrecv_replace_cdesc(CFI_cdesc_t* x, MPI_Fint *count, MPI_Fint *data
4650
MPI_Fint *dest, MPI_Fint *sendtag,
4751
MPI_Fint *source, MPI_Fint *recvtag,
4852
MPI_Fint *comm, MPI_Fint *status, MPI_Fint *ierr);
53+
54+
void ompi_ssend_cdesc(CFI_cdesc_t* x, MPI_Fint *count, MPI_Fint *datatype,
55+
MPI_Fint *dest, MPI_Fint *tag,
56+
MPI_Fint *comm, MPI_Fint *ierr);
57+
58+
void ompi_ssend_init_cdesc(CFI_cdesc_t* x, MPI_Fint *count, MPI_Fint *datatype,
59+
MPI_Fint *dest, MPI_Fint *tag,
60+
MPI_Fint *comm, MPI_Fint *request, MPI_Fint *ierr);
61+
4962
#endif /* OMPI_CDESC_BINDINGS_H */
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
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) 2011-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$
16+
*
17+
* Additional copyrights may follow
18+
*
19+
* $HEADER$
20+
*/
21+
22+
#include "ompi_config.h"
23+
24+
#include "ompi/mpi/fortran/mpif-h/bindings.h"
25+
#include "ompi/mpi/fortran/use-mpi-f08/cdesc/bindings.h"
26+
#include "ompi/mpi/fortran/base/constants.h"
27+
28+
void ompi_issend_cdesc(CFI_cdesc_t* x, MPI_Fint *count, MPI_Fint *datatype, MPI_Fint *dest, MPI_Fint *tag, MPI_Fint *comm, MPI_Fint *request, MPI_Fint *ierr)
29+
{
30+
int c_ierr;
31+
MPI_Datatype c_datatype, c_type = PMPI_Type_f2c(*datatype);
32+
MPI_Request c_req;
33+
MPI_Comm c_comm;
34+
void *buf = x->base_addr;
35+
int c_count = OMPI_FINT_2_INT(*count);
36+
37+
c_comm = PMPI_Comm_f2c (*comm);
38+
39+
c_datatype = c_type;
40+
if (x->rank != 0 && !CFI_is_contiguous(x)) {
41+
c_ierr = cdesc_create_datatype(x, c_count, c_type, &c_datatype);
42+
if (MPI_SUCCESS != c_ierr) {
43+
if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr);
44+
return;
45+
}
46+
c_count = 1;
47+
}
48+
c_ierr = PMPI_Issend(OMPI_F2C_BOTTOM(buf), c_count,
49+
c_datatype, OMPI_FINT_2_INT(*dest),
50+
OMPI_FINT_2_INT(*tag),
51+
c_comm, &c_req);
52+
if (c_datatype != c_type) {
53+
ompi_datatype_destroy(&c_datatype);
54+
}
55+
if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr);
56+
57+
if (MPI_SUCCESS == c_ierr) {
58+
*request = PMPI_Request_c2f(c_req);
59+
}
60+
}
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
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) 2011-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$
16+
*
17+
* Additional copyrights may follow
18+
*
19+
* $HEADER$
20+
*/
21+
22+
#include "ompi_config.h"
23+
24+
#include "ompi/mpi/fortran/mpif-h/bindings.h"
25+
#include "ompi/mpi/fortran/use-mpi-f08/cdesc/bindings.h"
26+
#include "ompi/mpi/fortran/base/constants.h"
27+
28+
void ompi_ssend_cdesc(CFI_cdesc_t* x, MPI_Fint *count, MPI_Fint *datatype,
29+
MPI_Fint *dest, MPI_Fint *tag,
30+
MPI_Fint *comm, MPI_Fint *ierr)
31+
{
32+
int c_ierr;
33+
MPI_Datatype c_datatype, c_type = PMPI_Type_f2c(*datatype);
34+
MPI_Comm c_comm;
35+
void *buf = x->base_addr;
36+
int c_count = OMPI_FINT_2_INT(*count);
37+
38+
c_comm = PMPI_Comm_f2c (*comm);
39+
40+
c_datatype = c_type;
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 = PMPI_Ssend(OMPI_F2C_BOTTOM(buf), c_count,
50+
c_datatype, OMPI_FINT_2_INT(*dest),
51+
OMPI_FINT_2_INT(*tag), c_comm);
52+
if (c_datatype != c_type) {
53+
ompi_datatype_destroy(&c_datatype);
54+
}
55+
if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr);
56+
}
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
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) 2011-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$
16+
*
17+
* Additional copyrights may follow
18+
*
19+
* $HEADER$
20+
*/
21+
22+
#include "ompi_config.h"
23+
24+
#include "ompi/mpi/fortran/mpif-h/bindings.h"
25+
#include "ompi/mpi/fortran/use-mpi-f08/cdesc/bindings.h"
26+
#include "ompi/mpi/fortran/base/constants.h"
27+
28+
void ompi_ssend_init_cdesc(CFI_cdesc_t* x, MPI_Fint *count, MPI_Fint *datatype,
29+
MPI_Fint *dest, MPI_Fint *tag,
30+
MPI_Fint *comm, 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_Comm c_comm;
36+
void *buf = x->base_addr;
37+
int c_count = OMPI_FINT_2_INT(*count);
38+
39+
c_comm = PMPI_Comm_f2c (*comm);
40+
41+
c_datatype = c_type;
42+
if (x->rank != 0 && !CFI_is_contiguous(x)) {
43+
c_ierr = cdesc_create_datatype(x, c_count, c_type, &c_datatype);
44+
if (MPI_SUCCESS != c_ierr) {
45+
if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr);
46+
return;
47+
}
48+
c_count = 1;
49+
}
50+
c_ierr = PMPI_Ssend_init(OMPI_F2C_BOTTOM(buf), c_count,
51+
c_datatype, OMPI_FINT_2_INT(*dest),
52+
OMPI_FINT_2_INT(*tag),
53+
c_comm, &c_req);
54+
if (c_datatype != c_type) {
55+
ompi_datatype_destroy(&c_datatype);
56+
}
57+
if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr);
58+
59+
if (MPI_SUCCESS == c_ierr) {
60+
*request = PMPI_Request_c2f(c_req);
61+
}
62+
}

ompi/mpi/fortran/use-mpi-f08/issend_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_Issend_f08(buf,count,datatype,dest,tag,comm,request,ierror)
1313
use :: mpi_f08_types, only : MPI_Datatype, MPI_Comm, MPI_Request
1414
use :: ompi_mpifh_bindings, only : ompi_issend_f
1515
implicit none
16-
OMPI_FORTRAN_IGNORE_TKR_TYPE, INTENT(IN) :: buf
16+
OMPI_F08_IGNORE_TKR_TYPE, INTENT(IN) :: buf
1717
INTEGER, INTENT(IN) :: count, dest, tag
1818
TYPE(MPI_Datatype), INTENT(IN) :: datatype
1919
TYPE(MPI_Comm), INTENT(IN) :: comm

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -189,11 +189,11 @@ subroutine MPI_Issend_f08(buf,count,datatype,dest,tag,comm,request,ierror)
189189
use :: mpi_f08_types, only : MPI_Datatype, MPI_Comm, MPI_Request
190190
implicit none
191191
!DEC$ ATTRIBUTES NO_ARG_CHECK :: buf
192-
!GCC$ ATTRIBUTES NO_ARG_CHECK :: buf
192+
OMPI_F08_GCC_ATTRIBUTES(buf)
193193
!$PRAGMA IGNORE_TKR buf
194194
!DIR$ IGNORE_TKR buf
195195
!IBM* IGNORE_TKR buf
196-
OMPI_FORTRAN_IGNORE_TKR_TYPE, INTENT(IN) :: buf
196+
OMPI_F08_IGNORE_TKR_TYPE, INTENT(IN) :: buf
197197
INTEGER, INTENT(IN) :: count, dest, tag
198198
TYPE(MPI_Datatype), INTENT(IN) :: datatype
199199
TYPE(MPI_Comm), INTENT(IN) :: comm
@@ -384,11 +384,11 @@ subroutine MPI_Ssend_f08(buf,count,datatype,dest,tag,comm,ierror)
384384
use :: mpi_f08_types, only : MPI_Datatype, MPI_Comm
385385
implicit none
386386
!DEC$ ATTRIBUTES NO_ARG_CHECK :: buf
387-
!GCC$ ATTRIBUTES NO_ARG_CHECK :: buf
387+
OMPI_F08_GCC_ATTRIBUTES(buf)
388388
!$PRAGMA IGNORE_TKR buf
389389
!DIR$ IGNORE_TKR buf
390390
!IBM* IGNORE_TKR buf
391-
OMPI_FORTRAN_IGNORE_TKR_TYPE, INTENT(IN) :: buf
391+
OMPI_F08_IGNORE_TKR_TYPE, INTENT(IN) :: buf
392392
INTEGER, INTENT(IN) :: count, dest, tag
393393
TYPE(MPI_Datatype), INTENT(IN) :: datatype
394394
TYPE(MPI_Comm), INTENT(IN) :: comm

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -189,11 +189,11 @@ subroutine PMPI_Issend_f08(buf,count,datatype,dest,tag,comm,request,ierror)
189189
use :: mpi_f08_types, only : MPI_Datatype, MPI_Comm, MPI_Request
190190
implicit none
191191
!DEC$ ATTRIBUTES NO_ARG_CHECK :: buf
192-
!GCC$ ATTRIBUTES NO_ARG_CHECK :: buf
192+
OMPI_F08_GCC_ATTRIBUTES(buf)
193193
!$PRAGMA IGNORE_TKR buf
194194
!DIR$ IGNORE_TKR buf
195195
!IBM* IGNORE_TKR buf
196-
OMPI_FORTRAN_IGNORE_TKR_TYPE, INTENT(IN) :: buf
196+
OMPI_F08_IGNORE_TKR_TYPE, INTENT(IN) :: buf
197197
INTEGER, INTENT(IN) :: count, dest, tag
198198
TYPE(MPI_Datatype), INTENT(IN) :: datatype
199199
TYPE(MPI_Comm), INTENT(IN) :: comm
@@ -384,11 +384,11 @@ subroutine PMPI_Ssend_f08(buf,count,datatype,dest,tag,comm,ierror)
384384
use :: mpi_f08_types, only : MPI_Datatype, MPI_Comm
385385
implicit none
386386
!DEC$ ATTRIBUTES NO_ARG_CHECK :: buf
387-
!GCC$ ATTRIBUTES NO_ARG_CHECK :: buf
387+
OMPI_F08_GCC_ATTRIBUTES(buf)
388388
!$PRAGMA IGNORE_TKR buf
389389
!DIR$ IGNORE_TKR buf
390390
!IBM* IGNORE_TKR buf
391-
OMPI_FORTRAN_IGNORE_TKR_TYPE, INTENT(IN) :: buf
391+
OMPI_F08_IGNORE_TKR_TYPE, INTENT(IN) :: buf
392392
INTEGER, INTENT(IN) :: count, dest, tag
393393
TYPE(MPI_Datatype), INTENT(IN) :: datatype
394394
TYPE(MPI_Comm), INTENT(IN) :: comm

ompi/mpi/fortran/use-mpi-f08/profile/pissend_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_Issend_f08(buf,count,datatype,dest,tag,comm,request,ierror)
1313
use :: mpi_f08_types, only : MPI_Datatype, MPI_Comm, MPI_Request
1414
use :: ompi_mpifh_bindings, only : ompi_issend_f
1515
implicit none
16-
OMPI_FORTRAN_IGNORE_TKR_TYPE, INTENT(IN) :: buf
16+
OMPI_F08_IGNORE_TKR_TYPE, INTENT(IN) :: buf
1717
INTEGER, INTENT(IN) :: count, dest, tag
1818
TYPE(MPI_Datatype), INTENT(IN) :: datatype
1919
TYPE(MPI_Comm), INTENT(IN) :: comm

0 commit comments

Comments
 (0)