root/orte/mca/snapc/base/base.h

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

INCLUDED FROM


   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) 2004-2005 The University of Tennessee and The University
   6  *                         of Tennessee Research Foundation.  All rights
   7  *                         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 (c) 2018      Intel, Inc.  All rights reserved.
  16  * $COPYRIGHT$
  17  *
  18  * Additional copyrights may follow
  19  *
  20  * $HEADER$
  21  */
  22 #ifndef ORTE_SNAPC_BASE_H
  23 #define ORTE_SNAPC_BASE_H
  24 
  25 #include "orte_config.h"
  26 #include "orte/types.h"
  27 
  28 #include "opal/util/printf.h"
  29 
  30 #include "orte/mca/snapc/snapc.h"
  31 
  32 /*
  33  * Global functions for MCA overall SNAPC
  34  */
  35 
  36 BEGIN_C_DECLS
  37 
  38 /*
  39  * MCA Framework
  40  */
  41 ORTE_DECLSPEC extern mca_base_framework_t orte_snapc_base_framework;
  42 /* select a component */
  43 ORTE_DECLSPEC int orte_snapc_base_select(bool seed, bool app);
  44 
  45 /*
  46  * Commands for command line tool and SnapC interaction
  47  */
  48 typedef uint8_t orte_snapc_cmd_flag_t;
  49 #define ORTE_SNAPC_CMD  OPAL_UINT8
  50 #define ORTE_SNAPC_GLOBAL_INIT_CMD    1
  51 #define ORTE_SNAPC_GLOBAL_TERM_CMD    2
  52 #define ORTE_SNAPC_GLOBAL_UPDATE_CMD  3
  53 #define ORTE_SNAPC_LOCAL_UPDATE_CMD   4
  54 #define ORTE_SNAPC_LOCAL_FINISH_CMD   5
  55 
  56 /**
  57  * There are 3 types of Coordinators, and any process may be once or more type.
  58  * e.g., orterun is can often be both a Global and Local coordinator if it
  59  *       launches processes locally.
  60  */
  61 typedef uint32_t orte_snapc_coord_type_t;
  62 #define ORTE_SNAPC_UNASSIGN_TYPE     0
  63 #define ORTE_SNAPC_GLOBAL_COORD_TYPE 1
  64 #define ORTE_SNAPC_LOCAL_COORD_TYPE  2
  65 #define ORTE_SNAPC_APP_COORD_TYPE    4
  66 ORTE_DECLSPEC extern orte_snapc_coord_type_t orte_snapc_coord_type;
  67 
  68 #define ORTE_SNAPC_COORD_NAME_PRINT(ct) ( (ct == (ORTE_SNAPC_GLOBAL_COORD_TYPE | ORTE_SNAPC_LOCAL_COORD_TYPE) ) ? "Global-Local" : \
  69                                           (ct ==  ORTE_SNAPC_GLOBAL_COORD_TYPE) ? "Global" : \
  70                                           (ct ==  ORTE_SNAPC_LOCAL_COORD_TYPE)  ? "Local"  : \
  71                                           (ct ==  ORTE_SNAPC_APP_COORD_TYPE)    ? "App"    : \
  72                                           "Unknown")
  73 
  74 /**
  75  * Global Snapshot Object Maintenance functions
  76  */
  77 void orte_snapc_base_local_snapshot_construct(orte_snapc_base_local_snapshot_t *obj);
  78 void orte_snapc_base_local_snapshot_destruct( orte_snapc_base_local_snapshot_t *obj);
  79 
  80 void orte_snapc_base_global_snapshot_construct(orte_snapc_base_global_snapshot_t *obj);
  81 void orte_snapc_base_global_snapshot_destruct( orte_snapc_base_global_snapshot_t *obj);
  82 
  83 void orte_snapc_base_quiesce_construct(orte_snapc_base_quiesce_t *obj);
  84 void orte_snapc_base_quiesce_destruct( orte_snapc_base_quiesce_t *obj);
  85 
  86 void orte_snapc_base_request_op_construct(orte_snapc_base_request_op_t *op);
  87 void orte_snapc_base_request_op_destruct(orte_snapc_base_request_op_t *op);
  88 
  89 /**
  90  * 'None' component functions
  91  * These are to be used when no component is selected.
  92  * They just return success, and empty strings as necessary.
  93  */
  94 ORTE_DECLSPEC int orte_snapc_base_none_open(void);
  95 ORTE_DECLSPEC int orte_snapc_base_none_close(void);
  96 ORTE_DECLSPEC int orte_snapc_base_none_query(mca_base_module_t **module, int *priority);
  97 
  98 ORTE_DECLSPEC int orte_snapc_base_module_init(bool seed, bool app);
  99 ORTE_DECLSPEC int orte_snapc_base_module_finalize(void);
 100 ORTE_DECLSPEC int orte_snapc_base_none_setup_job(orte_jobid_t jobid);
 101 ORTE_DECLSPEC int orte_snapc_base_none_release_job(orte_jobid_t jobid);
 102 ORTE_DECLSPEC int orte_snapc_base_none_ft_event(int state);
 103 ORTE_DECLSPEC int orte_snapc_base_none_start_ckpt(orte_snapc_base_quiesce_t *datum);
 104 ORTE_DECLSPEC int orte_snapc_base_none_end_ckpt(orte_snapc_base_quiesce_t *datum);
 105 
 106 ORTE_DECLSPEC extern orte_snapc_base_module_t orte_snapc;
 107 
 108 /**
 109  * Globals
 110  */
 111 ORTE_DECLSPEC extern bool   orte_snapc_base_store_only_one_seq;
 112 ORTE_DECLSPEC extern size_t orte_snapc_base_snapshot_seq_number;
 113 ORTE_DECLSPEC extern bool   orte_snapc_base_has_recovered;
 114 
 115 /**
 116  * Some utility functions
 117  */
 118 ORTE_DECLSPEC void orte_snapc_ckpt_state_notify(int state);
 119 ORTE_DECLSPEC int orte_snapc_ckpt_state_str(char ** state_str, int state);
 120 
 121 /*******************************
 122  * Global Coordinator functions
 123      *******************************/
 124 /* Initial handshake with the orte_checkpoint command */
 125 ORTE_DECLSPEC int orte_snapc_base_global_coord_ckpt_init_cmd(orte_process_name_t* peer,
 126                                                              opal_buffer_t* buffer,
 127                                                              opal_crs_base_ckpt_options_t *options,
 128                                                              orte_jobid_t *jobid);
 129 ORTE_DECLSPEC int orte_snapc_base_global_coord_ckpt_update_cmd(orte_process_name_t* peer,
 130                                                                orte_sstore_base_handle_t handle,
 131                                                                int ckpt_status);
 132 
 133 ORTE_DECLSPEC int orte_snapc_base_unpack_options(opal_buffer_t* buffer,
 134                                                  opal_crs_base_ckpt_options_t *options);
 135 ORTE_DECLSPEC int orte_snapc_base_pack_options(opal_buffer_t* buffer,
 136                                                opal_crs_base_ckpt_options_t *options);
 137 
 138 END_C_DECLS
 139 
 140 #endif /* ORTE_SNAPC_BASE_H */

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