Skip to content

Commit cfe0906

Browse files
Fixed C/Fortran linking to include module parameters in Psend/Precv_init
Signed-off-by: Emmanuel Brelle <emmanuel.brelle@atos.net>
1 parent fafbb37 commit cfe0906

File tree

13 files changed

+63
-32
lines changed

13 files changed

+63
-32
lines changed

ompi/include/mpi.h.in

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
* Copyright (c) 2021 Google, LLC. All rights reserved.
2525
* Copyright (c) 2021 Amazon.com, Inc. or its affiliates. All Rights
2626
* reserved.
27+
* Copyright (c) 2021 Bull S.A.S. All rights reserved.
2728
* $COPYRIGHT$
2829
*
2930
* Additional copyrights may follow
@@ -1776,11 +1777,11 @@ OMPI_DECLSPEC int MPI_Pready_range(int partition_low, int partition_high,
17761777
OMPI_DECLSPEC int MPI_Pready_list(int length, int partition_list[], MPI_Request request);
17771778
OMPI_DECLSPEC int MPI_Precv_init(void* buf, int partitions, MPI_Count count,
17781779
MPI_Datatype datatype, int source, int tag, MPI_Comm comm,
1779-
MPI_Request *request);
1780+
MPI_Info info, MPI_Request *request);
17801781
OMPI_DECLSPEC int MPI_Probe(int source, int tag, MPI_Comm comm, MPI_Status *status);
17811782
OMPI_DECLSPEC int MPI_Psend_init(const void* buf, int partitions, MPI_Count count,
17821783
MPI_Datatype datatype, int dest, int tag, MPI_Comm comm,
1783-
MPI_Request *request);
1784+
MPI_Info info, MPI_Request *request);
17841785
OMPI_DECLSPEC int MPI_Publish_name(const char *service_name, MPI_Info info,
17851786
const char *port_name);
17861787
OMPI_DECLSPEC int MPI_Put(const void *origin_addr, int origin_count, MPI_Datatype origin_datatype,
@@ -2433,10 +2434,10 @@ OMPI_DECLSPEC int PMPI_Issend(const void *buf, int count, MPI_Datatype datatype
24332434
int tag, MPI_Comm comm, MPI_Request *request);
24342435
OMPI_DECLSPEC int PMPI_Precv_init(void* buf, int partitions, MPI_Count count,
24352436
MPI_Datatype datatype, int source, int tag, MPI_Comm comm,
2436-
MPI_Request *request);
2437+
MPI_Info info, MPI_Request *request);
24372438
OMPI_DECLSPEC int PMPI_Psend_init(const void* buf, int partitions, MPI_Count count,
24382439
MPI_Datatype datatype, int dest, int tag, MPI_Comm comm,
2439-
MPI_Request *request);
2440+
MPI_Info info, MPI_Request *request);
24402441
OMPI_DECLSPEC int PMPI_Pready(int partitions, MPI_Request request);
24412442
OMPI_DECLSPEC int PMPI_Pready_range(int partition_low, int partition_high,
24422443
MPI_Request request);

ompi/mca/part/part.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
* Copyright (c) 2015 Research Organization for Information Science
1616
* and Technology (RIST). All rights reserved.
1717
* Copyright (c) 2011-2020 Sandia National Laboratories. All rights reserved.
18+
* Copyright (c) 2021 Bull S.A.S. All rights reserved.
1819
* $COPYRIGHT$
1920
*
2021
* Additional copyrights may follow
@@ -141,6 +142,7 @@ typedef int (*mca_part_base_module_precv_init_fn_t)(
141142
int src,
142143
int tag,
143144
struct ompi_communicator_t* comm,
145+
struct ompi_info_t * info,
144146
struct ompi_request_t **request
145147
);
146148

@@ -166,6 +168,7 @@ typedef int (*mca_part_base_module_psend_init_fn_t)(
166168
int dst,
167169
int tag,
168170
struct ompi_communicator_t* comm,
171+
struct ompi_info_t * info,
169172
struct ompi_request_t **request
170173
);
171174

ompi/mca/part/persist/part_persist.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
* Copyright (c) 2021 University of Alabama at Birmingham. All rights reserved.
1414
* Copyright (c) 2021 Tennessee Technological University. All rights reserved.
1515
* Copyright (c) 2021 Cisco Systems, Inc. All rights reserved
16+
* Copyright (c) 2021 Bull S.A.S. All rights reserved.
1617
* $COPYRIGHT$
1718
*
1819
* Additional copyrights may follow
@@ -331,6 +332,7 @@ mca_part_persist_precv_init(void *buf,
331332
int src,
332333
int tag,
333334
struct ompi_communicator_t *comm,
335+
struct ompi_info_t * info,
334336
struct ompi_request_t **request)
335337
{
336338
int err = OMPI_SUCCESS;
@@ -398,6 +400,7 @@ mca_part_persist_psend_init(const void* buf,
398400
int dst,
399401
int tag,
400402
ompi_communicator_t* comm,
403+
struct ompi_info_t * info,
401404
ompi_request_t** request)
402405
{
403406
int err = OMPI_SUCCESS;

ompi/mpi/c/precv_init.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
* Copyright (c) 2015 Research Organization for Information Science
1717
* and Technology (RIST). All rights reserved.
1818
* Copyright (c) 2020 Sandia National Laboratories. All rights reserved.
19+
* Copyright (c) 2021 Bull S.A.S. All rights reserved.
1920
* $COPYRIGHT$
2021
*
2122
* Additional copyrights may follow
@@ -43,7 +44,7 @@
4344
static const char FUNC_NAME[] = "MPI_Precv_init";
4445

4546

46-
int MPI_Precv_init(void* buf, int partitions, MPI_Count count, MPI_Datatype datatype, int source, int tag, MPI_Comm comm, MPI_Request *request)
47+
int MPI_Precv_init(void* buf, int partitions, MPI_Count count, MPI_Datatype datatype, int source, int tag, MPI_Comm comm, MPI_Info info, MPI_Request *request)
4748
{
4849
int rc;
4950

@@ -59,6 +60,6 @@ int MPI_Precv_init(void* buf, int partitions, MPI_Count count, MPI_Datatype data
5960
OMPI_ERRHANDLER_CHECK(rc, MPI_COMM_WORLD, rc, FUNC_NAME);
6061
}
6162

62-
rc = mca_part.part_precv_init(buf, partitions, count, datatype, source, tag, comm, request);
63+
rc = mca_part.part_precv_init(buf, partitions, count, datatype, source, tag, comm, info, request);
6364
OMPI_ERRHANDLER_RETURN(rc, MPI_COMM_WORLD, rc, FUNC_NAME);
6465
}

ompi/mpi/c/psend_init.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
* Copyright (c) 2015 Research Organization for Information Science
1717
* and Technology (RIST). All rights reserved.
1818
* Copyright (c) 2020 Sandia National Laboratories. All rights reserved.
19+
* Copyright (c) 2021 Bull S.A.S. All rights reserved.
1920
* $COPYRIGHT$
2021
*
2122
* Additional copyrights may follow
@@ -43,7 +44,7 @@
4344
static const char FUNC_NAME[] = "MPI_Psend_init";
4445

4546

46-
int MPI_Psend_init(const void* buf, int partitions, MPI_Count count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm, MPI_Request *request)
47+
int MPI_Psend_init(const void* buf, int partitions, MPI_Count count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm, MPI_Info info, MPI_Request *request)
4748
{
4849
int rc;
4950

@@ -59,6 +60,6 @@ int MPI_Psend_init(const void* buf, int partitions, MPI_Count count, MPI_Datatyp
5960
OMPI_ERRHANDLER_CHECK(rc, MPI_COMM_WORLD, rc, FUNC_NAME);
6061
}
6162

62-
rc = mca_part.part_psend_init(buf, partitions, count, datatype, dest, tag, comm, request);
63+
rc = mca_part.part_psend_init(buf, partitions, count, datatype, dest, tag, comm, info, request);
6364
OMPI_ERRHANDLER_RETURN(rc, MPI_COMM_WORLD, rc, FUNC_NAME);
6465
}

ompi/mpi/fortran/mpif-h/precv_init_f.c

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
* Copyright (c) 2015 Research Organization for Information Science
1414
* and Technology (RIST). All rights reserved.
1515
* Copyright (c) 2020 Sandia National Laboratories. All rights reserved.
16+
* Copyright (c) 2021 Bull S.A.S. All rights reserved.
1617
* $COPYRIGHT$
1718
*
1819
* Additional copyrights may follow
@@ -40,8 +41,8 @@ OMPI_GENERATE_F77_BINDINGS (PMPI_PRECV_INIT,
4041
pmpi_precv_init_,
4142
pmpi_precv_init__,
4243
pompi_precv_init_f,
43-
(char *buf, MPI_Fint *partitions, MPI_Fint *count, MPI_Fint *datatype, MPI_Fint *dest, MPI_Fint *tag, MPI_Fint *comm, MPI_Fint *request, MPI_Fint *ierr),
44-
(buf, partitions, count, datatype, dest, tag, comm, request, ierr) )
44+
(char *buf, MPI_Fint *partitions, MPI_Fint *count, MPI_Fint *datatype, MPI_Fint *dest, MPI_Fint *tag, MPI_Fint *comm, MPI_Fint *info, MPI_Fint *request, MPI_Fint *ierr),
45+
(buf, partitions, count, datatype, dest, tag, comm, info, request, ierr) )
4546
#endif
4647
#endif
4748

@@ -60,29 +61,31 @@ OMPI_GENERATE_F77_BINDINGS (MPI_PRECV_INIT,
6061
mpi_precv_init_,
6162
mpi_precv_init__,
6263
ompi_precv_init_f,
63-
(char *buf, MPI_Fint *partitions, MPI_Fint *count, MPI_Fint *datatype, MPI_Fint *dest, MPI_Fint *tag, MPI_Fint *comm, MPI_Fint *request, MPI_Fint *ierr),
64-
(buf, partitions, count, datatype, dest, tag, comm, request, ierr) )
64+
(char *buf, MPI_Fint *partitions, MPI_Fint *count, MPI_Fint *datatype, MPI_Fint *dest, MPI_Fint *tag, MPI_Fint *comm, MPI_Fint *info, MPI_Fint *request, MPI_Fint *ierr),
65+
(buf, partitions, count, datatype, dest, tag, comm, info, request, ierr) )
6566
#else
6667
#define ompi_precv_init_f pompi_precv_init_f
6768
#endif
6869
#endif
6970

7071

71-
void ompi_precv_init_f(char *buf, MPI_Fint *partitions, MPI_Fint *count, MPI_Fint *datatype, MPI_Fint *dest, MPI_Fint *tag, MPI_Fint *comm, MPI_Fint *request, MPI_Fint *ierr)
72+
void ompi_precv_init_f(char *buf, MPI_Fint *partitions, MPI_Fint *count, MPI_Fint *datatype, MPI_Fint *dest, MPI_Fint *tag, MPI_Fint *comm, MPI_Fint *info, MPI_Fint *request, MPI_Fint *ierr)
7273
{
7374
int c_ierr;
75+
MPI_Info c_info;
7476
MPI_Datatype c_type = PMPI_Type_f2c(*datatype);
7577
MPI_Request c_req;
7678
MPI_Comm c_comm;
7779

80+
c_info = PMPI_Info_f2c(*info);
7881
c_comm = PMPI_Comm_f2c (*comm);
7982

8083
c_ierr = PMPI_Precv_init(OMPI_F2C_BOTTOM(buf),
8184
OMPI_FINT_2_INT(*partitions),
8285
OMPI_FINT_2_INT(*count),
8386
c_type, OMPI_FINT_2_INT(*dest),
8487
OMPI_FINT_2_INT(*tag),
85-
c_comm, &c_req);
88+
c_comm, c_info, &c_req);
8689
if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr);
8790

8891
if (MPI_SUCCESS == c_ierr) {

ompi/mpi/fortran/mpif-h/prototypes_mpi.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
* reserved.
1717
* Copyright (c) 2016-2020 Research Organization for Information Science
1818
* and Technology (RIST). All rights reserved.
19+
* Copyright (c) 2021 Bull S.A.S. All rights reserved.
1920
* $COPYRIGHT$
2021
*
2122
* Additional copyrights may follow
@@ -344,8 +345,8 @@ PN2(void, MPI_Pcontrol, mpi_pcontrol, MPI_PCONTROL, (MPI_Fint *level));
344345
PN2(void, MPI_Pready, mpi_pready, MPI_PREADY, (MPI_Fint *partition, MPI_Fint *request, MPI_Fint *ierr));
345346
PN2(void, MPI_Pready_list, mpi_pready_list, MPI_PREADY_LIST, (MPI_Fint *length, MPI_Fint *partition, MPI_Fint *request, MPI_Fint *ierr));
346347
PN2(void, MPI_Pready_range, mpi_pready_range, MPI_PREADY_RANGE, (MPI_Fint *partition_low, MPI_Fint *partition_high, MPI_Fint *request, MPI_Fint *ierr));
347-
PN2(void, MPI_Precv_init, mpi_precv_init, MPI_PRECV_INIT, (char *buf, MPI_Fint *partitions, MPI_Fint *count, MPI_Fint *datatype, MPI_Fint *src, MPI_Fint *tag, MPI_Fint *comm, MPI_Fint *request, MPI_Fint *ierr));
348-
PN2(void, MPI_Psend_init, mpi_psend_init, MPI_PSEND_INIT, (char *buf, MPI_Fint *partitions, MPI_Fint *count, MPI_Fint *datatype, MPI_Fint *dest, MPI_Fint *tag, MPI_Fint *comm, MPI_Fint *request, MPI_Fint *ierr));
348+
PN2(void, MPI_Precv_init, mpi_precv_init, MPI_PRECV_INIT, (char *buf, MPI_Fint *partitions, MPI_Fint *count, MPI_Fint *datatype, MPI_Fint *src, MPI_Fint *tag, MPI_Fint *comm, MPI_Fint *info, MPI_Fint *request, MPI_Fint *ierr));
349+
PN2(void, MPI_Psend_init, mpi_psend_init, MPI_PSEND_INIT, (char *buf, MPI_Fint *partitions, MPI_Fint *count, MPI_Fint *datatype, MPI_Fint *dest, MPI_Fint *tag, MPI_Fint *comm, MPI_Fint *info, MPI_Fint *request, MPI_Fint *ierr));
349350
PN2(void, MPI_Probe, mpi_probe, MPI_PROBE, (MPI_Fint *source, MPI_Fint *tag, MPI_Fint *comm, MPI_Fint *status, MPI_Fint *ierr));
350351
PN2(void, MPI_Publish_name, mpi_publish_name, MPI_PUBLISH_NAME, (char *service_name, MPI_Fint *info, char *port_name, MPI_Fint *ierr, int service_name_len, int port_name_len));
351352
PN2(void, MPI_Put, mpi_put, MPI_PUT, (char *origin_addr, MPI_Fint *origin_count, MPI_Fint *origin_datatype, MPI_Fint *target_rank, MPI_Aint *target_disp, MPI_Fint *target_count, MPI_Fint *target_datatype, MPI_Fint *win, MPI_Fint *ierr));

ompi/mpi/fortran/mpif-h/psend_init_f.c

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
* Copyright (c) 2015 Research Organization for Information Science
1414
* and Technology (RIST). All rights reserved.
1515
* Copyright (c) 2020 Sandia National Laboratories. All rights reserved.
16+
* Copyright (c) 2021 Bull S.A.S. All rights reserved.
1617
* $COPYRIGHT$
1718
*
1819
* Additional copyrights may follow
@@ -40,8 +41,8 @@ OMPI_GENERATE_F77_BINDINGS (PMPI_PSEND_INIT,
4041
pmpi_psend_init_,
4142
pmpi_psend_init__,
4243
pompi_psend_init_f,
43-
(char *buf, MPI_Fint *partitions, MPI_Fint *count, MPI_Fint *datatype, MPI_Fint *dest, MPI_Fint *tag, MPI_Fint *comm, MPI_Fint *request, MPI_Fint *ierr),
44-
(buf, partitions, count, datatype, dest, tag, comm, request, ierr) )
44+
(char *buf, MPI_Fint *partitions, MPI_Fint *count, MPI_Fint *datatype, MPI_Fint *dest, MPI_Fint *tag, MPI_Fint *comm, MPI_Fint *info, MPI_Fint *request, MPI_Fint *ierr),
45+
(buf, partitions, count, datatype, dest, tag, comm, info, request, ierr) )
4546
#endif
4647
#endif
4748

@@ -60,29 +61,31 @@ OMPI_GENERATE_F77_BINDINGS (MPI_PSEND_INIT,
6061
mpi_psend_init_,
6162
mpi_psend_init__,
6263
ompi_psend_init_f,
63-
(char *buf, MPI_Fint *partitions, MPI_Fint *count, MPI_Fint *datatype, MPI_Fint *dest, MPI_Fint *tag, MPI_Fint *comm, MPI_Fint *request, MPI_Fint *ierr),
64-
(buf, partitions, count, datatype, dest, tag, comm, request, ierr) )
64+
(char *buf, MPI_Fint *partitions, MPI_Fint *count, MPI_Fint *datatype, MPI_Fint *dest, MPI_Fint *tag, MPI_Fint *comm, MPI_Fint *info, MPI_Fint *request, MPI_Fint *ierr),
65+
(buf, partitions, count, datatype, dest, tag, comm, info, request, ierr) )
6566
#else
6667
#define ompi_psend_init_f pompi_psend_init_f
6768
#endif
6869
#endif
6970

7071

71-
void ompi_psend_init_f(char *buf, MPI_Fint *partitions, MPI_Fint *count, MPI_Fint *datatype, MPI_Fint *dest, MPI_Fint *tag, MPI_Fint *comm, MPI_Fint *request, MPI_Fint *ierr)
72+
void ompi_psend_init_f(char *buf, MPI_Fint *partitions, MPI_Fint *count, MPI_Fint *datatype, MPI_Fint *dest, MPI_Fint *tag, MPI_Fint *comm, MPI_Fint *info, MPI_Fint *request, MPI_Fint *ierr)
7273
{
7374
int c_ierr;
75+
MPI_Info c_info;
7476
MPI_Datatype c_type = PMPI_Type_f2c(*datatype);
7577
MPI_Request c_req;
7678
MPI_Comm c_comm;
7779

80+
c_info = PMPI_Info_f2c(*info);
7881
c_comm = PMPI_Comm_f2c (*comm);
7982

8083
c_ierr = PMPI_Psend_init(OMPI_F2C_BOTTOM(buf),
8184
OMPI_FINT_2_INT(*partitions),
8285
OMPI_FINT_2_INT(*count),
8386
c_type, OMPI_FINT_2_INT(*dest),
8487
OMPI_FINT_2_INT(*tag),
85-
c_comm, &c_req);
88+
c_comm, c_info, &c_req);
8689
if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr);
8790

8891
if (MPI_SUCCESS == c_ierr) {

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
! Copyright (c) 2012 Inria. All rights reserved.
1010
! Copyright (c) 2015-2020 Research Organization for Information Science
1111
! and Technology (RIST). All rights reserved.
12+
! Copyright (c) 2021 Bull S.A.S. All rights reserved.
1213
! $COPYRIGHT$
1314
!
1415
! This file provides the interface specifications for the MPI Fortran
@@ -145,6 +146,7 @@
145146
! MPI_Is_thread_main
146147
! MPI_Op_commutative
147148
! MPI_Op_create
149+
! MPI_Parrived
148150
! MPI_Type_get_attr
149151
! MPI_Win_get_attr
150152
! MPI_Win_test
@@ -276,24 +278,26 @@ subroutine ompi_issend_f(buf,count,datatype,dest,tag,comm,request,ierror) &
276278
INTEGER, INTENT(OUT) :: ierror
277279
end subroutine ompi_issend_f
278280

279-
subroutine ompi_psend_init_f(buf,partitions,count,datatype,dest,tag,comm,request,ierror) &
281+
subroutine ompi_psend_init_f(buf,partitions,count,datatype,dest,tag,comm,info,request,ierror) &
280282
BIND(C, name="ompi_psend_init_f")
281283
implicit none
282284
OMPI_FORTRAN_IGNORE_TKR_TYPE, INTENT(IN) :: buf
283285
INTEGER, INTENT(IN) :: partitions, count, dest, tag
284286
INTEGER, INTENT(IN) :: datatype
285287
INTEGER, INTENT(IN) :: comm
288+
INTEGER, INTENT(IN) :: info
286289
INTEGER, INTENT(OUT) :: request
287290
INTEGER, INTENT(OUT) :: ierror
288291
end subroutine ompi_psend_init_f
289292

290-
subroutine ompi_precv_init_f(buf,partitions,count,datatype,dest,tag,comm,request,ierror) &
293+
subroutine ompi_precv_init_f(buf,partitions,count,datatype,dest,tag,comm,info,request,ierror) &
291294
BIND(C, name="ompi_precv_init_f")
292295
implicit none
293296
OMPI_FORTRAN_IGNORE_TKR_TYPE, INTENT(IN) :: buf
294297
INTEGER, INTENT(IN) :: partitions, count, dest, tag
295298
INTEGER, INTENT(IN) :: datatype
296299
INTEGER, INTENT(IN) :: comm
300+
INTEGER, INTENT(IN) :: info
297301
INTEGER, INTENT(OUT) :: request
298302
INTEGER, INTENT(OUT) :: ierror
299303
end subroutine ompi_precv_init_f

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
#include "ompi/mpi/fortran/configure-fortran-output.h"
1212

1313
subroutine MPI_Parrived_f08(request,partition,flag,ierror)
14+
! See note in mpi-f-interfaces-bind.h for why we "use mpi" here and
15+
! call a PMPI_* subroutine below.
1416
use :: mpi_f08_types, only : MPI_Datatype, MPI_Comm, MPI_Request
1517
use :: mpi, only : PMPI_Parrived
1618
implicit none

0 commit comments

Comments
 (0)