2008-02-28 01:57:57 +00:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2004-2005 The Trustees of Indiana University.
|
|
|
|
* All rights reserved.
|
2011-06-23 20:38:02 +00:00
|
|
|
* Copyright (c) 2004-2011 The Trustees of the University of Tennessee.
|
2008-02-28 01:57:57 +00:00
|
|
|
* 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.
|
2013-02-28 01:35:55 +00:00
|
|
|
* Copyright (c) 2011-2013 Los Alamos National Security, LLC.
|
2012-04-06 14:23:13 +00:00
|
|
|
* All rights reserved.
|
2008-02-28 01:57:57 +00:00
|
|
|
* $COPYRIGHT$
|
|
|
|
*
|
|
|
|
* Additional copyrights may follow
|
|
|
|
*
|
|
|
|
* $HEADER$
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "orte_config.h"
|
|
|
|
|
2009-04-29 00:49:23 +00:00
|
|
|
#ifdef HAVE_STRING_H
|
|
|
|
#include <string.h>
|
|
|
|
#endif
|
|
|
|
|
2008-02-28 01:57:57 +00:00
|
|
|
#include <sys/types.h>
|
|
|
|
|
|
|
|
#include "orte/runtime/data_type_support/orte_dt_support.h"
|
|
|
|
|
|
|
|
int orte_dt_compare_std_cntr(orte_std_cntr_t *value1, orte_std_cntr_t *value2, opal_data_type_t type)
|
|
|
|
{
|
|
|
|
if (*value1 > *value2) return OPAL_VALUE1_GREATER;
|
|
|
|
|
|
|
|
if (*value2 > *value1) return OPAL_VALUE2_GREATER;
|
|
|
|
|
|
|
|
return OPAL_EQUAL;
|
|
|
|
}
|
|
|
|
|
|
|
|
int orte_dt_compare_name(orte_process_name_t *value1,
|
|
|
|
orte_process_name_t *value2,
|
|
|
|
opal_data_type_t type)
|
|
|
|
{
|
|
|
|
if (NULL == value1 && NULL == value2) {
|
|
|
|
return OPAL_EQUAL;
|
|
|
|
} else if (NULL == value1) {
|
|
|
|
return OPAL_VALUE2_GREATER;
|
|
|
|
} else if (NULL == value2) {
|
|
|
|
return OPAL_VALUE1_GREATER;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* If any of the fields are wildcard,
|
|
|
|
* then we want to just ignore that one field. In the case
|
|
|
|
* of ORTE_NAME_WILDCARD (where ALL of the fields are wildcard), this
|
|
|
|
* will automatically result in OPAL_EQUAL for any name in the other
|
|
|
|
* value - a totally useless result, but consistent in behavior.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/** check the jobids - if one of them is WILDCARD, then ignore
|
|
|
|
* this field since anything is okay
|
|
|
|
*/
|
|
|
|
if (value1->jobid != ORTE_JOBID_WILDCARD &&
|
|
|
|
value2->jobid != ORTE_JOBID_WILDCARD) {
|
|
|
|
if (value1->jobid < value2->jobid) {
|
|
|
|
return OPAL_VALUE2_GREATER;
|
|
|
|
} else if (value1->jobid > value2->jobid) {
|
|
|
|
return OPAL_VALUE1_GREATER;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/** check the vpids - if one of them is WILDCARD, then ignore
|
|
|
|
* this field since anything is okay
|
|
|
|
*/
|
|
|
|
if (value1->vpid != ORTE_VPID_WILDCARD &&
|
|
|
|
value2->vpid != ORTE_VPID_WILDCARD) {
|
|
|
|
if (value1->vpid < value2->vpid) {
|
|
|
|
return OPAL_VALUE2_GREATER;
|
|
|
|
} else if (value1->vpid > value2->vpid) {
|
|
|
|
return OPAL_VALUE1_GREATER;
|
|
|
|
}
|
|
|
|
}
|
2011-06-23 20:38:02 +00:00
|
|
|
|
2008-02-28 01:57:57 +00:00
|
|
|
/** only way to get here is if all fields are equal or WILDCARD */
|
|
|
|
return OPAL_EQUAL;
|
|
|
|
}
|
|
|
|
|
|
|
|
int orte_dt_compare_vpid(orte_vpid_t *value1,
|
|
|
|
orte_vpid_t *value2,
|
|
|
|
opal_data_type_t type)
|
|
|
|
{
|
|
|
|
/** if either value is WILDCARD, then return equal */
|
|
|
|
if (*value1 == ORTE_VPID_WILDCARD ||
|
|
|
|
*value2 == ORTE_VPID_WILDCARD) return OPAL_EQUAL;
|
|
|
|
|
|
|
|
if (*value1 > *value2) return OPAL_VALUE1_GREATER;
|
|
|
|
|
|
|
|
if (*value2 > *value1) return OPAL_VALUE2_GREATER;
|
|
|
|
|
|
|
|
return OPAL_EQUAL;
|
|
|
|
}
|
|
|
|
|
|
|
|
int orte_dt_compare_jobid(orte_jobid_t *value1,
|
|
|
|
orte_jobid_t *value2,
|
|
|
|
opal_data_type_t type)
|
|
|
|
{
|
|
|
|
/** if either value is WILDCARD, then return equal */
|
|
|
|
if (*value1 == ORTE_JOBID_WILDCARD ||
|
|
|
|
*value2 == ORTE_JOBID_WILDCARD) return OPAL_EQUAL;
|
|
|
|
|
|
|
|
if (*value1 > *value2) return OPAL_VALUE1_GREATER;
|
|
|
|
|
|
|
|
if (*value2 > *value1) return OPAL_VALUE2_GREATER;
|
|
|
|
|
|
|
|
return OPAL_EQUAL;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* JOB
|
|
|
|
*/
|
|
|
|
int orte_dt_compare_job(orte_job_t *value1, orte_job_t *value2, opal_data_type_t type)
|
|
|
|
{
|
|
|
|
/** check jobids */
|
|
|
|
if (value1->jobid > value2->jobid) return OPAL_VALUE1_GREATER;
|
|
|
|
if (value1->jobid < value2->jobid) return OPAL_VALUE2_GREATER;
|
|
|
|
|
|
|
|
return OPAL_EQUAL;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* NODE
|
|
|
|
*/
|
|
|
|
int orte_dt_compare_node(orte_node_t *value1, orte_node_t *value2, opal_data_type_t type)
|
|
|
|
{
|
|
|
|
int test;
|
|
|
|
|
|
|
|
/** check node names */
|
|
|
|
test = strcmp(value1->name, value2->name);
|
|
|
|
if (0 == test) return OPAL_EQUAL;
|
|
|
|
if (0 < test) return OPAL_VALUE2_GREATER;
|
|
|
|
|
|
|
|
return OPAL_VALUE1_GREATER;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* PROC
|
|
|
|
*/
|
|
|
|
int orte_dt_compare_proc(orte_proc_t *value1, orte_proc_t *value2, opal_data_type_t type)
|
|
|
|
{
|
2011-06-23 20:38:02 +00:00
|
|
|
orte_ns_cmp_bitmask_t mask;
|
|
|
|
|
2008-02-28 01:57:57 +00:00
|
|
|
/** check vpids */
|
2011-06-23 20:38:02 +00:00
|
|
|
mask = ORTE_NS_CMP_VPID;
|
|
|
|
|
|
|
|
return orte_util_compare_name_fields(mask, &value1->name, &value2->name);
|
2008-02-28 01:57:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* APP CONTEXT
|
|
|
|
*/
|
|
|
|
int orte_dt_compare_app_context(orte_app_context_t *value1, orte_app_context_t *value2, opal_data_type_t type)
|
|
|
|
{
|
|
|
|
if (value1->idx > value2->idx) return OPAL_VALUE1_GREATER;
|
|
|
|
if (value2->idx > value1->idx) return OPAL_VALUE2_GREATER;
|
|
|
|
|
|
|
|
return OPAL_EQUAL;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* EXIT CODE
|
|
|
|
*/
|
|
|
|
int orte_dt_compare_exit_code(orte_exit_code_t *value1,
|
|
|
|
orte_exit_code_t *value2,
|
|
|
|
opal_data_type_t type)
|
|
|
|
{
|
|
|
|
if (*value1 > *value2) return OPAL_VALUE1_GREATER;
|
|
|
|
|
|
|
|
if (*value2 > *value1) return OPAL_VALUE2_GREATER;
|
|
|
|
|
|
|
|
return OPAL_EQUAL;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* NODE STATE
|
|
|
|
*/
|
|
|
|
int orte_dt_compare_node_state(orte_node_state_t *value1,
|
|
|
|
orte_node_state_t *value2,
|
|
|
|
orte_node_state_t type)
|
|
|
|
{
|
|
|
|
if (*value1 > *value2) return OPAL_VALUE1_GREATER;
|
|
|
|
|
|
|
|
if (*value2 > *value1) return OPAL_VALUE2_GREATER;
|
|
|
|
|
|
|
|
return OPAL_EQUAL;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* PROC STATE
|
|
|
|
*/
|
|
|
|
int orte_dt_compare_proc_state(orte_proc_state_t *value1,
|
|
|
|
orte_proc_state_t *value2,
|
|
|
|
orte_proc_state_t type)
|
|
|
|
{
|
|
|
|
if (*value1 > *value2) return OPAL_VALUE1_GREATER;
|
|
|
|
|
|
|
|
if (*value2 > *value1) return OPAL_VALUE2_GREATER;
|
|
|
|
|
|
|
|
return OPAL_EQUAL;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* JOB STATE
|
|
|
|
*/
|
|
|
|
int orte_dt_compare_job_state(orte_job_state_t *value1,
|
|
|
|
orte_job_state_t *value2,
|
|
|
|
orte_job_state_t type)
|
|
|
|
{
|
|
|
|
if (*value1 > *value2) return OPAL_VALUE1_GREATER;
|
|
|
|
|
|
|
|
if (*value2 > *value1) return OPAL_VALUE2_GREATER;
|
|
|
|
|
|
|
|
return OPAL_EQUAL;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* JOB_MAP
|
|
|
|
*/
|
|
|
|
int orte_dt_compare_map(orte_job_map_t *value1, orte_job_map_t *value2, opal_data_type_t type)
|
|
|
|
{
|
|
|
|
return OPAL_EQUAL;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* RML tags
|
|
|
|
*/
|
|
|
|
int orte_dt_compare_tags(orte_rml_tag_t *value1, orte_rml_tag_t *value2, opal_data_type_t type)
|
|
|
|
{
|
|
|
|
if (*value1 > *value2) {
|
|
|
|
return OPAL_VALUE1_GREATER;
|
|
|
|
} else if (*value1 < *value2) {
|
|
|
|
return OPAL_VALUE2_GREATER;
|
|
|
|
} else {
|
|
|
|
return OPAL_EQUAL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* ORTE_DAEMON_CMD */
|
|
|
|
int orte_dt_compare_daemon_cmd(orte_daemon_cmd_flag_t *value1, orte_daemon_cmd_flag_t *value2, opal_data_type_t type)
|
|
|
|
{
|
|
|
|
if (*value1 > *value2) return OPAL_VALUE1_GREATER;
|
|
|
|
|
|
|
|
if (*value2 > *value1) return OPAL_VALUE2_GREATER;
|
|
|
|
|
|
|
|
return OPAL_EQUAL;
|
|
|
|
}
|
|
|
|
|
Roll in the revamped IOF subsystem. Per the devel mailing list email, this is a complete rewrite of the iof framework designed to simplify the code for maintainability, and to support features we had planned to do, but were too difficult to implement in the old code. Specifically, the new code:
1. completely and cleanly separates responsibilities between the HNP, orted, and tool components.
2. removes all wireup messaging during launch and shutdown.
3. maintains flow control for stdin to avoid large-scale consumption of memory by orteds when large input files are forwarded. This is done using an xon/xoff protocol.
4. enables specification of stdin recipients on the mpirun cmd line. Allowed options include rank, "all", or "none". Default is rank 0.
5. creates a new MPI_Info key "ompi_stdin_target" that supports the above options for child jobs. Default is "none".
6. adds a new tool "orte-iof" that can connect to a running mpirun and display the output. Cmd line options allow selection of any combination of stdout, stderr, and stddiag. Default is stdout.
7. adds a new mpirun and orte-iof cmd line option "tag-output" that will tag each line of output with process name and stream ident. For example, "[1,0]<stdout>this is output"
This is not intended for the 1.3 release as it is a major change requiring considerable soak time.
This commit was SVN r19767.
2008-10-18 00:00:49 +00:00
|
|
|
/* ORTE_IOF_TAG */
|
|
|
|
int orte_dt_compare_iof_tag(orte_iof_tag_t *value1, orte_iof_tag_t *value2, opal_data_type_t type)
|
|
|
|
{
|
|
|
|
if (*value1 > *value2) return OPAL_VALUE1_GREATER;
|
|
|
|
|
|
|
|
if (*value2 > *value1) return OPAL_VALUE2_GREATER;
|
|
|
|
|
|
|
|
return OPAL_EQUAL;
|
|
|
|
}
|