1 /*
   2  * Copyright (c) 2004-2009 The Trustees of Indiana University and Indiana
   3  *                         University Research and Technology
   4  *                         Corporation.  All rights reserved.
   5  * Copyright (c) 2011      Oak Ridge National Labs.  All rights reserved.
   6  * Copyright (c) 2012 Cisco Systems, Inc.  All rights reserved.
   7  * $COPYRIGHT$
   8  *
   9  * Additional copyrights may follow
  10  *
  11  * $HEADER$
  12  */
  13 
  14 /*
  15  * This file contains the implementation of the OMPI_Progress
  16  * initialize / finalize hooks.  It has no file naming convention, and
  17  * generally contains whatever the extension needs it to.
  18  */
  19 
  20 #include "ompi_config.h"
  21 
  22 #include <stdio.h>
  23 
  24 #include "ompi/mpi/c/bindings.h"
  25 #include "ompi/mpiext/mpiext.h"
  26 #include "ompi/mpiext/example/c/mpiext_example_c.h"
  27 
  28 /*
  29  * The init/fini functions and the component struct are not required,
  30  * but optional.  If an extension would like to have init/fini, in
  31  * addition to providing the hooks below, adding the line in
  32  * configure.m4 (documented in example's configure.m4) is also
  33  * required.
  34  */
  35 static int example_init(void)
  36 {
  37     printf("example mpiext init\n");
  38     return OMPI_SUCCESS;
  39 }
  40 
  41 static int example_fini(void)
  42 {
  43     printf("example mpiext fini\n");
  44     return OMPI_SUCCESS;
  45 }
  46 
  47 /*
  48  * Similar to Open MPI components, a well-known struct provides
  49  * function pointers to the extension's init/fini hooks.  The struct
  50  * must be a global symbol of the form ompi_mpiext_<ext_name> and be
  51  * of type ompi_mpiext_component_t.
  52  */
  53 ompi_mpiext_component_t ompi_mpiext_example = {
  54     example_init,
  55     example_fini
  56 };