Add a new option to launch "pernode" - launches one process/node across all available nodes.
The other options also work correctly: "-bynode" with no -np will launch on all *slots*, mapped on a per-node basis. This commit was SVN r12063.
Этот коммит содержится в:
родитель
efe28d62e9
Коммит
98dd57b70e
@ -55,8 +55,12 @@ extern "C" {
|
||||
opal_list_t rmaps_opened;
|
||||
/** Sorted list of available components (highest priority first) */
|
||||
opal_list_t rmaps_available;
|
||||
/* map by node or not */
|
||||
bool bynode;
|
||||
/** whether or not we allow oversubscription of nodes */
|
||||
bool oversubscribe;
|
||||
/** do we want one ppn if num_procs not specified */
|
||||
bool per_node;
|
||||
} orte_rmaps_base_t;
|
||||
ORTE_DECLSPEC OBJ_CLASS_DECLARATION(orte_rmaps_base_t);
|
||||
/**
|
||||
|
@ -92,6 +92,15 @@ int orte_rmaps_base_open(void)
|
||||
mca_base_param_set_string(param, "node");
|
||||
}
|
||||
|
||||
/* Do we want one ppn if num_procs not specified */
|
||||
param = mca_base_param_reg_int_name("rmaps", "base_pernode",
|
||||
"Request one ppn if num procs not specified",
|
||||
false, false, 0, &value);
|
||||
|
||||
if ((int)true == value) {
|
||||
orte_rmaps_base.per_node = true;
|
||||
}
|
||||
|
||||
/* Should we schedule on the local node or not? */
|
||||
|
||||
mca_base_param_reg_int_name("rmaps", "base_schedule_local",
|
||||
|
@ -41,6 +41,7 @@
|
||||
#include "orte/mca/rmgr/rmgr.h"
|
||||
|
||||
#include "orte/mca/rmaps/base/rmaps_private.h"
|
||||
#include "orte/mca/rmaps/base/base.h"
|
||||
#include "rmaps_rr.h"
|
||||
|
||||
|
||||
@ -243,7 +244,7 @@ static int orte_rmaps_rr_map(orte_jobid_t jobid, char *ignore)
|
||||
orte_vpid_t vpid_start, job_vpid_start=0;
|
||||
orte_std_cntr_t num_procs = 0, total_num_slots, mapped_num_slots;
|
||||
int rc;
|
||||
bool bynode = true, modify_app_context = false;
|
||||
bool modify_app_context = false;
|
||||
|
||||
OPAL_TRACE(1);
|
||||
|
||||
@ -263,13 +264,6 @@ static int orte_rmaps_rr_map(orte_jobid_t jobid, char *ignore)
|
||||
return rc;
|
||||
}
|
||||
|
||||
/* which policy should we use? */
|
||||
if (0 == strcmp(mca_rmaps_round_robin_component.schedule_policy, "node")) {
|
||||
bynode = true;
|
||||
} else {
|
||||
bynode = false;
|
||||
}
|
||||
|
||||
/* query for all nodes allocated to this job - this will become our master list of
|
||||
* nodes. From this, we will construct a working list of nodes based on any specified
|
||||
* mappings from the user
|
||||
@ -330,8 +324,14 @@ static int orte_rmaps_rr_map(orte_jobid_t jobid, char *ignore)
|
||||
cur_node_item = opal_list_get_first(working_node_list);
|
||||
|
||||
if (0 == app->num_procs) {
|
||||
/** set the num_procs to equal the number of slots on these mapped nodes */
|
||||
app->num_procs = mapped_num_slots;
|
||||
/** set the num_procs to equal the number of slots on these mapped nodes - if
|
||||
user has specified "-pernode", then set it to the number of nodes
|
||||
*/
|
||||
if (orte_rmaps_base.per_node) {
|
||||
app->num_procs = opal_list_get_size(&mapped_node_list);
|
||||
} else {
|
||||
app->num_procs = mapped_num_slots;
|
||||
}
|
||||
modify_app_context = true;
|
||||
}
|
||||
}
|
||||
@ -344,8 +344,14 @@ static int orte_rmaps_rr_map(orte_jobid_t jobid, char *ignore)
|
||||
working_node_list = &master_node_list;
|
||||
|
||||
if (0 == app->num_procs) {
|
||||
/** set the num_procs to equal the number of slots on all available nodes */
|
||||
app->num_procs = total_num_slots;
|
||||
/** set the num_procs to equal the number of slots on these mapped nodes - if
|
||||
user has specified "-pernode", then set it to the number of nodes
|
||||
*/
|
||||
if (orte_rmaps_base.per_node) {
|
||||
app->num_procs = opal_list_get_size(&master_node_list);
|
||||
} else {
|
||||
app->num_procs = total_num_slots;
|
||||
}
|
||||
modify_app_context = true;
|
||||
}
|
||||
}
|
||||
@ -366,7 +372,7 @@ static int orte_rmaps_rr_map(orte_jobid_t jobid, char *ignore)
|
||||
num_procs += app->num_procs;
|
||||
|
||||
/* Make assignments */
|
||||
if (bynode) {
|
||||
if (orte_rmaps_base.bynode) {
|
||||
rc = map_app_by_node(app, map, jobid, vpid_start, working_node_list, &max_used_nodes);
|
||||
} else {
|
||||
rc = map_app_by_slot(app, map, jobid, vpid_start, working_node_list, &max_used_nodes);
|
||||
|
@ -36,7 +36,6 @@ struct orte_rmaps_round_robin_component_t {
|
||||
orte_rmaps_base_component_t super;
|
||||
int debug;
|
||||
int priority;
|
||||
char *schedule_policy;
|
||||
};
|
||||
typedef struct orte_rmaps_round_robin_component_t orte_rmaps_round_robin_component_t;
|
||||
|
||||
|
@ -70,8 +70,6 @@ orte_rmaps_round_robin_component_t mca_rmaps_round_robin_component = {
|
||||
*/
|
||||
static int orte_rmaps_round_robin_open(void)
|
||||
{
|
||||
int id;
|
||||
|
||||
mca_base_param_reg_int(&mca_rmaps_round_robin_component.super.rmaps_version, "debug",
|
||||
"Toggle debug output for Round Robin RMAPS component",
|
||||
false, false, 1,
|
||||
@ -82,19 +80,6 @@ static int orte_rmaps_round_robin_open(void)
|
||||
false, false, 1,
|
||||
&mca_rmaps_round_robin_component.priority);
|
||||
|
||||
/* JMS To be changed post-beta to LAM's C/N command line notation */
|
||||
|
||||
id = mca_base_param_find("rmaps_base", NULL, "schedule_policy");
|
||||
if (0 > id) {
|
||||
id = mca_base_param_reg_string_name("rmaps_base", "schedule_policy",
|
||||
"Scheduling Policy for RMAPS. [slot | node]",
|
||||
false, false, "slot",
|
||||
&mca_rmaps_round_robin_component.schedule_policy);
|
||||
}
|
||||
else {
|
||||
mca_base_param_lookup_string(id, &mca_rmaps_round_robin_component.schedule_policy);
|
||||
}
|
||||
|
||||
return ORTE_SUCCESS;
|
||||
}
|
||||
|
||||
@ -117,10 +102,6 @@ orte_rmaps_round_robin_init(int *priority)
|
||||
|
||||
static int orte_rmaps_round_robin_close(void)
|
||||
{
|
||||
if (NULL != mca_rmaps_round_robin_component.schedule_policy) {
|
||||
free(mca_rmaps_round_robin_component.schedule_policy);
|
||||
}
|
||||
|
||||
return ORTE_SUCCESS;
|
||||
}
|
||||
|
||||
|
@ -108,6 +108,7 @@ struct globals_t {
|
||||
bool no_wait_for_job_completion;
|
||||
bool by_node;
|
||||
bool by_slot;
|
||||
bool per_node;
|
||||
bool no_oversubscribe;
|
||||
bool debugger;
|
||||
bool no_local_schedule;
|
||||
@ -190,6 +191,9 @@ opal_cmd_line_init_t cmd_line_init[] = {
|
||||
{ NULL, NULL, NULL, '\0', "byslot", "byslot", 0,
|
||||
&orterun_globals.by_slot, OPAL_CMD_LINE_TYPE_BOOL,
|
||||
"Whether to allocate/map processes round-robin by slot (the default)" },
|
||||
{ NULL, NULL, NULL, '\0', "pernode", "pernode", 0,
|
||||
&orterun_globals.per_node, OPAL_CMD_LINE_TYPE_BOOL,
|
||||
"If no number of process is specified, this will cause one process per available node to be executed" },
|
||||
{ NULL, NULL, NULL, '\0', "nooversubscribe", "nooversubscribe", 0,
|
||||
&orterun_globals.no_oversubscribe, OPAL_CMD_LINE_TYPE_BOOL,
|
||||
"Nodes are not to be oversubscribed, even if the system supports such operation"},
|
||||
@ -783,6 +787,7 @@ static int init_globals(void)
|
||||
/* no_wait = */ false,
|
||||
/* by_node = */ false,
|
||||
/* by_slot = */ false,
|
||||
/* per_node = */ false,
|
||||
/* no_oversub = */ false,
|
||||
/* debugger = */ false,
|
||||
/* no_local = */ false,
|
||||
@ -897,7 +902,22 @@ static int parse_globals(int argc, char* argv[])
|
||||
/* Default */
|
||||
orterun_globals.by_slot = true;
|
||||
}
|
||||
|
||||
|
||||
/* did the user request "pernode", indicating we are to spawn one ppn
|
||||
* if no np is provided
|
||||
*/
|
||||
if (orterun_globals.per_node) {
|
||||
id = mca_base_param_reg_int_name("rmaps", "base_pernode",
|
||||
"Request one ppn if num procs not specified",
|
||||
false, false, 0, &ret);
|
||||
|
||||
if (orterun_globals.per_node) {
|
||||
mca_base_param_set_int(id, (int)true);
|
||||
} else {
|
||||
mca_base_param_set_int(id, (int)false);
|
||||
}
|
||||
}
|
||||
|
||||
/** Do we want to disallow oversubscription of nodes? */
|
||||
id = mca_base_param_reg_int_name("rmaps", "base_no_oversubscribe",
|
||||
"If nonzero, do not allow oversubscription of processes on nodes. If zero (default), oversubscription is allowed.",
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user