1
1

* rename ompi_process_t to mca_ns_{cellid, jobid, vpid}_t, both to fix the

confusion over the overused typedef and to conform to the naming MCA
  naming convention.

This commit was SVN r1815.
Этот коммит содержится в:
Brian Barrett 2004-07-27 23:49:08 +00:00
родитель 81d35ccf3c
Коммит 32264acd56
10 изменённых файлов: 65 добавлений и 62 удалений

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

@ -31,9 +31,9 @@ extern "C" {
* Base functions that are common to all implementations - can be overridden * Base functions that are common to all implementations - can be overridden
*/ */
ompi_process_name_t* ns_base_create_process_name(ompi_process_id_t cell, ompi_process_name_t* ns_base_create_process_name(mca_ns_base_cellid_t cell,
ompi_process_id_t job, mca_ns_base_jobid_t job,
ompi_process_id_t vpid); mca_ns_base_vpid_t vpid);
char* ns_base_get_proc_name_string(const ompi_process_name_t* name); char* ns_base_get_proc_name_string(const ompi_process_name_t* name);
@ -43,21 +43,21 @@ extern "C" {
char* ns_base_get_cellid_string(const ompi_process_name_t* name); char* ns_base_get_cellid_string(const ompi_process_name_t* name);
ompi_process_id_t ns_base_get_vpid(const ompi_process_name_t* name); mca_ns_base_vpid_t ns_base_get_vpid(const ompi_process_name_t* name);
ompi_process_id_t ns_base_get_jobid(const ompi_process_name_t* name); mca_ns_base_jobid_t ns_base_get_jobid(const ompi_process_name_t* name);
ompi_process_id_t ns_base_get_cellid(const ompi_process_name_t* name); mca_ns_base_cellid_t ns_base_get_cellid(const ompi_process_name_t* name);
int ns_base_compare(ompi_ns_cmp_bitmask_t fields, int ns_base_compare(ompi_ns_cmp_bitmask_t fields,
const ompi_process_name_t* name1, const ompi_process_name_t* name1,
const ompi_process_name_t* name2); const ompi_process_name_t* name2);
ompi_process_id_t ns_base_create_cellid(void); mca_ns_base_cellid_t ns_base_create_cellid(void);
ompi_process_id_t ns_base_create_jobid(void); mca_ns_base_jobid_t ns_base_create_jobid(void);
ompi_process_id_t ns_base_reserve_range(ompi_process_id_t job, ompi_process_id_t range); mca_ns_base_vpid_t ns_base_reserve_range(mca_ns_base_jobid_t job, mca_ns_base_vpid_t range);
int ns_base_free_name(ompi_process_name_t* name); int ns_base_free_name(ompi_process_name_t* name);

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

@ -18,8 +18,8 @@
* functions * functions
*/ */
ompi_process_name_t* ns_base_create_process_name(ompi_process_id_t cell, ompi_process_name_t* ns_base_create_process_name(mca_ns_base_cellid_t cell,
ompi_process_id_t job, ompi_process_id_t vpid) mca_ns_base_jobid_t job, mca_ns_base_vpid_t vpid)
{ {
ompi_process_name_t *newname; ompi_process_name_t *newname;
@ -115,7 +115,7 @@ char* ns_base_get_cellid_string(const ompi_process_name_t* name)
} }
ompi_process_id_t ns_base_get_vpid(const ompi_process_name_t* name) mca_ns_base_vpid_t ns_base_get_vpid(const ompi_process_name_t* name)
{ {
if (NULL == name) { /* got an error */ if (NULL == name) { /* got an error */
return(OMPI_NAME_SERVICE_MAX); return(OMPI_NAME_SERVICE_MAX);
@ -125,7 +125,7 @@ ompi_process_id_t ns_base_get_vpid(const ompi_process_name_t* name)
} }
ompi_process_id_t ns_base_get_jobid(const ompi_process_name_t* name) mca_ns_base_jobid_t ns_base_get_jobid(const ompi_process_name_t* name)
{ {
if (NULL == name) { /* got an error */ if (NULL == name) { /* got an error */
return(OMPI_NAME_SERVICE_MAX); return(OMPI_NAME_SERVICE_MAX);
@ -134,7 +134,7 @@ ompi_process_id_t ns_base_get_jobid(const ompi_process_name_t* name)
return(name->jobid); return(name->jobid);
} }
ompi_process_id_t ns_base_get_cellid(const ompi_process_name_t* name) mca_ns_base_cellid_t ns_base_get_cellid(const ompi_process_name_t* name)
{ {
if (NULL == name) { /* got an error */ if (NULL == name) { /* got an error */
return(OMPI_NAME_SERVICE_MAX); return(OMPI_NAME_SERVICE_MAX);

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

@ -18,11 +18,11 @@
* functions * functions
*/ */
ompi_process_id_t ns_base_create_cellid(void) mca_ns_base_cellid_t ns_base_create_cellid(void)
{ {
ompi_ns_msg_buffer_t cmd, *answer; ompi_ns_msg_buffer_t cmd, *answer;
struct iovec msg; struct iovec msg;
ompi_process_id_t cell; mca_ns_base_cellid_t cell;
cmd.command = OMPI_NS_CREATE_CELLID; cmd.command = OMPI_NS_CREATE_CELLID;
cmd.buflen = 0; cmd.buflen = 0;
@ -40,18 +40,18 @@ ompi_process_id_t ns_base_create_cellid(void)
} }
answer = (ompi_ns_msg_buffer_t*)msg.iov_base; answer = (ompi_ns_msg_buffer_t*)msg.iov_base;
cell = (ompi_process_id_t)answer->buf; cell = (mca_ns_base_cellid_t)answer->buf;
return cell; return cell;
} }
ompi_process_id_t ns_base_create_jobid(void) mca_ns_base_jobid_t ns_base_create_jobid(void)
{ {
/* JMS fill in here */ /* JMS fill in here */
return 0; return 0;
} }
ompi_process_id_t ns_base_reserve_range(ompi_process_id_t job, ompi_process_id_t range) mca_ns_base_vpid_t ns_base_reserve_range(mca_ns_base_jobid_t job, mca_ns_base_vpid_t range)
{ {
/* JMS fill in here */ /* JMS fill in here */
return 0; return 0;

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

@ -44,13 +44,16 @@
/* /*
* general typedefs & structures * general typedefs & structures
*/ */
typedef uint32_t ompi_process_id_t; /**< Set the allowed range for id's in each space */ /**< Set the allowed range for ids in each space */
typedef uint32_t mca_ns_base_jobid_t;
typedef uint32_t mca_ns_base_cellid_t;
typedef uint32_t mca_ns_base_vpid_t;
typedef uint8_t ompi_ns_cmp_bitmask_t; /**< Bit mask for comparing process names */ typedef uint8_t ompi_ns_cmp_bitmask_t; /**< Bit mask for comparing process names */
struct ompi_process_name_t { struct ompi_process_name_t {
ompi_process_id_t cellid; /**< Cell number */ mca_ns_base_cellid_t cellid; /**< Cell number */
ompi_process_id_t jobid; /**< Job number */ mca_ns_base_jobid_t jobid; /**< Job number */
ompi_process_id_t vpid; /**< Process number */ mca_ns_base_vpid_t vpid; /**< Process number */
}; };
typedef struct ompi_process_name_t ompi_process_name_t; typedef struct ompi_process_name_t ompi_process_name_t;
@ -100,7 +103,7 @@ typedef struct ompi_ns_msg_buffer_t ompi_ns_msg_buffer_t;
* new_cellid = ompi_name_server.create_cellid() * new_cellid = ompi_name_server.create_cellid()
* @endcode * @endcode
*/ */
typedef ompi_process_id_t (*mca_ns_create_cellid_fn_t)(void); typedef mca_ns_base_cellid_t (*mca_ns_create_cellid_fn_t)(void);
/** /**
* Create a new job id. * Create a new job id.
@ -123,7 +126,7 @@ typedef ompi_process_id_t (*mca_ns_create_cellid_fn_t)(void);
* new_jobid = ompi_name_server.create_jobid() * new_jobid = ompi_name_server.create_jobid()
* @endcode * @endcode
*/ */
typedef ompi_process_id_t (*mca_ns_create_jobid_fn_t)(void); typedef mca_ns_base_jobid_t (*mca_ns_create_jobid_fn_t)(void);
/** /**
* Obtain a single new process name. * Obtain a single new process name.
@ -149,7 +152,7 @@ typedef ompi_process_id_t (*mca_ns_create_jobid_fn_t)(void);
* new_name = ompi_name_server.create_process_name(cell, job, vpid); * new_name = ompi_name_server.create_process_name(cell, job, vpid);
* @endcode * @endcode
*/ */
typedef ompi_process_name_t* (*mca_ns_create_proc_name_fn_t)(ompi_process_id_t cell, ompi_process_id_t job, ompi_process_id_t vpid); typedef ompi_process_name_t* (*mca_ns_create_proc_name_fn_t)(mca_ns_base_cellid_t cell, mca_ns_base_jobid_t job, mca_ns_base_vpid_t vpid);
/** /**
@ -171,7 +174,7 @@ typedef ompi_process_name_t* (*mca_ns_create_proc_name_fn_t)(ompi_process_id_t c
* starting_procid = ompi_name_server.reserve_range(jobid, range) * starting_procid = ompi_name_server.reserve_range(jobid, range)
* @endcode * @endcode
*/ */
typedef ompi_process_id_t (*mca_ns_reserve_range_fn_t)(ompi_process_id_t job, ompi_process_id_t range); typedef mca_ns_base_vpid_t (*mca_ns_reserve_range_fn_t)(mca_ns_base_jobid_t job, mca_ns_base_vpid_t range);
/** /**
@ -301,7 +304,7 @@ typedef char* (*mca_ns_get_cellid_string_fn_t)(const ompi_process_name_t *name);
* vpid = ompi_name_server.get_vpid(&name) * vpid = ompi_name_server.get_vpid(&name)
* @endcode * @endcode
*/ */
typedef ompi_process_id_t (*mca_ns_get_vpid_fn_t)(const ompi_process_name_t *name); typedef mca_ns_base_vpid_t (*mca_ns_get_vpid_fn_t)(const ompi_process_name_t *name);
/** /**
* Get the job id as an ompi_process_id_t value. * Get the job id as an ompi_process_id_t value.
@ -318,7 +321,7 @@ typedef ompi_process_id_t (*mca_ns_get_vpid_fn_t)(const ompi_process_name_t *nam
* jobid = ompi_name_server.get_jobid(&name) * jobid = ompi_name_server.get_jobid(&name)
* @endcode * @endcode
*/ */
typedef ompi_process_id_t (*mca_ns_get_jobid_fn_t)(const ompi_process_name_t *name); typedef mca_ns_base_jobid_t (*mca_ns_get_jobid_fn_t)(const ompi_process_name_t *name);
/** /**
* Get the cell id as an ompi_process_id_t value. * Get the cell id as an ompi_process_id_t value.
@ -335,7 +338,7 @@ typedef ompi_process_id_t (*mca_ns_get_jobid_fn_t)(const ompi_process_name_t *na
* cellid = ompi_name_server.get_cellid(&name) * cellid = ompi_name_server.get_cellid(&name)
* @endcode * @endcode
*/ */
typedef ompi_process_id_t (*mca_ns_get_cellid_fn_t)(const ompi_process_name_t *name); typedef mca_ns_base_cellid_t (*mca_ns_get_cellid_fn_t)(const ompi_process_name_t *name);
/** /**
* Compare two name values. * Compare two name values.

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

@ -20,7 +20,7 @@
* functions * functions
*/ */
ompi_process_id_t ns_replica_create_cellid(void) mca_ns_base_cellid_t ns_replica_create_cellid(void)
{ {
if ((OMPI_NAME_SERVICE_MAX-1) >= mca_ns_replica_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; mca_ns_replica_last_used_cellid = mca_ns_replica_last_used_cellid + 1;
@ -30,7 +30,7 @@ ompi_process_id_t ns_replica_create_cellid(void)
} }
} }
ompi_process_id_t ns_replica_create_jobid(void) mca_ns_base_jobid_t ns_replica_create_jobid(void)
{ {
mca_ns_replica_name_tracker_t *new; mca_ns_replica_name_tracker_t *new;
@ -47,10 +47,10 @@ 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) mca_ns_base_vpid_t ns_replica_reserve_range(mca_ns_base_jobid_t job, mca_ns_base_vpid_t range)
{ {
mca_ns_replica_name_tracker_t *ptr; mca_ns_replica_name_tracker_t *ptr;
ompi_process_id_t start; mca_ns_base_vpid_t start;
for (ptr = (mca_ns_replica_name_tracker_t*)ompi_list_get_first(&mca_ns_replica_name_tracker); 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_end(&mca_ns_replica_name_tracker);

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

@ -21,8 +21,8 @@
*/ */
struct mca_ns_replica_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_list_item_t item; /**< Allows this item to be placed on a list */
ompi_process_id_t job; /**< Job id */ mca_ns_base_jobid_t job; /**< Job id */
ompi_process_id_t last_used_vpid; /**< Tracks the vpid last given out */ mca_ns_base_vpid_t last_used_vpid; /**< Tracks the vpid last given out */
}; };
typedef struct mca_ns_replica_name_tracker_t mca_ns_replica_name_tracker_t; typedef struct mca_ns_replica_name_tracker_t mca_ns_replica_name_tracker_t;
@ -31,8 +31,8 @@ OBJ_CLASS_DECLARATION(mca_ns_replica_name_tracker_t);
/* /*
* globals needed within component * globals needed within component
*/ */
extern ompi_process_id_t mca_ns_replica_last_used_cellid; extern mca_ns_base_cellid_t mca_ns_replica_last_used_cellid;
extern ompi_process_id_t mca_ns_replica_last_used_jobid; extern mca_ns_base_jobid_t mca_ns_replica_last_used_jobid;
extern ompi_list_t mca_ns_replica_name_tracker; extern ompi_list_t mca_ns_replica_name_tracker;
/* /*
@ -59,27 +59,27 @@ mca_oob_callback_fn_t mca_ns_replica_recv(int status, const ompi_process_name_t
/* /*
* Implementation of create_cellid(). * Implementation of create_cellid().
*/ */
ompi_process_id_t ns_replica_create_cellid(void); mca_ns_base_cellid_t ns_replica_create_cellid(void);
/* /*
* Implementation of create_jobid(). * Implementation of create_jobid().
*/ */
ompi_process_id_t ns_replica_create_jobid(void); mca_ns_base_jobid_t ns_replica_create_jobid(void);
/* /*
* Implementation of create_process_name() * Implementation of create_process_name()
*/ */
ompi_process_name_t* ns_replica_create_process_name( ompi_process_name_t* ns_replica_create_process_name(
ompi_process_id_t cell, mca_ns_base_cellid_t cell,
ompi_process_id_t job, mca_ns_base_jobid_t job,
ompi_process_id_t vpid); mca_ns_base_vpid_t vpid);
/* /*
* Implementation of reserve_range() * Implementation of reserve_range()
*/ */
ompi_process_id_t ns_replica_reserve_range( mca_ns_base_vpid_t ns_replica_reserve_range(
ompi_process_id_t job, mca_ns_base_jobid_t job,
ompi_process_id_t range); mca_ns_base_vpid_t range);
/* /*
* Implementation of free_name() * Implementation of free_name()
@ -109,17 +109,17 @@ char* ns_replica_get_cellid_string(const ompi_process_name_t* name);
/* /*
* Implementation of get_vpid() * Implementation of get_vpid()
*/ */
ompi_process_id_t ns_replica_get_vpid(const ompi_process_name_t* name); mca_ns_base_vpid_t ns_replica_get_vpid(const ompi_process_name_t* name);
/* /*
* Implementation of get_jobid() * Implementation of get_jobid()
*/ */
ompi_process_id_t ns_replica_get_jobid(const ompi_process_name_t* name); mca_ns_base_jobid_t ns_replica_get_jobid(const ompi_process_name_t* name);
/* /*
* Implementation of get_cellid() * Implementation of get_cellid()
*/ */
ompi_process_id_t ns_replica_get_cellid(const ompi_process_name_t* name); mca_ns_base_cellid_t ns_replica_get_cellid(const ompi_process_name_t* name);
/* /*
* Implementation of compare() * Implementation of compare()

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

@ -94,8 +94,8 @@ OBJ_CLASS_INSTANCE(
/* /*
* globals needed within replica component * globals needed within replica component
*/ */
ompi_process_id_t mca_ns_replica_last_used_cellid; mca_ns_base_cellid_t mca_ns_replica_last_used_cellid;
ompi_process_id_t mca_ns_replica_last_used_jobid; mca_ns_base_jobid_t mca_ns_replica_last_used_jobid;
ompi_list_t mca_ns_replica_name_tracker; ompi_list_t mca_ns_replica_name_tracker;
/* /*
@ -173,7 +173,7 @@ mca_oob_callback_fn_t mca_ns_replica_recv(int status, const ompi_process_name_t
void *cbdata) void *cbdata)
{ {
ompi_ns_msg_buffer_t *cmd, answer; ompi_ns_msg_buffer_t *cmd, answer;
ompi_process_id_t tmp1; mca_ns_base_cellid_t tmp1;
struct iovec reply; struct iovec reply;
int i; int i;

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

@ -20,7 +20,7 @@
#include <string.h> #include <string.h>
#include <unistd.h> #include <unistd.h>
static int do_recv(ompi_process_id_t jobid, ompi_process_id_t procid, const struct iovec* iov, int count, int flags); static int do_recv(mca_ns_base_jobid_t jobid, mca_ns_base_vpid_t procid, const struct iovec* iov, int count, int flags);
/** /**
* Similiar to unix send(2). * Similiar to unix send(2).
@ -131,7 +131,7 @@ mca_oob_cofs_recv_nb(
static char* static char*
find_match(ompi_process_id_t jobid, ompi_process_id_t procid) find_match(mca_ns_base_jobid_t jobid, mca_ns_base_vpid_t procid)
{ {
DIR* dir; DIR* dir;
struct dirent *ent; struct dirent *ent;
@ -184,7 +184,7 @@ find_match(ompi_process_id_t jobid, ompi_process_id_t procid)
static int static int
do_recv(ompi_process_id_t jobid, ompi_process_id_t procid, const struct iovec* iov, int count, int flags) do_recv(mca_ns_base_jobid_t jobid, mca_ns_base_vpid_t procid, const struct iovec* iov, int count, int flags)
{ {
char *fname; char *fname;
char full_fname[OMPI_PATH_MAX]; char full_fname[OMPI_PATH_MAX];

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

@ -80,8 +80,8 @@ mca_pcm_cofs_init(int *priority, bool *allow_multi_user_threads,
bool *have_hidden_threads) bool *have_hidden_threads)
{ {
int i,value; int i,value;
ompi_process_id_t cellid; mca_ns_base_cellid_t cellid;
ompi_process_id_t jobid; mca_ns_base_jobid_t jobid;
*priority = 1; *priority = 1;
*allow_multi_user_threads = true; *allow_multi_user_threads = true;

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

@ -46,20 +46,20 @@ int ompi_proc_info(void)
/* create the proc session directory */ /* create the proc session directory */
/* RLG - need to change universe name */ /* RLG - need to change universe name */
jobid_str=malloc(sizeof(ompi_process_id_t)*8+1); jobid_str=malloc(sizeof(mca_ns_base_jobid_t)*8+1);
if( NULL == jobid_str) { if( NULL == jobid_str) {
return_code=OMPI_ERR_OUT_OF_RESOURCE; return_code=OMPI_ERR_OUT_OF_RESOURCE;
goto CLEANUP; goto CLEANUP;
} }
memset(jobid_str,0,sizeof(ompi_process_id_t)*8+1); memset(jobid_str,0,sizeof(mca_ns_base_jobid_t)*8+1);
sprintf(jobid_str,"%-d",ompi_process_info.name->jobid); sprintf(jobid_str,"%-d",ompi_process_info.name->jobid);
procid_str=malloc(sizeof(ompi_process_id_t)*8+1); procid_str=malloc(sizeof(mca_ns_base_vpid_t)*8+1);
if( NULL == procid_str) { if( NULL == procid_str) {
return_code=OMPI_ERR_OUT_OF_RESOURCE; return_code=OMPI_ERR_OUT_OF_RESOURCE;
goto CLEANUP; goto CLEANUP;
} }
memset(procid_str,0,sizeof(ompi_process_id_t)*8+1); memset(procid_str,0,sizeof(mca_ns_base_vpid_t)*8+1);
sprintf(procid_str,"%-d",ompi_process_info.name->vpid); sprintf(procid_str,"%-d",ompi_process_info.name->vpid);
ompi_process_info.proc_session_dir=ompi_session_dir ompi_process_info.proc_session_dir=ompi_session_dir