Skip to content

Commit f050429

Browse files
ggouaillardethppritcha
authored andcommitted
fortran/use-mpi-f08: add CFI support for pack subroutines
Signed-off-by: Gilles Gouaillardet <gilles@rist.or.jp>
1 parent 35577b2 commit f050429

File tree

13 files changed

+386
-47
lines changed

13 files changed

+386
-47
lines changed

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

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -581,10 +581,10 @@ end subroutine ompi_get_elements_x_f
581581

582582
subroutine ompi_pack_f(inbuf,incount,datatype,outbuf,outsize, &
583583
position,comm,ierror) &
584-
BIND(C, name="ompi_pack_f")
584+
BIND(C, name="ompi_pack_@OMPI_F08_BINDINGS_EXTENSION@")
585585
implicit none
586-
OMPI_FORTRAN_IGNORE_TKR_TYPE, INTENT(IN) :: inbuf
587-
OMPI_FORTRAN_IGNORE_TKR_TYPE :: outbuf
586+
OMPI_F08_IGNORE_TKR_TYPE, INTENT(IN) :: inbuf
587+
OMPI_F08_IGNORE_TKR_TYPE :: outbuf
588588
INTEGER, INTENT(IN) :: incount, outsize
589589
INTEGER, INTENT(IN) :: datatype
590590
INTEGER, INTENT(INOUT) :: position
@@ -594,13 +594,13 @@ end subroutine ompi_pack_f
594594

595595
subroutine ompi_pack_external_f(datarep,inbuf,incount,datatype, &
596596
outbuf,outsize,position,ierror,datarep_len) &
597-
BIND(C, name="ompi_pack_external_f")
597+
BIND(C, name="ompi_pack_external_@OMPI_F08_BINDINGS_EXTENSION@")
598598
use, intrinsic :: ISO_C_BINDING, only : C_CHAR
599599
use :: mpi_f08_types, only : MPI_ADDRESS_KIND
600600
implicit none
601601
CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: datarep
602-
OMPI_FORTRAN_IGNORE_TKR_TYPE, INTENT(IN) :: inbuf
603-
OMPI_FORTRAN_IGNORE_TKR_TYPE :: outbuf
602+
OMPI_F08_IGNORE_TKR_TYPE, INTENT(IN) :: inbuf
603+
OMPI_F08_IGNORE_TKR_TYPE :: outbuf
604604
INTEGER, INTENT(IN) :: incount
605605
INTEGER, INTENT(IN) :: datatype
606606
INTEGER(MPI_ADDRESS_KIND), INTENT(IN) :: outsize
@@ -855,10 +855,10 @@ end subroutine ompi_type_vector_f
855855

856856
subroutine ompi_unpack_f(inbuf,insize,position,outbuf,outcount, &
857857
datatype,comm,ierror) &
858-
BIND(C, name="ompi_unpack_f")
858+
BIND(C, name="ompi_unpack_@OMPI_F08_BINDINGS_EXTENSION@")
859859
implicit none
860-
OMPI_FORTRAN_IGNORE_TKR_TYPE, INTENT(IN) :: inbuf
861-
OMPI_FORTRAN_IGNORE_TKR_TYPE :: outbuf
860+
OMPI_F08_IGNORE_TKR_TYPE, INTENT(IN) :: inbuf
861+
OMPI_F08_IGNORE_TKR_TYPE :: outbuf
862862
INTEGER, INTENT(IN) :: insize, outcount
863863
INTEGER, INTENT(INOUT) :: position
864864
INTEGER, INTENT(IN) :: datatype
@@ -868,13 +868,13 @@ end subroutine ompi_unpack_f
868868

869869
subroutine ompi_unpack_external_f(datarep,inbuf,insize,position, &
870870
outbuf,outcount,datatype,ierror,datarep_len) &
871-
BIND(C, name="ompi_unpack_external_f")
871+
BIND(C, name="ompi_unpack_external_@OMPI_F08_BINDINGS_EXTENSION@")
872872
use, intrinsic :: ISO_C_BINDING, only : C_CHAR
873873
use :: mpi_f08_types, only : MPI_ADDRESS_KIND
874874
implicit none
875875
CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: datarep
876-
OMPI_FORTRAN_IGNORE_TKR_TYPE, INTENT(IN) :: inbuf
877-
OMPI_FORTRAN_IGNORE_TKR_TYPE :: outbuf
876+
OMPI_F08_IGNORE_TKR_TYPE, INTENT(IN) :: inbuf
877+
OMPI_F08_IGNORE_TKR_TYPE :: outbuf
878878
INTEGER(MPI_ADDRESS_KIND), INTENT(IN) :: insize
879879
INTEGER(MPI_ADDRESS_KIND), INTENT(INOUT) :: position
880880
INTEGER, INTENT(IN) :: outcount

ompi/mpi/fortran/use-mpi-f08/mod/mpi-f08-interfaces.h.in

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -714,39 +714,39 @@ end subroutine MPI_Get_elements_x_f08
714714
end interface MPI_Get_elements_x
715715

716716
interface MPI_Pack
717-
subroutine MPI_Pack_f08(inbuf,incount,datatype,outbuf,outsize,position,comm,ierror)
717+
subroutine MPI_Pack_f08@OMPI_F08_BINDINGS_TS_SUFFIX@(inbuf,incount,datatype,outbuf,outsize,position,comm,ierror)
718718
use :: mpi_f08_types, only : MPI_Datatype, MPI_Comm
719719
implicit none
720-
@OMPI_FORTRAN_IGNORE_TKR_PREDECL@ inbuf, outbuf
721-
@OMPI_FORTRAN_IGNORE_TKR_TYPE@, INTENT(IN) :: inbuf
722-
@OMPI_FORTRAN_IGNORE_TKR_TYPE@ :: outbuf
720+
@OMPI_F08_IGNORE_TKR_PREDECL@ inbuf, outbuf
721+
@OMPI_F08_IGNORE_TKR_TYPE@, INTENT(IN) :: inbuf
722+
@OMPI_F08_IGNORE_TKR_TYPE@ :: outbuf
723723
INTEGER, INTENT(IN) :: incount, outsize
724724
TYPE(MPI_Datatype), INTENT(IN) :: datatype
725725
INTEGER, INTENT(INOUT) :: position
726726
TYPE(MPI_Comm), INTENT(IN) :: comm
727727
INTEGER, OPTIONAL, INTENT(OUT) :: ierror
728-
end subroutine MPI_Pack_f08
728+
end subroutine MPI_Pack_f08@OMPI_F08_BINDINGS_TS_SUFFIX@
729729
end interface MPI_Pack
730730

731731
interface MPI_Pack_external
732-
subroutine MPI_Pack_external_f08(datarep,inbuf,incount,datatype,outbuf,outsize, &
732+
subroutine MPI_Pack_external_f08@OMPI_F08_BINDINGS_TS_SUFFIX@(datarep,inbuf,incount,datatype,outbuf,outsize, &
733733
position,ierror)
734734
use :: mpi_f08_types, only : MPI_Datatype, MPI_ADDRESS_KIND
735735
implicit none
736736
CHARACTER(LEN=*), INTENT(IN) :: datarep
737-
@OMPI_FORTRAN_IGNORE_TKR_PREDECL@ inbuf, outbuf
738-
@OMPI_FORTRAN_IGNORE_TKR_TYPE@, INTENT(IN) :: inbuf
739-
@OMPI_FORTRAN_IGNORE_TKR_TYPE@ :: outbuf
737+
@OMPI_F08_IGNORE_TKR_PREDECL@ inbuf, outbuf
738+
@OMPI_F08_IGNORE_TKR_TYPE@, INTENT(IN) :: inbuf
739+
@OMPI_F08_IGNORE_TKR_TYPE@ :: outbuf
740740
INTEGER, INTENT(IN) :: incount
741741
TYPE(MPI_Datatype), INTENT(IN) :: datatype
742742
INTEGER(MPI_ADDRESS_KIND), INTENT(IN) :: outsize
743743
INTEGER(MPI_ADDRESS_KIND), INTENT(INOUT) :: position
744744
INTEGER, OPTIONAL, INTENT(OUT) :: ierror
745-
end subroutine MPI_Pack_external_f08
745+
end subroutine MPI_Pack_external_f08@OMPI_F08_BINDINGS_TS_SUFFIX@
746746
end interface MPI_Pack_external
747747

748748
interface MPI_Pack_external_size
749-
subroutine MPI_Pack_external_size_f08(datarep,incount,datatype,size,ierror &
749+
subroutine MPI_Pack_external_size_f08@OMPI_F08_BINDINGS_TS_SUFFIX@(datarep,incount,datatype,size,ierror &
750750
)
751751
use :: mpi_f08_types, only : MPI_Datatype, MPI_ADDRESS_KIND
752752
implicit none
@@ -755,7 +755,7 @@ subroutine MPI_Pack_external_size_f08(datarep,incount,datatype,size,ierror &
755755
CHARACTER(LEN=*), INTENT(IN) :: datarep
756756
INTEGER(MPI_ADDRESS_KIND), INTENT(OUT) :: size
757757
INTEGER, OPTIONAL, INTENT(OUT) :: ierror
758-
end subroutine MPI_Pack_external_size_f08
758+
end subroutine MPI_Pack_external_size_f08@OMPI_F08_BINDINGS_TS_SUFFIX@
759759
end interface MPI_Pack_external_size
760760

761761
interface MPI_Pack_size
@@ -1026,37 +1026,37 @@ end subroutine MPI_Type_vector_f08
10261026
end interface MPI_Type_vector
10271027

10281028
interface MPI_Unpack
1029-
subroutine MPI_Unpack_f08(inbuf,insize,position,outbuf,outcount,datatype,comm, &
1029+
subroutine MPI_Unpack_f08@OMPI_F08_BINDINGS_TS_SUFFIX@(inbuf,insize,position,outbuf,outcount,datatype,comm, &
10301030
ierror)
10311031
use :: mpi_f08_types, only : MPI_Datatype, MPI_Comm
10321032
implicit none
1033-
@OMPI_FORTRAN_IGNORE_TKR_PREDECL@ inbuf, outbuf
1034-
@OMPI_FORTRAN_IGNORE_TKR_TYPE@, INTENT(IN) :: inbuf
1035-
@OMPI_FORTRAN_IGNORE_TKR_TYPE@ :: outbuf
1033+
@OMPI_F08_IGNORE_TKR_PREDECL@ inbuf, outbuf
1034+
@OMPI_F08_IGNORE_TKR_TYPE@, INTENT(IN) :: inbuf
1035+
@OMPI_F08_IGNORE_TKR_TYPE@ :: outbuf
10361036
INTEGER, INTENT(IN) :: insize, outcount
10371037
INTEGER, INTENT(INOUT) :: position
10381038
TYPE(MPI_Datatype), INTENT(IN) :: datatype
10391039
TYPE(MPI_Comm), INTENT(IN) :: comm
10401040
INTEGER, OPTIONAL, INTENT(OUT) :: ierror
1041-
end subroutine MPI_Unpack_f08
1041+
end subroutine MPI_Unpack_f08@OMPI_F08_BINDINGS_TS_SUFFIX@
10421042
end interface MPI_Unpack
10431043

10441044
interface MPI_Unpack_external
1045-
subroutine MPI_Unpack_external_f08(datarep,inbuf,insize,position,outbuf,outcount, &
1045+
subroutine MPI_Unpack_external_f08@OMPI_F08_BINDINGS_TS_SUFFIX@(datarep,inbuf,insize,position,outbuf,outcount, &
10461046
datatype,ierror &
10471047
)
10481048
use :: mpi_f08_types, only : MPI_Datatype, MPI_ADDRESS_KIND
10491049
implicit none
10501050
CHARACTER(LEN=*), INTENT(IN) :: datarep
1051-
@OMPI_FORTRAN_IGNORE_TKR_PREDECL@ inbuf, outbuf
1052-
@OMPI_FORTRAN_IGNORE_TKR_TYPE@, INTENT(IN) :: inbuf
1053-
@OMPI_FORTRAN_IGNORE_TKR_TYPE@ :: outbuf
1051+
@OMPI_F08_IGNORE_TKR_PREDECL@ inbuf, outbuf
1052+
@OMPI_F08_IGNORE_TKR_TYPE@, INTENT(IN) :: inbuf
1053+
@OMPI_F08_IGNORE_TKR_TYPE@ :: outbuf
10541054
INTEGER(MPI_ADDRESS_KIND), INTENT(IN) :: insize
10551055
INTEGER(MPI_ADDRESS_KIND), INTENT(INOUT) :: position
10561056
INTEGER, INTENT(IN) :: outcount
10571057
TYPE(MPI_Datatype), INTENT(IN) :: datatype
10581058
INTEGER, OPTIONAL, INTENT(OUT) :: ierror
1059-
end subroutine MPI_Unpack_external_f08
1059+
end subroutine MPI_Unpack_external_f08@OMPI_F08_BINDINGS_TS_SUFFIX@
10601060
end interface MPI_Unpack_external
10611061

10621062
interface MPI_Allgather

ompi/mpi/fortran/use-mpi-f08/mod/mpi-f08-rename.h.in

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -137,9 +137,11 @@
137137
#define MPI_Get_elements_x PMPI_Get_elements_x
138138
#define MPI_Get_elements_x_f08 PMPI_Get_elements_x_f08
139139
#define MPI_Pack PMPI_Pack
140-
#define MPI_Pack_f08 PMPI_Pack_f08
140+
#define MPI_Pack_f08 PMPI_Pack_f08@OMPI_F08_BINDINGS_TS_SUFFIX@
141+
#define MPI_Pack_f08ts PMPI_Pack_f08s
141142
#define MPI_Pack_external PMPI_Pack_external
142-
#define MPI_Pack_external_f08 PMPI_Pack_external_f08
143+
#define MPI_Pack_external_f08 PMPI_Pack_external_f08@OMPI_F08_BINDINGS_TS_SUFFIX@
144+
#define MPI_Pack_external_f08ts PMPI_Pack_external_f08ts
143145
#define MPI_Pack_external_size PMPI_Pack_external_size
144146
#define MPI_Pack_external_size_f08 PMPI_Pack_external_size_f08
145147
#define MPI_Pack_size PMPI_Pack_size
@@ -189,9 +191,11 @@
189191
#define MPI_Type_vector PMPI_Type_vector
190192
#define MPI_Type_vector_f08 PMPI_Type_vector_f08
191193
#define MPI_Unpack PMPI_Unpack
192-
#define MPI_Unpack_f08 PMPI_Unpack_f08
194+
#define MPI_Unpack_f08 PMPI_Unpack_f08@OMPI_F08_BINDINGS_TS_SUFFIX@
195+
#define MPI_Unpack_f08ts PMPI_Unpack_f08ts
193196
#define MPI_Unpack_external PMPI_Unpack_external
194-
#define MPI_Unpack_external_f08 PMPI_Unpack_external_f08
197+
#define MPI_Unpack_external_f08 PMPI_Unpack_external_f08@OMPI_F08_BINDINGS_TS_SUFFIX@
198+
#define MPI_Unpack_external_f08ts PMPI_Unpack_external_f08ts
195199
#define MPI_Allgather PMPI_Allgather
196200
#define MPI_Allgather_f08 PMPI_Allgather_f08
197201
#define MPI_Iallgather PMPI_Iallgather
@@ -840,6 +844,10 @@
840844
#define MPI_Ssend_f08 MPI_Ssend_f08@OMPI_F08_BINDINGS_TS_SUFFIX@
841845
#define MPI_Ssend_init_f08 MPI_Ssend_init_f08@OMPI_F08_BINDINGS_TS_SUFFIX@
842846
#define MPI_Get_address_f08 MPI_Get_address_f08@OMPI_F08_BINDINGS_TS_SUFFIX@
847+
#define MPI_Pack_f08 MPI_Pack_f08@OMPI_F08_BINDINGS_TS_SUFFIX@
848+
#define MPI_Pack_external_f08 MPI_Pack_external_f08@OMPI_F08_BINDINGS_TS_SUFFIX@
849+
#define MPI_Unpack_f08 MPI_Unpack_f08@OMPI_F08_BINDINGS_TS_SUFFIX@
850+
#define MPI_Unpack_external_f08 MPI_Unpack_external_f08@OMPI_F08_BINDINGS_TS_SUFFIX@
843851
#define MPI_Free_mem_f08 MPI_Free_mem_f08@OMPI_F08_BINDINGS_TS_SUFFIX@
844852
#define MPI_F_sync_reg_f08 MPI_F_sync_reg_f08@OMPI_F08_BINDINGS_TS_SUFFIX@
845853
#define MPI_Imrecv_f08 MPI_Imrecv_f08@OMPI_F08_BINDINGS_TS_SUFFIX@

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ subroutine MPI_Pack_external_f08(datarep,inbuf,incount,datatype,outbuf,outsize,
1818
use :: ompi_mpifh_bindings, only : ompi_pack_external_f
1919
implicit none
2020
CHARACTER(LEN=*), INTENT(IN) :: datarep
21-
OMPI_FORTRAN_IGNORE_TKR_TYPE, INTENT(IN) :: inbuf
22-
OMPI_FORTRAN_IGNORE_TKR_TYPE :: outbuf
21+
OMPI_F08_IGNORE_TKR_TYPE, INTENT(IN) :: inbuf
22+
OMPI_F08_IGNORE_TKR_TYPE :: outbuf
2323
INTEGER, INTENT(IN) :: incount
2424
TYPE(MPI_Datatype), INTENT(IN) :: datatype
2525
INTEGER(MPI_ADDRESS_KIND), INTENT(IN) :: outsize

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ subroutine MPI_Pack_f08(inbuf,incount,datatype,outbuf,outsize,position,comm,ierr
1616
use :: mpi_f08_types, only : MPI_Datatype, MPI_Comm
1717
use :: ompi_mpifh_bindings, only : ompi_pack_f
1818
implicit none
19-
OMPI_FORTRAN_IGNORE_TKR_TYPE, INTENT(IN) :: inbuf
20-
OMPI_FORTRAN_IGNORE_TKR_TYPE :: outbuf
19+
OMPI_F08_IGNORE_TKR_TYPE, INTENT(IN) :: inbuf
20+
OMPI_F08_IGNORE_TKR_TYPE :: outbuf
2121
INTEGER, INTENT(IN) :: incount, outsize
2222
TYPE(MPI_Datatype), INTENT(IN) :: datatype
2323
INTEGER, INTENT(INOUT) :: position

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ libusempif08_ts_la_SOURCES = \
4747
isend_ts.c \
4848
issend_ts.c \
4949
mrecv_ts.c \
50+
pack_ts.c \
51+
pack_external_ts.c \
5052
recv_ts.c \
5153
recv_init_ts.c \
5254
rsend_ts.c \
@@ -56,4 +58,6 @@ libusempif08_ts_la_SOURCES = \
5658
sendrecv_ts.c \
5759
sendrecv_replace_ts.c \
5860
ssend_ts.c \
59-
ssend_init_ts.c
61+
ssend_init_ts.c \
62+
unpack_ts.c \
63+
unpack_external_ts.c

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

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,24 @@ void ompi_ssend_init_ts(CFI_cdesc_t* x, MPI_Fint *count, MPI_Fint *datatype,
9292

9393
void ompi_get_address_ts(CFI_cdesc_t *x, MPI_Aint *address, MPI_Fint *ierr);
9494

95+
void ompi_pack_ts(CFI_cdesc_t* x1, MPI_Fint *incount, MPI_Fint *datatype,
96+
CFI_cdesc_t* x2, MPI_Fint *outsize, MPI_Fint *position,
97+
MPI_Fint *comm, MPI_Fint *ierr);
98+
99+
void ompi_pack_external_ts(char *datarep, CFI_cdesc_t* x1, MPI_Fint *incount,
100+
MPI_Fint *datatype, CFI_cdesc_t* x2,
101+
MPI_Aint *outsize, MPI_Aint *position,
102+
MPI_Fint *ierr, int datarep_len);
103+
104+
void ompi_unpack_ts(CFI_cdesc_t* x1, MPI_Fint *insize, MPI_Fint *position,
105+
CFI_cdesc_t* x2, MPI_Fint *outcount, MPI_Fint *datatype,
106+
MPI_Fint *comm, MPI_Fint *ierr);
107+
108+
void ompi_unpack_external_ts(char *datarep, CFI_cdesc_t* x1, MPI_Aint *insize,
109+
MPI_Aint *position, CFI_cdesc_t* x2,
110+
MPI_Fint *outcount, MPI_Fint *datatype,
111+
MPI_Fint *ierr, int datarep_len);
112+
95113
void ompi_free_mem_ts(CFI_cdesc_t *x, MPI_Fint *ierr);
96114

97115
void ompi_f_sync_reg_ts(CFI_cdesc_t *x);
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
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/communicator/communicator.h"
25+
#include "ompi/errhandler/errhandler.h"
26+
#include "ompi/mpi/fortran/use-mpi-f08/ts/bindings.h"
27+
#include "ompi/constants.h"
28+
#include "ompi/mpi/fortran/base/constants.h"
29+
#include "ompi/mpi/fortran/base/fortran_base_strings.h"
30+
31+
static const char FUNC_NAME[] = "MPI_Pack_external";
32+
33+
void ompi_pack_external_ts(char *datarep, CFI_cdesc_t* x1, MPI_Fint *incount,
34+
MPI_Fint *datatype, CFI_cdesc_t* x2,
35+
MPI_Aint *outsize, MPI_Aint *position,
36+
MPI_Fint *ierr, int datarep_len)
37+
{
38+
int ret, c_ierr;
39+
char *c_datarep;
40+
MPI_Datatype c_datatype, c_type = PMPI_Type_f2c(*datatype);
41+
void *inbuf = x1->base_addr;
42+
char *outbuf = x2->base_addr;
43+
int c_incount = OMPI_FINT_2_INT(*incount);
44+
45+
/* Convert the fortran string */
46+
47+
if (OMPI_SUCCESS != (ret = ompi_fortran_string_f2c(datarep, datarep_len,
48+
&c_datarep))) {
49+
c_ierr = OMPI_ERRHANDLER_INVOKE(MPI_COMM_SELF, ret, FUNC_NAME);
50+
if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr);
51+
return;
52+
}
53+
54+
OMPI_CFI_2_C(x1, c_incount, c_type, c_datatype, c_ierr);
55+
if (MPI_SUCCESS != c_ierr) {
56+
if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr);
57+
OMPI_ERRHANDLER_INVOKE(MPI_COMM_SELF, c_ierr, FUNC_NAME);
58+
return;
59+
}
60+
61+
OMPI_CFI_CHECK_CONTIGUOUS(x2, c_ierr);
62+
if (MPI_SUCCESS != c_ierr) {
63+
if (c_datatype != c_type) {
64+
ompi_datatype_destroy(&c_datatype);
65+
}
66+
if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr);
67+
OMPI_ERRHANDLER_INVOKE(MPI_COMM_SELF, c_ierr, FUNC_NAME);
68+
return;
69+
}
70+
71+
c_ierr = PMPI_Pack_external(c_datarep, OMPI_F2C_BOTTOM(inbuf),
72+
c_incount,
73+
c_datatype, outbuf,
74+
*outsize,
75+
position);
76+
if (c_datatype != c_type) {
77+
ompi_datatype_destroy(&c_datatype);
78+
}
79+
if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr);
80+
81+
free(c_datarep);
82+
}

0 commit comments

Comments
 (0)