root/ompi/mpiext/example/mpif-h/mpiext_example_progress_f.c

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

DEFINITIONS

This source file includes following definitions.
  1. OMPI_Progress_f
  2. OMPI_PROGRESS
  3. ompi_progress
  4. ompi_progress_
  5. ompi_progress__

   1 /*
   2  * Copyright (c) 2011      Oak Ridge National Labs.  All rights reserved.
   3  * Copyright (c) 2012 Cisco Systems, Inc.  All rights reserved.
   4  * $COPYRIGHT$
   5  *
   6  * Additional copyrights may follow
   7  *
   8  * $HEADER$
   9  */
  10 
  11 /*
  12  * This file contains the mpif.h implementation of the OMPI_Progress
  13  * function.  It has no file naming convention, and generally contains
  14  * whatever the extension needs it to.
  15  */
  16 
  17 #include "ompi_config.h"
  18 
  19 #include <stdio.h>
  20 
  21 #include "ompi/mpi/fortran/mpif-h/bindings.h"
  22 #include "ompi/mpi/fortran/base/constants.h"
  23 
  24 #include "ompi/mpiext/example/c/mpiext_example_c.h"
  25 
  26 /* Rather than doing a whole pile of messy things with weak symbols,
  27    just define one back-end function (the _f version), and then four
  28    short functions for the four popular Fortran symbol-mangling
  29    schemes that call the back-end function.  Make sure that the the
  30    back-end function is public so that it can be callable from the
  31    mpi_f08_ext library. */
  32 
  33 /* Prototype everything so that the compiler doesn't complain */
  34 OMPI_DECLSPEC void OMPI_Progress_f(MPI_Fint *count, MPI_Fint *comm, MPI_Fint *ierr);
  35 OMPI_DECLSPEC void OMPI_PROGRESS(MPI_Fint *count, MPI_Fint *comm, MPI_Fint *ierr);
  36 OMPI_DECLSPEC void ompi_progress(MPI_Fint *count, MPI_Fint *comm, MPI_Fint *ierr);
  37 OMPI_DECLSPEC void ompi_progress_(MPI_Fint *count, MPI_Fint *comm, MPI_Fint *ierr);
  38 OMPI_DECLSPEC void ompi_progress__(MPI_Fint *count, MPI_Fint *comm, MPI_Fint *ierr);
  39 
  40 /* Back-end function */
  41 void OMPI_Progress_f(MPI_Fint *count, MPI_Fint *comm, MPI_Fint *ierr)
  42 {
  43     int c_err;
  44     MPI_Comm c_comm = MPI_Comm_f2c(*comm);
  45 
  46     c_err = OMPI_Progress(OMPI_FINT_2_INT(*count), c_comm);
  47 
  48     if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_err);
  49 }
  50 
  51 /* Front-end functions */
  52 void OMPI_PROGRESS(MPI_Fint *count, MPI_Fint *comm, MPI_Fint *ierr) {
  53     OMPI_Progress_f(count, comm, ierr);
  54 }
  55 
  56 void ompi_progress(MPI_Fint *count, MPI_Fint *comm, MPI_Fint *ierr) {
  57     OMPI_Progress_f(count, comm, ierr);
  58 }
  59 
  60 void ompi_progress_(MPI_Fint *count, MPI_Fint *comm, MPI_Fint *ierr) {
  61     OMPI_Progress_f(count, comm, ierr);
  62 }
  63 
  64 void ompi_progress__(MPI_Fint *count, MPI_Fint *comm, MPI_Fint *ierr) {
  65     OMPI_Progress_f(count, comm, ierr);
  66 }
  67 

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