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

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

DEFINITIONS

This source file includes following definitions.
  1. ompi_graph_neighbors_f

   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-2013 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) 2011-2013 Inria.  All rights reserved.
  14  * Copyright (c) 2011-2013 Universite Bordeaux 1
  15  * Copyright (c) 2015      Research Organization for Information Science
  16  *                         and Technology (RIST). All rights reserved.
  17  * $COPYRIGHT$
  18  *
  19  * Additional copyrights may follow
  20  *
  21  * $HEADER$
  22  */
  23 
  24 #include "ompi_config.h"
  25 
  26 #include "ompi/mpi/fortran/mpif-h/bindings.h"
  27 
  28 #if OMPI_BUILD_MPI_PROFILING
  29 #if OPAL_HAVE_WEAK_SYMBOLS
  30 #pragma weak PMPI_GRAPH_NEIGHBORS = ompi_graph_neighbors_f
  31 #pragma weak pmpi_graph_neighbors = ompi_graph_neighbors_f
  32 #pragma weak pmpi_graph_neighbors_ = ompi_graph_neighbors_f
  33 #pragma weak pmpi_graph_neighbors__ = ompi_graph_neighbors_f
  34 
  35 #pragma weak PMPI_Graph_neighbors_f = ompi_graph_neighbors_f
  36 #pragma weak PMPI_Graph_neighbors_f08 = ompi_graph_neighbors_f
  37 #else
  38 OMPI_GENERATE_F77_BINDINGS (PMPI_GRAPH_NEIGHBORS,
  39                            pmpi_graph_neighbors,
  40                            pmpi_graph_neighbors_,
  41                            pmpi_graph_neighbors__,
  42                            pompi_graph_neighbors_f,
  43                            (MPI_Fint *comm, MPI_Fint *rank, MPI_Fint *maxneighbors, MPI_Fint *neighbors, MPI_Fint *ierr),
  44                            (comm, rank, maxneighbors, neighbors, ierr) )
  45 #endif
  46 #endif
  47 
  48 #if OPAL_HAVE_WEAK_SYMBOLS
  49 #pragma weak MPI_GRAPH_NEIGHBORS = ompi_graph_neighbors_f
  50 #pragma weak mpi_graph_neighbors = ompi_graph_neighbors_f
  51 #pragma weak mpi_graph_neighbors_ = ompi_graph_neighbors_f
  52 #pragma weak mpi_graph_neighbors__ = ompi_graph_neighbors_f
  53 
  54 #pragma weak MPI_Graph_neighbors_f = ompi_graph_neighbors_f
  55 #pragma weak MPI_Graph_neighbors_f08 = ompi_graph_neighbors_f
  56 #else
  57 #if ! OMPI_BUILD_MPI_PROFILING
  58 OMPI_GENERATE_F77_BINDINGS (MPI_GRAPH_NEIGHBORS,
  59                            mpi_graph_neighbors,
  60                            mpi_graph_neighbors_,
  61                            mpi_graph_neighbors__,
  62                            ompi_graph_neighbors_f,
  63                            (MPI_Fint *comm, MPI_Fint *rank, MPI_Fint *maxneighbors, MPI_Fint *neighbors, MPI_Fint *ierr),
  64                            (comm, rank, maxneighbors, neighbors, ierr) )
  65 #else
  66 #define ompi_graph_neighbors_f pompi_graph_neighbors_f
  67 #endif
  68 #endif
  69 
  70 
  71 void ompi_graph_neighbors_f(MPI_Fint *comm, MPI_Fint *rank,
  72                            MPI_Fint *maxneighbors, MPI_Fint *neighbors,
  73                            MPI_Fint *ierr)
  74 {
  75     int c_ierr;
  76     MPI_Comm c_comm;
  77     OMPI_ARRAY_NAME_DECL(neighbors);
  78 
  79     c_comm = PMPI_Comm_f2c(*comm);
  80 
  81     OMPI_ARRAY_FINT_2_INT_ALLOC(neighbors, *maxneighbors);
  82 
  83     c_ierr = PMPI_Graph_neighbors(c_comm,
  84                                  OMPI_FINT_2_INT(*rank),
  85                                  OMPI_FINT_2_INT(*maxneighbors),
  86                                  OMPI_ARRAY_NAME_CONVERT(neighbors)
  87                                  );
  88     if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr);
  89 
  90     if (MPI_SUCCESS == c_ierr) {
  91         OMPI_ARRAY_INT_2_FINT(neighbors, *maxneighbors);
  92     } else {
  93         OMPI_ARRAY_FINT_2_INT_CLEANUP(neighbors);
  94     }
  95 }

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