2006-11-11 07:03:45 +03:00
|
|
|
/*
|
2007-09-27 18:37:04 +04:00
|
|
|
* Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana
|
2006-11-11 07:03:45 +03:00
|
|
|
* University Research and Technology
|
|
|
|
* Corporation. All rights reserved.
|
|
|
|
* Copyright (c) 2004-2005 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.
|
2007-09-29 00:15:28 +04:00
|
|
|
* Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved.
|
2006-11-11 07:03:45 +03:00
|
|
|
* $COPYRIGHT$
|
|
|
|
*
|
|
|
|
* Additional copyrights may follow
|
|
|
|
*
|
|
|
|
* $HEADER$
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
#include "orte_config.h"
|
2008-02-28 04:57:57 +03:00
|
|
|
#include "orte/constants.h"
|
2006-11-11 07:03:45 +03:00
|
|
|
|
2007-09-27 17:13:29 +04:00
|
|
|
#ifdef HAVE_SYS_PARAM_H
|
|
|
|
#include <sys/param.h>
|
|
|
|
#endif
|
2007-09-29 00:15:28 +04:00
|
|
|
#ifdef HAVE_NETDB_H
|
|
|
|
#include <netdb.h>
|
|
|
|
#endif
|
2007-09-27 17:13:29 +04:00
|
|
|
|
2006-11-11 07:03:45 +03:00
|
|
|
#include "opal/util/argv.h"
|
2008-06-09 18:53:58 +04:00
|
|
|
#include "orte/util/show_help.h"
|
2006-11-11 07:03:45 +03:00
|
|
|
#include "opal/util/trace.h"
|
2008-02-28 04:57:57 +03:00
|
|
|
#include "opal/util/basename.h"
|
2006-11-11 07:03:45 +03:00
|
|
|
|
2008-02-28 04:57:57 +03:00
|
|
|
#include "orte/util/name_fns.h"
|
2006-11-11 07:03:45 +03:00
|
|
|
#include "orte/mca/errmgr/errmgr.h"
|
|
|
|
|
2007-09-27 17:13:29 +04:00
|
|
|
#include "orte/mca/filem/filem.h"
|
|
|
|
#include "orte/mca/filem/base/base.h"
|
|
|
|
|
2006-11-11 07:03:45 +03:00
|
|
|
#include "orte/mca/odls/base/base.h"
|
|
|
|
#include "orte/mca/odls/base/odls_private.h"
|
|
|
|
|
|
|
|
|
2007-09-27 17:13:29 +04:00
|
|
|
/*
|
|
|
|
* 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);
|
2008-02-28 04:57:57 +03:00
|
|
|
if( orte_process_info.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;
|
2007-10-11 23:47:04 +04:00
|
|
|
}
|
|
|
|
else {
|
2008-02-28 04:57:57 +03:00
|
|
|
/* 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;
|
2007-10-11 23:47:04 +04:00
|
|
|
}
|
2008-02-28 04:57:57 +03:00
|
|
|
p_set->sink.jobid = ORTE_PROC_MY_NAME->jobid;
|
|
|
|
p_set->sink.vpid = ORTE_PROC_MY_NAME->vpid;
|
2007-09-27 17:13:29 +04:00
|
|
|
|
|
|
|
opal_list_append(&(filem_request->process_sets), &(p_set->super) );
|
|
|
|
|
|
|
|
if(app_context->preload_binary) {
|
2008-06-09 18:53:58 +04:00
|
|
|
OPAL_OUTPUT_VERBOSE((1, orte_odls_globals.output,
|
2007-09-27 17:13:29 +04:00
|
|
|
"%s) Preload Binary...",
|
|
|
|
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME)));
|
|
|
|
if( ORTE_SUCCESS != (ret = orte_odls_base_preload_append_binary(app_context,
|
|
|
|
filem_request) ) ){
|
This commit represents a bunch of work on a Mercurial side branch. As
such, the commit message back to the master SVN repository is fairly
long.
= ORTE Job-Level Output Messages =
Add two new interfaces that should be used for all new code throughout
the ORTE and OMPI layers (we already make the search-and-replace on
the existing ORTE / OMPI layers):
* orte_output(): (and corresponding friends ORTE_OUTPUT,
orte_output_verbose, etc.) This function sends the output directly
to the HNP for processing as part of a job-specific output
channel. It supports all the same outputs as opal_output()
(syslog, file, stdout, stderr), but for stdout/stderr, the output
is sent to the HNP for processing and output. More on this below.
* orte_show_help(): This function is a drop-in-replacement for
opal_show_help(), with two differences in functionality:
1. the rendered text help message output is sent to the HNP for
display (rather than outputting directly into the process' stderr
stream)
1. the HNP detects duplicate help messages and does not display them
(so that you don't see the same error message N times, once from
each of your N MPI processes); instead, it counts "new" instances
of the help message and displays a message every ~5 seconds when
there are new ones ("I got X new copies of the help message...")
opal_show_help and opal_output still exist, but they only output in
the current process. The intent for the new orte_* functions is that
they can apply job-level intelligence to the output. As such, we
recommend that all new ORTE and OMPI code use the new orte_*
functions, not thei opal_* functions.
=== New code ===
For ORTE and OMPI programmers, here's what you need to do differently
in new code:
* Do not include opal/util/show_help.h or opal/util/output.h.
Instead, include orte/util/output.h (this one header file has
declarations for both the orte_output() series of functions and
orte_show_help()).
* Effectively s/opal_output/orte_output/gi throughout your code.
Note that orte_output_open() takes a slightly different argument
list (as a way to pass data to the filtering stream -- see below),
so you if explicitly call opal_output_open(), you'll need to
slightly adapt to the new signature of orte_output_open().
* Literally s/opal_show_help/orte_show_help/. The function signature
is identical.
=== Notes ===
* orte_output'ing to stream 0 will do similar to what
opal_output'ing did, so leaving a hard-coded "0" as the first
argument is safe.
* For systems that do not use ORTE's RML or the HNP, the effect of
orte_output_* and orte_show_help will be identical to their opal
counterparts (the additional information passed to
orte_output_open() will be lost!). Indeed, the orte_* functions
simply become trivial wrappers to their opal_* counterparts. Note
that we have not tested this; the code is simple but it is quite
possible that we mucked something up.
= Filter Framework =
Messages sent view the new orte_* functions described above and
messages output via the IOF on the HNP will now optionally be passed
through a new "filter" framework before being output to
stdout/stderr. The "filter" OPAL MCA framework is intended to allow
preprocessing to messages before they are sent to their final
destinations. The first component that was written in the filter
framework was to create an XML stream, segregating all the messages
into different XML tags, etc. This will allow 3rd party tools to read
the stdout/stderr from the HNP and be able to know exactly what each
text message is (e.g., a help message, another OMPI infrastructure
message, stdout from the user process, stderr from the user process,
etc.).
Filtering is not active by default. Filter components must be
specifically requested, such as:
{{{
$ mpirun --mca filter xml ...
}}}
There can only be one filter component active.
= New MCA Parameters =
The new functionality described above introduces two new MCA
parameters:
* '''orte_base_help_aggregate''': Defaults to 1 (true), meaning that
help messages will be aggregated, as described above. If set to 0,
all help messages will be displayed, even if they are duplicates
(i.e., the original behavior).
* '''orte_base_show_output_recursions''': An MCA parameter to help
debug one of the known issues, described below. It is likely that
this MCA parameter will disappear before v1.3 final.
= Known Issues =
* The XML filter component is not complete. The current output from
this component is preliminary and not real XML. A bit more work
needs to be done to configure.m4 search for an appropriate XML
library/link it in/use it at run time.
* There are possible recursion loops in the orte_output() and
orte_show_help() functions -- e.g., if RML send calls orte_output()
or orte_show_help(). We have some ideas how to fix these, but
figured that it was ok to commit before feature freeze with known
issues. The code currently contains sub-optimal workarounds so
that this will not be a problem, but it would be good to actually
solve the problem rather than have hackish workarounds before v1.3 final.
This commit was SVN r18434.
2008-05-14 00:00:55 +04:00
|
|
|
orte_show_help("help-orte-odls-base.txt",
|
2007-09-27 17:13:29 +04:00
|
|
|
"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) {
|
2008-06-09 18:53:58 +04:00
|
|
|
OPAL_OUTPUT_VERBOSE((1, orte_odls_globals.output,
|
2007-09-27 17:13:29 +04:00
|
|
|
"%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) ) ){
|
This commit represents a bunch of work on a Mercurial side branch. As
such, the commit message back to the master SVN repository is fairly
long.
= ORTE Job-Level Output Messages =
Add two new interfaces that should be used for all new code throughout
the ORTE and OMPI layers (we already make the search-and-replace on
the existing ORTE / OMPI layers):
* orte_output(): (and corresponding friends ORTE_OUTPUT,
orte_output_verbose, etc.) This function sends the output directly
to the HNP for processing as part of a job-specific output
channel. It supports all the same outputs as opal_output()
(syslog, file, stdout, stderr), but for stdout/stderr, the output
is sent to the HNP for processing and output. More on this below.
* orte_show_help(): This function is a drop-in-replacement for
opal_show_help(), with two differences in functionality:
1. the rendered text help message output is sent to the HNP for
display (rather than outputting directly into the process' stderr
stream)
1. the HNP detects duplicate help messages and does not display them
(so that you don't see the same error message N times, once from
each of your N MPI processes); instead, it counts "new" instances
of the help message and displays a message every ~5 seconds when
there are new ones ("I got X new copies of the help message...")
opal_show_help and opal_output still exist, but they only output in
the current process. The intent for the new orte_* functions is that
they can apply job-level intelligence to the output. As such, we
recommend that all new ORTE and OMPI code use the new orte_*
functions, not thei opal_* functions.
=== New code ===
For ORTE and OMPI programmers, here's what you need to do differently
in new code:
* Do not include opal/util/show_help.h or opal/util/output.h.
Instead, include orte/util/output.h (this one header file has
declarations for both the orte_output() series of functions and
orte_show_help()).
* Effectively s/opal_output/orte_output/gi throughout your code.
Note that orte_output_open() takes a slightly different argument
list (as a way to pass data to the filtering stream -- see below),
so you if explicitly call opal_output_open(), you'll need to
slightly adapt to the new signature of orte_output_open().
* Literally s/opal_show_help/orte_show_help/. The function signature
is identical.
=== Notes ===
* orte_output'ing to stream 0 will do similar to what
opal_output'ing did, so leaving a hard-coded "0" as the first
argument is safe.
* For systems that do not use ORTE's RML or the HNP, the effect of
orte_output_* and orte_show_help will be identical to their opal
counterparts (the additional information passed to
orte_output_open() will be lost!). Indeed, the orte_* functions
simply become trivial wrappers to their opal_* counterparts. Note
that we have not tested this; the code is simple but it is quite
possible that we mucked something up.
= Filter Framework =
Messages sent view the new orte_* functions described above and
messages output via the IOF on the HNP will now optionally be passed
through a new "filter" framework before being output to
stdout/stderr. The "filter" OPAL MCA framework is intended to allow
preprocessing to messages before they are sent to their final
destinations. The first component that was written in the filter
framework was to create an XML stream, segregating all the messages
into different XML tags, etc. This will allow 3rd party tools to read
the stdout/stderr from the HNP and be able to know exactly what each
text message is (e.g., a help message, another OMPI infrastructure
message, stdout from the user process, stderr from the user process,
etc.).
Filtering is not active by default. Filter components must be
specifically requested, such as:
{{{
$ mpirun --mca filter xml ...
}}}
There can only be one filter component active.
= New MCA Parameters =
The new functionality described above introduces two new MCA
parameters:
* '''orte_base_help_aggregate''': Defaults to 1 (true), meaning that
help messages will be aggregated, as described above. If set to 0,
all help messages will be displayed, even if they are duplicates
(i.e., the original behavior).
* '''orte_base_show_output_recursions''': An MCA parameter to help
debug one of the known issues, described below. It is likely that
this MCA parameter will disappear before v1.3 final.
= Known Issues =
* The XML filter component is not complete. The current output from
this component is preliminary and not real XML. A bit more work
needs to be done to configure.m4 search for an appropriate XML
library/link it in/use it at run time.
* There are possible recursion loops in the orte_output() and
orte_show_help() functions -- e.g., if RML send calls orte_output()
or orte_show_help(). We have some ideas how to fix these, but
figured that it was ok to commit before feature freeze with known
issues. The code currently contains sub-optimal workarounds so
that this will not be a problem, but it would be good to actually
solve the problem rather than have hackish workarounds before v1.3 final.
This commit was SVN r18434.
2008-05-14 00:00:55 +04:00
|
|
|
orte_show_help("help-orte-odls-base.txt",
|
2007-09-27 17:13:29 +04:00
|
|
|
"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)) ) {
|
This commit represents a bunch of work on a Mercurial side branch. As
such, the commit message back to the master SVN repository is fairly
long.
= ORTE Job-Level Output Messages =
Add two new interfaces that should be used for all new code throughout
the ORTE and OMPI layers (we already make the search-and-replace on
the existing ORTE / OMPI layers):
* orte_output(): (and corresponding friends ORTE_OUTPUT,
orte_output_verbose, etc.) This function sends the output directly
to the HNP for processing as part of a job-specific output
channel. It supports all the same outputs as opal_output()
(syslog, file, stdout, stderr), but for stdout/stderr, the output
is sent to the HNP for processing and output. More on this below.
* orte_show_help(): This function is a drop-in-replacement for
opal_show_help(), with two differences in functionality:
1. the rendered text help message output is sent to the HNP for
display (rather than outputting directly into the process' stderr
stream)
1. the HNP detects duplicate help messages and does not display them
(so that you don't see the same error message N times, once from
each of your N MPI processes); instead, it counts "new" instances
of the help message and displays a message every ~5 seconds when
there are new ones ("I got X new copies of the help message...")
opal_show_help and opal_output still exist, but they only output in
the current process. The intent for the new orte_* functions is that
they can apply job-level intelligence to the output. As such, we
recommend that all new ORTE and OMPI code use the new orte_*
functions, not thei opal_* functions.
=== New code ===
For ORTE and OMPI programmers, here's what you need to do differently
in new code:
* Do not include opal/util/show_help.h or opal/util/output.h.
Instead, include orte/util/output.h (this one header file has
declarations for both the orte_output() series of functions and
orte_show_help()).
* Effectively s/opal_output/orte_output/gi throughout your code.
Note that orte_output_open() takes a slightly different argument
list (as a way to pass data to the filtering stream -- see below),
so you if explicitly call opal_output_open(), you'll need to
slightly adapt to the new signature of orte_output_open().
* Literally s/opal_show_help/orte_show_help/. The function signature
is identical.
=== Notes ===
* orte_output'ing to stream 0 will do similar to what
opal_output'ing did, so leaving a hard-coded "0" as the first
argument is safe.
* For systems that do not use ORTE's RML or the HNP, the effect of
orte_output_* and orte_show_help will be identical to their opal
counterparts (the additional information passed to
orte_output_open() will be lost!). Indeed, the orte_* functions
simply become trivial wrappers to their opal_* counterparts. Note
that we have not tested this; the code is simple but it is quite
possible that we mucked something up.
= Filter Framework =
Messages sent view the new orte_* functions described above and
messages output via the IOF on the HNP will now optionally be passed
through a new "filter" framework before being output to
stdout/stderr. The "filter" OPAL MCA framework is intended to allow
preprocessing to messages before they are sent to their final
destinations. The first component that was written in the filter
framework was to create an XML stream, segregating all the messages
into different XML tags, etc. This will allow 3rd party tools to read
the stdout/stderr from the HNP and be able to know exactly what each
text message is (e.g., a help message, another OMPI infrastructure
message, stdout from the user process, stderr from the user process,
etc.).
Filtering is not active by default. Filter components must be
specifically requested, such as:
{{{
$ mpirun --mca filter xml ...
}}}
There can only be one filter component active.
= New MCA Parameters =
The new functionality described above introduces two new MCA
parameters:
* '''orte_base_help_aggregate''': Defaults to 1 (true), meaning that
help messages will be aggregated, as described above. If set to 0,
all help messages will be displayed, even if they are duplicates
(i.e., the original behavior).
* '''orte_base_show_output_recursions''': An MCA parameter to help
debug one of the known issues, described below. It is likely that
this MCA parameter will disappear before v1.3 final.
= Known Issues =
* The XML filter component is not complete. The current output from
this component is preliminary and not real XML. A bit more work
needs to be done to configure.m4 search for an appropriate XML
library/link it in/use it at run time.
* There are possible recursion loops in the orte_output() and
orte_show_help() functions -- e.g., if RML send calls orte_output()
or orte_show_help(). We have some ideas how to fix these, but
figured that it was ok to commit before feature freeze with known
issues. The code currently contains sub-optimal workarounds so
that this will not be a problem, but it would be good to actually
solve the problem rather than have hackish workarounds before v1.3 final.
This commit was SVN r18434.
2008-05-14 00:00:55 +04:00
|
|
|
orte_show_help("help-orte-odls-base.txt",
|
2007-09-27 17:13:29 +04:00
|
|
|
"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
|
|
|
|
*/
|
|
|
|
if( NULL != local_bin ) {
|
|
|
|
if(NULL != context->app) {
|
|
|
|
free(context->app);
|
|
|
|
context->app = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
context->app = 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;
|
|
|
|
char * temp = 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, opal_basename(remote_targets[i]) );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
asprintf(&temp, "test -e %s", local_ref);
|
|
|
|
if(0 == system(temp)) {
|
|
|
|
char hostname[MAXHOSTNAMELEN];
|
|
|
|
gethostname(hostname, sizeof(hostname));
|
This commit represents a bunch of work on a Mercurial side branch. As
such, the commit message back to the master SVN repository is fairly
long.
= ORTE Job-Level Output Messages =
Add two new interfaces that should be used for all new code throughout
the ORTE and OMPI layers (we already make the search-and-replace on
the existing ORTE / OMPI layers):
* orte_output(): (and corresponding friends ORTE_OUTPUT,
orte_output_verbose, etc.) This function sends the output directly
to the HNP for processing as part of a job-specific output
channel. It supports all the same outputs as opal_output()
(syslog, file, stdout, stderr), but for stdout/stderr, the output
is sent to the HNP for processing and output. More on this below.
* orte_show_help(): This function is a drop-in-replacement for
opal_show_help(), with two differences in functionality:
1. the rendered text help message output is sent to the HNP for
display (rather than outputting directly into the process' stderr
stream)
1. the HNP detects duplicate help messages and does not display them
(so that you don't see the same error message N times, once from
each of your N MPI processes); instead, it counts "new" instances
of the help message and displays a message every ~5 seconds when
there are new ones ("I got X new copies of the help message...")
opal_show_help and opal_output still exist, but they only output in
the current process. The intent for the new orte_* functions is that
they can apply job-level intelligence to the output. As such, we
recommend that all new ORTE and OMPI code use the new orte_*
functions, not thei opal_* functions.
=== New code ===
For ORTE and OMPI programmers, here's what you need to do differently
in new code:
* Do not include opal/util/show_help.h or opal/util/output.h.
Instead, include orte/util/output.h (this one header file has
declarations for both the orte_output() series of functions and
orte_show_help()).
* Effectively s/opal_output/orte_output/gi throughout your code.
Note that orte_output_open() takes a slightly different argument
list (as a way to pass data to the filtering stream -- see below),
so you if explicitly call opal_output_open(), you'll need to
slightly adapt to the new signature of orte_output_open().
* Literally s/opal_show_help/orte_show_help/. The function signature
is identical.
=== Notes ===
* orte_output'ing to stream 0 will do similar to what
opal_output'ing did, so leaving a hard-coded "0" as the first
argument is safe.
* For systems that do not use ORTE's RML or the HNP, the effect of
orte_output_* and orte_show_help will be identical to their opal
counterparts (the additional information passed to
orte_output_open() will be lost!). Indeed, the orte_* functions
simply become trivial wrappers to their opal_* counterparts. Note
that we have not tested this; the code is simple but it is quite
possible that we mucked something up.
= Filter Framework =
Messages sent view the new orte_* functions described above and
messages output via the IOF on the HNP will now optionally be passed
through a new "filter" framework before being output to
stdout/stderr. The "filter" OPAL MCA framework is intended to allow
preprocessing to messages before they are sent to their final
destinations. The first component that was written in the filter
framework was to create an XML stream, segregating all the messages
into different XML tags, etc. This will allow 3rd party tools to read
the stdout/stderr from the HNP and be able to know exactly what each
text message is (e.g., a help message, another OMPI infrastructure
message, stdout from the user process, stderr from the user process,
etc.).
Filtering is not active by default. Filter components must be
specifically requested, such as:
{{{
$ mpirun --mca filter xml ...
}}}
There can only be one filter component active.
= New MCA Parameters =
The new functionality described above introduces two new MCA
parameters:
* '''orte_base_help_aggregate''': Defaults to 1 (true), meaning that
help messages will be aggregated, as described above. If set to 0,
all help messages will be displayed, even if they are duplicates
(i.e., the original behavior).
* '''orte_base_show_output_recursions''': An MCA parameter to help
debug one of the known issues, described below. It is likely that
this MCA parameter will disappear before v1.3 final.
= Known Issues =
* The XML filter component is not complete. The current output from
this component is preliminary and not real XML. A bit more work
needs to be done to configure.m4 search for an appropriate XML
library/link it in/use it at run time.
* There are possible recursion loops in the orte_output() and
orte_show_help() functions -- e.g., if RML send calls orte_output()
or orte_show_help(). We have some ideas how to fix these, but
figured that it was ok to commit before feature freeze with known
issues. The code currently contains sub-optimal workarounds so
that this will not be a problem, but it would be good to actually
solve the problem rather than have hackish workarounds before v1.3 final.
This commit was SVN r18434.
2008-05-14 00:00:55 +04:00
|
|
|
orte_show_help("help-orte-odls-base.txt",
|
2007-09-27 17:13:29 +04:00
|
|
|
"orte-odls-base:preload-file-exists",
|
|
|
|
true, local_ref, hostname);
|
|
|
|
free(temp);
|
|
|
|
temp = NULL;
|
|
|
|
free(local_ref);
|
|
|
|
local_ref = NULL;
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
free(temp);
|
|
|
|
temp = NULL;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* 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;
|
|
|
|
}
|