Make the data on local children and their jobs available globally on both daemons and the HNP. This simply shifts the data structures from the ODLS base to the orte globals area to support subsequent movement of the daemon collective operations from the odls to the grpcomm framework. As that will be a larger change, it will be implemented on a branch and rolled over separately.
This commit was SVN r20228.
Этот коммит содержится в:
родитель
e57435a5d4
Коммит
007d68becc
@ -66,6 +66,10 @@ int orte_ess_base_orted_setup(void)
|
||||
char *error = NULL;
|
||||
char *plm_to_use;
|
||||
|
||||
/* initialize the global list of local children and job data */
|
||||
OBJ_CONSTRUCT(&orte_local_children, opal_list_t);
|
||||
OBJ_CONSTRUCT(&orte_local_jobdata, opal_list_t);
|
||||
|
||||
/* open and setup the opal_pstat framework so we can provide
|
||||
* process stats if requested
|
||||
*/
|
||||
@ -281,11 +285,17 @@ error:
|
||||
"orte_init:startup:internal-failure",
|
||||
true, error, ORTE_ERROR_NAME(ret), ret);
|
||||
|
||||
/* cleanup the global list of local children and job data */
|
||||
OBJ_DESTRUCT(&orte_local_children);
|
||||
OBJ_DESTRUCT(&orte_local_jobdata);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
int orte_ess_base_orted_finalize(void)
|
||||
{
|
||||
opal_list_item_t *item;
|
||||
|
||||
orte_notifier_base_close();
|
||||
|
||||
orte_cr_finalize();
|
||||
@ -310,6 +320,16 @@ int orte_ess_base_orted_finalize(void)
|
||||
orte_routed_base_close();
|
||||
orte_rml_base_close();
|
||||
|
||||
/* cleanup the global list of local children and job data */
|
||||
while (NULL != (item = opal_list_remove_first(&orte_local_children))) {
|
||||
OBJ_RELEASE(item);
|
||||
}
|
||||
OBJ_DESTRUCT(&orte_local_children);
|
||||
while (NULL != (item = opal_list_remove_first(&orte_local_jobdata))) {
|
||||
OBJ_RELEASE(item);
|
||||
}
|
||||
OBJ_DESTRUCT(&orte_local_jobdata);
|
||||
|
||||
/* cleanup any lingering session directories */
|
||||
orte_session_dir_cleanup(ORTE_JOBID_WILDCARD);
|
||||
|
||||
|
@ -111,6 +111,10 @@ static int rte_init(char flags)
|
||||
orte_node_t *node;
|
||||
orte_proc_t *proc;
|
||||
|
||||
/* initialize the global list of local children and job data */
|
||||
OBJ_CONSTRUCT(&orte_local_children, opal_list_t);
|
||||
OBJ_CONSTRUCT(&orte_local_jobdata, opal_list_t);
|
||||
|
||||
/* run the prolog */
|
||||
if (ORTE_SUCCESS != (ret = orte_ess_base_std_prolog())) {
|
||||
error = "orte_ess_base_std_prolog";
|
||||
@ -447,13 +451,18 @@ error:
|
||||
true, error, ORTE_ERROR_NAME(ret), ret);
|
||||
}
|
||||
|
||||
/* cleanup the global list of local children and job data */
|
||||
OBJ_DESTRUCT(&orte_local_children);
|
||||
OBJ_DESTRUCT(&orte_local_jobdata);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int rte_finalize(void)
|
||||
{
|
||||
char *contact_path;
|
||||
|
||||
opal_list_item_t *item;
|
||||
|
||||
/* remove my contact info file */
|
||||
contact_path = opal_os_path(false, orte_process_info.top_session_dir,
|
||||
"contact.txt", NULL);
|
||||
@ -487,6 +496,25 @@ static int rte_finalize(void)
|
||||
orte_routed_base_close();
|
||||
orte_rml_base_close();
|
||||
|
||||
/* if we were doing timing studies, close the timing file */
|
||||
if (orte_timing) {
|
||||
if (stdout != orte_timing_output &&
|
||||
stderr != orte_timing_output) {
|
||||
fclose(orte_timing_output);
|
||||
}
|
||||
}
|
||||
|
||||
/* cleanup the global list of local children and job data */
|
||||
while (NULL != (item = opal_list_remove_first(&orte_local_children))) {
|
||||
OBJ_RELEASE(item);
|
||||
}
|
||||
OBJ_DESTRUCT(&orte_local_children);
|
||||
while (NULL != (item = opal_list_remove_first(&orte_local_jobdata))) {
|
||||
OBJ_RELEASE(item);
|
||||
}
|
||||
OBJ_DESTRUCT(&orte_local_jobdata);
|
||||
|
||||
/* finalize the session directory tree */
|
||||
orte_session_dir_finalize(ORTE_PROC_MY_NAME);
|
||||
|
||||
/* clean out the global structures */
|
||||
|
@ -31,11 +31,9 @@
|
||||
|
||||
int orte_odls_base_close(void)
|
||||
{
|
||||
/* cleanup globals */
|
||||
/* cleanup ODLS globals */
|
||||
OBJ_DESTRUCT(&orte_odls_globals.mutex);
|
||||
OBJ_DESTRUCT(&orte_odls_globals.cond);
|
||||
OBJ_DESTRUCT(&orte_odls_globals.children);
|
||||
OBJ_DESTRUCT(&orte_odls_globals.jobs);
|
||||
if (NULL != orte_odls_globals.dmap && NULL != orte_odls_globals.dmap->bytes) {
|
||||
free(orte_odls_globals.dmap->bytes);
|
||||
free(orte_odls_globals.dmap);
|
||||
|
@ -425,7 +425,7 @@ int orte_odls_base_default_construct_child_list(opal_buffer_t *data,
|
||||
orte_odls_globals.debugger->jobid = debugger;
|
||||
orte_odls_globals.debugger->num_apps = 1;
|
||||
orte_odls_globals.debugger->num_local_procs = 1;
|
||||
opal_list_append(&orte_odls_globals.jobs, &(orte_odls_globals.debugger)->super);
|
||||
opal_list_append(&orte_local_jobdata, &(orte_odls_globals.debugger)->super);
|
||||
/* retrieve the info */
|
||||
orte_odls_globals.debugger->apps = (orte_app_context_t**)malloc(sizeof(orte_app_context_t*));
|
||||
if (NULL == orte_odls_globals.debugger->apps) {
|
||||
@ -462,8 +462,8 @@ int orte_odls_base_default_construct_child_list(opal_buffer_t *data,
|
||||
* and see if it already exists
|
||||
*/
|
||||
jobdat = NULL;
|
||||
for (item = opal_list_get_first(&orte_odls_globals.jobs);
|
||||
item != opal_list_get_end(&orte_odls_globals.jobs);
|
||||
for (item = opal_list_get_first(&orte_local_jobdata);
|
||||
item != opal_list_get_end(&orte_local_jobdata);
|
||||
item = opal_list_get_next(item)) {
|
||||
orte_odls_job_t *jdat = (orte_odls_job_t*)item;
|
||||
|
||||
@ -482,7 +482,7 @@ int orte_odls_base_default_construct_child_list(opal_buffer_t *data,
|
||||
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME), ORTE_JOBID_PRINT(*job)));
|
||||
jobdat = OBJ_NEW(orte_odls_job_t);
|
||||
jobdat->jobid = *job;
|
||||
opal_list_append(&orte_odls_globals.jobs, &jobdat->super);
|
||||
opal_list_append(&orte_local_jobdata, &jobdat->super);
|
||||
}
|
||||
|
||||
/* UNPACK JOB-SPECIFIC DATA */
|
||||
@ -616,7 +616,7 @@ int orte_odls_base_default_construct_child_list(opal_buffer_t *data,
|
||||
}
|
||||
/* protect operation on the global list of children */
|
||||
OPAL_THREAD_LOCK(&orte_odls_globals.mutex);
|
||||
opal_list_append(&orte_odls_globals.children, &child->super);
|
||||
opal_list_append(&orte_local_children, &child->super);
|
||||
opal_condition_signal(&orte_odls_globals.cond);
|
||||
OPAL_THREAD_UNLOCK(&orte_odls_globals.mutex);
|
||||
} else {
|
||||
@ -735,7 +735,7 @@ static int odls_base_default_setup_fork(orte_app_context_t *context,
|
||||
*/
|
||||
if (opal_sys_limits.initialized) {
|
||||
if (0 < opal_sys_limits.num_procs &&
|
||||
opal_sys_limits.num_procs <= (int)opal_list_get_size(&orte_odls_globals.children)) {
|
||||
opal_sys_limits.num_procs <= (int)opal_list_get_size(&orte_local_children)) {
|
||||
/* at the system limit - abort */
|
||||
ORTE_ERROR_LOG(ORTE_ERR_SYS_LIMITS_CHILDREN);
|
||||
return ORTE_ERR_SYS_LIMITS_CHILDREN;
|
||||
@ -938,8 +938,8 @@ static int pack_state_update(opal_buffer_t *alert, bool pack_pid, orte_jobid_t j
|
||||
ORTE_ERROR_LOG(rc);
|
||||
return rc;
|
||||
}
|
||||
for (item = opal_list_get_first(&orte_odls_globals.children);
|
||||
item != opal_list_get_end(&orte_odls_globals.children);
|
||||
for (item = opal_list_get_first(&orte_local_children);
|
||||
item != opal_list_get_end(&orte_local_children);
|
||||
item = opal_list_get_next(item)) {
|
||||
child = (orte_odls_child_t*)item;
|
||||
/* if this child is part of the job... */
|
||||
@ -982,8 +982,8 @@ int orte_odls_base_default_launch_local(orte_jobid_t job,
|
||||
|
||||
/* find the jobdat for this job */
|
||||
jobdat = NULL;
|
||||
for (item = opal_list_get_first(&orte_odls_globals.jobs);
|
||||
item != opal_list_get_end(&orte_odls_globals.jobs);
|
||||
for (item = opal_list_get_first(&orte_local_jobdata);
|
||||
item != opal_list_get_end(&orte_local_jobdata);
|
||||
item = opal_list_get_next(item)) {
|
||||
jobdat = (orte_odls_job_t*)item;
|
||||
|
||||
@ -1033,7 +1033,7 @@ int orte_odls_base_default_launch_local(orte_jobid_t job,
|
||||
* Instead, force the opal_list_get_size value to be an int as we surely
|
||||
* won't have a #children bigger than that!
|
||||
*/
|
||||
if ((int)opal_list_get_size(&orte_odls_globals.children) > num_processors) {
|
||||
if ((int)opal_list_get_size(&orte_local_children) > num_processors) {
|
||||
/* if the #procs > #processors, declare us oversubscribed. This
|
||||
* covers the case where the user didn't tell us anything about the
|
||||
* number of available slots, so we defaulted to a value of 1
|
||||
@ -1048,7 +1048,7 @@ int orte_odls_base_default_launch_local(orte_jobid_t job,
|
||||
OPAL_OUTPUT_VERBOSE((5, orte_odls_globals.output,
|
||||
"%s odls:launch found %d processors for %d children and set oversubscribed to %s",
|
||||
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME),
|
||||
num_processors, (int)opal_list_get_size(&orte_odls_globals.children),
|
||||
num_processors, (int)opal_list_get_size(&orte_local_children),
|
||||
oversubscribed ? "true" : "false"));
|
||||
|
||||
/* setup to report the proc state to the HNP */
|
||||
@ -1076,8 +1076,8 @@ int orte_odls_base_default_launch_local(orte_jobid_t job,
|
||||
* so we can report things out correctly
|
||||
*/
|
||||
/* cycle through children to find those for this jobid */
|
||||
for (item = opal_list_get_first(&orte_odls_globals.children);
|
||||
item != opal_list_get_end(&orte_odls_globals.children);
|
||||
for (item = opal_list_get_first(&orte_local_children);
|
||||
item != opal_list_get_end(&orte_local_children);
|
||||
item = opal_list_get_next(item)) {
|
||||
child = (orte_odls_child_t*)item;
|
||||
if (OPAL_EQUAL == opal_dss.compare(&job, &(child->name->jobid), ORTE_JOBID)) {
|
||||
@ -1096,8 +1096,8 @@ int orte_odls_base_default_launch_local(orte_jobid_t job,
|
||||
|
||||
|
||||
/* okay, now let's launch our local procs using the provided fork_local fn */
|
||||
for (proc_rank = 0, item = opal_list_get_first(&orte_odls_globals.children);
|
||||
item != opal_list_get_end(&orte_odls_globals.children);
|
||||
for (proc_rank = 0, item = opal_list_get_first(&orte_local_children);
|
||||
item != opal_list_get_end(&orte_local_children);
|
||||
item = opal_list_get_next(item)) {
|
||||
child = (orte_odls_child_t*)item;
|
||||
|
||||
@ -1280,7 +1280,7 @@ CLEANUP:
|
||||
*/
|
||||
if (NULL != orte_odls_globals.debugger &&
|
||||
!orte_odls_globals.debugger_launched &&
|
||||
0 < opal_list_get_size(&orte_odls_globals.children)) {
|
||||
0 < opal_list_get_size(&orte_local_children)) {
|
||||
OPAL_OUTPUT_VERBOSE((5, orte_odls_globals.output,
|
||||
"%s odls:launch forking debugger with %s",
|
||||
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME),
|
||||
@ -1314,8 +1314,8 @@ CLEANUP:
|
||||
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME)));
|
||||
|
||||
/* if the launch didn't fail, setup the waitpids on the children */
|
||||
for (item = opal_list_get_first(&orte_odls_globals.children);
|
||||
item != opal_list_get_end(&orte_odls_globals.children);
|
||||
for (item = opal_list_get_first(&orte_local_children);
|
||||
item != opal_list_get_end(&orte_local_children);
|
||||
item = opal_list_get_next(item)) {
|
||||
child = (orte_odls_child_t*)item;
|
||||
|
||||
@ -1343,8 +1343,8 @@ int orte_odls_base_default_deliver_message(orte_jobid_t job, opal_buffer_t *buff
|
||||
/* protect operations involving the global list of children */
|
||||
OPAL_THREAD_LOCK(&orte_odls_globals.mutex);
|
||||
|
||||
for (item = opal_list_get_first(&orte_odls_globals.children);
|
||||
item != opal_list_get_end(&orte_odls_globals.children);
|
||||
for (item = opal_list_get_first(&orte_local_children);
|
||||
item != opal_list_get_end(&orte_local_children);
|
||||
item = opal_list_get_next(item)) {
|
||||
child = (orte_odls_child_t*)item;
|
||||
|
||||
@ -1403,8 +1403,8 @@ int orte_odls_base_default_signal_local_procs(const orte_process_name_t *proc, i
|
||||
*/
|
||||
if (NULL == proc) {
|
||||
rc = ORTE_SUCCESS; /* pre-set this as an empty list causes us to drop to bottom */
|
||||
for (item = opal_list_get_first(&orte_odls_globals.children);
|
||||
item != opal_list_get_end(&orte_odls_globals.children);
|
||||
for (item = opal_list_get_first(&orte_local_children);
|
||||
item != opal_list_get_end(&orte_local_children);
|
||||
item = opal_list_get_next(item)) {
|
||||
child = (orte_odls_child_t*)item;
|
||||
if (ORTE_SUCCESS != (rc = signal_local(child->pid, (int)signal))) {
|
||||
@ -1417,8 +1417,8 @@ int orte_odls_base_default_signal_local_procs(const orte_process_name_t *proc, i
|
||||
}
|
||||
|
||||
/* we want it sent to some specified process, so find it */
|
||||
for (item = opal_list_get_first(&orte_odls_globals.children);
|
||||
item != opal_list_get_end(&orte_odls_globals.children);
|
||||
for (item = opal_list_get_first(&orte_local_children);
|
||||
item != opal_list_get_end(&orte_local_children);
|
||||
item = opal_list_get_next(item)) {
|
||||
child = (orte_odls_child_t*)item;
|
||||
if (OPAL_EQUAL == opal_dss.compare(&(child->name), (orte_process_name_t*)proc, ORTE_NAME)) {
|
||||
@ -1448,8 +1448,8 @@ static bool all_children_registered(orte_jobid_t job)
|
||||
|
||||
/* the thread is locked elsewhere - don't try to do it again here */
|
||||
|
||||
for (item = opal_list_get_first(&orte_odls_globals.children);
|
||||
item != opal_list_get_end(&orte_odls_globals.children);
|
||||
for (item = opal_list_get_first(&orte_local_children);
|
||||
item != opal_list_get_end(&orte_local_children);
|
||||
item = opal_list_get_next(item)) {
|
||||
child = (orte_odls_child_t*)item;
|
||||
|
||||
@ -1475,8 +1475,8 @@ static int pack_child_contact_info(orte_jobid_t job, opal_buffer_t *buf)
|
||||
|
||||
/* the thread is locked elsewhere - don't try to do it again here */
|
||||
|
||||
for (item = opal_list_get_first(&orte_odls_globals.children);
|
||||
item != opal_list_get_end(&orte_odls_globals.children);
|
||||
for (item = opal_list_get_first(&orte_local_children);
|
||||
item != opal_list_get_end(&orte_local_children);
|
||||
item = opal_list_get_next(item)) {
|
||||
child = (orte_odls_child_t*)item;
|
||||
|
||||
@ -1510,7 +1510,7 @@ static void setup_singleton_jobdat(orte_jobid_t jobid)
|
||||
jobdat->jobid = jobid;
|
||||
jobdat->num_procs = 1;
|
||||
jobdat->num_local_procs = 1;
|
||||
opal_list_append(&orte_odls_globals.jobs, &jobdat->super);
|
||||
opal_list_append(&orte_local_jobdata, &jobdat->super);
|
||||
/* need to setup a pidmap for it */
|
||||
OBJ_CONSTRUCT(&buffer, opal_buffer_t);
|
||||
opal_dss.pack(&buffer, &jobid, 1, ORTE_JOBID); /* jobid */
|
||||
@ -1572,8 +1572,8 @@ int orte_odls_base_default_require_sync(orte_process_name_t *proc,
|
||||
/* protect operations involving the global list of children */
|
||||
OPAL_THREAD_LOCK(&orte_odls_globals.mutex);
|
||||
|
||||
for (item = opal_list_get_first(&orte_odls_globals.children);
|
||||
item != opal_list_get_end(&orte_odls_globals.children);
|
||||
for (item = opal_list_get_first(&orte_local_children);
|
||||
item != opal_list_get_end(&orte_local_children);
|
||||
item = opal_list_get_next(item)) {
|
||||
child = (orte_odls_child_t*)item;
|
||||
|
||||
@ -1599,7 +1599,7 @@ int orte_odls_base_default_require_sync(orte_process_name_t *proc,
|
||||
ORTE_ERROR_LOG(rc);
|
||||
goto CLEANUP;
|
||||
}
|
||||
opal_list_append(&orte_odls_globals.children, &child->super);
|
||||
opal_list_append(&orte_local_children, &child->super);
|
||||
/* we don't know any other info about the child, so just indicate it's
|
||||
* alive
|
||||
*/
|
||||
@ -1630,8 +1630,8 @@ int orte_odls_base_default_require_sync(orte_process_name_t *proc,
|
||||
if (drop_nidmap) {
|
||||
orte_odls_job_t *jobdat = NULL;
|
||||
/* get the jobdata object */
|
||||
for (item = opal_list_get_first(&orte_odls_globals.jobs);
|
||||
item != opal_list_get_end(&orte_odls_globals.jobs);
|
||||
for (item = opal_list_get_first(&orte_local_jobdata);
|
||||
item != opal_list_get_end(&orte_local_jobdata);
|
||||
item = opal_list_get_next(item)) {
|
||||
jobdat = (orte_odls_job_t*)item;
|
||||
if (jobdat->jobid == child->name->jobid) {
|
||||
@ -1720,8 +1720,8 @@ static bool any_live_children(orte_jobid_t job)
|
||||
|
||||
/* the thread is locked elsewhere - don't try to do it again here */
|
||||
|
||||
for (item = opal_list_get_first(&orte_odls_globals.children);
|
||||
item != opal_list_get_end(&orte_odls_globals.children);
|
||||
for (item = opal_list_get_first(&orte_local_children);
|
||||
item != opal_list_get_end(&orte_local_children);
|
||||
item = opal_list_get_next(item)) {
|
||||
child = (orte_odls_child_t*)item;
|
||||
|
||||
@ -1869,8 +1869,8 @@ void orte_odls_base_notify_iof_complete(orte_process_name_t *proc)
|
||||
OPAL_THREAD_LOCK(&orte_odls_globals.mutex);
|
||||
|
||||
/* find this child */
|
||||
for (item = opal_list_get_first(&orte_odls_globals.children);
|
||||
item != opal_list_get_end(&orte_odls_globals.children);
|
||||
for (item = opal_list_get_first(&orte_local_children);
|
||||
item != opal_list_get_end(&orte_local_children);
|
||||
item = opal_list_get_next(item)) {
|
||||
child = (orte_odls_child_t*)item;
|
||||
|
||||
@ -1919,8 +1919,8 @@ void orte_base_default_waitpid_fired(orte_process_name_t *proc, int32_t status)
|
||||
OPAL_THREAD_LOCK(&orte_odls_globals.mutex);
|
||||
|
||||
/* find this child */
|
||||
for (item = opal_list_get_first(&orte_odls_globals.children);
|
||||
item != opal_list_get_end(&orte_odls_globals.children);
|
||||
for (item = opal_list_get_first(&orte_local_children);
|
||||
item != opal_list_get_end(&orte_local_children);
|
||||
item = opal_list_get_next(item)) {
|
||||
child = (orte_odls_child_t*)item;
|
||||
|
||||
@ -2089,8 +2089,8 @@ void odls_base_default_wait_local_proc(pid_t pid, int status, void* cbdata)
|
||||
OPAL_THREAD_LOCK(&orte_odls_globals.mutex);
|
||||
|
||||
/* find this child */
|
||||
for (item = opal_list_get_first(&orte_odls_globals.children);
|
||||
item != opal_list_get_end(&orte_odls_globals.children);
|
||||
for (item = opal_list_get_first(&orte_local_children);
|
||||
item != opal_list_get_end(&orte_local_children);
|
||||
item = opal_list_get_next(item)) {
|
||||
child = (orte_odls_child_t*)item;
|
||||
|
||||
@ -2178,8 +2178,8 @@ int orte_odls_base_default_kill_local_procs(orte_jobid_t job, bool set_state,
|
||||
}
|
||||
last_job = ORTE_JOBID_INVALID;
|
||||
|
||||
for (item = opal_list_get_first(&orte_odls_globals.children);
|
||||
item != opal_list_get_end(&orte_odls_globals.children);
|
||||
for (item = opal_list_get_first(&orte_local_children);
|
||||
item != opal_list_get_end(&orte_local_children);
|
||||
item = next) {
|
||||
child = (orte_odls_child_t*)item;
|
||||
|
||||
@ -2208,7 +2208,7 @@ int orte_odls_base_default_kill_local_procs(orte_jobid_t job, bool set_state,
|
||||
}
|
||||
|
||||
/* remove the child from the list since it is either already dead or soon going to be dead */
|
||||
opal_list_remove_item(&orte_odls_globals.children, item);
|
||||
opal_list_remove_item(&orte_local_children, item);
|
||||
|
||||
/* store the jobid, if required */
|
||||
if (last_job != child->name->jobid) {
|
||||
@ -2351,8 +2351,8 @@ static bool all_children_participated(orte_jobid_t job)
|
||||
|
||||
/* the thread is locked elsewhere - don't try to do it again here */
|
||||
|
||||
for (item = opal_list_get_first(&orte_odls_globals.children);
|
||||
item != opal_list_get_end(&orte_odls_globals.children);
|
||||
for (item = opal_list_get_first(&orte_local_children);
|
||||
item != opal_list_get_end(&orte_local_children);
|
||||
item = opal_list_get_next(item)) {
|
||||
child = (orte_odls_child_t*)item;
|
||||
|
||||
@ -2394,8 +2394,8 @@ static int daemon_collective(orte_process_name_t *sender, opal_buffer_t *data)
|
||||
|
||||
/* lookup the job record for it */
|
||||
jobdat = NULL;
|
||||
for (item = opal_list_get_first(&orte_odls_globals.jobs);
|
||||
item != opal_list_get_end(&orte_odls_globals.jobs);
|
||||
for (item = opal_list_get_first(&orte_local_jobdata);
|
||||
item != opal_list_get_end(&orte_local_jobdata);
|
||||
item = opal_list_get_next(item)) {
|
||||
jobdat = (orte_odls_job_t*)item;
|
||||
|
||||
@ -2411,7 +2411,7 @@ static int daemon_collective(orte_process_name_t *sender, opal_buffer_t *data)
|
||||
*/
|
||||
jobdat = OBJ_NEW(orte_odls_job_t);
|
||||
jobdat->jobid = jobid;
|
||||
opal_list_append(&orte_odls_globals.jobs, &jobdat->super);
|
||||
opal_list_append(&orte_local_jobdata, &jobdat->super);
|
||||
/* flag that we entered this so we don't try to send it
|
||||
* along before we unpack the launch cmd!
|
||||
*/
|
||||
@ -2559,8 +2559,8 @@ static void reset_child_participation(orte_jobid_t job)
|
||||
opal_list_item_t *item;
|
||||
orte_odls_child_t *child;
|
||||
|
||||
for (item = opal_list_get_first(&orte_odls_globals.children);
|
||||
item != opal_list_get_end(&orte_odls_globals.children);
|
||||
for (item = opal_list_get_first(&orte_local_children);
|
||||
item != opal_list_get_end(&orte_local_children);
|
||||
item = opal_list_get_next(item)) {
|
||||
child = (orte_odls_child_t*)item;
|
||||
|
||||
@ -2595,8 +2595,8 @@ int orte_odls_base_default_collect_data(orte_process_name_t *proc,
|
||||
goto CLEANUP;
|
||||
}
|
||||
|
||||
for (item = opal_list_get_first(&orte_odls_globals.children);
|
||||
item != opal_list_get_end(&orte_odls_globals.children);
|
||||
for (item = opal_list_get_first(&orte_local_children);
|
||||
item != opal_list_get_end(&orte_local_children);
|
||||
item = opal_list_get_next(item)) {
|
||||
child = (orte_odls_child_t*)item;
|
||||
|
||||
@ -2622,7 +2622,7 @@ int orte_odls_base_default_collect_data(orte_process_name_t *proc,
|
||||
ORTE_ERROR_LOG(rc);
|
||||
return rc;
|
||||
}
|
||||
opal_list_append(&orte_odls_globals.children, &child->super);
|
||||
opal_list_append(&orte_local_children, &child->super);
|
||||
/* we don't know any other info about the child, so just indicate it's
|
||||
* alive
|
||||
*/
|
||||
@ -2633,8 +2633,8 @@ int orte_odls_base_default_collect_data(orte_process_name_t *proc,
|
||||
|
||||
/* this was one of our local procs - find the jobdat for this job */
|
||||
jobdat = NULL;
|
||||
for (item = opal_list_get_first(&orte_odls_globals.jobs);
|
||||
item != opal_list_get_end(&orte_odls_globals.jobs);
|
||||
for (item = opal_list_get_first(&orte_local_jobdata);
|
||||
item != opal_list_get_end(&orte_local_jobdata);
|
||||
item = opal_list_get_next(item)) {
|
||||
jobdat = (orte_odls_job_t*)item;
|
||||
|
||||
@ -2721,8 +2721,8 @@ int orte_odls_base_get_proc_stats(opal_buffer_t *answer,
|
||||
ORTE_NAME_PRINT(proc)));
|
||||
|
||||
/* find this child */
|
||||
for (item = opal_list_get_first(&orte_odls_globals.children);
|
||||
item != opal_list_get_end(&orte_odls_globals.children);
|
||||
for (item = opal_list_get_first(&orte_local_children);
|
||||
item != opal_list_get_end(&orte_local_children);
|
||||
item = opal_list_get_next(item)) {
|
||||
child = (orte_odls_child_t*)item;
|
||||
|
||||
|
@ -162,11 +162,9 @@ int orte_odls_base_open(void)
|
||||
"Time to wait for a process to die after issuing a kill signal to it",
|
||||
false, false, 1, &orte_odls_globals.timeout_before_sigkill);
|
||||
|
||||
/* initialize globals */
|
||||
/* initialize ODLS globals */
|
||||
OBJ_CONSTRUCT(&orte_odls_globals.mutex, opal_mutex_t);
|
||||
OBJ_CONSTRUCT(&orte_odls_globals.cond, opal_condition_t);
|
||||
OBJ_CONSTRUCT(&orte_odls_globals.children, opal_list_t);
|
||||
OBJ_CONSTRUCT(&orte_odls_globals.jobs, opal_list_t);
|
||||
orte_odls_globals.dmap = NULL;
|
||||
orte_odls_globals.debugger = NULL;
|
||||
orte_odls_globals.debugger_launched = false;
|
||||
|
@ -48,52 +48,6 @@ BEGIN_C_DECLS
|
||||
* General ODLS types
|
||||
*/
|
||||
|
||||
/*
|
||||
* List object to locally store the process names and pids of
|
||||
* our children. This can subsequently be used to order termination
|
||||
* or pass signals without looking the info up again.
|
||||
*/
|
||||
typedef struct {
|
||||
opal_list_item_t super; /* required to place this on a list */
|
||||
orte_process_name_t *name; /* the OpenRTE name of the proc */
|
||||
pid_t pid; /* local pid of the proc */
|
||||
orte_std_cntr_t app_idx; /* index of the app_context for this proc */
|
||||
bool alive; /* is this proc alive? */
|
||||
bool coll_recvd; /* collective operation recvd */
|
||||
orte_proc_state_t state; /* the state of the process */
|
||||
orte_exit_code_t exit_code; /* process exit code */
|
||||
char *rml_uri; /* contact info for this child */
|
||||
char *slot_list; /* list of slots for this child */
|
||||
bool waitpid_recvd; /* waitpid has detected proc termination */
|
||||
bool iof_complete; /* IOF has noted proc terminating all channels */
|
||||
} orte_odls_child_t;
|
||||
ORTE_DECLSPEC OBJ_CLASS_DECLARATION(orte_odls_child_t);
|
||||
|
||||
/*
|
||||
* List object to locally store job related info
|
||||
*/
|
||||
typedef struct orte_odls_job_t {
|
||||
opal_list_item_t super; /* required to place this on a list */
|
||||
orte_jobid_t jobid; /* jobid for this data */
|
||||
orte_app_context_t **apps; /* app_contexts for this job */
|
||||
orte_std_cntr_t num_apps; /* number of app_contexts */
|
||||
orte_job_controls_t controls; /* control flags for job */
|
||||
orte_vpid_t stdin_target; /* where stdin is to go */
|
||||
orte_std_cntr_t total_slots_alloc;
|
||||
orte_vpid_t num_procs;
|
||||
int32_t num_local_procs;
|
||||
opal_byte_object_t *pmap; /* local copy of pidmap byte object */
|
||||
opal_buffer_t collection_bucket;
|
||||
opal_buffer_t local_collection;
|
||||
orte_grpcomm_coll_t collective_type;
|
||||
int32_t num_contributors;
|
||||
int num_participating;
|
||||
int num_collected;
|
||||
} orte_odls_job_t;
|
||||
ORTE_DECLSPEC OBJ_CLASS_DECLARATION(orte_odls_job_t);
|
||||
|
||||
|
||||
|
||||
typedef struct {
|
||||
/** Verbose/debug output stream */
|
||||
int output;
|
||||
@ -103,10 +57,6 @@ typedef struct {
|
||||
opal_mutex_t mutex;
|
||||
/* condition variable */
|
||||
opal_condition_t cond;
|
||||
/* list of children for this orted */
|
||||
opal_list_t children;
|
||||
/* list of job data for this orted */
|
||||
opal_list_t jobs;
|
||||
/* byte object to store daemon map for later xmit to procs */
|
||||
opal_byte_object_t *dmap;
|
||||
/* any co-spawned debugger daemon */
|
||||
|
@ -90,12 +90,5 @@ int orte_odls_default_component_query(mca_base_module_t **module, int *priority)
|
||||
|
||||
int orte_odls_default_component_close(void)
|
||||
{
|
||||
opal_list_item_t *item;
|
||||
|
||||
/* cleanup state */
|
||||
while (NULL != (item = opal_list_remove_first(&orte_odls_globals.children))) {
|
||||
OBJ_RELEASE(item);
|
||||
}
|
||||
|
||||
return ORTE_SUCCESS;
|
||||
}
|
||||
|
@ -21,6 +21,12 @@
|
||||
#define ORTE_MCA_ODLS_TYPES_H
|
||||
|
||||
#include "orte_config.h"
|
||||
#include "orte/types.h"
|
||||
|
||||
#include "opal/class/opal_list.h"
|
||||
#include "opal/dss/dss_types.h"
|
||||
#include "orte/mca/grpcomm/grpcomm_types.h"
|
||||
#include "orte/runtime/orte_globals.h"
|
||||
|
||||
BEGIN_C_DECLS
|
||||
|
||||
@ -64,6 +70,51 @@ typedef uint8_t orte_daemon_cmd_flag_t;
|
||||
/* request proc resource usage */
|
||||
#define ORTE_DAEMON_TOP_CMD (orte_daemon_cmd_flag_t) 23
|
||||
|
||||
|
||||
/*
|
||||
* List object to locally store the process names and pids of
|
||||
* our children. This can subsequently be used to order termination
|
||||
* or pass signals without looking the info up again.
|
||||
*/
|
||||
typedef struct {
|
||||
opal_list_item_t super; /* required to place this on a list */
|
||||
orte_process_name_t *name; /* the OmpiRTE name of the proc */
|
||||
pid_t pid; /* local pid of the proc */
|
||||
orte_std_cntr_t app_idx; /* index of the app_context for this proc */
|
||||
bool alive; /* is this proc alive? */
|
||||
bool coll_recvd; /* collective operation recvd */
|
||||
orte_proc_state_t state; /* the state of the process */
|
||||
orte_exit_code_t exit_code; /* process exit code */
|
||||
char *rml_uri; /* contact info for this child */
|
||||
char *slot_list; /* list of slots for this child */
|
||||
bool waitpid_recvd; /* waitpid has detected proc termination */
|
||||
bool iof_complete; /* IOF has noted proc terminating all channels */
|
||||
} orte_odls_child_t;
|
||||
ORTE_DECLSPEC OBJ_CLASS_DECLARATION(orte_odls_child_t);
|
||||
|
||||
/*
|
||||
* List object to locally store job related info
|
||||
*/
|
||||
typedef struct orte_odls_job_t {
|
||||
opal_list_item_t super; /* required to place this on a list */
|
||||
orte_jobid_t jobid; /* jobid for this data */
|
||||
orte_app_context_t **apps; /* app_contexts for this job */
|
||||
orte_std_cntr_t num_apps; /* number of app_contexts */
|
||||
orte_job_controls_t controls; /* control flags for job */
|
||||
orte_vpid_t stdin_target; /* where stdin is to go */
|
||||
orte_std_cntr_t total_slots_alloc;
|
||||
orte_vpid_t num_procs;
|
||||
int32_t num_local_procs;
|
||||
opal_byte_object_t *pmap; /* local copy of pidmap byte object */
|
||||
opal_buffer_t collection_bucket;
|
||||
opal_buffer_t local_collection;
|
||||
orte_grpcomm_coll_t collective_type;
|
||||
int32_t num_contributors;
|
||||
int num_participating;
|
||||
int num_collected;
|
||||
} orte_odls_job_t;
|
||||
ORTE_DECLSPEC OBJ_CLASS_DECLARATION(orte_odls_job_t);
|
||||
|
||||
END_C_DECLS
|
||||
|
||||
#endif
|
||||
|
@ -81,12 +81,5 @@ int orte_odls_process_component_close(void)
|
||||
|
||||
int orte_odls_process_component_finalize(void)
|
||||
{
|
||||
opal_list_item_t *item;
|
||||
|
||||
/* cleanup state */
|
||||
while (NULL != (item = opal_list_remove_first(&orte_odls_globals.children))) {
|
||||
OBJ_RELEASE(item);
|
||||
}
|
||||
|
||||
return ORTE_SUCCESS;
|
||||
}
|
||||
|
@ -108,7 +108,7 @@ static int odls_process_fork_local_proc(orte_app_context_t* context,
|
||||
*/
|
||||
if (opal_sys_limits.initialized) {
|
||||
if (0 < opal_sys_limits.num_procs &&
|
||||
opal_sys_limits.num_procs <= (int)opal_list_get_size(&orte_odls_globals.children)) {
|
||||
opal_sys_limits.num_procs <= (int)opal_list_get_size(&orte_local_children)) {
|
||||
/* at the system limit - abort */
|
||||
ORTE_ERROR_LOG(ORTE_ERR_SYS_LIMITS_CHILDREN);
|
||||
child->state = ORTE_PROC_STATE_FAILED_TO_START;
|
||||
|
@ -46,6 +46,7 @@
|
||||
|
||||
/* globals used by RTE */
|
||||
bool orte_timing;
|
||||
FILE *orte_timing_output = NULL;
|
||||
bool orte_debug_daemons_file_flag = false;
|
||||
bool orte_leave_session_attached;
|
||||
bool orte_do_not_launch = false;
|
||||
@ -102,6 +103,11 @@ bool orte_send_profile;
|
||||
opal_pointer_array_t orte_nidmap;
|
||||
opal_pointer_array_t orte_jobmap;
|
||||
|
||||
/* list of local children on a daemon */
|
||||
opal_list_t orte_local_children;
|
||||
/* list of job data for local children on a daemon */
|
||||
opal_list_t orte_local_jobdata;
|
||||
|
||||
#endif /* !ORTE_DISABLE_FULL_RTE */
|
||||
|
||||
int orte_debug_output = -1;
|
||||
|
@ -399,6 +399,7 @@ ORTE_DECLSPEC orte_job_t* orte_get_job_data_object(orte_jobid_t job);
|
||||
|
||||
/* global variables used by RTE - instanced in orte_globals.c */
|
||||
ORTE_DECLSPEC extern bool orte_timing;
|
||||
ORTE_DECLSPEC extern FILE *orte_timing_output;
|
||||
ORTE_DECLSPEC extern bool orte_debug_daemons_flag, orte_debug_daemons_file_flag;
|
||||
ORTE_DECLSPEC extern bool orte_leave_session_attached;
|
||||
ORTE_DECLSPEC extern bool orte_do_not_launch;
|
||||
@ -457,6 +458,11 @@ ORTE_DECLSPEC extern bool orte_send_profile;
|
||||
ORTE_DECLSPEC extern opal_pointer_array_t orte_nidmap;
|
||||
ORTE_DECLSPEC extern opal_pointer_array_t orte_jobmap;
|
||||
|
||||
/* list of local children on a daemon */
|
||||
ORTE_DECLSPEC extern opal_list_t orte_local_children;
|
||||
/* list of job data for local children on a daemon */
|
||||
ORTE_DECLSPEC extern opal_list_t orte_local_jobdata;
|
||||
|
||||
|
||||
#endif /* ORTE_DISABLE_FULL_SUPPORT */
|
||||
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user