2008-04-01 20:03:49 +00:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana
|
|
|
|
* University Research and Technology
|
|
|
|
* Corporation. All rights reserved.
|
2011-06-23 20:38:02 +00:00
|
|
|
* Copyright (c) 2004-2011 The University of Tennessee and The University
|
2008-04-01 20:03:49 +00:00
|
|
|
* of Tennessee Research Foundation. All rights
|
|
|
|
* reserved.
|
2015-06-23 20:59:57 -07:00
|
|
|
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
2008-04-01 20:03:49 +00:00
|
|
|
* University of Stuttgart. All rights reserved.
|
|
|
|
* Copyright (c) 2004-2005 The Regents of the University of California.
|
|
|
|
* All rights reserved.
|
2017-02-10 04:48:43 -08:00
|
|
|
* Copyright (c) 2006-2017 Cisco Systems, Inc. All rights reserved
|
2012-04-06 14:23:13 +00:00
|
|
|
* Copyright (c) 2011 Los Alamos National Security, LLC.
|
|
|
|
* All rights reserved.
|
2018-01-26 21:35:42 -08:00
|
|
|
* Copyright (c) 2014-2018 Intel, Inc. All rights reserved.
|
2015-03-02 14:49:56 +09:00
|
|
|
* Copyright (c) 2015 Research Organization for Information Science
|
|
|
|
* and Technology (RIST). All rights reserved.
|
2016-08-25 13:57:00 -04:00
|
|
|
* Copyright (c) 2016 IBM Corporation. All rights reserved.
|
2008-04-01 20:03:49 +00:00
|
|
|
* $COPYRIGHT$
|
2015-06-23 20:59:57 -07:00
|
|
|
*
|
2008-04-01 20:03:49 +00:00
|
|
|
* Additional copyrights may follow
|
2015-06-23 20:59:57 -07:00
|
|
|
*
|
2008-04-01 20:03:49 +00:00
|
|
|
* $HEADER$
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "orte_config.h"
|
|
|
|
#include "orte/constants.h"
|
|
|
|
#include "orte/types.h"
|
|
|
|
|
|
|
|
#include <errno.h>
|
|
|
|
#ifdef HAVE_UNISTD_H
|
|
|
|
#include <unistd.h>
|
|
|
|
#endif /* HAVE_UNISTD_H */
|
|
|
|
#include <string.h>
|
2014-12-19 10:56:14 -08:00
|
|
|
#include <ctype.h>
|
2008-04-01 20:03:49 +00:00
|
|
|
|
2008-07-25 13:35:12 +00:00
|
|
|
#include "opal/util/if.h"
|
2016-09-02 12:33:34 -04:00
|
|
|
#include "opal/util/net.h"
|
2017-02-10 04:48:43 -08:00
|
|
|
#include "opal/mca/hwloc/hwloc-internal.h"
|
2008-04-01 20:03:49 +00:00
|
|
|
|
2008-06-09 14:53:58 +00:00
|
|
|
#include "orte/util/show_help.h"
|
2008-04-01 20:03:49 +00:00
|
|
|
#include "orte/mca/errmgr/errmgr.h"
|
2011-06-23 20:38:02 +00:00
|
|
|
#include "orte/mca/ess/ess.h"
|
2008-04-17 13:50:59 +00:00
|
|
|
#include "orte/util/hostfile/hostfile.h"
|
2010-03-08 09:54:49 +00:00
|
|
|
#include "orte/util/dash_host/dash_host.h"
|
2008-04-17 13:50:59 +00:00
|
|
|
#include "orte/util/name_fns.h"
|
|
|
|
#include "orte/runtime/orte_globals.h"
|
2008-04-01 20:03:49 +00:00
|
|
|
|
|
|
|
#include "orte/mca/rmaps/base/rmaps_private.h"
|
|
|
|
#include "orte/mca/rmaps/base/base.h"
|
|
|
|
#include "rmaps_seq.h"
|
|
|
|
|
2008-04-17 13:50:59 +00:00
|
|
|
static int orte_rmaps_seq_map(orte_job_t *jdata);
|
|
|
|
|
|
|
|
/* define the module */
|
|
|
|
orte_rmaps_base_module_t orte_rmaps_seq_module = {
|
2017-05-12 16:16:47 -07:00
|
|
|
.map_job = orte_rmaps_seq_map
|
2008-04-17 13:50:59 +00:00
|
|
|
};
|
2008-04-01 20:03:49 +00:00
|
|
|
|
2014-11-30 11:47:34 -08:00
|
|
|
/* local object for tracking rank locations */
|
|
|
|
typedef struct {
|
|
|
|
opal_list_item_t super;
|
|
|
|
char *hostname;
|
|
|
|
char *cpuset;
|
|
|
|
} seq_node_t;
|
|
|
|
static void sn_con(seq_node_t *p)
|
|
|
|
{
|
|
|
|
p->hostname = NULL;
|
|
|
|
p->cpuset = NULL;
|
|
|
|
}
|
|
|
|
static void sn_des(seq_node_t *p)
|
|
|
|
{
|
|
|
|
if (NULL != p->hostname) {
|
|
|
|
free(p->hostname);
|
2016-08-25 13:57:00 -04:00
|
|
|
p->hostname = NULL;
|
2014-11-30 11:47:34 -08:00
|
|
|
}
|
|
|
|
if (NULL != p->cpuset) {
|
|
|
|
free(p->cpuset);
|
2016-08-25 13:57:00 -04:00
|
|
|
p->cpuset = NULL;
|
2014-11-30 11:47:34 -08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
OBJ_CLASS_INSTANCE(seq_node_t,
|
|
|
|
opal_list_item_t,
|
|
|
|
sn_con, sn_des);
|
|
|
|
|
|
|
|
static char *orte_getline(FILE *fp);
|
2008-04-01 20:03:49 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Sequentially map the ranks according to the placement in the
|
|
|
|
* specified hostfile
|
|
|
|
*/
|
|
|
|
static int orte_rmaps_seq_map(orte_job_t *jdata)
|
|
|
|
{
|
|
|
|
orte_job_map_t *map;
|
2009-06-12 17:52:17 +00:00
|
|
|
orte_app_context_t *app;
|
2010-02-27 18:14:27 +00:00
|
|
|
int i, n;
|
|
|
|
orte_std_cntr_t j;
|
2009-08-11 02:51:27 +00:00
|
|
|
opal_list_item_t *item;
|
2014-11-30 11:47:34 -08:00
|
|
|
orte_node_t *node, *nd;
|
|
|
|
seq_node_t *sq, *save=NULL, *seq;;
|
2008-04-17 13:50:59 +00:00
|
|
|
orte_vpid_t vpid;
|
|
|
|
orte_std_cntr_t num_nodes;
|
2008-04-01 20:03:49 +00:00
|
|
|
int rc;
|
2014-11-30 11:47:34 -08:00
|
|
|
opal_list_t default_seq_list;
|
|
|
|
opal_list_t node_list, *seq_list, sq_list;
|
2009-08-11 02:51:27 +00:00
|
|
|
orte_proc_t *proc;
|
2011-03-12 05:30:09 +00:00
|
|
|
mca_base_component_t *c = &mca_rmaps_seq_component.base_version;
|
2016-08-25 13:57:00 -04:00
|
|
|
char *hosts = NULL, *sep, *eptr;
|
2014-11-30 11:47:34 -08:00
|
|
|
FILE *fp;
|
|
|
|
opal_hwloc_resource_type_t rtype;
|
At long last, the fabled revision to the affinity system has arrived. A more detailed explanation of how this all works will be presented here:
https://svn.open-mpi.org/trac/ompi/wiki/ProcessPlacement
The wiki page is incomplete at the moment, but I hope to complete it over the next few days. I will provide updates on the devel list. As the wiki page states, the default and most commonly used options remain unchanged (except as noted below). New, esoteric and complex options have been added, but unless you are a true masochist, you are unlikely to use many of them beyond perhaps an initial curiosity-motivated experimentation.
In a nutshell, this commit revamps the map/rank/bind procedure to take into account topology info on the compute nodes. I have, for the most part, preserved the default behaviors, with three notable exceptions:
1. I have at long last bowed my head in submission to the system admin's of managed clusters. For years, they have complained about our default of allowing users to oversubscribe nodes - i.e., to run more processes on a node than allocated slots. Accordingly, I have modified the default behavior: if you are running off of hostfile/dash-host allocated nodes, then the default is to allow oversubscription. If you are running off of RM-allocated nodes, then the default is to NOT allow oversubscription. Flags to override these behaviors are provided, so this only affects the default behavior.
2. both cpus/rank and stride have been removed. The latter was demanded by those who didn't understand the purpose behind it - and I agreed as the users who requested it are no longer using it. The former was removed temporarily pending implementation.
3. vm launch is now the sole method for starting OMPI. It was just too darned hard to maintain multiple launch procedures - maybe someday, provided someone can demonstrate a reason to do so.
As Jeff stated, it is impossible to fully test a change of this size. I have tested it on Linux and Mac, covering all the default and simple options, singletons, and comm_spawn. That said, I'm sure others will find problems, so I'll be watching MTT results until this stabilizes.
This commit was SVN r25476.
2011-11-15 03:40:11 +00:00
|
|
|
|
2013-03-27 21:14:43 +00:00
|
|
|
OPAL_OUTPUT_VERBOSE((1, orte_rmaps_base_framework.framework_output,
|
2014-11-30 11:47:34 -08:00
|
|
|
"%s rmaps:seq called on job %s",
|
2009-03-05 21:50:47 +00:00
|
|
|
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME),
|
|
|
|
ORTE_JOBID_PRINT(jdata->jobid)));
|
2008-04-01 20:03:49 +00:00
|
|
|
|
2011-02-15 23:24:31 +00:00
|
|
|
/* this mapper can only handle initial launch
|
|
|
|
* when seq mapping is desired - allow
|
|
|
|
* restarting of failed apps
|
|
|
|
*/
|
2014-06-01 16:14:10 +00:00
|
|
|
if (ORTE_FLAG_TEST(jdata, ORTE_JOB_FLAG_RESTART)) {
|
2013-03-27 21:14:43 +00:00
|
|
|
opal_output_verbose(5, orte_rmaps_base_framework.framework_output,
|
2012-04-06 14:23:13 +00:00
|
|
|
"mca:rmaps:seq: job %s is being restarted - seq cannot map",
|
2011-02-15 23:24:31 +00:00
|
|
|
ORTE_JOBID_PRINT(jdata->jobid));
|
|
|
|
return ORTE_ERR_TAKE_NEXT_OPTION;
|
|
|
|
}
|
2014-11-30 11:47:34 -08:00
|
|
|
if (NULL != jdata->map->req_mapper) {
|
|
|
|
if (0 != strcasecmp(jdata->map->req_mapper, c->mca_component_name)) {
|
|
|
|
/* a mapper has been specified, and it isn't me */
|
|
|
|
opal_output_verbose(5, orte_rmaps_base_framework.framework_output,
|
|
|
|
"mca:rmaps:seq: job %s not using sequential mapper",
|
|
|
|
ORTE_JOBID_PRINT(jdata->jobid));
|
|
|
|
return ORTE_ERR_TAKE_NEXT_OPTION;
|
|
|
|
}
|
|
|
|
/* we need to process it */
|
|
|
|
goto process;
|
2011-02-15 23:24:31 +00:00
|
|
|
}
|
At long last, the fabled revision to the affinity system has arrived. A more detailed explanation of how this all works will be presented here:
https://svn.open-mpi.org/trac/ompi/wiki/ProcessPlacement
The wiki page is incomplete at the moment, but I hope to complete it over the next few days. I will provide updates on the devel list. As the wiki page states, the default and most commonly used options remain unchanged (except as noted below). New, esoteric and complex options have been added, but unless you are a true masochist, you are unlikely to use many of them beyond perhaps an initial curiosity-motivated experimentation.
In a nutshell, this commit revamps the map/rank/bind procedure to take into account topology info on the compute nodes. I have, for the most part, preserved the default behaviors, with three notable exceptions:
1. I have at long last bowed my head in submission to the system admin's of managed clusters. For years, they have complained about our default of allowing users to oversubscribe nodes - i.e., to run more processes on a node than allocated slots. Accordingly, I have modified the default behavior: if you are running off of hostfile/dash-host allocated nodes, then the default is to allow oversubscription. If you are running off of RM-allocated nodes, then the default is to NOT allow oversubscription. Flags to override these behaviors are provided, so this only affects the default behavior.
2. both cpus/rank and stride have been removed. The latter was demanded by those who didn't understand the purpose behind it - and I agreed as the users who requested it are no longer using it. The former was removed temporarily pending implementation.
3. vm launch is now the sole method for starting OMPI. It was just too darned hard to maintain multiple launch procedures - maybe someday, provided someone can demonstrate a reason to do so.
As Jeff stated, it is impossible to fully test a change of this size. I have tested it on Linux and Mac, covering all the default and simple options, singletons, and comm_spawn. That said, I'm sure others will find problems, so I'll be watching MTT results until this stabilizes.
This commit was SVN r25476.
2011-11-15 03:40:11 +00:00
|
|
|
if (ORTE_MAPPING_SEQ != ORTE_GET_MAPPING_POLICY(jdata->map->mapping)) {
|
2011-03-12 05:30:09 +00:00
|
|
|
/* I don't know how to do these - defer */
|
2013-03-27 21:14:43 +00:00
|
|
|
opal_output_verbose(5, orte_rmaps_base_framework.framework_output,
|
2011-03-12 05:30:09 +00:00
|
|
|
"mca:rmaps:seq: job %s not using seq mapper",
|
|
|
|
ORTE_JOBID_PRINT(jdata->jobid));
|
|
|
|
return ORTE_ERR_TAKE_NEXT_OPTION;
|
|
|
|
}
|
2011-02-16 23:01:57 +00:00
|
|
|
|
2014-11-30 11:47:34 -08:00
|
|
|
process:
|
2013-03-27 21:14:43 +00:00
|
|
|
opal_output_verbose(5, orte_rmaps_base_framework.framework_output,
|
2011-02-15 23:24:31 +00:00
|
|
|
"mca:rmaps:seq: mapping job %s",
|
|
|
|
ORTE_JOBID_PRINT(jdata->jobid));
|
2011-02-16 23:01:57 +00:00
|
|
|
|
|
|
|
/* flag that I did the mapping */
|
2011-03-12 15:37:33 +00:00
|
|
|
if (NULL != jdata->map->last_mapper) {
|
|
|
|
free(jdata->map->last_mapper);
|
|
|
|
}
|
2011-03-12 05:30:09 +00:00
|
|
|
jdata->map->last_mapper = strdup(c->mca_component_name);
|
2011-02-15 23:24:31 +00:00
|
|
|
|
2014-11-30 11:47:34 -08:00
|
|
|
/* convenience def */
|
2008-04-01 20:03:49 +00:00
|
|
|
map = jdata->map;
|
2014-11-30 11:47:34 -08:00
|
|
|
|
2008-04-17 13:50:59 +00:00
|
|
|
/* if there is a default hostfile, go and get its ordered list of nodes */
|
2014-11-30 11:47:34 -08:00
|
|
|
OBJ_CONSTRUCT(&default_seq_list, opal_list_t);
|
2008-04-17 13:50:59 +00:00
|
|
|
if (NULL != orte_default_hostfile) {
|
2016-08-25 13:57:00 -04:00
|
|
|
char *hstname = NULL;
|
2014-11-30 11:47:34 -08:00
|
|
|
/* open the file */
|
|
|
|
fp = fopen(orte_default_hostfile, "r");
|
|
|
|
if (NULL == fp) {
|
|
|
|
ORTE_ERROR_LOG(ORTE_ERR_NOT_FOUND);
|
|
|
|
rc = ORTE_ERR_NOT_FOUND;
|
2008-04-17 13:50:59 +00:00
|
|
|
goto error;
|
|
|
|
}
|
2014-11-30 11:47:34 -08:00
|
|
|
while (NULL != (hstname = orte_getline(fp))) {
|
|
|
|
if (0 == strlen(hstname)) {
|
2015-06-03 14:06:05 +09:00
|
|
|
free(hstname);
|
2014-11-30 11:47:34 -08:00
|
|
|
/* blank line - ignore */
|
|
|
|
continue;
|
|
|
|
}
|
2016-08-25 13:57:00 -04:00
|
|
|
if( '#' == hstname[0] ) {
|
|
|
|
free(hstname);
|
|
|
|
/* Comment line - ignore */
|
|
|
|
continue;
|
|
|
|
}
|
2014-11-30 11:47:34 -08:00
|
|
|
sq = OBJ_NEW(seq_node_t);
|
|
|
|
if (NULL != (sep = strchr(hstname, ' '))) {
|
|
|
|
*sep = '\0';
|
|
|
|
sep++;
|
2014-12-19 10:56:14 -08:00
|
|
|
/* remove any trailing space */
|
|
|
|
eptr = sep + strlen(sep) - 1;
|
|
|
|
while (eptr > sep && isspace(*eptr)) {
|
|
|
|
eptr--;
|
|
|
|
}
|
|
|
|
*(eptr+1) = 0;
|
2014-11-30 11:47:34 -08:00
|
|
|
sq->cpuset = strdup(sep);
|
|
|
|
}
|
2016-08-25 13:57:00 -04:00
|
|
|
|
2016-09-02 12:33:34 -04:00
|
|
|
// Strip off the FQDN if present, ignore IP addresses
|
|
|
|
if( !orte_keep_fqdn_hostnames && !opal_net_isaddr(hstname) ) {
|
2016-08-25 13:57:00 -04:00
|
|
|
char *ptr;
|
2016-09-02 12:33:34 -04:00
|
|
|
if (NULL != (ptr = strchr(hstname, '.'))) {
|
|
|
|
*ptr = '\0';
|
2016-08-25 13:57:00 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-06-03 14:06:05 +09:00
|
|
|
sq->hostname = hstname;
|
2014-11-30 11:47:34 -08:00
|
|
|
opal_list_append(&default_seq_list, &sq->super);
|
|
|
|
}
|
|
|
|
fclose(fp);
|
2008-04-17 13:50:59 +00:00
|
|
|
}
|
2015-06-23 20:59:57 -07:00
|
|
|
|
2008-04-01 20:03:49 +00:00
|
|
|
/* start at the beginning... */
|
2008-04-17 13:50:59 +00:00
|
|
|
vpid = 0;
|
2009-05-16 04:15:55 +00:00
|
|
|
jdata->num_procs = 0;
|
2014-11-30 11:47:34 -08:00
|
|
|
if (0 < opal_list_get_size(&default_seq_list)) {
|
|
|
|
save = (seq_node_t*)opal_list_get_first(&default_seq_list);
|
2009-08-11 02:51:27 +00:00
|
|
|
}
|
2015-06-23 20:59:57 -07:00
|
|
|
|
2014-11-30 11:47:34 -08:00
|
|
|
/* default to LOGICAL processors */
|
|
|
|
if (orte_get_attribute(&jdata->attributes, ORTE_JOB_PHYSICAL_CPUIDS, NULL, OPAL_BOOL)) {
|
|
|
|
opal_output_verbose(5, orte_rmaps_base_framework.framework_output,
|
|
|
|
"mca:rmaps:seq: using PHYSICAL processors");
|
|
|
|
rtype = OPAL_HWLOC_PHYSICAL;
|
|
|
|
} else {
|
|
|
|
opal_output_verbose(5, orte_rmaps_base_framework.framework_output,
|
|
|
|
"mca:rmaps:seq: using LOGICAL processors");
|
|
|
|
rtype = OPAL_HWLOC_LOGICAL;
|
|
|
|
}
|
|
|
|
|
2014-12-08 08:03:53 -08:00
|
|
|
/* initialize all the nodes as not included in this job map */
|
|
|
|
for (j=0; j < orte_node_pool->size; j++) {
|
|
|
|
if (NULL != (node = (orte_node_t*)opal_pointer_array_get_item(orte_node_pool, j))) {
|
|
|
|
ORTE_FLAG_UNSET(node, ORTE_NODE_FLAG_MAPPED);
|
2015-06-23 20:59:57 -07:00
|
|
|
}
|
2014-12-08 08:03:53 -08:00
|
|
|
}
|
2015-06-23 20:59:57 -07:00
|
|
|
|
2008-04-01 20:03:49 +00:00
|
|
|
/* cycle through the app_contexts, mapping them sequentially */
|
2010-02-27 18:14:27 +00:00
|
|
|
for(i=0; i < jdata->apps->size; i++) {
|
2009-06-12 17:52:17 +00:00
|
|
|
if (NULL == (app = (orte_app_context_t*)opal_pointer_array_get_item(jdata->apps, i))) {
|
|
|
|
continue;
|
|
|
|
}
|
2015-06-23 20:59:57 -07:00
|
|
|
|
2010-03-08 09:54:49 +00:00
|
|
|
/* dash-host trumps hostfile */
|
2014-06-01 16:14:10 +00:00
|
|
|
if (orte_get_attribute(&app->attributes, ORTE_APP_DASH_HOST, (void**)&hosts, OPAL_STRING)) {
|
2014-11-30 11:47:34 -08:00
|
|
|
opal_output_verbose(5, orte_rmaps_base_framework.framework_output,
|
|
|
|
"mca:rmaps:seq: using dash-host nodes on app %s", app->app);
|
|
|
|
OBJ_CONSTRUCT(&node_list, opal_list_t);
|
|
|
|
/* dash host entries cannot specify cpusets, so used the std function to retrieve the list */
|
|
|
|
if (ORTE_SUCCESS != (rc = orte_util_get_ordered_dash_host_list(&node_list, hosts))) {
|
2010-03-08 09:54:49 +00:00
|
|
|
ORTE_ERROR_LOG(rc);
|
2014-06-01 16:14:10 +00:00
|
|
|
free(hosts);
|
2010-03-08 09:54:49 +00:00
|
|
|
goto error;
|
2014-06-01 16:14:10 +00:00
|
|
|
}
|
|
|
|
free(hosts);
|
2014-11-30 11:47:34 -08:00
|
|
|
/* transfer the list to a seq_node_t list */
|
|
|
|
OBJ_CONSTRUCT(&sq_list, opal_list_t);
|
|
|
|
while (NULL != (nd = (orte_node_t*)opal_list_remove_first(&node_list))) {
|
|
|
|
sq = OBJ_NEW(seq_node_t);
|
|
|
|
sq->hostname = strdup(nd->name);
|
|
|
|
opal_list_append(&sq_list, &sq->super);
|
|
|
|
OBJ_RELEASE(nd);
|
|
|
|
}
|
|
|
|
OBJ_DESTRUCT(&node_list);
|
|
|
|
seq_list = &sq_list;
|
2014-06-01 16:14:10 +00:00
|
|
|
} else if (orte_get_attribute(&app->attributes, ORTE_APP_HOSTFILE, (void**)&hosts, OPAL_STRING)) {
|
2015-06-03 14:06:05 +09:00
|
|
|
char *hstname;
|
2016-09-06 08:43:15 -07:00
|
|
|
if (NULL == hosts) {
|
|
|
|
rc = ORTE_ERR_NOT_FOUND;
|
|
|
|
goto error;
|
|
|
|
}
|
2014-11-30 11:47:34 -08:00
|
|
|
opal_output_verbose(5, orte_rmaps_base_framework.framework_output,
|
|
|
|
"mca:rmaps:seq: using hostfile %s nodes on app %s", hosts, app->app);
|
|
|
|
OBJ_CONSTRUCT(&sq_list, opal_list_t);
|
|
|
|
/* open the file */
|
|
|
|
fp = fopen(hosts, "r");
|
|
|
|
if (NULL == fp) {
|
|
|
|
ORTE_ERROR_LOG(ORTE_ERR_NOT_FOUND);
|
|
|
|
rc = ORTE_ERR_NOT_FOUND;
|
|
|
|
OBJ_DESTRUCT(&sq_list);
|
2008-04-17 13:50:59 +00:00
|
|
|
goto error;
|
2014-06-01 16:14:10 +00:00
|
|
|
}
|
2014-11-30 11:47:34 -08:00
|
|
|
while (NULL != (hstname = orte_getline(fp))) {
|
2016-08-25 13:57:00 -04:00
|
|
|
if (0 == strlen(hstname)) {
|
|
|
|
free(hstname);
|
|
|
|
/* blank line - ignore */
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
if( '#' == hstname[0] ) {
|
|
|
|
free(hstname);
|
|
|
|
/* Comment line - ignore */
|
|
|
|
continue;
|
|
|
|
}
|
2014-11-30 11:47:34 -08:00
|
|
|
sq = OBJ_NEW(seq_node_t);
|
|
|
|
if (NULL != (sep = strchr(hstname, ' '))) {
|
|
|
|
*sep = '\0';
|
|
|
|
sep++;
|
2014-12-19 10:56:14 -08:00
|
|
|
/* remove any trailing space */
|
|
|
|
eptr = sep + strlen(sep) - 1;
|
|
|
|
while (eptr > sep && isspace(*eptr)) {
|
|
|
|
eptr--;
|
|
|
|
}
|
|
|
|
*(eptr+1) = 0;
|
2014-11-30 11:47:34 -08:00
|
|
|
sq->cpuset = strdup(sep);
|
|
|
|
}
|
2016-08-25 13:57:00 -04:00
|
|
|
|
2016-09-02 12:33:34 -04:00
|
|
|
// Strip off the FQDN if present, ignore IP addresses
|
|
|
|
if( !orte_keep_fqdn_hostnames && !opal_net_isaddr(hstname) ) {
|
2016-08-25 13:57:00 -04:00
|
|
|
char *ptr;
|
2016-09-02 12:33:34 -04:00
|
|
|
if (NULL != (ptr = strchr(hstname, '.'))) {
|
|
|
|
(*ptr) = '\0';
|
2016-08-25 13:57:00 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-03-02 14:49:56 +09:00
|
|
|
sq->hostname = hstname;
|
2014-11-30 11:47:34 -08:00
|
|
|
opal_list_append(&sq_list, &sq->super);
|
|
|
|
}
|
|
|
|
fclose(fp);
|
2014-06-01 16:14:10 +00:00
|
|
|
free(hosts);
|
2014-11-30 11:47:34 -08:00
|
|
|
seq_list = &sq_list;
|
|
|
|
} else if (0 < opal_list_get_size(&default_seq_list)) {
|
|
|
|
opal_output_verbose(5, orte_rmaps_base_framework.framework_output,
|
|
|
|
"mca:rmaps:seq: using default hostfile nodes on app %s", app->app);
|
|
|
|
seq_list = &default_seq_list;
|
2010-03-08 09:54:49 +00:00
|
|
|
} else {
|
|
|
|
/* can't do anything - no nodes available! */
|
|
|
|
orte_show_help("help-orte-rmaps-base.txt",
|
|
|
|
"orte-rmaps-base:no-available-resources",
|
|
|
|
true);
|
|
|
|
return ORTE_ERR_SILENT;
|
2008-04-01 20:03:49 +00:00
|
|
|
}
|
2015-06-23 20:59:57 -07:00
|
|
|
|
2008-07-25 13:35:12 +00:00
|
|
|
/* check for nolocal and remove the head node, if required */
|
At long last, the fabled revision to the affinity system has arrived. A more detailed explanation of how this all works will be presented here:
https://svn.open-mpi.org/trac/ompi/wiki/ProcessPlacement
The wiki page is incomplete at the moment, but I hope to complete it over the next few days. I will provide updates on the devel list. As the wiki page states, the default and most commonly used options remain unchanged (except as noted below). New, esoteric and complex options have been added, but unless you are a true masochist, you are unlikely to use many of them beyond perhaps an initial curiosity-motivated experimentation.
In a nutshell, this commit revamps the map/rank/bind procedure to take into account topology info on the compute nodes. I have, for the most part, preserved the default behaviors, with three notable exceptions:
1. I have at long last bowed my head in submission to the system admin's of managed clusters. For years, they have complained about our default of allowing users to oversubscribe nodes - i.e., to run more processes on a node than allocated slots. Accordingly, I have modified the default behavior: if you are running off of hostfile/dash-host allocated nodes, then the default is to allow oversubscription. If you are running off of RM-allocated nodes, then the default is to NOT allow oversubscription. Flags to override these behaviors are provided, so this only affects the default behavior.
2. both cpus/rank and stride have been removed. The latter was demanded by those who didn't understand the purpose behind it - and I agreed as the users who requested it are no longer using it. The former was removed temporarily pending implementation.
3. vm launch is now the sole method for starting OMPI. It was just too darned hard to maintain multiple launch procedures - maybe someday, provided someone can demonstrate a reason to do so.
As Jeff stated, it is impossible to fully test a change of this size. I have tested it on Linux and Mac, covering all the default and simple options, singletons, and comm_spawn. That said, I'm sure others will find problems, so I'll be watching MTT results until this stabilizes.
This commit was SVN r25476.
2011-11-15 03:40:11 +00:00
|
|
|
if (map->mapping & ORTE_MAPPING_NO_USE_LOCAL) {
|
2014-11-30 11:47:34 -08:00
|
|
|
for (item = opal_list_get_first(seq_list);
|
|
|
|
item != opal_list_get_end(seq_list);
|
2008-07-25 13:35:12 +00:00
|
|
|
item = opal_list_get_next(item) ) {
|
2014-11-30 11:47:34 -08:00
|
|
|
seq = (seq_node_t*)item;
|
2008-07-25 13:35:12 +00:00
|
|
|
/* need to check ifislocal because the name in the
|
|
|
|
* hostfile may not have been FQDN, while name returned
|
|
|
|
* by gethostname may have been (or vice versa)
|
|
|
|
*/
|
2015-03-16 16:25:01 -07:00
|
|
|
if (orte_ifislocal(seq->hostname)) {
|
2014-11-30 11:47:34 -08:00
|
|
|
opal_output_verbose(5, orte_rmaps_base_framework.framework_output,
|
|
|
|
"mca:rmaps:seq: removing head node %s", seq->hostname);
|
|
|
|
opal_list_remove_item(seq_list, item);
|
2008-07-25 13:35:12 +00:00
|
|
|
OBJ_RELEASE(item); /* "un-retain" it */
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2015-06-23 20:59:57 -07:00
|
|
|
|
2014-11-30 11:47:34 -08:00
|
|
|
if (NULL == seq_list || 0 == (num_nodes = (orte_std_cntr_t)opal_list_get_size(seq_list))) {
|
This commit represents a bunch of work on a Mercurial side branch. As
such, the commit message back to the master SVN repository is fairly
long.
= ORTE Job-Level Output Messages =
Add two new interfaces that should be used for all new code throughout
the ORTE and OMPI layers (we already make the search-and-replace on
the existing ORTE / OMPI layers):
* orte_output(): (and corresponding friends ORTE_OUTPUT,
orte_output_verbose, etc.) This function sends the output directly
to the HNP for processing as part of a job-specific output
channel. It supports all the same outputs as opal_output()
(syslog, file, stdout, stderr), but for stdout/stderr, the output
is sent to the HNP for processing and output. More on this below.
* orte_show_help(): This function is a drop-in-replacement for
opal_show_help(), with two differences in functionality:
1. the rendered text help message output is sent to the HNP for
display (rather than outputting directly into the process' stderr
stream)
1. the HNP detects duplicate help messages and does not display them
(so that you don't see the same error message N times, once from
each of your N MPI processes); instead, it counts "new" instances
of the help message and displays a message every ~5 seconds when
there are new ones ("I got X new copies of the help message...")
opal_show_help and opal_output still exist, but they only output in
the current process. The intent for the new orte_* functions is that
they can apply job-level intelligence to the output. As such, we
recommend that all new ORTE and OMPI code use the new orte_*
functions, not thei opal_* functions.
=== New code ===
For ORTE and OMPI programmers, here's what you need to do differently
in new code:
* Do not include opal/util/show_help.h or opal/util/output.h.
Instead, include orte/util/output.h (this one header file has
declarations for both the orte_output() series of functions and
orte_show_help()).
* Effectively s/opal_output/orte_output/gi throughout your code.
Note that orte_output_open() takes a slightly different argument
list (as a way to pass data to the filtering stream -- see below),
so you if explicitly call opal_output_open(), you'll need to
slightly adapt to the new signature of orte_output_open().
* Literally s/opal_show_help/orte_show_help/. The function signature
is identical.
=== Notes ===
* orte_output'ing to stream 0 will do similar to what
opal_output'ing did, so leaving a hard-coded "0" as the first
argument is safe.
* For systems that do not use ORTE's RML or the HNP, the effect of
orte_output_* and orte_show_help will be identical to their opal
counterparts (the additional information passed to
orte_output_open() will be lost!). Indeed, the orte_* functions
simply become trivial wrappers to their opal_* counterparts. Note
that we have not tested this; the code is simple but it is quite
possible that we mucked something up.
= Filter Framework =
Messages sent view the new orte_* functions described above and
messages output via the IOF on the HNP will now optionally be passed
through a new "filter" framework before being output to
stdout/stderr. The "filter" OPAL MCA framework is intended to allow
preprocessing to messages before they are sent to their final
destinations. The first component that was written in the filter
framework was to create an XML stream, segregating all the messages
into different XML tags, etc. This will allow 3rd party tools to read
the stdout/stderr from the HNP and be able to know exactly what each
text message is (e.g., a help message, another OMPI infrastructure
message, stdout from the user process, stderr from the user process,
etc.).
Filtering is not active by default. Filter components must be
specifically requested, such as:
{{{
$ mpirun --mca filter xml ...
}}}
There can only be one filter component active.
= New MCA Parameters =
The new functionality described above introduces two new MCA
parameters:
* '''orte_base_help_aggregate''': Defaults to 1 (true), meaning that
help messages will be aggregated, as described above. If set to 0,
all help messages will be displayed, even if they are duplicates
(i.e., the original behavior).
* '''orte_base_show_output_recursions''': An MCA parameter to help
debug one of the known issues, described below. It is likely that
this MCA parameter will disappear before v1.3 final.
= Known Issues =
* The XML filter component is not complete. The current output from
this component is preliminary and not real XML. A bit more work
needs to be done to configure.m4 search for an appropriate XML
library/link it in/use it at run time.
* There are possible recursion loops in the orte_output() and
orte_show_help() functions -- e.g., if RML send calls orte_output()
or orte_show_help(). We have some ideas how to fix these, but
figured that it was ok to commit before feature freeze with known
issues. The code currently contains sub-optimal workarounds so
that this will not be a problem, but it would be good to actually
solve the problem rather than have hackish workarounds before v1.3 final.
This commit was SVN r18434.
2008-05-13 20:00:55 +00:00
|
|
|
orte_show_help("help-orte-rmaps-base.txt",
|
2008-04-17 13:50:59 +00:00
|
|
|
"orte-rmaps-base:no-available-resources",
|
|
|
|
true);
|
|
|
|
return ORTE_ERR_SILENT;
|
2008-04-01 20:03:49 +00:00
|
|
|
}
|
|
|
|
|
2008-04-17 13:50:59 +00:00
|
|
|
/* if num_procs wasn't specified, set it now */
|
|
|
|
if (0 == app->num_procs) {
|
|
|
|
app->num_procs = num_nodes;
|
2014-11-30 11:47:34 -08:00
|
|
|
opal_output_verbose(5, orte_rmaps_base_framework.framework_output,
|
|
|
|
"mca:rmaps:seq: setting num procs to %s for app %s",
|
|
|
|
ORTE_VPID_PRINT(app->num_procs), app->app);
|
|
|
|
} else if (num_nodes < app->num_procs) {
|
|
|
|
orte_show_help("help-orte-rmaps-base.txt", "seq:not-enough-resources", true,
|
|
|
|
app->num_procs, num_nodes);
|
|
|
|
return ORTE_ERR_SILENT;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (seq_list == &default_seq_list) {
|
|
|
|
sq = save;
|
|
|
|
} else {
|
|
|
|
sq = (seq_node_t*)opal_list_get_first(seq_list);
|
2008-04-17 13:50:59 +00:00
|
|
|
}
|
2010-02-27 18:14:27 +00:00
|
|
|
for (n=0; n < app->num_procs; n++) {
|
2008-04-17 13:50:59 +00:00
|
|
|
/* find this node on the global array - this is necessary so
|
|
|
|
* that our mapping gets saved on that array as the objects
|
|
|
|
* returned by the hostfile function are -not- on the array
|
|
|
|
*/
|
|
|
|
node = NULL;
|
|
|
|
for (j=0; j < orte_node_pool->size; j++) {
|
2009-06-12 17:52:17 +00:00
|
|
|
if (NULL == (node = (orte_node_t*)opal_pointer_array_get_item(orte_node_pool, j))) {
|
|
|
|
continue;
|
2015-06-23 20:59:57 -07:00
|
|
|
}
|
2014-11-30 11:47:34 -08:00
|
|
|
if (0 == strcmp(sq->hostname, node->name)) {
|
2008-04-17 13:50:59 +00:00
|
|
|
break;
|
|
|
|
}
|
2008-04-01 20:03:49 +00:00
|
|
|
}
|
2008-04-17 13:50:59 +00:00
|
|
|
if (NULL == node) {
|
|
|
|
/* wasn't found - that is an error */
|
This commit represents a bunch of work on a Mercurial side branch. As
such, the commit message back to the master SVN repository is fairly
long.
= ORTE Job-Level Output Messages =
Add two new interfaces that should be used for all new code throughout
the ORTE and OMPI layers (we already make the search-and-replace on
the existing ORTE / OMPI layers):
* orte_output(): (and corresponding friends ORTE_OUTPUT,
orte_output_verbose, etc.) This function sends the output directly
to the HNP for processing as part of a job-specific output
channel. It supports all the same outputs as opal_output()
(syslog, file, stdout, stderr), but for stdout/stderr, the output
is sent to the HNP for processing and output. More on this below.
* orte_show_help(): This function is a drop-in-replacement for
opal_show_help(), with two differences in functionality:
1. the rendered text help message output is sent to the HNP for
display (rather than outputting directly into the process' stderr
stream)
1. the HNP detects duplicate help messages and does not display them
(so that you don't see the same error message N times, once from
each of your N MPI processes); instead, it counts "new" instances
of the help message and displays a message every ~5 seconds when
there are new ones ("I got X new copies of the help message...")
opal_show_help and opal_output still exist, but they only output in
the current process. The intent for the new orte_* functions is that
they can apply job-level intelligence to the output. As such, we
recommend that all new ORTE and OMPI code use the new orte_*
functions, not thei opal_* functions.
=== New code ===
For ORTE and OMPI programmers, here's what you need to do differently
in new code:
* Do not include opal/util/show_help.h or opal/util/output.h.
Instead, include orte/util/output.h (this one header file has
declarations for both the orte_output() series of functions and
orte_show_help()).
* Effectively s/opal_output/orte_output/gi throughout your code.
Note that orte_output_open() takes a slightly different argument
list (as a way to pass data to the filtering stream -- see below),
so you if explicitly call opal_output_open(), you'll need to
slightly adapt to the new signature of orte_output_open().
* Literally s/opal_show_help/orte_show_help/. The function signature
is identical.
=== Notes ===
* orte_output'ing to stream 0 will do similar to what
opal_output'ing did, so leaving a hard-coded "0" as the first
argument is safe.
* For systems that do not use ORTE's RML or the HNP, the effect of
orte_output_* and orte_show_help will be identical to their opal
counterparts (the additional information passed to
orte_output_open() will be lost!). Indeed, the orte_* functions
simply become trivial wrappers to their opal_* counterparts. Note
that we have not tested this; the code is simple but it is quite
possible that we mucked something up.
= Filter Framework =
Messages sent view the new orte_* functions described above and
messages output via the IOF on the HNP will now optionally be passed
through a new "filter" framework before being output to
stdout/stderr. The "filter" OPAL MCA framework is intended to allow
preprocessing to messages before they are sent to their final
destinations. The first component that was written in the filter
framework was to create an XML stream, segregating all the messages
into different XML tags, etc. This will allow 3rd party tools to read
the stdout/stderr from the HNP and be able to know exactly what each
text message is (e.g., a help message, another OMPI infrastructure
message, stdout from the user process, stderr from the user process,
etc.).
Filtering is not active by default. Filter components must be
specifically requested, such as:
{{{
$ mpirun --mca filter xml ...
}}}
There can only be one filter component active.
= New MCA Parameters =
The new functionality described above introduces two new MCA
parameters:
* '''orte_base_help_aggregate''': Defaults to 1 (true), meaning that
help messages will be aggregated, as described above. If set to 0,
all help messages will be displayed, even if they are duplicates
(i.e., the original behavior).
* '''orte_base_show_output_recursions''': An MCA parameter to help
debug one of the known issues, described below. It is likely that
this MCA parameter will disappear before v1.3 final.
= Known Issues =
* The XML filter component is not complete. The current output from
this component is preliminary and not real XML. A bit more work
needs to be done to configure.m4 search for an appropriate XML
library/link it in/use it at run time.
* There are possible recursion loops in the orte_output() and
orte_show_help() functions -- e.g., if RML send calls orte_output()
or orte_show_help(). We have some ideas how to fix these, but
figured that it was ok to commit before feature freeze with known
issues. The code currently contains sub-optimal workarounds so
that this will not be a problem, but it would be good to actually
solve the problem rather than have hackish workarounds before v1.3 final.
This commit was SVN r18434.
2008-05-13 20:00:55 +00:00
|
|
|
orte_show_help("help-orte-rmaps-seq.txt",
|
2008-04-17 13:50:59 +00:00
|
|
|
"orte-rmaps-seq:resource-not-found",
|
2014-12-12 17:21:46 -08:00
|
|
|
true, sq->hostname);
|
2008-04-01 20:03:49 +00:00
|
|
|
rc = ORTE_ERR_SILENT;
|
|
|
|
goto error;
|
|
|
|
}
|
At long last, the fabled revision to the affinity system has arrived. A more detailed explanation of how this all works will be presented here:
https://svn.open-mpi.org/trac/ompi/wiki/ProcessPlacement
The wiki page is incomplete at the moment, but I hope to complete it over the next few days. I will provide updates on the devel list. As the wiki page states, the default and most commonly used options remain unchanged (except as noted below). New, esoteric and complex options have been added, but unless you are a true masochist, you are unlikely to use many of them beyond perhaps an initial curiosity-motivated experimentation.
In a nutshell, this commit revamps the map/rank/bind procedure to take into account topology info on the compute nodes. I have, for the most part, preserved the default behaviors, with three notable exceptions:
1. I have at long last bowed my head in submission to the system admin's of managed clusters. For years, they have complained about our default of allowing users to oversubscribe nodes - i.e., to run more processes on a node than allocated slots. Accordingly, I have modified the default behavior: if you are running off of hostfile/dash-host allocated nodes, then the default is to allow oversubscription. If you are running off of RM-allocated nodes, then the default is to NOT allow oversubscription. Flags to override these behaviors are provided, so this only affects the default behavior.
2. both cpus/rank and stride have been removed. The latter was demanded by those who didn't understand the purpose behind it - and I agreed as the users who requested it are no longer using it. The former was removed temporarily pending implementation.
3. vm launch is now the sole method for starting OMPI. It was just too darned hard to maintain multiple launch procedures - maybe someday, provided someone can demonstrate a reason to do so.
As Jeff stated, it is impossible to fully test a change of this size. I have tested it on Linux and Mac, covering all the default and simple options, singletons, and comm_spawn. That said, I'm sure others will find problems, so I'll be watching MTT results until this stabilizes.
This commit was SVN r25476.
2011-11-15 03:40:11 +00:00
|
|
|
/* ensure the node is in the map */
|
2014-06-01 16:14:10 +00:00
|
|
|
if (!ORTE_FLAG_TEST(node, ORTE_NODE_FLAG_MAPPED)) {
|
At long last, the fabled revision to the affinity system has arrived. A more detailed explanation of how this all works will be presented here:
https://svn.open-mpi.org/trac/ompi/wiki/ProcessPlacement
The wiki page is incomplete at the moment, but I hope to complete it over the next few days. I will provide updates on the devel list. As the wiki page states, the default and most commonly used options remain unchanged (except as noted below). New, esoteric and complex options have been added, but unless you are a true masochist, you are unlikely to use many of them beyond perhaps an initial curiosity-motivated experimentation.
In a nutshell, this commit revamps the map/rank/bind procedure to take into account topology info on the compute nodes. I have, for the most part, preserved the default behaviors, with three notable exceptions:
1. I have at long last bowed my head in submission to the system admin's of managed clusters. For years, they have complained about our default of allowing users to oversubscribe nodes - i.e., to run more processes on a node than allocated slots. Accordingly, I have modified the default behavior: if you are running off of hostfile/dash-host allocated nodes, then the default is to allow oversubscription. If you are running off of RM-allocated nodes, then the default is to NOT allow oversubscription. Flags to override these behaviors are provided, so this only affects the default behavior.
2. both cpus/rank and stride have been removed. The latter was demanded by those who didn't understand the purpose behind it - and I agreed as the users who requested it are no longer using it. The former was removed temporarily pending implementation.
3. vm launch is now the sole method for starting OMPI. It was just too darned hard to maintain multiple launch procedures - maybe someday, provided someone can demonstrate a reason to do so.
As Jeff stated, it is impossible to fully test a change of this size. I have tested it on Linux and Mac, covering all the default and simple options, singletons, and comm_spawn. That said, I'm sure others will find problems, so I'll be watching MTT results until this stabilizes.
This commit was SVN r25476.
2011-11-15 03:40:11 +00:00
|
|
|
OBJ_RETAIN(node);
|
|
|
|
opal_pointer_array_add(map->nodes, node);
|
2014-11-30 11:47:34 -08:00
|
|
|
jdata->map->num_nodes++;
|
2014-06-01 16:14:10 +00:00
|
|
|
ORTE_FLAG_SET(node, ORTE_NODE_FLAG_MAPPED);
|
At long last, the fabled revision to the affinity system has arrived. A more detailed explanation of how this all works will be presented here:
https://svn.open-mpi.org/trac/ompi/wiki/ProcessPlacement
The wiki page is incomplete at the moment, but I hope to complete it over the next few days. I will provide updates on the devel list. As the wiki page states, the default and most commonly used options remain unchanged (except as noted below). New, esoteric and complex options have been added, but unless you are a true masochist, you are unlikely to use many of them beyond perhaps an initial curiosity-motivated experimentation.
In a nutshell, this commit revamps the map/rank/bind procedure to take into account topology info on the compute nodes. I have, for the most part, preserved the default behaviors, with three notable exceptions:
1. I have at long last bowed my head in submission to the system admin's of managed clusters. For years, they have complained about our default of allowing users to oversubscribe nodes - i.e., to run more processes on a node than allocated slots. Accordingly, I have modified the default behavior: if you are running off of hostfile/dash-host allocated nodes, then the default is to allow oversubscription. If you are running off of RM-allocated nodes, then the default is to NOT allow oversubscription. Flags to override these behaviors are provided, so this only affects the default behavior.
2. both cpus/rank and stride have been removed. The latter was demanded by those who didn't understand the purpose behind it - and I agreed as the users who requested it are no longer using it. The former was removed temporarily pending implementation.
3. vm launch is now the sole method for starting OMPI. It was just too darned hard to maintain multiple launch procedures - maybe someday, provided someone can demonstrate a reason to do so.
As Jeff stated, it is impossible to fully test a change of this size. I have tested it on Linux and Mac, covering all the default and simple options, singletons, and comm_spawn. That said, I'm sure others will find problems, so I'll be watching MTT results until this stabilizes.
This commit was SVN r25476.
2011-11-15 03:40:11 +00:00
|
|
|
}
|
2011-12-05 22:01:08 +00:00
|
|
|
proc = orte_rmaps_base_setup_proc(jdata, node, i);
|
|
|
|
if ((node->slots < (int)node->num_procs) ||
|
|
|
|
(0 < node->slots_max && node->slots_max < (int)node->num_procs)) {
|
At long last, the fabled revision to the affinity system has arrived. A more detailed explanation of how this all works will be presented here:
https://svn.open-mpi.org/trac/ompi/wiki/ProcessPlacement
The wiki page is incomplete at the moment, but I hope to complete it over the next few days. I will provide updates on the devel list. As the wiki page states, the default and most commonly used options remain unchanged (except as noted below). New, esoteric and complex options have been added, but unless you are a true masochist, you are unlikely to use many of them beyond perhaps an initial curiosity-motivated experimentation.
In a nutshell, this commit revamps the map/rank/bind procedure to take into account topology info on the compute nodes. I have, for the most part, preserved the default behaviors, with three notable exceptions:
1. I have at long last bowed my head in submission to the system admin's of managed clusters. For years, they have complained about our default of allowing users to oversubscribe nodes - i.e., to run more processes on a node than allocated slots. Accordingly, I have modified the default behavior: if you are running off of hostfile/dash-host allocated nodes, then the default is to allow oversubscription. If you are running off of RM-allocated nodes, then the default is to NOT allow oversubscription. Flags to override these behaviors are provided, so this only affects the default behavior.
2. both cpus/rank and stride have been removed. The latter was demanded by those who didn't understand the purpose behind it - and I agreed as the users who requested it are no longer using it. The former was removed temporarily pending implementation.
3. vm launch is now the sole method for starting OMPI. It was just too darned hard to maintain multiple launch procedures - maybe someday, provided someone can demonstrate a reason to do so.
As Jeff stated, it is impossible to fully test a change of this size. I have tested it on Linux and Mac, covering all the default and simple options, singletons, and comm_spawn. That said, I'm sure others will find problems, so I'll be watching MTT results until this stabilizes.
This commit was SVN r25476.
2011-11-15 03:40:11 +00:00
|
|
|
if (ORTE_MAPPING_NO_OVERSUBSCRIBE & ORTE_GET_MAPPING_DIRECTIVE(jdata->map->mapping)) {
|
|
|
|
orte_show_help("help-orte-rmaps-base.txt", "orte-rmaps-base:alloc-error",
|
|
|
|
true, node->num_procs, app->app);
|
2016-04-14 05:51:10 -07:00
|
|
|
ORTE_UPDATE_EXIT_STATUS(ORTE_ERROR_DEFAULT_EXIT_CODE);
|
At long last, the fabled revision to the affinity system has arrived. A more detailed explanation of how this all works will be presented here:
https://svn.open-mpi.org/trac/ompi/wiki/ProcessPlacement
The wiki page is incomplete at the moment, but I hope to complete it over the next few days. I will provide updates on the devel list. As the wiki page states, the default and most commonly used options remain unchanged (except as noted below). New, esoteric and complex options have been added, but unless you are a true masochist, you are unlikely to use many of them beyond perhaps an initial curiosity-motivated experimentation.
In a nutshell, this commit revamps the map/rank/bind procedure to take into account topology info on the compute nodes. I have, for the most part, preserved the default behaviors, with three notable exceptions:
1. I have at long last bowed my head in submission to the system admin's of managed clusters. For years, they have complained about our default of allowing users to oversubscribe nodes - i.e., to run more processes on a node than allocated slots. Accordingly, I have modified the default behavior: if you are running off of hostfile/dash-host allocated nodes, then the default is to allow oversubscription. If you are running off of RM-allocated nodes, then the default is to NOT allow oversubscription. Flags to override these behaviors are provided, so this only affects the default behavior.
2. both cpus/rank and stride have been removed. The latter was demanded by those who didn't understand the purpose behind it - and I agreed as the users who requested it are no longer using it. The former was removed temporarily pending implementation.
3. vm launch is now the sole method for starting OMPI. It was just too darned hard to maintain multiple launch procedures - maybe someday, provided someone can demonstrate a reason to do so.
As Jeff stated, it is impossible to fully test a change of this size. I have tested it on Linux and Mac, covering all the default and simple options, singletons, and comm_spawn. That said, I'm sure others will find problems, so I'll be watching MTT results until this stabilizes.
This commit was SVN r25476.
2011-11-15 03:40:11 +00:00
|
|
|
rc = ORTE_ERR_SILENT;
|
2008-04-17 13:50:59 +00:00
|
|
|
goto error;
|
|
|
|
}
|
At long last, the fabled revision to the affinity system has arrived. A more detailed explanation of how this all works will be presented here:
https://svn.open-mpi.org/trac/ompi/wiki/ProcessPlacement
The wiki page is incomplete at the moment, but I hope to complete it over the next few days. I will provide updates on the devel list. As the wiki page states, the default and most commonly used options remain unchanged (except as noted below). New, esoteric and complex options have been added, but unless you are a true masochist, you are unlikely to use many of them beyond perhaps an initial curiosity-motivated experimentation.
In a nutshell, this commit revamps the map/rank/bind procedure to take into account topology info on the compute nodes. I have, for the most part, preserved the default behaviors, with three notable exceptions:
1. I have at long last bowed my head in submission to the system admin's of managed clusters. For years, they have complained about our default of allowing users to oversubscribe nodes - i.e., to run more processes on a node than allocated slots. Accordingly, I have modified the default behavior: if you are running off of hostfile/dash-host allocated nodes, then the default is to allow oversubscription. If you are running off of RM-allocated nodes, then the default is to NOT allow oversubscription. Flags to override these behaviors are provided, so this only affects the default behavior.
2. both cpus/rank and stride have been removed. The latter was demanded by those who didn't understand the purpose behind it - and I agreed as the users who requested it are no longer using it. The former was removed temporarily pending implementation.
3. vm launch is now the sole method for starting OMPI. It was just too darned hard to maintain multiple launch procedures - maybe someday, provided someone can demonstrate a reason to do so.
As Jeff stated, it is impossible to fully test a change of this size. I have tested it on Linux and Mac, covering all the default and simple options, singletons, and comm_spawn. That said, I'm sure others will find problems, so I'll be watching MTT results until this stabilizes.
This commit was SVN r25476.
2011-11-15 03:40:11 +00:00
|
|
|
/* flag the node as oversubscribed so that sched-yield gets
|
|
|
|
* properly set
|
|
|
|
*/
|
2014-06-01 16:14:10 +00:00
|
|
|
ORTE_FLAG_SET(node, ORTE_NODE_FLAG_OVERSUBSCRIBED);
|
2016-12-15 07:58:52 -08:00
|
|
|
ORTE_FLAG_SET(jdata, ORTE_JOB_FLAG_OVERSUBSCRIBED);
|
2015-12-25 13:48:52 +09:00
|
|
|
/* check for permission */
|
|
|
|
if (ORTE_FLAG_TEST(node, ORTE_NODE_FLAG_SLOTS_GIVEN)) {
|
|
|
|
/* if we weren't given a directive either way, then we will error out
|
|
|
|
* as the #slots were specifically given, either by the host RM or
|
|
|
|
* via hostfile/dash-host */
|
2018-01-26 21:35:42 -08:00
|
|
|
if (!(ORTE_MAPPING_SUBSCRIBE_GIVEN & ORTE_GET_MAPPING_DIRECTIVE(jdata->map->mapping))) {
|
2015-12-25 13:48:52 +09:00
|
|
|
orte_show_help("help-orte-rmaps-base.txt", "orte-rmaps-base:alloc-error",
|
|
|
|
true, app->num_procs, app->app);
|
2016-04-14 05:51:10 -07:00
|
|
|
ORTE_UPDATE_EXIT_STATUS(ORTE_ERROR_DEFAULT_EXIT_CODE);
|
2015-12-25 13:48:52 +09:00
|
|
|
return ORTE_ERR_SILENT;
|
|
|
|
} else if (ORTE_MAPPING_NO_OVERSUBSCRIBE & ORTE_GET_MAPPING_DIRECTIVE(jdata->map->mapping)) {
|
|
|
|
/* if we were explicitly told not to oversubscribe, then don't */
|
|
|
|
orte_show_help("help-orte-rmaps-base.txt", "orte-rmaps-base:alloc-error",
|
|
|
|
true, app->num_procs, app->app);
|
2016-04-14 05:51:10 -07:00
|
|
|
ORTE_UPDATE_EXIT_STATUS(ORTE_ERROR_DEFAULT_EXIT_CODE);
|
2015-12-25 13:48:52 +09:00
|
|
|
return ORTE_ERR_SILENT;
|
|
|
|
}
|
|
|
|
}
|
2008-04-17 13:50:59 +00:00
|
|
|
}
|
2011-12-05 22:01:08 +00:00
|
|
|
/* assign the vpid */
|
|
|
|
proc->name.vpid = vpid++;
|
2014-11-30 11:47:34 -08:00
|
|
|
opal_output_verbose(5, orte_rmaps_base_framework.framework_output,
|
|
|
|
"mca:rmaps:seq: assign proc %s to node %s for app %s",
|
|
|
|
ORTE_VPID_PRINT(proc->name.vpid), sq->hostname, app->app);
|
At long last, the fabled revision to the affinity system has arrived. A more detailed explanation of how this all works will be presented here:
https://svn.open-mpi.org/trac/ompi/wiki/ProcessPlacement
The wiki page is incomplete at the moment, but I hope to complete it over the next few days. I will provide updates on the devel list. As the wiki page states, the default and most commonly used options remain unchanged (except as noted below). New, esoteric and complex options have been added, but unless you are a true masochist, you are unlikely to use many of them beyond perhaps an initial curiosity-motivated experimentation.
In a nutshell, this commit revamps the map/rank/bind procedure to take into account topology info on the compute nodes. I have, for the most part, preserved the default behaviors, with three notable exceptions:
1. I have at long last bowed my head in submission to the system admin's of managed clusters. For years, they have complained about our default of allowing users to oversubscribe nodes - i.e., to run more processes on a node than allocated slots. Accordingly, I have modified the default behavior: if you are running off of hostfile/dash-host allocated nodes, then the default is to allow oversubscription. If you are running off of RM-allocated nodes, then the default is to NOT allow oversubscription. Flags to override these behaviors are provided, so this only affects the default behavior.
2. both cpus/rank and stride have been removed. The latter was demanded by those who didn't understand the purpose behind it - and I agreed as the users who requested it are no longer using it. The former was removed temporarily pending implementation.
3. vm launch is now the sole method for starting OMPI. It was just too darned hard to maintain multiple launch procedures - maybe someday, provided someone can demonstrate a reason to do so.
As Jeff stated, it is impossible to fully test a change of this size. I have tested it on Linux and Mac, covering all the default and simple options, singletons, and comm_spawn. That said, I'm sure others will find problems, so I'll be watching MTT results until this stabilizes.
This commit was SVN r25476.
2011-11-15 03:40:11 +00:00
|
|
|
|
2015-09-04 16:54:40 -07:00
|
|
|
/* record the cpuset, if given */
|
|
|
|
if (NULL != sq->cpuset) {
|
|
|
|
hwloc_cpuset_t bitmap;
|
|
|
|
char *cpu_bitmap;
|
2017-01-17 21:02:59 -08:00
|
|
|
if (NULL == node->topology || NULL == node->topology->topo) {
|
2015-09-04 16:54:40 -07:00
|
|
|
/* not allowed - for sequential cpusets, we must have
|
|
|
|
* the topology info
|
|
|
|
*/
|
|
|
|
orte_show_help("help-orte-rmaps-base.txt", "rmaps:no-topology", true, node->name);
|
|
|
|
rc = ORTE_ERR_SILENT;
|
|
|
|
goto error;
|
|
|
|
}
|
|
|
|
/* if we are using hwthreads as cpus and binding to hwthreads, then
|
|
|
|
* we can just copy the cpuset across as it already specifies things
|
|
|
|
* at that level */
|
|
|
|
if (opal_hwloc_use_hwthreads_as_cpus &&
|
|
|
|
OPAL_BIND_TO_HWTHREAD == OPAL_GET_BINDING_POLICY(opal_hwloc_binding_policy)) {
|
|
|
|
cpu_bitmap = strdup(sq->cpuset);
|
|
|
|
} else {
|
|
|
|
/* setup the bitmap */
|
|
|
|
bitmap = hwloc_bitmap_alloc();
|
|
|
|
/* parse the slot_list to find the socket and core */
|
2017-01-24 11:43:14 -08:00
|
|
|
if (ORTE_SUCCESS != (rc = opal_hwloc_base_cpu_list_parse(sq->cpuset, node->topology->topo, rtype, bitmap))) {
|
2015-09-04 16:54:40 -07:00
|
|
|
ORTE_ERROR_LOG(rc);
|
2014-12-19 10:56:14 -08:00
|
|
|
hwloc_bitmap_free(bitmap);
|
2015-09-04 16:54:40 -07:00
|
|
|
goto error;
|
2014-11-30 11:47:34 -08:00
|
|
|
}
|
2015-09-04 16:54:40 -07:00
|
|
|
/* note that we cannot set the proc locale to any specific object
|
|
|
|
* as the slot list may have assigned it to more than one - so
|
|
|
|
* leave that field NULL
|
2014-11-30 11:47:34 -08:00
|
|
|
*/
|
2015-09-04 16:54:40 -07:00
|
|
|
/* set the proc to the specified map */
|
|
|
|
hwloc_bitmap_list_asprintf(&cpu_bitmap, bitmap);
|
|
|
|
hwloc_bitmap_free(bitmap);
|
|
|
|
}
|
|
|
|
orte_set_attribute(&proc->attributes, ORTE_PROC_CPU_BITMAP, ORTE_ATTR_GLOBAL, cpu_bitmap, OPAL_STRING);
|
|
|
|
opal_output_verbose(5, orte_rmaps_base_framework.framework_output,
|
|
|
|
"mca:rmaps:seq: binding proc %s to cpuset %s bitmap %s",
|
|
|
|
ORTE_VPID_PRINT(proc->name.vpid), sq->cpuset, cpu_bitmap);
|
|
|
|
/* we are going to bind to cpuset since the user is specifying the cpus */
|
|
|
|
OPAL_SET_BINDING_POLICY(jdata->map->binding, OPAL_BIND_TO_CPUSET);
|
|
|
|
/* note that the user specified the mapping */
|
|
|
|
ORTE_SET_MAPPING_POLICY(jdata->map->mapping, ORTE_MAPPING_BYUSER);
|
|
|
|
ORTE_SET_MAPPING_DIRECTIVE(jdata->map->mapping, ORTE_MAPPING_GIVEN);
|
|
|
|
/* cleanup */
|
|
|
|
free(cpu_bitmap);
|
|
|
|
} else {
|
|
|
|
hwloc_obj_t locale;
|
|
|
|
|
|
|
|
/* assign the locale - okay for the topo to be null as
|
|
|
|
* it just means it wasn't returned
|
|
|
|
*/
|
2017-01-17 21:02:59 -08:00
|
|
|
if (NULL != node->topology && NULL != node->topology->topo) {
|
|
|
|
locale = hwloc_get_root_obj(node->topology->topo);
|
2015-09-04 16:54:40 -07:00
|
|
|
orte_set_attribute(&proc->attributes, ORTE_PROC_HWLOC_LOCALE,
|
|
|
|
ORTE_ATTR_LOCAL, locale, OPAL_PTR);
|
2014-06-01 16:14:10 +00:00
|
|
|
}
|
At long last, the fabled revision to the affinity system has arrived. A more detailed explanation of how this all works will be presented here:
https://svn.open-mpi.org/trac/ompi/wiki/ProcessPlacement
The wiki page is incomplete at the moment, but I hope to complete it over the next few days. I will provide updates on the devel list. As the wiki page states, the default and most commonly used options remain unchanged (except as noted below). New, esoteric and complex options have been added, but unless you are a true masochist, you are unlikely to use many of them beyond perhaps an initial curiosity-motivated experimentation.
In a nutshell, this commit revamps the map/rank/bind procedure to take into account topology info on the compute nodes. I have, for the most part, preserved the default behaviors, with three notable exceptions:
1. I have at long last bowed my head in submission to the system admin's of managed clusters. For years, they have complained about our default of allowing users to oversubscribe nodes - i.e., to run more processes on a node than allocated slots. Accordingly, I have modified the default behavior: if you are running off of hostfile/dash-host allocated nodes, then the default is to allow oversubscription. If you are running off of RM-allocated nodes, then the default is to NOT allow oversubscription. Flags to override these behaviors are provided, so this only affects the default behavior.
2. both cpus/rank and stride have been removed. The latter was demanded by those who didn't understand the purpose behind it - and I agreed as the users who requested it are no longer using it. The former was removed temporarily pending implementation.
3. vm launch is now the sole method for starting OMPI. It was just too darned hard to maintain multiple launch procedures - maybe someday, provided someone can demonstrate a reason to do so.
As Jeff stated, it is impossible to fully test a change of this size. I have tested it on Linux and Mac, covering all the default and simple options, singletons, and comm_spawn. That said, I'm sure others will find problems, so I'll be watching MTT results until this stabilizes.
This commit was SVN r25476.
2011-11-15 03:40:11 +00:00
|
|
|
}
|
2011-06-23 20:38:02 +00:00
|
|
|
|
2009-08-11 02:51:27 +00:00
|
|
|
/* add to the jdata proc array */
|
|
|
|
if (ORTE_SUCCESS != (rc = opal_pointer_array_set_item(jdata->procs, proc->name.vpid, proc))) {
|
|
|
|
ORTE_ERROR_LOG(rc);
|
|
|
|
goto error;
|
|
|
|
}
|
2008-04-17 13:50:59 +00:00
|
|
|
/* move to next node */
|
2014-11-30 11:47:34 -08:00
|
|
|
sq = (seq_node_t*)opal_list_get_next(&sq->super);
|
2008-04-01 20:03:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/** track the total number of processes we mapped */
|
|
|
|
jdata->num_procs += app->num_procs;
|
2015-06-23 20:59:57 -07:00
|
|
|
|
2008-04-17 13:50:59 +00:00
|
|
|
/* cleanup the node list if it came from this app_context */
|
2014-11-30 11:47:34 -08:00
|
|
|
if (seq_list != &default_seq_list) {
|
|
|
|
OPAL_LIST_DESTRUCT(seq_list);
|
2009-08-11 02:51:27 +00:00
|
|
|
} else {
|
2014-11-30 11:47:34 -08:00
|
|
|
save = sq;
|
2008-04-01 20:03:49 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-05-12 16:16:47 -07:00
|
|
|
/* mark that this job is to be fully
|
|
|
|
* described in the launch msg */
|
|
|
|
orte_set_attribute(&jdata->attributes, ORTE_JOB_FULLY_DESCRIBED, ORTE_ATTR_GLOBAL, NULL, OPAL_BOOL);
|
|
|
|
|
2008-04-01 20:03:49 +00:00
|
|
|
return ORTE_SUCCESS;
|
|
|
|
|
At long last, the fabled revision to the affinity system has arrived. A more detailed explanation of how this all works will be presented here:
https://svn.open-mpi.org/trac/ompi/wiki/ProcessPlacement
The wiki page is incomplete at the moment, but I hope to complete it over the next few days. I will provide updates on the devel list. As the wiki page states, the default and most commonly used options remain unchanged (except as noted below). New, esoteric and complex options have been added, but unless you are a true masochist, you are unlikely to use many of them beyond perhaps an initial curiosity-motivated experimentation.
In a nutshell, this commit revamps the map/rank/bind procedure to take into account topology info on the compute nodes. I have, for the most part, preserved the default behaviors, with three notable exceptions:
1. I have at long last bowed my head in submission to the system admin's of managed clusters. For years, they have complained about our default of allowing users to oversubscribe nodes - i.e., to run more processes on a node than allocated slots. Accordingly, I have modified the default behavior: if you are running off of hostfile/dash-host allocated nodes, then the default is to allow oversubscription. If you are running off of RM-allocated nodes, then the default is to NOT allow oversubscription. Flags to override these behaviors are provided, so this only affects the default behavior.
2. both cpus/rank and stride have been removed. The latter was demanded by those who didn't understand the purpose behind it - and I agreed as the users who requested it are no longer using it. The former was removed temporarily pending implementation.
3. vm launch is now the sole method for starting OMPI. It was just too darned hard to maintain multiple launch procedures - maybe someday, provided someone can demonstrate a reason to do so.
As Jeff stated, it is impossible to fully test a change of this size. I have tested it on Linux and Mac, covering all the default and simple options, singletons, and comm_spawn. That said, I'm sure others will find problems, so I'll be watching MTT results until this stabilizes.
This commit was SVN r25476.
2011-11-15 03:40:11 +00:00
|
|
|
error:
|
2014-11-30 11:47:34 -08:00
|
|
|
OPAL_LIST_DESTRUCT(&default_seq_list);
|
|
|
|
return rc;
|
|
|
|
}
|
|
|
|
|
|
|
|
static char *orte_getline(FILE *fp)
|
|
|
|
{
|
|
|
|
char *ret, *buff;
|
|
|
|
char input[1024];
|
|
|
|
|
|
|
|
ret = fgets(input, 1024, fp);
|
|
|
|
if (NULL != ret) {
|
2017-01-17 21:02:59 -08:00
|
|
|
input[strlen(input)-1] = '\0'; /* remove newline */
|
|
|
|
buff = strdup(input);
|
|
|
|
return buff;
|
2008-04-01 20:03:49 +00:00
|
|
|
}
|
2015-06-23 20:59:57 -07:00
|
|
|
|
2014-11-30 11:47:34 -08:00
|
|
|
return NULL;
|
2008-04-01 20:03:49 +00:00
|
|
|
}
|