|
| 1 | +/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ |
| 2 | +/* |
| 3 | + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana |
| 4 | + * University Research and Technology |
| 5 | + * Corporation. All rights reserved. |
| 6 | + * Copyright (c) 2004-2005 The University of Tennessee and The University |
| 7 | + * of Tennessee Research Foundation. All rights |
| 8 | + * reserved. |
| 9 | + * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, |
| 10 | + * University of Stuttgart. All rights reserved. |
| 11 | + * Copyright (c) 2004-2005 The Regents of the University of California. |
| 12 | + * All rights reserved. |
| 13 | + * Copyright (c) 2011-2013 Cisco Systems, Inc. All rights reserved. |
| 14 | + * Copyright (c) 2013 Los Alamos National Security, LLC. All rights |
| 15 | + * reserved. |
| 16 | + * Copyright (c) 2015 Research Organization for Information Science |
| 17 | + * and Technology (RIST). All rights reserved. |
| 18 | + * Copyright (c) 2021 Triad National Security, LLC. All rights |
| 19 | + * reserved. |
| 20 | + * |
| 21 | + * $COPYRIGHT$ |
| 22 | + * |
| 23 | + * Additional copyrights may follow |
| 24 | + * |
| 25 | + * $HEADER$ |
| 26 | + */ |
| 27 | + |
| 28 | +#include "ompi_config.h" |
| 29 | + |
| 30 | +#include "ompi/mpi/fortran/mpif-h/bindings.h" |
| 31 | + |
| 32 | +#if OMPI_BUILD_MPI_PROFILING |
| 33 | +#if OPAL_HAVE_WEAK_SYMBOLS |
| 34 | +#pragma weak PMPI_COMM_IDUP_WITH_INFO = ompi_comm_idup_with_info_f |
| 35 | +#pragma weak pmpi_comm_idup_with_info = ompi_comm_idup_with_info_f |
| 36 | +#pragma weak pmpi_comm_idup_with_info_ = ompi_comm_idup_with_info_f |
| 37 | +#pragma weak pmpi_comm_idup_with_info__ = ompi_comm_idup_with_info_f |
| 38 | + |
| 39 | +#pragma weak PMPI_Comm_idup_with_info_f = ompi_comm_idup_with_info_f |
| 40 | +#pragma weak PMPI_Comm_idup_with_info_f08 = ompi_comm_idup_with_info_f |
| 41 | +#else |
| 42 | +OMPI_GENERATE_F77_BINDINGS (PMPI_COMM_IDUP_WITH_INFO, |
| 43 | + pmpi_comm_idup_with_info, |
| 44 | + pmpi_comm_idup_with_info_, |
| 45 | + pmpi_comm_idup_with_info__, |
| 46 | + pompi_comm_idup_with_info_f, |
| 47 | + (MPI_Fint *comm, MPI_Fint *info, MPI_Fint *newcomm, MPI_Fint *request, MPI_Fint *ierr), |
| 48 | + (comm, info, newcomm, request, ierr) ) |
| 49 | +#endif |
| 50 | +#endif |
| 51 | + |
| 52 | +#if OPAL_HAVE_WEAK_SYMBOLS |
| 53 | +#pragma weak MPI_COMM_IDUP_WITH_INFO = ompi_comm_idup_with_info_f |
| 54 | +#pragma weak mpi_comm_idup_with_info = ompi_comm_idup_with_info_f |
| 55 | +#pragma weak mpi_comm_idup_with_info_ = ompi_comm_idup_with_info_f |
| 56 | +#pragma weak mpi_comm_idup_with_info__ = ompi_comm_idup_with_info_f |
| 57 | + |
| 58 | +#pragma weak MPI_Comm_idup_with_info_f = ompi_comm_idup_with_info_f |
| 59 | +#pragma weak MPI_Comm_idup_with_info_f08 = ompi_comm_idup_with_info_f |
| 60 | +#else |
| 61 | +#if ! OMPI_BUILD_MPI_PROFILING |
| 62 | +OMPI_GENERATE_F77_BINDINGS (MPI_COMM_IDUP_WITH_INFO, |
| 63 | + mpi_comm_idup_with_info, |
| 64 | + mpi_comm_idup_with_info_, |
| 65 | + mpi_comm_idup_with_info__, |
| 66 | + ompi_comm_idup_with_info_f, |
| 67 | + (MPI_Fint *comm, MPI_Fint *info, MPI_Fint *newcomm, MPI_Fint *request, MPI_Fint *ierr), |
| 68 | + (comm, info, newcomm, request, ierr) ) |
| 69 | +#else |
| 70 | +#define ompi_comm_idup_with_info_f pompi_comm_idup_with_info_f |
| 71 | +#endif |
| 72 | +#endif |
| 73 | + |
| 74 | + |
| 75 | +void ompi_comm_idup_with_info_f(MPI_Fint *comm, MPI_Fint *info, MPI_Fint *newcomm, MPI_Fint *request, MPI_Fint *ierr) |
| 76 | +{ |
| 77 | + int c_ierr; |
| 78 | + MPI_Comm c_newcomm; |
| 79 | + MPI_Comm c_comm = PMPI_Comm_f2c(*comm); |
| 80 | + MPI_Info c_info; |
| 81 | + MPI_Request c_req; |
| 82 | + |
| 83 | + c_info = PMPI_Info_f2c(*info); |
| 84 | + |
| 85 | + c_ierr = PMPI_Comm_idup_with_info(c_comm, c_info, &c_newcomm, &c_req); |
| 86 | + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); |
| 87 | + |
| 88 | + if (MPI_SUCCESS == c_ierr) { |
| 89 | + *newcomm = PMPI_Comm_c2f(c_newcomm); |
| 90 | + *request = PMPI_Request_c2f(c_req); |
| 91 | + } |
| 92 | +} |
0 commit comments