2008-02-28 04:57:57 +03:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
|
|
|
|
* University Research and Technology
|
|
|
|
* Corporation. All rights reserved.
|
2011-06-24 00:38:02 +04:00
|
|
|
* Copyright (c) 2004-2011 The University of Tennessee and The University
|
2008-02-28 04:57:57 +03:00
|
|
|
* of Tennessee Research Foundation. All rights
|
|
|
|
* reserved.
|
2015-06-24 06:59:57 +03:00
|
|
|
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
2008-02-28 04:57:57 +03:00
|
|
|
* University of Stuttgart. All rights reserved.
|
|
|
|
* Copyright (c) 2004-2005 The Regents of the University of California.
|
|
|
|
* All rights reserved.
|
2010-08-09 23:28:56 +04:00
|
|
|
* Copyright (c) 2010 Oracle and/or its affiliates. All rights reserved.
|
2016-01-14 04:34:44 +03:00
|
|
|
* Copyright (c) 2014-2016 Research Organization for Information Science
|
2014-09-09 09:13:00 +04:00
|
|
|
* and Technology (RIST). All rights reserved.
|
2016-01-16 20:44:52 +03:00
|
|
|
* Copyright (c) 2016 Intel, Inc. All rights reserved.
|
2008-02-28 04:57:57 +03:00
|
|
|
* $COPYRIGHT$
|
2015-06-24 06:59:57 +03:00
|
|
|
*
|
2008-02-28 04:57:57 +03:00
|
|
|
* Additional copyrights may follow
|
2015-06-24 06:59:57 +03:00
|
|
|
*
|
2008-02-28 04:57:57 +03:00
|
|
|
* $HEADER$
|
|
|
|
*/
|
|
|
|
#include "orte_config.h"
|
|
|
|
#include "orte/types.h"
|
|
|
|
#include "orte/constants.h"
|
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <string.h>
|
|
|
|
|
|
|
|
#include "opal/util/printf.h"
|
|
|
|
#include "opal/threads/tsd.h"
|
|
|
|
|
|
|
|
#include "orte/mca/errmgr/errmgr.h"
|
|
|
|
|
|
|
|
#include "orte/util/name_fns.h"
|
|
|
|
|
|
|
|
#define ORTE_PRINT_NAME_ARGS_MAX_SIZE 50
|
|
|
|
#define ORTE_PRINT_NAME_ARG_NUM_BUFS 16
|
|
|
|
|
|
|
|
#define ORTE_SCHEMA_DELIMITER_CHAR '.'
|
|
|
|
#define ORTE_SCHEMA_WILDCARD_CHAR '*'
|
|
|
|
#define ORTE_SCHEMA_WILDCARD_STRING "*"
|
|
|
|
#define ORTE_SCHEMA_INVALID_CHAR '$'
|
|
|
|
#define ORTE_SCHEMA_INVALID_STRING "$"
|
|
|
|
|
|
|
|
/* constructor - used to initialize namelist instance */
|
|
|
|
static void orte_namelist_construct(orte_namelist_t* list)
|
|
|
|
{
|
|
|
|
list->name.jobid = ORTE_JOBID_INVALID;
|
|
|
|
list->name.vpid = ORTE_VPID_INVALID;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* destructor - used to free any resources held by instance */
|
|
|
|
static void orte_namelist_destructor(orte_namelist_t* list)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
/* define instance of opal_class_t */
|
|
|
|
OBJ_CLASS_INSTANCE(orte_namelist_t, /* type name */
|
|
|
|
opal_list_item_t, /* parent "class" name */
|
|
|
|
orte_namelist_construct, /* constructor */
|
|
|
|
orte_namelist_destructor); /* destructor */
|
2015-06-24 06:59:57 +03:00
|
|
|
|
2008-02-28 04:57:57 +03:00
|
|
|
static bool fns_init=false;
|
|
|
|
|
|
|
|
static opal_tsd_key_t print_args_tsd_key;
|
|
|
|
char* orte_print_args_null = "NULL";
|
|
|
|
typedef struct {
|
|
|
|
char *buffers[ORTE_PRINT_NAME_ARG_NUM_BUFS];
|
|
|
|
int cntr;
|
|
|
|
} orte_print_args_buffers_t;
|
|
|
|
|
|
|
|
static void
|
|
|
|
buffer_cleanup(void *value)
|
|
|
|
{
|
|
|
|
int i;
|
|
|
|
orte_print_args_buffers_t *ptr;
|
2012-11-08 03:59:49 +04:00
|
|
|
|
2008-02-28 04:57:57 +03:00
|
|
|
if (NULL != value) {
|
|
|
|
ptr = (orte_print_args_buffers_t*)value;
|
|
|
|
for (i=0; i < ORTE_PRINT_NAME_ARG_NUM_BUFS; i++) {
|
|
|
|
free(ptr->buffers[i]);
|
|
|
|
}
|
2012-11-08 03:59:49 +04:00
|
|
|
free (ptr);
|
2008-02-28 04:57:57 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static orte_print_args_buffers_t*
|
|
|
|
get_print_name_buffer(void)
|
|
|
|
{
|
|
|
|
orte_print_args_buffers_t *ptr;
|
|
|
|
int ret, i;
|
2015-06-24 06:59:57 +03:00
|
|
|
|
2009-11-25 18:12:45 +03:00
|
|
|
if (!fns_init) {
|
|
|
|
/* setup the print_args function */
|
|
|
|
if (ORTE_SUCCESS != (ret = opal_tsd_key_create(&print_args_tsd_key, buffer_cleanup))) {
|
|
|
|
ORTE_ERROR_LOG(ret);
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
fns_init = true;
|
|
|
|
}
|
2015-06-24 06:59:57 +03:00
|
|
|
|
2008-02-28 04:57:57 +03:00
|
|
|
ret = opal_tsd_getspecific(print_args_tsd_key, (void**)&ptr);
|
|
|
|
if (OPAL_SUCCESS != ret) return NULL;
|
2015-06-24 06:59:57 +03:00
|
|
|
|
2008-02-28 04:57:57 +03:00
|
|
|
if (NULL == ptr) {
|
|
|
|
ptr = (orte_print_args_buffers_t*)malloc(sizeof(orte_print_args_buffers_t));
|
|
|
|
for (i=0; i < ORTE_PRINT_NAME_ARG_NUM_BUFS; i++) {
|
|
|
|
ptr->buffers[i] = (char *) malloc((ORTE_PRINT_NAME_ARGS_MAX_SIZE+1) * sizeof(char));
|
|
|
|
}
|
|
|
|
ptr->cntr = 0;
|
|
|
|
ret = opal_tsd_setspecific(print_args_tsd_key, (void*)ptr);
|
|
|
|
}
|
2015-06-24 06:59:57 +03:00
|
|
|
|
2008-02-28 04:57:57 +03:00
|
|
|
return (orte_print_args_buffers_t*) ptr;
|
|
|
|
}
|
|
|
|
|
|
|
|
char* orte_util_print_name_args(const orte_process_name_t *name)
|
|
|
|
{
|
|
|
|
orte_print_args_buffers_t *ptr;
|
2015-06-24 06:59:57 +03:00
|
|
|
char *job, *vpid;
|
|
|
|
|
2008-02-28 04:57:57 +03:00
|
|
|
/* protect against NULL names */
|
|
|
|
if (NULL == name) {
|
|
|
|
/* get the next buffer */
|
|
|
|
ptr = get_print_name_buffer();
|
|
|
|
if (NULL == ptr) {
|
|
|
|
ORTE_ERROR_LOG(ORTE_ERR_OUT_OF_RESOURCE);
|
|
|
|
return orte_print_args_null;
|
|
|
|
}
|
|
|
|
/* cycle around the ring */
|
|
|
|
if (ORTE_PRINT_NAME_ARG_NUM_BUFS == ptr->cntr) {
|
|
|
|
ptr->cntr = 0;
|
|
|
|
}
|
|
|
|
snprintf(ptr->buffers[ptr->cntr++], ORTE_PRINT_NAME_ARGS_MAX_SIZE, "[NO-NAME]");
|
|
|
|
return ptr->buffers[ptr->cntr-1];
|
|
|
|
}
|
2015-06-24 06:59:57 +03:00
|
|
|
|
2012-04-06 18:23:13 +04:00
|
|
|
/* get the jobid, vpid strings first - this will protect us from
|
2008-02-28 04:57:57 +03:00
|
|
|
* stepping on each other's buffer. This also guarantees
|
|
|
|
* that the print_args function has been initialized, so
|
|
|
|
* we don't need to duplicate that here
|
|
|
|
*/
|
|
|
|
job = orte_util_print_jobids(name->jobid);
|
|
|
|
vpid = orte_util_print_vpids(name->vpid);
|
2015-06-24 06:59:57 +03:00
|
|
|
|
2008-02-28 04:57:57 +03:00
|
|
|
/* get the next buffer */
|
|
|
|
ptr = get_print_name_buffer();
|
2015-06-24 06:59:57 +03:00
|
|
|
|
2008-02-28 04:57:57 +03:00
|
|
|
if (NULL == ptr) {
|
|
|
|
ORTE_ERROR_LOG(ORTE_ERR_OUT_OF_RESOURCE);
|
|
|
|
return orte_print_args_null;
|
|
|
|
}
|
2015-06-24 06:59:57 +03:00
|
|
|
|
2008-02-28 04:57:57 +03:00
|
|
|
/* cycle around the ring */
|
|
|
|
if (ORTE_PRINT_NAME_ARG_NUM_BUFS == ptr->cntr) {
|
|
|
|
ptr->cntr = 0;
|
|
|
|
}
|
2015-06-24 06:59:57 +03:00
|
|
|
|
|
|
|
snprintf(ptr->buffers[ptr->cntr++],
|
|
|
|
ORTE_PRINT_NAME_ARGS_MAX_SIZE,
|
2011-08-27 02:16:14 +04:00
|
|
|
"[%s,%s]", job, vpid);
|
2015-06-24 06:59:57 +03:00
|
|
|
|
2008-02-28 04:57:57 +03:00
|
|
|
return ptr->buffers[ptr->cntr-1];
|
|
|
|
}
|
|
|
|
|
|
|
|
char* orte_util_print_jobids(const orte_jobid_t job)
|
|
|
|
{
|
|
|
|
orte_print_args_buffers_t *ptr;
|
|
|
|
unsigned long tmp1, tmp2;
|
2015-06-24 06:59:57 +03:00
|
|
|
|
2008-02-28 04:57:57 +03:00
|
|
|
ptr = get_print_name_buffer();
|
2015-06-24 06:59:57 +03:00
|
|
|
|
2008-02-28 04:57:57 +03:00
|
|
|
if (NULL == ptr) {
|
|
|
|
ORTE_ERROR_LOG(ORTE_ERR_OUT_OF_RESOURCE);
|
|
|
|
return orte_print_args_null;
|
|
|
|
}
|
2015-06-24 06:59:57 +03:00
|
|
|
|
2008-02-28 04:57:57 +03:00
|
|
|
/* cycle around the ring */
|
|
|
|
if (ORTE_PRINT_NAME_ARG_NUM_BUFS == ptr->cntr) {
|
|
|
|
ptr->cntr = 0;
|
|
|
|
}
|
2015-06-24 06:59:57 +03:00
|
|
|
|
2008-02-28 04:57:57 +03:00
|
|
|
if (ORTE_JOBID_INVALID == job) {
|
|
|
|
snprintf(ptr->buffers[ptr->cntr++], ORTE_PRINT_NAME_ARGS_MAX_SIZE, "[INVALID]");
|
|
|
|
} else if (ORTE_JOBID_WILDCARD == job) {
|
|
|
|
snprintf(ptr->buffers[ptr->cntr++], ORTE_PRINT_NAME_ARGS_MAX_SIZE, "[WILDCARD]");
|
|
|
|
} else {
|
2014-09-09 09:13:00 +04:00
|
|
|
tmp1 = ORTE_JOB_FAMILY((unsigned long)job);
|
|
|
|
tmp2 = ORTE_LOCAL_JOBID((unsigned long)job);
|
2015-06-24 06:59:57 +03:00
|
|
|
snprintf(ptr->buffers[ptr->cntr++],
|
|
|
|
ORTE_PRINT_NAME_ARGS_MAX_SIZE,
|
2008-02-28 04:57:57 +03:00
|
|
|
"[%lu,%lu]", tmp1, tmp2);
|
|
|
|
}
|
|
|
|
return ptr->buffers[ptr->cntr-1];
|
|
|
|
}
|
|
|
|
|
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 04:00:49 +04:00
|
|
|
char* orte_util_print_job_family(const orte_jobid_t job)
|
|
|
|
{
|
|
|
|
orte_print_args_buffers_t *ptr;
|
|
|
|
unsigned long tmp1;
|
2015-06-24 06:59:57 +03:00
|
|
|
|
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 04:00:49 +04:00
|
|
|
ptr = get_print_name_buffer();
|
2015-06-24 06:59:57 +03:00
|
|
|
|
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 04:00:49 +04:00
|
|
|
if (NULL == ptr) {
|
|
|
|
ORTE_ERROR_LOG(ORTE_ERR_OUT_OF_RESOURCE);
|
|
|
|
return orte_print_args_null;
|
|
|
|
}
|
2015-06-24 06:59:57 +03:00
|
|
|
|
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 04:00:49 +04:00
|
|
|
/* cycle around the ring */
|
|
|
|
if (ORTE_PRINT_NAME_ARG_NUM_BUFS == ptr->cntr) {
|
|
|
|
ptr->cntr = 0;
|
|
|
|
}
|
2015-06-24 06:59:57 +03:00
|
|
|
|
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 04:00:49 +04:00
|
|
|
if (ORTE_JOBID_INVALID == job) {
|
|
|
|
snprintf(ptr->buffers[ptr->cntr++], ORTE_PRINT_NAME_ARGS_MAX_SIZE, "INVALID");
|
|
|
|
} else if (ORTE_JOBID_WILDCARD == job) {
|
|
|
|
snprintf(ptr->buffers[ptr->cntr++], ORTE_PRINT_NAME_ARGS_MAX_SIZE, "WILDCARD");
|
|
|
|
} else {
|
2014-09-09 09:13:00 +04:00
|
|
|
tmp1 = ORTE_JOB_FAMILY((unsigned long)job);
|
2015-06-24 06:59:57 +03:00
|
|
|
snprintf(ptr->buffers[ptr->cntr++],
|
|
|
|
ORTE_PRINT_NAME_ARGS_MAX_SIZE,
|
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 04:00:49 +04:00
|
|
|
"%lu", tmp1);
|
|
|
|
}
|
|
|
|
return ptr->buffers[ptr->cntr-1];
|
|
|
|
}
|
|
|
|
|
|
|
|
char* orte_util_print_local_jobid(const orte_jobid_t job)
|
|
|
|
{
|
|
|
|
orte_print_args_buffers_t *ptr;
|
|
|
|
unsigned long tmp1;
|
2015-06-24 06:59:57 +03:00
|
|
|
|
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 04:00:49 +04:00
|
|
|
ptr = get_print_name_buffer();
|
2015-06-24 06:59:57 +03:00
|
|
|
|
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 04:00:49 +04:00
|
|
|
if (NULL == ptr) {
|
|
|
|
ORTE_ERROR_LOG(ORTE_ERR_OUT_OF_RESOURCE);
|
|
|
|
return orte_print_args_null;
|
|
|
|
}
|
2015-06-24 06:59:57 +03:00
|
|
|
|
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 04:00:49 +04:00
|
|
|
/* cycle around the ring */
|
|
|
|
if (ORTE_PRINT_NAME_ARG_NUM_BUFS == ptr->cntr) {
|
|
|
|
ptr->cntr = 0;
|
|
|
|
}
|
2015-06-24 06:59:57 +03:00
|
|
|
|
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 04:00:49 +04:00
|
|
|
if (ORTE_JOBID_INVALID == job) {
|
|
|
|
snprintf(ptr->buffers[ptr->cntr++], ORTE_PRINT_NAME_ARGS_MAX_SIZE, "INVALID");
|
|
|
|
} else if (ORTE_JOBID_WILDCARD == job) {
|
|
|
|
snprintf(ptr->buffers[ptr->cntr++], ORTE_PRINT_NAME_ARGS_MAX_SIZE, "WILDCARD");
|
|
|
|
} else {
|
|
|
|
tmp1 = (unsigned long)job & 0x0000ffff;
|
2015-06-24 06:59:57 +03:00
|
|
|
snprintf(ptr->buffers[ptr->cntr++],
|
|
|
|
ORTE_PRINT_NAME_ARGS_MAX_SIZE,
|
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 04:00:49 +04:00
|
|
|
"%lu", tmp1);
|
|
|
|
}
|
|
|
|
return ptr->buffers[ptr->cntr-1];
|
|
|
|
}
|
|
|
|
|
2008-02-28 04:57:57 +03:00
|
|
|
char* orte_util_print_vpids(const orte_vpid_t vpid)
|
|
|
|
{
|
|
|
|
orte_print_args_buffers_t *ptr;
|
2015-06-24 06:59:57 +03:00
|
|
|
|
2008-02-28 04:57:57 +03:00
|
|
|
ptr = get_print_name_buffer();
|
2015-06-24 06:59:57 +03:00
|
|
|
|
2008-02-28 04:57:57 +03:00
|
|
|
if (NULL == ptr) {
|
|
|
|
ORTE_ERROR_LOG(ORTE_ERR_OUT_OF_RESOURCE);
|
|
|
|
return orte_print_args_null;
|
|
|
|
}
|
2015-06-24 06:59:57 +03:00
|
|
|
|
2008-02-28 04:57:57 +03:00
|
|
|
/* cycle around the ring */
|
|
|
|
if (ORTE_PRINT_NAME_ARG_NUM_BUFS == ptr->cntr) {
|
|
|
|
ptr->cntr = 0;
|
|
|
|
}
|
2015-06-24 06:59:57 +03:00
|
|
|
|
2008-02-28 04:57:57 +03:00
|
|
|
if (ORTE_VPID_INVALID == vpid) {
|
|
|
|
snprintf(ptr->buffers[ptr->cntr++], ORTE_PRINT_NAME_ARGS_MAX_SIZE, "INVALID");
|
|
|
|
} else if (ORTE_VPID_WILDCARD == vpid) {
|
|
|
|
snprintf(ptr->buffers[ptr->cntr++], ORTE_PRINT_NAME_ARGS_MAX_SIZE, "WILDCARD");
|
|
|
|
} else {
|
2015-06-24 06:59:57 +03:00
|
|
|
snprintf(ptr->buffers[ptr->cntr++],
|
|
|
|
ORTE_PRINT_NAME_ARGS_MAX_SIZE,
|
2008-02-28 04:57:57 +03:00
|
|
|
"%ld", (long)vpid);
|
|
|
|
}
|
|
|
|
return ptr->buffers[ptr->cntr-1];
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*** STRING FUNCTIONS ***/
|
2016-01-14 04:34:44 +03:00
|
|
|
|
|
|
|
int orte_util_snprintf_jobid(char *jobid_string, size_t size, const orte_jobid_t jobid)
|
2008-02-28 04:57:57 +03:00
|
|
|
{
|
2016-01-14 04:34:44 +03:00
|
|
|
int rc;
|
|
|
|
|
2008-02-28 04:57:57 +03:00
|
|
|
/* check for wildcard value - handle appropriately */
|
|
|
|
if (ORTE_JOBID_WILDCARD == jobid) {
|
2016-01-16 20:44:52 +03:00
|
|
|
(void)strncpy(jobid_string, ORTE_SCHEMA_WILDCARD_STRING, size);
|
2016-01-18 03:44:02 +03:00
|
|
|
} else {
|
|
|
|
rc = snprintf(jobid_string, size, "%ld", (long) jobid);
|
|
|
|
if (0 > rc) {
|
|
|
|
return ORTE_ERROR;
|
|
|
|
}
|
2008-02-28 04:57:57 +03:00
|
|
|
}
|
2015-06-24 06:59:57 +03:00
|
|
|
|
2016-01-18 03:44:02 +03:00
|
|
|
return ORTE_SUCCESS;
|
2016-01-14 04:34:44 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
int orte_util_convert_jobid_to_string(char **jobid_string, const orte_jobid_t jobid)
|
|
|
|
{
|
|
|
|
int rc;
|
|
|
|
char str[256];
|
|
|
|
rc = orte_util_snprintf_jobid(str, 255, jobid);
|
|
|
|
if (0 > rc) {
|
|
|
|
*jobid_string = NULL;
|
|
|
|
return rc;
|
|
|
|
}
|
|
|
|
*jobid_string = strdup(str);
|
|
|
|
if (NULL == *jobid_string) {
|
|
|
|
ORTE_ERROR_LOG(ORTE_ERR_OUT_OF_RESOURCE);
|
|
|
|
return ORTE_ERR_OUT_OF_RESOURCE;
|
|
|
|
}
|
2008-02-28 04:57:57 +03:00
|
|
|
return ORTE_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int orte_util_convert_string_to_jobid(orte_jobid_t *jobid, const char* jobidstring)
|
|
|
|
{
|
|
|
|
if (NULL == jobidstring) { /* got an error */
|
|
|
|
ORTE_ERROR_LOG(ORTE_ERR_BAD_PARAM);
|
|
|
|
*jobid = ORTE_JOBID_INVALID;
|
|
|
|
return ORTE_ERR_BAD_PARAM;
|
|
|
|
}
|
|
|
|
|
|
|
|
/** check for wildcard character - handle appropriately */
|
|
|
|
if (0 == strcmp(ORTE_SCHEMA_WILDCARD_STRING, jobidstring)) {
|
|
|
|
*jobid = ORTE_JOBID_WILDCARD;
|
|
|
|
return ORTE_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* check for invalid value */
|
|
|
|
if (0 == strcmp(ORTE_SCHEMA_INVALID_STRING, jobidstring)) {
|
|
|
|
*jobid = ORTE_JOBID_INVALID;
|
|
|
|
return ORTE_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
*jobid = strtoul(jobidstring, NULL, 10);
|
|
|
|
|
|
|
|
return ORTE_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
int orte_util_convert_vpid_to_string(char **vpid_string, const orte_vpid_t vpid)
|
|
|
|
{
|
|
|
|
/* check for wildcard value - handle appropriately */
|
|
|
|
if (ORTE_VPID_WILDCARD == vpid) {
|
|
|
|
*vpid_string = strdup(ORTE_SCHEMA_WILDCARD_STRING);
|
|
|
|
return ORTE_SUCCESS;
|
|
|
|
}
|
2015-06-24 06:59:57 +03:00
|
|
|
|
2008-02-28 04:57:57 +03:00
|
|
|
/* check for invalid value - handle appropriately */
|
|
|
|
if (ORTE_VPID_INVALID == vpid) {
|
|
|
|
*vpid_string = strdup(ORTE_SCHEMA_INVALID_STRING);
|
|
|
|
return ORTE_SUCCESS;
|
|
|
|
}
|
2015-06-24 06:59:57 +03:00
|
|
|
|
2008-02-28 04:57:57 +03:00
|
|
|
if (0 > asprintf(vpid_string, "%ld", (long) vpid)) {
|
|
|
|
ORTE_ERROR_LOG(ORTE_ERR_OUT_OF_RESOURCE);
|
|
|
|
return ORTE_ERR_OUT_OF_RESOURCE;
|
|
|
|
}
|
2015-06-24 06:59:57 +03:00
|
|
|
|
2008-02-28 04:57:57 +03:00
|
|
|
return ORTE_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int orte_util_convert_string_to_vpid(orte_vpid_t *vpid, const char* vpidstring)
|
|
|
|
{
|
|
|
|
if (NULL == vpidstring) { /* got an error */
|
|
|
|
ORTE_ERROR_LOG(ORTE_ERR_BAD_PARAM);
|
|
|
|
*vpid = ORTE_VPID_INVALID;
|
|
|
|
return ORTE_ERR_BAD_PARAM;
|
|
|
|
}
|
|
|
|
|
|
|
|
/** check for wildcard character - handle appropriately */
|
|
|
|
if (0 == strcmp(ORTE_SCHEMA_WILDCARD_STRING, vpidstring)) {
|
|
|
|
*vpid = ORTE_VPID_WILDCARD;
|
|
|
|
return ORTE_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* check for invalid value */
|
|
|
|
if (0 == strcmp(ORTE_SCHEMA_INVALID_STRING, vpidstring)) {
|
|
|
|
*vpid = ORTE_VPID_INVALID;
|
|
|
|
return ORTE_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
*vpid = strtol(vpidstring, NULL, 10);
|
|
|
|
|
|
|
|
return ORTE_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
int orte_util_convert_string_to_process_name(orte_process_name_t *name,
|
|
|
|
const char* name_string)
|
|
|
|
{
|
|
|
|
char *temp, *token;
|
|
|
|
orte_jobid_t job;
|
|
|
|
orte_vpid_t vpid;
|
|
|
|
int return_code=ORTE_SUCCESS;
|
2011-08-27 02:16:14 +04:00
|
|
|
|
2008-02-28 04:57:57 +03:00
|
|
|
/* set default */
|
|
|
|
name->jobid = ORTE_JOBID_INVALID;
|
|
|
|
name->vpid = ORTE_VPID_INVALID;
|
2015-06-24 06:59:57 +03:00
|
|
|
|
2008-02-28 04:57:57 +03:00
|
|
|
/* check for NULL string - error */
|
|
|
|
if (NULL == name_string) {
|
|
|
|
ORTE_ERROR_LOG(ORTE_ERR_BAD_PARAM);
|
|
|
|
return ORTE_ERR_BAD_PARAM;
|
|
|
|
}
|
2015-06-24 06:59:57 +03:00
|
|
|
|
2008-02-28 04:57:57 +03:00
|
|
|
temp = strdup(name_string); /** copy input string as the strtok process is destructive */
|
As per the RFC, bring in the ORTE async progress code and the rewrite of OOB:
*** THIS RFC INCLUDES A MINOR CHANGE TO THE MPI-RTE INTERFACE ***
Note: during the course of this work, it was necessary to completely separate the MPI and RTE progress engines. There were multiple places in the MPI layer where ORTE_WAIT_FOR_COMPLETION was being used. A new OMPI_WAIT_FOR_COMPLETION macro was created (defined in ompi/mca/rte/rte.h) that simply cycles across opal_progress until the provided flag becomes false. Places where the MPI layer blocked waiting for RTE to complete an event have been modified to use this macro.
***************************************************************************************
I am reissuing this RFC because of the time that has passed since its original release. Since its initial release and review, I have debugged it further to ensure it fully supports tests like loop_spawn. It therefore seems ready for merge back to the trunk. Given its prior review, I have set the timeout for one week.
The code is in https://bitbucket.org/rhc/ompi-oob2
WHAT: Rewrite of ORTE OOB
WHY: Support asynchronous progress and a host of other features
WHEN: Wed, August 21
SYNOPSIS:
The current OOB has served us well, but a number of limitations have been identified over the years. Specifically:
* it is only progressed when called via opal_progress, which can lead to hangs or recursive calls into libevent (which is not supported by that code)
* we've had issues when multiple NICs are available as the code doesn't "shift" messages between transports - thus, all nodes had to be available via the same TCP interface.
* the OOB "unloads" incoming opal_buffer_t objects during the transmission, thus preventing use of OBJ_RETAIN in the code when repeatedly sending the same message to multiple recipients
* there is no failover mechanism across NICs - if the selected NIC (or its attached switch) fails, we are forced to abort
* only one transport (i.e., component) can be "active"
The revised OOB resolves these problems:
* async progress is used for all application processes, with the progress thread blocking in the event library
* each available TCP NIC is supported by its own TCP module. The ability to asynchronously progress each module independently is provided, but not enabled by default (a runtime MCA parameter turns it "on")
* multi-address TCP NICs (e.g., a NIC with both an IPv4 and IPv6 address, or with virtual interfaces) are supported - reachability is determined by comparing the contact info for a peer against all addresses within the range covered by the address/mask pairs for the NIC.
* a message that arrives on one TCP NIC is automatically shifted to whatever NIC that is connected to the next "hop" if that peer cannot be reached by the incoming NIC. If no TCP module will reach the peer, then the OOB attempts to send the message via all other available components - if none can reach the peer, then an "error" is reported back to the RML, which then calls the errmgr for instructions.
* opal_buffer_t now conforms to standard object rules re OBJ_RETAIN as we no longer "unload" the incoming object
* NIC failure is reported to the TCP component, which then tries to resend the message across any other available TCP NIC. If that doesn't work, then the message is given back to the OOB base to try using other components. If all that fails, then the error is reported to the RML, which reports to the errmgr for instructions
* obviously from the above, multiple OOB components (e.g., TCP and UD) can be active in parallel
* the matching code has been moved to the RML (and out of the OOB/TCP component) so it is independent of transport
* routing is done by the individual OOB modules (as opposed to the RML). Thus, both routed and non-routed transports can simultaneously be active
* all blocking send/recv APIs have been removed. Everything operates asynchronously.
KNOWN LIMITATIONS:
* although provision is made for component failover as described above, the code for doing so has not been fully implemented yet. At the moment, if all connections for a given peer fail, the errmgr is notified of a "lost connection", which by default results in termination of the job if it was a lifeline
* the IPv6 code is present and compiles, but is not complete. Since the current IPv6 support in the OOB doesn't work anyway, I don't consider this a blocker
* routing is performed at the individual module level, yet the active routed component is selected on a global basis. We probably should update that to reflect that different transports may need/choose to route in different ways
* obviously, not every error path has been tested nor necessarily covered
* determining abnormal termination is more challenging than in the old code as we now potentially have multiple ways of connecting to a process. Ideally, we would declare "connection failed" when *all* transports can no longer reach the process, but that requires some additional (possibly complex) code. For now, the code replicates the old behavior only somewhat modified - i.e., if a module sees its connection fail, it checks to see if it is a lifeline. If so, it notifies the errmgr that the lifeline is lost - otherwise, it notifies the errmgr that a non-lifeline connection was lost.
* reachability is determined solely on the basis of a shared subnet address/mask - more sophisticated algorithms (e.g., the one used in the tcp btl) are required to handle routing via gateways
* the RML needs to assign sequence numbers to each message on a per-peer basis. The receiving RML will then deliver messages in order, thus preventing out-of-order messaging in the case where messages travel across different transports or a message needs to be redirected/resent due to failure of a NIC
This commit was SVN r29058.
2013-08-22 20:37:40 +04:00
|
|
|
token = strchr(temp, ORTE_SCHEMA_DELIMITER_CHAR); /** get first field -> jobid */
|
2015-06-24 06:59:57 +03:00
|
|
|
|
2008-02-28 04:57:57 +03:00
|
|
|
/* check for error */
|
|
|
|
if (NULL == token) {
|
|
|
|
ORTE_ERROR_LOG(ORTE_ERR_BAD_PARAM);
|
2015-02-17 06:27:23 +03:00
|
|
|
free(temp);
|
2008-02-28 04:57:57 +03:00
|
|
|
return ORTE_ERR_BAD_PARAM;
|
|
|
|
}
|
As per the RFC, bring in the ORTE async progress code and the rewrite of OOB:
*** THIS RFC INCLUDES A MINOR CHANGE TO THE MPI-RTE INTERFACE ***
Note: during the course of this work, it was necessary to completely separate the MPI and RTE progress engines. There were multiple places in the MPI layer where ORTE_WAIT_FOR_COMPLETION was being used. A new OMPI_WAIT_FOR_COMPLETION macro was created (defined in ompi/mca/rte/rte.h) that simply cycles across opal_progress until the provided flag becomes false. Places where the MPI layer blocked waiting for RTE to complete an event have been modified to use this macro.
***************************************************************************************
I am reissuing this RFC because of the time that has passed since its original release. Since its initial release and review, I have debugged it further to ensure it fully supports tests like loop_spawn. It therefore seems ready for merge back to the trunk. Given its prior review, I have set the timeout for one week.
The code is in https://bitbucket.org/rhc/ompi-oob2
WHAT: Rewrite of ORTE OOB
WHY: Support asynchronous progress and a host of other features
WHEN: Wed, August 21
SYNOPSIS:
The current OOB has served us well, but a number of limitations have been identified over the years. Specifically:
* it is only progressed when called via opal_progress, which can lead to hangs or recursive calls into libevent (which is not supported by that code)
* we've had issues when multiple NICs are available as the code doesn't "shift" messages between transports - thus, all nodes had to be available via the same TCP interface.
* the OOB "unloads" incoming opal_buffer_t objects during the transmission, thus preventing use of OBJ_RETAIN in the code when repeatedly sending the same message to multiple recipients
* there is no failover mechanism across NICs - if the selected NIC (or its attached switch) fails, we are forced to abort
* only one transport (i.e., component) can be "active"
The revised OOB resolves these problems:
* async progress is used for all application processes, with the progress thread blocking in the event library
* each available TCP NIC is supported by its own TCP module. The ability to asynchronously progress each module independently is provided, but not enabled by default (a runtime MCA parameter turns it "on")
* multi-address TCP NICs (e.g., a NIC with both an IPv4 and IPv6 address, or with virtual interfaces) are supported - reachability is determined by comparing the contact info for a peer against all addresses within the range covered by the address/mask pairs for the NIC.
* a message that arrives on one TCP NIC is automatically shifted to whatever NIC that is connected to the next "hop" if that peer cannot be reached by the incoming NIC. If no TCP module will reach the peer, then the OOB attempts to send the message via all other available components - if none can reach the peer, then an "error" is reported back to the RML, which then calls the errmgr for instructions.
* opal_buffer_t now conforms to standard object rules re OBJ_RETAIN as we no longer "unload" the incoming object
* NIC failure is reported to the TCP component, which then tries to resend the message across any other available TCP NIC. If that doesn't work, then the message is given back to the OOB base to try using other components. If all that fails, then the error is reported to the RML, which reports to the errmgr for instructions
* obviously from the above, multiple OOB components (e.g., TCP and UD) can be active in parallel
* the matching code has been moved to the RML (and out of the OOB/TCP component) so it is independent of transport
* routing is done by the individual OOB modules (as opposed to the RML). Thus, both routed and non-routed transports can simultaneously be active
* all blocking send/recv APIs have been removed. Everything operates asynchronously.
KNOWN LIMITATIONS:
* although provision is made for component failover as described above, the code for doing so has not been fully implemented yet. At the moment, if all connections for a given peer fail, the errmgr is notified of a "lost connection", which by default results in termination of the job if it was a lifeline
* the IPv6 code is present and compiles, but is not complete. Since the current IPv6 support in the OOB doesn't work anyway, I don't consider this a blocker
* routing is performed at the individual module level, yet the active routed component is selected on a global basis. We probably should update that to reflect that different transports may need/choose to route in different ways
* obviously, not every error path has been tested nor necessarily covered
* determining abnormal termination is more challenging than in the old code as we now potentially have multiple ways of connecting to a process. Ideally, we would declare "connection failed" when *all* transports can no longer reach the process, but that requires some additional (possibly complex) code. For now, the code replicates the old behavior only somewhat modified - i.e., if a module sees its connection fail, it checks to see if it is a lifeline. If so, it notifies the errmgr that the lifeline is lost - otherwise, it notifies the errmgr that a non-lifeline connection was lost.
* reachability is determined solely on the basis of a shared subnet address/mask - more sophisticated algorithms (e.g., the one used in the tcp btl) are required to handle routing via gateways
* the RML needs to assign sequence numbers to each message on a per-peer basis. The receiving RML will then deliver messages in order, thus preventing out-of-order messaging in the case where messages travel across different transports or a message needs to be redirected/resent due to failure of a NIC
This commit was SVN r29058.
2013-08-22 20:37:40 +04:00
|
|
|
*token = '\0';
|
|
|
|
token++;
|
2015-06-24 06:59:57 +03:00
|
|
|
|
2008-02-28 04:57:57 +03:00
|
|
|
/* check for WILDCARD character - assign
|
|
|
|
* value accordingly, if found
|
|
|
|
*/
|
As per the RFC, bring in the ORTE async progress code and the rewrite of OOB:
*** THIS RFC INCLUDES A MINOR CHANGE TO THE MPI-RTE INTERFACE ***
Note: during the course of this work, it was necessary to completely separate the MPI and RTE progress engines. There were multiple places in the MPI layer where ORTE_WAIT_FOR_COMPLETION was being used. A new OMPI_WAIT_FOR_COMPLETION macro was created (defined in ompi/mca/rte/rte.h) that simply cycles across opal_progress until the provided flag becomes false. Places where the MPI layer blocked waiting for RTE to complete an event have been modified to use this macro.
***************************************************************************************
I am reissuing this RFC because of the time that has passed since its original release. Since its initial release and review, I have debugged it further to ensure it fully supports tests like loop_spawn. It therefore seems ready for merge back to the trunk. Given its prior review, I have set the timeout for one week.
The code is in https://bitbucket.org/rhc/ompi-oob2
WHAT: Rewrite of ORTE OOB
WHY: Support asynchronous progress and a host of other features
WHEN: Wed, August 21
SYNOPSIS:
The current OOB has served us well, but a number of limitations have been identified over the years. Specifically:
* it is only progressed when called via opal_progress, which can lead to hangs or recursive calls into libevent (which is not supported by that code)
* we've had issues when multiple NICs are available as the code doesn't "shift" messages between transports - thus, all nodes had to be available via the same TCP interface.
* the OOB "unloads" incoming opal_buffer_t objects during the transmission, thus preventing use of OBJ_RETAIN in the code when repeatedly sending the same message to multiple recipients
* there is no failover mechanism across NICs - if the selected NIC (or its attached switch) fails, we are forced to abort
* only one transport (i.e., component) can be "active"
The revised OOB resolves these problems:
* async progress is used for all application processes, with the progress thread blocking in the event library
* each available TCP NIC is supported by its own TCP module. The ability to asynchronously progress each module independently is provided, but not enabled by default (a runtime MCA parameter turns it "on")
* multi-address TCP NICs (e.g., a NIC with both an IPv4 and IPv6 address, or with virtual interfaces) are supported - reachability is determined by comparing the contact info for a peer against all addresses within the range covered by the address/mask pairs for the NIC.
* a message that arrives on one TCP NIC is automatically shifted to whatever NIC that is connected to the next "hop" if that peer cannot be reached by the incoming NIC. If no TCP module will reach the peer, then the OOB attempts to send the message via all other available components - if none can reach the peer, then an "error" is reported back to the RML, which then calls the errmgr for instructions.
* opal_buffer_t now conforms to standard object rules re OBJ_RETAIN as we no longer "unload" the incoming object
* NIC failure is reported to the TCP component, which then tries to resend the message across any other available TCP NIC. If that doesn't work, then the message is given back to the OOB base to try using other components. If all that fails, then the error is reported to the RML, which reports to the errmgr for instructions
* obviously from the above, multiple OOB components (e.g., TCP and UD) can be active in parallel
* the matching code has been moved to the RML (and out of the OOB/TCP component) so it is independent of transport
* routing is done by the individual OOB modules (as opposed to the RML). Thus, both routed and non-routed transports can simultaneously be active
* all blocking send/recv APIs have been removed. Everything operates asynchronously.
KNOWN LIMITATIONS:
* although provision is made for component failover as described above, the code for doing so has not been fully implemented yet. At the moment, if all connections for a given peer fail, the errmgr is notified of a "lost connection", which by default results in termination of the job if it was a lifeline
* the IPv6 code is present and compiles, but is not complete. Since the current IPv6 support in the OOB doesn't work anyway, I don't consider this a blocker
* routing is performed at the individual module level, yet the active routed component is selected on a global basis. We probably should update that to reflect that different transports may need/choose to route in different ways
* obviously, not every error path has been tested nor necessarily covered
* determining abnormal termination is more challenging than in the old code as we now potentially have multiple ways of connecting to a process. Ideally, we would declare "connection failed" when *all* transports can no longer reach the process, but that requires some additional (possibly complex) code. For now, the code replicates the old behavior only somewhat modified - i.e., if a module sees its connection fail, it checks to see if it is a lifeline. If so, it notifies the errmgr that the lifeline is lost - otherwise, it notifies the errmgr that a non-lifeline connection was lost.
* reachability is determined solely on the basis of a shared subnet address/mask - more sophisticated algorithms (e.g., the one used in the tcp btl) are required to handle routing via gateways
* the RML needs to assign sequence numbers to each message on a per-peer basis. The receiving RML will then deliver messages in order, thus preventing out-of-order messaging in the case where messages travel across different transports or a message needs to be redirected/resent due to failure of a NIC
This commit was SVN r29058.
2013-08-22 20:37:40 +04:00
|
|
|
if (0 == strcmp(temp, ORTE_SCHEMA_WILDCARD_STRING)) {
|
2008-02-28 04:57:57 +03:00
|
|
|
job = ORTE_JOBID_WILDCARD;
|
As per the RFC, bring in the ORTE async progress code and the rewrite of OOB:
*** THIS RFC INCLUDES A MINOR CHANGE TO THE MPI-RTE INTERFACE ***
Note: during the course of this work, it was necessary to completely separate the MPI and RTE progress engines. There were multiple places in the MPI layer where ORTE_WAIT_FOR_COMPLETION was being used. A new OMPI_WAIT_FOR_COMPLETION macro was created (defined in ompi/mca/rte/rte.h) that simply cycles across opal_progress until the provided flag becomes false. Places where the MPI layer blocked waiting for RTE to complete an event have been modified to use this macro.
***************************************************************************************
I am reissuing this RFC because of the time that has passed since its original release. Since its initial release and review, I have debugged it further to ensure it fully supports tests like loop_spawn. It therefore seems ready for merge back to the trunk. Given its prior review, I have set the timeout for one week.
The code is in https://bitbucket.org/rhc/ompi-oob2
WHAT: Rewrite of ORTE OOB
WHY: Support asynchronous progress and a host of other features
WHEN: Wed, August 21
SYNOPSIS:
The current OOB has served us well, but a number of limitations have been identified over the years. Specifically:
* it is only progressed when called via opal_progress, which can lead to hangs or recursive calls into libevent (which is not supported by that code)
* we've had issues when multiple NICs are available as the code doesn't "shift" messages between transports - thus, all nodes had to be available via the same TCP interface.
* the OOB "unloads" incoming opal_buffer_t objects during the transmission, thus preventing use of OBJ_RETAIN in the code when repeatedly sending the same message to multiple recipients
* there is no failover mechanism across NICs - if the selected NIC (or its attached switch) fails, we are forced to abort
* only one transport (i.e., component) can be "active"
The revised OOB resolves these problems:
* async progress is used for all application processes, with the progress thread blocking in the event library
* each available TCP NIC is supported by its own TCP module. The ability to asynchronously progress each module independently is provided, but not enabled by default (a runtime MCA parameter turns it "on")
* multi-address TCP NICs (e.g., a NIC with both an IPv4 and IPv6 address, or with virtual interfaces) are supported - reachability is determined by comparing the contact info for a peer against all addresses within the range covered by the address/mask pairs for the NIC.
* a message that arrives on one TCP NIC is automatically shifted to whatever NIC that is connected to the next "hop" if that peer cannot be reached by the incoming NIC. If no TCP module will reach the peer, then the OOB attempts to send the message via all other available components - if none can reach the peer, then an "error" is reported back to the RML, which then calls the errmgr for instructions.
* opal_buffer_t now conforms to standard object rules re OBJ_RETAIN as we no longer "unload" the incoming object
* NIC failure is reported to the TCP component, which then tries to resend the message across any other available TCP NIC. If that doesn't work, then the message is given back to the OOB base to try using other components. If all that fails, then the error is reported to the RML, which reports to the errmgr for instructions
* obviously from the above, multiple OOB components (e.g., TCP and UD) can be active in parallel
* the matching code has been moved to the RML (and out of the OOB/TCP component) so it is independent of transport
* routing is done by the individual OOB modules (as opposed to the RML). Thus, both routed and non-routed transports can simultaneously be active
* all blocking send/recv APIs have been removed. Everything operates asynchronously.
KNOWN LIMITATIONS:
* although provision is made for component failover as described above, the code for doing so has not been fully implemented yet. At the moment, if all connections for a given peer fail, the errmgr is notified of a "lost connection", which by default results in termination of the job if it was a lifeline
* the IPv6 code is present and compiles, but is not complete. Since the current IPv6 support in the OOB doesn't work anyway, I don't consider this a blocker
* routing is performed at the individual module level, yet the active routed component is selected on a global basis. We probably should update that to reflect that different transports may need/choose to route in different ways
* obviously, not every error path has been tested nor necessarily covered
* determining abnormal termination is more challenging than in the old code as we now potentially have multiple ways of connecting to a process. Ideally, we would declare "connection failed" when *all* transports can no longer reach the process, but that requires some additional (possibly complex) code. For now, the code replicates the old behavior only somewhat modified - i.e., if a module sees its connection fail, it checks to see if it is a lifeline. If so, it notifies the errmgr that the lifeline is lost - otherwise, it notifies the errmgr that a non-lifeline connection was lost.
* reachability is determined solely on the basis of a shared subnet address/mask - more sophisticated algorithms (e.g., the one used in the tcp btl) are required to handle routing via gateways
* the RML needs to assign sequence numbers to each message on a per-peer basis. The receiving RML will then deliver messages in order, thus preventing out-of-order messaging in the case where messages travel across different transports or a message needs to be redirected/resent due to failure of a NIC
This commit was SVN r29058.
2013-08-22 20:37:40 +04:00
|
|
|
} else if (0 == strcmp(temp, ORTE_SCHEMA_INVALID_STRING)) {
|
2008-02-28 04:57:57 +03:00
|
|
|
job = ORTE_JOBID_INVALID;
|
|
|
|
} else {
|
As per the RFC, bring in the ORTE async progress code and the rewrite of OOB:
*** THIS RFC INCLUDES A MINOR CHANGE TO THE MPI-RTE INTERFACE ***
Note: during the course of this work, it was necessary to completely separate the MPI and RTE progress engines. There were multiple places in the MPI layer where ORTE_WAIT_FOR_COMPLETION was being used. A new OMPI_WAIT_FOR_COMPLETION macro was created (defined in ompi/mca/rte/rte.h) that simply cycles across opal_progress until the provided flag becomes false. Places where the MPI layer blocked waiting for RTE to complete an event have been modified to use this macro.
***************************************************************************************
I am reissuing this RFC because of the time that has passed since its original release. Since its initial release and review, I have debugged it further to ensure it fully supports tests like loop_spawn. It therefore seems ready for merge back to the trunk. Given its prior review, I have set the timeout for one week.
The code is in https://bitbucket.org/rhc/ompi-oob2
WHAT: Rewrite of ORTE OOB
WHY: Support asynchronous progress and a host of other features
WHEN: Wed, August 21
SYNOPSIS:
The current OOB has served us well, but a number of limitations have been identified over the years. Specifically:
* it is only progressed when called via opal_progress, which can lead to hangs or recursive calls into libevent (which is not supported by that code)
* we've had issues when multiple NICs are available as the code doesn't "shift" messages between transports - thus, all nodes had to be available via the same TCP interface.
* the OOB "unloads" incoming opal_buffer_t objects during the transmission, thus preventing use of OBJ_RETAIN in the code when repeatedly sending the same message to multiple recipients
* there is no failover mechanism across NICs - if the selected NIC (or its attached switch) fails, we are forced to abort
* only one transport (i.e., component) can be "active"
The revised OOB resolves these problems:
* async progress is used for all application processes, with the progress thread blocking in the event library
* each available TCP NIC is supported by its own TCP module. The ability to asynchronously progress each module independently is provided, but not enabled by default (a runtime MCA parameter turns it "on")
* multi-address TCP NICs (e.g., a NIC with both an IPv4 and IPv6 address, or with virtual interfaces) are supported - reachability is determined by comparing the contact info for a peer against all addresses within the range covered by the address/mask pairs for the NIC.
* a message that arrives on one TCP NIC is automatically shifted to whatever NIC that is connected to the next "hop" if that peer cannot be reached by the incoming NIC. If no TCP module will reach the peer, then the OOB attempts to send the message via all other available components - if none can reach the peer, then an "error" is reported back to the RML, which then calls the errmgr for instructions.
* opal_buffer_t now conforms to standard object rules re OBJ_RETAIN as we no longer "unload" the incoming object
* NIC failure is reported to the TCP component, which then tries to resend the message across any other available TCP NIC. If that doesn't work, then the message is given back to the OOB base to try using other components. If all that fails, then the error is reported to the RML, which reports to the errmgr for instructions
* obviously from the above, multiple OOB components (e.g., TCP and UD) can be active in parallel
* the matching code has been moved to the RML (and out of the OOB/TCP component) so it is independent of transport
* routing is done by the individual OOB modules (as opposed to the RML). Thus, both routed and non-routed transports can simultaneously be active
* all blocking send/recv APIs have been removed. Everything operates asynchronously.
KNOWN LIMITATIONS:
* although provision is made for component failover as described above, the code for doing so has not been fully implemented yet. At the moment, if all connections for a given peer fail, the errmgr is notified of a "lost connection", which by default results in termination of the job if it was a lifeline
* the IPv6 code is present and compiles, but is not complete. Since the current IPv6 support in the OOB doesn't work anyway, I don't consider this a blocker
* routing is performed at the individual module level, yet the active routed component is selected on a global basis. We probably should update that to reflect that different transports may need/choose to route in different ways
* obviously, not every error path has been tested nor necessarily covered
* determining abnormal termination is more challenging than in the old code as we now potentially have multiple ways of connecting to a process. Ideally, we would declare "connection failed" when *all* transports can no longer reach the process, but that requires some additional (possibly complex) code. For now, the code replicates the old behavior only somewhat modified - i.e., if a module sees its connection fail, it checks to see if it is a lifeline. If so, it notifies the errmgr that the lifeline is lost - otherwise, it notifies the errmgr that a non-lifeline connection was lost.
* reachability is determined solely on the basis of a shared subnet address/mask - more sophisticated algorithms (e.g., the one used in the tcp btl) are required to handle routing via gateways
* the RML needs to assign sequence numbers to each message on a per-peer basis. The receiving RML will then deliver messages in order, thus preventing out-of-order messaging in the case where messages travel across different transports or a message needs to be redirected/resent due to failure of a NIC
This commit was SVN r29058.
2013-08-22 20:37:40 +04:00
|
|
|
job = strtoul(temp, NULL, 10);
|
2008-02-28 04:57:57 +03:00
|
|
|
}
|
2015-06-24 06:59:57 +03:00
|
|
|
|
2008-02-28 04:57:57 +03:00
|
|
|
/* check for WILDCARD character - assign
|
|
|
|
* value accordingly, if found
|
|
|
|
*/
|
|
|
|
if (0 == strcmp(token, ORTE_SCHEMA_WILDCARD_STRING)) {
|
|
|
|
vpid = ORTE_VPID_WILDCARD;
|
|
|
|
} else if (0 == strcmp(token, ORTE_SCHEMA_INVALID_STRING)) {
|
|
|
|
vpid = ORTE_VPID_INVALID;
|
|
|
|
} else {
|
|
|
|
vpid = strtoul(token, NULL, 10);
|
|
|
|
}
|
2015-06-24 06:59:57 +03:00
|
|
|
|
2008-02-28 04:57:57 +03:00
|
|
|
name->jobid = job;
|
|
|
|
name->vpid = vpid;
|
|
|
|
|
|
|
|
free(temp);
|
2015-06-24 06:59:57 +03:00
|
|
|
|
2008-02-28 04:57:57 +03:00
|
|
|
return return_code;
|
|
|
|
}
|
|
|
|
|
|
|
|
int orte_util_convert_process_name_to_string(char **name_string,
|
|
|
|
const orte_process_name_t* name)
|
|
|
|
{
|
2011-06-24 00:38:02 +04:00
|
|
|
char *tmp, *tmp2;
|
2015-06-24 06:59:57 +03:00
|
|
|
|
2008-02-28 04:57:57 +03:00
|
|
|
if (NULL == name) { /* got an error */
|
|
|
|
ORTE_ERROR_LOG(ORTE_ERR_BAD_PARAM);
|
|
|
|
return ORTE_ERR_BAD_PARAM;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* check for wildcard and invalid values - where encountered, insert the
|
|
|
|
* corresponding string so we can correctly parse the name string when
|
|
|
|
* it is passed back to us later
|
|
|
|
*/
|
|
|
|
if (ORTE_JOBID_WILDCARD == name->jobid) {
|
|
|
|
asprintf(&tmp, "%s", ORTE_SCHEMA_WILDCARD_STRING);
|
|
|
|
} else if (ORTE_JOBID_INVALID == name->jobid) {
|
|
|
|
asprintf(&tmp, "%s", ORTE_SCHEMA_INVALID_STRING);
|
|
|
|
} else {
|
|
|
|
asprintf(&tmp, "%lu", (unsigned long)name->jobid);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (ORTE_VPID_WILDCARD == name->vpid) {
|
2011-06-24 00:38:02 +04:00
|
|
|
asprintf(&tmp2, "%s%c%s", tmp, ORTE_SCHEMA_DELIMITER_CHAR, ORTE_SCHEMA_WILDCARD_STRING);
|
2008-02-28 04:57:57 +03:00
|
|
|
} else if (ORTE_VPID_INVALID == name->vpid) {
|
2011-06-24 00:38:02 +04:00
|
|
|
asprintf(&tmp2, "%s%c%s", tmp, ORTE_SCHEMA_DELIMITER_CHAR, ORTE_SCHEMA_INVALID_STRING);
|
|
|
|
} else {
|
|
|
|
asprintf(&tmp2, "%s%c%lu", tmp, ORTE_SCHEMA_DELIMITER_CHAR, (unsigned long)name->vpid);
|
|
|
|
}
|
|
|
|
|
2011-08-27 02:16:14 +04:00
|
|
|
asprintf(name_string, "%s", tmp2);
|
|
|
|
|
2008-02-28 04:57:57 +03:00
|
|
|
free(tmp);
|
2011-06-24 00:38:02 +04:00
|
|
|
free(tmp2);
|
2008-02-28 04:57:57 +03:00
|
|
|
|
|
|
|
return ORTE_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**** CREATE PROCESS NAME ****/
|
|
|
|
int orte_util_create_process_name(orte_process_name_t **name,
|
|
|
|
orte_jobid_t job,
|
2011-08-27 02:16:14 +04:00
|
|
|
orte_vpid_t vpid
|
|
|
|
)
|
2008-02-28 04:57:57 +03:00
|
|
|
{
|
|
|
|
*name = NULL;
|
2015-06-24 06:59:57 +03:00
|
|
|
|
2008-02-28 04:57:57 +03:00
|
|
|
*name = (orte_process_name_t*)malloc(sizeof(orte_process_name_t));
|
|
|
|
if (NULL == *name) { /* got an error */
|
|
|
|
ORTE_ERROR_LOG(ORTE_ERR_OUT_OF_RESOURCE);
|
|
|
|
return ORTE_ERR_OUT_OF_RESOURCE;
|
|
|
|
}
|
|
|
|
|
|
|
|
(*name)->jobid = job;
|
|
|
|
(*name)->vpid = vpid;
|
2011-08-27 02:16:14 +04:00
|
|
|
|
2008-02-28 04:57:57 +03:00
|
|
|
return ORTE_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**** COMPARE NAME FIELDS ****/
|
|
|
|
int orte_util_compare_name_fields(orte_ns_cmp_bitmask_t fields,
|
|
|
|
const orte_process_name_t* name1,
|
|
|
|
const orte_process_name_t* name2)
|
|
|
|
{
|
|
|
|
/* handle the NULL pointer case */
|
|
|
|
if (NULL == name1 && NULL == name2) {
|
|
|
|
return OPAL_EQUAL;
|
|
|
|
} else if (NULL == name1) {
|
|
|
|
return OPAL_VALUE2_GREATER;
|
|
|
|
} else if (NULL == name2) {
|
|
|
|
return OPAL_VALUE1_GREATER;
|
|
|
|
}
|
2015-06-24 06:59:57 +03:00
|
|
|
|
2008-02-28 04:57:57 +03:00
|
|
|
/* in this comparison function, we check for exact equalities.
|
2010-08-25 19:35:41 +04:00
|
|
|
* In the case of wildcards, we check to ensure that the fields
|
|
|
|
* actually match those values - thus, a "wildcard" in this
|
|
|
|
* function does not actually stand for a wildcard value, but
|
|
|
|
* rather a specific value - UNLESS the CMP_WILD bitmask value
|
|
|
|
* is set
|
|
|
|
*/
|
2015-06-24 06:59:57 +03:00
|
|
|
|
2008-02-28 04:57:57 +03:00
|
|
|
/* check job id */
|
|
|
|
if (ORTE_NS_CMP_JOBID & fields) {
|
2010-08-25 19:35:41 +04:00
|
|
|
if (ORTE_NS_CMP_WILD & fields &&
|
|
|
|
(ORTE_JOBID_WILDCARD == name1->jobid ||
|
|
|
|
ORTE_JOBID_WILDCARD == name2->jobid)) {
|
|
|
|
goto check_vpid;
|
|
|
|
}
|
2008-02-28 04:57:57 +03:00
|
|
|
if (name1->jobid < name2->jobid) {
|
|
|
|
return OPAL_VALUE2_GREATER;
|
|
|
|
} else if (name1->jobid > name2->jobid) {
|
|
|
|
return OPAL_VALUE1_GREATER;
|
|
|
|
}
|
|
|
|
}
|
2015-06-24 06:59:57 +03:00
|
|
|
|
2008-02-28 04:57:57 +03:00
|
|
|
/* get here if jobid's are equal, or not being checked
|
2010-08-25 19:35:41 +04:00
|
|
|
* now check vpid
|
|
|
|
*/
|
|
|
|
check_vpid:
|
2008-02-28 04:57:57 +03:00
|
|
|
if (ORTE_NS_CMP_VPID & fields) {
|
2010-08-25 19:35:41 +04:00
|
|
|
if (ORTE_NS_CMP_WILD & fields &&
|
|
|
|
(ORTE_VPID_WILDCARD == name1->vpid ||
|
|
|
|
ORTE_VPID_WILDCARD == name2->vpid)) {
|
|
|
|
return OPAL_EQUAL;
|
|
|
|
}
|
2008-02-28 04:57:57 +03:00
|
|
|
if (name1->vpid < name2->vpid) {
|
|
|
|
return OPAL_VALUE2_GREATER;
|
|
|
|
} else if (name1->vpid > name2->vpid) {
|
|
|
|
return OPAL_VALUE1_GREATER;
|
|
|
|
}
|
|
|
|
}
|
2011-06-24 00:38:02 +04:00
|
|
|
|
2008-02-28 04:57:57 +03:00
|
|
|
/* only way to get here is if all fields are being checked and are equal,
|
2011-06-24 00:38:02 +04:00
|
|
|
* or jobid not checked, but vpid equal,
|
|
|
|
* only vpid being checked, and equal
|
|
|
|
* return that fact
|
|
|
|
*/
|
2008-02-28 04:57:57 +03:00
|
|
|
return OPAL_EQUAL;
|
|
|
|
}
|
2008-03-06 01:44:35 +03:00
|
|
|
|
2012-06-19 17:38:42 +04:00
|
|
|
/* hash a vpid based on Robert Jenkin's algorithm - note
|
|
|
|
* that the precise values of the constants in the algo are
|
|
|
|
* irrelevant.
|
|
|
|
*/
|
|
|
|
uint32_t orte_util_hash_vpid(orte_vpid_t vpid) {
|
|
|
|
uint32_t hash;
|
2015-06-24 06:59:57 +03:00
|
|
|
|
2012-06-19 17:38:42 +04:00
|
|
|
hash = vpid;
|
|
|
|
hash = (hash + 0x7ed55d16) + (hash<<12);
|
|
|
|
hash = (hash ^ 0xc761c23c) ^ (hash>>19);
|
|
|
|
hash = (hash + 0x165667b1) + (hash<<5);
|
|
|
|
hash = (hash + 0xd3a2646c) ^ (hash<<9);
|
|
|
|
hash = (hash + 0xfd7046c5) + (hash<<3);
|
|
|
|
hash = (hash ^ 0xb55a4f09) ^ (hash>>16);
|
|
|
|
return hash;
|
|
|
|
}
|
2010-04-23 08:44:41 +04:00
|
|
|
|
2010-08-09 23:28:56 +04:00
|
|
|
/* sysinfo conversion to and from string */
|
|
|
|
int orte_util_convert_string_to_sysinfo(char **cpu_type, char **cpu_model,
|
|
|
|
const char* sysinfo_string)
|
|
|
|
{
|
|
|
|
char *temp, *token;
|
|
|
|
int return_code=ORTE_SUCCESS;
|
2015-06-24 06:59:57 +03:00
|
|
|
|
2010-08-09 23:28:56 +04:00
|
|
|
/* check for NULL string - error */
|
|
|
|
if (NULL == sysinfo_string) {
|
|
|
|
ORTE_ERROR_LOG(ORTE_ERR_BAD_PARAM);
|
|
|
|
return ORTE_ERR_BAD_PARAM;
|
|
|
|
}
|
|
|
|
|
|
|
|
temp = strdup(sysinfo_string); /** copy input string as the strtok process is destructive */
|
As per the RFC, bring in the ORTE async progress code and the rewrite of OOB:
*** THIS RFC INCLUDES A MINOR CHANGE TO THE MPI-RTE INTERFACE ***
Note: during the course of this work, it was necessary to completely separate the MPI and RTE progress engines. There were multiple places in the MPI layer where ORTE_WAIT_FOR_COMPLETION was being used. A new OMPI_WAIT_FOR_COMPLETION macro was created (defined in ompi/mca/rte/rte.h) that simply cycles across opal_progress until the provided flag becomes false. Places where the MPI layer blocked waiting for RTE to complete an event have been modified to use this macro.
***************************************************************************************
I am reissuing this RFC because of the time that has passed since its original release. Since its initial release and review, I have debugged it further to ensure it fully supports tests like loop_spawn. It therefore seems ready for merge back to the trunk. Given its prior review, I have set the timeout for one week.
The code is in https://bitbucket.org/rhc/ompi-oob2
WHAT: Rewrite of ORTE OOB
WHY: Support asynchronous progress and a host of other features
WHEN: Wed, August 21
SYNOPSIS:
The current OOB has served us well, but a number of limitations have been identified over the years. Specifically:
* it is only progressed when called via opal_progress, which can lead to hangs or recursive calls into libevent (which is not supported by that code)
* we've had issues when multiple NICs are available as the code doesn't "shift" messages between transports - thus, all nodes had to be available via the same TCP interface.
* the OOB "unloads" incoming opal_buffer_t objects during the transmission, thus preventing use of OBJ_RETAIN in the code when repeatedly sending the same message to multiple recipients
* there is no failover mechanism across NICs - if the selected NIC (or its attached switch) fails, we are forced to abort
* only one transport (i.e., component) can be "active"
The revised OOB resolves these problems:
* async progress is used for all application processes, with the progress thread blocking in the event library
* each available TCP NIC is supported by its own TCP module. The ability to asynchronously progress each module independently is provided, but not enabled by default (a runtime MCA parameter turns it "on")
* multi-address TCP NICs (e.g., a NIC with both an IPv4 and IPv6 address, or with virtual interfaces) are supported - reachability is determined by comparing the contact info for a peer against all addresses within the range covered by the address/mask pairs for the NIC.
* a message that arrives on one TCP NIC is automatically shifted to whatever NIC that is connected to the next "hop" if that peer cannot be reached by the incoming NIC. If no TCP module will reach the peer, then the OOB attempts to send the message via all other available components - if none can reach the peer, then an "error" is reported back to the RML, which then calls the errmgr for instructions.
* opal_buffer_t now conforms to standard object rules re OBJ_RETAIN as we no longer "unload" the incoming object
* NIC failure is reported to the TCP component, which then tries to resend the message across any other available TCP NIC. If that doesn't work, then the message is given back to the OOB base to try using other components. If all that fails, then the error is reported to the RML, which reports to the errmgr for instructions
* obviously from the above, multiple OOB components (e.g., TCP and UD) can be active in parallel
* the matching code has been moved to the RML (and out of the OOB/TCP component) so it is independent of transport
* routing is done by the individual OOB modules (as opposed to the RML). Thus, both routed and non-routed transports can simultaneously be active
* all blocking send/recv APIs have been removed. Everything operates asynchronously.
KNOWN LIMITATIONS:
* although provision is made for component failover as described above, the code for doing so has not been fully implemented yet. At the moment, if all connections for a given peer fail, the errmgr is notified of a "lost connection", which by default results in termination of the job if it was a lifeline
* the IPv6 code is present and compiles, but is not complete. Since the current IPv6 support in the OOB doesn't work anyway, I don't consider this a blocker
* routing is performed at the individual module level, yet the active routed component is selected on a global basis. We probably should update that to reflect that different transports may need/choose to route in different ways
* obviously, not every error path has been tested nor necessarily covered
* determining abnormal termination is more challenging than in the old code as we now potentially have multiple ways of connecting to a process. Ideally, we would declare "connection failed" when *all* transports can no longer reach the process, but that requires some additional (possibly complex) code. For now, the code replicates the old behavior only somewhat modified - i.e., if a module sees its connection fail, it checks to see if it is a lifeline. If so, it notifies the errmgr that the lifeline is lost - otherwise, it notifies the errmgr that a non-lifeline connection was lost.
* reachability is determined solely on the basis of a shared subnet address/mask - more sophisticated algorithms (e.g., the one used in the tcp btl) are required to handle routing via gateways
* the RML needs to assign sequence numbers to each message on a per-peer basis. The receiving RML will then deliver messages in order, thus preventing out-of-order messaging in the case where messages travel across different transports or a message needs to be redirected/resent due to failure of a NIC
This commit was SVN r29058.
2013-08-22 20:37:40 +04:00
|
|
|
token = strchr(temp, ORTE_SCHEMA_DELIMITER_CHAR); /** get first field -> cpu_type */
|
2015-06-24 06:59:57 +03:00
|
|
|
|
2010-08-09 23:28:56 +04:00
|
|
|
/* check for error */
|
|
|
|
if (NULL == token) {
|
2015-02-17 06:27:23 +03:00
|
|
|
free(temp);
|
2010-08-09 23:28:56 +04:00
|
|
|
ORTE_ERROR_LOG(ORTE_ERR_BAD_PARAM);
|
|
|
|
return ORTE_ERR_BAD_PARAM;
|
2015-06-24 06:59:57 +03:00
|
|
|
}
|
As per the RFC, bring in the ORTE async progress code and the rewrite of OOB:
*** THIS RFC INCLUDES A MINOR CHANGE TO THE MPI-RTE INTERFACE ***
Note: during the course of this work, it was necessary to completely separate the MPI and RTE progress engines. There were multiple places in the MPI layer where ORTE_WAIT_FOR_COMPLETION was being used. A new OMPI_WAIT_FOR_COMPLETION macro was created (defined in ompi/mca/rte/rte.h) that simply cycles across opal_progress until the provided flag becomes false. Places where the MPI layer blocked waiting for RTE to complete an event have been modified to use this macro.
***************************************************************************************
I am reissuing this RFC because of the time that has passed since its original release. Since its initial release and review, I have debugged it further to ensure it fully supports tests like loop_spawn. It therefore seems ready for merge back to the trunk. Given its prior review, I have set the timeout for one week.
The code is in https://bitbucket.org/rhc/ompi-oob2
WHAT: Rewrite of ORTE OOB
WHY: Support asynchronous progress and a host of other features
WHEN: Wed, August 21
SYNOPSIS:
The current OOB has served us well, but a number of limitations have been identified over the years. Specifically:
* it is only progressed when called via opal_progress, which can lead to hangs or recursive calls into libevent (which is not supported by that code)
* we've had issues when multiple NICs are available as the code doesn't "shift" messages between transports - thus, all nodes had to be available via the same TCP interface.
* the OOB "unloads" incoming opal_buffer_t objects during the transmission, thus preventing use of OBJ_RETAIN in the code when repeatedly sending the same message to multiple recipients
* there is no failover mechanism across NICs - if the selected NIC (or its attached switch) fails, we are forced to abort
* only one transport (i.e., component) can be "active"
The revised OOB resolves these problems:
* async progress is used for all application processes, with the progress thread blocking in the event library
* each available TCP NIC is supported by its own TCP module. The ability to asynchronously progress each module independently is provided, but not enabled by default (a runtime MCA parameter turns it "on")
* multi-address TCP NICs (e.g., a NIC with both an IPv4 and IPv6 address, or with virtual interfaces) are supported - reachability is determined by comparing the contact info for a peer against all addresses within the range covered by the address/mask pairs for the NIC.
* a message that arrives on one TCP NIC is automatically shifted to whatever NIC that is connected to the next "hop" if that peer cannot be reached by the incoming NIC. If no TCP module will reach the peer, then the OOB attempts to send the message via all other available components - if none can reach the peer, then an "error" is reported back to the RML, which then calls the errmgr for instructions.
* opal_buffer_t now conforms to standard object rules re OBJ_RETAIN as we no longer "unload" the incoming object
* NIC failure is reported to the TCP component, which then tries to resend the message across any other available TCP NIC. If that doesn't work, then the message is given back to the OOB base to try using other components. If all that fails, then the error is reported to the RML, which reports to the errmgr for instructions
* obviously from the above, multiple OOB components (e.g., TCP and UD) can be active in parallel
* the matching code has been moved to the RML (and out of the OOB/TCP component) so it is independent of transport
* routing is done by the individual OOB modules (as opposed to the RML). Thus, both routed and non-routed transports can simultaneously be active
* all blocking send/recv APIs have been removed. Everything operates asynchronously.
KNOWN LIMITATIONS:
* although provision is made for component failover as described above, the code for doing so has not been fully implemented yet. At the moment, if all connections for a given peer fail, the errmgr is notified of a "lost connection", which by default results in termination of the job if it was a lifeline
* the IPv6 code is present and compiles, but is not complete. Since the current IPv6 support in the OOB doesn't work anyway, I don't consider this a blocker
* routing is performed at the individual module level, yet the active routed component is selected on a global basis. We probably should update that to reflect that different transports may need/choose to route in different ways
* obviously, not every error path has been tested nor necessarily covered
* determining abnormal termination is more challenging than in the old code as we now potentially have multiple ways of connecting to a process. Ideally, we would declare "connection failed" when *all* transports can no longer reach the process, but that requires some additional (possibly complex) code. For now, the code replicates the old behavior only somewhat modified - i.e., if a module sees its connection fail, it checks to see if it is a lifeline. If so, it notifies the errmgr that the lifeline is lost - otherwise, it notifies the errmgr that a non-lifeline connection was lost.
* reachability is determined solely on the basis of a shared subnet address/mask - more sophisticated algorithms (e.g., the one used in the tcp btl) are required to handle routing via gateways
* the RML needs to assign sequence numbers to each message on a per-peer basis. The receiving RML will then deliver messages in order, thus preventing out-of-order messaging in the case where messages travel across different transports or a message needs to be redirected/resent due to failure of a NIC
This commit was SVN r29058.
2013-08-22 20:37:40 +04:00
|
|
|
*token = '\0';
|
|
|
|
token++;
|
|
|
|
|
2010-08-09 23:28:56 +04:00
|
|
|
/* If type is a valid string get the value otherwise leave cpu_type untouched.
|
|
|
|
*/
|
As per the RFC, bring in the ORTE async progress code and the rewrite of OOB:
*** THIS RFC INCLUDES A MINOR CHANGE TO THE MPI-RTE INTERFACE ***
Note: during the course of this work, it was necessary to completely separate the MPI and RTE progress engines. There were multiple places in the MPI layer where ORTE_WAIT_FOR_COMPLETION was being used. A new OMPI_WAIT_FOR_COMPLETION macro was created (defined in ompi/mca/rte/rte.h) that simply cycles across opal_progress until the provided flag becomes false. Places where the MPI layer blocked waiting for RTE to complete an event have been modified to use this macro.
***************************************************************************************
I am reissuing this RFC because of the time that has passed since its original release. Since its initial release and review, I have debugged it further to ensure it fully supports tests like loop_spawn. It therefore seems ready for merge back to the trunk. Given its prior review, I have set the timeout for one week.
The code is in https://bitbucket.org/rhc/ompi-oob2
WHAT: Rewrite of ORTE OOB
WHY: Support asynchronous progress and a host of other features
WHEN: Wed, August 21
SYNOPSIS:
The current OOB has served us well, but a number of limitations have been identified over the years. Specifically:
* it is only progressed when called via opal_progress, which can lead to hangs or recursive calls into libevent (which is not supported by that code)
* we've had issues when multiple NICs are available as the code doesn't "shift" messages between transports - thus, all nodes had to be available via the same TCP interface.
* the OOB "unloads" incoming opal_buffer_t objects during the transmission, thus preventing use of OBJ_RETAIN in the code when repeatedly sending the same message to multiple recipients
* there is no failover mechanism across NICs - if the selected NIC (or its attached switch) fails, we are forced to abort
* only one transport (i.e., component) can be "active"
The revised OOB resolves these problems:
* async progress is used for all application processes, with the progress thread blocking in the event library
* each available TCP NIC is supported by its own TCP module. The ability to asynchronously progress each module independently is provided, but not enabled by default (a runtime MCA parameter turns it "on")
* multi-address TCP NICs (e.g., a NIC with both an IPv4 and IPv6 address, or with virtual interfaces) are supported - reachability is determined by comparing the contact info for a peer against all addresses within the range covered by the address/mask pairs for the NIC.
* a message that arrives on one TCP NIC is automatically shifted to whatever NIC that is connected to the next "hop" if that peer cannot be reached by the incoming NIC. If no TCP module will reach the peer, then the OOB attempts to send the message via all other available components - if none can reach the peer, then an "error" is reported back to the RML, which then calls the errmgr for instructions.
* opal_buffer_t now conforms to standard object rules re OBJ_RETAIN as we no longer "unload" the incoming object
* NIC failure is reported to the TCP component, which then tries to resend the message across any other available TCP NIC. If that doesn't work, then the message is given back to the OOB base to try using other components. If all that fails, then the error is reported to the RML, which reports to the errmgr for instructions
* obviously from the above, multiple OOB components (e.g., TCP and UD) can be active in parallel
* the matching code has been moved to the RML (and out of the OOB/TCP component) so it is independent of transport
* routing is done by the individual OOB modules (as opposed to the RML). Thus, both routed and non-routed transports can simultaneously be active
* all blocking send/recv APIs have been removed. Everything operates asynchronously.
KNOWN LIMITATIONS:
* although provision is made for component failover as described above, the code for doing so has not been fully implemented yet. At the moment, if all connections for a given peer fail, the errmgr is notified of a "lost connection", which by default results in termination of the job if it was a lifeline
* the IPv6 code is present and compiles, but is not complete. Since the current IPv6 support in the OOB doesn't work anyway, I don't consider this a blocker
* routing is performed at the individual module level, yet the active routed component is selected on a global basis. We probably should update that to reflect that different transports may need/choose to route in different ways
* obviously, not every error path has been tested nor necessarily covered
* determining abnormal termination is more challenging than in the old code as we now potentially have multiple ways of connecting to a process. Ideally, we would declare "connection failed" when *all* transports can no longer reach the process, but that requires some additional (possibly complex) code. For now, the code replicates the old behavior only somewhat modified - i.e., if a module sees its connection fail, it checks to see if it is a lifeline. If so, it notifies the errmgr that the lifeline is lost - otherwise, it notifies the errmgr that a non-lifeline connection was lost.
* reachability is determined solely on the basis of a shared subnet address/mask - more sophisticated algorithms (e.g., the one used in the tcp btl) are required to handle routing via gateways
* the RML needs to assign sequence numbers to each message on a per-peer basis. The receiving RML will then deliver messages in order, thus preventing out-of-order messaging in the case where messages travel across different transports or a message needs to be redirected/resent due to failure of a NIC
This commit was SVN r29058.
2013-08-22 20:37:40 +04:00
|
|
|
if (0 != strcmp(temp, ORTE_SCHEMA_INVALID_STRING)) {
|
|
|
|
*cpu_type = strdup(temp);
|
2015-06-24 06:59:57 +03:00
|
|
|
}
|
2010-08-09 23:28:56 +04:00
|
|
|
|
|
|
|
/* If type is a valid string get the value otherwise leave cpu_type untouched.
|
|
|
|
*/
|
|
|
|
if (0 != strcmp(token, ORTE_SCHEMA_INVALID_STRING)) {
|
|
|
|
*cpu_model = strdup(token);
|
2015-06-24 06:59:57 +03:00
|
|
|
}
|
2010-08-09 23:28:56 +04:00
|
|
|
|
|
|
|
free(temp);
|
|
|
|
|
|
|
|
return return_code;
|
|
|
|
}
|
|
|
|
|
|
|
|
int orte_util_convert_sysinfo_to_string(char **sysinfo_string,
|
|
|
|
const char *cpu_type, const char *cpu_model)
|
|
|
|
{
|
|
|
|
char *tmp;
|
2015-06-24 06:59:57 +03:00
|
|
|
|
2010-08-09 23:28:56 +04:00
|
|
|
/* check for no sysinfo values (like empty cpu_type) - where encountered, insert the
|
|
|
|
* invalid string so we can correctly parse the name string when
|
|
|
|
* it is passed back to us later
|
|
|
|
*/
|
|
|
|
if (NULL == cpu_type) {
|
|
|
|
asprintf(&tmp, "%s", ORTE_SCHEMA_INVALID_STRING);
|
|
|
|
} else {
|
|
|
|
asprintf(&tmp, "%s", cpu_type);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (NULL == cpu_model) {
|
|
|
|
asprintf(sysinfo_string, "%s%c%s", tmp, ORTE_SCHEMA_DELIMITER_CHAR, ORTE_SCHEMA_INVALID_STRING);
|
|
|
|
} else {
|
|
|
|
asprintf(sysinfo_string, "%s%c%s", tmp, ORTE_SCHEMA_DELIMITER_CHAR, cpu_model);
|
|
|
|
}
|
|
|
|
free(tmp);
|
|
|
|
return ORTE_SUCCESS;
|
|
|
|
}
|
|
|
|
|
2010-04-23 08:44:41 +04:00
|
|
|
char *orte_pretty_print_timing(int64_t secs, int64_t usecs)
|
|
|
|
{
|
|
|
|
unsigned long minutes, seconds;
|
|
|
|
float fsecs;
|
|
|
|
char *timestring;
|
2015-06-24 06:59:57 +03:00
|
|
|
|
2010-04-23 08:44:41 +04:00
|
|
|
seconds = secs + (usecs / 1000000l);
|
|
|
|
minutes = seconds / 60l;
|
|
|
|
seconds = seconds % 60l;
|
|
|
|
if (0 == minutes && 0 == seconds) {
|
|
|
|
fsecs = ((float)(secs)*1000000.0 + (float)usecs) / 1000.0;
|
|
|
|
asprintf(×tring, "%8.2f millisecs", fsecs);
|
|
|
|
} else {
|
|
|
|
asprintf(×tring, "%3lu:%02lu min:sec", minutes, seconds);
|
|
|
|
}
|
2015-06-24 06:59:57 +03:00
|
|
|
|
2010-04-23 08:44:41 +04:00
|
|
|
return timestring;
|
|
|
|
}
|
|
|
|
|
|
|
|
|