1
1

This doesn't totally resolve the comm_spawn problem, but it helps a little. I'll continue working on it and hope to resolve it completely shortly. The issue primarily centers on where to start mapping the child job's processes, and how to deal with oversubscription that might result. At the moment, I am trying to resolve the first issue first (hey, that even sounds right!).

This change does a couple of things:

1. Since the USE_PARENT_ALLOC attribute is a directive about regarding allocation of resources to a job, it more properly should be an attribute of the RAS. Change the name to reflect that and move the attribute define to the ras_types.h file.

2. Add the attributes list to the RMAPS map_job interface. This provides us with the desired flexibility to dynamically specify directives for mapping. The system will - in the absence of any attribute-based directive - default to the values provided in the MCA parameters (either from environment or command-line interface).

This commit was SVN r12164.
Этот коммит содержится в:
Ralph Castain 2006-10-18 14:01:44 +00:00
родитель 252a9cea34
Коммит f4a458532b
26 изменённых файлов: 205 добавлений и 47 удалений

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

@ -46,6 +46,7 @@
#include "orte/mca/ns/ns.h"
#include "orte/mca/gpr/gpr.h"
#include "orte/mca/errmgr/errmgr.h"
#include "orte/mca/ras/ras_types.h"
#include "orte/mca/rmgr/rmgr.h"
#include "orte/mca/rmgr/base/base.h"
#include "orte/mca/smr/smr_types.h"
@ -546,7 +547,7 @@ ompi_comm_start_processes(int count, char **array_of_commands,
/* tell the RTE that we want to the children to run inside of our allocation -
* don't go get one just for them
*/
if (ORTE_SUCCESS != (rc = orte_rmgr.add_attribute(&attributes, ORTE_RMGR_USE_PARENT_ALLOCATION,
if (ORTE_SUCCESS != (rc = orte_rmgr.add_attribute(&attributes, ORTE_RAS_USE_PARENT_ALLOCATION,
ORTE_JOBID, &(orte_process_info.my_name->jobid)))) {
ORTE_ERROR_LOG(rc);
OBJ_DESTRUCT(&attributes);

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

@ -251,7 +251,7 @@ static int orte_ras_bjs_allocate(orte_jobid_t jobid, opal_list_t *attributes)
* jobid's allocation. This can occur if we are doing a dynamic
* process spawn and don't want to go through the allocator again
*/
if (NULL != (attr = orte_rmgr.find_attribute(attributes, ORTE_RMGR_USE_PARENT_ALLOCATION))) {
if (NULL != (attr = orte_rmgr.find_attribute(attributes, ORTE_RAS_USE_PARENT_ALLOCATION))) {
/* attribute was given - just reallocate to the new jobid */
if (ORTE_SUCCESS != (rc = orte_dss.get((void**)&jptr, attr->value, ORTE_JOBID))) {
ORTE_ERROR_LOG(rc);

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

@ -83,7 +83,7 @@ static int orte_ras_dash_host_allocate(orte_jobid_t jobid, opal_list_t *attribut
* jobid's allocation. This can occur if we are doing a dynamic
* process spawn and don't want to go through the allocator again
*/
if (NULL != (attr = orte_rmgr.find_attribute(attributes, ORTE_RMGR_USE_PARENT_ALLOCATION))) {
if (NULL != (attr = orte_rmgr.find_attribute(attributes, ORTE_RAS_USE_PARENT_ALLOCATION))) {
/* attribute was given - just reallocate to the new jobid */
if (ORTE_SUCCESS != (rc = orte_dss.get((void**)&jptr, attr->value, ORTE_JOBID))) {
ORTE_ERROR_LOG(rc);

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

@ -85,7 +85,7 @@ static int orte_ras_gridengine_allocate(orte_jobid_t jobid, opal_list_t *attribu
* jobid's allocation. This can occur if we are doing a dynamic
* process spawn and don't want to go through the allocator again
*/
if (NULL != (attr = orte_rmgr.find_attribute(attributes, ORTE_RMGR_USE_PARENT_ALLOCATION))) {
if (NULL != (attr = orte_rmgr.find_attribute(attributes, ORTE_RAS_USE_PARENT_ALLOCATION))) {
/* attribute was given - just reallocate to the new jobid */
if (ORTE_SUCCESS != (rc = orte_dss.get((void**)&jptr, attr->value, ORTE_JOBID))) {
ORTE_ERROR_LOG(rc);

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

@ -97,7 +97,7 @@ static int orte_ras_hostfile_allocate(orte_jobid_t jobid, opal_list_t *attribute
* jobid's allocation. This can occur if we are doing a dynamic
* process spawn and don't want to go through the allocator again
*/
if (NULL != (attr = orte_rmgr.find_attribute(attributes, ORTE_RMGR_USE_PARENT_ALLOCATION))) {
if (NULL != (attr = orte_rmgr.find_attribute(attributes, ORTE_RAS_USE_PARENT_ALLOCATION))) {
/* attribute was given - just reallocate to the new jobid */
if (ORTE_SUCCESS != (rc = orte_dss.get((void**)&jptr, attr->value, ORTE_JOBID))) {
ORTE_ERROR_LOG(rc);

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

@ -96,7 +96,7 @@ static int orte_ras_loadleveler_allocate(orte_jobid_t jobid, opal_list_t *attrib
* jobid's allocation. This can occur if we are doing a dynamic
* process spawn and don't want to go through the allocator again
*/
if (NULL != (attr = orte_rmgr.find_attribute(attributes, ORTE_RMGR_USE_PARENT_ALLOCATION))) {
if (NULL != (attr = orte_rmgr.find_attribute(attributes, ORTE_RAS_USE_PARENT_ALLOCATION))) {
/* attribute was given - just reallocate to the new jobid */
if (ORTE_SUCCESS != (rc = orte_dss.get((void**)&jptr, attr->value, ORTE_JOBID))) {
ORTE_ERROR_LOG(rc);

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

@ -81,7 +81,7 @@ static int orte_ras_localhost_allocate(orte_jobid_t jobid, opal_list_t *attribut
* jobid's allocation. This can occur if we are doing a dynamic
* process spawn and don't want to go through the allocator again
*/
if (NULL != (attr = orte_rmgr.find_attribute(attributes, ORTE_RMGR_USE_PARENT_ALLOCATION))) {
if (NULL != (attr = orte_rmgr.find_attribute(attributes, ORTE_RAS_USE_PARENT_ALLOCATION))) {
/* attribute was given - just reallocate to the new jobid */
if (ORTE_SUCCESS != (ret = orte_dss.get((void**)&jptr, attr->value, ORTE_JOBID))) {
ORTE_ERROR_LOG(ret);

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

@ -29,6 +29,12 @@
extern "C" {
#endif
/*
* RAS Attributes
*/
#define ORTE_RAS_USE_PARENT_ALLOCATION "orte-use-parent-alloc"
/**
* Struct for holding information about a node (a local copy of what
* is in the node segment in the registry).

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

@ -78,7 +78,7 @@ static int allocate(orte_jobid_t jobid, opal_list_t *attributes)
* jobid's allocation. This can occur if we are doing a dynamic
* process spawn and don't want to go through the allocator again
*/
if (NULL != (attr = orte_rmgr.find_attribute(attributes, ORTE_RMGR_USE_PARENT_ALLOCATION))) {
if (NULL != (attr = orte_rmgr.find_attribute(attributes, ORTE_RAS_USE_PARENT_ALLOCATION))) {
/* attribute was given - just reallocate to the new jobid */
if (ORTE_SUCCESS != (ret = orte_dss.get((void**)&jptr, attr->value, ORTE_JOBID))) {
ORTE_ERROR_LOG(ret);

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

@ -81,7 +81,7 @@ static int allocate(orte_jobid_t jobid, opal_list_t *attributes)
* jobid's allocation. This can occur if we are doing a dynamic
* process spawn and don't want to go through the allocator again
*/
if (NULL != (attr = orte_rmgr.find_attribute(attributes, ORTE_RMGR_USE_PARENT_ALLOCATION))) {
if (NULL != (attr = orte_rmgr.find_attribute(attributes, ORTE_RAS_USE_PARENT_ALLOCATION))) {
/* attribute was given - just reallocate to the new jobid */
if (ORTE_SUCCESS != (ret = orte_dss.get((void**)&jptr, attr->value, ORTE_JOBID))) {
ORTE_ERROR_LOG(ret);

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

@ -78,7 +78,7 @@ static int allocate(orte_jobid_t jobid, opal_list_t *attributes)
* jobid's allocation. This can occur if we are doing a dynamic
* process spawn and don't want to go through the allocator again
*/
if (NULL != (attr = orte_rmgr.find_attribute(attributes, ORTE_RMGR_USE_PARENT_ALLOCATION))) {
if (NULL != (attr = orte_rmgr.find_attribute(attributes, ORTE_RAS_USE_PARENT_ALLOCATION))) {
/* attribute was given - just reallocate to the new jobid */
if (ORTE_SUCCESS != (ret = orte_dss.get((void**)&jptr, attr->value, ORTE_JOBID))) {
ORTE_ERROR_LOG(ret);

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

@ -61,6 +61,8 @@ extern "C" {
bool oversubscribe;
/** do we want one ppn if num_procs not specified */
bool per_node;
/* do we not allow use of the localhost */
bool no_use_local;
} orte_rmaps_base_t;
ORTE_DECLSPEC OBJ_CLASS_DECLARATION(orte_rmaps_base_t);
/**

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

@ -25,7 +25,9 @@
#include "opal/mca/mca.h"
#include "opal/mca/base/base.h"
#include "orte/dss/dss.h"
#include "orte/mca/errmgr/errmgr.h"
#include "orte/mca/rmgr/rmgr.h"
#include "orte/mca/rmaps/base/rmaps_private.h"
#include "orte/mca/rmaps/base/base.h"
@ -42,12 +44,83 @@ static orte_rmaps_base_module_t *select_any(void);
* Function for selecting one component from all those that are
* available.
*/
int orte_rmaps_base_map_job(orte_jobid_t job, char *desired_mapper)
int orte_rmaps_base_map_job(orte_jobid_t job, opal_list_t *attributes)
{
orte_rmaps_base_module_t *module=NULL;
orte_attribute_t *attr;
char *desired_mapper;
int rc;
if (NULL != desired_mapper) {
/* check the attributes to see if anything in the environment
* has been overridden. If not, then install the environment
* values to correctly control the behavior of the RMAPS component.
*/
if (NULL == (attr = orte_rmgr.find_attribute(attributes, ORTE_RMAPS_MAP_POLICY))) {
/* was NOT provided - use what was set by the environment */
if (orte_rmaps_base.bynode) {
if (ORTE_SUCCESS != (rc = orte_rmgr.add_attribute(attributes, ORTE_RMAPS_MAP_POLICY,
ORTE_STRING, "bynode"))) {
ORTE_ERROR_LOG(rc);
return rc;
}
} else {
if (ORTE_SUCCESS != (rc = orte_rmgr.add_attribute(attributes, ORTE_RMAPS_MAP_POLICY,
ORTE_STRING, "byslot"))) {
ORTE_ERROR_LOG(rc);
return rc;
}
}
}
if (NULL == (attr = orte_rmgr.find_attribute(attributes, ORTE_RMAPS_PERNODE))) {
/* was NOT provided - add it if it was set by the environment. Note that this
* attribute only cares if it exists - its value is irrelevant and hence
* not provided
*/
if (orte_rmaps_base.per_node) {
if (ORTE_SUCCESS != (rc = orte_rmgr.add_attribute(attributes, ORTE_RMAPS_PERNODE,
ORTE_UNDEF, NULL))) {
ORTE_ERROR_LOG(rc);
return rc;
}
}
}
if (NULL == (attr = orte_rmgr.find_attribute(attributes, ORTE_RMAPS_NO_USE_LOCAL))) {
/* was NOT provided - add it if it was set by the environment. Note that this
* attribute only cares if it exists - its value is irrelevant and hence
* not provided
*/
if (orte_rmaps_base.no_use_local) {
if (ORTE_SUCCESS != (rc = orte_rmgr.add_attribute(attributes, ORTE_RMAPS_NO_USE_LOCAL,
ORTE_UNDEF, NULL))) {
ORTE_ERROR_LOG(rc);
return rc;
}
}
}
if (NULL == (attr = orte_rmgr.find_attribute(attributes, ORTE_RMAPS_NO_OVERSUB))) {
/* was NOT provided - add it if it was set by the environment. Note that this
* attribute only cares if it exists - its value is irrelevant and hence
* not provided
*/
if (!orte_rmaps_base.oversubscribe) {
if (ORTE_SUCCESS != (rc = orte_rmgr.add_attribute(attributes, ORTE_RMAPS_NO_OVERSUB,
ORTE_UNDEF, NULL))) {
ORTE_ERROR_LOG(rc);
return rc;
}
}
}
/* see if they provided a desired mapper */
if (NULL != (attr = orte_rmgr.find_attribute(attributes, ORTE_RMAPS_DESIRED_MAPPER))) {
/* they did - extract its name */
if (ORTE_SUCCESS != (rc = orte_dss.get((void**)&desired_mapper, attr->value, ORTE_STRING))) {
ORTE_ERROR_LOG(rc);
return rc;
}
module = select_preferred(desired_mapper);
} else {
module = select_any();
@ -61,7 +134,7 @@ int orte_rmaps_base_map_job(orte_jobid_t job, char *desired_mapper)
return ORTE_ERR_NOT_FOUND;
}
if (ORTE_SUCCESS != (rc = module->map_job(job, desired_mapper))) {
if (ORTE_SUCCESS != (rc = module->map_job(job, attributes))) {
ORTE_ERROR_LOG(rc);
return rc;
}

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

@ -104,6 +104,8 @@ int orte_rmaps_base_open(void)
if ((int)true == value) {
orte_rmaps_base.per_node = true;
} else {
orte_rmaps_base.per_node = false;
}
/* Should we schedule on the local node or not? */
@ -111,6 +113,11 @@ int orte_rmaps_base_open(void)
mca_base_param_reg_int_name("rmaps", "base_schedule_local",
"If nonzero, allow scheduling MPI applications on the same node as mpirun (default). If zero, do not schedule any MPI applications on the same node as mpirun",
false, false, 1, &value);
if (0 == value) {
orte_rmaps_base.no_use_local = true;
} else {
orte_rmaps_base.no_use_local = false;
}
/* Should we oversubscribe or not? */

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

@ -95,7 +95,8 @@ void orte_rmaps_base_recv(int status, orte_process_name_t* sender,
orte_rmaps_cmd_flag_t command;
orte_std_cntr_t count;
orte_jobid_t job;
char *desired_mapper;
opal_list_t attrs;
opal_list_item_t *item;
int rc;
/* get the command */
@ -125,18 +126,24 @@ void orte_rmaps_base_recv(int status, orte_process_name_t* sender,
goto SEND_ANSWER;
}
/* get any desired mapper */
/* get any attributes */
OBJ_CONSTRUCT(&attrs, opal_list_t);
count = 1;
if (ORTE_SUCCESS != (rc = orte_dss.unpack(buffer, &desired_mapper, &count, ORTE_STRING))) {
if (ORTE_SUCCESS != (rc = orte_dss.unpack(buffer, &attrs, &count, ORTE_ATTR_LIST))) {
ORTE_ERROR_LOG(rc);
goto SEND_ANSWER;
}
/* process the request */
if (ORTE_SUCCESS != (rc = orte_rmaps.map_job(job, desired_mapper))) {
if (ORTE_SUCCESS != (rc = orte_rmaps.map_job(job, &attrs))) {
ORTE_ERROR_LOG(rc);
goto SEND_ANSWER;
}
while (NULL != (item = opal_list_remove_first(&attrs))) {
OBJ_RELEASE(item);
}
OBJ_DESTRUCT(&attrs);
break;
default:

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

@ -96,11 +96,11 @@ static bool is_mapped(opal_list_item_t *item,
/*
* Query the registry for all nodes allocated to a specified job
*/
int orte_rmaps_base_get_target_nodes(opal_list_t *allocated_nodes, orte_jobid_t jobid, orte_std_cntr_t *total_num_slots)
int orte_rmaps_base_get_target_nodes(opal_list_t *allocated_nodes, orte_jobid_t jobid, orte_std_cntr_t *total_num_slots, bool nolocal)
{
opal_list_item_t *item, *next;
orte_ras_node_t *node;
int id, rc, nolocal;
int rc;
orte_std_cntr_t num_slots=0;
/** set default answer */
@ -114,10 +114,7 @@ int orte_rmaps_base_get_target_nodes(opal_list_t *allocated_nodes, orte_jobid_t
/* If the "no local" option was set, then remove the local node
from the list */
id = mca_base_param_find("rmaps", NULL, "base_schedule_local");
mca_base_param_lookup_int(id, &nolocal);
if (0 == nolocal) {
if (nolocal) {
for (item = opal_list_get_first(allocated_nodes);
item != opal_list_get_end(allocated_nodes);
item = opal_list_get_next(item) ) {
@ -298,7 +295,8 @@ int orte_rmaps_base_claim_slot(orte_job_map_t *map,
orte_jobid_t jobid, orte_vpid_t vpid,
orte_std_cntr_t app_idx,
opal_list_t *nodes,
opal_list_t *fully_used_nodes)
opal_list_t *fully_used_nodes,
bool oversubscribe)
{
orte_process_name_t *name;
orte_mapped_proc_t *proc;
@ -349,7 +347,7 @@ int orte_rmaps_base_claim_slot(orte_job_map_t *map,
*/
if ((0 != current_node->node_slots_max &&
current_node->node_slots_inuse >= current_node->node_slots_max) ||
(!orte_rmaps_base.oversubscribe && oversub)) {
(!oversubscribe && oversub)) {
opal_list_remove_item(nodes, (opal_list_item_t*)current_node);
/* add it to the list of fully used nodes */
opal_list_append(fully_used_nodes, &current_node->super);

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

@ -76,7 +76,7 @@ OBJ_CLASS_DECLARATION(orte_rmaps_base_cmp_t);
* All calls to rmaps.map_job are routed through this function. This allows callers to
* the RMAPS framework to specify the particular mapper they wish to use.
*/
ORTE_DECLSPEC int orte_rmaps_base_map_job(orte_jobid_t job, char *desired_mapper);
ORTE_DECLSPEC int orte_rmaps_base_map_job(orte_jobid_t job, opal_list_t *attributes);
/*
* Get job map
@ -132,7 +132,8 @@ void orte_rmaps_base_recv(int status, orte_process_name_t* sender,
int orte_rmaps_base_add_proc_to_map(orte_job_map_t *map, orte_cellid_t cell, char *nodename,
char *username, bool oversubscribed, orte_mapped_proc_t *proc);
ORTE_DECLSPEC int orte_rmaps_base_get_target_nodes(opal_list_t* node_list, orte_jobid_t jobid, orte_std_cntr_t *total_num_slots);
ORTE_DECLSPEC int orte_rmaps_base_get_target_nodes(opal_list_t* node_list, orte_jobid_t jobid,
orte_std_cntr_t *total_num_slots, bool no_use_local);
ORTE_DECLSPEC int orte_rmaps_base_update_node_usage(opal_list_t *nodes);
ORTE_DECLSPEC int orte_rmaps_base_get_mapped_targets(opal_list_t *mapped_node_list,
orte_app_context_t *app,
@ -144,7 +145,8 @@ ORTE_DECLSPEC int orte_rmaps_base_claim_slot(orte_job_map_t *map,
orte_jobid_t jobid, orte_vpid_t vpid,
orte_std_cntr_t app_idx,
opal_list_t *nodes,
opal_list_t *fully_used_nodes);
opal_list_t *fully_used_nodes,
bool oversubscribe);
/** Local data type functions */
void orte_rmaps_base_std_obj_release(orte_data_value_t *value);

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

@ -33,7 +33,7 @@
/*
* Map a job
*/
int orte_rmaps_proxy_map(orte_jobid_t job, char *desired_mapper)
int orte_rmaps_proxy_map(orte_jobid_t job, opal_list_t *attributes)
{
orte_buffer_t* cmd;
orte_buffer_t* answer;
@ -63,10 +63,8 @@ int orte_rmaps_proxy_map(orte_jobid_t job, char *desired_mapper)
return rc;
}
/* pack the desired mapper - since the DSS can handle NULL strings, don't
* bother checking for that here
*/
if (ORTE_SUCCESS != (rc = orte_dss.pack(cmd, &desired_mapper, 1, ORTE_STRING))) {
/* pack the attributes */
if (ORTE_SUCCESS != (rc = orte_dss.pack(cmd, attributes, 1, ORTE_ATTR_LIST))) {
ORTE_ERROR_LOG(rc);
OBJ_RELEASE(cmd);
return rc;

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

@ -61,7 +61,7 @@ extern orte_rmaps_proxy_globals_t orte_rmaps_proxy_globals;
/*
* Component API functions
*/
int orte_rmaps_proxy_map(orte_jobid_t job, char *desired_mapper);
int orte_rmaps_proxy_map(orte_jobid_t job, opal_list_t *attributes);
/*
* Global component.

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

@ -56,7 +56,7 @@
/**
* Mapping function
*/
typedef int (*orte_rmaps_base_module_map_fn_t)(orte_jobid_t job, char *desired_mapper);
typedef int (*orte_rmaps_base_module_map_fn_t)(orte_jobid_t job, opal_list_t *attributes);
/**
* Get the map of a job from the registry

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

@ -33,6 +33,13 @@
extern "C" {
#endif
/**** RMAPS ATTRIBUTES ***/
#define ORTE_RMAPS_MAP_POLICY "orte-map-policy"
#define ORTE_RMAPS_PERNODE "orte-map-pernode"
#define ORTE_RMAPS_NO_USE_LOCAL "orte-map-no-use-local"
#define ORTE_RMAPS_NO_OVERSUB "orte-map-no-oversubscribe"
#define ORTE_RMAPS_DESIRED_MAPPER "orte-map-desired"
/**** JOB_MAP OBJECTS ***/
/*
* Mapped process info for job_map

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

@ -114,7 +114,8 @@ static int map_app_by_node(
/* Allocate a slot on this node */
node = (orte_ras_node_t*) cur_node_item;
if (ORTE_SUCCESS != (rc = orte_rmaps_base_claim_slot(map, node, jobid, vpid_start + num_alloc, app->idx,
nodes, max_used_nodes))) {
nodes, max_used_nodes,
mca_rmaps_round_robin_component.oversubscribe))) {
ORTE_ERROR_LOG(rc);
return rc;
}
@ -198,7 +199,8 @@ static int map_app_by_slot(
for( i = 0; i < num_slots_to_take; ++i) {
if (ORTE_SUCCESS != (rc = orte_rmaps_base_claim_slot(map, node, jobid, vpid_start + num_alloc, app->idx,
nodes, max_used_nodes))) {
nodes, max_used_nodes,
mca_rmaps_round_robin_component.oversubscribe))) {
/** if the code is ORTE_ERR_NODE_FULLY_USED, then we know this
* really isn't an error - we just need to break from the loop
* since the node is fully used up. For now, just don't report
@ -229,11 +231,52 @@ static int map_app_by_slot(
}
/*
* Process the attributes and push them into our local "global"
*/
static int orte_rmaps_rr_process_attrs(opal_list_t *attributes)
{
int rc;
char *policy;
orte_attribute_t *attr;
mca_rmaps_round_robin_component.bynode = false; /* set default mapping policy */
if (NULL != (attr = orte_rmgr.find_attribute(attributes, ORTE_RMAPS_MAP_POLICY))) {
/* they specified a mapping policy - extract its name */
if (ORTE_SUCCESS != (rc = orte_dss.get((void**)&policy, attr->value, ORTE_STRING))) {
ORTE_ERROR_LOG(rc);
return rc;
}
if (0 == strcmp(policy, "bynode")) {
mca_rmaps_round_robin_component.bynode = true;
}
}
mca_rmaps_round_robin_component.per_node = false;
if (NULL != (attr = orte_rmgr.find_attribute(attributes, ORTE_RMAPS_PERNODE))) {
/* was provided - set boolean accordingly */
mca_rmaps_round_robin_component.per_node = true;
}
mca_rmaps_round_robin_component.no_use_local = false;
if (NULL != (attr = orte_rmgr.find_attribute(attributes, ORTE_RMAPS_NO_USE_LOCAL))) {
/* was provided - set boolean accordingly */
mca_rmaps_round_robin_component.no_use_local = true;
}
mca_rmaps_round_robin_component.oversubscribe = true;
if (NULL != (attr = orte_rmgr.find_attribute(attributes, ORTE_RMAPS_NO_OVERSUB))) {
/* was provided - set boolean accordingly */
mca_rmaps_round_robin_component.oversubscribe = false;
}
return ORTE_SUCCESS;
}
/*
* Create a round-robin mapping for the job.
*/
static int orte_rmaps_rr_map(orte_jobid_t jobid, char *ignore)
static int orte_rmaps_rr_map(orte_jobid_t jobid, opal_list_t *attributes)
{
orte_app_context_t *app;
orte_job_map_t* map;
@ -248,6 +291,12 @@ static int orte_rmaps_rr_map(orte_jobid_t jobid, char *ignore)
OPAL_TRACE(1);
/* setup the local environment from the attributes */
if (ORTE_SUCCESS != (rc = orte_rmaps_rr_process_attrs(attributes))) {
ORTE_ERROR_LOG(rc);
return rc;
}
/* create the map object */
map = OBJ_NEW(orte_job_map_t);
if (NULL == map) {
@ -269,7 +318,9 @@ static int orte_rmaps_rr_map(orte_jobid_t jobid, char *ignore)
* mappings from the user
*/
OBJ_CONSTRUCT(&master_node_list, opal_list_t);
if(ORTE_SUCCESS != (rc = orte_rmaps_base_get_target_nodes(&master_node_list, jobid, &total_num_slots))) {
if(ORTE_SUCCESS != (rc = orte_rmaps_base_get_target_nodes(&master_node_list, jobid,
&total_num_slots,
mca_rmaps_round_robin_component.no_use_local))) {
ORTE_ERROR_LOG(rc);
OBJ_DESTRUCT(&master_node_list);
return rc;
@ -286,10 +337,13 @@ static int orte_rmaps_rr_map(orte_jobid_t jobid, char *ignore)
for (cur_node_item = opal_list_get_first(&master_node_list);
cur_node_item != opal_list_get_end(&master_node_list);
cur_node_item = opal_list_get_next(cur_node_item)) {
#if 0
node = (orte_ras_node_t*)cur_node_item;
if (node->node_slots > node->node_slots_inuse) {
goto MOVEON;
}
#endif
goto MOVEON; /* until I get this fixed...this runs slow, but doesn't hang */
}
/* if we got here, then everyone is at or above the soft limit - just
* start with the first node on the list
@ -334,7 +388,8 @@ MOVEON:
/** If the user has specified a mapping for this app_context, then we
* create a working node list that contains only those nodes.
*/
if (ORTE_SUCCESS != (rc = orte_rmaps_base_get_mapped_targets(&mapped_node_list, app, &master_node_list, &mapped_num_slots))) {
if (ORTE_SUCCESS != (rc = orte_rmaps_base_get_mapped_targets(&mapped_node_list, app,
&master_node_list, &mapped_num_slots))) {
ORTE_ERROR_LOG(rc);
goto cleanup;
}
@ -346,7 +401,7 @@ MOVEON:
/** 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) {
if (mca_rmaps_round_robin_component.per_node) {
app->num_procs = opal_list_get_size(&mapped_node_list);
} else {
app->num_procs = mapped_num_slots;
@ -366,7 +421,7 @@ MOVEON:
/** 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) {
if (mca_rmaps_round_robin_component.per_node) {
app->num_procs = opal_list_get_size(&master_node_list);
} else {
app->num_procs = total_num_slots;
@ -391,7 +446,7 @@ MOVEON:
num_procs += app->num_procs;
/* Make assignments */
if (orte_rmaps_base.bynode) {
if (mca_rmaps_round_robin_component.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,6 +36,10 @@ struct orte_rmaps_round_robin_component_t {
orte_rmaps_base_component_t super;
int debug;
int priority;
bool bynode;
bool per_node;
bool no_use_local;
bool oversubscribe;
};
typedef struct orte_rmaps_round_robin_component_t orte_rmaps_round_robin_component_t;

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

@ -383,7 +383,7 @@ static int orte_rmgr_proxy_spawn_job(
ORTE_ERROR_LOG(rc);
return rc;
}
if (ORTE_SUCCESS != (rc = orte_rmaps.map_job(*jobid, NULL))) {
if (ORTE_SUCCESS != (rc = orte_rmaps.map_job(*jobid, attributes))) {
ORTE_ERROR_LOG(rc);
return rc;
}

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

@ -40,8 +40,6 @@ extern "C" {
typedef orte_gpr_keyval_t orte_attribute_t;
ORTE_DECLSPEC OBJ_CLASS_DECLARATION(orte_attribute_t);
#define ORTE_RMGR_USE_PARENT_ALLOCATION "orte-use-parent-alloc"
/* RESOURCE MANAGER DATA TYPES */

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

@ -325,7 +325,7 @@ static int orte_rmgr_urm_spawn_job(
return rc;
}
if (ORTE_SUCCESS != (rc = orte_rmaps.map_job(*jobid, NULL))) {
if (ORTE_SUCCESS != (rc = orte_rmaps.map_job(*jobid, attributes))) {
ORTE_ERROR_LOG(rc);
return rc;
}