1
1

Complete the cleanup of the preload files system. Remove the dest_dir option as moving things to arbitrary locations - especially absolute paths - can prove disastrous. Remove the preload_libs option as these can be treated as just files. Cleanup some of the pack/unpack code as the dss handles NULL strings just fine. Deal a little better with absolute paths, noting that tar now strips the leading '/' for us (showing my age as it didn't used to do so).

Remove the odls_base_state.c file as that code is now covered by the new broadcast form of preload_files.

This commit was SVN r27127.
Этот коммит содержится в:
Ralph Castain 2012-08-24 02:28:29 +00:00
родитель c8b511d18a
Коммит e0c39c94e8
15 изменённых файлов: 160 добавлений и 716 удалений

Просмотреть файл

@ -1315,30 +1315,12 @@ static int spawn(int count, char **array_of_commands,
app->preload_binary = true;
}
/* check for 'preload_libraries' */
ompi_info_get_bool(array_of_info[i], "ompi_preload_libraries", &local_spawn, &flag);
if ( flag ) {
app->preload_libs = true;
}
/* check for 'preload_files' */
ompi_info_get (array_of_info[i], "ompi_preload_files", sizeof(cwd) - 1, cwd, &flag);
if ( flag ) {
app->preload_files = strdup(cwd);
}
/* check for 'preload_files_dest_dir' */
ompi_info_get (array_of_info[i], "ompi_preload_files_dest_dir", sizeof(cwd) - 1, cwd, &flag);
if ( flag ) {
app->preload_files_dest_dir = strdup(cwd);
}
/* check for 'preload_files_src_dir' */
ompi_info_get (array_of_info[i], "ompi_preload_files_src_dir", sizeof(cwd) - 1, cwd, &flag);
if ( flag ) {
app->preload_files_src_dir = strdup(cwd);
}
/* see if this is a non-mpi job - if so, then set the flag so ORTE
* knows what to do
*/
@ -1369,21 +1351,16 @@ static int spawn(int count, char **array_of_commands,
}
/* default value: If the user did not tell us where to look for the
* executable, we assume the current working directory, or the preload destination
* if it was given
* executable, we assume the current working directory
*/
if ( !have_wdir ) {
if (NULL != app->preload_files_dest_dir) {
app->cwd = strdup(app->preload_files_dest_dir);
} else {
if (OMPI_SUCCESS != (rc = opal_getcwd(cwd, OPAL_PATH_MAX))) {
ORTE_ERROR_LOG(rc);
OBJ_RELEASE(jdata);
opal_progress_event_users_decrement();
return rc;
}
app->cwd = strdup(cwd);
if (OMPI_SUCCESS != (rc = opal_getcwd(cwd, OPAL_PATH_MAX))) {
ORTE_ERROR_LOG(rc);
OBJ_RELEASE(jdata);
opal_progress_event_users_decrement();
return rc;
}
app->cwd = strdup(cwd);
}
/* leave the map info alone - the launcher will

Просмотреть файл

@ -501,9 +501,6 @@ int orte_errmgr_base_update_app_context_for_cr_recovery(orte_job_t *jobdata,
new_app_context->prefix_dir = (NULL == cur_app_context->prefix_dir ? NULL :
strdup(cur_app_context->prefix_dir));
new_app_context->preload_binary = false;
new_app_context->preload_libs = false;
new_app_context->preload_files_dest_dir = NULL;
new_app_context->preload_files_src_dir = NULL;
asprintf(&tmp_str, reference_fmt_str, vpid_snapshot->process_name.vpid);
asprintf(&(new_app_context->sstore_load),

Просмотреть файл

@ -42,7 +42,6 @@ typedef struct {
opal_event_t ev;
bool pending;
char *file;
char *target;
int32_t type;
int32_t nchunk;
int status;

Просмотреть файл

@ -317,10 +317,11 @@ static int raw_preposition_files(orte_job_t *jdata,
if (opal_path_is_absolute(app->app)) {
cptr = opal_basename(app->app);
free(app->app);
app->app = cptr;
asprintf(&app->app, "./%s", cptr);
free(app->argv[0]);
app->argv[0] = strdup(cptr);
app->argv[0] = strdup(app->app);
}
fs->remote_target = strdup(app->app);
}
if (NULL != app->preload_files) {
files = opal_argv_split(app->preload_files, ',');
@ -353,14 +354,30 @@ static int raw_preposition_files(orte_job_t *jdata,
} else {
fs->target_flag = ORTE_FILEM_TYPE_FILE;
}
if (NULL != app->preload_files_dest_dir) {
fs->remote_target = opal_os_path(false, app->preload_files_dest_dir, files[i], NULL);
/* if this was an absolute path, then we need
* to convert it to a relative path - we do not
* allow positioning of files to absolute locations
* due to the potential for unintentional overwriting
* of files
*/
if (opal_path_is_absolute(files[i])) {
fs->remote_target = strdup(&files[i][1]);
} else {
fs->remote_target = strdup(files[i]);
}
opal_list_append(&fsets, &fs->super);
}
opal_argv_free(files);
}
}
if (0 == opal_list_get_size(&fsets)) {
/* nothing to preposition */
if (NULL != cbfunc) {
cbfunc(ORTE_SUCCESS, cbdata);
}
OBJ_DESTRUCT(&fsets);
return ORTE_SUCCESS;
}
/* track the outbound file sets */
outbound = OBJ_NEW(orte_filem_raw_outbound_t);
@ -394,9 +411,16 @@ static int raw_preposition_files(orte_job_t *jdata,
"%s filem:raw: setting up to position file %s",
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME), fs->local_target));
xfer = OBJ_NEW(orte_filem_raw_xfer_t);
xfer->file = strdup(fs->local_target);
if (NULL != fs->remote_target) {
xfer->target = strdup(fs->remote_target);
/* if the remote target starts with "./", then we need to remove
* that prefix
*/
if (0 == strncmp(fs->remote_target, "./", 2) ||
0 == strncmp(fs->remote_target, "../", 3)) {
cptr = strchr(fs->remote_target, '/');
++cptr; /* step over the '/' */
xfer->file = strdup(cptr);
} else {
xfer->file = strdup(fs->remote_target);
}
xfer->type = fs->target_flag;
xfer->outbound = outbound;
@ -429,8 +453,9 @@ static int create_link(char *my_dir, char *path,
*/
if (0 != stat(fullname, &buf)) {
OPAL_OUTPUT_VERBOSE((1, orte_filem_base_output,
"%s filem:raw: creating symlink to %s",
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME), link_pt));
"%s filem:raw: creating symlink to %s\n\tmypath: %s\n\tlink: %s",
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME), link_pt,
mypath, fullname));
/* do the symlink */
if (0 != symlink(mypath, fullname)) {
opal_output(0, "%s Failed to symlink %s to %s",
@ -481,9 +506,7 @@ static int raw_link_local_files(orte_job_t *jdata)
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME),
ORTE_NAME_PRINT(&proc->name)));
/* get the session dir name in absolute form - create it
* if it doesn't already exist
*/
/* get the session dir name in absolute form */
rc = orte_session_dir_get_name(&path, &prefix, NULL,
orte_process_info.nodename,
NULL, &proc->name);
@ -591,18 +614,13 @@ static void send_chunk(int fd, short argc, void *cbdata)
close(fd);
return;
}
/* if it is the first chunk, then add file type and target path */
/* if it is the first chunk, then add file type */
if (0 == rev->nchunk) {
if (OPAL_SUCCESS != (rc = opal_dss.pack(&chunk, &rev->type, 1, OPAL_INT32))) {
ORTE_ERROR_LOG(rc);
close(fd);
return;
}
if (OPAL_SUCCESS != (rc = opal_dss.pack(&chunk, &rev->target, 1, OPAL_STRING))) {
ORTE_ERROR_LOG(rc);
close(fd);
return;
}
}
/* xcast this chunk to all daemons */
@ -703,12 +721,6 @@ static int link_archive(orte_filem_raw_incoming_t *inbnd)
"%s filem:raw: path %s",
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME),
path));
/* if it is an absolute path, then do nothing - the user
* is responsible for knowing where it went
*/
if (opal_path_is_absolute(path)) {
continue;
}
/* take the first element of the path as our
* link point
*/
@ -734,7 +746,6 @@ static void recv_files(int status, orte_process_name_t* sender,
orte_filem_raw_incoming_t *ptr, *incoming;
opal_list_item_t *item;
int32_t type;
char *target=NULL;
char *tmp, *cptr;
/* unpack the data */
@ -773,13 +784,6 @@ static void recv_files(int status, orte_process_name_t* sender,
free(file);
return;
}
n=1;
if (OPAL_SUCCESS != (rc = opal_dss.unpack(buffer, &target, &n, OPAL_STRING))) {
ORTE_ERROR_LOG(rc);
send_complete(file, rc);
free(file);
return;
}
}
OPAL_OUTPUT_VERBOSE((1, orte_filem_base_output,
@ -805,66 +809,24 @@ static void recv_files(int status, orte_process_name_t* sender,
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME), file);
send_complete(file, ORTE_ERR_FILE_WRITE_FAILURE);
free(file);
if (NULL != target) {
free(target);
}
return;
}
/* nope - add it */
incoming = OBJ_NEW(orte_filem_raw_incoming_t);
incoming->file = strdup(file);
incoming->type = type;
/* define the full filename to point to the absolute location */
if (NULL == target) {
/* if it starts with "./", then we need to remove
* that prefix
*/
if (0 == strncmp(file, "./", 2) ||
0 == strncmp(file, "../", 3)) {
cptr = strchr(file, '/');
++cptr; /* step over the '/' */
tmp = strdup(cptr);
} else {
tmp = strdup(file);
}
/* separate out the top-level directory of the target */
if (NULL != (cptr = strchr(tmp, '/'))) {
*cptr = '\0';
}
/* save it */
incoming->top = strdup(tmp);
free(tmp);
/* define the full path to where we will put it */
jobfam_dir = opal_dirname(orte_process_info.job_session_dir);
incoming->fullpath = opal_os_path(false, jobfam_dir, file, NULL);
free(jobfam_dir);
} else if (opal_path_is_absolute(target)) {
incoming->top = strdup(target);
incoming->fullpath = strdup(target);
} else {
/* if it starts with "./", then we need to remove
* that prefix
*/
if (0 == strncmp(target, "./", 2) ||
0 == strncmp(target, "../", 3)) {
cptr = strchr(target, '/');
++cptr; /* step over the '/' */
tmp = strdup(cptr);
} else {
tmp = strdup(target);
}
/* separate out the top-level directory of the target */
if (NULL != (cptr = strchr(tmp, '/'))) {
*cptr = '\0';
}
/* save it */
incoming->top = strdup(tmp);
free(tmp);
/* define the full path to where we will put it */
jobfam_dir = opal_dirname(orte_process_info.job_session_dir);
incoming->fullpath = opal_os_path(false, jobfam_dir, target, NULL);
free(jobfam_dir);
/* separate out the top-level directory of the target */
tmp = strdup(file);
if (NULL != (cptr = strchr(tmp, '/'))) {
*cptr = '\0';
}
/* save it */
incoming->top = strdup(tmp);
free(tmp);
/* define the full path to where we will put it */
jobfam_dir = opal_dirname(orte_process_info.job_session_dir);
incoming->fullpath = opal_os_path(false, jobfam_dir, file, NULL);
free(jobfam_dir);
OPAL_OUTPUT_VERBOSE((1, orte_filem_base_output,
"%s filem:raw: opening target file %s",
@ -877,9 +839,6 @@ static void recv_files(int status, orte_process_name_t* sender,
free(file);
free(tmp);
OBJ_RELEASE(incoming);
if (NULL != target) {
free(target);
}
return;
}
/* open the file descriptor for writing */
@ -889,9 +848,6 @@ static void recv_files(int status, orte_process_name_t* sender,
incoming->fullpath);
send_complete(file, ORTE_ERR_FILE_WRITE_FAILURE);
free(file);
if (NULL != target) {
free(target);
}
return;
}
OPAL_OUTPUT_VERBOSE((1, orte_filem_base_output,
@ -923,9 +879,6 @@ static void recv_files(int status, orte_process_name_t* sender,
/* cleanup */
free(file);
if (NULL != target) {
free(target);
}
}
@ -955,18 +908,12 @@ static void write_handler(int fd, short event, void *cbdata)
"%s write:handler zero bytes - reporting complete for file %s",
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME),
sink->file));
send_complete(sink->file, ORTE_SUCCESS);
if (ORTE_FILEM_TYPE_FILE == sink->type) {
/* if it is an absolute path, then no link is required - the
* user is responsible for correctly pointing at it
*
* if it is a file and not an absolute path,
* then just link to the top as this will be the
/* just link to the top as this will be the
* name we will want in each proc's session dir
*/
if (!opal_path_is_absolute(sink->top)) {
opal_argv_append_nosize(&sink->link_pts, sink->top);
}
opal_argv_append_nosize(&sink->link_pts, sink->top);
send_complete(sink->file, ORTE_SUCCESS);
} else {
/* unarchive the file */
if (ORTE_FILEM_TYPE_TAR == sink->type) {
@ -991,6 +938,8 @@ static void write_handler(int fd, short event, void *cbdata)
if (ORTE_SUCCESS != (rc = link_archive(sink))) {
ORTE_ERROR_LOG(rc);
send_complete(sink->file, ORTE_ERR_FILE_WRITE_FAILURE);
} else {
send_complete(sink->file, ORTE_SUCCESS);
}
}
return;
@ -1043,7 +992,6 @@ static void xfer_construct(orte_filem_raw_xfer_t *ptr)
{
ptr->pending = false;
ptr->file = NULL;
ptr->target = NULL;
ptr->nchunk = 0;
ptr->status = ORTE_SUCCESS;
ptr->nrecvd = 0;
@ -1056,9 +1004,6 @@ static void xfer_destruct(orte_filem_raw_xfer_t *ptr)
if (NULL != ptr->file) {
free(ptr->file);
}
if (NULL != ptr->target) {
free(ptr->target);
}
}
OBJ_CLASS_INSTANCE(orte_filem_raw_xfer_t,
opal_list_item_t,

Просмотреть файл

@ -9,6 +9,8 @@
# University of Stuttgart. All rights reserved.
# Copyright (c) 2004-2005 The Regents of the University of California.
# All rights reserved.
# Copyright (c) 2012 Los Alamos National Security, LLC.
# All rights reserved
# $COPYRIGHT$
#
# Additional copyrights may follow
@ -17,21 +19,13 @@
#
headers += \
base/base.h
libmca_odls_la_SOURCES += \
base/odls_base_open.c
if !ORTE_DISABLE_FULL_SUPPORT
dist_pkgdata_DATA += base/help-orte-odls-base.txt
headers += \
base/base.h \
base/odls_private.h
libmca_odls_la_SOURCES += \
base/odls_base_open.c \
base/odls_base_close.c \
base/odls_base_select.c \
base/odls_base_default_fns.c \
base/odls_base_state.c
endif
base/odls_base_default_fns.c
dist_pkgdata_DATA += base/help-orte-odls-base.txt

Просмотреть файл

@ -1,287 +0,0 @@
/*
* Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana
* University Research and Technology
* Corporation. All rights reserved.
* Copyright (c) 2004-2011 The University of Tennessee and The University
* of Tennessee Research Foundation. All rights
* reserved.
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
#include "orte_config.h"
#include "orte/constants.h"
#ifdef HAVE_STRING_H
#include <string.h>
#endif
#ifdef HAVE_SYS_PARAM_H
#include <sys/param.h>
#endif
#ifdef HAVE_NETDB_H
#include <netdb.h>
#endif
#include "opal/util/argv.h"
#include "orte/util/show_help.h"
#include "orte/runtime/orte_globals.h"
#include "opal/util/basename.h"
#include "orte/util/name_fns.h"
#include "orte/util/proc_info.h"
#include "orte/mca/errmgr/errmgr.h"
#include "orte/mca/filem/filem.h"
#include "orte/mca/filem/base/base.h"
#include "orte/mca/odls/base/base.h"
#include "orte/mca/odls/base/odls_private.h"
/*
* Preload all files for a single app context
*/
static int orte_odls_base_preload_append_binary(orte_app_context_t* context,
orte_filem_base_request_t *filem_request);
static int orte_odls_base_preload_append_files(orte_app_context_t* context,
orte_filem_base_request_t *filem_request);
static bool orte_odls_base_is_preload_local_dup(char *local_ref,
orte_filem_base_request_t *filem_request);
int orte_odls_base_preload_files_app_context(orte_app_context_t* app_context)
{
int ret, exit_status = ORTE_SUCCESS;
orte_filem_base_request_t *filem_request;
orte_filem_base_process_set_t *p_set = NULL;
/* Sanity Check - Make sure there are files to preload */
if(!app_context->preload_binary &&
NULL == app_context->preload_files) {
return exit_status;
}
filem_request = OBJ_NEW(orte_filem_base_request_t);
/* Define the process set */
p_set = OBJ_NEW(orte_filem_base_process_set_t);
if( ORTE_PROC_IS_HNP ) {
/* if I am the HNP, then use me as the source */
p_set->source.jobid = ORTE_PROC_MY_NAME->jobid;
p_set->source.vpid = ORTE_PROC_MY_NAME->vpid;
}
else {
/* otherwise, set the HNP as the source */
p_set->source.jobid = ORTE_PROC_MY_HNP->jobid;
p_set->source.vpid = ORTE_PROC_MY_HNP->vpid;
}
p_set->sink.jobid = ORTE_PROC_MY_NAME->jobid;
p_set->sink.vpid = ORTE_PROC_MY_NAME->vpid;
opal_list_append(&(filem_request->process_sets), &(p_set->super) );
if(app_context->preload_binary) {
OPAL_OUTPUT_VERBOSE((1, orte_odls_globals.output,
"%s) Preload Binary...",
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME)));
if( ORTE_SUCCESS != (ret = orte_odls_base_preload_append_binary(app_context,
filem_request) ) ){
orte_show_help("help-orte-odls-base.txt",
"orte-odls-base:could-not-preload-binary",
true, app_context->app);
ORTE_ERROR_LOG(ret);
exit_status = ret;
/* Keep accumulating files anyway */
}
}
if( NULL != app_context->preload_files) {
OPAL_OUTPUT_VERBOSE((1, orte_odls_globals.output,
"%s) Preload Files... [%s]",
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME),
app_context->preload_files));
if( ORTE_SUCCESS != (ret = orte_odls_base_preload_append_files(app_context,
filem_request) ) ){
orte_show_help("help-orte-odls-base.txt",
"orte-odls-base:could-not-preload-files",
true, app_context->preload_files);
ORTE_ERROR_LOG(ret);
exit_status = ret;
/* Keep accumulating files anyway */
}
}
/* Actually bring over the files - One app context at a time
* JJH: This could be improved for multiple app contexts by making
* this a non-blocking filem get and then waiting on all of
* the requests for all app contexts.
*/
if( ORTE_SUCCESS != (ret = orte_filem.get(filem_request)) ) {
orte_show_help("help-orte-odls-base.txt",
"orte-odls-base:could-not-preload",
true,
(app_context->preload_binary ? app_context->app : ""),
(NULL != app_context->preload_files ? app_context->preload_files : ""));
ORTE_ERROR_LOG(ret);
exit_status = ret;
goto cleanup;
}
cleanup:
if( NULL != filem_request ) {
OBJ_RELEASE(filem_request);
filem_request = NULL;
}
return exit_status;
}
/*
* The difference between preloading a file, and a binary file is that
* we may need to update the app_context to reflect the placement of the binary file
* on the local machine.
*/
static int orte_odls_base_preload_append_binary(orte_app_context_t* context,
orte_filem_base_request_t *filem_request) {
char * local_bin = NULL;
orte_filem_base_file_set_t * f_set = NULL;
f_set = OBJ_NEW(orte_filem_base_file_set_t);
/* Local Placement */
asprintf(&local_bin, "%s/%s", orte_process_info.job_session_dir, opal_basename(context->app));
if(orte_odls_base_is_preload_local_dup(local_bin, filem_request) ) {
goto cleanup;
}
f_set->local_target = strdup(local_bin);
/* Remote reference */
f_set->remote_target = strdup(context->app);
/* Flag as a single file */
f_set->target_flag = ORTE_FILEM_TYPE_FILE;
/* Add to the request list */
opal_list_append(&(filem_request->file_sets), &(f_set->super) );
cleanup:
/*
* Adjust the process name to point to the new local version (and argv[0])
*/
if( NULL != local_bin ) {
if(NULL != context->app) {
free(context->app);
context->app = NULL;
}
if(NULL != context->argv[0]) {
free(context->argv[0]);
context->argv[0] = NULL;
}
context->app = strdup(local_bin);
context->argv[0] = strdup(local_bin);
free(local_bin);
}
return ORTE_SUCCESS;
}
static int orte_odls_base_preload_append_files(orte_app_context_t* context,
orte_filem_base_request_t *filem_request) {
char * local_ref = NULL;
int i, remote_argc = 0;
char **remote_targets = NULL;
orte_filem_base_file_set_t * f_set = NULL;
remote_targets = opal_argv_split(context->preload_files, ',');
remote_argc = opal_argv_count(remote_targets);
for(i = 0; i < remote_argc; ++i) {
if(NULL != context->preload_files_dest_dir) {
if(context->preload_files_dest_dir[0] == '.') {
asprintf(&local_ref, "%s/%s/%s", context->cwd, context->preload_files_dest_dir, opal_basename(remote_targets[i]) );
}
else {
asprintf(&local_ref, "%s/%s", context->preload_files_dest_dir, opal_basename(remote_targets[i]) );
}
}
else {
/*
* If the preload_files_dest_dir is not specified
* If this is an absolute path, copy it to that path. Otherwise copy it to the cwd.
*/
if('/' == remote_targets[i][0]) {
asprintf(&local_ref, "%s", remote_targets[i]);
} else {
asprintf(&local_ref, "%s/%s", context->cwd, remote_targets[i] );
}
/* If this is the HNP, then source = sink, so use the same path for each local and remote */
if( ORTE_PROC_IS_HNP ) {
free(remote_targets[i]);
remote_targets[i] = strdup(local_ref);
}
}
/*
* Is this a duplicate
*/
if(orte_odls_base_is_preload_local_dup(local_ref, filem_request) ) {
free(local_ref);
local_ref = NULL;
continue;
}
f_set = OBJ_NEW(orte_filem_base_file_set_t);
/* Local Placement */
f_set->local_target = strdup(local_ref);
/* Remote reference */
f_set->remote_target = strdup(remote_targets[i]);
/* Flag as unknown, let FileM figure it out */
f_set->target_flag = ORTE_FILEM_TYPE_UNKNOWN;
/* Add to the request list */
opal_list_append(&(filem_request->file_sets), &(f_set->super) );
free(local_ref);
local_ref = NULL;
}
if(NULL != local_ref)
free(local_ref);
if(NULL != remote_targets)
opal_argv_free(remote_targets);
return ORTE_SUCCESS;
}
/*
* Keeps us from transfering the same file more than once.
*/
static bool orte_odls_base_is_preload_local_dup(char *local_ref,
orte_filem_base_request_t *filem_request) {
opal_list_item_t *item = NULL;
for (item = opal_list_get_first( &filem_request->file_sets);
item != opal_list_get_end( &filem_request->file_sets);
item = opal_list_get_next( item) ) {
orte_filem_base_file_set_t * f_set = (orte_filem_base_file_set_t*)item;
if(0 == strncmp(local_ref, f_set->local_target, strlen(local_ref)+1) ) {
return true;
}
}
return false;
}

Просмотреть файл

@ -9,8 +9,8 @@
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2011 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2011 Los Alamos National Security, LLC.
* Copyright (c) 2011 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2011-2012 Los Alamos National Security, LLC.
* All rights reserved.
* $COPYRIGHT$
*
@ -181,20 +181,11 @@ int orte_dt_copy_app_context(orte_app_context_t **dest, orte_app_context_t *src,
}
(*dest)->preload_binary = src->preload_binary;
(*dest)->preload_libs = src->preload_libs;
if( NULL != src->preload_files) {
(*dest)->preload_files = strdup(src->preload_files);
}
if( NULL != src->preload_files_dest_dir) {
(*dest)->preload_files_dest_dir = strdup(src->preload_files_dest_dir);
}
if( NULL != src->preload_files_src_dir) {
(*dest)->preload_files_src_dir = strdup(src->preload_files_src_dir);
}
(*dest)->recovery_defined = src->recovery_defined;
(*dest)->max_restarts = src->max_restarts;

Просмотреть файл

@ -491,10 +491,10 @@ int orte_dt_pack_proc(opal_buffer_t *buffer, const void *src,
* APP CONTEXT
*/
int orte_dt_pack_app_context(opal_buffer_t *buffer, const void *src,
int32_t num_vals, opal_data_type_t type)
int32_t num_vals, opal_data_type_t type)
{
int rc;
int8_t have_prefix, have_preload_files, have_preload_files_dest_dir, user_specified;
int8_t user_specified;
int32_t i, count;
orte_app_context_t **app_context;
@ -504,28 +504,28 @@ int orte_dt_pack_app_context(opal_buffer_t *buffer, const void *src,
for (i=0; i < num_vals; i++) {
/* pack the application index (for multiapp jobs) */
if (ORTE_SUCCESS != (rc = opal_dss_pack_buffer(buffer,
(void*)(&(app_context[i]->idx)), 1, ORTE_STD_CNTR))) {
(void*)(&(app_context[i]->idx)), 1, ORTE_STD_CNTR))) {
ORTE_ERROR_LOG(rc);
return rc;
}
/* pack the application name */
if (ORTE_SUCCESS != (rc = opal_dss_pack_buffer(buffer,
(void*)(&(app_context[i]->app)), 1, OPAL_STRING))) {
(void*)(&(app_context[i]->app)), 1, OPAL_STRING))) {
ORTE_ERROR_LOG(rc);
return rc;
}
/* pack the number of processes */
if (ORTE_SUCCESS != (rc = opal_dss_pack_buffer(buffer,
(void*)(&(app_context[i]->num_procs)), 1, ORTE_STD_CNTR))) {
(void*)(&(app_context[i]->num_procs)), 1, ORTE_STD_CNTR))) {
ORTE_ERROR_LOG(rc);
return rc;
}
/* pack the first rank for this app */
if (ORTE_SUCCESS != (rc = opal_dss_pack_buffer(buffer,
(void*)(&(app_context[i]->first_rank)), 1, ORTE_VPID))) {
(void*)(&(app_context[i]->first_rank)), 1, ORTE_VPID))) {
ORTE_ERROR_LOG(rc);
return rc;
}
@ -540,7 +540,7 @@ int orte_dt_pack_app_context(opal_buffer_t *buffer, const void *src,
/* if there are entries, pack the argv entries */
if (0 < count) {
if (ORTE_SUCCESS != (rc = opal_dss_pack_buffer(buffer,
(void*)(app_context[i]->argv), count, OPAL_STRING))) {
(void*)(app_context[i]->argv), count, OPAL_STRING))) {
ORTE_ERROR_LOG(rc);
return rc;
}
@ -556,7 +556,7 @@ int orte_dt_pack_app_context(opal_buffer_t *buffer, const void *src,
/* if there are entries, pack the enviro entries */
if (0 < count) {
if (ORTE_SUCCESS != (rc = opal_dss_pack_buffer(buffer,
(void*)(app_context[i]->env), count, OPAL_STRING))) {
(void*)(app_context[i]->env), count, OPAL_STRING))) {
ORTE_ERROR_LOG(rc);
return rc;
}
@ -564,7 +564,7 @@ int orte_dt_pack_app_context(opal_buffer_t *buffer, const void *src,
/* pack the cwd */
if (ORTE_SUCCESS != (rc = opal_dss_pack_buffer(buffer,
(void*)(&(app_context[i]->cwd)), 1, OPAL_STRING))) {
(void*)(&(app_context[i]->cwd)), 1, OPAL_STRING))) {
ORTE_ERROR_LOG(rc);
return rc;
}
@ -576,7 +576,7 @@ int orte_dt_pack_app_context(opal_buffer_t *buffer, const void *src,
user_specified = 0;
}
if (ORTE_SUCCESS != (rc = opal_dss_pack_buffer(buffer,
(void*)(&user_specified), 1, OPAL_INT8))) {
(void*)(&user_specified), 1, OPAL_INT8))) {
ORTE_ERROR_LOG(rc);
return rc;
}
@ -588,21 +588,21 @@ int orte_dt_pack_app_context(opal_buffer_t *buffer, const void *src,
user_specified = 0;
}
if (ORTE_SUCCESS != (rc = opal_dss_pack_buffer(buffer,
(void*)(&user_specified), 1, OPAL_INT8))) {
(void*)(&user_specified), 1, OPAL_INT8))) {
ORTE_ERROR_LOG(rc);
return rc;
}
/* pack the hostfile name */
if (ORTE_SUCCESS != (rc = opal_dss_pack_buffer(buffer,
(void*)(&(app_context[i]->hostfile)), 1, OPAL_STRING))) {
(void*)(&(app_context[i]->hostfile)), 1, OPAL_STRING))) {
ORTE_ERROR_LOG(rc);
return rc;
}
/* pack the add_hostfile name */
if (ORTE_SUCCESS != (rc = opal_dss_pack_buffer(buffer,
(void*)(&(app_context[i]->add_hostfile)), 1, OPAL_STRING))) {
(void*)(&(app_context[i]->add_hostfile)), 1, OPAL_STRING))) {
ORTE_ERROR_LOG(rc);
return rc;
}
@ -617,7 +617,7 @@ int orte_dt_pack_app_context(opal_buffer_t *buffer, const void *src,
/* if there are entries, pack the argv entries */
if (0 < count) {
if (ORTE_SUCCESS != (rc = opal_dss_pack_buffer(buffer,
(void*)(app_context[i]->add_host), count, OPAL_STRING))) {
(void*)(app_context[i]->add_host), count, OPAL_STRING))) {
ORTE_ERROR_LOG(rc);
return rc;
}
@ -630,116 +630,38 @@ int orte_dt_pack_app_context(opal_buffer_t *buffer, const void *src,
return rc;
}
/* if there are entries, pack the argv entries */
/* if there are entries, pack the dash_host entries */
if (0 < count) {
if (ORTE_SUCCESS != (rc = opal_dss_pack_buffer(buffer,
(void*)(app_context[i]->dash_host), count, OPAL_STRING))) {
(void*)(app_context[i]->dash_host), count, OPAL_STRING))) {
ORTE_ERROR_LOG(rc);
return rc;
}
}
/* pack the prefix dir if we have one */
if (NULL != app_context[i]->prefix_dir) {
have_prefix = 1;
} else {
have_prefix = 0;
}
/* pack the prefix dir */
if (ORTE_SUCCESS != (rc = opal_dss_pack_buffer(buffer,
(void*)(&have_prefix), 1, OPAL_INT8))) {
ORTE_ERROR_LOG(rc);
return rc;
}
if (have_prefix) {
if (ORTE_SUCCESS != (rc = opal_dss_pack_buffer(buffer,
(void*)(&(app_context[i]->prefix_dir)), 1, OPAL_STRING))) {
ORTE_ERROR_LOG(rc);
return rc;
}
}
if (ORTE_SUCCESS != (rc = opal_dss_pack_buffer(buffer,
(void*)(&(app_context[i]->preload_binary)), 1, OPAL_BOOL))) {
ORTE_ERROR_LOG(rc);
return rc;
}
if (ORTE_SUCCESS != (rc = opal_dss_pack_buffer(buffer,
(void*)(&(app_context[i]->preload_libs)), 1, OPAL_BOOL))) {
(void*)(&(app_context[i]->prefix_dir)), 1, OPAL_STRING))) {
ORTE_ERROR_LOG(rc);
return rc;
}
/* Pack the preload_files if we have one */
if (NULL != app_context[i]->preload_files) {
have_preload_files = 1;
} else {
have_preload_files = 0;
}
if (ORTE_SUCCESS != (rc = opal_dss_pack_buffer(buffer,
(void*)(&have_preload_files), 1, OPAL_INT8))) {
(void*)(&(app_context[i]->preload_binary)), 1, OPAL_BOOL))) {
ORTE_ERROR_LOG(rc);
return rc;
}
if( have_preload_files) {
if( NULL != app_context[i]->preload_files) {
if (ORTE_SUCCESS != (rc = opal_dss_pack_buffer(buffer,
(void*)(&(app_context[i]->preload_files)), 1, OPAL_STRING))) {
ORTE_ERROR_LOG(rc);
return rc;
}
}
}
/* Pack the preload_files_dest_dir if we have one */
if (NULL != app_context[i]->preload_files_dest_dir) {
have_preload_files_dest_dir = 1;
} else {
have_preload_files_dest_dir = 0;
}
/* Pack the preload_files */
if (ORTE_SUCCESS != (rc = opal_dss_pack_buffer(buffer,
(void*)(&have_preload_files_dest_dir), 1, OPAL_INT8))) {
(void*)(&(app_context[i]->preload_files)), 1, OPAL_STRING))) {
ORTE_ERROR_LOG(rc);
return rc;
}
if( have_preload_files_dest_dir) {
if (ORTE_SUCCESS != (rc = opal_dss_pack_buffer(buffer,
(void*)(&(app_context[i]->preload_files_dest_dir)), 1, OPAL_STRING))) {
ORTE_ERROR_LOG(rc);
return rc;
}
}
/* Pack the preload_files_src_dir if we have one */
if (NULL != app_context[i]->preload_files_src_dir) {
have_preload_files_dest_dir = 1;
} else {
have_preload_files_dest_dir = 0;
}
if (ORTE_SUCCESS != (rc = opal_dss_pack_buffer(buffer,
(void*)(&have_preload_files_dest_dir), 1, OPAL_INT8))) {
ORTE_ERROR_LOG(rc);
return rc;
}
if( have_preload_files_dest_dir) {
if (ORTE_SUCCESS != (rc = opal_dss_pack_buffer(buffer,
(void*)(&(app_context[i]->preload_files_src_dir)), 1, OPAL_STRING))) {
ORTE_ERROR_LOG(rc);
return rc;
}
}
/* pack the recovery defined flag */
if (ORTE_SUCCESS != (rc = opal_dss_pack_buffer(buffer,
(void*)(&(app_context[i]->recovery_defined)), 1, OPAL_BOOL))) {
(void*)(&(app_context[i]->recovery_defined)), 1, OPAL_BOOL))) {
ORTE_ERROR_LOG(rc);
return rc;
}
@ -751,25 +673,28 @@ int orte_dt_pack_app_context(opal_buffer_t *buffer, const void *src,
}
#if OPAL_ENABLE_FT_CR == 1
/* Pack the preload_files_src_dir if we have one */
if (NULL != app_context[i]->sstore_load) {
have_preload_files_dest_dir = 1;
} else {
have_preload_files_dest_dir = 0;
}
{
int8_t have_sstore;
/* Pack the preload_files_src_dir if we have one */
if (NULL != app_context[i]->sstore_load) {
have_sstore = 1;
} else {
have_sstore = 0;
}
if (ORTE_SUCCESS != (rc = opal_dss_pack_buffer(buffer,
(void*)(&have_preload_files_dest_dir), 1, OPAL_INT8))) {
ORTE_ERROR_LOG(rc);
return rc;
}
if( have_preload_files_dest_dir) {
if (ORTE_SUCCESS != (rc = opal_dss_pack_buffer(buffer,
(void*)(&(app_context[i]->sstore_load)), 1, OPAL_STRING))) {
(void*)(&have_sstore), 1, OPAL_INT8))) {
ORTE_ERROR_LOG(rc);
return rc;
}
if( have_sstore) {
if (ORTE_SUCCESS != (rc = opal_dss_pack_buffer(buffer,
(void*)(&(app_context[i]->sstore_load)), 1, OPAL_STRING))) {
ORTE_ERROR_LOG(rc);
return rc;
}
}
}
#endif
}

Просмотреть файл

@ -581,11 +581,10 @@ int orte_dt_print_app_context(char **output, char *prefix, orte_app_context_t *s
tmp = tmp2;
}
asprintf(&tmp2, "%s\n%s\tPreload binary: %s\tPreload libs: %s\tUsed on node: %s\n%s\tPreload files dest: %s\n%s\tPreload files src dir: %s", tmp,
pfx2, (src->preload_binary) ? "TRUE" : "FALSE", (src->preload_libs) ? "TRUE" : "FALSE",
(src->used_on_node) ? "TRUE" : "FALSE",
pfx2, (NULL == src->preload_files_dest_dir) ? "NULL" : src->preload_files_dest_dir,
pfx2, (NULL == src->preload_files_src_dir) ? "NULL" : src->preload_files_src_dir);
asprintf(&tmp2, "%s\n%s\tPreload binary: %s\tPreload files: %s\tUsed on node: %s", tmp,
pfx2, (src->preload_binary) ? "TRUE" : "FALSE",
(NULL == src->preload_files) ? "NULL" : src->preload_files,
(src->used_on_node) ? "TRUE" : "FALSE");
free(tmp);
tmp = tmp2;

Просмотреть файл

@ -9,8 +9,8 @@
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2011 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2011 Los Alamos National Security, LLC.
* Copyright (c) 2011 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2011-2012 Los Alamos National Security, LLC.
* All rights reserved.
* $COPYRIGHT$
*
@ -532,12 +532,12 @@ int orte_dt_unpack_proc(opal_buffer_t *buffer, void *dest,
* APP_CONTEXT
*/
int orte_dt_unpack_app_context(opal_buffer_t *buffer, void *dest,
int32_t *num_vals, opal_data_type_t type)
int32_t *num_vals, opal_data_type_t type)
{
int rc;
orte_app_context_t **app_context;
int32_t i, max_n=1, count;
int8_t have_prefix, user_specified, have_preload_files, have_preload_files_dest_dir;
int8_t user_specified;
/* unpack into array of app_context objects */
app_context = (orte_app_context_t**) dest;
@ -553,7 +553,7 @@ int orte_dt_unpack_app_context(opal_buffer_t *buffer, void *dest,
/* get the app index number */
max_n = 1;
if (ORTE_SUCCESS != (rc = opal_dss_unpack_buffer(buffer, &(app_context[i]->idx),
&max_n, ORTE_STD_CNTR))) {
&max_n, ORTE_STD_CNTR))) {
ORTE_ERROR_LOG(rc);
return rc;
}
@ -561,7 +561,7 @@ int orte_dt_unpack_app_context(opal_buffer_t *buffer, void *dest,
/* unpack the application name */
max_n = 1;
if (ORTE_SUCCESS != (rc = opal_dss_unpack_buffer(buffer, &(app_context[i]->app),
&max_n, OPAL_STRING))) {
&max_n, OPAL_STRING))) {
ORTE_ERROR_LOG(rc);
return rc;
}
@ -569,7 +569,7 @@ int orte_dt_unpack_app_context(opal_buffer_t *buffer, void *dest,
/* get the number of processes */
max_n = 1;
if (ORTE_SUCCESS != (rc = opal_dss_unpack_buffer(buffer, &(app_context[i]->num_procs),
&max_n, ORTE_STD_CNTR))) {
&max_n, ORTE_STD_CNTR))) {
ORTE_ERROR_LOG(rc);
return rc;
}
@ -577,7 +577,7 @@ int orte_dt_unpack_app_context(opal_buffer_t *buffer, void *dest,
/* get the first rank for this app */
max_n = 1;
if (ORTE_SUCCESS != (rc = opal_dss_unpack_buffer(buffer, &(app_context[i]->first_rank),
&max_n, ORTE_VPID))) {
&max_n, ORTE_VPID))) {
ORTE_ERROR_LOG(rc);
return rc;
}
@ -585,9 +585,9 @@ int orte_dt_unpack_app_context(opal_buffer_t *buffer, void *dest,
/* get the number of argv strings that were packed */
max_n = 1;
if (ORTE_SUCCESS != (rc = opal_dss_unpack_buffer(buffer, &count, &max_n, ORTE_STD_CNTR))) {
ORTE_ERROR_LOG(rc);
return rc;
}
ORTE_ERROR_LOG(rc);
return rc;
}
/* if there are argv strings, allocate the required space for the char * pointers */
if (0 < count) {
@ -633,7 +633,7 @@ int orte_dt_unpack_app_context(opal_buffer_t *buffer, void *dest,
/* unpack the cwd */
max_n = 1;
if (ORTE_SUCCESS != (rc = opal_dss_unpack_buffer(buffer, &app_context[i]->cwd,
&max_n, OPAL_STRING))) {
&max_n, OPAL_STRING))) {
ORTE_ERROR_LOG(rc);
return rc;
}
@ -641,7 +641,7 @@ int orte_dt_unpack_app_context(opal_buffer_t *buffer, void *dest,
/* unpack the user-specified cwd flag */
max_n=1;
if (ORTE_SUCCESS != (rc = opal_dss_unpack_buffer(buffer, &user_specified,
&max_n, OPAL_INT8))) {
&max_n, OPAL_INT8))) {
ORTE_ERROR_LOG(rc);
return rc;
}
@ -654,7 +654,7 @@ int orte_dt_unpack_app_context(opal_buffer_t *buffer, void *dest,
/* unpack the use-session-dir cwd flag */
max_n=1;
if (ORTE_SUCCESS != (rc = opal_dss_unpack_buffer(buffer, &user_specified,
&max_n, OPAL_INT8))) {
&max_n, OPAL_INT8))) {
ORTE_ERROR_LOG(rc);
return rc;
}
@ -707,9 +707,9 @@ int orte_dt_unpack_app_context(opal_buffer_t *buffer, void *dest,
/* get the number of dash_host strings that were packed */
max_n = 1;
if (ORTE_SUCCESS != (rc = opal_dss_unpack_buffer(buffer, &count, &max_n, ORTE_STD_CNTR))) {
ORTE_ERROR_LOG(rc);
return rc;
}
ORTE_ERROR_LOG(rc);
return rc;
}
/* if there are dash_host strings, allocate the required space for the char * pointers */
if (0 < count) {
@ -728,89 +728,29 @@ int orte_dt_unpack_app_context(opal_buffer_t *buffer, void *dest,
}
}
/* unpack the prefix dir if there is one */
max_n=1;
if (ORTE_SUCCESS != (rc = opal_dss_unpack_buffer(buffer, &have_prefix,
&max_n, OPAL_INT8))) {
ORTE_ERROR_LOG(rc);
return rc;
}
if (have_prefix) {
if (ORTE_SUCCESS != (rc = opal_dss_unpack_buffer(buffer, &app_context[i]->prefix_dir,
&max_n, OPAL_STRING))) {
ORTE_ERROR_LOG(rc);
return rc;
}
} else {
app_context[i]->prefix_dir = NULL;
}
/* Unpack the preload_binary flag */
max_n=1;
if (ORTE_SUCCESS != (rc = opal_dss_unpack_buffer(buffer, &(app_context[i]->preload_binary),
&max_n, OPAL_BOOL))) {
/* unpack the prefix dir */
max_n = 1;
if (ORTE_SUCCESS != (rc = opal_dss_unpack_buffer(buffer, &app_context[i]->prefix_dir,
&max_n, OPAL_STRING))) {
ORTE_ERROR_LOG(rc);
return rc;
}
/* Unpack the preload_libs flag */
max_n=1;
if (ORTE_SUCCESS != (rc = opal_dss_unpack_buffer(buffer, &(app_context[i]->preload_libs),
/* unpack the preload_binaries flag */
max_n = 1;
if (ORTE_SUCCESS != (rc = opal_dss_unpack_buffer(buffer, &app_context[i]->preload_binary,
&max_n, OPAL_BOOL))) {
ORTE_ERROR_LOG(rc);
return rc;
}
/* Unpack the preload_files set */
max_n=1;
if (ORTE_SUCCESS != (rc = opal_dss_unpack_buffer(buffer, &have_preload_files,
&max_n, OPAL_INT8))) {
ORTE_ERROR_LOG(rc);
return rc;
}
if (have_preload_files) {
if (ORTE_SUCCESS != (rc = opal_dss_unpack_buffer(buffer, &app_context[i]->preload_files,
&max_n, OPAL_STRING))) {
ORTE_ERROR_LOG(rc);
return rc;
}
} else {
app_context[i]->preload_files = NULL;
}
/* Unpack the preload_files_dest_dir set */
max_n=1;
if (ORTE_SUCCESS != (rc = opal_dss_unpack_buffer(buffer, &have_preload_files_dest_dir,
&max_n, OPAL_INT8))) {
/* unpack the preload_files */
max_n = 1;
if (ORTE_SUCCESS != (rc = opal_dss_unpack_buffer(buffer, &app_context[i]->preload_files,
&max_n, OPAL_STRING))) {
ORTE_ERROR_LOG(rc);
return rc;
}
if (have_preload_files_dest_dir) {
if (ORTE_SUCCESS != (rc = opal_dss_unpack_buffer(buffer, &app_context[i]->preload_files_dest_dir,
&max_n, OPAL_STRING))) {
ORTE_ERROR_LOG(rc);
return rc;
}
} else {
app_context[i]->preload_files_dest_dir = NULL;
}
/* Unpack the preload_files_src_dir set */
max_n=1;
if (ORTE_SUCCESS != (rc = opal_dss_unpack_buffer(buffer, &have_preload_files_dest_dir,
&max_n, OPAL_INT8))) {
ORTE_ERROR_LOG(rc);
return rc;
}
if (have_preload_files_dest_dir) {
if (ORTE_SUCCESS != (rc = opal_dss_unpack_buffer(buffer, &app_context[i]->preload_files_src_dir,
&max_n, OPAL_STRING))) {
ORTE_ERROR_LOG(rc);
return rc;
}
} else {
app_context[i]->preload_files_src_dir = NULL;
}
/* Unpack the recovery_defined flag */
max_n=1;
@ -828,20 +768,24 @@ int orte_dt_unpack_app_context(opal_buffer_t *buffer, void *dest,
}
#if OPAL_ENABLE_FT_CR == 1
/* Unpack the sstore_load */
if (ORTE_SUCCESS != (rc = opal_dss_unpack_buffer(buffer, &have_preload_files_dest_dir,
&max_n, OPAL_INT8))) {
ORTE_ERROR_LOG(rc);
return rc;
}
if (have_preload_files_dest_dir) {
if (ORTE_SUCCESS != (rc = opal_dss_unpack_buffer(buffer, &app_context[i]->sstore_load,
&max_n, OPAL_STRING))) {
{
int8_t have_sstore;
/* Unpack the sstore_load */
if (ORTE_SUCCESS != (rc = opal_dss_unpack_buffer(buffer, &have_sstore,
&max_n, OPAL_INT8))) {
ORTE_ERROR_LOG(rc);
return rc;
}
} else {
app_context[i]->sstore_load = NULL;
if (have_sstore) {
if (ORTE_SUCCESS != (rc = opal_dss_unpack_buffer(buffer, &app_context[i]->sstore_load,
&max_n, OPAL_STRING))) {
ORTE_ERROR_LOG(rc);
return rc;
}
} else {
app_context[i]->sstore_load = NULL;
}
}
#endif
}

Просмотреть файл

@ -582,8 +582,6 @@ static void orte_app_context_construct(orte_app_context_t* app_context)
app_context->prefix_dir = NULL;
app_context->preload_binary = false;
app_context->preload_files = NULL;
app_context->preload_files_dest_dir = NULL;
app_context->preload_files_src_dir = NULL;
app_context->used_on_node = false;
#if OPAL_ENABLE_FT_CR == 1
@ -649,23 +647,12 @@ static void orte_app_context_destructor(orte_app_context_t* app_context)
}
app_context->preload_binary = false;
app_context->preload_libs = false;
if(NULL != app_context->preload_files) {
free(app_context->preload_files);
app_context->preload_files = NULL;
}
if(NULL != app_context->preload_files_dest_dir) {
free(app_context->preload_files_dest_dir);
app_context->preload_files_dest_dir = NULL;
}
if(NULL != app_context->preload_files_src_dir) {
free(app_context->preload_files_src_dir);
app_context->preload_files_src_dir = NULL;
}
#if OPAL_ENABLE_FT_CR == 1
if( NULL != app_context->sstore_load ) {
free(app_context->sstore_load);

Просмотреть файл

@ -273,16 +273,8 @@ typedef struct {
char *prefix_dir;
/** Preload the binary on the remote machine (in PLM via FileM) */
bool preload_binary;
/** Preload the libraries on the remote machine (in PLM via FileM) */
bool preload_libs;
/** Preload the comma separated list of files to the remote machines cwd */
char * preload_files;
/** Destination directory for the preloaded files
* If NULL then the absolute and relative paths are obeyed */
char *preload_files_dest_dir;
/** Source directory for the preloaded files
* If NULL then the absolute and relative paths are obeyed */
char *preload_files_src_dir;
/* is being used on the local node */
bool used_on_node;
#if OPAL_ENABLE_FT_CR == 1

Просмотреть файл

@ -124,7 +124,6 @@ struct mapreduce_globals_t {
char *wdir;
char *path;
char *preload_files;
char *preload_files_dest_dir;
opal_mutex_t lock;
bool sleep;
char *ompi_server;
@ -257,11 +256,6 @@ static opal_cmd_line_init_t cmd_line_init[] = {
&mapreduce_globals.preload_files, OPAL_CMD_LINE_TYPE_STRING,
"Preload the comma separated list of files to the remote machines current working directory before starting the remote process." },
/* Where to Preload files on the remote machine */
{ NULL, NULL, NULL, '\0', NULL, "preload-files-dest-dir", 1,
&mapreduce_globals.preload_files_dest_dir, OPAL_CMD_LINE_TYPE_STRING,
"The destination directory to use in conjunction with --preload-files. By default the absolute and relative paths provided by --preload-files are used." },
/* Use an appfile */
{ NULL, NULL, NULL, '\0', NULL, "app", 1,
&mapreduce_globals.appfile, OPAL_CMD_LINE_TYPE_STRING,
@ -953,7 +947,6 @@ static int init_globals(void)
mapreduce_globals.preload_binaries = false;
mapreduce_globals.preload_files = NULL;
mapreduce_globals.preload_files_dest_dir = NULL;
#if OPAL_ENABLE_FT_CR == 1
mapreduce_globals.sstore_load = NULL;
@ -1764,10 +1757,6 @@ static int create_app(int argc, char* argv[],
app->preload_files = strdup(mapreduce_globals.preload_files);
else
app->preload_files = NULL;
if( NULL != mapreduce_globals.preload_files_dest_dir)
app->preload_files_dest_dir = strdup(mapreduce_globals.preload_files_dest_dir);
else
app->preload_files_dest_dir = NULL;
/* flag type of app */
if (mapreduce_globals.mapper) {

Просмотреть файл

@ -230,11 +230,6 @@ static opal_cmd_line_init_t cmd_line_init[] = {
&orterun_globals.preload_files, OPAL_CMD_LINE_TYPE_STRING,
"Preload the comma separated list of files to the remote machines current working directory before starting the remote process." },
/* Where to Preload files on the remote machine */
{ NULL, NULL, NULL, '\0', NULL, "preload-files-dest-dir", 1,
&orterun_globals.preload_files_dest_dir, OPAL_CMD_LINE_TYPE_STRING,
"The destination directory to use in conjunction with --preload-files. By default the absolute and relative paths provided by --preload-files are used." },
#if OPAL_ENABLE_FT_CR == 1
/* Tell SStore to preload a snapshot before launch */
{ NULL, NULL, NULL, '\0', NULL, "sstore-load", 1,
@ -994,7 +989,6 @@ static int init_globals(void)
orterun_globals.preload_binaries = false;
orterun_globals.preload_files = NULL;
orterun_globals.preload_files_dest_dir = NULL;
#if OPAL_ENABLE_FT_CR == 1
orterun_globals.sstore_load = NULL;
@ -1762,9 +1756,13 @@ static int create_app(int argc, char* argv[],
app->preload_binary = orterun_globals.preload_binaries;
/* if we were told to cwd to the session dir and the app was given in
* relative syntax, then we need to preload the binary to
* find the app
* find the app - don't do this for java apps, however, as we
* can't easily find the class on the cmd line. Java apps have to
* preload their binary via the preload_files option
*/
if (app->set_cwd_to_session_dir && !opal_path_is_absolute(app->argv[0])) {
if (app->set_cwd_to_session_dir &&
!opal_path_is_absolute(app->argv[0]) &&
NULL == strstr(app->argv[0], "java")) {
app->preload_binary = true;
}
if (NULL != orterun_globals.preload_files) {
@ -1772,11 +1770,6 @@ static int create_app(int argc, char* argv[],
} else {
app->preload_files = NULL;
}
if (NULL != orterun_globals.preload_files_dest_dir) {
app->preload_files_dest_dir = strdup(orterun_globals.preload_files_dest_dir);
} else {
app->preload_files_dest_dir = NULL;
}
#if OPAL_ENABLE_FT_CR == 1
if( NULL != orterun_globals.sstore_load ) {

Просмотреть файл

@ -50,7 +50,6 @@ struct orterun_globals_t {
bool set_cwd_to_session_dir;
char *path;
char *preload_files;
char *preload_files_dest_dir;
opal_mutex_t lock;
bool sleep;
char *ompi_server;