root/constants.h

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

INCLUDED FROM


   1 /****************************************************************************
   2  *   Copyright (C) 2006-2008 by Jason Ansel, Kapil Arya, and Gene Cooperman *
   3  *   jansel@csail.mit.edu, kapil@ccs.neu.edu, gene@ccs.neu.edu              *
   4  *                                                                          *
   5  *  This file is part of DMTCP.                                             *
   6  *                                                                          *
   7  *  DMTCP is free software: you can redistribute it and/or                  *
   8  *  modify it under the terms of the GNU Lesser General Public License as   *
   9  *  published by the Free Software Foundation, either version 3 of the      *
  10  *  License, or (at your option) any later version.                         *
  11  *                                                                          *
  12  *  DMTCP is distributed in the hope that it will be useful,                *
  13  *  but WITHOUT ANY WARRANTY; without even the implied warranty of          *
  14  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the           *
  15  *  GNU Lesser General Public License for more details.                     *
  16  *                                                                          *
  17  *  You should have received a copy of the GNU Lesser General Public        *
  18  *  License along with DMTCP:dmtcp/src.  If not, see                        *
  19  *  <http://www.gnu.org/licenses/>.                                         *
  20  ****************************************************************************/
  21 
  22 #ifndef CONSTANTS_H
  23 #define CONSTANTS_H
  24 
  25 #include <linux/version.h>
  26 #include <features.h>
  27 
  28 #include "config.h"
  29 
  30 // Turn on coordinator NameService by default. In future, we will replace the
  31 // logic in dmtcp_coordinator.cpp and dmtcp_worker.cpp to allow the coordinator
  32 // to automatically detect when a worker wants to use NameService. If it does,
  33 // the worker will go through two extra barriers in the coordinator (REGISTER
  34 // and QUERY).
  35 // Every worker that uses the NameService, must register _some_ data with the
  36 // coordinator before it can do a query.
  37 #define COORD_NAMESERVICE
  38 
  39 #ifndef CKPT_SIGNAL
  40 # define CKPT_SIGNAL SIGUSR2
  41 #endif
  42 
  43 // This macro (LIBC...) is also defined in ../jalib/jassert.cpp and should
  44 // always be kept in sync with that.
  45 #define LIBC_FILENAME "libc.so.6"
  46 
  47 #define LIBDL_FILENAME "libdl.so.2"
  48 #define CKPT_FILE_PREFIX "ckpt_"
  49 #define CKPT_FILE_SUFFIX ".dmtcp"
  50 #define CKPT_FILE_SUFFIX_LEN strlen(".dmtcp")
  51 #define CKPT_FILES_SUBDIR_PREFIX "ckpt_"
  52 #define CKPT_FILES_SUBDIR_SUFFIX "_files"
  53 /* dmtcp_launch, dmtcp_restart return a unique rc (default: 99) */
  54 #define DMTCP_FAIL_RC \
  55         (getenv("DMTCP_FAIL_RC") && atoi(getenv("DMTCP_FAIL_RC")) ? \
  56          atoi(getenv("DMTCP_FAIL_RC")) : 99)
  57 
  58 // Not used
  59 //#define X11_LISTENER_PORT_START 6000
  60 
  61 // Virtual pids used by coordinator.
  62 #define INITIAL_VIRTUAL_PID  40000
  63 #define MAX_VIRTUAL_PID  400000000
  64 
  65 #define DEFAULT_HOST "127.0.0.1"
  66 #define DEFAULT_PORT 7779
  67 
  68 // Matchup this definition with the one in plugins/ptrace/ptracewrappers.h
  69 #define DMTCP_FAKE_SYSCALL 1023
  70 
  71 //this next string can be at most 16 chars long
  72 #define DMTCP_MAGIC_STRING "DMTCP_CKPT_V0\n"
  73 
  74 //it should be safe to change any of these names
  75 #define ENV_VAR_NAME_HOST "DMTCP_COORD_HOST"
  76 #define ENV_VAR_NAME_PORT "DMTCP_COORD_PORT"
  77 #define ENV_VAR_NAME_RESTART_DIR  "DMTCP_RESTART_DIR"
  78 #define ENV_VAR_CKPT_INTR "DMTCP_CHECKPOINT_INTERVAL"
  79 #define ENV_VAR_ORIG_LD_PRELOAD "DMTCP_ORIG_LD_PRELOAD"
  80 #define ENV_VAR_HIJACK_LIBS "DMTCP_HIJACK_LIBS"
  81 #define ENV_VAR_HIJACK_LIBS_M32 "DMTCP_HIJACK_LIBS_M32"
  82 #define ENV_VAR_CHECKPOINT_DIR "DMTCP_CHECKPOINT_DIR"
  83 #define ENV_VAR_TMPDIR "DMTCP_TMPDIR"
  84 #define ENV_VAR_CKPT_OPEN_FILES "DMTCP_CKPT_OPEN_FILES"
  85 #define ENV_VAR_PLUGIN "DMTCP_PLUGIN"
  86 #define ENV_VAR_QUIET "DMTCP_QUIET"
  87 #define ENV_VAR_DMTCP_DUMMY "DMTCP_DUMMY"
  88 // Keep in sync with plugin/pid/pidwrappers.h
  89 #define ENV_VAR_VIRTUAL_PID "DMTCP_VIRTUAL_PID"
  90 // Keep in sync with plugin/batch-queue/rm_pmi.h
  91 #define ENV_VAR_EXPLICIT_SRUN "DMTCP_EXPLICIT_SRUN"
  92 
  93 
  94 // it is not yet safe to change these; these names are hard-wired in the code
  95 #define ENV_VAR_STDERR_PATH "JALIB_STDERR_PATH"
  96 #define ENV_VAR_COMPRESSION "DMTCP_GZIP"
  97 #define ENV_VAR_ALLOC_PLUGIN "DMTCP_ALLOC_PLUGIN"
  98 #define ENV_VAR_DL_PLUGIN "DMTCP_DL_PLUGIN"
  99 #ifdef HBICT_DELTACOMP
 100   #define ENV_VAR_DELTACOMPRESSION "DMTCP_HBICT"
 101   #define ENV_DELTACOMPRESSION ENV_VAR_DELTACOMPRESSION
 102 #else
 103   #define ENV_DELTACOMPRESSION
 104 #endif
 105 
 106 #define ENV_VAR_FORKED_CKPT "DMTCP_FORKED_CHECKPOINT"
 107 #define ENV_VAR_SIGCKPT "DMTCP_SIGCKPT"
 108 #define ENV_VAR_SCREENDIR "SCREENDIR"
 109 #define ENV_VAR_DISABLE_UID_CHECKING "DMTCP_DISABLE_UID_CHECKING"
 110 
 111 #define GLIBC_BASE_FUNC isalnum
 112 
 113 #define LIBDL_BASE_FUNC dlinfo
 114 #define LIBDL_BASE_FUNC_STR "dlinfo"
 115 #define ENV_VAR_DLSYM_OFFSET "DMTCP_DLSYM_OFFSET"
 116 #define ENV_VAR_DLSYM_OFFSET_M32 "DMTCP_DLSYM_OFFSET_M32"
 117 
 118 //this list should be kept up to date with all "protected" environment vars
 119 #define ENV_VARS_ALL \
 120     ENV_VAR_NAME_HOST,\
 121     ENV_VAR_NAME_PORT,\
 122     ENV_VAR_CKPT_INTR,\
 123     ENV_VAR_ORIG_LD_PRELOAD,\
 124     ENV_VAR_HIJACK_LIBS,\
 125     ENV_VAR_HIJACK_LIBS_M32,\
 126     ENV_VAR_PLUGIN, \
 127     ENV_VAR_CHECKPOINT_DIR,\
 128     ENV_VAR_TMPDIR,\
 129     ENV_VAR_CKPT_OPEN_FILES,\
 130     ENV_VAR_QUIET,\
 131     ENV_VAR_STDERR_PATH,\
 132     ENV_VAR_COMPRESSION,\
 133     ENV_VAR_ALLOC_PLUGIN,\
 134     ENV_VAR_DL_PLUGIN,\
 135     ENV_VAR_SIGCKPT,\
 136     ENV_VAR_SCREENDIR, \
 137     ENV_VAR_DLSYM_OFFSET, \
 138     ENV_VAR_DLSYM_OFFSET_M32, \
 139     ENV_VAR_VIRTUAL_PID, \
 140     ENV_DELTACOMPRESSION
 141 
 142 #define DMTCP_RESTART_CMD "dmtcp_restart"
 143 
 144 #define RESTART_SCRIPT_BASENAME "dmtcp_restart_script"
 145 #define RESTART_SCRIPT_EXT "sh"
 146 
 147 #define DMTCP_FILE_HEADER "DMTCP_CHECKPOINT_IMAGE_v2.0\n"
 148 
 149 // #define MIN_SIGNAL 1
 150 // #define MAX_SIGNAL 30
 151 
 152 #if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,9)
 153 #define user_desc modify_ldt_ldt_s
 154 #endif
 155 
 156 #define DMTCP_VERSION_AND_COPYRIGHT_INFO                                       \
 157   BINARY_NAME " (DMTCP) " PACKAGE_VERSION "\n"                                 \
 158   "License LGPLv3+: GNU LGPL version 3 or later\n"                             \
 159   "    <http://gnu.org/licenses/lgpl.html>.\n"                                 \
 160   "This program comes with ABSOLUTELY NO WARRANTY.\n"                          \
 161   "This is free software, and you are welcome to redistribute it\n"            \
 162   "under certain conditions; see COPYING file for details.\n"
 163 
 164 #define HELP_AND_CONTACT_INFO             \
 165   "Report bugs to: "PACKAGE_BUGREPORT"\n" \
 166   "DMTCP home page: <"PACKAGE_URL">\n"
 167 
 168 #endif

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