1
1

* Use the ORTE_<type> constants instead of internal DSS_TYPE_<type>_T constants

for the type to be packed / unpacked when dealing with sized types (like
  size_t) so that the dss_unpack code to deal with types of different sizes is
  activated.  Necessary for proper 32/64 interoperability.

This commit was SVN r9475.
Этот коммит содержится в:
Brian Barrett 2006-03-30 14:33:25 +00:00
родитель ea11582191
Коммит 6be35fb604
9 изменённых файлов: 91 добавлений и 87 удалений

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

@ -43,6 +43,75 @@ extern "C" {
*/
#define ORTE_DSS_DEFAULT_PAGE_SIZE 1
/*
* Internal type corresponding to size_t. Do not use this in
* interface calls - use ORTE_SIZE instead.
*/
#if SIZEOF_SIZE_T == 1
#define DSS_TYPE_SIZE_T ORTE_UINT8
#elif SIZEOF_SIZE_T == 2
#define DSS_TYPE_SIZE_T ORTE_UINT16
#elif SIZEOF_SIZE_T == 4
#define DSS_TYPE_SIZE_T ORTE_UINT32
#elif SIZEOF_SIZE_T == 8
#define DSS_TYPE_SIZE_T ORTE_UINT64
#else
#error Unsupported size_t size!
#endif
/*
* Internal type corresponding to bool. Do not use this in interface
* calls - use ORTE_BOOL instead.
*/
#if SIZEOF_BOOL == 1
#define DSS_TYPE_BOOL ORTE_UINT8
#elif SIZEOF_BOOL == 2
#define DSS_TYPE_BOOL ORTE_UINT16
#elif SIZEOF_BOOL == 4
#define DSS_TYPE_BOOL ORTE_UINT32
#elif SIZEOF_BOOL == 8
#define DSS_TYPE_BOOL ORTE_UINT64
#else
#error Unsupported bool size!
#endif
/*
* Internal type corresponding to int and unsigned int. Do not use
* this in interface calls - use ORTE_INT / ORTE_UINT instead.
*/
#if SIZEOF_INT == 1
#define DSS_TYPE_INT ORTE_INT8
#define DSS_TYPE_UINT ORTE_UINT8
#elif SIZEOF_INT == 2
#define DSS_TYPE_INT ORTE_INT16
#define DSS_TYPE_UINT ORTE_UINT16
#elif SIZEOF_INT == 4
#define DSS_TYPE_INT ORTE_INT32
#define DSS_TYPE_UINT ORTE_UINT32
#elif SIZEOF_INT == 8
#define DSS_TYPE_INT ORTE_INT64
#define DSS_TYPE_UINT ORTE_UINT64
#else
#error Unsupported int size!
#endif
/*
* Internal type corresponding to pid_t. Do not use this in interface
* calls - use ORTE_PID instead.
*/
#if SIZEOF_PID_T == 1
#define DSS_TYPE_PID_T ORTE_UINT8
#elif SIZEOF_PID_T == 2
#define DSS_TYPE_PID_T ORTE_UINT16
#elif SIZEOF_PID_T == 4
#define DSS_TYPE_PID_T ORTE_UINT32
#elif SIZEOF_PID_T == 8
#define DSS_TYPE_PID_T ORTE_UINT64
#else
#error Unsupported pid_t size!
#endif
/**
* Internal struct used for holding registered dss functions
*/

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

@ -57,71 +57,6 @@ OBJ_CLASS_DECLARATION(orte_data_value_t);
#define ORTE_DSS_STRUCTURED true
#define ORTE_DSS_UNSTRUCTURED false
/*
* ORTE type corresponding to size_t
*/
#if SIZEOF_SIZE_T == 1
#define DSS_TYPE_SIZE_T ORTE_UINT8
#elif SIZEOF_SIZE_T == 2
#define DSS_TYPE_SIZE_T ORTE_UINT16
#elif SIZEOF_SIZE_T == 4
#define DSS_TYPE_SIZE_T ORTE_UINT32
#elif SIZEOF_SIZE_T == 8
#define DSS_TYPE_SIZE_T ORTE_UINT64
#else
#error Unsupported size_t size!
#endif
/*
* ORTE type corresponding to bool
*/
#if SIZEOF_BOOL == 1
#define DSS_TYPE_BOOL ORTE_UINT8
#elif SIZEOF_BOOL == 2
#define DSS_TYPE_BOOL ORTE_UINT16
#elif SIZEOF_BOOL == 4
#define DSS_TYPE_BOOL ORTE_UINT32
#elif SIZEOF_BOOL == 8
#define DSS_TYPE_BOOL ORTE_UINT64
#else
#error Unsupported bool size!
#endif
/*
* ORTE type corresponding to int and unsigned int
*/
#if SIZEOF_INT == 1
#define DSS_TYPE_INT ORTE_INT8
#define DSS_TYPE_UINT ORTE_UINT8
#elif SIZEOF_INT == 2
#define DSS_TYPE_INT ORTE_INT16
#define DSS_TYPE_UINT ORTE_UINT16
#elif SIZEOF_INT == 4
#define DSS_TYPE_INT ORTE_INT32
#define DSS_TYPE_UINT ORTE_UINT32
#elif SIZEOF_INT == 8
#define DSS_TYPE_INT ORTE_INT64
#define DSS_TYPE_UINT ORTE_UINT64
#else
#error Unsupported int size!
#endif
/*
* ORTE type corresponding to pid_t
*/
#if SIZEOF_PID_T == 1
#define DSS_TYPE_PID_T ORTE_UINT8
#elif SIZEOF_PID_T == 2
#define DSS_TYPE_PID_T ORTE_UINT16
#elif SIZEOF_PID_T == 4
#define DSS_TYPE_PID_T ORTE_UINT32
#elif SIZEOF_PID_T == 8
#define DSS_TYPE_PID_T ORTE_UINT64
#else
#error Unsupported pid_t size!
#endif
/**
* Structure for holding a buffer to be used with the RML or OOB
* subsystems.

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

@ -223,7 +223,7 @@ int orte_gpr_base_pack_value(orte_buffer_t *buffer, void *src,
/* pack the number of tokens so we can read it for unpacking */
if (ORTE_SUCCESS != (rc = orte_dss_pack_buffer(buffer,
(void*)(&(values[i]->num_tokens)), 1, DSS_TYPE_SIZE_T))) {
(void*)(&(values[i]->num_tokens)), 1, ORTE_SIZE))) {
ORTE_ERROR_LOG(rc);
return ORTE_ERROR;
}
@ -239,7 +239,7 @@ int orte_gpr_base_pack_value(orte_buffer_t *buffer, void *src,
/* pack the number of keyval pairs so we can read it for unpacking */
if (ORTE_SUCCESS != (rc = orte_dss_pack_buffer(buffer,
(void*)(&(values[i]->cnt)), 1, DSS_TYPE_SIZE_T))) {
(void*)(&(values[i]->cnt)), 1, ORTE_SIZE))) {
ORTE_ERROR_LOG(rc);
return ORTE_ERROR;
}
@ -295,7 +295,7 @@ int orte_gpr_base_pack_subscription(orte_buffer_t *buffer, void *src,
/* pack the number of values so we can read it for unpacking */
if (ORTE_SUCCESS != (rc = orte_dss_pack_buffer(buffer,
(void*)(&(subs[i]->cnt)), 1, DSS_TYPE_SIZE_T))) {
(void*)(&(subs[i]->cnt)), 1, ORTE_SIZE))) {
ORTE_ERROR_LOG(rc);
return rc;
}
@ -353,7 +353,7 @@ int orte_gpr_base_pack_trigger(orte_buffer_t *buffer, void *src,
/* pack the number of values so we can read it for unpacking */
if (ORTE_SUCCESS != (rc = orte_dss_pack_buffer(buffer,
(void*)(&(trigs[i]->cnt)), 1, DSS_TYPE_SIZE_T))) {
(void*)(&(trigs[i]->cnt)), 1, ORTE_SIZE))) {
ORTE_ERROR_LOG(rc);
return rc;
}
@ -412,7 +412,7 @@ int orte_gpr_base_pack_notify_data(orte_buffer_t *buffer, void *src,
/* pack the number of values so we can read it for unpacking */
if (ORTE_SUCCESS != (rc = orte_dss_pack_buffer(buffer,
(void*)(&(data[i]->cnt)), 1, DSS_TYPE_SIZE_T))) {
(void*)(&(data[i]->cnt)), 1, ORTE_SIZE))) {
ORTE_ERROR_LOG(rc);
return rc;
}
@ -486,7 +486,7 @@ int orte_gpr_base_pack_notify_msg(orte_buffer_t *buffer, void *src,
/* pack the number of datagrams so we can read it for unpacking */
if (ORTE_SUCCESS != (rc = orte_dss_pack_buffer(buffer,
(void*)(&(msg[i]->cnt)), 1, DSS_TYPE_SIZE_T))) {
(void*)(&(msg[i]->cnt)), 1, ORTE_SIZE))) {
ORTE_ERROR_LOG(rc);
return rc;
}

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

@ -241,7 +241,7 @@ int orte_gpr_base_unpack_value(orte_buffer_t *buffer, void *dest,
/* get the number of tokens */
if (ORTE_SUCCESS != (rc = orte_dss_unpack_buffer(buffer, &(values[i]->num_tokens),
&max_n, DSS_TYPE_SIZE_T))) {
&max_n, ORTE_SIZE))) {
ORTE_ERROR_LOG(rc);
return rc;
}
@ -264,7 +264,7 @@ int orte_gpr_base_unpack_value(orte_buffer_t *buffer, void *dest,
/* get the number of keyval pairs */
if (ORTE_SUCCESS != (rc = orte_dss_unpack_buffer(buffer, &(values[i]->cnt),
&max_n, DSS_TYPE_SIZE_T))) {
&max_n, ORTE_SIZE))) {
ORTE_ERROR_LOG(rc);
return rc;
}
@ -334,7 +334,7 @@ int orte_gpr_base_unpack_subscription(orte_buffer_t *buffer, void *dest,
/* get the number of values */
if (ORTE_SUCCESS != (rc = orte_dss_unpack_buffer(buffer, &(subs[i]->cnt),
&max_n, DSS_TYPE_SIZE_T))) {
&max_n, ORTE_SIZE))) {
ORTE_ERROR_LOG(rc);
return rc;
}
@ -408,7 +408,7 @@ int orte_gpr_base_unpack_trigger(orte_buffer_t *buffer, void *dest,
/* get the number of values */
if (ORTE_SUCCESS != (rc = orte_dss_unpack_buffer(buffer, &(trigs[i]->cnt),
&max_n, DSS_TYPE_SIZE_T))) {
&max_n, ORTE_SIZE))) {
ORTE_ERROR_LOG(rc);
return rc;
}
@ -480,7 +480,7 @@ int orte_gpr_base_unpack_notify_data(orte_buffer_t *buffer, void *dest,
/* get the number of values */
if (ORTE_SUCCESS != (rc = orte_dss_unpack_buffer(buffer, &(data[i]->cnt),
&max_n, DSS_TYPE_SIZE_T))) {
&max_n, ORTE_SIZE))) {
ORTE_ERROR_LOG(rc);
return rc;
}
@ -561,7 +561,7 @@ int orte_gpr_base_unpack_notify_msg(orte_buffer_t *buffer, void *dest,
/* get the number of datagrams */
if (ORTE_SUCCESS != (rc = orte_dss_unpack_buffer(buffer, &(msg[i]->cnt),
&max_n, DSS_TYPE_SIZE_T))) {
&max_n, ORTE_SIZE))) {
ORTE_ERROR_LOG(rc);
return rc;
}

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

@ -68,7 +68,7 @@ typedef uint8_t orte_gpr_notify_action_t;
#define ORTE_GPR_NOTIFY_ACTION_T ORTE_UINT8
typedef size_t orte_gpr_subscription_id_t;
#define ORTE_GPR_SUBSCRIPTION_ID_T DSS_TYPE_SIZE_T
#define ORTE_GPR_SUBSCRIPTION_ID_T ORTE_SIZE
#define ORTE_GPR_SUBSCRIPTION_ID_MAX SIZE_MAX
@ -85,7 +85,7 @@ typedef uint8_t orte_gpr_trigger_action_t;
#define ORTE_GPR_TRIGGER_ACTION_T ORTE_UINT8
typedef size_t orte_gpr_trigger_id_t;
#define ORTE_GPR_TRIGGER_ID_T DSS_TYPE_SIZE_T
#define ORTE_GPR_TRIGGER_ID_T ORTE_SIZE
#define ORTE_GPR_TRIGGER_ID_MAX SIZE_MAX

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

@ -47,7 +47,7 @@ int orte_rmgr_base_pack_app_context(orte_buffer_t *buffer, void *src,
for (i=0; i < num_vals; i++) {
/* pack the application index (for multiapp jobs) */
if (ORTE_SUCCESS != (rc = orte_dss_pack_buffer(buffer,
(void*)(&(app_context[i]->idx)), 1, DSS_TYPE_SIZE_T))) {
(void*)(&(app_context[i]->idx)), 1, ORTE_SIZE))) {
ORTE_ERROR_LOG(rc);
return rc;
}
@ -61,7 +61,7 @@ int orte_rmgr_base_pack_app_context(orte_buffer_t *buffer, void *src,
/* pack the number of processes */
if (ORTE_SUCCESS != (rc = orte_dss_pack_buffer(buffer,
(void*)(&(app_context[i]->num_procs)), 1, DSS_TYPE_SIZE_T))) {
(void*)(&(app_context[i]->num_procs)), 1, ORTE_SIZE))) {
ORTE_ERROR_LOG(rc);
return rc;
}
@ -119,7 +119,7 @@ int orte_rmgr_base_pack_app_context(orte_buffer_t *buffer, void *src,
/* Pack the map data */
if (ORTE_SUCCESS != (rc = orte_dss_pack_buffer(buffer,
(void*)(&(app_context[i]->num_map)), 1, DSS_TYPE_SIZE_T))) {
(void*)(&(app_context[i]->num_map)), 1, ORTE_SIZE))) {
ORTE_ERROR_LOG(rc);
return rc;
}

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

@ -55,7 +55,7 @@ int orte_rmgr_base_unpack_app_context(orte_buffer_t *buffer, void *dest,
/* get the app index number */
max_n = 1;
if (ORTE_SUCCESS != (rc = orte_dss_unpack_buffer(buffer, &(app_context[i]->idx),
&max_n, DSS_TYPE_SIZE_T))) {
&max_n, ORTE_SIZE))) {
ORTE_ERROR_LOG(rc);
return rc;
}
@ -71,7 +71,7 @@ int orte_rmgr_base_unpack_app_context(orte_buffer_t *buffer, void *dest,
/* get the number of processes */
max_n = 1;
if (ORTE_SUCCESS != (rc = orte_dss_unpack_buffer(buffer, &(app_context[i]->num_procs),
&max_n, DSS_TYPE_SIZE_T))) {
&max_n, ORTE_SIZE))) {
ORTE_ERROR_LOG(rc);
return rc;
}
@ -147,7 +147,7 @@ int orte_rmgr_base_unpack_app_context(orte_buffer_t *buffer, void *dest,
/* unpack the map data */
max_n=1;
if (ORTE_SUCCESS != (rc = orte_dss_unpack_buffer(buffer, &(app_context[i]->num_map),
&max_n, DSS_TYPE_SIZE_T))) {
&max_n, ORTE_SIZE))) {
ORTE_ERROR_LOG(rc);
return rc;
}

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

@ -36,7 +36,7 @@ int orte_soh_base_pack_exit_code(orte_buffer_t *buffer, void *src,
{
int rc;
if (ORTE_SUCCESS != (rc = orte_dss_pack_buffer(buffer, src, num_vals, DSS_TYPE_INT))) {
if (ORTE_SUCCESS != (rc = orte_dss_pack_buffer(buffer, src, num_vals, ORTE_INT))) {
ORTE_ERROR_LOG(rc);
}

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

@ -36,7 +36,7 @@ int orte_soh_base_unpack_exit_code(orte_buffer_t *buffer, void *dest,
{
int rc;
if (ORTE_SUCCESS != (rc = orte_dss_unpack_buffer(buffer, dest, num_vals, DSS_TYPE_INT))) {
if (ORTE_SUCCESS != (rc = orte_dss_unpack_buffer(buffer, dest, num_vals, ORTE_INT))) {
ORTE_ERROR_LOG(rc);
}