1
1
openmpi/orte/mca/filem/filem.h
Jeff Squyres e7ecd56bd2 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-13 20:00:55 +00:00

367 строки
10 KiB
C

/*
* Copyright (c) 2004-2008 The Trustees of Indiana University and Indiana
* 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.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
/**
* @file
*
* Remote File Management (FileM) Interface
*
*/
#ifndef MCA_FILEM_H
#define MCA_FILEM_H
#include "orte_config.h"
#include "orte/constants.h"
#include "orte/types.h"
#include "opal/mca/mca.h"
#include "opal/mca/base/base.h"
#include "opal/class/opal_object.h"
#if defined(c_plusplus) || defined(__cplusplus)
extern "C" {
#endif
/**
* A set of flags that determine the type of the file
* in question
*/
#define ORTE_FILEM_TYPE_FILE 0
#define ORTE_FILEM_TYPE_DIR 1
#define ORTE_FILEM_TYPE_UNKNOWN 2
/**
* Type of moment
*/
#define ORTE_FILEM_MOVE_TYPE_PUT 0
#define ORTE_FILEM_MOVE_TYPE_GET 1
#define ORTE_FILEM_MOVE_TYPE_RM 2
#define ORTE_FILEM_MOVE_TYPE_UNKNOWN 3
/**
* Define a Process Set
*
* Source: A single source of the operation.
* Sink: Desitination of the operation.
*/
struct orte_filem_base_process_set_1_0_0_t {
/** This is an object, so must have a super */
opal_list_item_t super;
/** Source Process */
orte_process_name_t source;
/** Sink Process */
orte_process_name_t sink;
};
typedef struct orte_filem_base_process_set_1_0_0_t orte_filem_base_process_set_1_0_0_t;
typedef struct orte_filem_base_process_set_1_0_0_t orte_filem_base_process_set_t;
ORTE_DECLSPEC OBJ_CLASS_DECLARATION(orte_filem_base_process_set_t);
/**
* Define a File Pair
*
* Local: Local file reference
* Remove: Remote file reference
*
* Note: If multiple process sinks are used it is assumed that the
* file reference is the same for each of the sinks. If this is not
* true then more than one filem request needs to be created.
*/
struct orte_filem_base_file_set_1_0_0_t {
/** This is an object, so must have a super */
opal_list_item_t super;
/* Local file reference */
char * local_target;
/* Remove file reference */
char * remote_target;
/* Type of file to move */
int target_flag;
};
typedef struct orte_filem_base_file_set_1_0_0_t orte_filem_base_file_set_1_0_0_t;
typedef struct orte_filem_base_file_set_1_0_0_t orte_filem_base_file_set_t;
ORTE_DECLSPEC OBJ_CLASS_DECLARATION(orte_filem_base_file_set_t);
/**
* Definition of a file movement request
* This will allow:
* - The movement of one or more files
* - to/from one or more processes
* in a single call of the API function. Allowing the implementation
* to optimize the sending/receiving of data.
* Used for the following:
*
*/
struct orte_filem_base_request_1_0_0_t {
/** This is an object, so must have a super */
opal_list_item_t super;
/*
* A list of process sets
*/
opal_list_t process_sets;
/*
* A list of file pairings
*/
opal_list_t file_sets;
/*
* Internal use:
* Number of movements
*/
int num_mv;
/*
* Internal use:
* Boolean to indianate if transfer is complete
*/
bool *is_done;
/*
* Internal use:
* Boolean to indianate if transfer is active
*/
bool *is_active;
/*
* Internal use:
* Exit status of the copy command
*/
int32_t *exit_status;
/*
* Internal use:
* Movement type
*/
int movement_type;
};
typedef struct orte_filem_base_request_1_0_0_t orte_filem_base_request_1_0_0_t;
typedef struct orte_filem_base_request_1_0_0_t orte_filem_base_request_t;
ORTE_DECLSPEC OBJ_CLASS_DECLARATION(orte_filem_base_request_t);
/**
* Module initialization function.
* Returns ORTE_SUCCESS
*/
typedef int (*orte_filem_base_module_init_fn_t)
(void);
/**
* Module finalization function.
* Returns ORTE_SUCCESS
*/
typedef int (*orte_filem_base_module_finalize_fn_t)
(void);
/**
* Put a file or directory on the remote machine
*
* Note: By using a relative path for the remote file/directory, the filem
* component will negotiate the correct absolute path for that file/directory
* for the remote machine.
*
* @param request FileM request describing the files/directories to send,
* the remote files/directories to use, and the processes to see the change.
*
* @return ORTE_SUCCESS on successful file transer
* @return ORTE_ERROR on failed file transfer
*/
typedef int (*orte_filem_base_put_fn_t)
(orte_filem_base_request_t *request);
/**
* Put a file or directory on the remote machine (Async)
*
* Note: By using a relative path for the remote file/directory, the filem
* component will negotiate the correct absolute path for that file/directory
* for the remote machine.
*
* @param request FileM request describing the files/directories to send,
* the remote files/directories to use, and the processes to see the change.
*
* @return ORTE_SUCCESS on successful file transer
* @return ORTE_ERROR on failed file transfer
*/
typedef int (*orte_filem_base_put_nb_fn_t)
(orte_filem_base_request_t *request);
/**
* Get a file from the remote machine
*
* Note: By using a relative path for the remote file/directory, the filem
* component will negotiate the correct absolute path for that file/directory
* for the remote machine.
*
* @param request FileM request describing the files/directories to receive,
* the remote files/directories to use, and the processes to see the change.
*
* @return ORTE_SUCCESS on successful file transer
* @return ORTE_ERROR on failed file transfer
*/
typedef int (*orte_filem_base_get_fn_t)
(orte_filem_base_request_t *request);
/**
* Get a file from the remote machine (Async)
*
* Note: By using a relative path for the remote file/directory, the filem
* component will negotiate the correct absolute path for that file/directory
* for the remote machine.
*
* @param request FileM request describing the files/directories to receive,
* the remote files/directories to use, and the processes to see the change.
*
* @return ORTE_SUCCESS on successful file transer
* @return ORTE_ERROR on failed file transfer
*/
typedef int (*orte_filem_base_get_nb_fn_t)
(orte_filem_base_request_t *request);
/**
* Remove a file from the remote machine
*
* Note: By using a relative path for the remote file/directory, the filem
* component will negotiate the correct absolute path for that file/directory
* for the remote machine.
*
* @param request FileM request describing the remote files/directories to remove,
* the processes to see the change.
*
* @return ORTE_SUCCESS on success
* @return ORTE_ERROR on fail
*/
typedef int (*orte_filem_base_rm_fn_t)
(orte_filem_base_request_t *request);
/**
* Remove a file from the remote machine (Async)
*
* Note: By using a relative path for the remote file/directory, the filem
* component will negotiate the correct absolute path for that file/directory
* for the remote machine.
*
* @param request FileM request describing the remote files/directories to remove,
* the processes to see the change.
*
* @return ORTE_SUCCESS on success
* @return ORTE_ERROR on fail
*/
typedef int (*orte_filem_base_rm_nb_fn_t)
(orte_filem_base_request_t *request);
/**
* Wait for a single file movement request to finish
*
* @param request FileM request describing the remote files/directories.
*
* The request must have been passed through one of the non-blocking functions
* before calling wait or wait_all otherwise ORTE_ERROR will be returned.
*
* @return ORTE_SUCCESS on success
* @return ORTE_ERROR on fail
*/
typedef int (*orte_filem_base_wait_fn_t)
(orte_filem_base_request_t *request);
/**
* Wait for a multiple file movement requests to finish
*
* @param request_list opal_list_t of FileM requests describing the remote files/directories.
*
* The request must have been passed through one of the non-blocking functions
* before calling wait or wait_all otherwise ORTE_ERROR will be returned.
*
* @return ORTE_SUCCESS on success
* @return ORTE_ERROR on fail
*/
typedef int (*orte_filem_base_wait_all_fn_t)
(opal_list_t *request_list);
/**
* Structure for FILEM v1.0.0 components.
*/
struct orte_filem_base_component_1_0_0_t {
/** MCA base component */
mca_base_component_t base_version;
/** MCA base data */
mca_base_component_data_1_0_0_t base_data;
/** Verbosity Level */
int verbose;
/** Output Handle for orte_output */
int output_handle;
/** Default Priority */
int priority;
};
typedef struct orte_filem_base_component_1_0_0_t orte_filem_base_component_1_0_0_t;
typedef struct orte_filem_base_component_1_0_0_t orte_filem_base_component_t;
/**
* Structure for FILEM v1.0.0 modules
*/
struct orte_filem_base_module_1_0_0_t {
/** Initialization Function */
orte_filem_base_module_init_fn_t filem_init;
/** Finalization Function */
orte_filem_base_module_finalize_fn_t filem_finalize;
/** Put a file on the remote machine */
orte_filem_base_put_fn_t put;
orte_filem_base_put_nb_fn_t put_nb;
/** Get a file from the remote machine */
orte_filem_base_get_fn_t get;
orte_filem_base_get_nb_fn_t get_nb;
/** Remove a file on the remote machine */
orte_filem_base_rm_fn_t rm;
orte_filem_base_rm_nb_fn_t rm_nb;
/** Test functions for the non-blocking versions */
orte_filem_base_wait_fn_t wait;
orte_filem_base_wait_all_fn_t wait_all;
};
typedef struct orte_filem_base_module_1_0_0_t orte_filem_base_module_1_0_0_t;
typedef struct orte_filem_base_module_1_0_0_t orte_filem_base_module_t;
ORTE_DECLSPEC extern orte_filem_base_module_t orte_filem;
/**
* Macro for use in components that are of type FILEM v1.0.0
*/
#define ORTE_FILEM_BASE_VERSION_1_0_0 \
/* FILEM v1.0 is chained to MCA v1.0 */ \
MCA_BASE_VERSION_1_0_0, \
/* FILEM v1.0 */ \
"filem", 1, 0, 0
#if defined(c_plusplus) || defined(__cplusplus)
}
#endif
#endif /* ORTE_FILEM_H */