Ejemplo n.º 1
0
/**
 * Measurement wrapper for MPI_Dist_graph_neighbors
 * @note Auto-generated by wrapgen from template: std.w
 * @note C interface
 * @note Introduced with MPI 2.2
 * @ingroup topo
 */
int MPI_Dist_graph_neighbors(MPI_Comm comm,
                             int      maxindegree,
                             int      sources[],
                             int      sourceweights[],
                             int      maxoutdegree,
                             int      destinations[],
                             int      destweights[])
{
  int return_val;

  if (IS_EVENT_GEN_ON_FOR(TOPO))
  {
    EVENT_GEN_OFF();
    esd_enter(epk_mpi_regid[EPK__MPI_DIST_GRAPH_NEIGHBORS]);

    return_val = PMPI_Dist_graph_neighbors(comm,
                                           maxindegree,
                                           sources,
                                           sourceweights,
                                           maxoutdegree,
                                           destinations,
                                           destweights);

    esd_exit(epk_mpi_regid[EPK__MPI_DIST_GRAPH_NEIGHBORS]);
    EVENT_GEN_ON();
  }
  else
  {
    return_val = PMPI_Dist_graph_neighbors(comm,
                                           maxindegree,
                                           sources,
                                           sourceweights,
                                           maxoutdegree,
                                           destinations,
                                           destweights);
  }

  return return_val;
}
Ejemplo n.º 2
0
void ompi_dist_graph_neighbors_f(MPI_Fint* comm, MPI_Fint* maxindegree,
                                 MPI_Fint* sources, MPI_Fint* sourceweights,
                                 MPI_Fint* maxoutdegree, MPI_Fint* destinations,
                                 MPI_Fint* destweights,
                                 MPI_Fint *ierr)
{
    MPI_Comm c_comm;
    OMPI_ARRAY_NAME_DECL(sources);
    OMPI_ARRAY_NAME_DECL(sourceweights);
    OMPI_ARRAY_NAME_DECL(destinations);
    OMPI_ARRAY_NAME_DECL(destweights);

    c_comm = PMPI_Comm_f2c(*comm);

    OMPI_ARRAY_FINT_2_INT_ALLOC(sources, *maxindegree);
    if( !OMPI_IS_FORTRAN_UNWEIGHTED(sourceweights) ) {
        OMPI_ARRAY_FINT_2_INT_ALLOC(sourceweights, *maxindegree);
    }
    OMPI_ARRAY_FINT_2_INT_ALLOC(destinations, *maxoutdegree);
    if( !OMPI_IS_FORTRAN_UNWEIGHTED(destweights) ) {
        OMPI_ARRAY_FINT_2_INT_ALLOC(destweights, *maxoutdegree);
    }

    *ierr = OMPI_INT_2_FINT(PMPI_Dist_graph_neighbors(c_comm, OMPI_FINT_2_INT(*maxindegree),
                                                      OMPI_ARRAY_NAME_CONVERT(sources),
                                                      OMPI_IS_FORTRAN_UNWEIGHTED(sourceweights) ? MPI_UNWEIGHTED : OMPI_ARRAY_NAME_CONVERT(sourceweights),
                                                      OMPI_FINT_2_INT(*maxoutdegree), OMPI_ARRAY_NAME_CONVERT(destinations),
                                                      OMPI_IS_FORTRAN_UNWEIGHTED(destweights) ? MPI_UNWEIGHTED : OMPI_ARRAY_NAME_CONVERT(destweights)));
    if (OMPI_SUCCESS == OMPI_FINT_2_INT(*ierr)) {
        OMPI_ARRAY_INT_2_FINT(sources, *maxindegree);
        if( !OMPI_IS_FORTRAN_UNWEIGHTED(sourceweights) ) {
            OMPI_ARRAY_INT_2_FINT(sourceweights, *maxindegree);
        }
        OMPI_ARRAY_INT_2_FINT(destinations, *maxoutdegree);
        if( !OMPI_IS_FORTRAN_UNWEIGHTED(destweights) ) {
            OMPI_ARRAY_INT_2_FINT(destweights, *maxoutdegree);
        }
    } else {
        OMPI_ARRAY_FINT_2_INT_CLEANUP(sources);
        if( !OMPI_IS_FORTRAN_UNWEIGHTED(sourceweights) ) {
            OMPI_ARRAY_FINT_2_INT_CLEANUP(sourceweights);
        }
        OMPI_ARRAY_FINT_2_INT_CLEANUP(destinations);
        if( !OMPI_IS_FORTRAN_UNWEIGHTED(destweights) ) {
            OMPI_ARRAY_FINT_2_INT_CLEANUP(destweights);
        }
    }
}