Skip to content

Commit 842b95f

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 0aa6281 commit 842b95f

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
@@ -577,10 +577,10 @@ end subroutine ompi_get_elements_x_f
577577

578578
subroutine ompi_pack_f(inbuf,incount,datatype,outbuf,outsize, &
579579
position,comm,ierror) &
580-
BIND(C, name="ompi_pack_f")
580+
BIND(C, name="ompi_pack_@OMPI_F08_BINDINGS_EXTENSION@")
581581
implicit none
582-
OMPI_FORTRAN_IGNORE_TKR_TYPE, INTENT(IN) :: inbuf
583-
OMPI_FORTRAN_IGNORE_TKR_TYPE :: outbuf
582+
OMPI_F08_IGNORE_TKR_TYPE, INTENT(IN) :: inbuf
583+
OMPI_F08_IGNORE_TKR_TYPE :: outbuf
584584
INTEGER, INTENT(IN) :: incount, outsize
585585
INTEGER, INTENT(IN) :: datatype
586586
INTEGER, INTENT(INOUT) :: position
@@ -590,13 +590,13 @@ end subroutine ompi_pack_f
590590

591591
subroutine ompi_pack_external_f(datarep,inbuf,incount,datatype, &
592592
outbuf,outsize,position,ierror,datarep_len) &
593-
BIND(C, name="ompi_pack_external_f")
593+
BIND(C, name="ompi_pack_external_@OMPI_F08_BINDINGS_EXTENSION@")
594594
use, intrinsic :: ISO_C_BINDING, only : C_CHAR
595595
use :: mpi_f08_types, only : MPI_ADDRESS_KIND
596596
implicit none
597597
CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: datarep
598-
OMPI_FORTRAN_IGNORE_TKR_TYPE, INTENT(IN) :: inbuf
599-
OMPI_FORTRAN_IGNORE_TKR_TYPE :: outbuf
598+
OMPI_F08_IGNORE_TKR_TYPE, INTENT(IN) :: inbuf
599+
OMPI_F08_IGNORE_TKR_TYPE :: outbuf
600600
INTEGER, INTENT(IN) :: incount
601601
INTEGER, INTENT(IN) :: datatype
602602
INTEGER(MPI_ADDRESS_KIND), INTENT(IN) :: outsize
@@ -851,10 +851,10 @@ end subroutine ompi_type_vector_f
851851

852852
subroutine ompi_unpack_f(inbuf,insize,position,outbuf,outcount, &
853853
datatype,comm,ierror) &
854-
BIND(C, name="ompi_unpack_f")
854+
BIND(C, name="ompi_unpack_@OMPI_F08_BINDINGS_EXTENSION@")
855855
implicit none
856-
OMPI_FORTRAN_IGNORE_TKR_TYPE, INTENT(IN) :: inbuf
857-
OMPI_FORTRAN_IGNORE_TKR_TYPE :: outbuf
856+
OMPI_F08_IGNORE_TKR_TYPE, INTENT(IN) :: inbuf
857+
OMPI_F08_IGNORE_TKR_TYPE :: outbuf
858858
INTEGER, INTENT(IN) :: insize, outcount
859859
INTEGER, INTENT(INOUT) :: position
860860
INTEGER, INTENT(IN) :: datatype
@@ -864,13 +864,13 @@ end subroutine ompi_unpack_f
864864

865865
subroutine ompi_unpack_external_f(datarep,inbuf,insize,position, &
866866
outbuf,outcount,datatype,ierror,datarep_len) &
867-
BIND(C, name="ompi_unpack_external_f")
867+
BIND(C, name="ompi_unpack_external_@OMPI_F08_BINDINGS_EXTENSION@")
868868
use, intrinsic :: ISO_C_BINDING, only : C_CHAR
869869
use :: mpi_f08_types, only : MPI_ADDRESS_KIND
870870
implicit none
871871
CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: datarep
872-
OMPI_FORTRAN_IGNORE_TKR_TYPE, INTENT(IN) :: inbuf
873-
OMPI_FORTRAN_IGNORE_TKR_TYPE :: outbuf
872+
OMPI_F08_IGNORE_TKR_TYPE, INTENT(IN) :: inbuf
873+
OMPI_F08_IGNORE_TKR_TYPE :: outbuf
874874
INTEGER(MPI_ADDRESS_KIND), INTENT(IN) :: insize
875875
INTEGER(MPI_ADDRESS_KIND), INTENT(INOUT) :: position
876876
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
@@ -671,39 +671,39 @@ end subroutine MPI_Get_elements_x_f08
671671
end interface MPI_Get_elements_x
672672

673673
interface MPI_Pack
674-
subroutine MPI_Pack_f08(inbuf,incount,datatype,outbuf,outsize,position,comm,ierror)
674+
subroutine MPI_Pack_f08@OMPI_F08_BINDINGS_TS_SUFFIX@(inbuf,incount,datatype,outbuf,outsize,position,comm,ierror)
675675
use :: mpi_f08_types, only : MPI_Datatype, MPI_Comm
676676
implicit none
677-
@OMPI_FORTRAN_IGNORE_TKR_PREDECL@ inbuf, outbuf
678-
@OMPI_FORTRAN_IGNORE_TKR_TYPE@, INTENT(IN) :: inbuf
679-
@OMPI_FORTRAN_IGNORE_TKR_TYPE@ :: outbuf
677+
@OMPI_F08_IGNORE_TKR_PREDECL@ inbuf, outbuf
678+
@OMPI_F08_IGNORE_TKR_TYPE@, INTENT(IN) :: inbuf
679+
@OMPI_F08_IGNORE_TKR_TYPE@ :: outbuf
680680
INTEGER, INTENT(IN) :: incount, outsize
681681
TYPE(MPI_Datatype), INTENT(IN) :: datatype
682682
INTEGER, INTENT(INOUT) :: position
683683
TYPE(MPI_Comm), INTENT(IN) :: comm
684684
INTEGER, OPTIONAL, INTENT(OUT) :: ierror
685-
end subroutine MPI_Pack_f08
685+
end subroutine MPI_Pack_f08@OMPI_F08_BINDINGS_TS_SUFFIX@
686686
end interface MPI_Pack
687687

688688
interface MPI_Pack_external
689-
subroutine MPI_Pack_external_f08(datarep,inbuf,incount,datatype,outbuf,outsize, &
689+
subroutine MPI_Pack_external_f08@OMPI_F08_BINDINGS_TS_SUFFIX@(datarep,inbuf,incount,datatype,outbuf,outsize, &
690690
position,ierror)
691691
use :: mpi_f08_types, only : MPI_Datatype, MPI_ADDRESS_KIND
692692
implicit none
693693
CHARACTER(LEN=*), INTENT(IN) :: datarep
694-
@OMPI_FORTRAN_IGNORE_TKR_PREDECL@ inbuf, outbuf
695-
@OMPI_FORTRAN_IGNORE_TKR_TYPE@, INTENT(IN) :: inbuf
696-
@OMPI_FORTRAN_IGNORE_TKR_TYPE@ :: outbuf
694+
@OMPI_F08_IGNORE_TKR_PREDECL@ inbuf, outbuf
695+
@OMPI_F08_IGNORE_TKR_TYPE@, INTENT(IN) :: inbuf
696+
@OMPI_F08_IGNORE_TKR_TYPE@ :: outbuf
697697
INTEGER, INTENT(IN) :: incount
698698
TYPE(MPI_Datatype), INTENT(IN) :: datatype
699699
INTEGER(MPI_ADDRESS_KIND), INTENT(IN) :: outsize
700700
INTEGER(MPI_ADDRESS_KIND), INTENT(INOUT) :: position
701701
INTEGER, OPTIONAL, INTENT(OUT) :: ierror
702-
end subroutine MPI_Pack_external_f08
702+
end subroutine MPI_Pack_external_f08@OMPI_F08_BINDINGS_TS_SUFFIX@
703703
end interface MPI_Pack_external
704704

705705
interface MPI_Pack_external_size
706-
subroutine MPI_Pack_external_size_f08(datarep,incount,datatype,size,ierror &
706+
subroutine MPI_Pack_external_size_f08@OMPI_F08_BINDINGS_TS_SUFFIX@(datarep,incount,datatype,size,ierror &
707707
)
708708
use :: mpi_f08_types, only : MPI_Datatype, MPI_ADDRESS_KIND
709709
implicit none
@@ -712,7 +712,7 @@ subroutine MPI_Pack_external_size_f08(datarep,incount,datatype,size,ierror &
712712
CHARACTER(LEN=*), INTENT(IN) :: datarep
713713
INTEGER(MPI_ADDRESS_KIND), INTENT(OUT) :: size
714714
INTEGER, OPTIONAL, INTENT(OUT) :: ierror
715-
end subroutine MPI_Pack_external_size_f08
715+
end subroutine MPI_Pack_external_size_f08@OMPI_F08_BINDINGS_TS_SUFFIX@
716716
end interface MPI_Pack_external_size
717717

718718
interface MPI_Pack_size
@@ -983,37 +983,37 @@ end subroutine MPI_Type_vector_f08
983983
end interface MPI_Type_vector
984984

985985
interface MPI_Unpack
986-
subroutine MPI_Unpack_f08(inbuf,insize,position,outbuf,outcount,datatype,comm, &
986+
subroutine MPI_Unpack_f08@OMPI_F08_BINDINGS_TS_SUFFIX@(inbuf,insize,position,outbuf,outcount,datatype,comm, &
987987
ierror)
988988
use :: mpi_f08_types, only : MPI_Datatype, MPI_Comm
989989
implicit none
990-
@OMPI_FORTRAN_IGNORE_TKR_PREDECL@ inbuf, outbuf
991-
@OMPI_FORTRAN_IGNORE_TKR_TYPE@, INTENT(IN) :: inbuf
992-
@OMPI_FORTRAN_IGNORE_TKR_TYPE@ :: outbuf
990+
@OMPI_F08_IGNORE_TKR_PREDECL@ inbuf, outbuf
991+
@OMPI_F08_IGNORE_TKR_TYPE@, INTENT(IN) :: inbuf
992+
@OMPI_F08_IGNORE_TKR_TYPE@ :: outbuf
993993
INTEGER, INTENT(IN) :: insize, outcount
994994
INTEGER, INTENT(INOUT) :: position
995995
TYPE(MPI_Datatype), INTENT(IN) :: datatype
996996
TYPE(MPI_Comm), INTENT(IN) :: comm
997997
INTEGER, OPTIONAL, INTENT(OUT) :: ierror
998-
end subroutine MPI_Unpack_f08
998+
end subroutine MPI_Unpack_f08@OMPI_F08_BINDINGS_TS_SUFFIX@
999999
end interface MPI_Unpack
10001000

10011001
interface MPI_Unpack_external
1002-
subroutine MPI_Unpack_external_f08(datarep,inbuf,insize,position,outbuf,outcount, &
1002+
subroutine MPI_Unpack_external_f08@OMPI_F08_BINDINGS_TS_SUFFIX@(datarep,inbuf,insize,position,outbuf,outcount, &
10031003
datatype,ierror &
10041004
)
10051005
use :: mpi_f08_types, only : MPI_Datatype, MPI_ADDRESS_KIND
10061006
implicit none
10071007
CHARACTER(LEN=*), INTENT(IN) :: datarep
1008-
@OMPI_FORTRAN_IGNORE_TKR_PREDECL@ inbuf, outbuf
1009-
@OMPI_FORTRAN_IGNORE_TKR_TYPE@, INTENT(IN) :: inbuf
1010-
@OMPI_FORTRAN_IGNORE_TKR_TYPE@ :: outbuf
1008+
@OMPI_F08_IGNORE_TKR_PREDECL@ inbuf, outbuf
1009+
@OMPI_F08_IGNORE_TKR_TYPE@, INTENT(IN) :: inbuf
1010+
@OMPI_F08_IGNORE_TKR_TYPE@ :: outbuf
10111011
INTEGER(MPI_ADDRESS_KIND), INTENT(IN) :: insize
10121012
INTEGER(MPI_ADDRESS_KIND), INTENT(INOUT) :: position
10131013
INTEGER, INTENT(IN) :: outcount
10141014
TYPE(MPI_Datatype), INTENT(IN) :: datatype
10151015
INTEGER, OPTIONAL, INTENT(OUT) :: ierror
1016-
end subroutine MPI_Unpack_external_f08
1016+
end subroutine MPI_Unpack_external_f08@OMPI_F08_BINDINGS_TS_SUFFIX@
10171017
end interface MPI_Unpack_external
10181018

10191019
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
@@ -129,9 +129,11 @@
129129
#define MPI_Get_elements_x PMPI_Get_elements_x
130130
#define MPI_Get_elements_x_f08 PMPI_Get_elements_x_f08
131131
#define MPI_Pack PMPI_Pack
132-
#define MPI_Pack_f08 PMPI_Pack_f08
132+
#define MPI_Pack_f08 PMPI_Pack_f08@OMPI_F08_BINDINGS_TS_SUFFIX@
133+
#define MPI_Pack_f08ts PMPI_Pack_f08s
133134
#define MPI_Pack_external PMPI_Pack_external
134-
#define MPI_Pack_external_f08 PMPI_Pack_external_f08
135+
#define MPI_Pack_external_f08 PMPI_Pack_external_f08@OMPI_F08_BINDINGS_TS_SUFFIX@
136+
#define MPI_Pack_external_f08ts PMPI_Pack_external_f08ts
135137
#define MPI_Pack_external_size PMPI_Pack_external_size
136138
#define MPI_Pack_external_size_f08 PMPI_Pack_external_size_f08
137139
#define MPI_Pack_size PMPI_Pack_size
@@ -181,9 +183,11 @@
181183
#define MPI_Type_vector PMPI_Type_vector
182184
#define MPI_Type_vector_f08 PMPI_Type_vector_f08
183185
#define MPI_Unpack PMPI_Unpack
184-
#define MPI_Unpack_f08 PMPI_Unpack_f08
186+
#define MPI_Unpack_f08 PMPI_Unpack_f08@OMPI_F08_BINDINGS_TS_SUFFIX@
187+
#define MPI_Unpack_f08ts PMPI_Unpack_f08ts
185188
#define MPI_Unpack_external PMPI_Unpack_external
186-
#define MPI_Unpack_external_f08 PMPI_Unpack_external_f08
189+
#define MPI_Unpack_external_f08 PMPI_Unpack_external_f08@OMPI_F08_BINDINGS_TS_SUFFIX@
190+
#define MPI_Unpack_external_f08ts PMPI_Unpack_external_f08ts
187191
#define MPI_Allgather PMPI_Allgather
188192
#define MPI_Allgather_f08 PMPI_Allgather_f08
189193
#define MPI_Iallgather PMPI_Iallgather
@@ -830,6 +834,10 @@
830834
#define MPI_Ssend_f08 MPI_Ssend_f08@OMPI_F08_BINDINGS_TS_SUFFIX@
831835
#define MPI_Ssend_init_f08 MPI_Ssend_init_f08@OMPI_F08_BINDINGS_TS_SUFFIX@
832836
#define MPI_Get_address_f08 MPI_Get_address_f08@OMPI_F08_BINDINGS_TS_SUFFIX@
837+
#define MPI_Pack_f08 MPI_Pack_f08@OMPI_F08_BINDINGS_TS_SUFFIX@
838+
#define MPI_Pack_external_f08 MPI_Pack_external_f08@OMPI_F08_BINDINGS_TS_SUFFIX@
839+
#define MPI_Unpack_f08 MPI_Unpack_f08@OMPI_F08_BINDINGS_TS_SUFFIX@
840+
#define MPI_Unpack_external_f08 MPI_Unpack_external_f08@OMPI_F08_BINDINGS_TS_SUFFIX@
833841
#define MPI_Free_mem_f08 MPI_Free_mem_f08@OMPI_F08_BINDINGS_TS_SUFFIX@
834842
#define MPI_F_sync_reg_f08 MPI_F_sync_reg_f08@OMPI_F08_BINDINGS_TS_SUFFIX@
835843
#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)