1
1
openmpi/orte/mca/filem/filem.h

403 строки
12 KiB
C
Исходник Обычный вид История

/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
/*
* Copyright (c) 2004-2009 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.
2015-06-24 06:59:57 +03:00
* 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) 2012-2015 Los Alamos National Security, LLC. All rights
* reserved
* $COPYRIGHT$
2015-06-24 06:59:57 +03:00
*
* Additional copyrights may follow
2015-06-24 06:59:57 +03:00
*
* $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 "orte/mca/mca.h"
#include "opal/mca/base/base.h"
#include "opal/class/opal_object.h"
#include "orte/runtime/orte_globals.h"
- Replace combinations of #if defined (c_plusplus) defined (__cplusplus) followed by extern "C" { and the closing counterpart by BEGIN_C_DECLS and END_C_DECLS. Notable exceptions are: - opal/include/opal_config_bottom.h: This is our generated code, that itself defines BEGIN_C_DECL and END_C_DECL - ompi/mpi/cxx/mpicxx.h: Here we do not include opal_config_bottom.h: - Belongs to external code: opal/mca/backtrace/darwin/MoreBacktrace/MoreDebugging/MoreBacktrace.c opal/mca/backtrace/darwin/MoreBacktrace/MoreDebugging/MoreBacktrace.h - opal/include/opal/prefetch.h: Has C++ specific macros that are protected: - Had #if ... } #endif _and_ END_C_DECLS (aka end up with 2x END_C_DECLS) ompi/mca/btl/openib/btl_openib.h - opal/event/event.h has #ifdef __cplusplus as BEGIN_C_DECLS... - opal/win32/ompi_process.h: had extern "C"\n {... opal/win32/ompi_process.h: dito - ompi/mca/btl/pcie/btl_pcie_lex.l: needed to add *_C_DECLS ompi/mpi/f90/test/align_c.c: dito - ompi/debuggers/msgq_interface.h: used #ifdef __cplusplus - ompi/mpi/f90/xml/common-C.xsl: Amend Tested on linux using --with-openib and --with-mx The following do not contain either opal_config.h, orte_config.h or ompi_config.h (but possibly other header files, that include one of the above): ompi/mca/bml/r2/bml_r2_ft.h ompi/mca/btl/gm/btl_gm_endpoint.h ompi/mca/btl/gm/btl_gm_proc.h ompi/mca/btl/mx/btl_mx_endpoint.h ompi/mca/btl/ofud/btl_ofud_endpoint.h ompi/mca/btl/ofud/btl_ofud_frag.h ompi/mca/btl/ofud/btl_ofud_proc.h ompi/mca/btl/openib/btl_openib_mca.h ompi/mca/btl/portals/btl_portals_endpoint.h ompi/mca/btl/portals/btl_portals_frag.h ompi/mca/btl/sctp/btl_sctp_endpoint.h ompi/mca/btl/sctp/btl_sctp_proc.h ompi/mca/btl/tcp/btl_tcp_endpoint.h ompi/mca/btl/tcp/btl_tcp_ft.h ompi/mca/btl/tcp/btl_tcp_proc.h ompi/mca/btl/template/btl_template_endpoint.h ompi/mca/btl/template/btl_template_proc.h ompi/mca/btl/udapl/btl_udapl_eager_rdma.h ompi/mca/btl/udapl/btl_udapl_endpoint.h ompi/mca/btl/udapl/btl_udapl_mca.h ompi/mca/btl/udapl/btl_udapl_proc.h ompi/mca/mtl/mx/mtl_mx_endpoint.h ompi/mca/mtl/mx/mtl_mx.h ompi/mca/mtl/psm/mtl_psm_endpoint.h ompi/mca/mtl/psm/mtl_psm.h ompi/mca/pml/cm/pml_cm_component.h ompi/mca/pml/csum/pml_csum_comm.h ompi/mca/pml/dr/pml_dr_comm.h ompi/mca/pml/dr/pml_dr_component.h ompi/mca/pml/dr/pml_dr_endpoint.h ompi/mca/pml/dr/pml_dr_recvfrag.h ompi/mca/pml/example/pml_example.h ompi/mca/pml/ob1/pml_ob1_comm.h ompi/mca/pml/ob1/pml_ob1_component.h ompi/mca/pml/ob1/pml_ob1_endpoint.h ompi/mca/pml/ob1/pml_ob1_rdmafrag.h ompi/mca/pml/ob1/pml_ob1_recvfrag.h ompi/mca/pml/v/pml_v_output.h opal/include/opal/prefetch.h opal/mca/timer/aix/timer_aix.h opal/util/qsort.h test/support/components.h This commit was SVN r21855. The following SVN revision numbers were found above: r2 --> open-mpi/ompi@58fdc188553052bc2e893ba28fb28fddbe78435a
2009-08-20 15:42:18 +04:00
BEGIN_C_DECLS
/**
* 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
#define ORTE_FILEM_TYPE_TAR 3
#define ORTE_FILEM_TYPE_BZIP 4
#define ORTE_FILEM_TYPE_GZIP 5
#define ORTE_FILEM_TYPE_EXE 6
2007-09-27 17:13:29 +04:00
/**
* Type of movement
2007-09-27 17:13:29 +04:00
*/
#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
/**
* Hints that describe the local or remote file target for
* optimization purposes.
*/
#define ORTE_FILEM_HINT_NONE 0
#define ORTE_FILEM_HINT_SHARED 1
2007-09-27 17:13:29 +04:00
/**
* 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
*
2015-06-24 06:59:57 +03:00
* Note: If multiple process sinks are used it is assumed that the
2007-09-27 17:13:29 +04:00
* 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;
/* the app_index this pertains to, if applicable */
orte_app_idx_t app_idx;
2007-09-27 17:13:29 +04:00
/* Local file reference */
char * local_target;
/* Local file reference hints */
int local_hint;
2007-09-27 17:13:29 +04:00
/* Remove file reference */
char * remote_target;
/* Remote file reference hints */
int remote_hint;
2007-09-27 17:13:29 +04:00
/* 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.
2007-09-27 17:13:29 +04:00
* Used for the following:
2015-06-24 06:59:57 +03:00
*
*/
struct orte_filem_base_request_1_0_0_t {
/** This is an object, so must have a super */
opal_list_item_t super;
2007-09-27 17:13:29 +04:00
/*
* A list of process sets - use WILDCARD to
* indicate all procs of a given vpid/jobid,
* INVALID to indicate not-applicable. For
* example, if you need to move a file at time
* of job start to each node that has a proc
* on it, then the process set would have a
* source proc with vpid=INVALID and a sink proc
* with vpid=WILDCARD, and a remote hint of "shared"
* in the file sets so we don't copy them over
* multiple times
*/
2007-09-27 17:13:29 +04:00
opal_list_t process_sets;
2007-09-27 17:13:29 +04:00
/*
* A list of file pairings
*/
opal_list_t file_sets;
2007-09-27 17:13:29 +04:00
/*
* Internal use:
* Number of movements
*/
int num_mv;
2007-09-27 17:13:29 +04:00
/*
* 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.
*
2015-06-24 06:59:57 +03:00
* @param request FileM request describing the files/directories to send,
* the remote files/directories to use, and the processes to see the change.
2015-06-24 06:59:57 +03:00
*
* @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);
2007-09-27 17:13:29 +04:00
/**
* 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.
*
2015-06-24 06:59:57 +03:00
* @param request FileM request describing the files/directories to send,
2007-09-27 17:13:29 +04:00
* the remote files/directories to use, and the processes to see the change.
2015-06-24 06:59:57 +03:00
*
2007-09-27 17:13:29 +04:00
* @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.
*
2015-06-24 06:59:57 +03:00
* @param request FileM request describing the files/directories to receive,
* the remote files/directories to use, and the processes to see the change.
2015-06-24 06:59:57 +03:00
*
* @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);
2007-09-27 17:13:29 +04:00
/**
* 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.
*
2015-06-24 06:59:57 +03:00
* @param request FileM request describing the files/directories to receive,
2007-09-27 17:13:29 +04:00
* the remote files/directories to use, and the processes to see the change.
2015-06-24 06:59:57 +03:00
*
2007-09-27 17:13:29 +04:00
* @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
2015-06-24 06:59:57 +03:00
*
* 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.
*
2015-06-24 06:59:57 +03:00
* @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);
2007-09-27 17:13:29 +04:00
/**
* Remove a file from the remote machine (Async)
2015-06-24 06:59:57 +03:00
*
2007-09-27 17:13:29 +04:00
* 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.
*
2015-06-24 06:59:57 +03:00
* @param request FileM request describing the remote files/directories to remove,
2007-09-27 17:13:29 +04:00
* 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);
typedef void (*orte_filem_completion_cbfunc_t)(int status, void *cbdata);
/* Pre-position files
*/
typedef int (*orte_filem_base_preposition_files_fn_t)(orte_job_t *jdata,
orte_filem_completion_cbfunc_t cbfunc,
void *cbdata);
/* link local files */
typedef int (*orte_filem_base_link_local_files_fn_t)(orte_job_t *jdata,
orte_app_context_t *app);
/**
* Structure for FILEM components.
*/
struct orte_filem_base_component_2_0_0_t {
/** MCA base component */
mca_base_component_t base_version;
/** MCA base data */
mca_base_component_data_t base_data;
};
typedef struct orte_filem_base_component_2_0_0_t orte_filem_base_component_2_0_0_t;
typedef struct orte_filem_base_component_2_0_0_t orte_filem_base_component_t;
/**
* Structure for FILEM 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;
2007-09-27 17:13:29 +04:00
orte_filem_base_put_nb_fn_t put_nb;
/** Get a file from the remote machine */
orte_filem_base_get_fn_t get;
2007-09-27 17:13:29 +04:00
orte_filem_base_get_nb_fn_t get_nb;
/** Remove a file on the remote machine */
orte_filem_base_rm_fn_t rm;
2007-09-27 17:13:29 +04:00
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;
/* pre-position files to every node */
orte_filem_base_preposition_files_fn_t preposition_files;
/* create local links for all shared files */
orte_filem_base_link_local_files_fn_t link_local_files;
};
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
*/
#define ORTE_FILEM_BASE_VERSION_2_0_0 \
ORTE_MCA_BASE_VERSION_2_1_0("filem", 2, 0, 0)
- Replace combinations of #if defined (c_plusplus) defined (__cplusplus) followed by extern "C" { and the closing counterpart by BEGIN_C_DECLS and END_C_DECLS. Notable exceptions are: - opal/include/opal_config_bottom.h: This is our generated code, that itself defines BEGIN_C_DECL and END_C_DECL - ompi/mpi/cxx/mpicxx.h: Here we do not include opal_config_bottom.h: - Belongs to external code: opal/mca/backtrace/darwin/MoreBacktrace/MoreDebugging/MoreBacktrace.c opal/mca/backtrace/darwin/MoreBacktrace/MoreDebugging/MoreBacktrace.h - opal/include/opal/prefetch.h: Has C++ specific macros that are protected: - Had #if ... } #endif _and_ END_C_DECLS (aka end up with 2x END_C_DECLS) ompi/mca/btl/openib/btl_openib.h - opal/event/event.h has #ifdef __cplusplus as BEGIN_C_DECLS... - opal/win32/ompi_process.h: had extern "C"\n {... opal/win32/ompi_process.h: dito - ompi/mca/btl/pcie/btl_pcie_lex.l: needed to add *_C_DECLS ompi/mpi/f90/test/align_c.c: dito - ompi/debuggers/msgq_interface.h: used #ifdef __cplusplus - ompi/mpi/f90/xml/common-C.xsl: Amend Tested on linux using --with-openib and --with-mx The following do not contain either opal_config.h, orte_config.h or ompi_config.h (but possibly other header files, that include one of the above): ompi/mca/bml/r2/bml_r2_ft.h ompi/mca/btl/gm/btl_gm_endpoint.h ompi/mca/btl/gm/btl_gm_proc.h ompi/mca/btl/mx/btl_mx_endpoint.h ompi/mca/btl/ofud/btl_ofud_endpoint.h ompi/mca/btl/ofud/btl_ofud_frag.h ompi/mca/btl/ofud/btl_ofud_proc.h ompi/mca/btl/openib/btl_openib_mca.h ompi/mca/btl/portals/btl_portals_endpoint.h ompi/mca/btl/portals/btl_portals_frag.h ompi/mca/btl/sctp/btl_sctp_endpoint.h ompi/mca/btl/sctp/btl_sctp_proc.h ompi/mca/btl/tcp/btl_tcp_endpoint.h ompi/mca/btl/tcp/btl_tcp_ft.h ompi/mca/btl/tcp/btl_tcp_proc.h ompi/mca/btl/template/btl_template_endpoint.h ompi/mca/btl/template/btl_template_proc.h ompi/mca/btl/udapl/btl_udapl_eager_rdma.h ompi/mca/btl/udapl/btl_udapl_endpoint.h ompi/mca/btl/udapl/btl_udapl_mca.h ompi/mca/btl/udapl/btl_udapl_proc.h ompi/mca/mtl/mx/mtl_mx_endpoint.h ompi/mca/mtl/mx/mtl_mx.h ompi/mca/mtl/psm/mtl_psm_endpoint.h ompi/mca/mtl/psm/mtl_psm.h ompi/mca/pml/cm/pml_cm_component.h ompi/mca/pml/csum/pml_csum_comm.h ompi/mca/pml/dr/pml_dr_comm.h ompi/mca/pml/dr/pml_dr_component.h ompi/mca/pml/dr/pml_dr_endpoint.h ompi/mca/pml/dr/pml_dr_recvfrag.h ompi/mca/pml/example/pml_example.h ompi/mca/pml/ob1/pml_ob1_comm.h ompi/mca/pml/ob1/pml_ob1_component.h ompi/mca/pml/ob1/pml_ob1_endpoint.h ompi/mca/pml/ob1/pml_ob1_rdmafrag.h ompi/mca/pml/ob1/pml_ob1_recvfrag.h ompi/mca/pml/v/pml_v_output.h opal/include/opal/prefetch.h opal/mca/timer/aix/timer_aix.h opal/util/qsort.h test/support/components.h This commit was SVN r21855. The following SVN revision numbers were found above: r2 --> open-mpi/ompi@58fdc188553052bc2e893ba28fb28fddbe78435a
2009-08-20 15:42:18 +04:00
END_C_DECLS
#endif /* ORTE_FILEM_H */