root/ompi/mpiext/cr/c/restart.c

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

DEFINITIONS

This source file includes following definitions.
  1. OMPI_CR_Restart

   1 /*
   2  * Copyright (c) 2004-2010 The Trustees of Indiana University and Indiana
   3  *                         University Research and Technology
   4  *                         Corporation.  All rights reserved.
   5  * Copyright (c) 2012 Cisco Systems, Inc.  All rights reserved.
   6  * $COPYRIGHT$
   7  *
   8  * Additional copyrights may follow
   9  *
  10  * $HEADER$
  11  */
  12 #include "ompi_config.h"
  13 #include <stdio.h>
  14 
  15 #include "ompi/mpi/c/bindings.h"
  16 #include "ompi/info/info.h"
  17 #include "ompi/runtime/params.h"
  18 #include "ompi/communicator/communicator.h"
  19 #include "orte/mca/snapc/snapc.h"
  20 
  21 #include "ompi/mpiext/cr/c/mpiext_cr_c.h"
  22 
  23 static const char FUNC_NAME[] = "OMPI_CR_Restart";
  24 
  25 int OMPI_CR_Restart(char *handle, int seq, MPI_Info *info)
  26 {
  27     int ret = MPI_SUCCESS;
  28     MPI_Comm comm = MPI_COMM_WORLD;
  29     orte_snapc_base_request_op_t *datum = NULL;
  30 
  31     /* argument checking */
  32     if (MPI_PARAM_CHECK) {
  33         OMPI_ERR_INIT_FINALIZE(FUNC_NAME);
  34     }
  35 
  36     /*
  37      * Setup the data structure for the operation
  38      */
  39     datum = OBJ_NEW(orte_snapc_base_request_op_t);
  40     datum->event = ORTE_SNAPC_OP_RESTART;
  41     datum->is_active = true;
  42 
  43     /*
  44      * Restart is not collective, so the caller is the leader
  45      */
  46     datum->leader = OMPI_PROC_MY_NAME->vpid;
  47     datum->seq_num = seq;
  48     datum->global_handle = strdup(handle);
  49 
  50     /*
  51      * Leader sends the request
  52      */
  53     OPAL_CR_ENTER_LIBRARY();
  54     ret = orte_snapc.request_op(datum);
  55     if( OMPI_SUCCESS != ret ) {
  56         OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_OTHER,
  57                                FUNC_NAME);
  58     }
  59     OPAL_CR_EXIT_LIBRARY();
  60 
  61     datum->is_active = false;
  62     OBJ_RELEASE(datum);
  63 
  64     /********** If successful, should never reach this point (JJH) ******/
  65 
  66     return ret;
  67 }

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