- Make the replica component adhere to the prefix rule
- Remove more stuff from the proxy component (I'm not sure what is supposed to be there, so stripping more globals out of the skeleton seems to be ok until Ralph can implement what he wants) This commit was SVN r1625.
Этот коммит содержится в:
родитель
4c842c29b2
Коммит
3cf7ab309c
@ -13,27 +13,6 @@
|
||||
#include "class/ompi_list.h"
|
||||
#include "mca/ns/ns.h"
|
||||
|
||||
/*
|
||||
* list class for tracking vpids/jobid
|
||||
* This structure is used to create a linked list of jobid-max vpid pairs. Basically, we
|
||||
* are tracking the max used vpid for each jobid that has been created.
|
||||
*/
|
||||
struct ompi_name_tracker_t {
|
||||
ompi_list_item_t item; /**< Allows this item to be placed on a list */
|
||||
ompi_process_id_t job; /**< Job id */
|
||||
ompi_process_id_t last_used_vpid; /**< Tracks the vpid last given out */
|
||||
};
|
||||
typedef struct ompi_name_tracker_t ompi_name_tracker_t;
|
||||
|
||||
OBJ_CLASS_DECLARATION(ompi_name_tracker_t);
|
||||
|
||||
/*
|
||||
* globals needed within component
|
||||
*/
|
||||
extern ompi_process_id_t last_used_cellid;
|
||||
extern ompi_process_id_t last_used_jobid;
|
||||
extern ompi_list_t ompi_name_tracker;
|
||||
|
||||
/*
|
||||
* Module open / close
|
||||
*/
|
||||
|
@ -70,32 +70,6 @@ static mca_ns_t mca_ns_proxy = {
|
||||
static bool initialized = false;
|
||||
|
||||
|
||||
/* constructor - used to initialize state of name_tracker instance */
|
||||
static void ompi_name_tracker_construct(ompi_name_tracker_t* name_tracker)
|
||||
{
|
||||
name_tracker->job = 0;
|
||||
name_tracker->last_used_vpid = 0;
|
||||
}
|
||||
|
||||
/* destructor - used to free any resources held by instance */
|
||||
static void ompi_name_tracker_destructor(ompi_name_tracker_t* name_tracker)
|
||||
{
|
||||
}
|
||||
|
||||
/* define instance of ompi_class_t */
|
||||
OBJ_CLASS_INSTANCE(
|
||||
ompi_name_tracker_t, /* type name */
|
||||
ompi_list_item_t, /* parent "class" name */
|
||||
ompi_name_tracker_construct, /* constructor */
|
||||
ompi_name_tracker_destructor); /* destructor */
|
||||
|
||||
/*
|
||||
* globals needed within proxy component
|
||||
*/
|
||||
ompi_process_id_t last_used_cellid;
|
||||
ompi_process_id_t last_used_jobid;
|
||||
ompi_list_t ompi_name_tracker;
|
||||
|
||||
/*
|
||||
* don't really need this function - could just put NULL in the above structure
|
||||
* Just holding the place in case we decide there is something we need to do
|
||||
@ -120,9 +94,6 @@ mca_ns_t* mca_ns_proxy_init(bool *allow_multi_user_threads, bool *have_hidden_th
|
||||
|
||||
if (!ompi_process_info.seed) {
|
||||
|
||||
last_used_cellid = 0;
|
||||
last_used_jobid = 0;
|
||||
|
||||
/* Return a module (choose an arbitrary, positive priority --
|
||||
it's only relevant compared to other ns components). If
|
||||
we're not the seed, then we don't want to be selected, so
|
||||
@ -135,10 +106,6 @@ mca_ns_t* mca_ns_proxy_init(bool *allow_multi_user_threads, bool *have_hidden_th
|
||||
*allow_multi_user_threads = true;
|
||||
*have_hidden_threads = false;
|
||||
|
||||
/* initialize the name tracker */
|
||||
|
||||
OBJ_CONSTRUCT(&ompi_name_tracker, ompi_list_t);
|
||||
|
||||
/* Return the module */
|
||||
|
||||
initialized = true;
|
||||
@ -156,8 +123,6 @@ int mca_ns_proxy_finalize(void)
|
||||
/* free all tracking storage, but only if this component was initialized */
|
||||
|
||||
if (initialized) {
|
||||
OBJ_DESTRUCT(&ompi_name_tracker);
|
||||
|
||||
initialized = false;
|
||||
}
|
||||
|
||||
|
@ -20,9 +20,9 @@
|
||||
|
||||
ompi_process_id_t ns_replica_create_cellid(void)
|
||||
{
|
||||
if ((OMPI_NAME_SERVICE_MAX-1) < last_used_cellid) {
|
||||
last_used_cellid = last_used_cellid + 1;
|
||||
return(last_used_cellid);
|
||||
if ((OMPI_NAME_SERVICE_MAX-1) < mca_ns_replica_last_used_cellid) {
|
||||
mca_ns_replica_last_used_cellid = mca_ns_replica_last_used_cellid + 1;
|
||||
return(mca_ns_replica_last_used_cellid);
|
||||
} else {
|
||||
return(0);
|
||||
}
|
||||
@ -30,15 +30,15 @@ ompi_process_id_t ns_replica_create_cellid(void)
|
||||
|
||||
ompi_process_id_t ns_replica_create_jobid(void)
|
||||
{
|
||||
ompi_name_tracker_t *new;
|
||||
mca_ns_replica_name_tracker_t *new;
|
||||
|
||||
if ((OMPI_NAME_SERVICE_MAX-1) < last_used_jobid) {
|
||||
last_used_jobid = last_used_jobid + 1;
|
||||
new = OBJ_NEW(ompi_name_tracker_t);
|
||||
new->job = last_used_jobid;
|
||||
if ((OMPI_NAME_SERVICE_MAX-1) < mca_ns_replica_last_used_jobid) {
|
||||
mca_ns_replica_last_used_jobid = mca_ns_replica_last_used_jobid + 1;
|
||||
new = OBJ_NEW(mca_ns_replica_name_tracker_t);
|
||||
new->job = mca_ns_replica_last_used_jobid;
|
||||
new->last_used_vpid = 0;
|
||||
ompi_list_append(&ompi_name_tracker, &new->item);
|
||||
return(last_used_jobid);
|
||||
ompi_list_append(&mca_ns_replica_name_tracker, &new->item);
|
||||
return(mca_ns_replica_last_used_jobid);
|
||||
} else {
|
||||
return(0);
|
||||
}
|
||||
@ -47,12 +47,12 @@ ompi_process_id_t ns_replica_create_jobid(void)
|
||||
|
||||
ompi_process_id_t ns_replica_reserve_range(ompi_process_id_t job, ompi_process_id_t range)
|
||||
{
|
||||
ompi_name_tracker_t *ptr;
|
||||
mca_ns_replica_name_tracker_t *ptr;
|
||||
ompi_process_id_t start;
|
||||
|
||||
for (ptr = (ompi_name_tracker_t*)ompi_list_get_first(&ompi_name_tracker);
|
||||
ptr != (ompi_name_tracker_t*)ompi_list_get_end(&ompi_name_tracker);
|
||||
ptr = (ompi_name_tracker_t*)ompi_list_get_next(ptr)) {
|
||||
for (ptr = (mca_ns_replica_name_tracker_t*)ompi_list_get_first(&mca_ns_replica_name_tracker);
|
||||
ptr != (mca_ns_replica_name_tracker_t*)ompi_list_get_end(&mca_ns_replica_name_tracker);
|
||||
ptr = (mca_ns_replica_name_tracker_t*)ompi_list_get_next(ptr)) {
|
||||
if (job == ptr->job) { /* found the specified job */
|
||||
if ((OMPI_NAME_SERVICE_MAX-range-1) > ptr->last_used_vpid) { /* requested range available */
|
||||
start = ptr->last_used_vpid + 1;
|
||||
|
@ -18,21 +18,21 @@
|
||||
* This structure is used to create a linked list of jobid-max vpid pairs. Basically, we
|
||||
* are tracking the max used vpid for each jobid that has been created.
|
||||
*/
|
||||
struct ompi_name_tracker_t {
|
||||
struct mca_ns_replica_name_tracker_t {
|
||||
ompi_list_item_t item; /**< Allows this item to be placed on a list */
|
||||
ompi_process_id_t job; /**< Job id */
|
||||
ompi_process_id_t last_used_vpid; /**< Tracks the vpid last given out */
|
||||
};
|
||||
typedef struct ompi_name_tracker_t ompi_name_tracker_t;
|
||||
typedef struct mca_ns_replica_name_tracker_t mca_ns_replica_name_tracker_t;
|
||||
|
||||
OBJ_CLASS_DECLARATION(ompi_name_tracker_t);
|
||||
OBJ_CLASS_DECLARATION(mca_ns_replica_name_tracker_t);
|
||||
|
||||
/*
|
||||
* globals needed within component
|
||||
*/
|
||||
extern ompi_process_id_t last_used_cellid;
|
||||
extern ompi_process_id_t last_used_jobid;
|
||||
extern ompi_list_t ompi_name_tracker;
|
||||
extern ompi_process_id_t mca_ns_replica_last_used_cellid;
|
||||
extern ompi_process_id_t mca_ns_replica_last_used_jobid;
|
||||
extern ompi_list_t mca_ns_replica_name_tracker;
|
||||
|
||||
/*
|
||||
* Module open / close
|
||||
|
@ -71,20 +71,20 @@ static bool initialized = false;
|
||||
|
||||
|
||||
/* constructor - used to initialize state of name_tracker instance */
|
||||
static void ompi_name_tracker_construct(ompi_name_tracker_t* name_tracker)
|
||||
static void ompi_name_tracker_construct(mca_ns_replica_name_tracker_t* name_tracker)
|
||||
{
|
||||
name_tracker->job = 0;
|
||||
name_tracker->last_used_vpid = 0;
|
||||
}
|
||||
|
||||
/* destructor - used to free any resources held by instance */
|
||||
static void ompi_name_tracker_destructor(ompi_name_tracker_t* name_tracker)
|
||||
static void ompi_name_tracker_destructor(mca_ns_replica_name_tracker_t* name_tracker)
|
||||
{
|
||||
}
|
||||
|
||||
/* define instance of ompi_class_t */
|
||||
OBJ_CLASS_INSTANCE(
|
||||
ompi_name_tracker_t, /* type name */
|
||||
mca_ns_replica_name_tracker_t, /* type name */
|
||||
ompi_list_item_t, /* parent "class" name */
|
||||
ompi_name_tracker_construct, /* constructor */
|
||||
ompi_name_tracker_destructor); /* destructor */
|
||||
@ -92,9 +92,9 @@ OBJ_CLASS_INSTANCE(
|
||||
/*
|
||||
* globals needed within replica component
|
||||
*/
|
||||
ompi_process_id_t last_used_cellid;
|
||||
ompi_process_id_t last_used_jobid;
|
||||
ompi_list_t ompi_name_tracker;
|
||||
ompi_process_id_t mca_ns_replica_last_used_cellid;
|
||||
ompi_process_id_t mca_ns_replica_last_used_jobid;
|
||||
ompi_list_t mca_ns_replica_name_tracker;
|
||||
|
||||
/*
|
||||
* don't really need this function - could just put NULL in the above structure
|
||||
@ -120,8 +120,8 @@ mca_ns_t* mca_ns_replica_init(bool *allow_multi_user_threads, bool *have_hidden_
|
||||
|
||||
if (ompi_process_info.seed) {
|
||||
|
||||
last_used_cellid = 0;
|
||||
last_used_jobid = 0;
|
||||
mca_ns_replica_last_used_cellid = 0;
|
||||
mca_ns_replica_last_used_jobid = 0;
|
||||
|
||||
/* Return a module (choose an arbitrary, positive priority --
|
||||
it's only relevant compared to other ns components). If
|
||||
@ -137,7 +137,7 @@ mca_ns_t* mca_ns_replica_init(bool *allow_multi_user_threads, bool *have_hidden_
|
||||
|
||||
/* initialize the name tracker */
|
||||
|
||||
OBJ_CONSTRUCT(&ompi_name_tracker, ompi_list_t);
|
||||
OBJ_CONSTRUCT(&mca_ns_replica_name_tracker, ompi_list_t);
|
||||
|
||||
/* Return the module */
|
||||
|
||||
@ -156,7 +156,7 @@ int mca_ns_replica_finalize(void)
|
||||
/* free all tracking storage, but only if this component was initialized */
|
||||
|
||||
if (initialized) {
|
||||
OBJ_DESTRUCT(&ompi_name_tracker);
|
||||
OBJ_DESTRUCT(&mca_ns_replica_name_tracker);
|
||||
|
||||
initialized = false;
|
||||
}
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user