root/orte/mca/snapc/base/snapc_base_frame.c

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

DEFINITIONS

This source file includes following definitions.
  1. orte_snapc_base_register
  2. orte_snapc_base_close
  3. orte_snapc_base_open

   1 /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
   2 
   3 /*
   4  * Copyright (c) 2004-2010 The Trustees of Indiana University.
   5  *                         All rights reserved.
   6  * Copyright (c) 2004-2008 The Trustees of the University of Tennessee.
   7  *                         All rights 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) 2007      Evergrid, Inc. All rights reserved.
  13  * Copyright (c) 2013      Los Alamos National Security, LLC.  All rights reserved.
  14  *
  15  * $COPYRIGHT$
  16  *
  17  * Additional copyrights may follow
  18  *
  19  * $HEADER$
  20  */
  21 
  22 #include "orte_config.h"
  23 
  24 #include <string.h>
  25 #ifdef HAVE_UNISTD_H
  26 #include <unistd.h>
  27 #endif
  28 #ifdef HAVE_SYS_TYPES_H
  29 #include <sys/types.h>
  30 #endif
  31 
  32 #include "orte/mca/mca.h"
  33 #include "opal/mca/base/base.h"
  34 #include "opal/util/opal_environ.h"
  35 #include "opal/util/output.h"
  36 
  37 #include "orte/constants.h"
  38 #include "orte/mca/sstore/sstore.h"
  39 #include "orte/mca/sstore/base/base.h"
  40 
  41 #include "orte/mca/snapc/snapc.h"
  42 #include "orte/mca/snapc/base/base.h"
  43 
  44 #include "orte/mca/snapc/base/static-components.h"
  45 
  46 /*
  47  * Globals
  48  */
  49 bool orte_snapc_base_is_tool = false;
  50 orte_snapc_base_module_t orte_snapc = {
  51     NULL, /* snapc_init      */
  52     NULL, /* snapc_finalize  */
  53     NULL, /* setup_job       */
  54     NULL  /* release_job     */
  55 };
  56 
  57 orte_snapc_coord_type_t orte_snapc_coord_type = ORTE_SNAPC_UNASSIGN_TYPE;
  58 
  59 bool orte_snapc_base_store_only_one_seq = false;
  60 bool   orte_snapc_base_has_recovered = false;
  61 
  62 static int orte_snapc_base_register(mca_base_register_flag_t flags)
  63 {
  64     /*
  65      * Reuse sequence numbers
  66      * This will create a directory and always use seq 0 for all checkpoints
  67      * This *should* also enforce a 2-phase commit protocol
  68      */
  69     orte_snapc_base_store_only_one_seq = false;
  70     (void) mca_base_var_register("orte", "snapc", "base", "only_one_seq",
  71                                  "Only store the most recent checkpoint sequence. [Default = disabled]",
  72                                  MCA_BASE_VAR_TYPE_BOOL, NULL, 0, 0,
  73                                  OPAL_INFO_LVL_9,
  74                                  MCA_BASE_VAR_SCOPE_READONLY,
  75                                  &orte_snapc_base_store_only_one_seq);
  76 
  77     return ORTE_SUCCESS;
  78 }
  79 
  80 static int orte_snapc_base_close(void)
  81 {
  82     /* Close the selected component */
  83     if( NULL != orte_snapc.snapc_finalize ) {
  84         orte_snapc.snapc_finalize();
  85     }
  86 
  87     return mca_base_framework_components_close(&orte_snapc_base_framework, NULL);
  88 }
  89 
  90 /**
  91  * Function for finding and opening either all MCA components,
  92  * or the one that was specifically requested via a MCA parameter.
  93  */
  94 static int orte_snapc_base_open(mca_base_open_flag_t flags)
  95 {
  96     /* Init the sequence (interval) number */
  97     orte_snapc_base_snapshot_seq_number = 0;
  98 
  99     /* Open up all available components */
 100     return mca_base_framework_components_open(&orte_snapc_base_framework, flags);
 101 }
 102 
 103 MCA_BASE_FRAMEWORK_DECLARE(orte, snapc, "ORTE Snapc", orte_snapc_base_register,
 104                            orte_snapc_base_open, orte_snapc_base_close,
 105                            mca_snapc_base_static_components, 0);
 106 

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