1
1

Merge pull request #6874 from rhc54/cmr40/lsf

v4.0.x: Allow individual jobs to set map policy, override LSF bindfile
Этот коммит содержится в:
Geoff Paulsen 2019-08-08 16:37:04 -05:00 коммит произвёл GitHub
родитель e547a2b94d f0f25b60a8
Коммит 6d62fb02ec
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
3 изменённых файлов: 16 добавлений и 23 удалений

Просмотреть файл

@ -10,7 +10,7 @@
* Copyright (c) 2004-2005 The Regents of the University of California. * Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved. * All rights reserved.
* Copyright (c) 2007-2017 Cisco Systems, Inc. All rights reserved * Copyright (c) 2007-2017 Cisco Systems, Inc. All rights reserved
* Copyright (c) 2014 Intel, Inc. All rights reserved * Copyright (c) 2014-2019 Intel, Inc. All rights reserved.
* Copyright (c) 2016 IBM Corporation. All rights reserved. * Copyright (c) 2016 IBM Corporation. All rights reserved.
* $COPYRIGHT$ * $COPYRIGHT$
* *
@ -36,6 +36,7 @@
#include "orte/mca/rmaps/rmaps_types.h" #include "orte/mca/rmaps/rmaps_types.h"
#include "orte/mca/errmgr/errmgr.h" #include "orte/mca/errmgr/errmgr.h"
#include "orte/mca/rmaps/base/base.h"
#include "orte/runtime/orte_globals.h" #include "orte/runtime/orte_globals.h"
#include "orte/util/show_help.h" #include "orte/util/show_help.h"
@ -70,6 +71,7 @@ static int allocate(orte_job_t *jdata, opal_list_t *nodes)
char *affinity_file; char *affinity_file;
struct stat buf; struct stat buf;
char *ptr; char *ptr;
bool directives_given = false;
/* get the list of allocated nodes */ /* get the list of allocated nodes */
if ((num_nodes = lsb_getalloc(&nodelist)) < 0) { if ((num_nodes = lsb_getalloc(&nodelist)) < 0) {
@ -112,8 +114,19 @@ static int allocate(orte_job_t *jdata, opal_list_t *nodes)
/* release the nodelist from lsf */ /* release the nodelist from lsf */
opal_argv_free(nodelist); opal_argv_free(nodelist);
/* check to see if any mapping or binding directives were given */
if (NULL != jdata && NULL != jdata->map) {
if ((ORTE_MAPPING_GIVEN & ORTE_GET_MAPPING_DIRECTIVE(jdata->map->mapping)) ||
OPAL_BINDING_POLICY_IS_SET(jdata->map->binding)) {
directives_given = true;
}
} else if ((ORTE_MAPPING_GIVEN & ORTE_GET_MAPPING_DIRECTIVE(orte_rmaps_base.mapping)) ||
OPAL_BINDING_POLICY_IS_SET(opal_hwloc_binding_policy)) {
directives_given = true;
}
/* check for an affinity file */ /* check for an affinity file */
if (NULL != (affinity_file = getenv("LSB_AFFINITY_HOSTFILE"))) { if (!directives_given && NULL != (affinity_file = getenv("LSB_AFFINITY_HOSTFILE"))) {
/* check to see if the file is empty - if it is, /* check to see if the file is empty - if it is,
* then affinity wasn't actually set for this job */ * then affinity wasn't actually set for this job */
if (0 != stat(affinity_file, &buf)) { if (0 != stat(affinity_file, &buf)) {

Просмотреть файл

@ -556,6 +556,7 @@ static int check_modifiers(char *ck, orte_mapping_policy_t *tmp)
for (i=0; NULL != ck2[i]; i++) { for (i=0; NULL != ck2[i]; i++) {
if (0 == strncasecmp(ck2[i], "span", strlen(ck2[i]))) { if (0 == strncasecmp(ck2[i], "span", strlen(ck2[i]))) {
ORTE_SET_MAPPING_DIRECTIVE(*tmp, ORTE_MAPPING_SPAN); ORTE_SET_MAPPING_DIRECTIVE(*tmp, ORTE_MAPPING_SPAN);
ORTE_SET_MAPPING_DIRECTIVE(*tmp, ORTE_MAPPING_GIVEN);
found = true; found = true;
} else if (0 == strncasecmp(ck2[i], "pe", strlen("pe"))) { } else if (0 == strncasecmp(ck2[i], "pe", strlen("pe"))) {
/* break this at the = sign to get the number */ /* break this at the = sign to get the number */

Просмотреть файл

@ -302,13 +302,6 @@ int pmix_server_spawn_fn(opal_process_name_t *requestor,
/*** MAP-BY ***/ /*** MAP-BY ***/
} else if (0 == strcmp(info->key, OPAL_PMIX_MAPBY)) { } else if (0 == strcmp(info->key, OPAL_PMIX_MAPBY)) {
if (ORTE_MAPPING_POLICY_IS_SET(jdata->map->mapping)) {
/* not allowed to provide multiple mapping policies */
orte_show_help("help-orte-rmaps-base.txt", "redefining-policy",
true, "mapping", info->data.string,
orte_rmaps_base_print_mapping(orte_rmaps_base.mapping));
return ORTE_ERR_BAD_PARAM;
}
rc = orte_rmaps_base_set_mapping_policy(jdata, &jdata->map->mapping, rc = orte_rmaps_base_set_mapping_policy(jdata, &jdata->map->mapping,
NULL, info->data.string); NULL, info->data.string);
if (ORTE_SUCCESS != rc) { if (ORTE_SUCCESS != rc) {
@ -317,13 +310,6 @@ int pmix_server_spawn_fn(opal_process_name_t *requestor,
/*** RANK-BY ***/ /*** RANK-BY ***/
} else if (0 == strcmp(info->key, OPAL_PMIX_RANKBY)) { } else if (0 == strcmp(info->key, OPAL_PMIX_RANKBY)) {
if (ORTE_RANKING_POLICY_IS_SET(jdata->map->ranking)) {
/* not allowed to provide multiple ranking policies */
orte_show_help("help-orte-rmaps-base.txt", "redefining-policy",
true, "ranking", info->data.string,
orte_rmaps_base_print_ranking(orte_rmaps_base.ranking));
return ORTE_ERR_BAD_PARAM;
}
rc = orte_rmaps_base_set_ranking_policy(&jdata->map->ranking, rc = orte_rmaps_base_set_ranking_policy(&jdata->map->ranking,
jdata->map->mapping, jdata->map->mapping,
info->data.string); info->data.string);
@ -333,13 +319,6 @@ int pmix_server_spawn_fn(opal_process_name_t *requestor,
/*** BIND-TO ***/ /*** BIND-TO ***/
} else if (0 == strcmp(info->key, OPAL_PMIX_BINDTO)) { } else if (0 == strcmp(info->key, OPAL_PMIX_BINDTO)) {
if (OPAL_BINDING_POLICY_IS_SET(jdata->map->binding)) {
/* not allowed to provide multiple mapping policies */
orte_show_help("help-opal-hwloc-base.txt", "redefining-policy", true,
info->data.string,
opal_hwloc_base_print_binding(opal_hwloc_binding_policy));
return ORTE_ERR_BAD_PARAM;
}
rc = opal_hwloc_base_set_binding_policy(&jdata->map->binding, rc = opal_hwloc_base_set_binding_policy(&jdata->map->binding,
info->data.string); info->data.string);
if (ORTE_SUCCESS != rc) { if (ORTE_SUCCESS != rc) {