Deal with the include spree. Protect "environ" on Windows.
Some others minors modifications in order to make it compile [again] on Windows. This commit was SVN r14188.
Этот коммит содержится в:
родитель
6ddd250a87
Коммит
f2a6b9394f
@ -23,7 +23,6 @@
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
#include <time.h>
|
||||
#include <libgen.h>
|
||||
#include <ctype.h>
|
||||
|
||||
#include "opal/mca/mca.h"
|
||||
|
@ -17,7 +17,9 @@
|
||||
#include "ompi_config.h"
|
||||
|
||||
#include <sys/types.h>
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif /* HAVE_UNIST_H */
|
||||
|
||||
#include "opal/runtime/opal_cr.h"
|
||||
#include "opal/event/event.h"
|
||||
|
@ -17,7 +17,9 @@
|
||||
#include "ompi_config.h"
|
||||
|
||||
#include <sys/types.h>
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif /* HAVE_UNIST_H */
|
||||
|
||||
#include "opal/mca/mca.h"
|
||||
#include "opal/mca/base/base.h"
|
||||
|
@ -17,7 +17,9 @@
|
||||
#include "ompi_config.h"
|
||||
|
||||
#include <sys/types.h>
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif /* HAVE_UNIST_H */
|
||||
|
||||
#include "opal/runtime/opal_cr.h"
|
||||
#include "opal/event/event.h"
|
||||
|
@ -19,8 +19,10 @@
|
||||
|
||||
#include "ompi_config.h"
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif /* HAVE_UNIST_H */
|
||||
#include "opal/mca/mca.h"
|
||||
#include "opal/mca/base/base.h"
|
||||
#include "opal/util/output.h"
|
||||
|
@ -70,7 +70,9 @@
|
||||
/******************
|
||||
* Global Var Decls
|
||||
******************/
|
||||
#ifndef __WINDOWS__
|
||||
extern char **environ;
|
||||
#endif /* __WINDOWS__ */
|
||||
|
||||
bool opal_cr_stall_check;
|
||||
int opal_cr_output;
|
||||
@ -122,7 +124,8 @@ bool opal_cr_is_enabled = true;
|
||||
bool opal_cr_is_tool = false;
|
||||
|
||||
|
||||
int opal_cr_set_enabled(bool en) {
|
||||
int opal_cr_set_enabled(bool en)
|
||||
{
|
||||
opal_cr_is_enabled = en;
|
||||
return OPAL_SUCCESS;
|
||||
}
|
||||
@ -181,13 +184,17 @@ int opal_cr_init(void )
|
||||
opal_output_verbose(10, opal_cr_output,
|
||||
"opal_cr: init: Is a tool program: %d",
|
||||
val);
|
||||
|
||||
#ifndef __WINDOWS__
|
||||
mca_base_param_reg_int_name("opal_cr", "signal",
|
||||
"Checkpoint/Restart signal used to initialize a checkpoint of a program",
|
||||
false, false,
|
||||
SIGUSR1,
|
||||
&opal_cr_signal);
|
||||
|
||||
#else
|
||||
opal_output( 0, "This feature is disabled on Windows" );
|
||||
exit(-1);
|
||||
#endif /* __WINDOWS__ */
|
||||
|
||||
opal_output_verbose(10, opal_cr_output,
|
||||
"opal_cr: init: Checkpoint Signal: %d",
|
||||
opal_cr_signal);
|
||||
@ -339,7 +346,8 @@ int opal_cr_finalize(void)
|
||||
/*
|
||||
* Check if a checkpoint request needs to be operated upon
|
||||
*/
|
||||
void opal_cr_test_if_checkpoint_ready(void) {
|
||||
void opal_cr_test_if_checkpoint_ready(void)
|
||||
{
|
||||
int ret;
|
||||
static int jump_to_stage = 0;
|
||||
|
||||
@ -537,9 +545,8 @@ int opal_cr_coord(int state)
|
||||
return OPAL_SUCCESS;
|
||||
}
|
||||
|
||||
int opal_cr_reg_coord_callback
|
||||
(opal_cr_coord_callback_fn_t new_func,
|
||||
opal_cr_coord_callback_fn_t *prev_func)
|
||||
int opal_cr_reg_coord_callback(opal_cr_coord_callback_fn_t new_func,
|
||||
opal_cr_coord_callback_fn_t *prev_func)
|
||||
{
|
||||
/*
|
||||
* Preserve the previous callback
|
||||
@ -561,8 +568,11 @@ int opal_cr_reg_coord_callback
|
||||
|
||||
static int cr_notify_reopen_files(int *prog_read_fd, int *prog_write_fd)
|
||||
{
|
||||
int ret;
|
||||
int ret = OPAL_ERR_NOT_IMPLEMENTED;
|
||||
|
||||
#ifdef __WINDOWS__
|
||||
return ret;
|
||||
#else
|
||||
/*
|
||||
* Open up the read pipe
|
||||
*/
|
||||
@ -614,12 +624,14 @@ static int cr_notify_reopen_files(int *prog_read_fd, int *prog_write_fd)
|
||||
}
|
||||
|
||||
return OPAL_SUCCESS;
|
||||
#endif /* __WINDOWS__ */
|
||||
}
|
||||
|
||||
/*
|
||||
* Respond to an asynchronous checkpoint request
|
||||
*/
|
||||
int checkpoint_response(opal_cr_ckpt_cmd_state_t resp, int *jump_to_stage) {
|
||||
int checkpoint_response(opal_cr_ckpt_cmd_state_t resp, int *jump_to_stage)
|
||||
{
|
||||
static int app_term = 0, app_pid = 0;
|
||||
static opal_crs_base_snapshot_t *snapshot = NULL;
|
||||
static int prog_named_read_pipe_fd, prog_named_write_pipe_fd;
|
||||
@ -895,7 +907,8 @@ int checkpoint_response(opal_cr_ckpt_cmd_state_t resp, int *jump_to_stage) {
|
||||
* so it can communicate with the checkpoint command to take the approprate
|
||||
* action.
|
||||
*/
|
||||
static void opal_cr_signal_handler (int signo) {
|
||||
static void opal_cr_signal_handler (int signo)
|
||||
{
|
||||
if( opal_cr_signal != signo ) {
|
||||
/* Not our signal */
|
||||
return;
|
||||
@ -921,7 +934,8 @@ static void opal_cr_signal_handler (int signo) {
|
||||
* Extract environment variables from a saved file
|
||||
* and place them in the environment.
|
||||
*/
|
||||
static int extract_env_vars(int prev_pid) {
|
||||
static int extract_env_vars(int prev_pid)
|
||||
{
|
||||
int exit_status = OPAL_SUCCESS;
|
||||
char *file_name = NULL;
|
||||
FILE *env_data = NULL;
|
||||
|
@ -42,9 +42,6 @@
|
||||
#ifdef HAVE_SYS_STAT_H
|
||||
#include <sys/stat.h> /* for mkfifo */
|
||||
#endif /* HAVE_SYS_STAT_H */
|
||||
#ifdef HAVE_LIBGEN_H
|
||||
#include <libgen.h>
|
||||
#endif
|
||||
#ifdef HAVE_SYS_WAIT_H
|
||||
#include <sys/wait.h>
|
||||
#endif
|
||||
@ -75,7 +72,9 @@
|
||||
/******************
|
||||
* Global Vars
|
||||
******************/
|
||||
#ifndef __WINDOWS__
|
||||
extern char** environ;
|
||||
#endif /* __WINDOWS__ */
|
||||
|
||||
/******************
|
||||
* Local Functions
|
||||
|
@ -28,16 +28,15 @@
|
||||
|
||||
#include <stdio.h>
|
||||
#include <errno.h>
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif /* HAVE_UNISTD_H */
|
||||
#ifdef HAVE_STDLIB_H
|
||||
#include <stdlib.h>
|
||||
#endif /* HAVE_STDLIB_H */
|
||||
#ifdef HAVE_SYS_STAT_H
|
||||
#include <sys/stat.h>
|
||||
#endif
|
||||
#ifdef HAVE_LIBGEN_H
|
||||
#include <libgen.h>
|
||||
#endif
|
||||
#ifdef HAVE_SYS_TYPES_H
|
||||
#include <sys/types.h>
|
||||
#endif
|
||||
@ -65,8 +64,9 @@
|
||||
#include "opal/mca/crs/crs.h"
|
||||
#include "opal/mca/crs/base/base.h"
|
||||
|
||||
#ifndef __WINDOWS__
|
||||
extern char **environ;
|
||||
|
||||
#endif /* __WINDOWS__ */
|
||||
/******************
|
||||
* Local Functions
|
||||
******************/
|
||||
@ -289,7 +289,8 @@ main(int argc, char *argv[])
|
||||
return exit_status;
|
||||
}
|
||||
|
||||
static int initialize(int argc, char *argv[]) {
|
||||
static int initialize(int argc, char *argv[])
|
||||
{
|
||||
int ret, exit_status = OPAL_SUCCESS;
|
||||
|
||||
/*
|
||||
@ -331,7 +332,8 @@ static int initialize(int argc, char *argv[]) {
|
||||
return exit_status;
|
||||
}
|
||||
|
||||
static int finalize(void) {
|
||||
static int finalize(void)
|
||||
{
|
||||
int ret;
|
||||
|
||||
if (OPAL_SUCCESS != (ret = opal_finalize())) {
|
||||
@ -341,7 +343,8 @@ static int finalize(void) {
|
||||
return OPAL_SUCCESS;
|
||||
}
|
||||
|
||||
static int parse_args(int argc, char *argv[]) {
|
||||
static int parse_args(int argc, char *argv[])
|
||||
{
|
||||
int i, ret, len;
|
||||
opal_cmd_line_t cmd_line;
|
||||
char **app_env = NULL, **global_env = NULL;
|
||||
@ -433,7 +436,8 @@ static int parse_args(int argc, char *argv[]) {
|
||||
return OPAL_SUCCESS;
|
||||
}
|
||||
|
||||
static int check_file(char *given_filename) {
|
||||
static int check_file(char *given_filename)
|
||||
{
|
||||
int exit_status = OPAL_SUCCESS;
|
||||
int ret;
|
||||
char * path_to_check = NULL;
|
||||
@ -482,7 +486,8 @@ static int check_file(char *given_filename) {
|
||||
return exit_status;
|
||||
}
|
||||
|
||||
static int post_env_vars(int prev_pid) {
|
||||
static int post_env_vars(int prev_pid)
|
||||
{
|
||||
int ret, exit_status = OPAL_SUCCESS;
|
||||
char *command = NULL;
|
||||
char *proc_file = NULL;
|
||||
|
@ -25,16 +25,13 @@
|
||||
#endif /* HAVE_STDLIB_H */
|
||||
#ifdef HAVE_SYS_STAT_H
|
||||
#include <sys/stat.h>
|
||||
#endif
|
||||
#ifdef HAVE_LIBGEN_H
|
||||
#include <libgen.h>
|
||||
#endif
|
||||
#endif /* HAVE_SYS_STAT_H */
|
||||
#ifdef HAVE_SYS_TYPES_H
|
||||
#include <sys/types.h>
|
||||
#endif
|
||||
#endif /* HAVE_SYS_TYPES_H */
|
||||
#ifdef HAVE_SYS_WAIT_H
|
||||
#include <sys/wait.h>
|
||||
#endif
|
||||
#endif /* HAVE_SYS_WAIT_H */
|
||||
#ifdef HAVE_STRING_H
|
||||
#include <string.h>
|
||||
#endif /* HAVE_STRING_H */
|
||||
|
@ -19,10 +19,9 @@
|
||||
#include "opal_config.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
#ifdef HAVE_STRING_H
|
||||
#include <string.h>
|
||||
#if HAVE_DIRNAME
|
||||
#include <libgen.h>
|
||||
#endif /* HAVE_DIRNAME */
|
||||
#endif /* HAVE_STRING_H */
|
||||
|
||||
#include "opal/util/basename.h"
|
||||
#include "opal/util/os_path.h"
|
||||
|
@ -22,17 +22,14 @@
|
||||
#include <string.h>
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
#ifdef HAVE_LIBGEN_H
|
||||
#include <libgen.h>
|
||||
#endif
|
||||
#endif /* HAVE_UNISTD_H */
|
||||
#include <stdlib.h>
|
||||
#ifdef HAVE_SYS_TYPES_H
|
||||
#include <sys/types.h>
|
||||
#endif
|
||||
#endif /* HAVE_SYS_TYPES_H */
|
||||
#ifdef HAVE_DIRENT_H
|
||||
#include <dirent.h>
|
||||
#endif
|
||||
#endif /* HAVE_DIRENT_H */
|
||||
|
||||
#include "opal/util/os_dirpath.h"
|
||||
#include "opal/util/argv.h"
|
||||
@ -412,11 +409,10 @@ bool opal_os_dirpath_is_empty(const char *path ) {
|
||||
int opal_os_dirpath_access(const char *path, const mode_t in_mode ) {
|
||||
#ifndef __WINDOWS__
|
||||
struct stat buf;
|
||||
mode_t loc_mode = S_IRWXU; /* at the least, I need to be able to do anything */
|
||||
#else
|
||||
struct __stat64 buf;
|
||||
mode_t loc_mode = _S_IREAD | _S_IWRITE | _S_IEXEC;
|
||||
#endif
|
||||
mode_t loc_mode = S_IRWXU; /* looking for full rights */
|
||||
|
||||
/*
|
||||
* If there was no mode specified, use the default mode
|
||||
|
@ -21,13 +21,10 @@
|
||||
#include <string.h>
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
#ifdef HAVE_LIBGEN_H
|
||||
#include <libgen.h>
|
||||
#endif
|
||||
#endif /* HAVE_UNISTD_H */
|
||||
#ifdef HAVE_SYS_PARAM_H
|
||||
#include <sys/param.h>
|
||||
#endif
|
||||
#endif /* HAVE_SYS_PARAM_H */
|
||||
#include <stdlib.h>
|
||||
#include <stdarg.h>
|
||||
|
||||
|
@ -19,8 +19,9 @@
|
||||
#include <stdlib.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#include <libgen.h>
|
||||
#endif /* HAVE_UNISTD_H */
|
||||
|
||||
#include "orte/orte_constants.h"
|
||||
#include "opal/mca/mca.h"
|
||||
|
@ -33,9 +33,6 @@
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
#ifdef HAVE_LIBGEN_H
|
||||
#include <libgen.h>
|
||||
#endif
|
||||
|
||||
#include "orte/orte_constants.h"
|
||||
|
||||
|
@ -33,9 +33,6 @@
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
#ifdef HAVE_LIBGEN_H
|
||||
#include <libgen.h>
|
||||
#endif
|
||||
|
||||
#include "orte/orte_constants.h"
|
||||
|
||||
|
@ -17,7 +17,9 @@
|
||||
#include "orte_config.h"
|
||||
|
||||
#include <sys/types.h>
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif /* HAVE_UNISTD_H */
|
||||
|
||||
#include "opal/runtime/opal_cr.h"
|
||||
#include "opal/util/output.h"
|
||||
|
@ -16,9 +16,10 @@
|
||||
|
||||
#include "orte_config.h"
|
||||
|
||||
#include <libgen.h>
|
||||
#include <sys/types.h>
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif /* HAVE_UNISTD_H */
|
||||
|
||||
#include "opal/threads/mutex.h"
|
||||
#include "opal/threads/condition.h"
|
||||
@ -26,6 +27,7 @@
|
||||
#include "opal/util/show_help.h"
|
||||
#include "opal/util/argv.h"
|
||||
#include "opal/util/opal_environ.h"
|
||||
#include "opal/util/basename.h"
|
||||
#include "opal/mca/mca.h"
|
||||
#include "opal/mca/base/base.h"
|
||||
#include "opal/mca/base/mca_base_param.h"
|
||||
@ -260,7 +262,7 @@ snapc_full_global_checkpoint(orte_jobid_t jobid, bool term, char **global_snapsh
|
||||
|
||||
global_snapshot.seq_num = orte_snapc_base_snapshot_seq_number;
|
||||
global_snapshot.reference_name = strdup(*global_snapshot_handle);
|
||||
global_snapshot.local_location = dirname(orte_snapc_base_get_global_snapshot_directory(global_snapshot.reference_name));
|
||||
global_snapshot.local_location = opal_dirname(orte_snapc_base_get_global_snapshot_directory(global_snapshot.reference_name));
|
||||
|
||||
/* Creates the directory (with metadata files):
|
||||
* /tmp/ompi_global_snapshot_PID.ckpt/seq_num
|
||||
@ -888,7 +890,7 @@ static int snapc_full_global_gather_all_files(void) {
|
||||
*/
|
||||
tmp_argc = 0;
|
||||
local_dir = strdup(vpid_snapshot->crs_snapshot_super.local_location);
|
||||
opal_argv_append(&tmp_argc, &filem_request->local_targets, dirname(local_dir));
|
||||
opal_argv_append(&tmp_argc, &filem_request->local_targets, opal_dirname(local_dir));
|
||||
|
||||
/*
|
||||
* Do the transfer
|
||||
|
@ -17,8 +17,9 @@
|
||||
#include "orte_config.h"
|
||||
|
||||
#include <sys/types.h>
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#include <libgen.h>
|
||||
#endif /* HAVE_UNISTD_H */
|
||||
|
||||
#include "opal/runtime/opal_progress.h"
|
||||
#include "opal/util/output.h"
|
||||
@ -26,6 +27,7 @@
|
||||
#include "opal/util/argv.h"
|
||||
#include "opal/util/opal_environ.h"
|
||||
#include "opal/util/os_dirpath.h"
|
||||
#include "opal/util/basename.h"
|
||||
#include "opal/mca/mca.h"
|
||||
#include "opal/mca/base/base.h"
|
||||
#include "opal/mca/base/mca_base_param.h"
|
||||
@ -71,7 +73,8 @@ static orte_jobid_t snapc_local_jobid;
|
||||
/************************
|
||||
* Function Definitions
|
||||
************************/
|
||||
int local_coord_init() {
|
||||
int local_coord_init( void )
|
||||
{
|
||||
int ret, exit_status = ORTE_SUCCESS;
|
||||
int id, jobid;
|
||||
|
||||
@ -121,7 +124,8 @@ int local_coord_init() {
|
||||
return exit_status;
|
||||
}
|
||||
|
||||
int local_coord_finalize() {
|
||||
int local_coord_finalize( void )
|
||||
{
|
||||
int ret, exit_status = ORTE_SUCCESS;
|
||||
opal_list_item_t* item = NULL;
|
||||
bool is_done = true;
|
||||
@ -166,7 +170,8 @@ int local_coord_finalize() {
|
||||
/******************
|
||||
* Local functions
|
||||
******************/
|
||||
static int snapc_full_local_reg_vpid_state_updates(void) {
|
||||
static int snapc_full_local_reg_vpid_state_updates(void)
|
||||
{
|
||||
int ret, exit_status = ORTE_SUCCESS;
|
||||
char *segment = NULL, *trig_name = NULL;
|
||||
orte_gpr_subscription_id_t id;
|
||||
@ -249,7 +254,8 @@ static int snapc_full_local_reg_vpid_state_updates(void) {
|
||||
return exit_status;
|
||||
}
|
||||
|
||||
static int snapc_full_local_reg_job_state_updates( void ) {
|
||||
static int snapc_full_local_reg_job_state_updates( void )
|
||||
{
|
||||
int ret, exit_status = ORTE_SUCCESS;
|
||||
char *segment = NULL, *trig_name = NULL, **tokens;
|
||||
orte_gpr_subscription_id_t id;
|
||||
@ -321,7 +327,8 @@ static int snapc_full_local_reg_job_state_updates( void ) {
|
||||
return exit_status;
|
||||
}
|
||||
|
||||
static void snapc_full_local_vpid_state_callback(orte_gpr_notify_data_t *data, void *cbdata) {
|
||||
static void snapc_full_local_vpid_state_callback(orte_gpr_notify_data_t *data, void *cbdata)
|
||||
{
|
||||
int ret, exit_status = ORTE_SUCCESS;
|
||||
orte_process_name_t *proc;
|
||||
size_t ckpt_state;
|
||||
@ -452,7 +459,8 @@ static void snapc_full_local_vpid_state_callback(orte_gpr_notify_data_t *data, v
|
||||
return;
|
||||
}
|
||||
|
||||
static void snapc_full_local_job_state_callback( orte_gpr_notify_data_t *data, void *cbdata ) {
|
||||
static void snapc_full_local_job_state_callback( orte_gpr_notify_data_t *data, void *cbdata )
|
||||
{
|
||||
int ret, exit_status = ORTE_SUCCESS;
|
||||
size_t ckpt_state;
|
||||
char *ckpt_ref = NULL;
|
||||
@ -570,7 +578,8 @@ static void snapc_full_local_job_state_callback( orte_gpr_notify_data_t *data, v
|
||||
return;
|
||||
}
|
||||
|
||||
static int snapc_full_local_setup_snapshot_dir(char * snapshot_ref, char * sugg_dir, char **actual_dir) {
|
||||
static int snapc_full_local_setup_snapshot_dir(char * snapshot_ref, char * sugg_dir, char **actual_dir)
|
||||
{
|
||||
int ret, exit_status = ORTE_SUCCESS;
|
||||
mode_t my_mode = S_IRWXU;
|
||||
|
||||
@ -594,7 +603,8 @@ static int snapc_full_local_setup_snapshot_dir(char * snapshot_ref, char * sugg_
|
||||
return exit_status;
|
||||
}
|
||||
|
||||
static int snapc_full_local_get_vpids(void) {
|
||||
static int snapc_full_local_get_vpids(void)
|
||||
{
|
||||
int ret, exit_status = ORTE_SUCCESS;
|
||||
char *segment = NULL;
|
||||
char *keys[3];
|
||||
@ -676,7 +686,8 @@ static int snapc_full_local_get_vpids(void) {
|
||||
return exit_status;
|
||||
}
|
||||
|
||||
static int snapc_full_local_get_updated_vpids(void) {
|
||||
static int snapc_full_local_get_updated_vpids(void)
|
||||
{
|
||||
int ret, exit_status = ORTE_SUCCESS;
|
||||
char *segment = NULL;
|
||||
char *keys[4];
|
||||
@ -788,7 +799,8 @@ static int snapc_full_local_get_updated_vpids(void) {
|
||||
return exit_status;
|
||||
}
|
||||
|
||||
static int snapc_full_local_start_checkpoint(orte_snapc_base_snapshot_t *vpid_snapshot, bool term) {
|
||||
static int snapc_full_local_start_checkpoint(orte_snapc_base_snapshot_t *vpid_snapshot, bool term)
|
||||
{
|
||||
int ret, exit_status = ORTE_SUCCESS;
|
||||
char * command = NULL;
|
||||
char * local_dir = NULL;
|
||||
@ -833,7 +845,7 @@ static int snapc_full_local_start_checkpoint(orte_snapc_base_snapshot_t *vpid_sn
|
||||
term_str = strdup("");
|
||||
|
||||
local_dir = strdup(vpid_snapshot->crs_snapshot_super.local_location);
|
||||
local_dir = dirname(local_dir);
|
||||
local_dir = opal_dirname(local_dir);
|
||||
|
||||
asprintf(&command, "opal-checkpoint --where %s --name %s %s %d ",
|
||||
local_dir,
|
||||
@ -867,7 +879,8 @@ static int snapc_full_local_start_checkpoint(orte_snapc_base_snapshot_t *vpid_sn
|
||||
return exit_status;
|
||||
}
|
||||
|
||||
static bool local_checkpoint_finished(void) {
|
||||
static bool local_checkpoint_finished(void)
|
||||
{
|
||||
opal_list_item_t* item = NULL;
|
||||
bool is_done = true;
|
||||
|
||||
@ -888,7 +901,8 @@ static bool local_checkpoint_finished(void) {
|
||||
return is_done;
|
||||
}
|
||||
|
||||
static void snapc_full_local_wait_ckpt_cb(pid_t pid, int status, void* cbdata) {
|
||||
static void snapc_full_local_wait_ckpt_cb(pid_t pid, int status, void* cbdata)
|
||||
{
|
||||
orte_process_name_t *proc_name = (orte_process_name_t *)cbdata;
|
||||
opal_list_item_t* item = NULL;
|
||||
orte_snapc_base_snapshot_t *vpid_snapshot = NULL;
|
||||
|
@ -17,7 +17,9 @@
|
||||
#include "orte_config.h"
|
||||
|
||||
#include <sys/types.h>
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif /* HAVE_UNISTD_H */
|
||||
|
||||
#include "orte/orte_constants.h"
|
||||
#include "opal/mca/mca.h"
|
||||
|
@ -80,7 +80,9 @@
|
||||
/*************
|
||||
* Global Vars
|
||||
*************/
|
||||
#ifndef __WINDOWS__
|
||||
extern char **environ;
|
||||
#endif /* __WINDOWS__ */
|
||||
|
||||
/*************
|
||||
* Local functions
|
||||
|
@ -34,9 +34,6 @@
|
||||
#ifdef HAVE_DIRENT_H
|
||||
#include <dirent.h>
|
||||
#endif /* HAVE_DIRENT_H */
|
||||
#ifdef HAVE_LIBGEN_H
|
||||
#include <libgen.h>
|
||||
#endif /* HAVE_LIBGEN_H */
|
||||
|
||||
#include "orte/orte_constants.h"
|
||||
#include "opal/util/output.h"
|
||||
|
@ -41,12 +41,9 @@
|
||||
#ifdef HAVE_SYS_STAT_H
|
||||
#include <sys/stat.h> /* for mkfifo */
|
||||
#endif /* HAVE_SYS_STAT_H */
|
||||
#ifdef HAVE_LIBGEN_H
|
||||
#include <libgen.h>
|
||||
#endif
|
||||
#ifdef HAVE_SYS_WAIT_H
|
||||
#include <sys/wait.h>
|
||||
#endif
|
||||
#endif /* HAVE_SYS_WAIT_H */
|
||||
#ifdef HAVE_STRING_H
|
||||
#include <string.h>
|
||||
#endif /* HAVE_STRING_H */
|
||||
@ -83,7 +80,9 @@
|
||||
/******************
|
||||
* Global Vars
|
||||
******************/
|
||||
#ifndef __WINDOWS__
|
||||
extern char** environ;
|
||||
#endif /* __WINDOWS__ */
|
||||
|
||||
/******************
|
||||
* Local Functions
|
||||
|
@ -29,23 +29,19 @@
|
||||
#endif /* HAVE_STDLIB_H */
|
||||
#ifdef HAVE_SYS_STAT_H
|
||||
#include <sys/stat.h>
|
||||
#endif
|
||||
#ifdef HAVE_LIBGEN_H
|
||||
#include <libgen.h>
|
||||
#endif
|
||||
#endif /* HAVE_SYS_STAT_H */
|
||||
#ifdef HAVE_SYS_TYPES_H
|
||||
#include <sys/types.h>
|
||||
#endif
|
||||
#endif /* HAVE_SYS_TYPES_H */
|
||||
#ifdef HAVE_SYS_WAIT_H
|
||||
#include <sys/wait.h>
|
||||
#endif
|
||||
#endif /* HAVE_SYS_WAIT_H */
|
||||
#ifdef HAVE_SYS_PARAM_H
|
||||
#include <sys/param.h>
|
||||
#endif
|
||||
#endif /* HAVE_SYS_PARAM_H */
|
||||
#ifdef HAVE_STRING_H
|
||||
#include <string.h>
|
||||
#endif /* HAVE_STRING_H */
|
||||
#include <sys/types.h>
|
||||
#ifdef HAVE_DIRENT_H
|
||||
#include <dirent.h>
|
||||
#endif /* HAVE_DIRENT_H */
|
||||
@ -80,7 +76,9 @@
|
||||
/******************
|
||||
* Global Vars
|
||||
******************/
|
||||
#ifndef __WINDOWS__
|
||||
extern char** environ;
|
||||
#endif /* __WINDOWS__ */
|
||||
|
||||
/******************
|
||||
* Local Functions
|
||||
|
@ -28,28 +28,27 @@
|
||||
|
||||
#include <stdio.h>
|
||||
#include <errno.h>
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#include <libgen.h>
|
||||
#endif /* HAVE_UNISTD_H */
|
||||
#ifdef HAVE_STDLIB_H
|
||||
#include <stdlib.h>
|
||||
#endif /* HAVE_STDLIB_H */
|
||||
#ifdef HAVE_SYS_STAT_H
|
||||
#include <sys/stat.h>
|
||||
#endif
|
||||
#ifdef HAVE_LIBGEN_H
|
||||
#include <libgen.h>
|
||||
#endif
|
||||
#endif /* HAVE_SYS_STAT_H */
|
||||
#ifdef HAVE_SYS_TYPES_H
|
||||
#include <sys/types.h>
|
||||
#endif
|
||||
#endif /* HAVE_SYS_TYPES_H */
|
||||
#ifdef HAVE_SYS_WAIT_H
|
||||
#include <sys/wait.h>
|
||||
#endif
|
||||
#endif /* HAVE_SYS_WAIT_H */
|
||||
#ifdef HAVE_STRING_H
|
||||
#include <string.h>
|
||||
#endif /* HAVE_STRING_H */
|
||||
#include <sys/types.h>
|
||||
#ifdef HAVE_DIRENT_H
|
||||
#include <dirent.h>
|
||||
#endif /* HAVE_DIRENT_H */
|
||||
|
||||
#include "opal/util/cmd_line.h"
|
||||
#include "opal/util/argv.h"
|
||||
@ -83,7 +82,9 @@
|
||||
/******************
|
||||
* Global Vars
|
||||
******************/
|
||||
#ifndef __WINDOWS__
|
||||
extern char** environ;
|
||||
#endif /* __WINDOWS__ */
|
||||
|
||||
/*******************
|
||||
* Universe/job/vpid information Objects
|
||||
|
@ -26,23 +26,21 @@
|
||||
|
||||
#include <stdio.h>
|
||||
#include <errno.h>
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#include <libgen.h>
|
||||
#endif /* HAVE_UNISTD_H */
|
||||
#ifdef HAVE_STDLIB_H
|
||||
#include <stdlib.h>
|
||||
#endif /* HAVE_STDLIB_H */
|
||||
#ifdef HAVE_SYS_STAT_H
|
||||
#include <sys/stat.h>
|
||||
#endif
|
||||
#ifdef HAVE_LIBGEN_H
|
||||
#include <libgen.h>
|
||||
#endif
|
||||
#endif /* HAVE_SYS_STAT_H */
|
||||
#ifdef HAVE_SYS_TYPES_H
|
||||
#include <sys/types.h>
|
||||
#endif
|
||||
#endif /* HAVE_SYS_TYPES_H */
|
||||
#ifdef HAVE_SYS_WAIT_H
|
||||
#include <sys/wait.h>
|
||||
#endif
|
||||
#endif /* HAVE_SYS_WAIT_H */
|
||||
#ifdef HAVE_STRING_H
|
||||
#include <string.h>
|
||||
#endif /* HAVE_STRING_H */
|
||||
@ -55,6 +53,7 @@
|
||||
#include "opal/util/output.h"
|
||||
#include "opal/util/opal_environ.h"
|
||||
#include "opal/util/os_path.h"
|
||||
#include "opal/util/basename.h"
|
||||
#include "opal/mca/base/base.h"
|
||||
#include "opal/mca/base/mca_base_param.h"
|
||||
#include "opal/mca/crs/crs.h"
|
||||
@ -71,7 +70,10 @@
|
||||
/*****************
|
||||
* Global Vars
|
||||
*****************/
|
||||
|
||||
#ifndef __WINDOWS__
|
||||
extern char **environ;
|
||||
#endif /* __WINDOWS__ */
|
||||
|
||||
/******************
|
||||
* Local Functions
|
||||
@ -170,7 +172,7 @@ main(int argc, char *argv[])
|
||||
|
||||
snapshot = OBJ_NEW(orte_snapc_base_global_snapshot_t);
|
||||
snapshot->reference_name = strdup(orte_restart_globals.filename);
|
||||
snapshot->local_location = dirname(orte_snapc_base_get_global_snapshot_directory(snapshot->reference_name));
|
||||
snapshot->local_location = opal_dirname(orte_snapc_base_get_global_snapshot_directory(snapshot->reference_name));
|
||||
|
||||
/*
|
||||
* Check for existence of the file
|
||||
@ -271,7 +273,8 @@ static int initialize(int argc, char *argv[]) {
|
||||
return exit_status;
|
||||
}
|
||||
|
||||
static int finalize(void) {
|
||||
static int finalize(void)
|
||||
{
|
||||
int ret;
|
||||
|
||||
if (OPAL_SUCCESS != (ret = orte_finalize())) {
|
||||
@ -281,7 +284,8 @@ static int finalize(void) {
|
||||
return ORTE_SUCCESS;
|
||||
}
|
||||
|
||||
static int parse_args(int argc, char *argv[]) {
|
||||
static int parse_args(int argc, char *argv[])
|
||||
{
|
||||
int i, ret, len;
|
||||
opal_cmd_line_t cmd_line;
|
||||
char **app_env = NULL, **global_env = NULL;
|
||||
@ -366,7 +370,8 @@ static int parse_args(int argc, char *argv[]) {
|
||||
return ORTE_SUCCESS;
|
||||
}
|
||||
|
||||
static int check_file(orte_snapc_base_global_snapshot_t *snapshot) {
|
||||
static int check_file(orte_snapc_base_global_snapshot_t *snapshot)
|
||||
{
|
||||
int ret, exit_status = ORTE_SUCCESS;
|
||||
|
||||
opal_output_verbose(10, orte_restart_globals.output,
|
||||
@ -382,7 +387,8 @@ static int check_file(orte_snapc_base_global_snapshot_t *snapshot) {
|
||||
return exit_status;
|
||||
}
|
||||
|
||||
static int create_appfile(orte_snapc_base_global_snapshot_t *snapshot) {
|
||||
static int create_appfile(orte_snapc_base_global_snapshot_t *snapshot)
|
||||
{
|
||||
int ret, exit_status = ORTE_SUCCESS;
|
||||
FILE *appfile = NULL;
|
||||
opal_list_item_t* item = NULL;
|
||||
@ -456,7 +462,8 @@ static int create_appfile(orte_snapc_base_global_snapshot_t *snapshot) {
|
||||
return exit_status;
|
||||
}
|
||||
|
||||
static int spawn_children(orte_snapc_base_global_snapshot_t *snapshot, pid_t *child_pid) {
|
||||
static int spawn_children(orte_snapc_base_global_snapshot_t *snapshot, pid_t *child_pid)
|
||||
{
|
||||
int ret, exit_status = ORTE_SUCCESS;
|
||||
char **argv = NULL;
|
||||
int argc = 0;
|
||||
|
@ -36,9 +36,6 @@
|
||||
#ifdef HAVE_SYS_WAIT_H
|
||||
#include <sys/wait.h>
|
||||
#endif /* HAVE_SYS_WAIT_H */
|
||||
#ifdef HAVE_LIBGEN_H
|
||||
#include <libgen.h>
|
||||
#endif
|
||||
|
||||
#include "opal/event/event.h"
|
||||
#include "opal/install_dirs.h"
|
||||
|
@ -296,14 +296,15 @@ int main(int argc, char *argv[])
|
||||
free(args);
|
||||
return 1;
|
||||
}
|
||||
|
||||
#if !defined(__WINDOWS__)
|
||||
/* see if we were directed to separate from current session */
|
||||
if (orted_globals.set_sid) {
|
||||
setsid();
|
||||
}
|
||||
|
||||
#endif /* !defined(__WINDOWS__) */
|
||||
/* see if they want us to spin until they can connect a debugger to us */
|
||||
i=0;
|
||||
/*orted_globals.spin = 1;*/
|
||||
while (orted_globals.spin) {
|
||||
i++;
|
||||
if (1000 < i) i=0;
|
||||
|
@ -37,9 +37,6 @@
|
||||
#ifdef HAVE_SYS_WAIT_H
|
||||
#include <sys/wait.h>
|
||||
#endif /* HAVE_SYS_WAIT_H */
|
||||
#ifdef HAVE_LIBGEN_H
|
||||
#include <libgen.h>
|
||||
#endif
|
||||
|
||||
#include "opal/event/event.h"
|
||||
#include "opal/install_dirs.h"
|
||||
|
@ -36,9 +36,6 @@
|
||||
#ifdef HAVE_SYS_WAIT_H
|
||||
#include <sys/wait.h>
|
||||
#endif /* HAVE_SYS_WAIT_H */
|
||||
#ifdef HAVE_LIBGEN_H
|
||||
#include <libgen.h>
|
||||
#endif
|
||||
|
||||
#include "opal/event/event.h"
|
||||
#include "opal/install_dirs.h"
|
||||
|
@ -37,12 +37,9 @@
|
||||
#ifdef HAVE_SYS_WAIT_H
|
||||
#include <sys/wait.h>
|
||||
#endif /* HAVE_SYS_WAIT_H */
|
||||
#ifdef HAVE_LIBGEN_H
|
||||
#include <libgen.h>
|
||||
#endif
|
||||
#ifdef HAVE_SYS_TIME_H
|
||||
#include <sys/time.h>
|
||||
#endif
|
||||
#endif /* HAVE_SYS_TIME_H */
|
||||
|
||||
#include "opal/event/event.h"
|
||||
#include "opal/install_dirs.h"
|
||||
|
@ -26,23 +26,20 @@
|
||||
#include <stddef.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#ifdef HAVE_LIBGEN_H
|
||||
#include <libgen.h>
|
||||
#endif
|
||||
#ifdef HAVE_SYS_PARAM_H
|
||||
#include <sys/param.h>
|
||||
#endif
|
||||
#endif /* HAVE_SYS_PARAM_H */
|
||||
#ifdef HAVE_SYS_TYPES_H
|
||||
#include <sys/types.h>
|
||||
#endif
|
||||
#endif /* HAVE_SYS_TYPES_H */
|
||||
#include <sys/stat.h>
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
#endif /* HAVE_UNISTD_H */
|
||||
#include <errno.h>
|
||||
#ifdef HAVE_DIRENT_H
|
||||
#include <dirent.h>
|
||||
#endif
|
||||
#endif /* HAVE_DIRENT_H */
|
||||
|
||||
#include "orte/orte_constants.h"
|
||||
|
||||
@ -82,11 +79,7 @@ static bool orte_dir_check_file(const char *root, const char *path);
|
||||
*/
|
||||
static int orte_create_dir(char *directory)
|
||||
{
|
||||
#ifndef __WINDOWS__
|
||||
mode_t my_mode = S_IRWXU; /* at the least, I need to be able to do anything */
|
||||
#else
|
||||
mode_t my_mode = _S_IREAD | _S_IWRITE | _S_IEXEC;
|
||||
#endif
|
||||
mode_t my_mode = S_IRWXU; /* I'm looking for full rights */
|
||||
int ret;
|
||||
|
||||
/* Sanity check before creating the directory with the proper mode,
|
||||
|
@ -20,14 +20,11 @@
|
||||
#include <string.h>
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
#ifdef HAVE_LIBGEN_H
|
||||
#include <libgen.h>
|
||||
#endif
|
||||
#endif /* HAVE_UNISTD_H */
|
||||
#include <stdlib.h>
|
||||
#ifdef HAVE_PWD_H
|
||||
#include <pwd.h>
|
||||
#endif
|
||||
#endif /* HAVE_PWD_H */
|
||||
#include <sys/stat.h>
|
||||
|
||||
|
||||
|
@ -20,14 +20,11 @@
|
||||
#include <string.h>
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
#ifdef HAVE_LIBGEN_H
|
||||
#include <libgen.h>
|
||||
#endif
|
||||
#endif /* HAVE_UNISTD_H */
|
||||
#include <stdlib.h>
|
||||
#ifdef HAVE_PWD_H
|
||||
#include <pwd.h>
|
||||
#endif
|
||||
#endif /* HAVE_PWD_H */
|
||||
#include <sys/stat.h>
|
||||
|
||||
|
||||
|
@ -23,13 +23,10 @@
|
||||
#include <stdlib.h>
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
#ifdef HAVE_LIBGEN_H
|
||||
#include <libgen.h>
|
||||
#endif
|
||||
#endif /* HAVE_UNISTD_H */
|
||||
#ifdef HAVE_SYS_PARAM_H
|
||||
#include <sys/param.h>
|
||||
#endif
|
||||
#endif /* HAVE_SYS_PARAM_H */
|
||||
#include <sys/stat.h>
|
||||
|
||||
#include "support.h"
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user