root/orte/mca/sstore/base/base.h

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

INCLUDED FROM


   1 /*
   2  * Copyright (c)      2010 The Trustees of Indiana University and Indiana
   3  *                         University Research and Technology
   4  *                         Corporation.  All rights reserved.
   5  * Copyright (c) 2013      Los Alamos National Security, LLC.  All rights reserved.
   6  * Copyright (c) 2018      Intel, Inc.  All rights reserved.
   7  * $COPYRIGHT$
   8  *
   9  * Additional copyrights may follow
  10  *
  11  * $HEADER$
  12  */
  13 #ifndef ORTE_SSTORE_BASE_H
  14 #define ORTE_SSTORE_BASE_H
  15 
  16 #include "orte_config.h"
  17 
  18 #include "opal/util/printf.h"
  19 #include "orte/mca/sstore/sstore.h"
  20 
  21 /*
  22  * Global functions for MCA overall SStore
  23  */
  24 
  25 BEGIN_C_DECLS
  26 
  27 /*
  28  * MCA Framework
  29  */
  30 ORTE_DECLSPEC extern mca_base_framework_t orte_sstore_base_framework;
  31 /* select a component */
  32 ORTE_DECLSPEC    int orte_sstore_base_select(void);
  33 
  34 /**
  35  * Object stuff
  36  */
  37 void orte_sstore_base_local_snapshot_info_construct(orte_sstore_base_local_snapshot_info_t *snapshot);
  38 void orte_sstore_base_local_snapshot_info_destruct( orte_sstore_base_local_snapshot_info_t *snapshot);
  39 
  40 void orte_sstore_base_global_snapshot_info_construct(orte_sstore_base_global_snapshot_info_t *snapshot);
  41 void orte_sstore_base_global_snapshot_info_destruct( orte_sstore_base_global_snapshot_info_t *snapshot);
  42 
  43 /**
  44  * Globals
  45  */
  46 ORTE_DECLSPEC extern orte_sstore_base_module_t orte_sstore;
  47 
  48 /*
  49  * Context of this module
  50  */
  51 #define ORTE_SSTORE_UNASSIGN_TYPE 0
  52 #define ORTE_SSTORE_GLOBAL_TYPE   1
  53 #define ORTE_SSTORE_LOCAL_TYPE    2
  54 #define ORTE_SSTORE_TOOL_TYPE     4
  55 #define ORTE_SSTORE_APP_TYPE      8
  56 ORTE_DECLSPEC extern int orte_sstore_context;
  57 
  58 /**
  59  * Snapshot metadata
  60  */
  61 #define SSTORE_METADATA_LOCAL_CRS_COMP_STR  CRS_METADATA_COMP
  62 #define SSTORE_METADATA_LOCAL_PID_STR       CRS_METADATA_PID
  63 #define SSTORE_METADATA_LOCAL_CONTEXT_STR   CRS_METADATA_CONTEXT
  64 #define SSTORE_METADATA_LOCAL_MKDIR_STR     CRS_METADATA_MKDIR
  65 #define SSTORE_METADATA_LOCAL_TOUCH_STR     CRS_METADATA_TOUCH
  66 
  67 #define SSTORE_METADATA_LOCAL_COMPRESS_COMP_STR    ("# OPAL Compress Component: ")
  68 #define SSTORE_METADATA_LOCAL_COMPRESS_POSTFIX_STR ("# OPAL Compress Postfix: ")
  69 
  70 #define SSTORE_METADATA_LOCAL_SNAP_REF_FMT_STR ("# Local Snapshot Format Reference: ")
  71 #define SSTORE_METADATA_GLOBAL_SNAP_SEQ_STR    ("# Seq: ")
  72 #define SSTORE_METADATA_GLOBAL_AMCA_PARAM_STR  ("# AMCA: ")
  73 #define SSTORE_METADATA_GLOBAL_TUNE_PARAM_STR  ("# TUNE: ")
  74 
  75 #define SSTORE_METADATA_INTERNAL_DONE_SEQ_STR  ("# Finished Seq: ")
  76 #define SSTORE_METADATA_INTERNAL_TIME_STR      ("# Timestamp: ")
  77 #define SSTORE_METADATA_INTERNAL_PROCESS_STR   ("# Process: ")
  78 
  79 #define SSTORE_METADATA_INTERNAL_MIG_SEQ_STR       ("# Migrate Seq: ")
  80 #define SSTORE_METADATA_INTERNAL_DONE_MIG_SEQ_STR  ("# Finished Migrate Seq: ")
  81 
  82 
  83 /**
  84  * Some utility functions
  85  */
  86 ORTE_DECLSPEC extern bool   orte_sstore_base_is_checkpoint_available;
  87 ORTE_DECLSPEC extern char * orte_sstore_base_local_metadata_filename;
  88 ORTE_DECLSPEC extern char * orte_sstore_base_global_metadata_filename;
  89 ORTE_DECLSPEC extern char * orte_sstore_base_local_snapshot_fmt;
  90 ORTE_DECLSPEC extern char * orte_sstore_base_global_snapshot_dir;
  91 ORTE_DECLSPEC extern char * orte_sstore_base_global_snapshot_ref;
  92 ORTE_DECLSPEC extern char * orte_sstore_base_prelaunch_location;
  93 
  94 ORTE_DECLSPEC int orte_sstore_base_get_global_snapshot_ref(char **name_str, pid_t pid);
  95 
  96 ORTE_DECLSPEC int orte_sstore_base_convert_key_to_string(orte_sstore_base_key_t key, char **key_str);
  97 ORTE_DECLSPEC int orte_sstore_base_convert_string_to_key(char *key_str, orte_sstore_base_key_t *key);
  98 
  99 ORTE_DECLSPEC int orte_sstore_base_metadata_read_next_seq_num(FILE *file);
 100 ORTE_DECLSPEC int orte_sstore_base_metadata_read_next_token(FILE *file, char **token, char **value);
 101 ORTE_DECLSPEC int orte_sstore_base_metadata_seek_to_seq_num(FILE *file, int seq_num);
 102 
 103 ORTE_DECLSPEC int orte_sstore_base_extract_global_metadata(orte_sstore_base_global_snapshot_info_t *global_snapshot);
 104 ORTE_DECLSPEC int orte_sstore_base_get_all_snapshots(opal_list_t *all_snapshots, char *basedir);
 105 ORTE_DECLSPEC int orte_sstore_base_find_largest_seq_num(orte_sstore_base_global_snapshot_info_t *global_snapshot, int *seq_num);
 106 ORTE_DECLSPEC int orte_sstore_base_find_all_seq_nums(orte_sstore_base_global_snapshot_info_t *global_snapshot, int *num_seq, char ***seq_list);
 107 
 108 /*
 109  * Common Tool functionality for interfacing with orte-restart/checkpoint
 110  */
 111 ORTE_DECLSPEC int orte_sstore_base_tool_request_restart_handle(orte_sstore_base_handle_t *handle,
 112                                                                char *basedir, char *ref, int seq,
 113                                                                orte_sstore_base_global_snapshot_info_t *snapshot);
 114 ORTE_DECLSPEC int orte_sstore_base_tool_get_attr(orte_sstore_base_handle_t handle, orte_sstore_base_key_t key, char **value);
 115 
 116 END_C_DECLS
 117 
 118 #endif /* ORTE_SSTORE_BASE_H */

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