Коммит
efd715ed85
@ -30,7 +30,7 @@ greek=
|
||||
# command, or with the date (if "git describe" fails) in the form of
|
||||
# "date<date>".
|
||||
|
||||
repo_rev=git3bd2b2d
|
||||
repo_rev=gitefa7fe7
|
||||
|
||||
# If tarball_version is not empty, it is used as the version string in
|
||||
# the tarball filename, regardless of all other versions listed in
|
||||
@ -44,7 +44,7 @@ tarball_version=
|
||||
|
||||
# The date when this release was created
|
||||
|
||||
date="Feb 03, 2018"
|
||||
date="Feb 07, 2018"
|
||||
|
||||
# The shared library version of each of PMIx's public libraries.
|
||||
# These versions are maintained in accordance with the "Library
|
||||
|
@ -1,6 +1,6 @@
|
||||
# -*- text -*-
|
||||
#
|
||||
# Copyright (c) 2015-2018 Intel, Inc. All rights reserved.
|
||||
# Copyright (c) 2015 Intel, Inc. All rights reserved.
|
||||
# $COPYRIGHT$
|
||||
#
|
||||
# Additional copyrights may follow
|
||||
|
@ -13,7 +13,7 @@
|
||||
* All rights reserved.
|
||||
* Copyright (c) 2009-2012 Cisco Systems, Inc. All rights reserved.
|
||||
* Copyright (c) 2011 Oak Ridge National Labs. All rights reserved.
|
||||
* Copyright (c) 2013-2017 Intel, Inc. All rights reserved.
|
||||
* Copyright (c) 2013-2017 Intel, Inc. All rights reserved.
|
||||
* Copyright (c) 2015 Mellanox Technologies, Inc. All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
@ -41,7 +41,6 @@ typedef struct {
|
||||
} myquery_data_t;
|
||||
|
||||
|
||||
static volatile bool waiting_for_debugger = true;
|
||||
static pmix_proc_t myproc;
|
||||
|
||||
/* this is a callback function for the PMIx_Query
|
||||
@ -134,11 +133,6 @@ int main(int argc, char **argv)
|
||||
size_t nq, n;
|
||||
myquery_data_t myquery_data;
|
||||
|
||||
fprintf(stderr, "I AM HERE\n");
|
||||
fflush(stderr);
|
||||
sleep(10);
|
||||
exit(0);
|
||||
|
||||
/* init us - since we were launched by the RM, our connection info
|
||||
* will have been provided at startup. */
|
||||
if (PMIX_SUCCESS != (rc = PMIx_tool_init(&myproc, NULL, 0))) {
|
||||
@ -216,7 +210,7 @@ fflush(stderr);
|
||||
n = 0;
|
||||
fprintf(stderr, "[%s:%u] Hanging around awhile, doing debugger magic\n", myproc.nspace, myproc.rank);
|
||||
while (n < 5) {
|
||||
usleep(1000);
|
||||
usleep(10);
|
||||
++n;
|
||||
}
|
||||
|
||||
|
@ -567,6 +567,7 @@ PMIX_EXPORT pmix_status_t PMIx_Process_monitor_nb(const pmix_info_t *monitor, pm
|
||||
PMIX_INFO_DESTRUCT(&_in); \
|
||||
} while(0)
|
||||
|
||||
|
||||
/* Request a credential from the PMIx server/SMS.
|
||||
* Input values include:
|
||||
*
|
||||
@ -631,87 +632,6 @@ PMIX_EXPORT pmix_status_t PMIx_Validate_credential(const pmix_byte_object_t *cre
|
||||
const pmix_info_t info[], size_t ninfo,
|
||||
pmix_validation_cbfunc_t cbfunc, void *cbdata);
|
||||
|
||||
/* Define a callback function for delivering forwarded IO to a process
|
||||
* This function will be called whenever data becomes available, or a
|
||||
* specified buffering size and/or time has been met. The function
|
||||
* will be passed the following values:
|
||||
*
|
||||
* iofhdlr - the returned registration number of the handler being invoked.
|
||||
* This is required when deregistering the handler.
|
||||
*
|
||||
* channel - a bitmask identifying the channel the data arrived on
|
||||
*
|
||||
* source - the nspace/rank of the process that generated the data
|
||||
*
|
||||
* payload - pointer to character array containing the data. Note that
|
||||
* multiple strings may be included, and that the array may
|
||||
* _not_ be NULL terminated
|
||||
*
|
||||
* info - an optional array of info provided by the source containing
|
||||
* metadata about the payload. This could include PMIX_IOF_COMPLETE
|
||||
*
|
||||
* ninfo - number of elements in the optional info array
|
||||
*/
|
||||
typedef void (*pmix_iof_cbfunc_t)(size_t iofhdlr, pmix_iof_channel_t channel,
|
||||
pmix_proc_t *source, char *payload,
|
||||
pmix_info_t info[], size_t ninfo);
|
||||
|
||||
|
||||
/* Register to receive IO forwarded from a remote process.
|
||||
*
|
||||
* procs - array of identifiers for sources whose IO is being
|
||||
* requested. Wildcard rank indicates that all procs
|
||||
* in the specified nspace are included in the request
|
||||
*
|
||||
* nprocs - number of identifiers in the procs array
|
||||
*
|
||||
* directives - optional array of attributes to control the
|
||||
* behavior of the request. For example, this
|
||||
* might include directives on buffering IO
|
||||
* before delivery, and/or directives to include
|
||||
* or exclude any backlogged data
|
||||
*
|
||||
* ndirs - number of elements in the directives array
|
||||
*
|
||||
* channel - bitmask of IO channels included in the request
|
||||
*
|
||||
* cbfunc - function to be called when relevant IO is received
|
||||
*
|
||||
* regcbfunc - since registration is async, this is the
|
||||
* function to be called when registration is
|
||||
* completed. The function itself will return
|
||||
* a non-success error if the registration cannot
|
||||
* be submitted - in this case, the regcbfunc
|
||||
* will _not_ be called.
|
||||
*
|
||||
* cbdata - pointer to object to be returned in regcbfunc
|
||||
*/
|
||||
PMIX_EXPORT pmix_status_t PMIx_IOF_register(const pmix_proc_t procs[], size_t nprocs,
|
||||
const pmix_info_t directives[], size_t ndirs,
|
||||
pmix_iof_channel_t channel, pmix_iof_cbfunc_t cbfunc,
|
||||
pmix_hdlr_reg_cbfunc_t regcbfunc, void *regcbdata);
|
||||
|
||||
/* Deregister from IO forwarded from a remote process.
|
||||
*
|
||||
* iofhdlr - the registration number returned from the
|
||||
* call to PMIx_IOF_register
|
||||
*
|
||||
* directives - optional array of attributes to control the
|
||||
* behavior of the request. For example, this
|
||||
* might include directives regarding what to
|
||||
* do with any data currently in the IO buffer
|
||||
* for this process
|
||||
*
|
||||
* cbfunc - function to be called when deregistration has
|
||||
* been completed. Note that any IO to be flushed
|
||||
* may continue to be received after deregistration
|
||||
* has completed.
|
||||
*
|
||||
* cbdata - pointer to object to be returned in cbfunc
|
||||
*/
|
||||
PMIX_EXPORT pmix_status_t PMIx_IOF_deregister(size_t iofhdlr,
|
||||
const pmix_info_t directives[], size_t ndirs,
|
||||
pmix_op_cbfunc_t cbfunc, void *cbdata);
|
||||
|
||||
#if defined(c_plusplus) || defined(__cplusplus)
|
||||
}
|
||||
|
@ -147,7 +147,6 @@ typedef uint32_t pmix_rank_t;
|
||||
#define PMIX_CONNECT_RETRY_DELAY "pmix.tool.retry" // (uint32_t) time in seconds between connection attempts
|
||||
#define PMIX_TOOL_DO_NOT_CONNECT "pmix.tool.nocon" // (bool) the tool wants to use internal PMIx support, but does
|
||||
// not want to connect to a PMIx server
|
||||
// from the specified processes to this tool
|
||||
|
||||
/* identification attributes */
|
||||
#define PMIX_USERID "pmix.euid" // (uint32_t) effective user id
|
||||
@ -221,9 +220,7 @@ typedef uint32_t pmix_rank_t;
|
||||
#define PMIX_LOCAL_CPUSETS "pmix.lcpus" // (char*) colon-delimited cpusets of local peers within the specified nspace
|
||||
#define PMIX_PROC_URI "pmix.puri" // (char*) URI containing contact info for proc
|
||||
#define PMIX_LOCALITY "pmix.loc" // (uint16_t) relative locality of two procs
|
||||
#define PMIX_PARENT_ID "pmix.parent" // (pmix_proc_t*) identifier of the process that called PMIx_Spawn
|
||||
// to launch this proc's application
|
||||
|
||||
#define PMIX_PARENT_ID "pmix.parent" // (pmix_proc_t) process identifier of my parent process
|
||||
|
||||
/* size info */
|
||||
#define PMIX_UNIV_SIZE "pmix.univ.size" // (uint32_t) #procs in this nspace
|
||||
@ -327,7 +324,7 @@ typedef uint32_t pmix_rank_t;
|
||||
#define PMIX_EVENT_WANT_TERMINATION "pmix.evterm" // (bool) indicates that the handler has determined that the application should be terminated
|
||||
|
||||
|
||||
/* attributes used to describe "spawn" directives */
|
||||
/* attributes used to describe "spawn" attributes */
|
||||
#define PMIX_PERSONALITY "pmix.pers" // (char*) name of personality to use
|
||||
#define PMIX_HOST "pmix.host" // (char*) comma-delimited list of hosts to use for spawned procs
|
||||
#define PMIX_HOSTFILE "pmix.hostfile" // (char*) hostfile to use for spawned procs
|
||||
@ -345,6 +342,9 @@ typedef uint32_t pmix_rank_t;
|
||||
#define PMIX_PRELOAD_FILES "pmix.preloadfiles" // (char*) comma-delimited list of files to pre-position
|
||||
#define PMIX_NON_PMI "pmix.nonpmi" // (bool) spawned procs will not call PMIx_Init
|
||||
#define PMIX_STDIN_TGT "pmix.stdin" // (uint32_t) spawned proc rank that is to receive stdin
|
||||
#define PMIX_FWD_STDIN "pmix.fwd.stdin" // (bool) forward my stdin to the designated proc
|
||||
#define PMIX_FWD_STDOUT "pmix.fwd.stdout" // (bool) forward stdout from spawned procs to me
|
||||
#define PMIX_FWD_STDERR "pmix.fwd.stderr" // (bool) forward stderr from spawned procs to me
|
||||
#define PMIX_DEBUGGER_DAEMONS "pmix.debugger" // (bool) spawned app consists of debugger daemons
|
||||
#define PMIX_COSPAWN_APP "pmix.cospawn" // (bool) designated app is to be spawned as a disconnected
|
||||
// job - i.e., not part of the "comm_world" of the job
|
||||
@ -364,11 +364,6 @@ typedef uint32_t pmix_rank_t;
|
||||
#define PMIX_JOB_CONTINUOUS "pmix.continuous" // (bool) application is continuous, all failed procs should
|
||||
// be immediately restarted
|
||||
#define PMIX_MAX_RESTARTS "pmix.maxrestarts" // (uint32_t) max number of times to restart a job
|
||||
#define PMIX_FWD_STDIN "pmix.fwd.stdin" // (bool) forward the stdin from this process to the spawned processes
|
||||
#define PMIX_FWD_STDOUT "pmix.fwd.stdout" // (bool) forward stdout from the spawned processes to this process (typically used by a tool)
|
||||
#define PMIX_FWD_STDERR "pmix.fwd.stderr" // (bool) forward stderr from the spawned processes to this process (typically used by a tool)
|
||||
#define PMIX_FWD_STDDIAG "pmix.fwd.stddiag" // (bool) if a diagnostic channel exists, forward any output on it
|
||||
// from the spawned processes to this process (typically used by a tool)
|
||||
|
||||
|
||||
/* connect attributes */
|
||||
@ -421,11 +416,6 @@ typedef uint32_t pmix_rank_t;
|
||||
#define PMIX_DEBUG_WAIT_FOR_NOTIFY "pmix.dbg.notify" // (bool) block at desired point until receiving debugger release notification
|
||||
#define PMIX_DEBUG_JOB "pmix.dbg.job" // (char*) nspace of the job to be debugged - the RM/PMIx server are
|
||||
#define PMIX_DEBUG_WAITING_FOR_NOTIFY "pmix.dbg.waiting" // (bool) job to be debugged is waiting for a release
|
||||
#define PMIX_PREPEND_LD_PRELOAD "pmix.prepend.preload" // (char*) prepend the named library to any existing
|
||||
// LD_PRELOAD directive
|
||||
#define PMIX_APPEND_LD_PRELOAD "pmix.append.preload" // (char*) append the named library to any existing
|
||||
// LD_PRELOAD directive
|
||||
|
||||
|
||||
/* Resource Manager identification */
|
||||
#define PMIX_RM_NAME "pmix.rm.name" // (char*) string name of the resource manager
|
||||
@ -730,8 +720,6 @@ typedef uint16_t pmix_data_type_t;
|
||||
#define PMIX_ALLOC_DIRECTIVE 43
|
||||
/**** DEPRECATED ****/
|
||||
#define PMIX_INFO_ARRAY 44
|
||||
/**** ****/
|
||||
#define PMIX_IOF_CHANNEL 45
|
||||
/********************/
|
||||
|
||||
/* define a boundary for implementers so they can add their own data types */
|
||||
@ -798,18 +786,6 @@ typedef uint8_t pmix_alloc_directive_t;
|
||||
#define PMIX_ALLOC_EXTERNAL 128
|
||||
|
||||
|
||||
/* define a set of bit-mask flags for specifying IO
|
||||
* forwarding channels. These can be OR'd together
|
||||
* to reference multiple channels */
|
||||
typedef uint16_t pmix_iof_channel_t;
|
||||
#define PMIX_FWD_NO_CHANNELS 0x00
|
||||
#define PMIX_FWD_STDIN_CHANNEL 0x01
|
||||
#define PMIX_FWD_STDOUT_CHANNEL 0x02
|
||||
#define PMIX_FWD_STDERR_CHANNEL 0x04
|
||||
#define PMIX_FWD_STDDIAG_CHANNEL 0x08
|
||||
#define PMIX_FWD_ALL_CHANNELS 0xff
|
||||
|
||||
|
||||
/**** PMIX BYTE OBJECT ****/
|
||||
typedef struct pmix_byte_object {
|
||||
char *bytes;
|
||||
@ -839,6 +815,14 @@ typedef struct pmix_byte_object {
|
||||
free((m)); \
|
||||
} while(0)
|
||||
|
||||
#define PMIX_BYTE_OBJECT_LOAD(b, d, s) \
|
||||
do { \
|
||||
(b)->bytes = (d); \
|
||||
(d) = NULL; \
|
||||
(b)->size = (s); \
|
||||
(s) = 0; \
|
||||
} while(0)
|
||||
|
||||
|
||||
/**** PMIX DATA BUFFER ****/
|
||||
typedef struct pmix_data_buffer {
|
||||
@ -1645,19 +1629,14 @@ typedef void (*pmix_notification_fn_t)(size_t evhdlr_registration_id,
|
||||
pmix_event_notification_cbfunc_fn_t cbfunc,
|
||||
void *cbdata);
|
||||
|
||||
/* define a callback function for calls to register handlers, e.g., event
|
||||
* notification and IOF requests
|
||||
*
|
||||
* status - PMIX_SUCCESS or an appropriate error constant
|
||||
*
|
||||
* refid - reference identifier assigned to the handler by PMIx,
|
||||
* used to deregister the handler
|
||||
*
|
||||
* cbdata - object provided to the registration call
|
||||
*/
|
||||
typedef void (*pmix_hdlr_reg_cbfunc_t)(pmix_status_t status,
|
||||
size_t refid,
|
||||
void *cbdata);
|
||||
/* define a callback function for calls to PMIx_Register_evhdlr. The
|
||||
* status indicates if the request was successful or not, evhdlr_ref is
|
||||
* an integer reference assigned to the event handler by PMIx, this reference
|
||||
* must be used to deregister the err handler. A ptr to the original
|
||||
* cbdata is returned. */
|
||||
typedef void (*pmix_evhdlr_reg_cbfunc_t)(pmix_status_t status,
|
||||
size_t evhdlr_ref,
|
||||
void *cbdata);
|
||||
|
||||
/* define a callback function for calls to PMIx_Get_nb. The status
|
||||
* indicates if the requested data was found or not - a pointer to the
|
||||
@ -1782,7 +1761,7 @@ typedef void (*pmix_validation_cbfunc_t)(pmix_status_t status,
|
||||
PMIX_EXPORT void PMIx_Register_event_handler(pmix_status_t codes[], size_t ncodes,
|
||||
pmix_info_t info[], size_t ninfo,
|
||||
pmix_notification_fn_t evhdlr,
|
||||
pmix_hdlr_reg_cbfunc_t cbfunc,
|
||||
pmix_evhdlr_reg_cbfunc_t cbfunc,
|
||||
void *cbdata);
|
||||
|
||||
/* Deregister an event handler
|
||||
@ -1840,7 +1819,6 @@ PMIX_EXPORT pmix_status_t PMIx_Notify_event(pmix_status_t status,
|
||||
* - pmix_info_directives_t (PMIX_INFO_DIRECTIVES)
|
||||
* - pmix_data_type_t (PMIX_DATA_TYPE)
|
||||
* - pmix_alloc_directive_t (PMIX_ALLOC_DIRECTIVE)
|
||||
* - pmix_iof_channel_t (PMIX_IOF_CHANNEL)
|
||||
*/
|
||||
PMIX_EXPORT const char* PMIx_Error_string(pmix_status_t status);
|
||||
PMIX_EXPORT const char* PMIx_Proc_state_string(pmix_proc_state_t state);
|
||||
@ -1850,7 +1828,6 @@ PMIX_EXPORT const char* PMIx_Data_range_string(pmix_data_range_t range);
|
||||
PMIX_EXPORT const char* PMIx_Info_directives_string(pmix_info_directives_t directives);
|
||||
PMIX_EXPORT const char* PMIx_Data_type_string(pmix_data_type_t type);
|
||||
PMIX_EXPORT const char* PMIx_Alloc_directive_string(pmix_alloc_directive_t directive);
|
||||
PMIX_EXPORT const char* PMIx_IOF_channel_string(pmix_iof_channel_t channel);
|
||||
|
||||
/* Get the PMIx version string. Note that the provided string is
|
||||
* statically defined and must NOT be free'd */
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2013-2018 Intel, Inc. All rights reserved.
|
||||
* Copyright (c) 2013-2017 Intel, Inc. All rights reserved.
|
||||
* Copyright (c) 2015 Artem Y. Polyakov <artpol84@gmail.com>.
|
||||
* All rights reserved.
|
||||
* Copyright (c) 2015 Research Organization for Information Science
|
||||
@ -414,64 +414,6 @@ typedef pmix_status_t (*pmix_server_validate_cred_fn_t)(const pmix_proc_t *proc,
|
||||
const pmix_info_t directives[], size_t ndirs,
|
||||
pmix_validation_cbfunc_t cbfunc, void *cbdata);
|
||||
|
||||
/* Request the specified IO channels be forwarded from the given array of procs.
|
||||
* The function shall return PMIX_SUCCESS once the host RM accepts the request for
|
||||
* processing, or a PMIx error code if the request itself isn't correct or supported.
|
||||
* The callback function shall be called when the request has been processed,
|
||||
* returning either PMIX_SUCCESS to indicate that IO shall be forwarded as requested,
|
||||
* or some appropriate error code if the request has been denied.
|
||||
*
|
||||
* procs - array of process identifiers whose IO is being requested.
|
||||
*
|
||||
* nprocs - size of the procs array
|
||||
*
|
||||
* directives - array of key-value attributes further defining the request. This
|
||||
* might include directives on buffering and security credentials for
|
||||
* access to protected channels
|
||||
*
|
||||
* ndirs - size of the directives array
|
||||
*
|
||||
* channels - bitmask identifying the channels to be forwarded
|
||||
*
|
||||
* cbfunc - callback function when the IO forwarding has been setup
|
||||
*
|
||||
* cbdata - object to be returned in cbfunc
|
||||
*
|
||||
* This call serves as a registration with the host RM for the given IO channels from
|
||||
* the specified procs - the host RM is expected to ensure that this local PMIx server
|
||||
* is on the distribution list for the channel/proc combination
|
||||
*/
|
||||
typedef pmix_status_t (*pmix_server_iof_fn_t)(const pmix_proc_t procs[], size_t nprocs,
|
||||
const pmix_info_t directives[], size_t ndirs,
|
||||
pmix_iof_channel_t channels,
|
||||
pmix_op_cbfunc_t cbfunc, void *cbdata);
|
||||
|
||||
/* Passes stdin to the host RM for transmission to recipients. The host RM is
|
||||
* responsible for forwarding the data to all PMIx servers that have requested
|
||||
* stdin from the specified source.
|
||||
*
|
||||
* source - pointer to the identifier of the process whose stdin is being provided
|
||||
*
|
||||
* bo - pointer to a byte object containing the stdin data
|
||||
*
|
||||
* directives - array of key-value attributes further defining the request. This
|
||||
* might include directives on buffering and security credentials for
|
||||
* access to protected channels
|
||||
*
|
||||
* ndirs - size of the directives array
|
||||
*
|
||||
* cbfunc - callback function when the IO forwarding has been setup
|
||||
*
|
||||
* cbdata - object to be returned in cbfunc
|
||||
*
|
||||
*/
|
||||
|
||||
typedef pmix_status_t (*pmix_server_stdin_fn_t)(const pmix_proc_t *source,
|
||||
const pmix_byte_object_t *bo,
|
||||
const pmix_info_t directives[], size_t ndirs,
|
||||
pmix_op_cbfunc_t cbfunc, void *cbdata);
|
||||
|
||||
|
||||
typedef struct pmix_server_module_2_0_0_t {
|
||||
/* v1x interfaces */
|
||||
pmix_server_client_connected_fn_t client_connected;
|
||||
@ -499,11 +441,9 @@ typedef struct pmix_server_module_2_0_0_t {
|
||||
/* v3x interfaces */
|
||||
pmix_server_get_cred_fn_t get_credential;
|
||||
pmix_server_validate_cred_fn_t validate_credential;
|
||||
pmix_server_iof_fn_t register_iof;
|
||||
pmix_server_stdin_fn_t push_stdin;
|
||||
} pmix_server_module_t;
|
||||
|
||||
/**** HOST RM FUNCTIONS FOR INTERFACE TO PMIX SERVER ****/
|
||||
/**** SERVER SUPPORT INIT/FINALIZE FUNCTIONS ****/
|
||||
|
||||
/* Initialize the server support library, and provide a
|
||||
* pointer to a pmix_server_module_t structure
|
||||
@ -671,38 +611,6 @@ PMIX_EXPORT pmix_status_t PMIx_server_setup_local_support(const char nspace[],
|
||||
pmix_info_t info[], size_t ninfo,
|
||||
pmix_op_cbfunc_t cbfunc, void *cbdata);
|
||||
|
||||
/* Provide a function by which the host RM can pass forwarded IO
|
||||
* to the local PMIx server for distribution to its clients. The
|
||||
* PMIx server is responsible for determining which of its clients
|
||||
* have actually registered for the provided data
|
||||
*
|
||||
* Parameters include:
|
||||
*
|
||||
* source - the process that provided the data being forwarded
|
||||
*
|
||||
* channel - the IOF channel (stdin, stdout, etc.)
|
||||
*
|
||||
* bo - a byte object containing the data
|
||||
*
|
||||
* info - an optional array of metadata describing the data, including
|
||||
* attributes such as PMIX_IOF_COMPLETE to indicate that the
|
||||
* source channel has been closed
|
||||
*
|
||||
* ninfo - number of elements in the info array
|
||||
*
|
||||
* cbfunc - a callback function to be executed once the provided data
|
||||
* is no longer required. The host RM is required to retain
|
||||
* the byte object until the callback is executed, or a
|
||||
* non-success status is returned by the function
|
||||
*
|
||||
* cbdata - object pointer to be returned in the callback function
|
||||
*/
|
||||
PMIX_EXPORT pmix_status_t PMIx_IOF_push(const pmix_proc_t *source,
|
||||
pmix_iof_channel_t channel,
|
||||
const pmix_byte_object_t *bo,
|
||||
const pmix_info_t info[], size_t ninfo,
|
||||
pmix_op_cbfunc_t cbfunc, void *cbdata);
|
||||
|
||||
#if defined(c_plusplus) || defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
@ -98,7 +98,6 @@ PMIX_EXPORT pmix_status_t PMIx_tool_init(pmix_proc_t *proc,
|
||||
* operation. */
|
||||
PMIX_EXPORT pmix_status_t PMIx_tool_finalize(void);
|
||||
|
||||
|
||||
#if defined(c_plusplus) || defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
@ -342,41 +342,6 @@ static void _check_for_notify(pmix_info_t info[], size_t ninfo)
|
||||
}
|
||||
}
|
||||
|
||||
static void client_iof_handler(struct pmix_peer_t *pr,
|
||||
pmix_ptl_hdr_t *hdr,
|
||||
pmix_buffer_t *buf, void *cbdata)
|
||||
{
|
||||
pmix_peer_t *peer = (pmix_peer_t*)pr;
|
||||
pmix_proc_t source;
|
||||
pmix_iof_channel_t channel;
|
||||
pmix_byte_object_t bo;
|
||||
int32_t cnt;
|
||||
pmix_status_t rc;
|
||||
|
||||
pmix_output_verbose(2, pmix_client_globals.iof_output,
|
||||
"recvd IOF");
|
||||
|
||||
cnt = 1;
|
||||
PMIX_BFROPS_UNPACK(rc, peer, buf, &source, &cnt, PMIX_PROC);
|
||||
if (PMIX_SUCCESS != rc) {
|
||||
PMIX_ERROR_LOG(rc);
|
||||
return;
|
||||
}
|
||||
cnt = 1;
|
||||
PMIX_BFROPS_UNPACK(rc, peer, buf, &channel, &cnt, PMIX_IOF_CHANNEL);
|
||||
if (PMIX_SUCCESS != rc) {
|
||||
PMIX_ERROR_LOG(rc);
|
||||
return;
|
||||
}
|
||||
cnt = 1;
|
||||
PMIX_BFROPS_UNPACK(rc, peer, buf, &bo, &cnt, PMIX_BYTE_OBJECT);
|
||||
if (PMIX_SUCCESS != rc) {
|
||||
PMIX_ERROR_LOG(rc);
|
||||
return;
|
||||
}
|
||||
pmix_output(0, "IOF: %s", bo.bytes);
|
||||
}
|
||||
|
||||
PMIX_EXPORT pmix_status_t PMIx_Init(pmix_proc_t *proc,
|
||||
pmix_info_t info[], size_t ninfo)
|
||||
{
|
||||
@ -393,7 +358,6 @@ PMIX_EXPORT pmix_status_t PMIx_Init(pmix_proc_t *proc,
|
||||
pmix_lock_t reglock;
|
||||
size_t n;
|
||||
bool found;
|
||||
pmix_ptl_posted_recv_t *rcv;
|
||||
|
||||
PMIX_ACQUIRE_THREAD(&pmix_global_lock);
|
||||
|
||||
@ -430,13 +394,6 @@ PMIX_EXPORT pmix_status_t PMIx_Init(pmix_proc_t *proc,
|
||||
PMIX_RELEASE_THREAD(&pmix_global_lock);
|
||||
return rc;
|
||||
}
|
||||
/* setup the IO Forwarding recv */
|
||||
rcv = PMIX_NEW(pmix_ptl_posted_recv_t);
|
||||
rcv->tag = PMIX_PTL_TAG_IOF;
|
||||
rcv->cbfunc = client_iof_handler;
|
||||
/* add it to the end of the list of recvs */
|
||||
pmix_list_append(&pmix_ptl_globals.posted_recvs, &rcv->super);
|
||||
|
||||
|
||||
/* setup the globals */
|
||||
PMIX_CONSTRUCT(&pmix_client_globals.pending_requests, pmix_list_t);
|
||||
@ -621,7 +578,7 @@ PMIX_EXPORT pmix_status_t PMIx_Init(pmix_proc_t *proc,
|
||||
}
|
||||
PMIX_RELEASE_THREAD(&pmix_global_lock);
|
||||
|
||||
/* look for a debugger attach key */
|
||||
/* lood for a debugger attach key */
|
||||
(void)strncpy(wildcard.nspace, pmix_globals.myid.nspace, PMIX_MAX_NSLEN);
|
||||
wildcard.rank = PMIX_RANK_WILDCARD;
|
||||
PMIX_INFO_LOAD(&ginfo, PMIX_OPTIONAL, NULL, PMIX_BOOL);
|
||||
@ -630,7 +587,6 @@ PMIX_EXPORT pmix_status_t PMIx_Init(pmix_proc_t *proc,
|
||||
/* if the value was found, then we need to wait for debugger attach here */
|
||||
/* register for the debugger release notification */
|
||||
PMIX_CONSTRUCT_LOCK(®lock);
|
||||
PMIX_POST_OBJECT(®lock);
|
||||
PMIx_Register_event_handler(&code, 1, NULL, 0,
|
||||
notification_fn, NULL, (void*)®lock);
|
||||
/* wait for it to arrive */
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2015-2018 Intel, Inc. All rights reserved.
|
||||
* Copyright (c) 2015-2018 Intel, Inc. All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
@ -42,9 +42,6 @@ typedef struct {
|
||||
// verbosity for client event operations
|
||||
int event_output;
|
||||
int event_verbose;
|
||||
// verbosity for client iof operations
|
||||
int iof_output;
|
||||
int iof_verbose;
|
||||
// verbosity for basic client functions
|
||||
int base_output;
|
||||
int base_verbose;
|
||||
|
@ -15,5 +15,4 @@ sources += \
|
||||
common/pmix_log.c \
|
||||
common/pmix_control.c \
|
||||
common/pmix_data.c \
|
||||
common/pmix_security.c \
|
||||
common/pmix_iof.c
|
||||
common/pmix_security.c
|
||||
|
@ -1,175 +0,0 @@
|
||||
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
|
||||
/*
|
||||
* Copyright (c) 2014-2018 Intel, Inc. All rights reserved.
|
||||
* Copyright (c) 2016 Mellanox Technologies, Inc.
|
||||
* All rights reserved.
|
||||
* Copyright (c) 2016 IBM Corporation. All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
*
|
||||
* $HEADER$
|
||||
*/
|
||||
#include <src/include/pmix_config.h>
|
||||
|
||||
#include <src/include/types.h>
|
||||
#include <src/include/pmix_stdint.h>
|
||||
#include <src/include/pmix_socket_errno.h>
|
||||
|
||||
#include <pmix.h>
|
||||
#include <pmix_common.h>
|
||||
#include <pmix_server.h>
|
||||
#include <pmix_rename.h>
|
||||
|
||||
#include "src/threads/threads.h"
|
||||
#include "src/util/argv.h"
|
||||
#include "src/util/error.h"
|
||||
#include "src/util/output.h"
|
||||
#include "src/mca/bfrops/bfrops.h"
|
||||
#include "src/mca/ptl/ptl.h"
|
||||
|
||||
#include "src/client/pmix_client_ops.h"
|
||||
#include "src/server/pmix_server_ops.h"
|
||||
#include "src/include/pmix_globals.h"
|
||||
|
||||
static void msgcbfunc(struct pmix_peer_t *peer,
|
||||
pmix_ptl_hdr_t *hdr,
|
||||
pmix_buffer_t *buf, void *cbdata)
|
||||
{
|
||||
pmix_shift_caddy_t *cd = (pmix_shift_caddy_t*)cbdata;
|
||||
int32_t m;
|
||||
pmix_status_t rc, status;
|
||||
|
||||
/* unpack the return status */
|
||||
m=1;
|
||||
PMIX_BFROPS_UNPACK(rc, peer, buf, &status, &m, PMIX_STATUS);
|
||||
if (PMIX_SUCCESS == rc && PMIX_SUCCESS == status) {
|
||||
/* store the request on our list - we are in an event, and
|
||||
* so this is safe */
|
||||
pmix_list_append(&pmix_globals.iof_requests, &cd->iofreq->super);
|
||||
} else if (PMIX_SUCCESS != rc) {
|
||||
status = rc;
|
||||
PMIX_RELEASE(cd->iofreq);
|
||||
}
|
||||
|
||||
pmix_output_verbose(2, pmix_client_globals.iof_output,
|
||||
"pmix:iof_register returned status %s", PMIx_Error_string(status));
|
||||
|
||||
if (NULL != cd->cbfunc.opcbfn) {
|
||||
cd->cbfunc.opcbfn(status, cd->cbdata);
|
||||
}
|
||||
PMIX_RELEASE(cd);
|
||||
}
|
||||
|
||||
PMIX_EXPORT pmix_status_t PMIx_IOF_register(const pmix_proc_t procs[], size_t nprocs,
|
||||
const pmix_info_t directives[], size_t ndirs,
|
||||
pmix_iof_channel_t channel, pmix_iof_cbfunc_t cbfunc,
|
||||
pmix_hdlr_reg_cbfunc_t regcbfunc, void *regcbdata)
|
||||
{
|
||||
pmix_shift_caddy_t *cd;
|
||||
pmix_cmd_t cmd = PMIX_IOF_CMD;
|
||||
pmix_buffer_t *msg;
|
||||
pmix_status_t rc;
|
||||
|
||||
PMIX_ACQUIRE_THREAD(&pmix_global_lock);
|
||||
|
||||
pmix_output_verbose(2, pmix_client_globals.iof_output,
|
||||
"pmix:iof_register");
|
||||
|
||||
if (pmix_globals.init_cntr <= 0) {
|
||||
PMIX_RELEASE_THREAD(&pmix_global_lock);
|
||||
return PMIX_ERR_INIT;
|
||||
}
|
||||
|
||||
/* if we are a server, we cannot do this */
|
||||
if (PMIX_PROC_IS_SERVER(pmix_globals.mypeer)) {
|
||||
PMIX_RELEASE_THREAD(&pmix_global_lock);
|
||||
return PMIX_ERR_NOT_SUPPORTED;
|
||||
}
|
||||
|
||||
/* if we aren't connected, don't attempt to send */
|
||||
if (!pmix_globals.connected) {
|
||||
PMIX_RELEASE_THREAD(&pmix_global_lock);
|
||||
return PMIX_ERR_UNREACH;
|
||||
}
|
||||
PMIX_RELEASE_THREAD(&pmix_global_lock);
|
||||
|
||||
/* send this request to the server */
|
||||
cd = PMIX_NEW(pmix_shift_caddy_t);
|
||||
if (NULL == cd) {
|
||||
return PMIX_ERR_NOMEM;
|
||||
}
|
||||
cd->cbfunc.hdlrregcbfn = regcbfunc;
|
||||
cd->cbdata = regcbdata;
|
||||
/* setup the request item */
|
||||
cd->iofreq = PMIX_NEW(pmix_iof_req_t);
|
||||
if (NULL == cd->iofreq) {
|
||||
PMIX_RELEASE(cd);
|
||||
return PMIX_ERR_NOMEM;
|
||||
}
|
||||
/* retain the channels and cbfunc */
|
||||
cd->iofreq->channels = channel;
|
||||
cd->iofreq->cbfunc = cbfunc;
|
||||
/* we don't need the source specifications - only the
|
||||
* server cares as it will filter against them */
|
||||
|
||||
/* setup the registration cmd */
|
||||
msg = PMIX_NEW(pmix_buffer_t);
|
||||
if (NULL == msg) {
|
||||
PMIX_RELEASE(cd->iofreq);
|
||||
PMIX_RELEASE(cd);
|
||||
return PMIX_ERR_NOMEM;
|
||||
}
|
||||
PMIX_BFROPS_PACK(rc, pmix_client_globals.myserver,
|
||||
msg, &cmd, 1, PMIX_COMMAND);
|
||||
if (PMIX_SUCCESS != rc) {
|
||||
PMIX_ERROR_LOG(rc);
|
||||
goto cleanup;
|
||||
}
|
||||
PMIX_BFROPS_PACK(rc, pmix_client_globals.myserver,
|
||||
msg, &nprocs, 1, PMIX_SIZE);
|
||||
if (PMIX_SUCCESS != rc) {
|
||||
PMIX_ERROR_LOG(rc);
|
||||
goto cleanup;
|
||||
}
|
||||
PMIX_BFROPS_PACK(rc, pmix_client_globals.myserver,
|
||||
msg, procs, nprocs, PMIX_PROC);
|
||||
if (PMIX_SUCCESS != rc) {
|
||||
PMIX_ERROR_LOG(rc);
|
||||
goto cleanup;
|
||||
}
|
||||
PMIX_BFROPS_PACK(rc, pmix_client_globals.myserver,
|
||||
msg, &ndirs, 1, PMIX_SIZE);
|
||||
if (PMIX_SUCCESS != rc) {
|
||||
PMIX_ERROR_LOG(rc);
|
||||
goto cleanup;
|
||||
}
|
||||
if (0 < ndirs) {
|
||||
PMIX_BFROPS_PACK(rc, pmix_client_globals.myserver,
|
||||
msg, directives, ndirs, PMIX_INFO);
|
||||
if (PMIX_SUCCESS != rc) {
|
||||
PMIX_ERROR_LOG(rc);
|
||||
goto cleanup;
|
||||
}
|
||||
}
|
||||
PMIX_BFROPS_PACK(rc, pmix_client_globals.myserver,
|
||||
msg, &channel, 1, PMIX_IOF_CHANNEL);
|
||||
if (PMIX_SUCCESS != rc) {
|
||||
PMIX_ERROR_LOG(rc);
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
pmix_output_verbose(2, pmix_client_globals.iof_output,
|
||||
"pmix:iof_request sending to server");
|
||||
PMIX_PTL_SEND_RECV(rc, pmix_client_globals.myserver,
|
||||
msg, msgcbfunc, (void*)cd);
|
||||
|
||||
cleanup:
|
||||
if (PMIX_SUCCESS != rc) {
|
||||
PMIX_ERROR_LOG(rc);
|
||||
PMIX_RELEASE(msg);
|
||||
PMIX_RELEASE(cd->iofreq);
|
||||
PMIX_RELEASE(cd);
|
||||
}
|
||||
return rc;
|
||||
}
|
@ -11,7 +11,7 @@
|
||||
* All rights reserved.
|
||||
* Copyright (c) 2007-2012 Los Alamos National Security, LLC.
|
||||
* All rights reserved.
|
||||
* Copyright (c) 2014-2017 Intel, Inc. All rights reserved.
|
||||
* Copyright (c) 2014-2018 Intel, Inc. All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
@ -216,40 +216,7 @@ PMIX_EXPORT const char* pmix_command_string(pmix_cmd_t cmd)
|
||||
return "JOB CONTROL";
|
||||
case PMIX_MONITOR_CMD:
|
||||
return "MONITOR";
|
||||
case PMIX_IOF_CMD:
|
||||
return "IOF";
|
||||
default:
|
||||
return "UNKNOWN";
|
||||
}
|
||||
}
|
||||
|
||||
/* this is not a thread-safe implementation. To correctly implement this,
|
||||
* we need to port the thread-safe data code from OPAL and use it here */
|
||||
static char answer[300];
|
||||
|
||||
PMIX_EXPORT const char* PMIx_IOF_channel_string(pmix_iof_channel_t channel)
|
||||
{
|
||||
size_t cnt=0;
|
||||
|
||||
memset(answer, 0, sizeof(answer));
|
||||
if (PMIX_FWD_STDIN_CHANNEL & channel) {
|
||||
strncpy(&answer[cnt], "STDIN ", strlen("STDIN "));
|
||||
cnt += strlen("STDIN ");
|
||||
}
|
||||
if (PMIX_FWD_STDOUT_CHANNEL & channel) {
|
||||
strncpy(&answer[cnt], "STDOUT ", strlen("STDOUT "));
|
||||
cnt += strlen("STDOUT ");
|
||||
}
|
||||
if (PMIX_FWD_STDERR_CHANNEL & channel) {
|
||||
strncpy(&answer[cnt], "STDERR ", strlen("STDERR "));
|
||||
cnt += strlen("STDERR ");
|
||||
}
|
||||
if (PMIX_FWD_STDDIAG_CHANNEL & channel) {
|
||||
strncpy(&answer[cnt], "STDDIAG ", strlen("STDDIAG "));
|
||||
cnt += strlen("STDDIAG ");
|
||||
}
|
||||
if (0 == cnt) {
|
||||
strncpy(&answer[cnt], "NONE", strlen("NONE"));
|
||||
}
|
||||
return answer;
|
||||
}
|
||||
|
@ -41,7 +41,7 @@
|
||||
pmix_info_t *info;
|
||||
size_t ninfo;
|
||||
pmix_notification_fn_t evhdlr;
|
||||
pmix_hdlr_reg_cbfunc_t evregcbfn;
|
||||
pmix_evhdlr_reg_cbfunc_t evregcbfn;
|
||||
void *cbdata;
|
||||
} pmix_rshift_caddy_t;
|
||||
static void rscon(pmix_rshift_caddy_t *p)
|
||||
@ -766,7 +766,7 @@ static void reg_event_hdlr(int sd, short args, void *cbdata)
|
||||
PMIX_EXPORT void PMIx_Register_event_handler(pmix_status_t codes[], size_t ncodes,
|
||||
pmix_info_t info[], size_t ninfo,
|
||||
pmix_notification_fn_t event_hdlr,
|
||||
pmix_hdlr_reg_cbfunc_t cbfunc,
|
||||
pmix_evhdlr_reg_cbfunc_t cbfunc,
|
||||
void *cbdata)
|
||||
{
|
||||
pmix_rshift_caddy_t *cd;
|
||||
|
@ -219,24 +219,6 @@ PMIX_EXPORT PMIX_CLASS_INSTANCE(pmix_peer_t,
|
||||
pmix_object_t,
|
||||
pcon, pdes);
|
||||
|
||||
static void iofreqcon(pmix_iof_req_t *p)
|
||||
{
|
||||
p->peer = NULL;
|
||||
memset(&p->pname, 0, sizeof(pmix_name_t));
|
||||
p->channels = PMIX_FWD_NO_CHANNELS;
|
||||
p->cbfunc = NULL;
|
||||
}
|
||||
static void iofreqdes(pmix_iof_req_t *p)
|
||||
{
|
||||
if (NULL != p->peer) {
|
||||
PMIX_RELEASE(p->peer);
|
||||
}
|
||||
}
|
||||
PMIX_EXPORT PMIX_CLASS_INSTANCE(pmix_iof_req_t,
|
||||
pmix_list_item_t,
|
||||
iofreqcon, iofreqdes);
|
||||
|
||||
|
||||
static void scon(pmix_shift_caddy_t *p)
|
||||
{
|
||||
PMIX_CONSTRUCT_LOCK(&p->lock);
|
||||
@ -252,7 +234,6 @@ static void scon(pmix_shift_caddy_t *p)
|
||||
p->directives = NULL;
|
||||
p->ndirs = 0;
|
||||
p->evhdlr = NULL;
|
||||
p->iofreq = NULL;
|
||||
p->kv = NULL;
|
||||
p->vptr = NULL;
|
||||
p->cd = NULL;
|
||||
|
@ -31,7 +31,6 @@
|
||||
#endif
|
||||
#include PMIX_EVENT_HEADER
|
||||
|
||||
#include <pmix.h>
|
||||
#include <pmix_common.h>
|
||||
|
||||
#include "src/class/pmix_hash_table.h"
|
||||
@ -53,6 +52,8 @@ BEGIN_C_DECLS
|
||||
|
||||
/* internal-only attributes */
|
||||
#define PMIX_BFROPS_MODULE "pmix.bfrops.mod" // (char*) name of bfrops plugin in-use by a given nspace
|
||||
#define PMIX_PNET_SETUP_APP "pmix.pnet.setapp" // (pmix_byte_object_t) blob containing info to be given to
|
||||
// pnet framework on remote nodes
|
||||
|
||||
/* define an internal-only process name that has
|
||||
* a dynamically-sized nspace field to save memory */
|
||||
@ -96,7 +97,6 @@ typedef uint8_t pmix_cmd_t;
|
||||
#define PMIX_MONITOR_CMD 19
|
||||
#define PMIX_GET_CREDENTIAL_CMD 20
|
||||
#define PMIX_VALIDATE_CRED_CMD 21
|
||||
#define PMIX_IOF_CMD 22
|
||||
|
||||
/* provide a "pretty-print" function for cmds */
|
||||
const char* pmix_command_string(pmix_cmd_t cmd);
|
||||
@ -228,17 +228,6 @@ typedef struct pmix_peer_t {
|
||||
PMIX_CLASS_DECLARATION(pmix_peer_t);
|
||||
|
||||
|
||||
/* tracker for IOF requests */
|
||||
typedef struct {
|
||||
pmix_list_item_t super;
|
||||
pmix_peer_t *peer;
|
||||
pmix_name_t pname;
|
||||
pmix_iof_channel_t channels;
|
||||
pmix_iof_cbfunc_t cbfunc;
|
||||
} pmix_iof_req_t;
|
||||
PMIX_CLASS_DECLARATION(pmix_iof_req_t);
|
||||
|
||||
|
||||
/* caddy for query requests */
|
||||
typedef struct {
|
||||
pmix_object_t super;
|
||||
@ -318,7 +307,6 @@ PMIX_CLASS_DECLARATION(pmix_server_caddy_t);
|
||||
pmix_info_t *directives;
|
||||
size_t ndirs;
|
||||
pmix_notification_fn_t evhdlr;
|
||||
pmix_iof_req_t *iofreq;
|
||||
pmix_kval_t *kv;
|
||||
pmix_value_t *vptr;
|
||||
pmix_server_caddy_t *cd;
|
||||
@ -326,8 +314,9 @@ PMIX_CLASS_DECLARATION(pmix_server_caddy_t);
|
||||
bool enviro;
|
||||
union {
|
||||
pmix_release_cbfunc_t relfn;
|
||||
pmix_hdlr_reg_cbfunc_t hdlrregcbfn;
|
||||
pmix_evhdlr_reg_cbfunc_t evregcbfn;
|
||||
pmix_op_cbfunc_t opcbfn;
|
||||
pmix_evhdlr_reg_cbfunc_t errregcbfn;
|
||||
} cbfunc;
|
||||
void *cbdata;
|
||||
size_t ref;
|
||||
@ -351,7 +340,7 @@ typedef struct {
|
||||
pmix_lookup_cbfunc_t lookupfn;
|
||||
pmix_spawn_cbfunc_t spawnfn;
|
||||
pmix_connect_cbfunc_t cnctfn;
|
||||
pmix_hdlr_reg_cbfunc_t hdlrregfn;
|
||||
pmix_evhdlr_reg_cbfunc_t errregfn;
|
||||
} cbfunc;
|
||||
size_t errhandler_ref;
|
||||
void *cbdata;
|
||||
@ -425,7 +414,6 @@ typedef struct {
|
||||
bool commits_pending;
|
||||
struct timeval event_window;
|
||||
pmix_list_t cached_events; // events waiting in the window prior to processing
|
||||
pmix_list_t iof_requests; // list of pmix_iof_req_t IOF requests
|
||||
pmix_ring_buffer_t notifications; // ring buffer of pending notifications
|
||||
/* processes also need a place where they can store
|
||||
* their own internal data - e.g., data provided by
|
||||
|
@ -13,7 +13,7 @@
|
||||
* Copyright (c) 2008-2013 Cisco Systems, Inc. All rights reserved.
|
||||
* Copyright (c) 2012-2015 Los Alamos National Security, LLC. All rights
|
||||
* reserved.
|
||||
* Copyright (c) 2016 Intel, Inc. All rights reserved
|
||||
* Copyright (c) 2016-2018 Intel, Inc. All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
@ -315,7 +315,7 @@ int pmix_mca_base_var_group_component_register (const pmix_mca_base_component_t
|
||||
const char *description)
|
||||
{
|
||||
/* 1.7 components do not store the project */
|
||||
return group_register (NULL, component->pmix_mca_type_name,
|
||||
return group_register (component->pmix_mca_project_name, component->pmix_mca_type_name,
|
||||
component->pmix_mca_component_name, description);
|
||||
}
|
||||
|
||||
|
@ -379,8 +379,6 @@ PMIX_EXPORT pmix_status_t pmix_bfrops_base_pack_val(pmix_buffer_t *buffer,
|
||||
pmix_value_t *p);
|
||||
PMIX_EXPORT pmix_status_t pmix_bfrops_base_pack_alloc_directive(pmix_buffer_t *buffer, const void *src,
|
||||
int32_t num_vals, pmix_data_type_t type);
|
||||
PMIX_EXPORT pmix_status_t pmix_bfrops_base_pack_iof_channel(pmix_buffer_t *buffer, const void *src,
|
||||
int32_t num_vals, pmix_data_type_t type);
|
||||
|
||||
/*
|
||||
* "Standard" unpack functions
|
||||
@ -468,8 +466,6 @@ PMIX_EXPORT pmix_status_t pmix_bfrops_base_unpack_query(pmix_buffer_t *buffer, v
|
||||
int32_t *num_vals, pmix_data_type_t type);
|
||||
PMIX_EXPORT pmix_status_t pmix_bfrops_base_unpack_alloc_directive(pmix_buffer_t *buffer, void *dest,
|
||||
int32_t *num_vals, pmix_data_type_t type);
|
||||
PMIX_EXPORT pmix_status_t pmix_bfrops_base_unpack_iof_channel(pmix_buffer_t *buffer, void *dest,
|
||||
int32_t *num_vals, pmix_data_type_t type);
|
||||
/**** DEPRECATED ****/
|
||||
PMIX_EXPORT pmix_status_t pmix_bfrops_base_unpack_array(pmix_buffer_t *buffer, void *dest,
|
||||
int32_t *num_vals, pmix_data_type_t type);
|
||||
@ -641,9 +637,6 @@ PMIX_EXPORT pmix_status_t pmix_bfrops_base_print_rank(char **output, char *prefi
|
||||
PMIX_EXPORT pmix_status_t pmix_bfrops_base_print_alloc_directive(char **output, char *prefix,
|
||||
pmix_alloc_directive_t *src,
|
||||
pmix_data_type_t type);
|
||||
PMIX_EXPORT pmix_status_t pmix_bfrops_base_print_iof_channel(char **output, char *prefix,
|
||||
pmix_iof_channel_t *src,
|
||||
pmix_data_type_t type);
|
||||
|
||||
/*
|
||||
* Common helper functions
|
||||
|
@ -113,7 +113,6 @@ pmix_status_t pmix_bfrops_base_std_copy(void **dest, void *src,
|
||||
|
||||
case PMIX_INT16:
|
||||
case PMIX_UINT16:
|
||||
case PMIX_IOF_CHANNEL:
|
||||
datasize = 2;
|
||||
break;
|
||||
|
||||
|
@ -9,7 +9,7 @@
|
||||
* University of Stuttgart. All rights reserved.
|
||||
* Copyright (c) 2004-2005 The Regents of the University of California.
|
||||
* All rights reserved.
|
||||
* Copyright (c) 2015-2018 Intel, Inc. All rights reserved.
|
||||
* Copyright (c) 2015-2017 Intel, Inc. All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
@ -1270,9 +1270,3 @@ pmix_status_t pmix_bfrops_base_pack_array(pmix_buffer_t *buffer, const void *src
|
||||
|
||||
return PMIX_SUCCESS;
|
||||
}
|
||||
|
||||
PMIX_EXPORT pmix_status_t pmix_bfrops_base_pack_iof_channel(pmix_buffer_t *buffer, const void *src,
|
||||
int32_t num_vals, pmix_data_type_t type)
|
||||
{
|
||||
return pmix_bfrops_base_pack_int16(buffer, src, num_vals, PMIX_UINT16);
|
||||
}
|
||||
|
@ -1636,35 +1636,6 @@ pmix_status_t pmix_bfrops_base_print_alloc_directive(char **output, char *prefix
|
||||
}
|
||||
}
|
||||
|
||||
pmix_status_t pmix_bfrops_base_print_iof_channel(char **output, char *prefix,
|
||||
pmix_iof_channel_t *src,
|
||||
pmix_data_type_t type)
|
||||
{
|
||||
char *prefx;
|
||||
int ret;
|
||||
|
||||
/* deal with NULL prefix */
|
||||
if (NULL == prefix) {
|
||||
if (0 > asprintf(&prefx, " ")) {
|
||||
return PMIX_ERR_NOMEM;
|
||||
}
|
||||
} else {
|
||||
prefx = prefix;
|
||||
}
|
||||
|
||||
ret = asprintf(output, "%sData type: PMIX_IOF_CHANNEL\tValue: %s",
|
||||
prefx, PMIx_IOF_channel_string(*src));
|
||||
if (prefx != prefix) {
|
||||
free(prefx);
|
||||
}
|
||||
|
||||
if (0 > ret) {
|
||||
return PMIX_ERR_OUT_OF_RESOURCE;
|
||||
} else {
|
||||
return PMIX_SUCCESS;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**** DEPRECATED ****/
|
||||
pmix_status_t pmix_bfrops_base_print_array(char **output, char *prefix,
|
||||
|
@ -1603,11 +1603,6 @@ pmix_status_t pmix_bfrops_base_unpack_alloc_directive(pmix_buffer_t *buffer, voi
|
||||
return pmix_bfrops_base_unpack_byte(buffer, dest, num_vals, PMIX_UINT8);
|
||||
}
|
||||
|
||||
pmix_status_t pmix_bfrops_base_unpack_iof_channel(pmix_buffer_t *buffer, void *dest,
|
||||
int32_t *num_vals, pmix_data_type_t type)
|
||||
{
|
||||
return pmix_bfrops_base_unpack_int16(buffer, dest, num_vals, PMIX_UINT16);
|
||||
}
|
||||
|
||||
/**** DEPRECATED ****/
|
||||
pmix_status_t pmix_bfrops_base_unpack_array(pmix_buffer_t *buffer, void *dest,
|
||||
|
@ -1,50 +0,0 @@
|
||||
# -*- makefile -*-
|
||||
#
|
||||
# Copyright (c) 2004-2005 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 (c) 2012 Los Alamos National Security, Inc. All rights reserved.
|
||||
# Copyright (c) 2013-2017 Intel, Inc. All rights reserved.
|
||||
# $COPYRIGHT$
|
||||
#
|
||||
# Additional copyrights may follow
|
||||
#
|
||||
# $HEADER$
|
||||
#
|
||||
|
||||
headers = bfrop_pmix3.h
|
||||
sources = \
|
||||
bfrop_pmix3_component.c \
|
||||
bfrop_pmix3.c
|
||||
|
||||
# Make the output library in this directory, and name it either
|
||||
# mca_<type>_<name>.la (for DSO builds) or libmca_<type>_<name>.la
|
||||
# (for static builds).
|
||||
|
||||
if MCA_BUILD_pmix_bfrops_v3_DSO
|
||||
lib =
|
||||
lib_sources =
|
||||
component = mca_bfrops_v3.la
|
||||
component_sources = $(headers) $(sources)
|
||||
else
|
||||
lib = libmca_bfrops_v3.la
|
||||
lib_sources = $(headers) $(sources)
|
||||
component =
|
||||
component_sources =
|
||||
endif
|
||||
|
||||
mcacomponentdir = $(pmixlibdir)
|
||||
mcacomponent_LTLIBRARIES = $(component)
|
||||
mca_bfrops_v3_la_SOURCES = $(component_sources)
|
||||
mca_bfrops_v3_la_LDFLAGS = -module -avoid-version
|
||||
|
||||
noinst_LTLIBRARIES = $(lib)
|
||||
libmca_bfrops_v3_la_SOURCES = $(lib_sources)
|
||||
libmca_bfrops_v3_la_LDFLAGS = -module -avoid-version
|
@ -1,456 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2010 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) 2010-2011 Oak Ridge National Labs. All rights reserved.
|
||||
* Copyright (c) 2011-2014 Cisco Systems, Inc. All rights reserved.
|
||||
* Copyright (c) 2011-2013 Los Alamos National Security, LLC. All rights
|
||||
* reserved.
|
||||
* Copyright (c) 2013-2017 Intel, Inc. All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
*
|
||||
* $HEADER$
|
||||
*
|
||||
*/
|
||||
|
||||
#include <src/include/pmix_config.h>
|
||||
|
||||
#include "src/mca/bfrops/base/base.h"
|
||||
#include "bfrop_pmix3.h"
|
||||
|
||||
static pmix_status_t init(void);
|
||||
static void finalize(void);
|
||||
static pmix_status_t pmix3_pack(pmix_buffer_t *buffer,
|
||||
const void *src, int num_vals,
|
||||
pmix_data_type_t type);
|
||||
static pmix_status_t pmix3_unpack(pmix_buffer_t *buffer, void *dest,
|
||||
int32_t *num_vals, pmix_data_type_t type);
|
||||
static pmix_status_t pmix3_copy(void **dest, void *src,
|
||||
pmix_data_type_t type);
|
||||
static pmix_status_t pmix3_print(char **output, char *prefix,
|
||||
void *src, pmix_data_type_t type);
|
||||
static pmix_status_t register_type(const char *name,
|
||||
pmix_data_type_t type,
|
||||
pmix_bfrop_pack_fn_t pack,
|
||||
pmix_bfrop_unpack_fn_t unpack,
|
||||
pmix_bfrop_copy_fn_t copy,
|
||||
pmix_bfrop_print_fn_t print);
|
||||
static const char* data_type_string(pmix_data_type_t type);
|
||||
|
||||
pmix_bfrops_module_t pmix_bfrops_pmix3_module = {
|
||||
.version = "v3",
|
||||
.init = init,
|
||||
.finalize = finalize,
|
||||
.pack = pmix3_pack,
|
||||
.unpack = pmix3_unpack,
|
||||
.copy = pmix3_copy,
|
||||
.print = pmix3_print,
|
||||
.copy_payload = pmix_bfrops_base_copy_payload,
|
||||
.value_xfer = pmix_bfrops_base_value_xfer,
|
||||
.value_load = pmix_bfrops_base_value_load,
|
||||
.value_unload = pmix_bfrops_base_value_unload,
|
||||
.value_cmp = pmix_bfrops_base_value_cmp,
|
||||
.register_type = register_type,
|
||||
.data_type_string = data_type_string
|
||||
};
|
||||
|
||||
static pmix_status_t init(void)
|
||||
{
|
||||
/* some standard types don't require anything special */
|
||||
PMIX_REGISTER_TYPE("PMIX_BOOL", PMIX_BOOL,
|
||||
pmix_bfrops_base_pack_bool,
|
||||
pmix_bfrops_base_unpack_bool,
|
||||
pmix_bfrops_base_std_copy,
|
||||
pmix_bfrops_base_print_bool,
|
||||
&mca_bfrops_v3_component.types);
|
||||
|
||||
PMIX_REGISTER_TYPE("PMIX_BYTE", PMIX_BYTE,
|
||||
pmix_bfrops_base_pack_byte,
|
||||
pmix_bfrops_base_unpack_byte,
|
||||
pmix_bfrops_base_std_copy,
|
||||
pmix_bfrops_base_print_byte,
|
||||
&mca_bfrops_v3_component.types);
|
||||
|
||||
PMIX_REGISTER_TYPE("PMIX_STRING", PMIX_STRING,
|
||||
pmix_bfrops_base_pack_string,
|
||||
pmix_bfrops_base_unpack_string,
|
||||
pmix_bfrops_base_copy_string,
|
||||
pmix_bfrops_base_print_string,
|
||||
&mca_bfrops_v3_component.types);
|
||||
|
||||
/* Register the rest of the standard generic types to point to internal functions */
|
||||
PMIX_REGISTER_TYPE("PMIX_SIZE", PMIX_SIZE,
|
||||
pmix_bfrops_base_pack_sizet,
|
||||
pmix_bfrops_base_unpack_sizet,
|
||||
pmix_bfrops_base_std_copy,
|
||||
pmix_bfrops_base_print_size,
|
||||
&mca_bfrops_v3_component.types);
|
||||
|
||||
PMIX_REGISTER_TYPE("PMIX_PID", PMIX_PID,
|
||||
pmix_bfrops_base_pack_pid,
|
||||
pmix_bfrops_base_unpack_pid,
|
||||
pmix_bfrops_base_std_copy,
|
||||
pmix_bfrops_base_print_pid,
|
||||
&mca_bfrops_v3_component.types);
|
||||
|
||||
PMIX_REGISTER_TYPE("PMIX_INT", PMIX_INT,
|
||||
pmix_bfrops_base_pack_int,
|
||||
pmix_bfrops_base_unpack_int,
|
||||
pmix_bfrops_base_std_copy,
|
||||
pmix_bfrops_base_print_int,
|
||||
&mca_bfrops_v3_component.types);
|
||||
|
||||
/* Register all the standard fixed types to point to base functions */
|
||||
PMIX_REGISTER_TYPE("PMIX_INT8", PMIX_INT8,
|
||||
pmix_bfrops_base_pack_byte,
|
||||
pmix_bfrops_base_unpack_byte,
|
||||
pmix_bfrops_base_std_copy,
|
||||
pmix_bfrops_base_print_int8,
|
||||
&mca_bfrops_v3_component.types);
|
||||
|
||||
PMIX_REGISTER_TYPE("PMIX_INT16", PMIX_INT16,
|
||||
pmix_bfrops_base_pack_int16,
|
||||
pmix_bfrops_base_unpack_int16,
|
||||
pmix_bfrops_base_std_copy,
|
||||
pmix_bfrops_base_print_int16,
|
||||
&mca_bfrops_v3_component.types);
|
||||
|
||||
PMIX_REGISTER_TYPE("PMIX_INT32", PMIX_INT32,
|
||||
pmix_bfrops_base_pack_int32,
|
||||
pmix_bfrops_base_unpack_int32,
|
||||
pmix_bfrops_base_std_copy,
|
||||
pmix_bfrops_base_print_int32,
|
||||
&mca_bfrops_v3_component.types);
|
||||
|
||||
PMIX_REGISTER_TYPE("PMIX_INT64", PMIX_INT64,
|
||||
pmix_bfrops_base_pack_int64,
|
||||
pmix_bfrops_base_unpack_int64,
|
||||
pmix_bfrops_base_std_copy,
|
||||
pmix_bfrops_base_print_int64,
|
||||
&mca_bfrops_v3_component.types);
|
||||
|
||||
PMIX_REGISTER_TYPE("PMIX_UINT", PMIX_UINT,
|
||||
pmix_bfrops_base_pack_int,
|
||||
pmix_bfrops_base_unpack_int,
|
||||
pmix_bfrops_base_std_copy,
|
||||
pmix_bfrops_base_print_uint,
|
||||
&mca_bfrops_v3_component.types);
|
||||
|
||||
PMIX_REGISTER_TYPE("PMIX_UINT8", PMIX_UINT8,
|
||||
pmix_bfrops_base_pack_byte,
|
||||
pmix_bfrops_base_unpack_byte,
|
||||
pmix_bfrops_base_std_copy,
|
||||
pmix_bfrops_base_print_uint8,
|
||||
&mca_bfrops_v3_component.types);
|
||||
|
||||
PMIX_REGISTER_TYPE("PMIX_UINT16", PMIX_UINT16,
|
||||
pmix_bfrops_base_pack_int16,
|
||||
pmix_bfrops_base_unpack_int16,
|
||||
pmix_bfrops_base_std_copy,
|
||||
pmix_bfrops_base_print_uint16,
|
||||
&mca_bfrops_v3_component.types);
|
||||
|
||||
PMIX_REGISTER_TYPE("PMIX_UINT32", PMIX_UINT32,
|
||||
pmix_bfrops_base_pack_int32,
|
||||
pmix_bfrops_base_unpack_int32,
|
||||
pmix_bfrops_base_std_copy,
|
||||
pmix_bfrops_base_print_uint32,
|
||||
&mca_bfrops_v3_component.types);
|
||||
|
||||
PMIX_REGISTER_TYPE("PMIX_UINT64", PMIX_UINT64,
|
||||
pmix_bfrops_base_pack_int64,
|
||||
pmix_bfrops_base_unpack_int64,
|
||||
pmix_bfrops_base_std_copy,
|
||||
pmix_bfrops_base_print_uint64,
|
||||
&mca_bfrops_v3_component.types);
|
||||
|
||||
PMIX_REGISTER_TYPE("PMIX_FLOAT", PMIX_FLOAT,
|
||||
pmix_bfrops_base_pack_float,
|
||||
pmix_bfrops_base_unpack_float,
|
||||
pmix_bfrops_base_std_copy,
|
||||
pmix_bfrops_base_print_float,
|
||||
&mca_bfrops_v3_component.types);
|
||||
|
||||
PMIX_REGISTER_TYPE("PMIX_DOUBLE", PMIX_DOUBLE,
|
||||
pmix_bfrops_base_pack_double,
|
||||
pmix_bfrops_base_unpack_double,
|
||||
pmix_bfrops_base_std_copy,
|
||||
pmix_bfrops_base_print_double,
|
||||
&mca_bfrops_v3_component.types);
|
||||
|
||||
PMIX_REGISTER_TYPE("PMIX_TIMEVAL", PMIX_TIMEVAL,
|
||||
pmix_bfrops_base_pack_timeval,
|
||||
pmix_bfrops_base_unpack_timeval,
|
||||
pmix_bfrops_base_std_copy,
|
||||
pmix_bfrops_base_print_timeval,
|
||||
&mca_bfrops_v3_component.types);
|
||||
|
||||
PMIX_REGISTER_TYPE("PMIX_TIME", PMIX_TIME,
|
||||
pmix_bfrops_base_pack_time,
|
||||
pmix_bfrops_base_unpack_time,
|
||||
pmix_bfrops_base_std_copy,
|
||||
pmix_bfrops_base_print_time,
|
||||
&mca_bfrops_v3_component.types);
|
||||
|
||||
PMIX_REGISTER_TYPE("PMIX_STATUS", PMIX_STATUS,
|
||||
pmix_bfrops_base_pack_status,
|
||||
pmix_bfrops_base_unpack_status,
|
||||
pmix_bfrops_base_std_copy,
|
||||
pmix_bfrops_base_print_status,
|
||||
&mca_bfrops_v3_component.types);
|
||||
|
||||
PMIX_REGISTER_TYPE("PMIX_VALUE", PMIX_VALUE,
|
||||
pmix_bfrops_base_pack_value,
|
||||
pmix_bfrops_base_unpack_value,
|
||||
pmix_bfrops_base_copy_value,
|
||||
pmix_bfrops_base_print_value,
|
||||
&mca_bfrops_v3_component.types);
|
||||
|
||||
PMIX_REGISTER_TYPE("PMIX_PROC", PMIX_PROC,
|
||||
pmix_bfrops_base_pack_proc,
|
||||
pmix_bfrops_base_unpack_proc,
|
||||
pmix_bfrops_base_copy_proc,
|
||||
pmix_bfrops_base_print_proc,
|
||||
&mca_bfrops_v3_component.types);
|
||||
|
||||
PMIX_REGISTER_TYPE("PMIX_APP", PMIX_APP,
|
||||
pmix_bfrops_base_pack_app,
|
||||
pmix_bfrops_base_unpack_app,
|
||||
pmix_bfrops_base_copy_app,
|
||||
pmix_bfrops_base_print_app,
|
||||
&mca_bfrops_v3_component.types);
|
||||
|
||||
PMIX_REGISTER_TYPE("PMIX_INFO", PMIX_INFO,
|
||||
pmix_bfrops_base_pack_info,
|
||||
pmix_bfrops_base_unpack_info,
|
||||
pmix_bfrops_base_copy_info,
|
||||
pmix_bfrops_base_print_info,
|
||||
&mca_bfrops_v3_component.types);
|
||||
|
||||
PMIX_REGISTER_TYPE("PMIX_PDATA", PMIX_PDATA,
|
||||
pmix_bfrops_base_pack_pdata,
|
||||
pmix_bfrops_base_unpack_pdata,
|
||||
pmix_bfrops_base_copy_pdata,
|
||||
pmix_bfrops_base_print_pdata,
|
||||
&mca_bfrops_v3_component.types);
|
||||
|
||||
PMIX_REGISTER_TYPE("PMIX_BUFFER", PMIX_BUFFER,
|
||||
pmix_bfrops_base_pack_buf,
|
||||
pmix_bfrops_base_unpack_buf,
|
||||
pmix_bfrops_base_copy_buf,
|
||||
pmix_bfrops_base_print_buf,
|
||||
&mca_bfrops_v3_component.types);
|
||||
|
||||
PMIX_REGISTER_TYPE("PMIX_BYTE_OBJECT", PMIX_BYTE_OBJECT,
|
||||
pmix_bfrops_base_pack_bo,
|
||||
pmix_bfrops_base_unpack_bo,
|
||||
pmix_bfrops_base_copy_bo,
|
||||
pmix_bfrops_base_print_bo,
|
||||
&mca_bfrops_v3_component.types);
|
||||
|
||||
PMIX_REGISTER_TYPE("PMIX_KVAL", PMIX_KVAL,
|
||||
pmix_bfrops_base_pack_kval,
|
||||
pmix_bfrops_base_unpack_kval,
|
||||
pmix_bfrops_base_copy_kval,
|
||||
pmix_bfrops_base_print_kval,
|
||||
&mca_bfrops_v3_component.types);
|
||||
|
||||
PMIX_REGISTER_TYPE("PMIX_MODEX", PMIX_MODEX,
|
||||
pmix_bfrops_base_pack_modex,
|
||||
pmix_bfrops_base_unpack_modex,
|
||||
pmix_bfrops_base_copy_modex,
|
||||
pmix_bfrops_base_print_modex,
|
||||
&mca_bfrops_v3_component.types);
|
||||
|
||||
/* these are fixed-sized values and can be done by base */
|
||||
PMIX_REGISTER_TYPE("PMIX_PERSIST", PMIX_PERSIST,
|
||||
pmix_bfrops_base_pack_persist,
|
||||
pmix_bfrops_base_unpack_persist,
|
||||
pmix_bfrops_base_std_copy,
|
||||
pmix_bfrops_base_print_persist,
|
||||
&mca_bfrops_v3_component.types);
|
||||
|
||||
PMIX_REGISTER_TYPE("PMIX_POINTER", PMIX_POINTER,
|
||||
pmix_bfrops_base_pack_ptr,
|
||||
pmix_bfrops_base_unpack_ptr,
|
||||
pmix_bfrops_base_std_copy,
|
||||
pmix_bfrops_base_print_ptr,
|
||||
&mca_bfrops_v3_component.types);
|
||||
|
||||
PMIX_REGISTER_TYPE("PMIX_SCOPE", PMIX_SCOPE,
|
||||
pmix_bfrops_base_pack_scope,
|
||||
pmix_bfrops_base_unpack_scope,
|
||||
pmix_bfrops_base_std_copy,
|
||||
pmix_bfrops_base_std_copy,
|
||||
&mca_bfrops_v3_component.types);
|
||||
|
||||
PMIX_REGISTER_TYPE("PMIX_DATA_RANGE", PMIX_DATA_RANGE,
|
||||
pmix_bfrops_base_pack_range,
|
||||
pmix_bfrops_base_unpack_range,
|
||||
pmix_bfrops_base_std_copy,
|
||||
pmix_bfrops_base_print_ptr,
|
||||
&mca_bfrops_v3_component.types);
|
||||
|
||||
PMIX_REGISTER_TYPE("PMIX_COMMAND", PMIX_COMMAND,
|
||||
pmix_bfrops_base_pack_cmd,
|
||||
pmix_bfrops_base_unpack_cmd,
|
||||
pmix_bfrops_base_std_copy,
|
||||
pmix_bfrops_base_print_cmd,
|
||||
&mca_bfrops_v3_component.types);
|
||||
|
||||
PMIX_REGISTER_TYPE("PMIX_INFO_DIRECTIVES", PMIX_INFO_DIRECTIVES,
|
||||
pmix_bfrops_base_pack_info_directives,
|
||||
pmix_bfrops_base_unpack_info_directives,
|
||||
pmix_bfrops_base_std_copy,
|
||||
pmix_bfrops_base_print_info_directives,
|
||||
&mca_bfrops_v3_component.types);
|
||||
|
||||
PMIX_REGISTER_TYPE("PMIX_DATA_TYPE", PMIX_DATA_TYPE,
|
||||
pmix_bfrops_base_pack_datatype,
|
||||
pmix_bfrops_base_unpack_datatype,
|
||||
pmix_bfrops_base_std_copy,
|
||||
pmix_bfrops_base_print_datatype,
|
||||
&mca_bfrops_v3_component.types);
|
||||
|
||||
PMIX_REGISTER_TYPE("PMIX_PROC_STATE", PMIX_PROC_STATE,
|
||||
pmix_bfrops_base_pack_pstate,
|
||||
pmix_bfrops_base_unpack_pstate,
|
||||
pmix_bfrops_base_std_copy,
|
||||
pmix_bfrops_base_print_pstate,
|
||||
&mca_bfrops_v3_component.types);
|
||||
|
||||
PMIX_REGISTER_TYPE("PMIX_PROC_INFO", PMIX_PROC_INFO,
|
||||
pmix_bfrops_base_pack_pinfo,
|
||||
pmix_bfrops_base_unpack_pinfo,
|
||||
pmix_bfrops_base_copy_pinfo,
|
||||
pmix_bfrops_base_print_pinfo,
|
||||
&mca_bfrops_v3_component.types);
|
||||
|
||||
PMIX_REGISTER_TYPE("PMIX_DATA_ARRAY", PMIX_DATA_ARRAY,
|
||||
pmix_bfrops_base_pack_darray,
|
||||
pmix_bfrops_base_unpack_darray,
|
||||
pmix_bfrops_base_copy_darray,
|
||||
pmix_bfrops_base_print_darray,
|
||||
&mca_bfrops_v3_component.types);
|
||||
|
||||
PMIX_REGISTER_TYPE("PMIX_PROC_RANK", PMIX_PROC_RANK,
|
||||
pmix_bfrops_base_pack_rank,
|
||||
pmix_bfrops_base_unpack_rank,
|
||||
pmix_bfrops_base_std_copy,
|
||||
pmix_bfrops_base_print_rank,
|
||||
&mca_bfrops_v3_component.types);
|
||||
|
||||
PMIX_REGISTER_TYPE("PMIX_QUERY", PMIX_QUERY,
|
||||
pmix_bfrops_base_pack_query,
|
||||
pmix_bfrops_base_unpack_query,
|
||||
pmix_bfrops_base_copy_query,
|
||||
pmix_bfrops_base_print_query,
|
||||
&mca_bfrops_v3_component.types);
|
||||
|
||||
PMIX_REGISTER_TYPE("PMIX_COMPRESSED_STRING",
|
||||
PMIX_COMPRESSED_STRING,
|
||||
pmix_bfrops_base_pack_bo,
|
||||
pmix_bfrops_base_unpack_bo,
|
||||
pmix_bfrops_base_copy_bo,
|
||||
pmix_bfrops_base_print_bo,
|
||||
&mca_bfrops_v3_component.types);
|
||||
|
||||
PMIX_REGISTER_TYPE("PMIX_ALLOC_DIRECTIVE",
|
||||
PMIX_ALLOC_DIRECTIVE,
|
||||
pmix_bfrops_base_pack_alloc_directive,
|
||||
pmix_bfrops_base_unpack_alloc_directive,
|
||||
pmix_bfrops_base_std_copy,
|
||||
pmix_bfrops_base_print_alloc_directive,
|
||||
&mca_bfrops_v3_component.types);
|
||||
|
||||
PMIX_REGISTER_TYPE("PMIX_IOF_CHANNEL",
|
||||
PMIX_IOF_CHANNEL,
|
||||
pmix_bfrops_base_pack_iof_channel,
|
||||
pmix_bfrops_base_unpack_iof_channel,
|
||||
pmix_bfrops_base_std_copy,
|
||||
pmix_bfrops_base_print_iof_channel,
|
||||
&mca_bfrops_v3_component.types);
|
||||
|
||||
/**** DEPRECATED ****/
|
||||
PMIX_REGISTER_TYPE("PMIX_INFO_ARRAY", PMIX_INFO_ARRAY,
|
||||
pmix_bfrops_base_pack_array,
|
||||
pmix_bfrops_base_unpack_array,
|
||||
pmix_bfrops_base_copy_array,
|
||||
pmix_bfrops_base_print_array,
|
||||
&mca_bfrops_v3_component.types);
|
||||
/********************/
|
||||
|
||||
|
||||
return PMIX_SUCCESS;
|
||||
}
|
||||
|
||||
static void finalize(void)
|
||||
{
|
||||
int n;
|
||||
pmix_bfrop_type_info_t *info;
|
||||
|
||||
for (n=0; n < mca_bfrops_v3_component.types.size; n++) {
|
||||
if (NULL != (info = (pmix_bfrop_type_info_t*)pmix_pointer_array_get_item(&mca_bfrops_v3_component.types, n))) {
|
||||
PMIX_RELEASE(info);
|
||||
pmix_pointer_array_set_item(&mca_bfrops_v3_component.types, n, NULL);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static pmix_status_t pmix3_pack(pmix_buffer_t *buffer,
|
||||
const void *src, int num_vals,
|
||||
pmix_data_type_t type)
|
||||
{
|
||||
/* kick the process off by passing this in to the base */
|
||||
return pmix_bfrops_base_pack(&mca_bfrops_v3_component.types,
|
||||
buffer, src, num_vals, type);
|
||||
}
|
||||
|
||||
static pmix_status_t pmix3_unpack(pmix_buffer_t *buffer, void *dest,
|
||||
int32_t *num_vals, pmix_data_type_t type)
|
||||
{
|
||||
/* kick the process off by passing this in to the base */
|
||||
return pmix_bfrops_base_unpack(&mca_bfrops_v3_component.types,
|
||||
buffer, dest, num_vals, type);
|
||||
}
|
||||
|
||||
static pmix_status_t pmix3_copy(void **dest, void *src,
|
||||
pmix_data_type_t type)
|
||||
{
|
||||
return pmix_bfrops_base_copy(&mca_bfrops_v3_component.types,
|
||||
dest, src, type);
|
||||
}
|
||||
|
||||
static pmix_status_t pmix3_print(char **output, char *prefix,
|
||||
void *src, pmix_data_type_t type)
|
||||
{
|
||||
return pmix_bfrops_base_print(&mca_bfrops_v3_component.types,
|
||||
output, prefix, src, type);
|
||||
}
|
||||
|
||||
static pmix_status_t register_type(const char *name, pmix_data_type_t type,
|
||||
pmix_bfrop_pack_fn_t pack,
|
||||
pmix_bfrop_unpack_fn_t unpack,
|
||||
pmix_bfrop_copy_fn_t copy,
|
||||
pmix_bfrop_print_fn_t print)
|
||||
{
|
||||
PMIX_REGISTER_TYPE(name, type,
|
||||
pack, unpack,
|
||||
copy, print,
|
||||
&mca_bfrops_v3_component.types);
|
||||
return PMIX_SUCCESS;
|
||||
}
|
||||
|
||||
static const char* data_type_string(pmix_data_type_t type)
|
||||
{
|
||||
return pmix_bfrops_base_data_type_string(&mca_bfrops_v3_component.types, type);
|
||||
}
|
@ -1,34 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2008 The Trustees of Indiana University and Indiana
|
||||
* University Research and Technology
|
||||
* Corporation. All rights reserved.
|
||||
* Copyright (c) 2004-2006 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) 2016-2017 Intel, Inc. All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
*
|
||||
* $HEADER$
|
||||
*/
|
||||
|
||||
#ifndef PMIX_BFROPS_PMIX3_H
|
||||
#define PMIX_BFROPS_PMIX3_H
|
||||
|
||||
#include "src/mca/bfrops/bfrops.h"
|
||||
|
||||
BEGIN_C_DECLS
|
||||
|
||||
/* the component must be visible data for the linker to find it */
|
||||
PMIX_EXPORT extern pmix_bfrops_base_component_t mca_bfrops_v3_component;
|
||||
|
||||
extern pmix_bfrops_module_t pmix_bfrops_pmix3_module;
|
||||
|
||||
END_C_DECLS
|
||||
|
||||
#endif /* PMIX_BFROPS_PMIX3_H */
|
@ -1,99 +0,0 @@
|
||||
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
|
||||
/*
|
||||
* 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 Tennbfropsee and The University
|
||||
* of Tennbfropsee 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) 2015 Los Alamos National Security, LLC. All rights
|
||||
* reserved.
|
||||
* Copyright (c) 2016-2017 Intel, Inc. All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
*
|
||||
* $HEADER$
|
||||
*
|
||||
* These symbols are in a file by themselves to provide nice linker
|
||||
* semantics. Since linkers generally pull in symbols by object
|
||||
* files, keeping these symbols as the only symbols in this file
|
||||
* prevents utility programs such as "ompi_info" from having to import
|
||||
* entire components just to query their version and parameters.
|
||||
*/
|
||||
|
||||
#include <src/include/pmix_config.h>
|
||||
#include <pmix_common.h>
|
||||
#include "src/include/types.h"
|
||||
#include "src/include/pmix_globals.h"
|
||||
|
||||
#include "src/util/error.h"
|
||||
#include "src/server/pmix_server_ops.h"
|
||||
#include "src/mca/bfrops/base/base.h"
|
||||
#include "bfrop_pmix3.h"
|
||||
|
||||
extern pmix_bfrops_module_t pmix_bfrops_pmix3_module;
|
||||
|
||||
static pmix_status_t component_open(void);
|
||||
static pmix_status_t component_query(pmix_mca_base_module_t **module, int *priority);
|
||||
static pmix_status_t component_close(void);
|
||||
static pmix_bfrops_module_t* assign_module(void);
|
||||
|
||||
/*
|
||||
* Instantiate the public struct with all of our public information
|
||||
* and pointers to our public functions in it
|
||||
*/
|
||||
pmix_bfrops_base_component_t mca_bfrops_v3_component = {
|
||||
.base = {
|
||||
PMIX_BFROPS_BASE_VERSION_1_0_0,
|
||||
|
||||
/* Component name and version */
|
||||
.pmix_mca_component_name = "v3",
|
||||
PMIX_MCA_BASE_MAKE_VERSION(component, PMIX_MAJOR_VERSION, PMIX_MINOR_VERSION,
|
||||
PMIX_RELEASE_VERSION),
|
||||
|
||||
/* Component open and close functions */
|
||||
.pmix_mca_open_component = component_open,
|
||||
.pmix_mca_close_component = component_close,
|
||||
.pmix_mca_query_component = component_query,
|
||||
},
|
||||
.priority = 40,
|
||||
.assign_module = assign_module
|
||||
};
|
||||
|
||||
|
||||
pmix_status_t component_open(void)
|
||||
{
|
||||
/* setup the types array */
|
||||
PMIX_CONSTRUCT(&mca_bfrops_v3_component.types, pmix_pointer_array_t);
|
||||
pmix_pointer_array_init(&mca_bfrops_v3_component.types, 32, INT_MAX, 16);
|
||||
|
||||
return PMIX_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
pmix_status_t component_query(pmix_mca_base_module_t **module, int *priority)
|
||||
{
|
||||
|
||||
*priority = mca_bfrops_v3_component.priority;
|
||||
*module = (pmix_mca_base_module_t *)&pmix_bfrops_pmix3_module;
|
||||
return PMIX_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
pmix_status_t component_close(void)
|
||||
{
|
||||
PMIX_DESTRUCT(&mca_bfrops_v3_component.types);
|
||||
return PMIX_SUCCESS;
|
||||
}
|
||||
|
||||
static pmix_bfrops_module_t* assign_module(void)
|
||||
{
|
||||
pmix_output_verbose(10, pmix_bfrops_base_framework.framework_output,
|
||||
"bfrops:pmix3x assigning module");
|
||||
return &pmix_bfrops_pmix3_module;
|
||||
}
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2015-2018 Intel, Inc. All rights reserved.
|
||||
* Copyright (c) 2015-2017 Intel, Inc. All rights reserved.
|
||||
* Copyright (c) 2016 IBM Corporation. All rights reserved.
|
||||
* Copyright (c) 2017 Research Organization for Information Science
|
||||
* and Technology (RIST). All rights reserved.
|
||||
@ -100,7 +100,6 @@ static pmix_status_t create_cred(struct pmix_peer_t *peer,
|
||||
}
|
||||
}
|
||||
if (!takeus) {
|
||||
PMIX_ERROR_LOG(PMIX_ERR_NOT_SUPPORTED);
|
||||
return PMIX_ERR_NOT_SUPPORTED;
|
||||
}
|
||||
}
|
||||
@ -125,7 +124,6 @@ static pmix_status_t create_cred(struct pmix_peer_t *peer,
|
||||
goto complete;
|
||||
} else {
|
||||
/* unrecognized protocol */
|
||||
PMIX_ERROR_LOG(PMIX_ERR_NOT_SUPPORTED);
|
||||
return PMIX_ERR_NOT_SUPPORTED;
|
||||
}
|
||||
|
||||
|
@ -89,7 +89,6 @@ typedef uint32_t pmix_ptl_tag_t;
|
||||
* within the system */
|
||||
#define PMIX_PTL_TAG_NOTIFY 0
|
||||
#define PMIX_PTL_TAG_HEARTBEAT 1
|
||||
#define PMIX_PTL_TAG_IOF 2
|
||||
|
||||
/* define the start of dynamic tags that are
|
||||
* assigned for send/recv operations */
|
||||
|
@ -12,7 +12,7 @@
|
||||
* Copyright (c) 2008-2015 Cisco Systems, Inc. All rights reserved.
|
||||
* Copyright (c) 2010-2015 Los Alamos National Security, LLC.
|
||||
* All rights reserved.
|
||||
* Copyright (c) 2013-2018 Intel, Inc. All rights reserved.
|
||||
* Copyright (c) 2013-2017 Intel, Inc. All rights reserved.
|
||||
* Copyright (c) 2016 Research Organization for Information Science
|
||||
* and Technology (RIST). All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
@ -115,7 +115,6 @@ void pmix_rte_finalize(void)
|
||||
PMIX_DESTRUCT(&pmix_globals.events);
|
||||
PMIX_LIST_DESTRUCT(&pmix_globals.cached_events);
|
||||
PMIX_DESTRUCT(&pmix_globals.notifications);
|
||||
PMIX_LIST_DESTRUCT(&pmix_globals.iof_requests);
|
||||
|
||||
/* now safe to release the event base */
|
||||
if (!pmix_globals.external_evbase) {
|
||||
|
@ -15,7 +15,7 @@
|
||||
* Copyright (c) 2009 Oak Ridge National Labs. All rights reserved.
|
||||
* Copyright (c) 2010-2015 Los Alamos National Security, LLC.
|
||||
* All rights reserved.
|
||||
* Copyright (c) 2013-2018 Intel, Inc. All rights reserved.
|
||||
* Copyright (c) 2013-2017 Intel, Inc. All rights reserved.
|
||||
* Copyright (c) 2015 Research Organization for Information Science
|
||||
* and Technology (RIST). All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
@ -159,8 +159,6 @@ int pmix_rte_init(pmix_proc_type_t type,
|
||||
/* construct the global notification ring buffer */
|
||||
PMIX_CONSTRUCT(&pmix_globals.notifications, pmix_ring_buffer_t);
|
||||
pmix_ring_buffer_init(&pmix_globals.notifications, 256);
|
||||
/* and setup the iof request tracking list */
|
||||
PMIX_CONSTRUCT(&pmix_globals.iof_requests, pmix_list_t);
|
||||
|
||||
/* Setup client verbosities as all procs are allowed to
|
||||
* access client APIs */
|
||||
@ -200,12 +198,6 @@ int pmix_rte_init(pmix_proc_type_t type,
|
||||
pmix_output_set_verbosity(pmix_client_globals.event_output,
|
||||
pmix_client_globals.event_verbose);
|
||||
}
|
||||
if (0 < pmix_client_globals.iof_verbose) {
|
||||
/* set default output */
|
||||
pmix_client_globals.iof_output = pmix_output_open(NULL);
|
||||
pmix_output_set_verbosity(pmix_client_globals.iof_output,
|
||||
pmix_client_globals.iof_verbose);
|
||||
}
|
||||
|
||||
/* get our effective id's */
|
||||
pmix_globals.uid = geteuid();
|
||||
|
@ -21,7 +21,7 @@
|
||||
* and Technology (RIST). All rights reserved.
|
||||
* Copyright (c) 2015 Mellanox Technologies, Inc.
|
||||
* All rights reserved.
|
||||
* Copyright (c) 2016-2018 Intel, Inc. All rights reserved.
|
||||
* Copyright (c) 2016-2017 Intel, Inc. All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
@ -140,17 +140,11 @@ pmix_status_t pmix_register_params(void)
|
||||
&pmix_client_globals.spawn_verbose);
|
||||
|
||||
(void) pmix_mca_base_var_register ("pmix", "pmix", "client", "event_verbose",
|
||||
"Verbosity for client spawn operations",
|
||||
"Verbosity for eventt spawn operations",
|
||||
PMIX_MCA_BASE_VAR_TYPE_INT, NULL, 0, 0,
|
||||
PMIX_INFO_LVL_1, PMIX_MCA_BASE_VAR_SCOPE_ALL,
|
||||
&pmix_client_globals.event_verbose);
|
||||
|
||||
(void) pmix_mca_base_var_register ("pmix", "pmix", "client", "iof_verbose",
|
||||
"Verbosity for client iof operations",
|
||||
PMIX_MCA_BASE_VAR_TYPE_INT, NULL, 0, 0,
|
||||
PMIX_INFO_LVL_1, PMIX_MCA_BASE_VAR_SCOPE_ALL,
|
||||
&pmix_client_globals.iof_verbose);
|
||||
|
||||
(void) pmix_mca_base_var_register ("pmix", "pmix", "client", "base_verbose",
|
||||
"Verbosity for basic client operations",
|
||||
PMIX_MCA_BASE_VAR_TYPE_INT, NULL, 0, 0,
|
||||
@ -194,12 +188,6 @@ pmix_status_t pmix_register_params(void)
|
||||
PMIX_INFO_LVL_1, PMIX_MCA_BASE_VAR_SCOPE_ALL,
|
||||
&pmix_server_globals.event_verbose);
|
||||
|
||||
(void) pmix_mca_base_var_register ("pmix", "pmix", "server", "iof_verbose",
|
||||
"Verbosity for server iof operations",
|
||||
PMIX_MCA_BASE_VAR_TYPE_INT, NULL, 0, 0,
|
||||
PMIX_INFO_LVL_1, PMIX_MCA_BASE_VAR_SCOPE_ALL,
|
||||
&pmix_server_globals.iof_verbose);
|
||||
|
||||
(void) pmix_mca_base_var_register ("pmix", "pmix", "server", "base_verbose",
|
||||
"Verbosity for basic server operations",
|
||||
PMIX_MCA_BASE_VAR_TYPE_INT, NULL, 0, 0,
|
||||
|
@ -170,12 +170,6 @@ PMIX_EXPORT pmix_status_t PMIx_server_init(pmix_server_module_t *module,
|
||||
pmix_output_set_verbosity(pmix_server_globals.event_output,
|
||||
pmix_server_globals.event_verbose);
|
||||
}
|
||||
if (0 < pmix_server_globals.iof_verbose) {
|
||||
/* set default output */
|
||||
pmix_server_globals.iof_output = pmix_output_open(NULL);
|
||||
pmix_output_set_verbosity(pmix_server_globals.iof_output,
|
||||
pmix_server_globals.iof_verbose);
|
||||
}
|
||||
/* setup the base verbosity */
|
||||
if (0 < pmix_server_globals.base_verbose) {
|
||||
/* set default output */
|
||||
@ -1304,11 +1298,12 @@ static void _setup_op(pmix_status_t rc, void *cbdata)
|
||||
static void _setup_app(int sd, short args, void *cbdata)
|
||||
{
|
||||
pmix_setup_caddy_t *cd = (pmix_setup_caddy_t*)cbdata;
|
||||
pmix_buffer_t buffer;
|
||||
pmix_byte_object_t blob;
|
||||
pmix_setup_caddy_t *fcd = NULL;
|
||||
pmix_status_t rc;
|
||||
pmix_list_t ilist;
|
||||
pmix_kval_t *kv;
|
||||
size_t n;
|
||||
|
||||
PMIX_ACQUIRE_OBJECT(cd);
|
||||
|
||||
@ -1327,21 +1322,31 @@ static void _setup_app(int sd, short args, void *cbdata)
|
||||
goto depart;
|
||||
}
|
||||
|
||||
/* if anything came back, construct the info array */
|
||||
if (0 < (fcd->ninfo = pmix_list_get_size(&ilist))) {
|
||||
PMIX_INFO_CREATE(fcd->info, fcd->ninfo);
|
||||
n = 0;
|
||||
/* if anything came back, construct the blob */
|
||||
if (0 < pmix_list_get_size(&ilist)) {
|
||||
PMIX_CONSTRUCT(&buffer, pmix_buffer_t);
|
||||
PMIX_LIST_FOREACH(kv, &ilist, pmix_kval_t) {
|
||||
(void)strncpy(fcd->info[n].key, kv->key, PMIX_MAX_KEYLEN);
|
||||
PMIX_BFROPS_VALUE_XFER(rc, pmix_globals.mypeer,
|
||||
&fcd->info[n].value, kv->value);
|
||||
PMIX_BFROPS_PACK(rc, pmix_globals.mypeer, &buffer, kv, 1, PMIX_KVAL);
|
||||
if (PMIX_SUCCESS != rc) {
|
||||
PMIX_INFO_FREE(fcd->info, fcd->ninfo);
|
||||
PMIX_DESTRUCT(&blob);
|
||||
PMIX_RELEASE(fcd);
|
||||
fcd = NULL;
|
||||
goto depart;
|
||||
}
|
||||
}
|
||||
PMIX_INFO_CREATE(fcd->info, 1);
|
||||
if (NULL == fcd->info) {
|
||||
PMIX_DESTRUCT(&blob);
|
||||
PMIX_RELEASE(fcd);
|
||||
fcd = NULL;
|
||||
goto depart;
|
||||
}
|
||||
fcd->ninfo = 1;
|
||||
PMIX_BYTE_OBJECT_CONSTRUCT(&blob);
|
||||
PMIX_BYTE_OBJECT_LOAD(&blob, buffer.base_ptr, buffer.bytes_used);
|
||||
PMIX_DESTRUCT(&buffer);
|
||||
PMIX_INFO_LOAD(&fcd->info[0], PMIX_PNET_SETUP_APP, &blob, PMIX_BYTE_OBJECT);
|
||||
PMIX_BYTE_OBJECT_DESTRUCT(&blob);
|
||||
}
|
||||
|
||||
depart:
|
||||
@ -1443,99 +1448,6 @@ pmix_status_t PMIx_server_setup_local_support(const char nspace[],
|
||||
return PMIX_SUCCESS;
|
||||
}
|
||||
|
||||
static void _iofpush(int sd, short args, void *cbdata)
|
||||
{
|
||||
pmix_setup_caddy_t *cd = (pmix_setup_caddy_t*)cbdata;
|
||||
pmix_iof_req_t *req;
|
||||
pmix_status_t rc;
|
||||
pmix_buffer_t *msg;
|
||||
|
||||
pmix_output_verbose(2, pmix_server_globals.iof_output,
|
||||
"PMIX:SERVER pushing IOF");
|
||||
|
||||
/* cycle across our list of IOF requestors and see who wants
|
||||
* this channel from this source */
|
||||
PMIX_LIST_FOREACH(req, &pmix_globals.iof_requests, pmix_iof_req_t) {
|
||||
/* if the channel wasn't included, then ignore it */
|
||||
if (!(cd->channels & req->channels)) {
|
||||
continue;
|
||||
}
|
||||
/* if the source matches the request, then forward this along */
|
||||
if (0 != strncmp(cd->procs->nspace, req->pname.nspace, PMIX_MAX_NSLEN) ||
|
||||
(PMIX_RANK_WILDCARD != req->pname.rank && cd->procs->rank != req->pname.rank)) {
|
||||
continue;
|
||||
}
|
||||
/* setup the msg */
|
||||
if (NULL == (msg = PMIX_NEW(pmix_buffer_t))) {
|
||||
PMIX_ERROR_LOG(PMIX_ERR_OUT_OF_RESOURCE);
|
||||
rc = PMIX_ERR_OUT_OF_RESOURCE;
|
||||
break;
|
||||
}
|
||||
/* provide the source */
|
||||
PMIX_BFROPS_PACK(rc, req->peer, msg, cd->procs, 1, PMIX_PROC);
|
||||
if (PMIX_SUCCESS != rc) {
|
||||
PMIX_ERROR_LOG(rc);
|
||||
PMIX_RELEASE(msg);
|
||||
break;
|
||||
}
|
||||
/* provide the channel */
|
||||
PMIX_BFROPS_PACK(rc, req->peer, msg, &cd->channels, 1, PMIX_IOF_CHANNEL);
|
||||
if (PMIX_SUCCESS != rc) {
|
||||
PMIX_ERROR_LOG(rc);
|
||||
PMIX_RELEASE(msg);
|
||||
break;
|
||||
}
|
||||
/* pack the data */
|
||||
PMIX_BFROPS_PACK(rc, req->peer, msg, cd->bo, 1, PMIX_BYTE_OBJECT);
|
||||
if (PMIX_SUCCESS != rc) {
|
||||
PMIX_ERROR_LOG(rc);
|
||||
PMIX_RELEASE(msg);
|
||||
break;
|
||||
}
|
||||
/* send it to the requestor */
|
||||
PMIX_PTL_SEND_ONEWAY(rc, req->peer, msg, PMIX_PTL_TAG_IOF);
|
||||
if (PMIX_SUCCESS != rc) {
|
||||
PMIX_ERROR_LOG(rc);
|
||||
PMIX_RELEASE(msg);
|
||||
}
|
||||
}
|
||||
|
||||
if (NULL != cd->opcbfunc) {
|
||||
cd->opcbfunc(rc, cd->cbdata);
|
||||
}
|
||||
PMIX_RELEASE(cd);
|
||||
}
|
||||
|
||||
pmix_status_t PMIx_IOF_push(const pmix_proc_t *source, pmix_iof_channel_t channel,
|
||||
const pmix_byte_object_t *bo,
|
||||
const pmix_info_t info[], size_t ninfo,
|
||||
pmix_op_cbfunc_t cbfunc, void *cbdata)
|
||||
{
|
||||
pmix_setup_caddy_t *cd;
|
||||
|
||||
PMIX_ACQUIRE_THREAD(&pmix_global_lock);
|
||||
if (pmix_globals.init_cntr <= 0) {
|
||||
PMIX_RELEASE_THREAD(&pmix_global_lock);
|
||||
return PMIX_ERR_INIT;
|
||||
}
|
||||
PMIX_RELEASE_THREAD(&pmix_global_lock);
|
||||
|
||||
/* need to threadshift this request */
|
||||
cd = PMIX_NEW(pmix_setup_caddy_t);
|
||||
if (NULL == cd) {
|
||||
return PMIX_ERR_NOMEM;
|
||||
}
|
||||
cd->procs = (pmix_proc_t*)source;
|
||||
cd->channels = channel;
|
||||
cd->bo = (pmix_byte_object_t*)bo;
|
||||
cd->info = (pmix_info_t*)info;
|
||||
cd->ninfo = ninfo;
|
||||
cd->opcbfunc = cbfunc;
|
||||
cd->cbdata = cbdata;
|
||||
PMIX_THREADSHIFT(cd, _iofpush);
|
||||
|
||||
return PMIX_SUCCESS;
|
||||
}
|
||||
|
||||
/**** THE FOLLOWING CALLBACK FUNCTIONS ARE USED BY THE HOST SERVER ****
|
||||
**** THEY THEREFORE CAN OCCUR IN EITHER THE HOST SERVER'S THREAD ****
|
||||
@ -2447,69 +2359,6 @@ static void validate_cbfunc(pmix_status_t status,
|
||||
}
|
||||
|
||||
|
||||
static void _iofreg(int sd, short args, void *cbdata)
|
||||
{
|
||||
pmix_setup_caddy_t *cd = (pmix_setup_caddy_t*)cbdata;
|
||||
pmix_server_caddy_t *scd = (pmix_server_caddy_t*)cd->cbdata;
|
||||
pmix_buffer_t *reply;
|
||||
pmix_status_t rc;
|
||||
|
||||
PMIX_ACQUIRE_OBJECT(cd);
|
||||
|
||||
/* setup the reply to the requestor */
|
||||
reply = PMIX_NEW(pmix_buffer_t);
|
||||
if (NULL == reply) {
|
||||
PMIX_ERROR_LOG(PMIX_ERR_NOMEM);
|
||||
rc = PMIX_ERR_NOMEM;
|
||||
goto cleanup;
|
||||
}
|
||||
/* start with the status */
|
||||
PMIX_BFROPS_PACK(rc, scd->peer, reply, &cd->status, 1, PMIX_STATUS);
|
||||
if (PMIX_SUCCESS != rc) {
|
||||
PMIX_ERROR_LOG(rc);
|
||||
PMIX_RELEASE(reply);
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
/* was the request a success? */
|
||||
if (PMIX_SUCCESS != cd->status) {
|
||||
/* find and remove the tracker(s) */
|
||||
}
|
||||
|
||||
pmix_output_verbose(2, pmix_server_globals.iof_output,
|
||||
"server:_iofreg reply being sent to %s:%u",
|
||||
scd->peer->info->pname.nspace, scd->peer->info->pname.rank);
|
||||
PMIX_SERVER_QUEUE_REPLY(scd->peer, scd->hdr.tag, reply);
|
||||
|
||||
cleanup:
|
||||
/* release the cached info */
|
||||
if (NULL != cd->procs) {
|
||||
PMIX_PROC_FREE(cd->procs, cd->nprocs);
|
||||
}
|
||||
PMIX_INFO_FREE(cd->info, cd->ninfo);
|
||||
/* we are done */
|
||||
PMIX_RELEASE(cd);
|
||||
}
|
||||
|
||||
static void iof_cbfunc(pmix_status_t status,
|
||||
void *cbdata)
|
||||
{
|
||||
pmix_setup_caddy_t *cd = (pmix_setup_caddy_t*)cbdata;
|
||||
|
||||
pmix_output_verbose(2, pmix_server_globals.iof_output,
|
||||
"server:iof_cbfunc called with status %d",
|
||||
status);
|
||||
|
||||
if (NULL == cd) {
|
||||
/* nothing to do */
|
||||
return;
|
||||
}
|
||||
cd->status = status;
|
||||
|
||||
/* need to thread-shift this callback as it accesses global data */
|
||||
PMIX_THREADSHIFT(cd, _iofreg);
|
||||
}
|
||||
|
||||
/* the switchyard is the primary message handling function. It's purpose
|
||||
* is to take incoming commands (packed into a buffer), unpack them,
|
||||
* and then call the corresponding host server's function to execute
|
||||
@ -2761,12 +2610,6 @@ static pmix_status_t server_switchyard(pmix_peer_t *peer, uint32_t tag,
|
||||
return rc;
|
||||
}
|
||||
|
||||
if (PMIX_IOF_CMD == cmd) {
|
||||
PMIX_GDS_CADDY(cd, peer, tag);
|
||||
rc = pmix_server_iofreg(peer, buf, iof_cbfunc, cd);
|
||||
return rc;
|
||||
}
|
||||
|
||||
return PMIX_ERR_NOT_SUPPORTED;
|
||||
}
|
||||
|
||||
|
@ -838,6 +838,7 @@ static void _process_dmdx_reply(int fd, short args, void *cbdata)
|
||||
pmix_dmdx_request_t *dm;
|
||||
bool found;
|
||||
pmix_buffer_t pbkt;
|
||||
pmix_cb_t cb;
|
||||
|
||||
PMIX_ACQUIRE_OBJECT(caddy);
|
||||
|
||||
@ -860,7 +861,7 @@ static void _process_dmdx_reply(int fd, short args, void *cbdata)
|
||||
* processes from it running on this host - so just record it
|
||||
* so we know we have the data for any future requests */
|
||||
nptr = PMIX_NEW(pmix_nspace_t);
|
||||
(void)strncpy(nptr->nspace, caddy->lcd->proc.nspace, PMIX_MAX_NSLEN);
|
||||
nptr->nspace = strdup(caddy->lcd->proc.nspace);
|
||||
/* add to the list */
|
||||
pmix_list_append(&pmix_server_globals.nspaces, &nptr->super);
|
||||
}
|
||||
@ -912,33 +913,65 @@ static void _process_dmdx_reply(int fd, short args, void *cbdata)
|
||||
}
|
||||
PMIX_CONSTRUCT(&pbkt, pmix_buffer_t);
|
||||
if (NULL == caddy->data) {
|
||||
PMIX_GDS_REGISTER_JOB_INFO(rc, pmix_globals.mypeer, &pbkt);
|
||||
/* we assume that the data was provided via a call to
|
||||
* register_nspace, so what we need to do now is simply
|
||||
* transfer it across to the individual nspace storage
|
||||
* components */
|
||||
PMIX_CONSTRUCT(&cb, pmix_cb_t);
|
||||
PMIX_PROC_CREATE(cb.proc, 1);
|
||||
if (NULL == cb.proc) {
|
||||
PMIX_ERROR_LOG(PMIX_ERR_NOMEM);
|
||||
PMIX_DESTRUCT(&cb);
|
||||
goto complete;
|
||||
}
|
||||
(void)strncpy(cb.proc->nspace, nm->ns->nspace, PMIX_MAX_NSLEN);
|
||||
cb.proc->rank = PMIX_RANK_WILDCARD;
|
||||
cb.scope = PMIX_INTERNAL;
|
||||
cb.copy = false;
|
||||
PMIX_GDS_FETCH_KV(rc, pmix_globals.mypeer, &cb);
|
||||
if (PMIX_SUCCESS != rc) {
|
||||
PMIX_ERROR_LOG(rc);
|
||||
PMIX_DESTRUCT(&cb);
|
||||
goto complete;
|
||||
}
|
||||
PMIX_LIST_FOREACH(kv, &cb.kvs, pmix_kval_t) {
|
||||
PMIX_GDS_STORE_KV(rc, peer, &caddy->lcd->proc, PMIX_INTERNAL, kv);
|
||||
if (PMIX_SUCCESS != rc) {
|
||||
PMIX_ERROR_LOG(rc);
|
||||
break;
|
||||
}
|
||||
}
|
||||
PMIX_DESTRUCT(&cb);
|
||||
} else {
|
||||
PMIX_LOAD_BUFFER(pmix_globals.mypeer, &pbkt, caddy->data, caddy->ndata);
|
||||
}
|
||||
/* unpack and store it*/
|
||||
kv = PMIX_NEW(pmix_kval_t);
|
||||
cnt = 1;
|
||||
PMIX_BFROPS_UNPACK(rc, pmix_globals.mypeer, &pbkt, kv, &cnt, PMIX_KVAL);
|
||||
while (PMIX_SUCCESS == rc) {
|
||||
PMIX_GDS_STORE_KV(rc, peer, &caddy->lcd->proc, PMIX_REMOTE, kv);
|
||||
if (PMIX_SUCCESS != rc) {
|
||||
/* unpack and store it*/
|
||||
kv = PMIX_NEW(pmix_kval_t);
|
||||
cnt = 1;
|
||||
PMIX_BFROPS_UNPACK(rc, pmix_globals.mypeer, &pbkt, kv, &cnt, PMIX_KVAL);
|
||||
while (PMIX_SUCCESS == rc) {
|
||||
if (caddy->lcd->proc.rank == PMIX_RANK_WILDCARD) {
|
||||
PMIX_GDS_STORE_KV(rc, peer, &caddy->lcd->proc, PMIX_INTERNAL, kv);
|
||||
} else {
|
||||
PMIX_GDS_STORE_KV(rc, peer, &caddy->lcd->proc, PMIX_REMOTE, kv);
|
||||
}
|
||||
if (PMIX_SUCCESS != rc) {
|
||||
PMIX_ERROR_LOG(rc);
|
||||
caddy->status = rc;
|
||||
goto complete;
|
||||
}
|
||||
PMIX_RELEASE(kv);
|
||||
kv = PMIX_NEW(pmix_kval_t);
|
||||
cnt = 1;
|
||||
PMIX_BFROPS_UNPACK(rc, pmix_globals.mypeer, &pbkt, kv, &cnt, PMIX_KVAL);
|
||||
}
|
||||
PMIX_RELEASE(kv);
|
||||
pbkt.base_ptr = NULL; // protect the data
|
||||
PMIX_DESTRUCT(&pbkt);
|
||||
if (PMIX_ERR_UNPACK_READ_PAST_END_OF_BUFFER != rc) {
|
||||
PMIX_ERROR_LOG(rc);
|
||||
caddy->status = rc;
|
||||
goto complete;
|
||||
}
|
||||
PMIX_RELEASE(kv);
|
||||
kv = PMIX_NEW(pmix_kval_t);
|
||||
cnt = 1;
|
||||
PMIX_BFROPS_UNPACK(rc, pmix_globals.mypeer, &pbkt, kv, &cnt, PMIX_KVAL);
|
||||
}
|
||||
PMIX_RELEASE(kv);
|
||||
pbkt.base_ptr = NULL; // protect the data
|
||||
PMIX_DESTRUCT(&pbkt);
|
||||
if (PMIX_ERR_UNPACK_READ_PAST_END_OF_BUFFER != rc) {
|
||||
PMIX_ERROR_LOG(rc);
|
||||
caddy->status = rc;
|
||||
goto complete;
|
||||
}
|
||||
}
|
||||
PMIX_LIST_DESTRUCT(&nspaces);
|
||||
|
@ -1025,22 +1025,7 @@ static void spcbfunc(pmix_status_t status,
|
||||
char nspace[], void *cbdata)
|
||||
{
|
||||
pmix_setup_caddy_t *cd = (pmix_setup_caddy_t*)cbdata;
|
||||
pmix_iof_req_t *req;
|
||||
|
||||
/* if it was successful, and there are IOF requests, then
|
||||
* register them now */
|
||||
if (PMIX_SUCCESS == status && PMIX_FWD_NO_CHANNELS != cd->channels) {
|
||||
/* record the request */
|
||||
req = PMIX_NEW(pmix_iof_req_t);
|
||||
if (NULL != req) {
|
||||
PMIX_RETAIN(cd->peer);
|
||||
req->peer = cd->peer;
|
||||
req->pname.nspace = strdup(nspace);
|
||||
req->pname.rank = PMIX_RANK_WILDCARD;
|
||||
req->channels = cd->channels;
|
||||
pmix_list_append(&pmix_globals.iof_requests, &req->super);
|
||||
}
|
||||
}
|
||||
/* cleanup the caddy */
|
||||
if (NULL != cd->info) {
|
||||
PMIX_INFO_FREE(cd->info, cd->ninfo);
|
||||
@ -1063,8 +1048,7 @@ pmix_status_t pmix_server_spawn(pmix_peer_t *peer,
|
||||
int32_t cnt;
|
||||
pmix_status_t rc;
|
||||
pmix_proc_t proc;
|
||||
size_t ninfo, n;
|
||||
bool stdout_found = false, stderr_found = false, stddiag_found = false;
|
||||
size_t ninfo;
|
||||
|
||||
pmix_output_verbose(2, pmix_server_globals.spawn_output,
|
||||
"recvd SPAWN");
|
||||
@ -1079,8 +1063,6 @@ pmix_status_t pmix_server_spawn(pmix_peer_t *peer,
|
||||
if (NULL == cd) {
|
||||
return PMIX_ERR_NOMEM;
|
||||
}
|
||||
PMIX_RETAIN(peer);
|
||||
cd->peer = peer;
|
||||
cd->spcbfunc = cbfunc;
|
||||
cd->cbdata = cbdata;
|
||||
|
||||
@ -1109,48 +1091,10 @@ pmix_status_t pmix_server_spawn(pmix_peer_t *peer,
|
||||
PMIX_ERROR_LOG(rc);
|
||||
goto cleanup;
|
||||
}
|
||||
/* run a quick check of the directives to see if any IOF
|
||||
* requests were included so we can set that up now - helps
|
||||
* to catch any early output */
|
||||
cd->channels = PMIX_FWD_NO_CHANNELS;
|
||||
for (n=0; n < cd->ninfo; n++) {
|
||||
if (0 == strncmp(cd->info[n].key, PMIX_FWD_STDIN, PMIX_MAX_KEYLEN)) {
|
||||
stdout_found = true;
|
||||
if (PMIX_INFO_TRUE(&cd->info[n])) {
|
||||
cd->channels |= PMIX_FWD_STDIN_CHANNEL;
|
||||
}
|
||||
} else if (0 == strncmp(cd->info[n].key, PMIX_FWD_STDOUT, PMIX_MAX_KEYLEN)) {
|
||||
if (PMIX_INFO_TRUE(&cd->info[n])) {
|
||||
cd->channels |= PMIX_FWD_STDOUT_CHANNEL;
|
||||
}
|
||||
} else if (0 == strncmp(cd->info[n].key, PMIX_FWD_STDERR, PMIX_MAX_KEYLEN)) {
|
||||
stderr_found = true;
|
||||
if (PMIX_INFO_TRUE(&cd->info[n])) {
|
||||
cd->channels |= PMIX_FWD_STDERR_CHANNEL;
|
||||
}
|
||||
} else if (0 == strncmp(cd->info[n].key, PMIX_FWD_STDDIAG, PMIX_MAX_KEYLEN)) {
|
||||
stddiag_found = true;
|
||||
if (PMIX_INFO_TRUE(&cd->info[n])) {
|
||||
cd->channels |= PMIX_FWD_STDDIAG_CHANNEL;
|
||||
}
|
||||
}
|
||||
}
|
||||
/* we will construct any required iof request tracker upon completion of the spawn */
|
||||
}
|
||||
/* add the directive to the end */
|
||||
if (PMIX_PROC_IS_TOOL(peer)) {
|
||||
PMIX_INFO_LOAD(&cd->info[ninfo], PMIX_REQUESTOR_IS_TOOL, NULL, PMIX_BOOL);
|
||||
/* if the requestor is a tool, we default to forwarding all
|
||||
* output IO channels */
|
||||
if (!stdout_found) {
|
||||
cd->channels |= PMIX_FWD_STDOUT_CHANNEL;
|
||||
}
|
||||
if (!stderr_found) {
|
||||
cd->channels |= PMIX_FWD_STDERR_CHANNEL;
|
||||
}
|
||||
if (!stddiag_found) {
|
||||
cd->channels |= PMIX_FWD_STDDIAG_CHANNEL;
|
||||
}
|
||||
} else {
|
||||
PMIX_INFO_LOAD(&cd->info[ninfo], PMIX_REQUESTOR_IS_CLIENT, NULL, PMIX_BOOL);
|
||||
}
|
||||
@ -2598,130 +2542,6 @@ pmix_status_t pmix_server_validate_credential(pmix_peer_t *peer,
|
||||
return rc;
|
||||
}
|
||||
|
||||
pmix_status_t pmix_server_iofreg(pmix_peer_t *peer,
|
||||
pmix_buffer_t *buf,
|
||||
pmix_op_cbfunc_t cbfunc,
|
||||
void *cbdata)
|
||||
{
|
||||
int32_t cnt;
|
||||
pmix_status_t rc;
|
||||
pmix_setup_caddy_t *cd;
|
||||
pmix_iof_req_t *req;
|
||||
bool notify, match;
|
||||
size_t n;
|
||||
|
||||
pmix_output_verbose(2, pmix_server_globals.iof_output,
|
||||
"recvd register IOF request from client");
|
||||
|
||||
if (NULL == pmix_host_server.register_iof) {
|
||||
return PMIX_ERR_NOT_SUPPORTED;
|
||||
}
|
||||
|
||||
cd = PMIX_NEW(pmix_setup_caddy_t);
|
||||
if (NULL == cd) {
|
||||
return PMIX_ERR_NOMEM;
|
||||
}
|
||||
cd->cbdata = cbdata; // this is the pmix_server_caddy_t
|
||||
|
||||
/* unpack the number of procs */
|
||||
cnt = 1;
|
||||
PMIX_BFROPS_UNPACK(rc, peer, buf, &cd->nprocs, &cnt, PMIX_SIZE);
|
||||
if (PMIX_SUCCESS != rc) {
|
||||
PMIX_ERROR_LOG(rc);
|
||||
goto exit;
|
||||
}
|
||||
/* unpack the procs */
|
||||
if (0 < cd->nprocs) {
|
||||
PMIX_PROC_CREATE(cd->procs, cd->nprocs);
|
||||
cnt = cd->nprocs;
|
||||
PMIX_BFROPS_UNPACK(rc, peer, buf, cd->procs, &cnt, PMIX_PROC);
|
||||
if (PMIX_SUCCESS != rc) {
|
||||
PMIX_ERROR_LOG(rc);
|
||||
goto exit;
|
||||
}
|
||||
}
|
||||
|
||||
/* unpack the number of directives */
|
||||
cnt = 1;
|
||||
PMIX_BFROPS_UNPACK(rc, peer, buf, &cd->ninfo, &cnt, PMIX_SIZE);
|
||||
if (PMIX_SUCCESS != rc) {
|
||||
PMIX_ERROR_LOG(rc);
|
||||
goto exit;
|
||||
}
|
||||
/* unpack the directives */
|
||||
if (0 < cd->ninfo) {
|
||||
PMIX_INFO_CREATE(cd->info, cd->ninfo);
|
||||
cnt = cd->ninfo;
|
||||
PMIX_BFROPS_UNPACK(rc, peer, buf, cd->info, &cnt, PMIX_INFO);
|
||||
if (PMIX_SUCCESS != rc) {
|
||||
PMIX_ERROR_LOG(rc);
|
||||
goto exit;
|
||||
}
|
||||
}
|
||||
|
||||
/* unpack the channels */
|
||||
cnt = 1;
|
||||
PMIX_BFROPS_UNPACK(rc, peer, buf, &cd->channels, &cnt, PMIX_IOF_CHANNEL);
|
||||
if (PMIX_SUCCESS != rc) {
|
||||
PMIX_ERROR_LOG(rc);
|
||||
goto exit;
|
||||
}
|
||||
|
||||
/* check to see if we have already registered this source/channel combination */
|
||||
notify = false;
|
||||
for (n=0; n < cd->nprocs; n++) {
|
||||
match = false;
|
||||
PMIX_LIST_FOREACH(req, &pmix_globals.iof_requests, pmix_iof_req_t) {
|
||||
/* is this request from the same peer? */
|
||||
if (peer != req->peer) {
|
||||
continue;
|
||||
}
|
||||
/* do we already have this source for this peer? */
|
||||
if (0 == strncmp(cd->procs[n].nspace, req->pname.nspace, PMIX_MAX_NSLEN) &&
|
||||
(PMIX_RANK_WILDCARD == req->pname.rank || cd->procs[n].rank == req->pname.rank)) {
|
||||
match = true;
|
||||
if ((req->channels & cd->channels) != cd->channels) {
|
||||
/* this is a channel update */
|
||||
req->channels |= cd->channels;
|
||||
/* we need to notify the host */
|
||||
notify = true;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
/* if we didn't find the matching entry, then add it */
|
||||
if (!match) {
|
||||
/* record the request */
|
||||
req = PMIX_NEW(pmix_iof_req_t);
|
||||
if (NULL == req) {
|
||||
rc = PMIX_ERR_NOMEM;
|
||||
goto exit;
|
||||
}
|
||||
PMIX_RETAIN(peer);
|
||||
req->peer = peer;
|
||||
req->pname.nspace = strdup(cd->procs[n].nspace);
|
||||
req->pname.rank = cd->procs[n].rank;
|
||||
req->channels = cd->channels;
|
||||
pmix_list_append(&pmix_globals.iof_requests, &req->super);
|
||||
}
|
||||
}
|
||||
|
||||
if (notify) {
|
||||
/* ask the host to execute the request */
|
||||
if (PMIX_SUCCESS != (rc = pmix_host_server.register_iof(cd->procs, cd->nprocs,
|
||||
cd->info, cd->ninfo,
|
||||
cd->channels,
|
||||
cbfunc, cd))) {
|
||||
goto exit;
|
||||
}
|
||||
}
|
||||
return PMIX_SUCCESS;
|
||||
|
||||
exit:
|
||||
PMIX_RELEASE(cd);
|
||||
return rc;
|
||||
}
|
||||
|
||||
/***** INSTANCE SERVER LIBRARY CLASSES *****/
|
||||
static void tcon(pmix_server_trkr_t *t)
|
||||
{
|
||||
@ -2783,7 +2603,6 @@ PMIX_CLASS_INSTANCE(pmix_server_caddy_t,
|
||||
|
||||
static void scadcon(pmix_setup_caddy_t *p)
|
||||
{
|
||||
p->peer = NULL;
|
||||
memset(&p->proc, 0, sizeof(pmix_proc_t));
|
||||
PMIX_CONSTRUCT_LOCK(&p->lock);
|
||||
p->nspace = NULL;
|
||||
@ -2796,8 +2615,6 @@ static void scadcon(pmix_setup_caddy_t *p)
|
||||
p->info = NULL;
|
||||
p->ninfo = 0;
|
||||
p->keys = NULL;
|
||||
p->channels = PMIX_FWD_NO_CHANNELS;
|
||||
p->bo = NULL;
|
||||
p->cbfunc = NULL;
|
||||
p->opcbfunc = NULL;
|
||||
p->setupcbfunc = NULL;
|
||||
@ -2807,9 +2624,6 @@ static void scadcon(pmix_setup_caddy_t *p)
|
||||
}
|
||||
static void scaddes(pmix_setup_caddy_t *p)
|
||||
{
|
||||
if (NULL != p->peer) {
|
||||
PMIX_RELEASE(p->peer);
|
||||
}
|
||||
PMIX_DESTRUCT_LOCK(&p->lock);
|
||||
}
|
||||
PMIX_EXPORT PMIX_CLASS_INSTANCE(pmix_setup_caddy_t,
|
||||
|
@ -35,7 +35,6 @@ typedef struct {
|
||||
pmix_object_t super;
|
||||
pmix_event_t ev;
|
||||
pmix_lock_t lock;
|
||||
pmix_peer_t *peer;
|
||||
char *nspace;
|
||||
pmix_status_t status;
|
||||
pmix_status_t *codes;
|
||||
@ -52,8 +51,6 @@ typedef struct {
|
||||
char **keys;
|
||||
pmix_app_t *apps;
|
||||
size_t napps;
|
||||
pmix_iof_channel_t channels;
|
||||
pmix_byte_object_t *bo;
|
||||
pmix_op_cbfunc_t opcbfunc;
|
||||
pmix_dmodex_response_fn_t cbfunc;
|
||||
pmix_setup_application_cbfunc_t setupcbfunc;
|
||||
@ -99,7 +96,7 @@ PMIX_CLASS_DECLARATION(pmix_peer_events_info_t);
|
||||
|
||||
typedef struct {
|
||||
pmix_list_item_t super;
|
||||
pmix_list_t peers; // list of pmix_peer_events_info_t
|
||||
pmix_list_t peers; // list of pmix_prevents_info_t
|
||||
int code;
|
||||
} pmix_regevents_info_t;
|
||||
PMIX_CLASS_DECLARATION(pmix_regevents_info_t);
|
||||
@ -131,9 +128,6 @@ typedef struct {
|
||||
// verbosity for server event operations
|
||||
int event_output;
|
||||
int event_verbose;
|
||||
// verbosity for server iof operations
|
||||
int iof_output;
|
||||
int iof_verbose;
|
||||
// verbosity for basic server functions
|
||||
int base_output;
|
||||
int base_verbose;
|
||||
@ -262,11 +256,6 @@ pmix_status_t pmix_server_validate_credential(pmix_peer_t *peer,
|
||||
pmix_validation_cbfunc_t cbfunc,
|
||||
void *cbdata);
|
||||
|
||||
pmix_status_t pmix_server_iofreg(pmix_peer_t *peer,
|
||||
pmix_buffer_t *buf,
|
||||
pmix_op_cbfunc_t cbfunc,
|
||||
void *cbdata);
|
||||
|
||||
pmix_status_t pmix_server_event_recvd_from_client(pmix_peer_t *peer,
|
||||
pmix_buffer_t *buf,
|
||||
pmix_op_cbfunc_t cbfunc,
|
||||
|
@ -4,7 +4,7 @@
|
||||
* Copyright (c) 2008 Cisco Systems, Inc. All rights reserved.
|
||||
* Copyright (c) 2015-2017 Research Organization for Information Science
|
||||
* and Technology (RIST). All rights reserved.
|
||||
* Copyright (c) 2017 Intel, Inc. All rights reserved.
|
||||
* Copyright (c) 2017-2018 Intel, Inc. All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
@ -38,74 +38,6 @@ BEGIN_C_DECLS
|
||||
*/
|
||||
typedef void (*pmix_tsd_destructor_t)(void *value);
|
||||
|
||||
#if defined(DOXYGEN)
|
||||
|
||||
/**
|
||||
* Typedef for thread-specific data key
|
||||
*/
|
||||
typedef void* pmix_tsd_key_t;
|
||||
|
||||
|
||||
/**
|
||||
* Delete a thread-specific data key
|
||||
*
|
||||
* Delete a thread-specific data key previously returned by
|
||||
* pmix_tsd_key_create(). The destructor associated with the key is
|
||||
* not fired in any thread and memory cleanup is the responsibility of
|
||||
* the caller.
|
||||
*
|
||||
* @note Unlike pthread_key_delete, this function should not be called
|
||||
* from within a destructor. It can not be universally supported at
|
||||
* this time.
|
||||
*
|
||||
* @param key[in] The key for accessing thread-specific data
|
||||
*
|
||||
* @retval PMIX_SUCCESS Success
|
||||
* @retval EINVAL Invalid key
|
||||
*/
|
||||
PMIX_EXPORT int pmix_tsd_key_delete(pmix_tsd_key_t key);
|
||||
|
||||
|
||||
/**
|
||||
* Set a thread-specific data value
|
||||
*
|
||||
* Associates value with key in the current thread. The value for the
|
||||
* key in other threads is not changed. Different threads may assign
|
||||
* different values to the same key.
|
||||
*
|
||||
* @note This function should not be called within
|
||||
* pmix_tsd_key_delete().
|
||||
*
|
||||
* @param key[in] Thread specific data key to modify
|
||||
* @param value[in] Value to associate with key
|
||||
*
|
||||
* @retval PMIX_SUCCESS Success
|
||||
* @retval ENOMEM Insufficient memory exists to associate the
|
||||
* value with the key
|
||||
* @retval EINVAL Invalid key
|
||||
*/
|
||||
PMIX_EXPORT int pmix_tsd_setspecific(pmix_tsd_key_t key, void *value);
|
||||
|
||||
|
||||
/**
|
||||
* Get a thread-specific data value
|
||||
*
|
||||
* Get the data associated with the given key, as set by
|
||||
* pmix_tsd_setspecific(). If pmix_tsd_setspecific() hasn't been
|
||||
* called in the current thread with the given key, NULL is returned
|
||||
* in valuep.
|
||||
*
|
||||
* @param key[in] Thread specific data key to modify
|
||||
* @param value[out] Value to associate with key
|
||||
*
|
||||
* @retval PMIX_SUCCESS Success
|
||||
* @retval ENOMEM Insufficient memory exists to associate the
|
||||
* value with the key
|
||||
* @retval EINVAL Invalid key
|
||||
*/
|
||||
PMIX_EXPORT int pmix_tsd_getspecific(pmix_tsd_key_t key, void **valuep);
|
||||
|
||||
#else
|
||||
|
||||
typedef pthread_key_t pmix_tsd_key_t;
|
||||
|
||||
@ -128,8 +60,6 @@ pmix_tsd_getspecific(pmix_tsd_key_t key, void **valuep)
|
||||
return PMIX_SUCCESS;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Create thread-specific data key
|
||||
*
|
||||
|
@ -69,7 +69,7 @@ extern pmix_client_globals_t pmix_client_globals;
|
||||
#include "src/runtime/pmix_rte.h"
|
||||
#include "src/mca/bfrops/base/base.h"
|
||||
#include "src/mca/gds/base/base.h"
|
||||
#include "src/mca/ptl/base/base.h"
|
||||
#include "src/mca/ptl/ptl.h"
|
||||
#include "src/mca/psec/psec.h"
|
||||
#include "src/include/pmix_globals.h"
|
||||
|
||||
@ -189,53 +189,6 @@ static void pmix_tool_notify_recv(struct pmix_peer_t *peer,
|
||||
}
|
||||
|
||||
|
||||
static void tool_iof_handler(struct pmix_peer_t *pr,
|
||||
pmix_ptl_hdr_t *hdr,
|
||||
pmix_buffer_t *buf, void *cbdata)
|
||||
{
|
||||
pmix_peer_t *peer = (pmix_peer_t*)pr;
|
||||
pmix_proc_t source;
|
||||
pmix_iof_channel_t channel;
|
||||
pmix_byte_object_t bo;
|
||||
int32_t cnt;
|
||||
pmix_status_t rc;
|
||||
|
||||
pmix_output_verbose(2, pmix_client_globals.iof_output,
|
||||
"recvd IOF");
|
||||
|
||||
/* if the buffer is empty, they are simply closing the channel */
|
||||
if (0 == buf->bytes_used) {
|
||||
return;
|
||||
}
|
||||
|
||||
cnt = 1;
|
||||
PMIX_BFROPS_UNPACK(rc, peer, buf, &source, &cnt, PMIX_PROC);
|
||||
if (PMIX_SUCCESS != rc) {
|
||||
PMIX_ERROR_LOG(rc);
|
||||
return;
|
||||
}
|
||||
cnt = 1;
|
||||
PMIX_BFROPS_UNPACK(rc, peer, buf, &channel, &cnt, PMIX_IOF_CHANNEL);
|
||||
if (PMIX_SUCCESS != rc) {
|
||||
PMIX_ERROR_LOG(rc);
|
||||
return;
|
||||
}
|
||||
cnt = 1;
|
||||
PMIX_BFROPS_UNPACK(rc, peer, buf, &bo, &cnt, PMIX_BYTE_OBJECT);
|
||||
if (PMIX_SUCCESS != rc) {
|
||||
PMIX_ERROR_LOG(rc);
|
||||
return;
|
||||
}
|
||||
if (NULL != bo.bytes && 0 < bo.size) {
|
||||
if (channel & PMIX_FWD_STDOUT_CHANNEL) {
|
||||
write(fileno(stdout), bo.bytes, bo.size);
|
||||
} else {
|
||||
fprintf(stderr, "%s", bo.bytes);
|
||||
}
|
||||
}
|
||||
PMIX_BYTE_OBJECT_DESTRUCT(&bo);
|
||||
}
|
||||
|
||||
PMIX_EXPORT int PMIx_tool_init(pmix_proc_t *proc,
|
||||
pmix_info_t info[], size_t ninfo)
|
||||
{
|
||||
@ -247,7 +200,6 @@ PMIX_EXPORT int PMIx_tool_init(pmix_proc_t *proc,
|
||||
bool rank_given = false;
|
||||
pmix_info_t ginfo;
|
||||
size_t n;
|
||||
pmix_ptl_posted_recv_t *rcv;
|
||||
pmix_proc_t wildcard;
|
||||
|
||||
PMIX_ACQUIRE_THREAD(&pmix_global_lock);
|
||||
@ -286,13 +238,6 @@ PMIX_EXPORT int PMIx_tool_init(pmix_proc_t *proc,
|
||||
PMIX_RELEASE_THREAD(&pmix_global_lock);
|
||||
return rc;
|
||||
}
|
||||
/* setup the IO Forwarding recv */
|
||||
rcv = PMIX_NEW(pmix_ptl_posted_recv_t);
|
||||
rcv->tag = PMIX_PTL_TAG_IOF;
|
||||
rcv->cbfunc = tool_iof_handler;
|
||||
/* add it to the end of the list of recvs */
|
||||
pmix_list_append(&pmix_ptl_globals.posted_recvs, &rcv->super);
|
||||
|
||||
|
||||
PMIX_CONSTRUCT(&pmix_client_globals.pending_requests, pmix_list_t);
|
||||
PMIX_CONSTRUCT(&pmix_client_globals.peers, pmix_pointer_array_t);
|
||||
|
@ -12,7 +12,7 @@
|
||||
# All rights reserved.
|
||||
# Copyright (c) 2007-2016 Cisco Systems, Inc. All rights reserved.
|
||||
# Copyright (c) 2013 NVIDIA Corporation. All rights reserved.
|
||||
# Copyright (c) 2013-2017 Intel, Inc. All rights reserved.
|
||||
# Copyright (c) 2013-2018 Intel, Inc. All rights reserved.
|
||||
# Copyright (c) 2016 Research Organization for Information Science
|
||||
# and Technology (RIST). All rights reserved.
|
||||
# $COPYRIGHT$
|
||||
@ -47,9 +47,9 @@ headers += \
|
||||
util/getid.h \
|
||||
util/strnlen.h \
|
||||
util/hash.h \
|
||||
util/name_fns.h \
|
||||
util/net.h \
|
||||
util/pif.h \
|
||||
util/tsd.h \
|
||||
util/parse_options.h \
|
||||
util/compress.h
|
||||
|
||||
@ -72,6 +72,7 @@ sources += \
|
||||
util/path.c \
|
||||
util/getid.c \
|
||||
util/hash.c \
|
||||
util/name_fns.c \
|
||||
util/net.c \
|
||||
util/pif.c \
|
||||
util/parse_options.c \
|
||||
|
154
opal/mca/pmix/pmix3x/pmix/src/util/name_fns.c
Обычный файл
154
opal/mca/pmix/pmix3x/pmix/src/util/name_fns.c
Обычный файл
@ -0,0 +1,154 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2005 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) 2010 Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2014-2016 Research Organization for Information Science
|
||||
* and Technology (RIST). All rights reserved.
|
||||
* Copyright (c) 2016-2018 Intel, Inc. All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
*
|
||||
* $HEADER$
|
||||
*/
|
||||
#include "pmix_config.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "pmix_common.h"
|
||||
|
||||
#include "src/threads/tsd.h"
|
||||
#include "src/util/error.h"
|
||||
#include "src/util/name_fns.h"
|
||||
#include "src/util/printf.h"
|
||||
|
||||
#define PMIX_PRINT_NAME_ARGS_MAX_SIZE 50
|
||||
#define PMIX_PRINT_NAME_ARG_NUM_BUFS 16
|
||||
|
||||
#define PMIX_SCHEMA_DELIMITER_CHAR '.'
|
||||
#define PMIX_SCHEMA_WILDCARD_CHAR '*'
|
||||
#define PMIX_SCHEMA_WILDCARD_STRING "*"
|
||||
#define PMIX_SCHEMA_INVALID_CHAR '$'
|
||||
#define PMIX_SCHEMA_INVALID_STRING "$"
|
||||
|
||||
static bool fns_init=false;
|
||||
|
||||
static pmix_tsd_key_t print_args_tsd_key;
|
||||
char* pmix_print_args_null = "NULL";
|
||||
typedef struct {
|
||||
char *buffers[PMIX_PRINT_NAME_ARG_NUM_BUFS];
|
||||
int cntr;
|
||||
} pmix_print_args_buffers_t;
|
||||
|
||||
static void
|
||||
buffer_cleanup(void *value)
|
||||
{
|
||||
int i;
|
||||
pmix_print_args_buffers_t *ptr;
|
||||
|
||||
if (NULL != value) {
|
||||
ptr = (pmix_print_args_buffers_t*)value;
|
||||
for (i=0; i < PMIX_PRINT_NAME_ARG_NUM_BUFS; i++) {
|
||||
free(ptr->buffers[i]);
|
||||
}
|
||||
free (ptr);
|
||||
}
|
||||
}
|
||||
|
||||
static pmix_print_args_buffers_t*
|
||||
get_print_name_buffer(void)
|
||||
{
|
||||
pmix_print_args_buffers_t *ptr;
|
||||
int ret, i;
|
||||
|
||||
if (!fns_init) {
|
||||
/* setup the print_args function */
|
||||
if (PMIX_SUCCESS != (ret = pmix_tsd_key_create(&print_args_tsd_key, buffer_cleanup))) {
|
||||
PMIX_ERROR_LOG(ret);
|
||||
return NULL;
|
||||
}
|
||||
fns_init = true;
|
||||
}
|
||||
|
||||
ret = pmix_tsd_getspecific(print_args_tsd_key, (void**)&ptr);
|
||||
if (PMIX_SUCCESS != ret) return NULL;
|
||||
|
||||
if (NULL == ptr) {
|
||||
ptr = (pmix_print_args_buffers_t*)malloc(sizeof(pmix_print_args_buffers_t));
|
||||
for (i=0; i < PMIX_PRINT_NAME_ARG_NUM_BUFS; i++) {
|
||||
ptr->buffers[i] = (char *) malloc((PMIX_PRINT_NAME_ARGS_MAX_SIZE+1) * sizeof(char));
|
||||
}
|
||||
ptr->cntr = 0;
|
||||
ret = pmix_tsd_setspecific(print_args_tsd_key, (void*)ptr);
|
||||
}
|
||||
|
||||
return (pmix_print_args_buffers_t*) ptr;
|
||||
}
|
||||
|
||||
char* pmix_util_print_name_args(const pmix_proc_t *name)
|
||||
{
|
||||
pmix_print_args_buffers_t *ptr;
|
||||
char *rank;
|
||||
|
||||
/* get the next buffer */
|
||||
ptr = get_print_name_buffer();
|
||||
if (NULL == ptr) {
|
||||
PMIX_ERROR_LOG(PMIX_ERR_OUT_OF_RESOURCE);
|
||||
return pmix_print_args_null;
|
||||
}
|
||||
/* cycle around the ring */
|
||||
if (PMIX_PRINT_NAME_ARG_NUM_BUFS == ptr->cntr) {
|
||||
ptr->cntr = 0;
|
||||
}
|
||||
|
||||
/* protect against NULL names */
|
||||
if (NULL == name) {
|
||||
snprintf(ptr->buffers[ptr->cntr++], PMIX_PRINT_NAME_ARGS_MAX_SIZE, "[NO-NAME]");
|
||||
return ptr->buffers[ptr->cntr-1];
|
||||
}
|
||||
|
||||
rank = pmix_util_print_rank(name->rank);
|
||||
|
||||
snprintf(ptr->buffers[ptr->cntr++],
|
||||
PMIX_PRINT_NAME_ARGS_MAX_SIZE,
|
||||
"[%s,%s]", name->nspace, rank);
|
||||
|
||||
return ptr->buffers[ptr->cntr-1];
|
||||
}
|
||||
|
||||
char* pmix_util_print_rank(const pmix_rank_t vpid)
|
||||
{
|
||||
pmix_print_args_buffers_t *ptr;
|
||||
|
||||
ptr = get_print_name_buffer();
|
||||
|
||||
if (NULL == ptr) {
|
||||
PMIX_ERROR_LOG(PMIX_ERR_OUT_OF_RESOURCE);
|
||||
return pmix_print_args_null;
|
||||
}
|
||||
|
||||
/* cycle around the ring */
|
||||
if (PMIX_PRINT_NAME_ARG_NUM_BUFS == ptr->cntr) {
|
||||
ptr->cntr = 0;
|
||||
}
|
||||
|
||||
if (PMIX_RANK_UNDEF == vpid) {
|
||||
snprintf(ptr->buffers[ptr->cntr++], PMIX_PRINT_NAME_ARGS_MAX_SIZE, "UNDEF");
|
||||
} else if (PMIX_RANK_WILDCARD == vpid) {
|
||||
snprintf(ptr->buffers[ptr->cntr++], PMIX_PRINT_NAME_ARGS_MAX_SIZE, "WILDCARD");
|
||||
} else {
|
||||
snprintf(ptr->buffers[ptr->cntr++],
|
||||
PMIX_PRINT_NAME_ARGS_MAX_SIZE,
|
||||
"%ld", (long)vpid);
|
||||
}
|
||||
return ptr->buffers[ptr->cntr-1];
|
||||
}
|
47
opal/mca/pmix/pmix3x/pmix/src/util/name_fns.h
Обычный файл
47
opal/mca/pmix/pmix3x/pmix/src/util/name_fns.h
Обычный файл
@ -0,0 +1,47 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2008 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) 2010 Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2014-2016 Research Organization for Information Science
|
||||
* and Technology (RIST). All rights reserved.
|
||||
* Copyright (c) 2018 Intel, Inc. All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
*
|
||||
* $HEADER$
|
||||
*/
|
||||
|
||||
#ifndef _PMIX_NAME_FNS_H_
|
||||
#define _PMIX_NAME_FNS_H_
|
||||
|
||||
#include "pmix_config.h"
|
||||
|
||||
#ifdef HAVE_STDINT_h
|
||||
#include <stdint.h>
|
||||
#endif
|
||||
|
||||
#include "pmix_common.h"
|
||||
|
||||
BEGIN_C_DECLS
|
||||
|
||||
/* useful define to print name args in output messages */
|
||||
PMIX_EXPORT char* pmix_util_print_name_args(const pmix_proc_t *name);
|
||||
#define PMIX_NAME_PRINT(n) \
|
||||
pmix_util_print_name_args(n)
|
||||
|
||||
PMIX_EXPORT char* pmix_util_print_rank(const pmix_rank_t vpid);
|
||||
#define PMIX_RANK_PRINT(n) \
|
||||
pmix_util_print_rank(n)
|
||||
|
||||
|
||||
END_C_DECLS
|
||||
#endif
|
@ -12,7 +12,7 @@
|
||||
* Copyright (c) 2007 Los Alamos National Security, LLC. All rights
|
||||
* reserved.
|
||||
* Copyright (c) 2009-2015 Cisco Systems, Inc. All rights reserved.
|
||||
* Copyright (c) 2013 Intel, Inc. All rights reserved.
|
||||
* Copyright (c) 2013-2018 Intel, Inc. All rights reserved.
|
||||
* Copyright (c) 2015 Research Organization for Information Science
|
||||
* and Technology (RIST). All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
@ -79,7 +79,7 @@
|
||||
#include "src/util/output.h"
|
||||
#include "src/util/argv.h"
|
||||
#include "src/util/show_help.h"
|
||||
#include "src/util/tsd.h"
|
||||
#include "src/threads/tsd.h"
|
||||
#include "src/runtime/pmix_rte.h"
|
||||
|
||||
/* this function doesn't depend on sockaddr_h */
|
||||
|
@ -1,172 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2007-2013 Los Alamos National Security, LLC. All rights
|
||||
* reserved.
|
||||
* Copyright (c) 2008 Cisco Systems, Inc. All rights reserved.
|
||||
* Copyright (c) 2015 Research Organization for Information Science
|
||||
* and Technology (RIST). All rights reserved.
|
||||
* Copyright (c) 2016 Intel, Inc. All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
*
|
||||
* $HEADER$
|
||||
*/
|
||||
|
||||
|
||||
#ifndef PMIX_THREADS_TSD_H
|
||||
#define PMIX_THREADS_TSD_H
|
||||
|
||||
#include "pmix_config.h"
|
||||
#include "pmix_common.h"
|
||||
|
||||
#include <pthread.h>
|
||||
|
||||
|
||||
BEGIN_C_DECLS
|
||||
|
||||
/**
|
||||
* @file
|
||||
*
|
||||
* Thread Specific Datastore Interface
|
||||
*
|
||||
* Functions for providing thread-specific datastore capabilities.
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* Prototype for callback when tsd data is being destroyed
|
||||
*/
|
||||
typedef void (*pmix_tsd_destructor_t)(void *value);
|
||||
|
||||
#if defined(DOXYGEN)
|
||||
|
||||
/**
|
||||
* Typedef for thread-specific data key
|
||||
*/
|
||||
typedef void* pmix_tsd_key_t;
|
||||
|
||||
|
||||
/**
|
||||
* Create thread-specific data key
|
||||
*
|
||||
* Create a thread-specific data key visible to all threads in the
|
||||
* current process. The returned key is valid in all threads,
|
||||
* although the values bound to the key by pmix_tsd_setspecific() are
|
||||
* allocated on a per-thread basis and persist for the life of the
|
||||
* calling thread.
|
||||
*
|
||||
* Upon key creation, the value NULL is associated with the new key in
|
||||
* all active threads. When a new thread is created, the value NULL
|
||||
* is associated with all defined keys in the new thread.
|
||||
*
|
||||
* The destructor parameter may be NULL. At thread exit, if
|
||||
* destructor is non-NULL AND the thread has a non-NULL value
|
||||
* associated with the key, the function is called with the current
|
||||
* value as its argument.
|
||||
*
|
||||
* @param key[out] The key for accessing thread-specific data
|
||||
* @param destructor[in] Cleanup function to call when a thread exits
|
||||
*
|
||||
* @retval PMIX_SUCCESS Success
|
||||
* @retval EAGAIN The system lacked the necessary resource to
|
||||
* create another thread specific data key
|
||||
* @retval ENOMEM Insufficient memory exists to create the key
|
||||
*/
|
||||
PMIX_EXPORT int pmix_tsd_key_create(pmix_tsd_key_t *key,
|
||||
pmix_tsd_destructor_t destructor);
|
||||
|
||||
|
||||
/**
|
||||
* Delete a thread-specific data key
|
||||
*
|
||||
* Delete a thread-specific data key previously returned by
|
||||
* pmix_tsd_key_create(). The destructor associated with the key is
|
||||
* not fired in any thread and memory cleanup is the responsibility of
|
||||
* the caller.
|
||||
*
|
||||
* @note Unlike pthread_key_delete, this function should not be called
|
||||
* from within a destructor. It can not be universally supported at
|
||||
* this time.
|
||||
*
|
||||
* @param key[in] The key for accessing thread-specific data
|
||||
*
|
||||
* @retval PMIX_SUCCESS Success
|
||||
* @retval EINVAL Invalid key
|
||||
*/
|
||||
PMIX_EXPORT int pmix_tsd_key_delete(pmix_tsd_key_t key);
|
||||
|
||||
|
||||
/**
|
||||
* Set a thread-specific data value
|
||||
*
|
||||
* Associates value with key in the current thread. The value for the
|
||||
* key in other threads is not changed. Different threads may assign
|
||||
* different values to the same key.
|
||||
*
|
||||
* @note This function should not be called within
|
||||
* pmix_tsd_key_delete().
|
||||
*
|
||||
* @param key[in] Thread specific data key to modify
|
||||
* @param value[in] Value to associate with key
|
||||
*
|
||||
* @retval PMIX_SUCCESS Success
|
||||
* @retval ENOMEM Insufficient memory exists to associate the
|
||||
* value with the key
|
||||
* @retval EINVAL Invalid key
|
||||
*/
|
||||
PMIX_EXPORT int pmix_tsd_setspecific(pmix_tsd_key_t key, void *value);
|
||||
|
||||
|
||||
/**
|
||||
* Get a thread-specific data value
|
||||
*
|
||||
* Get the data associated with the given key, as set by
|
||||
* pmix_tsd_setspecific(). If pmix_tsd_setspecific() hasn't been
|
||||
* called in the current thread with the given key, NULL is returned
|
||||
* in valuep.
|
||||
*
|
||||
* @param key[in] Thread specific data key to modify
|
||||
* @param value[out] Value to associate with key
|
||||
*
|
||||
* @retval PMIX_SUCCESS Success
|
||||
* @retval ENOMEM Insufficient memory exists to associate the
|
||||
* value with the key
|
||||
* @retval EINVAL Invalid key
|
||||
*/
|
||||
PMIX_EXPORT int pmix_tsd_getspecific(pmix_tsd_key_t key, void **valuep);
|
||||
|
||||
#else
|
||||
|
||||
typedef pthread_key_t pmix_tsd_key_t;
|
||||
|
||||
static inline int
|
||||
pmix_tsd_key_create(pmix_tsd_key_t *key,
|
||||
pmix_tsd_destructor_t destructor)
|
||||
{
|
||||
return pthread_key_create(key, destructor);
|
||||
}
|
||||
|
||||
static inline int
|
||||
pmix_tsd_key_delete(pmix_tsd_key_t key)
|
||||
{
|
||||
return pthread_key_delete(key);
|
||||
}
|
||||
|
||||
static inline int
|
||||
pmix_tsd_setspecific(pmix_tsd_key_t key, void *value)
|
||||
{
|
||||
return pthread_setspecific(key, value);
|
||||
}
|
||||
|
||||
static inline int
|
||||
pmix_tsd_getspecific(pmix_tsd_key_t key, void **valuep)
|
||||
{
|
||||
*valuep = pthread_getspecific(key);
|
||||
return PMIX_SUCCESS;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
END_C_DECLS
|
||||
|
||||
#endif /* PMIX_MTHREADS_TSD_H */
|
@ -1,6 +1,6 @@
|
||||
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
|
||||
/*
|
||||
* Copyright (c) 2015-2016 Intel, Inc. All rights reserved.
|
||||
* Copyright (c) 2015-2018 Intel, Inc. All rights reserved.
|
||||
* Copyright (c) 2015 Research Organization for Information Science
|
||||
* and Technology (RIST). All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
|
||||
/*
|
||||
* Copyright (c) 2015-2016 Intel, Inc. All rights reserved.
|
||||
* Copyright (c) 2015-2018 Intel, Inc. All rights reserved.
|
||||
* Copyright (c) 2015 Research Organization for Information Science
|
||||
* and Technology (RIST). All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
|
@ -120,7 +120,7 @@ const opal_pmix_base_module_t opal_pmix_pmix3x_module = {
|
||||
.server_setup_fork = pmix3x_server_setup_fork,
|
||||
.server_dmodex_request = pmix3x_server_dmodex,
|
||||
.server_notify_event = pmix3x_server_notify_event,
|
||||
.server_iof_push = pmix3x_server_iof_push,
|
||||
.server_iof_push = NULL, //pmix3x_server_iof_push,
|
||||
/* tool APIs */
|
||||
.tool_init = pmix3x_tool_init,
|
||||
.tool_finalize = pmix3x_tool_fini,
|
||||
|
@ -297,9 +297,11 @@ OPAL_MODULE_DECLSPEC int pmix3x_server_notify_event(int status,
|
||||
opal_list_t *info,
|
||||
opal_pmix_op_cbfunc_t cbfunc, void *cbdata);
|
||||
|
||||
#if 0
|
||||
OPAL_MODULE_DECLSPEC int pmix3x_server_iof_push(const opal_process_name_t *source,
|
||||
opal_pmix_iof_channel_t channel,
|
||||
unsigned char *data, size_t nbytes);
|
||||
#endif
|
||||
|
||||
/**** COMPONENT UTILITY FUNCTIONS ****/
|
||||
OPAL_MODULE_DECLSPEC int opal_pmix_pmix3x_check_evars(void);
|
||||
|
@ -569,6 +569,7 @@ int pmix3x_server_notify_event(int status,
|
||||
return pmix3x_convert_rc(rc);
|
||||
}
|
||||
|
||||
#if 0
|
||||
int pmix3x_server_iof_push(const opal_process_name_t *source,
|
||||
opal_pmix_iof_channel_t channel,
|
||||
unsigned char *data, size_t nbytes)
|
||||
@ -635,3 +636,4 @@ int pmix3x_server_iof_push(const opal_process_name_t *source,
|
||||
|
||||
return ret;
|
||||
}
|
||||
#endif
|
||||
|
@ -209,9 +209,9 @@ static void job_errors(int fd, short args, void *cbdata)
|
||||
ORTE_JOBID_PRINT(jdata->jobid),
|
||||
ORTE_NAME_PRINT(&jdata->originator)));
|
||||
if (0 > (ret = orte_rml.send_buffer_nb(orte_mgmt_conduit,
|
||||
&jdata->originator, answer,
|
||||
ORTE_RML_TAG_LAUNCH_RESP,
|
||||
orte_rml_send_callback, NULL))) {
|
||||
&jdata->originator, answer,
|
||||
ORTE_RML_TAG_LAUNCH_RESP,
|
||||
orte_rml_send_callback, NULL))) {
|
||||
ORTE_ERROR_LOG(ret);
|
||||
OBJ_RELEASE(answer);
|
||||
}
|
||||
|
@ -235,43 +235,9 @@ void orte_ras_base_allocate(int fd, short args, void *cbdata)
|
||||
"%s ras:base:allocate nothing found in module - proceeding to hostfile",
|
||||
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME)));
|
||||
|
||||
/* nothing was found, or no active module was alive. Our next
|
||||
* option is to look for a hostfile and assign our global
|
||||
* pool from there.
|
||||
*
|
||||
* Individual hostfile names, if given, are included
|
||||
* in the app_contexts for this job. We therefore need to
|
||||
* retrieve the app_contexts for the job, and then cycle
|
||||
* through them to see if anything is there. The parser will
|
||||
* add the nodes found in each hostfile to our list - i.e.,
|
||||
* the resulting list contains the UNION of all nodes specified
|
||||
* in hostfiles from across all app_contexts
|
||||
*
|
||||
* We then continue to add any hosts provided by dash-host and
|
||||
* the default hostfile, if we have it. We will then filter out
|
||||
* all the non-desired hosts (i.e., those not specified by
|
||||
* -host and/or -hostfile) when we start the mapping process
|
||||
*
|
||||
* Note that any relative node syntax found in the hostfiles will
|
||||
* generate an error in this scenario, so only non-relative syntax
|
||||
* can be present
|
||||
*/
|
||||
if (NULL != orte_default_hostfile) {
|
||||
OPAL_OUTPUT_VERBOSE((5, orte_ras_base_framework.framework_output,
|
||||
"%s ras:base:allocate parsing default hostfile %s",
|
||||
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME),
|
||||
orte_default_hostfile));
|
||||
|
||||
/* a default hostfile was provided - parse it */
|
||||
if (ORTE_SUCCESS != (rc = orte_util_add_hostfile_nodes(&nodes,
|
||||
orte_default_hostfile))) {
|
||||
OBJ_DESTRUCT(&nodes);
|
||||
ORTE_FORCED_TERMINATE(ORTE_ERROR_DEFAULT_EXIT_CODE);
|
||||
OBJ_RELEASE(caddy);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
/* nothing was found, or no active module was alive. We first see
|
||||
* if we were given a rankfile - if so, use it as the hosts will be
|
||||
* taken from the mapping */
|
||||
if (NULL != orte_rankfile) {
|
||||
OPAL_OUTPUT_VERBOSE((5, orte_ras_base_framework.framework_output,
|
||||
"%s ras:base:allocate parsing rankfile %s",
|
||||
@ -287,85 +253,8 @@ void orte_ras_base_allocate(int fd, short args, void *cbdata)
|
||||
return;
|
||||
}
|
||||
}
|
||||
for (i=0; i < jdata->apps->size; i++) {
|
||||
if (NULL == (app = (orte_app_context_t*)opal_pointer_array_get_item(jdata->apps, i))) {
|
||||
continue;
|
||||
}
|
||||
if (orte_get_attribute(&app->attributes, ORTE_APP_HOSTFILE, (void**)&hosts, OPAL_STRING)) {
|
||||
OPAL_OUTPUT_VERBOSE((5, orte_ras_base_framework.framework_output,
|
||||
"%s ras:base:allocate adding hostfile %s",
|
||||
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME), hosts));
|
||||
|
||||
/* hostfile was specified - parse it and add it to the list */
|
||||
if (ORTE_SUCCESS != (rc = orte_util_add_hostfile_nodes(&nodes, hosts))) {
|
||||
free(hosts);
|
||||
OBJ_DESTRUCT(&nodes);
|
||||
/* set an error event */
|
||||
ORTE_FORCED_TERMINATE(ORTE_ERROR_DEFAULT_EXIT_CODE);
|
||||
OBJ_RELEASE(caddy);
|
||||
return;
|
||||
}
|
||||
free(hosts);
|
||||
} else if (!orte_soft_locations &&
|
||||
orte_get_attribute(&app->attributes, ORTE_APP_DASH_HOST, (void**)&hosts, OPAL_STRING)) {
|
||||
/* if we are using soft locations, then any dash-host would
|
||||
* just include desired nodes and not required. We don't want
|
||||
* to pick them up here as this would mean the request was
|
||||
* always satisfied - instead, we want to allow the request
|
||||
* to fail later on and use whatever nodes are actually
|
||||
* available
|
||||
*/
|
||||
OPAL_OUTPUT_VERBOSE((5, orte_ras_base_framework.framework_output,
|
||||
"%s ras:base:allocate adding dash_hosts",
|
||||
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME)));
|
||||
if (ORTE_SUCCESS != (rc = orte_util_add_dash_host_nodes(&nodes, hosts, true))) {
|
||||
free(hosts);
|
||||
OBJ_DESTRUCT(&nodes);
|
||||
ORTE_FORCED_TERMINATE(ORTE_ERROR_DEFAULT_EXIT_CODE);
|
||||
OBJ_RELEASE(caddy);
|
||||
return;
|
||||
}
|
||||
free(hosts);
|
||||
}
|
||||
}
|
||||
|
||||
/* if something was found in the hostfile(s), we use that as our global
|
||||
* pool - set it and we are done
|
||||
*/
|
||||
if (!opal_list_is_empty(&nodes)) {
|
||||
/* store the results in the global resource pool - this removes the
|
||||
* list items
|
||||
*/
|
||||
if (ORTE_SUCCESS != (rc = orte_ras_base_node_insert(&nodes, jdata))) {
|
||||
ORTE_ERROR_LOG(rc);
|
||||
ORTE_FORCED_TERMINATE(ORTE_ERROR_DEFAULT_EXIT_CODE);
|
||||
OBJ_RELEASE(caddy);
|
||||
return;
|
||||
}
|
||||
/* cleanup */
|
||||
OBJ_DESTRUCT(&nodes);
|
||||
goto DISPLAY;
|
||||
}
|
||||
|
||||
OPAL_OUTPUT_VERBOSE((5, orte_ras_base_framework.framework_output,
|
||||
"%s ras:base:allocate nothing found in hostfiles - checking for rankfile",
|
||||
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME)));
|
||||
|
||||
/* Our next option is to look for a rankfile - if one was provided, we
|
||||
* will use its nodes to create a default allocation pool
|
||||
*/
|
||||
if (NULL != orte_rankfile) {
|
||||
/* check the rankfile for node information */
|
||||
if (ORTE_SUCCESS != (rc = orte_util_add_hostfile_nodes(&nodes,
|
||||
orte_rankfile))) {
|
||||
ORTE_ERROR_LOG(rc);
|
||||
OBJ_DESTRUCT(&nodes);
|
||||
ORTE_FORCED_TERMINATE(ORTE_ERROR_DEFAULT_EXIT_CODE);
|
||||
OBJ_RELEASE(caddy);
|
||||
return ;
|
||||
}
|
||||
}
|
||||
/* if something was found in rankfile, we use that as our global
|
||||
/* if something was found in the rankfile, we use that as our global
|
||||
* pool - set it and we are done
|
||||
*/
|
||||
if (!opal_list_is_empty(&nodes)) {
|
||||
@ -387,9 +276,146 @@ void orte_ras_base_allocate(int fd, short args, void *cbdata)
|
||||
goto DISPLAY;
|
||||
}
|
||||
|
||||
/* if a dash-host has been provided, aggregate across all the
|
||||
* app_contexts. Any hosts the user wants to add via comm_spawn
|
||||
* can be done so using the add_host option */
|
||||
for (i=0; i < jdata->apps->size; i++) {
|
||||
if (NULL == (app = (orte_app_context_t*)opal_pointer_array_get_item(jdata->apps, i))) {
|
||||
continue;
|
||||
}
|
||||
if (!orte_soft_locations &&
|
||||
orte_get_attribute(&app->attributes, ORTE_APP_DASH_HOST, (void**)&hosts, OPAL_STRING)) {
|
||||
/* if we are using soft locations, then any dash-host would
|
||||
* just include desired nodes and not required. We don't want
|
||||
* to pick them up here as this would mean the request was
|
||||
* always satisfied - instead, we want to allow the request
|
||||
* to fail later on and use whatever nodes are actually
|
||||
* available
|
||||
*/
|
||||
OPAL_OUTPUT_VERBOSE((5, orte_ras_base_framework.framework_output,
|
||||
"%s ras:base:allocate adding dash_hosts",
|
||||
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME)));
|
||||
if (ORTE_SUCCESS != (rc = orte_util_add_dash_host_nodes(&nodes, hosts, true))) {
|
||||
free(hosts);
|
||||
OBJ_DESTRUCT(&nodes);
|
||||
ORTE_FORCED_TERMINATE(ORTE_ERROR_DEFAULT_EXIT_CODE);
|
||||
OBJ_RELEASE(caddy);
|
||||
return;
|
||||
}
|
||||
free(hosts);
|
||||
}
|
||||
}
|
||||
|
||||
/* if something was found in the dash-host(s), we use that as our global
|
||||
* pool - set it and we are done
|
||||
*/
|
||||
if (!opal_list_is_empty(&nodes)) {
|
||||
/* store the results in the global resource pool - this removes the
|
||||
* list items
|
||||
*/
|
||||
if (ORTE_SUCCESS != (rc = orte_ras_base_node_insert(&nodes, jdata))) {
|
||||
ORTE_ERROR_LOG(rc);
|
||||
ORTE_FORCED_TERMINATE(ORTE_ERROR_DEFAULT_EXIT_CODE);
|
||||
OBJ_RELEASE(caddy);
|
||||
return;
|
||||
}
|
||||
/* cleanup */
|
||||
OBJ_DESTRUCT(&nodes);
|
||||
goto DISPLAY;
|
||||
}
|
||||
|
||||
/* Our next option is to look for a hostfile and assign our global
|
||||
* pool from there.
|
||||
*
|
||||
* Individual hostfile names, if given, are included
|
||||
* in the app_contexts for this job. We therefore need to
|
||||
* retrieve the app_contexts for the job, and then cycle
|
||||
* through them to see if anything is there. The parser will
|
||||
* add the nodes found in each hostfile to our list - i.e.,
|
||||
* the resulting list contains the UNION of all nodes specified
|
||||
* in hostfiles from across all app_contexts
|
||||
*
|
||||
* Note that any relative node syntax found in the hostfiles will
|
||||
* generate an error in this scenario, so only non-relative syntax
|
||||
* can be present
|
||||
*/
|
||||
for (i=0; i < jdata->apps->size; i++) {
|
||||
if (NULL == (app = (orte_app_context_t*)opal_pointer_array_get_item(jdata->apps, i))) {
|
||||
continue;
|
||||
}
|
||||
if (orte_get_attribute(&app->attributes, ORTE_APP_HOSTFILE, (void**)&hosts, OPAL_STRING)) {
|
||||
OPAL_OUTPUT_VERBOSE((5, orte_ras_base_framework.framework_output,
|
||||
"%s ras:base:allocate adding hostfile %s",
|
||||
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME), hosts));
|
||||
|
||||
/* hostfile was specified - parse it and add it to the list */
|
||||
if (ORTE_SUCCESS != (rc = orte_util_add_hostfile_nodes(&nodes, hosts))) {
|
||||
free(hosts);
|
||||
OBJ_DESTRUCT(&nodes);
|
||||
/* set an error event */
|
||||
ORTE_FORCED_TERMINATE(ORTE_ERROR_DEFAULT_EXIT_CODE);
|
||||
OBJ_RELEASE(caddy);
|
||||
return;
|
||||
}
|
||||
free(hosts);
|
||||
}
|
||||
}
|
||||
|
||||
/* if something was found in the hostfiles(s), we use that as our global
|
||||
* pool - set it and we are done
|
||||
*/
|
||||
if (!opal_list_is_empty(&nodes)) {
|
||||
/* store the results in the global resource pool - this removes the
|
||||
* list items
|
||||
*/
|
||||
if (ORTE_SUCCESS != (rc = orte_ras_base_node_insert(&nodes, jdata))) {
|
||||
ORTE_ERROR_LOG(rc);
|
||||
ORTE_FORCED_TERMINATE(ORTE_ERROR_DEFAULT_EXIT_CODE);
|
||||
OBJ_RELEASE(caddy);
|
||||
return;
|
||||
}
|
||||
/* cleanup */
|
||||
OBJ_DESTRUCT(&nodes);
|
||||
goto DISPLAY;
|
||||
}
|
||||
|
||||
/* if nothing was found so far, then look for a default hostfile */
|
||||
if (NULL != orte_default_hostfile) {
|
||||
OPAL_OUTPUT_VERBOSE((5, orte_ras_base_framework.framework_output,
|
||||
"%s ras:base:allocate parsing default hostfile %s",
|
||||
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME),
|
||||
orte_default_hostfile));
|
||||
|
||||
/* a default hostfile was provided - parse it */
|
||||
if (ORTE_SUCCESS != (rc = orte_util_add_hostfile_nodes(&nodes,
|
||||
orte_default_hostfile))) {
|
||||
OBJ_DESTRUCT(&nodes);
|
||||
ORTE_FORCED_TERMINATE(ORTE_ERROR_DEFAULT_EXIT_CODE);
|
||||
OBJ_RELEASE(caddy);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
/* if something was found in the default hostfile, we use that as our global
|
||||
* pool - set it and we are done
|
||||
*/
|
||||
if (!opal_list_is_empty(&nodes)) {
|
||||
/* store the results in the global resource pool - this removes the
|
||||
* list items
|
||||
*/
|
||||
if (ORTE_SUCCESS != (rc = orte_ras_base_node_insert(&nodes, jdata))) {
|
||||
ORTE_ERROR_LOG(rc);
|
||||
ORTE_FORCED_TERMINATE(ORTE_ERROR_DEFAULT_EXIT_CODE);
|
||||
OBJ_RELEASE(caddy);
|
||||
return;
|
||||
}
|
||||
/* cleanup */
|
||||
OBJ_DESTRUCT(&nodes);
|
||||
goto DISPLAY;
|
||||
}
|
||||
|
||||
OPAL_OUTPUT_VERBOSE((5, orte_ras_base_framework.framework_output,
|
||||
"%s ras:base:allocate nothing found in rankfile - inserting current node",
|
||||
"%s ras:base:allocate nothing found in hostfiles - inserting current node",
|
||||
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME)));
|
||||
|
||||
addlocal:
|
||||
|
@ -12,7 +12,7 @@
|
||||
* Copyright (c) 2011-2012 Cisco Systems, Inc. All rights reserved.
|
||||
* Copyright (c) 2011-2012 Los Alamos National Security, LLC.
|
||||
* All rights reserved.
|
||||
* Copyright (c) 2014-2017 Intel, Inc. All rights reserved.
|
||||
* Copyright (c) 2014-2018 Intel, Inc. All rights reserved.
|
||||
* Copyright (c) 2016 Research Organization for Information Science
|
||||
* and Technology (RIST). All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
@ -190,19 +190,23 @@ void orte_rmaps_base_map_job(int fd, short args, void *cbdata)
|
||||
}
|
||||
}
|
||||
/* check for oversubscribe directives */
|
||||
if (!(ORTE_MAPPING_SUBSCRIBE_GIVEN & ORTE_GET_MAPPING_DIRECTIVE(orte_rmaps_base.mapping))) {
|
||||
ORTE_SET_MAPPING_DIRECTIVE(jdata->map->mapping, ORTE_MAPPING_NO_OVERSUBSCRIBE);
|
||||
} else {
|
||||
/* pass along the directive */
|
||||
if (ORTE_MAPPING_NO_OVERSUBSCRIBE & ORTE_GET_MAPPING_DIRECTIVE(orte_rmaps_base.mapping)) {
|
||||
if (!(ORTE_MAPPING_SUBSCRIBE_GIVEN & ORTE_GET_MAPPING_DIRECTIVE(jdata->map->mapping))) {
|
||||
if (!(ORTE_MAPPING_SUBSCRIBE_GIVEN & ORTE_GET_MAPPING_DIRECTIVE(orte_rmaps_base.mapping))) {
|
||||
ORTE_SET_MAPPING_DIRECTIVE(jdata->map->mapping, ORTE_MAPPING_NO_OVERSUBSCRIBE);
|
||||
} else {
|
||||
ORTE_UNSET_MAPPING_DIRECTIVE(jdata->map->mapping, ORTE_MAPPING_NO_OVERSUBSCRIBE);
|
||||
/* pass along the directive */
|
||||
if (ORTE_MAPPING_NO_OVERSUBSCRIBE & ORTE_GET_MAPPING_DIRECTIVE(orte_rmaps_base.mapping)) {
|
||||
ORTE_SET_MAPPING_DIRECTIVE(jdata->map->mapping, ORTE_MAPPING_NO_OVERSUBSCRIBE);
|
||||
} else {
|
||||
ORTE_UNSET_MAPPING_DIRECTIVE(jdata->map->mapping, ORTE_MAPPING_NO_OVERSUBSCRIBE);
|
||||
}
|
||||
}
|
||||
}
|
||||
/* check for no-use-local directive */
|
||||
if (ORTE_MAPPING_NO_USE_LOCAL & ORTE_GET_MAPPING_DIRECTIVE(orte_rmaps_base.mapping)) {
|
||||
ORTE_SET_MAPPING_DIRECTIVE(jdata->map->mapping, ORTE_MAPPING_NO_USE_LOCAL);
|
||||
if (!(ORTE_MAPPING_LOCAL_GIVEN & ORTE_GET_MAPPING_DIRECTIVE(jdata->map->mapping))) {
|
||||
if (ORTE_MAPPING_NO_USE_LOCAL & ORTE_GET_MAPPING_DIRECTIVE(orte_rmaps_base.mapping)) {
|
||||
ORTE_SET_MAPPING_DIRECTIVE(jdata->map->mapping, ORTE_MAPPING_NO_USE_LOCAL);
|
||||
}
|
||||
}
|
||||
/* ditto for rank policy */
|
||||
if (!ORTE_RANKING_POLICY_IS_SET(jdata->map->ranking)) {
|
||||
|
@ -190,49 +190,8 @@ int orte_rmaps_base_get_target_nodes(opal_list_t *allocated_nodes, orte_std_cntr
|
||||
return rc;
|
||||
}
|
||||
free(hosts);
|
||||
} else if (NULL != orte_rankfile) {
|
||||
/* use the rankfile, if provided */
|
||||
OPAL_OUTPUT_VERBOSE((5, orte_rmaps_base_framework.framework_output,
|
||||
"%s using rankfile %s",
|
||||
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME),
|
||||
orte_rankfile));
|
||||
if (ORTE_SUCCESS != (rc = orte_util_add_hostfile_nodes(&nodes,
|
||||
orte_rankfile))) {
|
||||
ORTE_ERROR_LOG(rc);
|
||||
return rc;
|
||||
}
|
||||
if (0 == opal_list_get_size(&nodes)) {
|
||||
OPAL_OUTPUT_VERBOSE((5, orte_rmaps_base_framework.framework_output,
|
||||
"%s nothing found in given rankfile",
|
||||
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME)));
|
||||
OBJ_DESTRUCT(&nodes);
|
||||
return ORTE_ERR_BAD_PARAM;
|
||||
}
|
||||
} else if (NULL != orte_default_hostfile) {
|
||||
/* fall back to the default hostfile, if provided */
|
||||
OPAL_OUTPUT_VERBOSE((5, orte_rmaps_base_framework.framework_output,
|
||||
"%s using default hostfile %s",
|
||||
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME),
|
||||
orte_default_hostfile));
|
||||
if (ORTE_SUCCESS != (rc = orte_util_add_hostfile_nodes(&nodes,
|
||||
orte_default_hostfile))) {
|
||||
ORTE_ERROR_LOG(rc);
|
||||
return rc;
|
||||
}
|
||||
/* this is a special case - we always install a default
|
||||
* hostfile, but it is empty. If the user didn't remove it
|
||||
* or put something into it, then we will have pursued that
|
||||
* option and found nothing. This isn't an error, we just need
|
||||
* to add all the known nodes
|
||||
*/
|
||||
if (0 == opal_list_get_size(&nodes)) {
|
||||
OPAL_OUTPUT_VERBOSE((5, orte_rmaps_base_framework.framework_output,
|
||||
"%s nothing in default hostfile - using known nodes",
|
||||
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME)));
|
||||
goto addknown;
|
||||
}
|
||||
} else {
|
||||
/* if nothing else was available, then use all known nodes, which
|
||||
/* if nothing else was specified by the app, then use all known nodes, which
|
||||
* will include ourselves
|
||||
*/
|
||||
OPAL_OUTPUT_VERBOSE((5, orte_rmaps_base_framework.framework_output,
|
||||
@ -585,9 +544,7 @@ orte_proc_t* orte_rmaps_base_setup_proc(orte_job_t *jdata,
|
||||
* available slots - otherwise, it does */
|
||||
if (!ORTE_FLAG_TEST(jdata, ORTE_JOB_FLAG_DEBUGGER_DAEMON)) {
|
||||
node->num_procs++;
|
||||
if (node->slots_inuse < node->slots) {
|
||||
++node->slots_inuse;
|
||||
}
|
||||
++node->slots_inuse;
|
||||
}
|
||||
if (0 > (rc = opal_pointer_array_add(node->procs, (void*)proc))) {
|
||||
ORTE_ERROR_LOG(rc);
|
||||
|
@ -2,7 +2,7 @@
|
||||
* Copyright (c) 2011 Cisco Systems, Inc. All rights reserved.
|
||||
* Copyright (c) 2011 Los Alamos National Security, LLC.
|
||||
* All rights reserved.
|
||||
* Copyright (c) 2014-2017 Intel, Inc. All rights reserved.
|
||||
* Copyright (c) 2014-2018 Intel, Inc. All rights reserved.
|
||||
* Copyright (c) 2015-2017 Research Organization for Information Science
|
||||
* and Technology (RIST). All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
@ -357,7 +357,7 @@ static int ppr_mapper(orte_job_t *jdata)
|
||||
/* if we weren't given a directive either way, then we will error out
|
||||
* as the #slots were specifically given, either by the host RM or
|
||||
* via hostfile/dash-host */
|
||||
if (!(ORTE_MAPPING_SUBSCRIBE_GIVEN & ORTE_GET_MAPPING_DIRECTIVE(orte_rmaps_base.mapping))) {
|
||||
if (!(ORTE_MAPPING_SUBSCRIBE_GIVEN & ORTE_GET_MAPPING_DIRECTIVE(jdata->map->mapping))) {
|
||||
orte_show_help("help-orte-rmaps-base.txt", "orte-rmaps-base:alloc-error",
|
||||
true, app->num_procs, app->app);
|
||||
ORTE_UPDATE_EXIT_STATUS(ORTE_ERROR_DEFAULT_EXIT_CODE);
|
||||
|
@ -12,7 +12,7 @@
|
||||
* Copyright (c) 2011-2017 Cisco Systems, Inc. All rights reserved
|
||||
* Copyright (c) 2012-2015 Los Alamos National Security, LLC. All rights
|
||||
* reserved.
|
||||
* Copyright (c) 2014-2017 Intel, Inc. All rights reserved.
|
||||
* Copyright (c) 2014-2018 Intel, Inc. All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
@ -89,7 +89,9 @@ ORTE_DECLSPEC OBJ_CLASS_DECLARATION(orte_job_map_t);
|
||||
#define ORTE_MAPPING_SUBSCRIBE_GIVEN 0x0400
|
||||
#define ORTE_MAPPING_SPAN 0x0800
|
||||
/* an error flag */
|
||||
#define ORTE_MAPPING_CONFLICTED 0x2000
|
||||
#define ORTE_MAPPING_CONFLICTED 0x1000
|
||||
/* directives given */
|
||||
#define ORTE_MAPPING_LOCAL_GIVEN 0x2000
|
||||
#define ORTE_MAPPING_GIVEN 0x4000
|
||||
/* mapping a debugger job */
|
||||
#define ORTE_MAPPING_DEBUGGER 0x8000
|
||||
|
@ -10,7 +10,7 @@
|
||||
* Copyright (c) 2004-2005 The Regents of the University of California.
|
||||
* All rights reserved.
|
||||
* Copyright (c) 2009-2013 Cisco Systems, Inc. All rights reserved.
|
||||
* Copyright (c) 2013-2017 Intel, Inc. All rights reserved.
|
||||
* Copyright (c) 2013-2018 Intel, Inc. All rights reserved.
|
||||
* Copyright (c) 2015 Research Organization for Information Science
|
||||
* and Technology (RIST). All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
@ -184,7 +184,7 @@ int orte_rmaps_rr_byslot(orte_job_t *jdata,
|
||||
/* if we weren't given a directive either way, then we will error out
|
||||
* as the #slots were specifically given, either by the host RM or
|
||||
* via hostfile/dash-host */
|
||||
if (!(ORTE_MAPPING_SUBSCRIBE_GIVEN & ORTE_GET_MAPPING_DIRECTIVE(orte_rmaps_base.mapping))) {
|
||||
if (!(ORTE_MAPPING_SUBSCRIBE_GIVEN & ORTE_GET_MAPPING_DIRECTIVE(jdata->map->mapping))) {
|
||||
orte_show_help("help-orte-rmaps-base.txt", "orte-rmaps-base:alloc-error",
|
||||
true, app->num_procs, app->app, orte_process_info.nodename);
|
||||
ORTE_UPDATE_EXIT_STATUS(ORTE_ERROR_DEFAULT_EXIT_CODE);
|
||||
@ -366,7 +366,7 @@ int orte_rmaps_rr_bynode(orte_job_t *jdata,
|
||||
/* if we weren't given a directive either way, then we will error out
|
||||
* as the #slots were specifically given, either by the host RM or
|
||||
* via hostfile/dash-host */
|
||||
if (!(ORTE_MAPPING_SUBSCRIBE_GIVEN & ORTE_GET_MAPPING_DIRECTIVE(orte_rmaps_base.mapping))) {
|
||||
if (!(ORTE_MAPPING_SUBSCRIBE_GIVEN & ORTE_GET_MAPPING_DIRECTIVE(jdata->map->mapping))) {
|
||||
orte_show_help("help-orte-rmaps-base.txt", "orte-rmaps-base:alloc-error",
|
||||
true, app->num_procs, app->app, orte_process_info.nodename);
|
||||
ORTE_UPDATE_EXIT_STATUS(ORTE_ERROR_DEFAULT_EXIT_CODE);
|
||||
@ -584,7 +584,7 @@ int orte_rmaps_rr_byobj(orte_job_t *jdata,
|
||||
/* if we weren't given a directive either way, then we will error out
|
||||
* as the #slots were specifically given, either by the host RM or
|
||||
* via hostfile/dash-host */
|
||||
if (!(ORTE_MAPPING_SUBSCRIBE_GIVEN & ORTE_GET_MAPPING_DIRECTIVE(orte_rmaps_base.mapping))) {
|
||||
if (!(ORTE_MAPPING_SUBSCRIBE_GIVEN & ORTE_GET_MAPPING_DIRECTIVE(jdata->map->mapping))) {
|
||||
orte_show_help("help-orte-rmaps-base.txt", "orte-rmaps-base:alloc-error",
|
||||
true, app->num_procs, app->app, orte_process_info.nodename);
|
||||
ORTE_UPDATE_EXIT_STATUS(ORTE_ERROR_DEFAULT_EXIT_CODE);
|
||||
|
@ -12,7 +12,7 @@
|
||||
* Copyright (c) 2006-2017 Cisco Systems, Inc. All rights reserved
|
||||
* Copyright (c) 2011 Los Alamos National Security, LLC.
|
||||
* All rights reserved.
|
||||
* Copyright (c) 2014-2017 Intel, Inc. All rights reserved.
|
||||
* Copyright (c) 2014-2018 Intel, Inc. All rights reserved.
|
||||
* Copyright (c) 2015 Research Organization for Information Science
|
||||
* and Technology (RIST). All rights reserved.
|
||||
* Copyright (c) 2016 IBM Corporation. All rights reserved.
|
||||
@ -418,7 +418,7 @@ static int orte_rmaps_seq_map(orte_job_t *jdata)
|
||||
/* if we weren't given a directive either way, then we will error out
|
||||
* as the #slots were specifically given, either by the host RM or
|
||||
* via hostfile/dash-host */
|
||||
if (!(ORTE_MAPPING_SUBSCRIBE_GIVEN & ORTE_GET_MAPPING_DIRECTIVE(orte_rmaps_base.mapping))) {
|
||||
if (!(ORTE_MAPPING_SUBSCRIBE_GIVEN & ORTE_GET_MAPPING_DIRECTIVE(jdata->map->mapping))) {
|
||||
orte_show_help("help-orte-rmaps-base.txt", "orte-rmaps-base:alloc-error",
|
||||
true, app->num_procs, app->app);
|
||||
ORTE_UPDATE_EXIT_STATUS(ORTE_ERROR_DEFAULT_EXIT_CODE);
|
||||
|
@ -13,7 +13,7 @@
|
||||
* All rights reserved.
|
||||
* Copyright (c) 2009-2017 Cisco Systems, Inc. All rights reserved
|
||||
* Copyright (c) 2011 Oak Ridge National Labs. All rights reserved.
|
||||
* Copyright (c) 2013-2017 Intel, Inc. All rights reserved.
|
||||
* Copyright (c) 2013-2018 Intel, Inc. All rights reserved.
|
||||
* Copyright (c) 2014 Mellanox Technologies, Inc.
|
||||
* All rights reserved.
|
||||
* Copyright (c) 2014-2016 Research Organization for Information Science
|
||||
@ -333,8 +333,13 @@ int pmix_server_spawn_fn(opal_process_name_t *requestor,
|
||||
/*** NO USE LOCAL ***/
|
||||
} else if (0 == strcmp(info->key, OPAL_PMIX_NO_PROCS_ON_HEAD)) {
|
||||
OPAL_CHECK_BOOL(info, flag);
|
||||
orte_set_attribute(&jdata->attributes, ORTE_MAPPING_NO_USE_LOCAL,
|
||||
ORTE_ATTR_GLOBAL, &flag, OPAL_BOOL);
|
||||
if (flag) {
|
||||
ORTE_SET_MAPPING_DIRECTIVE(jdata->map->mapping, ORTE_MAPPING_NO_USE_LOCAL);
|
||||
} else {
|
||||
ORTE_UNSET_MAPPING_DIRECTIVE(jdata->map->mapping, ORTE_MAPPING_NO_USE_LOCAL);
|
||||
}
|
||||
/* mark that the user specified it */
|
||||
ORTE_SET_MAPPING_DIRECTIVE(jdata->map->mapping, ORTE_MAPPING_LOCAL_GIVEN);
|
||||
|
||||
/*** OVERSUBSCRIBE ***/
|
||||
} else if (0 == strcmp(info->key, OPAL_PMIX_NO_OVERSUBSCRIBE)) {
|
||||
@ -344,6 +349,8 @@ int pmix_server_spawn_fn(opal_process_name_t *requestor,
|
||||
} else {
|
||||
ORTE_UNSET_MAPPING_DIRECTIVE(jdata->map->mapping, ORTE_MAPPING_NO_OVERSUBSCRIBE);
|
||||
}
|
||||
/* mark that the user specified it */
|
||||
ORTE_SET_MAPPING_DIRECTIVE(jdata->map->mapping, ORTE_MAPPING_SUBSCRIBE_GIVEN);
|
||||
|
||||
/*** REPORT BINDINGS ***/
|
||||
} else if (0 == strcmp(info->key, OPAL_PMIX_REPORT_BINDINGS)) {
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user