root/ompi/mpi/fortran/mpif-h/comm_idup_f.c

/* [<][>][^][v][top][bottom][index][help] */

DEFINITIONS

This source file includes following definitions.
  1. ompi_comm_idup_f

   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$
  19  *
  20  * Additional copyrights may follow
  21  *
  22  * $HEADER$
  23  */
  24 
  25 #include "ompi_config.h"
  26 
  27 #include "ompi/mpi/fortran/mpif-h/bindings.h"
  28 
  29 #if OMPI_BUILD_MPI_PROFILING
  30 #if OPAL_HAVE_WEAK_SYMBOLS
  31 #pragma weak PMPI_COMM_IDUP = ompi_comm_idup_f
  32 #pragma weak pmpi_comm_idup = ompi_comm_idup_f
  33 #pragma weak pmpi_comm_idup_ = ompi_comm_idup_f
  34 #pragma weak pmpi_comm_idup__ = ompi_comm_idup_f
  35 
  36 #pragma weak PMPI_Comm_idup_f = ompi_comm_idup_f
  37 #pragma weak PMPI_Comm_idup_f08 = ompi_comm_idup_f
  38 #else
  39 OMPI_GENERATE_F77_BINDINGS (PMPI_COMM_IDUP,
  40                            pmpi_comm_idup,
  41                            pmpi_comm_idup_,
  42                            pmpi_comm_idup__,
  43                            pompi_comm_idup_f,
  44                             (MPI_Fint *comm, MPI_Fint *newcomm, MPI_Fint *request, MPI_Fint *ierr),
  45                             (comm, newcomm, request, ierr) )
  46 #endif
  47 #endif
  48 
  49 #if OPAL_HAVE_WEAK_SYMBOLS
  50 #pragma weak MPI_COMM_IDUP = ompi_comm_idup_f
  51 #pragma weak mpi_comm_idup = ompi_comm_idup_f
  52 #pragma weak mpi_comm_idup_ = ompi_comm_idup_f
  53 #pragma weak mpi_comm_idup__ = ompi_comm_idup_f
  54 
  55 #pragma weak MPI_Comm_idup_f = ompi_comm_idup_f
  56 #pragma weak MPI_Comm_idup_f08 = ompi_comm_idup_f
  57 #else
  58 #if ! OMPI_BUILD_MPI_PROFILING
  59 OMPI_GENERATE_F77_BINDINGS (MPI_COMM_IDUP,
  60                             mpi_comm_idup,
  61                             mpi_comm_idup_,
  62                             mpi_comm_idup__,
  63                             ompi_comm_idup_f,
  64                             (MPI_Fint *comm, MPI_Fint *newcomm, MPI_Fint *request, MPI_Fint *ierr),
  65                             (comm, newcomm, request, ierr) )
  66 #else
  67 #define ompi_comm_idup_f pompi_comm_idup_f
  68 #endif
  69 #endif
  70 
  71 
  72 void ompi_comm_idup_f(MPI_Fint *comm, MPI_Fint *newcomm, MPI_Fint *request, MPI_Fint *ierr)
  73 {
  74     int c_ierr;
  75     MPI_Comm c_newcomm;
  76     MPI_Comm c_comm = PMPI_Comm_f2c(*comm);
  77     MPI_Request c_req;
  78 
  79     c_ierr = PMPI_Comm_idup(c_comm, &c_newcomm, &c_req);
  80     if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr);
  81 
  82     if (MPI_SUCCESS == c_ierr) {
  83         *newcomm = PMPI_Comm_c2f(c_newcomm);
  84         *request = PMPI_Request_c2f(c_req);
  85     }
  86 }

/* [<][>][^][v][top][bottom][index][help] */