2005-06-17 21:12:50 +00:00
|
|
|
/*
|
2005-11-05 19:57:48 +00:00
|
|
|
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
|
|
|
|
* University Research and Technology
|
|
|
|
* Corporation. All rights reserved.
|
|
|
|
* Copyright (c) 2004-2005 The University of Tennessee and The University
|
|
|
|
* of Tennessee Research Foundation. All rights
|
|
|
|
* reserved.
|
2005-06-17 21:12:50 +00:00
|
|
|
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
|
|
|
* University of Stuttgart. All rights reserved.
|
|
|
|
* Copyright (c) 2004-2005 The Regents of the University of California.
|
|
|
|
* All rights reserved.
|
|
|
|
* $COPYRIGHT$
|
|
|
|
*
|
|
|
|
* Additional copyrights may follow
|
|
|
|
*
|
|
|
|
* $HEADER$
|
2005-07-27 23:18:16 +00:00
|
|
|
*
|
2005-06-17 21:12:50 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include "orte_config.h"
|
2005-11-17 22:02:28 +00:00
|
|
|
#include <sys/bproc.h>
|
2005-07-27 23:18:16 +00:00
|
|
|
|
2006-02-12 01:33:29 +00:00
|
|
|
#include "orte/orte_constants.h"
|
2005-11-17 22:02:28 +00:00
|
|
|
#include "orte/util/sys_info.h"
|
2005-11-28 23:13:36 +00:00
|
|
|
#include "opal/util/output.h"
|
Bring in the code for routing xcast stage gate messages via the local orteds. This code is inactive unless you specifically request it via an mca param oob_xcast_mode (can be set to "linear" or "direct"). Direct mode is the old standard method where we send messages directly to each MPI process. Linear mode sends the xcast message via the orteds, with the HNP sending the message to each orted directly.
There is a binomial algorithm in the code (i.e., the HNP would send to a subset of the orteds, which then relay it on according to the typical log-2 algo), but that has a bug in it so the code won't let you select it even if you tried (and the mca param doesn't show, so you'd *really* have to try).
This also involved a slight change to the oob.xcast API, so propagated that as required.
Note: this has *only* been tested on rsh, SLURM, and Bproc environments (now that it has been transferred to the OMPI trunk, I'll need to re-test it [only done rsh so far]). It should work fine on any environment that uses the ORTE daemons - anywhere else, you are on your own... :-)
Also, correct a mistake where the orte_debug_flag was declared an int, but the mca param was set as a bool. Move the storage for that flag to the orte/runtime/params.c and orte/runtime/params.h files appropriately.
This commit was SVN r14475.
2007-04-23 18:41:04 +00:00
|
|
|
#include "opal/util/os_path.h"
|
2006-02-12 01:33:29 +00:00
|
|
|
#include "opal/mca/base/mca_base_param.h"
|
Bring in the code for routing xcast stage gate messages via the local orteds. This code is inactive unless you specifically request it via an mca param oob_xcast_mode (can be set to "linear" or "direct"). Direct mode is the old standard method where we send messages directly to each MPI process. Linear mode sends the xcast message via the orteds, with the HNP sending the message to each orted directly.
There is a binomial algorithm in the code (i.e., the HNP would send to a subset of the orteds, which then relay it on according to the typical log-2 algo), but that has a bug in it so the code won't let you select it even if you tried (and the mca param doesn't show, so you'd *really* have to try).
This also involved a slight change to the oob.xcast API, so propagated that as required.
Note: this has *only* been tested on rsh, SLURM, and Bproc environments (now that it has been transferred to the OMPI trunk, I'll need to re-test it [only done rsh so far]). It should work fine on any environment that uses the ORTE daemons - anywhere else, you are on your own... :-)
Also, correct a mistake where the orte_debug_flag was declared an int, but the mca param was set as a bool. Move the storage for that flag to the orte/runtime/params.c and orte/runtime/params.h files appropriately.
This commit was SVN r14475.
2007-04-23 18:41:04 +00:00
|
|
|
|
2006-02-12 01:33:29 +00:00
|
|
|
#include "orte/mca/sds/sds.h"
|
|
|
|
#include "orte/mca/sds/base/base.h"
|
|
|
|
#include "orte/mca/sds/bproc/sds_bproc.h"
|
|
|
|
#include "orte/mca/ns/ns.h"
|
|
|
|
#include "orte/mca/ns/base/base.h"
|
|
|
|
#include "orte/mca/errmgr/base/base.h"
|
Bring in the code for routing xcast stage gate messages via the local orteds. This code is inactive unless you specifically request it via an mca param oob_xcast_mode (can be set to "linear" or "direct"). Direct mode is the old standard method where we send messages directly to each MPI process. Linear mode sends the xcast message via the orteds, with the HNP sending the message to each orted directly.
There is a binomial algorithm in the code (i.e., the HNP would send to a subset of the orteds, which then relay it on according to the typical log-2 algo), but that has a bug in it so the code won't let you select it even if you tried (and the mca param doesn't show, so you'd *really* have to try).
This also involved a slight change to the oob.xcast API, so propagated that as required.
Note: this has *only* been tested on rsh, SLURM, and Bproc environments (now that it has been transferred to the OMPI trunk, I'll need to re-test it [only done rsh so far]). It should work fine on any environment that uses the ORTE daemons - anywhere else, you are on your own... :-)
Also, correct a mistake where the orte_debug_flag was declared an int, but the mca param was set as a bool. Move the storage for that flag to the orte/runtime/params.c and orte/runtime/params.h files appropriately.
This commit was SVN r14475.
2007-04-23 18:41:04 +00:00
|
|
|
#include "orte/util/session_dir.h"
|
2005-06-17 21:12:50 +00:00
|
|
|
|
2005-08-02 18:51:28 +00:00
|
|
|
orte_sds_base_module_t orte_sds_bproc_module = {
|
2005-07-27 23:18:16 +00:00
|
|
|
orte_sds_base_basic_contact_universe,
|
|
|
|
orte_sds_bproc_set_name,
|
|
|
|
orte_sds_bproc_finalize,
|
|
|
|
};
|
2005-06-17 21:12:50 +00:00
|
|
|
|
2005-08-08 22:17:22 +00:00
|
|
|
/**
|
|
|
|
* Sets up the process name from the information put into the environment
|
|
|
|
* by the bproc launcher and orte_ns_nds_bproc_put.
|
|
|
|
* @retval ORTE_SUCCESS
|
|
|
|
* @retval error
|
|
|
|
*/
|
|
|
|
int orte_sds_bproc_set_name(void)
|
2005-07-27 23:18:16 +00:00
|
|
|
{
|
2005-06-17 21:12:50 +00:00
|
|
|
int rc;
|
|
|
|
int id;
|
Bring in the code for routing xcast stage gate messages via the local orteds. This code is inactive unless you specifically request it via an mca param oob_xcast_mode (can be set to "linear" or "direct"). Direct mode is the old standard method where we send messages directly to each MPI process. Linear mode sends the xcast message via the orteds, with the HNP sending the message to each orted directly.
There is a binomial algorithm in the code (i.e., the HNP would send to a subset of the orteds, which then relay it on according to the typical log-2 algo), but that has a bug in it so the code won't let you select it even if you tried (and the mca param doesn't show, so you'd *really* have to try).
This also involved a slight change to the oob.xcast API, so propagated that as required.
Note: this has *only* been tested on rsh, SLURM, and Bproc environments (now that it has been transferred to the OMPI trunk, I'll need to re-test it [only done rsh so far]). It should work fine on any environment that uses the ORTE daemons - anywhere else, you are on your own... :-)
Also, correct a mistake where the orte_debug_flag was declared an int, but the mca param was set as a bool. Move the storage for that flag to the orte/runtime/params.c and orte/runtime/params.h files appropriately.
This commit was SVN r14475.
2007-04-23 18:41:04 +00:00
|
|
|
char *name_string = NULL;
|
|
|
|
char *jobid_string;
|
|
|
|
char *vpid_string;
|
|
|
|
char orted_uri[1024];
|
|
|
|
bool cleanup_jobid_string, cleanup_vpid_string;
|
|
|
|
char *session_dir;
|
|
|
|
char *uri_file;
|
|
|
|
FILE *fp;
|
Compute and pass the local_rank and local number of procs (in that proc's job) on the node.
To be precise, given this hypothetical launching pattern:
host1: vpids 0, 2, 4, 6
host2: vpids 1, 3, 5, 7
The local_rank for these procs would be:
host1: vpids 0->local_rank 0, v2->lr1, v4->lr2, v6->lr3
host2: vpids 1->local_rank 0, v3->lr1, v5->lr2, v7->lr3
and the number of local procs on each node would be four. If vpid=0 then does a comm_spawn of one process on host1, the values of the parent job would remain unchanged. The local_rank of the child process would be 0 and its num_local_procs would be 1 since it is in a separate jobid.
I have verified this functionality for the rsh case - need to verify that slurm and other cases also get the right values. Some consolidation of common code is probably going to occur in the SDS components to make this simpler and more maintainable in the future.
This commit was SVN r14706.
2007-05-21 14:30:10 +00:00
|
|
|
int local_rank;
|
|
|
|
int num_local_procs;
|
Bring in the code for routing xcast stage gate messages via the local orteds. This code is inactive unless you specifically request it via an mca param oob_xcast_mode (can be set to "linear" or "direct"). Direct mode is the old standard method where we send messages directly to each MPI process. Linear mode sends the xcast message via the orteds, with the HNP sending the message to each orted directly.
There is a binomial algorithm in the code (i.e., the HNP would send to a subset of the orteds, which then relay it on according to the typical log-2 algo), but that has a bug in it so the code won't let you select it even if you tried (and the mca param doesn't show, so you'd *really* have to try).
This also involved a slight change to the oob.xcast API, so propagated that as required.
Note: this has *only* been tested on rsh, SLURM, and Bproc environments (now that it has been transferred to the OMPI trunk, I'll need to re-test it [only done rsh so far]). It should work fine on any environment that uses the ORTE daemons - anywhere else, you are on your own... :-)
Also, correct a mistake where the orte_debug_flag was declared an int, but the mca param was set as a bool. Move the storage for that flag to the orte/runtime/params.c and orte/runtime/params.h files appropriately.
This commit was SVN r14475.
2007-04-23 18:41:04 +00:00
|
|
|
|
2005-06-17 21:12:50 +00:00
|
|
|
id = mca_base_param_register_string("ns", "nds", "name", NULL, NULL);
|
|
|
|
mca_base_param_lookup_string(id, &name_string);
|
|
|
|
if(name_string != NULL) {
|
Bring over the update to terminate orteds that are generated by a dynamic spawn such as comm_spawn. This introduces the concept of a job "family" - i.e., jobs that have a parent/child relationship. Comm_spawn'ed jobs have a parent (the one that spawned them). We track that relationship throughout the lineage - i.e., if a comm_spawned job in turn calls comm_spawn, then it has a parent (the one that spawned it) and a "root" job (the original job that started things).
Accordingly, there are new APIs to the name service to support the ability to get a job's parent, root, immediate children, and all its descendants. In addition, the terminate_job, terminate_orted, and signal_job APIs for the PLS have been modified to accept attributes that define the extent of their actions. For example, doing a "terminate_job" with an attribute of ORTE_NS_INCLUDE_DESCENDANTS will terminate the given jobid AND all jobs that descended from it.
I have tested this capability on a MacBook under rsh, Odin under SLURM, and LANL's Flash (bproc). It worked successfully on non-MPI jobs (both simple and including a spawn), and MPI jobs (again, both simple and with a spawn).
This commit was SVN r12597.
2006-11-14 19:34:59 +00:00
|
|
|
if (ORTE_SUCCESS != (rc = orte_ns.convert_string_to_process_name(
|
2005-06-17 21:12:50 +00:00
|
|
|
&(orte_process_info.my_name),
|
|
|
|
name_string))) {
|
|
|
|
ORTE_ERROR_LOG(rc);
|
|
|
|
free(name_string);
|
|
|
|
return rc;
|
|
|
|
}
|
|
|
|
free(name_string);
|
|
|
|
|
Bring in the code for routing xcast stage gate messages via the local orteds. This code is inactive unless you specifically request it via an mca param oob_xcast_mode (can be set to "linear" or "direct"). Direct mode is the old standard method where we send messages directly to each MPI process. Linear mode sends the xcast message via the orteds, with the HNP sending the message to each orted directly.
There is a binomial algorithm in the code (i.e., the HNP would send to a subset of the orteds, which then relay it on according to the typical log-2 algo), but that has a bug in it so the code won't let you select it even if you tried (and the mca param doesn't show, so you'd *really* have to try).
This also involved a slight change to the oob.xcast API, so propagated that as required.
Note: this has *only* been tested on rsh, SLURM, and Bproc environments (now that it has been transferred to the OMPI trunk, I'll need to re-test it [only done rsh so far]). It should work fine on any environment that uses the ORTE daemons - anywhere else, you are on your own... :-)
Also, correct a mistake where the orte_debug_flag was declared an int, but the mca param was set as a bool. Move the storage for that flag to the orte/runtime/params.c and orte/runtime/params.h files appropriately.
This commit was SVN r14475.
2007-04-23 18:41:04 +00:00
|
|
|
/* get the jobid and vpid strings for use later */
|
|
|
|
if (ORTE_SUCCESS != (rc = orte_ns.get_jobid_string(&jobid_string, ORTE_PROC_MY_NAME))) {
|
|
|
|
ORTE_ERROR_LOG(rc);
|
|
|
|
return rc;
|
|
|
|
}
|
|
|
|
if (ORTE_SUCCESS != (rc = orte_ns.get_vpid_string(&vpid_string, ORTE_PROC_MY_NAME))) {
|
|
|
|
ORTE_ERROR_LOG(rc);
|
|
|
|
return rc;
|
|
|
|
}
|
|
|
|
cleanup_jobid_string = true;
|
|
|
|
cleanup_vpid_string = true;
|
|
|
|
|
2005-06-17 21:12:50 +00:00
|
|
|
} else {
|
|
|
|
|
|
|
|
orte_cellid_t cellid;
|
|
|
|
orte_jobid_t jobid;
|
|
|
|
orte_vpid_t vpid;
|
2005-08-02 22:22:55 +00:00
|
|
|
orte_vpid_t vpid_start;
|
2005-06-17 21:12:50 +00:00
|
|
|
char* cellid_string;
|
2005-08-02 22:22:55 +00:00
|
|
|
int num_procs;
|
2006-08-11 19:41:33 +00:00
|
|
|
char *bproc_rank_string;
|
|
|
|
int bproc_rank;
|
|
|
|
int stride;
|
2005-06-17 21:12:50 +00:00
|
|
|
|
|
|
|
id = mca_base_param_register_string("ns", "nds", "cellid", NULL, NULL);
|
|
|
|
mca_base_param_lookup_string(id, &cellid_string);
|
|
|
|
if (NULL == cellid_string) {
|
|
|
|
ORTE_ERROR_LOG(ORTE_ERR_NOT_FOUND);
|
|
|
|
return ORTE_ERR_NOT_FOUND;
|
|
|
|
}
|
|
|
|
if (ORTE_SUCCESS != (rc = orte_ns.convert_string_to_cellid(&cellid, cellid_string))) {
|
|
|
|
ORTE_ERROR_LOG(rc);
|
|
|
|
return(rc);
|
|
|
|
}
|
|
|
|
|
|
|
|
id = mca_base_param_register_string("ns", "nds", "jobid", NULL, NULL);
|
|
|
|
mca_base_param_lookup_string(id, &jobid_string);
|
|
|
|
if (NULL == jobid_string) {
|
|
|
|
ORTE_ERROR_LOG(ORTE_ERR_NOT_FOUND);
|
|
|
|
return ORTE_ERR_NOT_FOUND;
|
|
|
|
}
|
|
|
|
if (ORTE_SUCCESS != (rc = orte_ns.convert_string_to_jobid(&jobid, jobid_string))) {
|
|
|
|
ORTE_ERROR_LOG(rc);
|
|
|
|
return(rc);
|
|
|
|
}
|
Bring in the code for routing xcast stage gate messages via the local orteds. This code is inactive unless you specifically request it via an mca param oob_xcast_mode (can be set to "linear" or "direct"). Direct mode is the old standard method where we send messages directly to each MPI process. Linear mode sends the xcast message via the orteds, with the HNP sending the message to each orted directly.
There is a binomial algorithm in the code (i.e., the HNP would send to a subset of the orteds, which then relay it on according to the typical log-2 algo), but that has a bug in it so the code won't let you select it even if you tried (and the mca param doesn't show, so you'd *really* have to try).
This also involved a slight change to the oob.xcast API, so propagated that as required.
Note: this has *only* been tested on rsh, SLURM, and Bproc environments (now that it has been transferred to the OMPI trunk, I'll need to re-test it [only done rsh so far]). It should work fine on any environment that uses the ORTE daemons - anywhere else, you are on your own... :-)
Also, correct a mistake where the orte_debug_flag was declared an int, but the mca param was set as a bool. Move the storage for that flag to the orte/runtime/params.c and orte/runtime/params.h files appropriately.
This commit was SVN r14475.
2007-04-23 18:41:04 +00:00
|
|
|
cleanup_jobid_string = false;
|
2005-06-17 21:12:50 +00:00
|
|
|
|
2006-08-11 19:41:33 +00:00
|
|
|
/* BPROC_RANK is set by bproc when we do a parallel launch */
|
|
|
|
bproc_rank_string = getenv("BPROC_RANK");
|
|
|
|
if (NULL == bproc_rank_string) {
|
2005-07-13 19:46:55 +00:00
|
|
|
opal_output(0, "orte_ns_nds_bproc_get: Error: Environment variable "
|
|
|
|
"BPROC_RANK not found.\n");
|
2005-06-17 21:12:50 +00:00
|
|
|
ORTE_ERROR_LOG(ORTE_ERR_NOT_FOUND);
|
|
|
|
return ORTE_ERR_NOT_FOUND;
|
|
|
|
}
|
2006-08-11 19:41:33 +00:00
|
|
|
bproc_rank = (int)strtol(bproc_rank_string, NULL, 10);
|
|
|
|
|
|
|
|
/* to compute our process name, we need to know two other things: the
|
|
|
|
* stride (i.e., the size of the step between vpids in this launch
|
|
|
|
* wave) and the starting vpid of this launch. Get those values here
|
|
|
|
*/
|
|
|
|
id = mca_base_param_register_int("pls", "bproc", "stride", NULL, -1);
|
|
|
|
mca_base_param_lookup_int(id, &stride);
|
|
|
|
if (stride < 0) {
|
|
|
|
ORTE_ERROR_LOG(ORTE_ERR_NOT_FOUND);
|
|
|
|
return ORTE_ERR_NOT_FOUND;
|
2005-06-17 21:12:50 +00:00
|
|
|
}
|
2006-08-11 19:41:33 +00:00
|
|
|
|
2005-08-02 22:22:55 +00:00
|
|
|
id = mca_base_param_register_string("ns", "nds", "vpid_start", NULL, NULL);
|
|
|
|
mca_base_param_lookup_string(id, &vpid_string);
|
|
|
|
if (NULL == vpid_string) {
|
2005-06-17 21:12:50 +00:00
|
|
|
ORTE_ERROR_LOG(ORTE_ERR_NOT_FOUND);
|
|
|
|
return ORTE_ERR_NOT_FOUND;
|
|
|
|
}
|
2005-08-02 22:22:55 +00:00
|
|
|
rc = orte_ns.convert_string_to_vpid(&vpid_start, vpid_string);
|
|
|
|
if (ORTE_SUCCESS != rc) {
|
|
|
|
ORTE_ERROR_LOG(rc);
|
|
|
|
return(rc);
|
|
|
|
}
|
2005-06-17 21:12:50 +00:00
|
|
|
|
2006-08-11 19:41:33 +00:00
|
|
|
/* compute our vpid */
|
|
|
|
vpid = vpid_start + (bproc_rank * stride);
|
|
|
|
|
|
|
|
/* create our name */
|
2005-06-17 21:12:50 +00:00
|
|
|
if (ORTE_SUCCESS != (rc = orte_ns.create_process_name(
|
|
|
|
&(orte_process_info.my_name),
|
|
|
|
cellid,
|
|
|
|
jobid,
|
|
|
|
vpid))) {
|
|
|
|
ORTE_ERROR_LOG(rc);
|
|
|
|
return rc;
|
|
|
|
}
|
|
|
|
|
2005-08-02 22:22:55 +00:00
|
|
|
id = mca_base_param_register_int("ns", "nds", "num_procs", NULL, -1);
|
|
|
|
mca_base_param_lookup_int(id, &num_procs);
|
|
|
|
if (num_procs < 0) {
|
|
|
|
ORTE_ERROR_LOG(ORTE_ERR_NOT_FOUND);
|
|
|
|
return ORTE_ERR_NOT_FOUND;
|
|
|
|
}
|
Compute and pass the local_rank and local number of procs (in that proc's job) on the node.
To be precise, given this hypothetical launching pattern:
host1: vpids 0, 2, 4, 6
host2: vpids 1, 3, 5, 7
The local_rank for these procs would be:
host1: vpids 0->local_rank 0, v2->lr1, v4->lr2, v6->lr3
host2: vpids 1->local_rank 0, v3->lr1, v5->lr2, v7->lr3
and the number of local procs on each node would be four. If vpid=0 then does a comm_spawn of one process on host1, the values of the parent job would remain unchanged. The local_rank of the child process would be 0 and its num_local_procs would be 1 since it is in a separate jobid.
I have verified this functionality for the rsh case - need to verify that slurm and other cases also get the right values. Some consolidation of common code is probably going to occur in the SDS components to make this simpler and more maintainable in the future.
This commit was SVN r14706.
2007-05-21 14:30:10 +00:00
|
|
|
orte_process_info.num_procs = (orte_std_cntr_t)num_procs;
|
2005-06-17 21:12:50 +00:00
|
|
|
|
2005-08-02 22:22:55 +00:00
|
|
|
id = mca_base_param_register_string("ns", "nds", "global_vpid_start", NULL, NULL);
|
|
|
|
mca_base_param_lookup_string(id, &vpid_string);
|
|
|
|
if (NULL == vpid_string) {
|
|
|
|
ORTE_ERROR_LOG(ORTE_ERR_NOT_FOUND);
|
|
|
|
return ORTE_ERR_NOT_FOUND;
|
|
|
|
}
|
|
|
|
rc = orte_ns.convert_string_to_vpid(&orte_process_info.vpid_start, vpid_string);
|
|
|
|
if (ORTE_SUCCESS != rc) {
|
|
|
|
ORTE_ERROR_LOG(rc);
|
|
|
|
return(rc);
|
|
|
|
}
|
2005-11-17 22:02:28 +00:00
|
|
|
|
|
|
|
if(NULL != orte_system_info.nodename)
|
|
|
|
free(orte_system_info.nodename);
|
|
|
|
asprintf(&orte_system_info.nodename, "%d", bproc_currnode());
|
Bring in the code for routing xcast stage gate messages via the local orteds. This code is inactive unless you specifically request it via an mca param oob_xcast_mode (can be set to "linear" or "direct"). Direct mode is the old standard method where we send messages directly to each MPI process. Linear mode sends the xcast message via the orteds, with the HNP sending the message to each orted directly.
There is a binomial algorithm in the code (i.e., the HNP would send to a subset of the orteds, which then relay it on according to the typical log-2 algo), but that has a bug in it so the code won't let you select it even if you tried (and the mca param doesn't show, so you'd *really* have to try).
This also involved a slight change to the oob.xcast API, so propagated that as required.
Note: this has *only* been tested on rsh, SLURM, and Bproc environments (now that it has been transferred to the OMPI trunk, I'll need to re-test it [only done rsh so far]). It should work fine on any environment that uses the ORTE daemons - anywhere else, you are on your own... :-)
Also, correct a mistake where the orte_debug_flag was declared an int, but the mca param was set as a bool. Move the storage for that flag to the orte/runtime/params.c and orte/runtime/params.h files appropriately.
This commit was SVN r14475.
2007-04-23 18:41:04 +00:00
|
|
|
|
|
|
|
/* ensure the vpid is in the vpid_string in case we need it later */
|
|
|
|
if (ORTE_SUCCESS != (rc = orte_ns.get_vpid_string(&vpid_string, ORTE_PROC_MY_NAME))) {
|
|
|
|
ORTE_ERROR_LOG(rc);
|
|
|
|
return rc;
|
|
|
|
}
|
|
|
|
cleanup_vpid_string = true;
|
|
|
|
}
|
|
|
|
|
Compute and pass the local_rank and local number of procs (in that proc's job) on the node.
To be precise, given this hypothetical launching pattern:
host1: vpids 0, 2, 4, 6
host2: vpids 1, 3, 5, 7
The local_rank for these procs would be:
host1: vpids 0->local_rank 0, v2->lr1, v4->lr2, v6->lr3
host2: vpids 1->local_rank 0, v3->lr1, v5->lr2, v7->lr3
and the number of local procs on each node would be four. If vpid=0 then does a comm_spawn of one process on host1, the values of the parent job would remain unchanged. The local_rank of the child process would be 0 and its num_local_procs would be 1 since it is in a separate jobid.
I have verified this functionality for the rsh case - need to verify that slurm and other cases also get the right values. Some consolidation of common code is probably going to occur in the SDS components to make this simpler and more maintainable in the future.
This commit was SVN r14706.
2007-05-21 14:30:10 +00:00
|
|
|
/* it is okay for this param not to be found - for example, we don't bother
|
|
|
|
* to set it for orteds - so just set it to an invalid value which indicates
|
|
|
|
* it wasn't found if it isn't there
|
|
|
|
*/
|
|
|
|
id = mca_base_param_register_int("ns", "nds", "local_rank", NULL, ORTE_VPID_INVALID);
|
|
|
|
mca_base_param_lookup_int(id, &local_rank);
|
|
|
|
orte_process_info.local_rank = (orte_vpid_t)local_rank;
|
|
|
|
|
|
|
|
/* it is okay for this param not to be found - for example, we don't bother
|
|
|
|
* to set it for orteds - so just set it to a value which indicates
|
|
|
|
* it wasn't found if it isn't there
|
|
|
|
*/
|
|
|
|
id = mca_base_param_register_int("ns", "nds", "num_local_procs", NULL, 0);
|
|
|
|
mca_base_param_lookup_int(id, &num_local_procs);
|
|
|
|
orte_process_info.num_local_procs = (orte_std_cntr_t)num_local_procs;
|
|
|
|
|
Bring in the code for routing xcast stage gate messages via the local orteds. This code is inactive unless you specifically request it via an mca param oob_xcast_mode (can be set to "linear" or "direct"). Direct mode is the old standard method where we send messages directly to each MPI process. Linear mode sends the xcast message via the orteds, with the HNP sending the message to each orted directly.
There is a binomial algorithm in the code (i.e., the HNP would send to a subset of the orteds, which then relay it on according to the typical log-2 algo), but that has a bug in it so the code won't let you select it even if you tried (and the mca param doesn't show, so you'd *really* have to try).
This also involved a slight change to the oob.xcast API, so propagated that as required.
Note: this has *only* been tested on rsh, SLURM, and Bproc environments (now that it has been transferred to the OMPI trunk, I'll need to re-test it [only done rsh so far]). It should work fine on any environment that uses the ORTE daemons - anywhere else, you are on your own... :-)
Also, correct a mistake where the orte_debug_flag was declared an int, but the mca param was set as a bool. Move the storage for that flag to the orte/runtime/params.c and orte/runtime/params.h files appropriately.
This commit was SVN r14475.
2007-04-23 18:41:04 +00:00
|
|
|
/* if we are NOT a daemon, then lookup our local daemon's contact info
|
|
|
|
* and setup that link
|
|
|
|
*/
|
|
|
|
if (!orte_process_info.daemon) {
|
|
|
|
/* get the session dir name so we can find the file there */
|
|
|
|
if (ORTE_SUCCESS != (rc = orte_session_dir_get_name(&session_dir, NULL, NULL, NULL,
|
|
|
|
NULL, NULL, NULL, jobid_string, vpid_string))) {
|
|
|
|
ORTE_ERROR_LOG(rc);
|
|
|
|
return rc;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* find the file and get the local orted's uri from it */
|
|
|
|
uri_file = opal_os_path(false, session_dir, "orted-uri.txt", NULL);
|
|
|
|
free(session_dir);
|
|
|
|
|
|
|
|
fp = fopen(uri_file, "r");
|
|
|
|
if (NULL == fp) {
|
|
|
|
ORTE_ERROR_LOG(ORTE_ERR_FILE_OPEN_FAILURE);
|
|
|
|
return ORTE_ERR_FILE_OPEN_FAILURE;
|
|
|
|
}
|
|
|
|
fgets(orted_uri, 1024, fp);
|
|
|
|
orted_uri[strlen(orted_uri)-1] = '\0';
|
|
|
|
fclose(fp);
|
|
|
|
/* setup the link */
|
|
|
|
if (ORTE_SUCCESS != (rc = orte_sds_base_contact_orted(orted_uri))) {
|
|
|
|
ORTE_ERROR_LOG(rc);
|
|
|
|
return(rc);
|
|
|
|
}
|
|
|
|
free(uri_file);
|
2005-06-17 21:12:50 +00:00
|
|
|
}
|
Bring in the code for routing xcast stage gate messages via the local orteds. This code is inactive unless you specifically request it via an mca param oob_xcast_mode (can be set to "linear" or "direct"). Direct mode is the old standard method where we send messages directly to each MPI process. Linear mode sends the xcast message via the orteds, with the HNP sending the message to each orted directly.
There is a binomial algorithm in the code (i.e., the HNP would send to a subset of the orteds, which then relay it on according to the typical log-2 algo), but that has a bug in it so the code won't let you select it even if you tried (and the mca param doesn't show, so you'd *really* have to try).
This also involved a slight change to the oob.xcast API, so propagated that as required.
Note: this has *only* been tested on rsh, SLURM, and Bproc environments (now that it has been transferred to the OMPI trunk, I'll need to re-test it [only done rsh so far]). It should work fine on any environment that uses the ORTE daemons - anywhere else, you are on your own... :-)
Also, correct a mistake where the orte_debug_flag was declared an int, but the mca param was set as a bool. Move the storage for that flag to the orte/runtime/params.c and orte/runtime/params.h files appropriately.
This commit was SVN r14475.
2007-04-23 18:41:04 +00:00
|
|
|
|
|
|
|
if (cleanup_jobid_string) free(jobid_string);
|
|
|
|
if (cleanup_vpid_string) free(vpid_string);
|
|
|
|
|
2005-06-17 21:12:50 +00:00
|
|
|
return ORTE_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2005-07-27 23:18:16 +00:00
|
|
|
int
|
|
|
|
orte_sds_bproc_finalize(void)
|
|
|
|
{
|
2005-06-17 21:12:50 +00:00
|
|
|
return ORTE_SUCCESS;
|
|
|
|
}
|