2006-02-07 06:32:36 +03:00
|
|
|
/*
|
2007-03-17 02:11:45 +03:00
|
|
|
* Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana
|
2006-08-23 07:32:36 +04:00
|
|
|
* University Research and Technology
|
|
|
|
* Corporation. All rights reserved.
|
|
|
|
* Copyright (c) 2004-2006 The University of Tennessee and The University
|
|
|
|
* of Tennessee Research Foundation. All rights
|
|
|
|
* reserved.
|
2006-02-07 06:32:36 +03:00
|
|
|
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
|
|
|
* University of Stuttgart. All rights reserved.
|
|
|
|
* Copyright (c) 2004-2005 The Regents of the University of California.
|
|
|
|
* All rights reserved.
|
|
|
|
* $COPYRIGHT$
|
|
|
|
*
|
|
|
|
* Additional copyrights may follow
|
|
|
|
*
|
|
|
|
* $HEADER$
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "orte_config.h"
|
|
|
|
|
2007-03-17 02:11:45 +03:00
|
|
|
#include "orte/orte_constants.h"
|
|
|
|
|
2006-02-07 06:32:36 +03:00
|
|
|
#include <sys/types.h>
|
|
|
|
#if HAVE_NETINET_IN_H
|
|
|
|
#include <netinet/in.h>
|
|
|
|
#endif
|
2006-09-15 01:29:51 +04:00
|
|
|
#include "opal/util/output.h"
|
2006-02-07 06:32:36 +03:00
|
|
|
|
|
|
|
#include "orte/mca/errmgr/errmgr.h"
|
2006-09-15 01:29:51 +04:00
|
|
|
#include "orte/mca/odls/odls_types.h"
|
2006-02-07 06:32:36 +03:00
|
|
|
|
|
|
|
#include "orte/dss/dss_internal.h"
|
|
|
|
|
|
|
|
static void orte_dss_arith_int(int *value, int *operand, orte_dss_arith_op_t operation);
|
|
|
|
static void orte_dss_arith_uint(uint *value, uint *operand, orte_dss_arith_op_t operation);
|
|
|
|
static void orte_dss_arith_size(size_t *value, size_t *operand, orte_dss_arith_op_t operation);
|
|
|
|
static void orte_dss_arith_pid(pid_t *value, pid_t *operand, orte_dss_arith_op_t operation);
|
|
|
|
static void orte_dss_arith_byte(uint8_t *value, uint8_t *operand, orte_dss_arith_op_t operation);
|
|
|
|
static void orte_dss_arith_int8(int8_t *value, int8_t *operand, orte_dss_arith_op_t operation);
|
|
|
|
static void orte_dss_arith_int16(int16_t *value, int16_t *operand, orte_dss_arith_op_t operation);
|
|
|
|
static void orte_dss_arith_uint16(uint16_t *value, uint16_t *operand, orte_dss_arith_op_t operation);
|
|
|
|
static void orte_dss_arith_int32(int32_t *value, int32_t *operand, orte_dss_arith_op_t operation);
|
|
|
|
static void orte_dss_arith_uint32(uint32_t *value, uint32_t *operand, orte_dss_arith_op_t operation);
|
|
|
|
static void orte_dss_arith_int64(int64_t *value, int64_t *operand, orte_dss_arith_op_t operation);
|
|
|
|
static void orte_dss_arith_uint64(uint64_t *value, uint64_t *operand, orte_dss_arith_op_t operation);
|
|
|
|
|
2006-08-15 23:54:10 +04:00
|
|
|
static void orte_dss_arith_std_cntr(orte_std_cntr_t *value, orte_std_cntr_t *operand, orte_dss_arith_op_t operation);
|
|
|
|
|
2006-02-07 06:32:36 +03:00
|
|
|
/* some weird ones - but somebody *might* want to do it, I suppose... */
|
|
|
|
static void orte_dss_arith_data_type(orte_data_type_t *value, orte_data_type_t *operand, orte_dss_arith_op_t operation);
|
|
|
|
static void orte_dss_arith_daemon_cmd(orte_daemon_cmd_flag_t *value, orte_daemon_cmd_flag_t *operand, orte_dss_arith_op_t operation);
|
|
|
|
|
2007-03-17 02:11:45 +03:00
|
|
|
#if OPAL_ENABLE_FT == 1
|
|
|
|
static void orte_dss_arith_ckpt_cmd(orte_daemon_cmd_flag_t *value, orte_daemon_cmd_flag_t *operand, orte_dss_arith_op_t operation);
|
|
|
|
#endif
|
|
|
|
|
Bring over the ORTE 2.0 DSS. This introduces a few changes, almost all of which are transparent to the user:
1. Introduces a flag for the type of buffer that now allows a user to either have a fully described or a completely non-described buffer. In the latter case, no data type descriptions are included in the buffer. This obviously limits what we can do for debugging purposes, but the intent here was to provide an optimized communications capability for those wanting it.
Note that individual buffers can be designated for either type using the orte_dss.set_buffer_type command. In other words, the buffer type can be set dynamically - it isn't a configuration setting at all. The type will default to fully described. A buffer MUST be empty to set its type - this is checked by the set_buffer_type command, and you will receive an error if you violate that rule.
IMPORTANT NOTE: ORTE 1.x actually will NOT work with non-described buffers. This capability should therefore NOT be used until we tell you it is okay. For now, it is here simply so we can begin bringing over parts of ORTE 2.0. The problem is that ORTE 1.x depends upon the transmission of non-hard-cast data types such as size_t. These "soft" types currently utilize a "peek" function to see their actual type in the buffer - obviously, without description, the system has no idea how to unpack these "soft" types. We will deal with this later - for now, please don't use the non-described buffer option.
2. Introduces the orte_std_cntr_t type. This will become the replacement for the size_t's used throughout ORTE 1.x. At the moment, it is actually typedef'd to size_t for backward compatibility.
3. Introduces the orte_dss.arith API that supports arbitrary arithmetic functions on numeric data types. Calling the function with any other data type will generate an error.
This commit was SVN r11075.
2006-08-01 22:42:25 +04:00
|
|
|
int orte_dss_arith(orte_data_value_t *value, orte_data_value_t *operand, orte_dss_arith_op_t operation)
|
2006-02-07 06:32:36 +03:00
|
|
|
{
|
|
|
|
/* check for error */
|
|
|
|
if (NULL == value || NULL == operand) {
|
|
|
|
ORTE_ERROR_LOG(ORTE_ERR_BAD_PARAM);
|
|
|
|
return ORTE_ERR_BAD_PARAM;
|
|
|
|
}
|
Bring over the ORTE 2.0 DSS. This introduces a few changes, almost all of which are transparent to the user:
1. Introduces a flag for the type of buffer that now allows a user to either have a fully described or a completely non-described buffer. In the latter case, no data type descriptions are included in the buffer. This obviously limits what we can do for debugging purposes, but the intent here was to provide an optimized communications capability for those wanting it.
Note that individual buffers can be designated for either type using the orte_dss.set_buffer_type command. In other words, the buffer type can be set dynamically - it isn't a configuration setting at all. The type will default to fully described. A buffer MUST be empty to set its type - this is checked by the set_buffer_type command, and you will receive an error if you violate that rule.
IMPORTANT NOTE: ORTE 1.x actually will NOT work with non-described buffers. This capability should therefore NOT be used until we tell you it is okay. For now, it is here simply so we can begin bringing over parts of ORTE 2.0. The problem is that ORTE 1.x depends upon the transmission of non-hard-cast data types such as size_t. These "soft" types currently utilize a "peek" function to see their actual type in the buffer - obviously, without description, the system has no idea how to unpack these "soft" types. We will deal with this later - for now, please don't use the non-described buffer option.
2. Introduces the orte_std_cntr_t type. This will become the replacement for the size_t's used throughout ORTE 1.x. At the moment, it is actually typedef'd to size_t for backward compatibility.
3. Introduces the orte_dss.arith API that supports arbitrary arithmetic functions on numeric data types. Calling the function with any other data type will generate an error.
This commit was SVN r11075.
2006-08-01 22:42:25 +04:00
|
|
|
if (operand->type != value->type) {
|
2006-02-07 06:32:36 +03:00
|
|
|
ORTE_ERROR_LOG(ORTE_ERR_TYPE_MISMATCH);
|
|
|
|
return ORTE_ERR_TYPE_MISMATCH;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Lookup the arith function for this type and call it */
|
|
|
|
|
Bring over the ORTE 2.0 DSS. This introduces a few changes, almost all of which are transparent to the user:
1. Introduces a flag for the type of buffer that now allows a user to either have a fully described or a completely non-described buffer. In the latter case, no data type descriptions are included in the buffer. This obviously limits what we can do for debugging purposes, but the intent here was to provide an optimized communications capability for those wanting it.
Note that individual buffers can be designated for either type using the orte_dss.set_buffer_type command. In other words, the buffer type can be set dynamically - it isn't a configuration setting at all. The type will default to fully described. A buffer MUST be empty to set its type - this is checked by the set_buffer_type command, and you will receive an error if you violate that rule.
IMPORTANT NOTE: ORTE 1.x actually will NOT work with non-described buffers. This capability should therefore NOT be used until we tell you it is okay. For now, it is here simply so we can begin bringing over parts of ORTE 2.0. The problem is that ORTE 1.x depends upon the transmission of non-hard-cast data types such as size_t. These "soft" types currently utilize a "peek" function to see their actual type in the buffer - obviously, without description, the system has no idea how to unpack these "soft" types. We will deal with this later - for now, please don't use the non-described buffer option.
2. Introduces the orte_std_cntr_t type. This will become the replacement for the size_t's used throughout ORTE 1.x. At the moment, it is actually typedef'd to size_t for backward compatibility.
3. Introduces the orte_dss.arith API that supports arbitrary arithmetic functions on numeric data types. Calling the function with any other data type will generate an error.
This commit was SVN r11075.
2006-08-01 22:42:25 +04:00
|
|
|
switch(operand->type) {
|
2006-02-07 06:32:36 +03:00
|
|
|
case ORTE_INT:
|
2006-08-23 07:32:36 +04:00
|
|
|
orte_dss_arith_int((int*)value->data, (int*)operand->data, operation);
|
2006-02-07 06:32:36 +03:00
|
|
|
break;
|
|
|
|
|
|
|
|
case ORTE_UINT:
|
2006-08-23 07:32:36 +04:00
|
|
|
orte_dss_arith_uint((uint*)value->data, (uint*)operand->data, operation);
|
2006-02-07 06:32:36 +03:00
|
|
|
break;
|
|
|
|
|
|
|
|
case ORTE_SIZE:
|
2006-08-23 07:32:36 +04:00
|
|
|
orte_dss_arith_size((size_t*)value->data, (size_t*)operand->data, operation);
|
2006-02-07 06:32:36 +03:00
|
|
|
break;
|
|
|
|
|
|
|
|
case ORTE_PID:
|
2006-08-23 07:32:36 +04:00
|
|
|
orte_dss_arith_pid((pid_t*)value->data, (pid_t*)operand->data, operation);
|
2006-02-07 06:32:36 +03:00
|
|
|
break;
|
|
|
|
|
|
|
|
case ORTE_BYTE:
|
|
|
|
case ORTE_UINT8:
|
2006-08-23 07:32:36 +04:00
|
|
|
orte_dss_arith_byte((uint8_t*)value->data, (uint8_t*)operand->data, operation);
|
2006-02-07 06:32:36 +03:00
|
|
|
break;
|
|
|
|
|
|
|
|
case ORTE_INT8:
|
2006-08-23 07:32:36 +04:00
|
|
|
orte_dss_arith_int8((int8_t*)value->data, (int8_t*)operand->data, operation);
|
2006-02-07 06:32:36 +03:00
|
|
|
break;
|
|
|
|
|
|
|
|
case ORTE_INT16:
|
2006-08-23 07:32:36 +04:00
|
|
|
orte_dss_arith_int16((int16_t*)value->data, (int16_t*)operand->data, operation);
|
2006-02-07 06:32:36 +03:00
|
|
|
break;
|
|
|
|
|
|
|
|
case ORTE_UINT16:
|
2006-08-23 07:32:36 +04:00
|
|
|
orte_dss_arith_uint16((uint16_t*)value->data, (uint16_t*)operand->data, operation);
|
2006-02-07 06:32:36 +03:00
|
|
|
break;
|
|
|
|
|
|
|
|
case ORTE_INT32:
|
2006-08-23 07:32:36 +04:00
|
|
|
orte_dss_arith_int32((int32_t*)value->data, (int32_t*)operand->data, operation);
|
2006-02-07 06:32:36 +03:00
|
|
|
break;
|
|
|
|
|
|
|
|
case ORTE_UINT32:
|
2006-08-23 07:32:36 +04:00
|
|
|
orte_dss_arith_uint32((uint32_t*)value->data, (uint32_t*)operand->data, operation);
|
2006-02-07 06:32:36 +03:00
|
|
|
break;
|
|
|
|
|
|
|
|
case ORTE_INT64:
|
2006-08-23 07:32:36 +04:00
|
|
|
orte_dss_arith_int64((int64_t*)value->data, (int64_t*)operand->data, operation);
|
2006-02-07 06:32:36 +03:00
|
|
|
break;
|
|
|
|
|
|
|
|
case ORTE_UINT64:
|
2006-08-23 07:32:36 +04:00
|
|
|
orte_dss_arith_uint64((uint64_t*)value->data, (uint64_t*)operand->data, operation);
|
2006-02-07 06:32:36 +03:00
|
|
|
break;
|
|
|
|
|
2006-08-15 23:54:10 +04:00
|
|
|
case ORTE_STD_CNTR:
|
2006-08-23 07:32:36 +04:00
|
|
|
orte_dss_arith_std_cntr((orte_std_cntr_t*)value->data, (orte_std_cntr_t*)operand->data, operation);
|
2006-08-15 23:54:10 +04:00
|
|
|
break;
|
|
|
|
|
2006-02-07 06:32:36 +03:00
|
|
|
default:
|
|
|
|
ORTE_ERROR_LOG(ORTE_ERR_OPERATION_UNSUPPORTED);
|
|
|
|
return ORTE_ERR_OPERATION_UNSUPPORTED;
|
|
|
|
}
|
|
|
|
|
|
|
|
return ORTE_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
int orte_dss_increment(orte_data_value_t *value)
|
|
|
|
{
|
|
|
|
int one;
|
|
|
|
unsigned int uone;
|
|
|
|
size_t sone;
|
|
|
|
pid_t pone;
|
|
|
|
uint8_t u8one;
|
|
|
|
int8_t i8one;
|
|
|
|
uint16_t u16one;
|
|
|
|
int16_t i16one;
|
|
|
|
uint32_t u32one;
|
|
|
|
int32_t i32one;
|
|
|
|
uint64_t u64one;
|
|
|
|
int64_t i64one;
|
|
|
|
orte_daemon_cmd_flag_t daemoncmdone;
|
|
|
|
orte_data_type_t datatypeone;
|
2006-08-15 23:54:10 +04:00
|
|
|
orte_std_cntr_t stdcntrone;
|
2007-03-17 02:11:45 +03:00
|
|
|
#if OPAL_ENABLE_FT == 1
|
|
|
|
orte_daemon_cmd_flag_t ckptcmdone;
|
|
|
|
#endif
|
2006-02-07 06:32:36 +03:00
|
|
|
|
|
|
|
/* check for error */
|
|
|
|
if (NULL == value) {
|
|
|
|
ORTE_ERROR_LOG(ORTE_ERR_BAD_PARAM);
|
|
|
|
return ORTE_ERR_BAD_PARAM;
|
|
|
|
}
|
|
|
|
/* Lookup the arith function for this type and call it */
|
|
|
|
|
|
|
|
switch(value->type) {
|
|
|
|
case ORTE_INT:
|
|
|
|
one = 1;
|
2006-08-23 07:32:36 +04:00
|
|
|
orte_dss_arith_int((int*)value->data, &one, ORTE_DSS_ADD);
|
2006-02-07 06:32:36 +03:00
|
|
|
break;
|
|
|
|
|
|
|
|
case ORTE_UINT:
|
|
|
|
uone = 1;
|
2006-08-23 07:32:36 +04:00
|
|
|
orte_dss_arith_uint((uint*)value->data, &uone, ORTE_DSS_ADD);
|
2006-02-07 06:32:36 +03:00
|
|
|
break;
|
|
|
|
|
|
|
|
case ORTE_SIZE:
|
|
|
|
sone = 1;
|
2006-08-23 07:32:36 +04:00
|
|
|
orte_dss_arith_size((size_t*)value->data, &sone, ORTE_DSS_ADD);
|
2006-02-07 06:32:36 +03:00
|
|
|
break;
|
|
|
|
|
|
|
|
case ORTE_PID:
|
|
|
|
pone = 1;
|
2006-08-23 07:32:36 +04:00
|
|
|
orte_dss_arith_pid((pid_t*)value->data, &pone, ORTE_DSS_ADD);
|
2006-02-07 06:32:36 +03:00
|
|
|
break;
|
|
|
|
|
|
|
|
case ORTE_BYTE:
|
|
|
|
case ORTE_UINT8:
|
|
|
|
u8one = 1;
|
2006-08-23 07:32:36 +04:00
|
|
|
orte_dss_arith_byte((uint8_t*)value->data, &u8one, ORTE_DSS_ADD);
|
2006-02-07 06:32:36 +03:00
|
|
|
break;
|
|
|
|
|
|
|
|
case ORTE_INT8:
|
|
|
|
i8one = 1;
|
2006-08-23 07:32:36 +04:00
|
|
|
orte_dss_arith_int8((int8_t*)value->data, &i8one, ORTE_DSS_ADD);
|
2006-02-07 06:32:36 +03:00
|
|
|
break;
|
|
|
|
|
|
|
|
case ORTE_INT16:
|
|
|
|
i16one = 1;
|
2006-08-23 07:32:36 +04:00
|
|
|
orte_dss_arith_int16((int16_t*)value->data, &i16one, ORTE_DSS_ADD);
|
2006-02-07 06:32:36 +03:00
|
|
|
break;
|
|
|
|
|
|
|
|
case ORTE_UINT16:
|
|
|
|
u16one = 1;
|
2006-08-23 07:32:36 +04:00
|
|
|
orte_dss_arith_uint16((uint16_t*)value->data, &u16one, ORTE_DSS_ADD);
|
2006-02-07 06:32:36 +03:00
|
|
|
break;
|
|
|
|
|
|
|
|
case ORTE_INT32:
|
|
|
|
i32one = 1;
|
2006-08-23 07:32:36 +04:00
|
|
|
orte_dss_arith_int32((int32_t*)value->data, &i32one, ORTE_DSS_ADD);
|
2006-02-07 06:32:36 +03:00
|
|
|
break;
|
|
|
|
|
|
|
|
case ORTE_UINT32:
|
|
|
|
u32one = 1;
|
2006-08-23 07:32:36 +04:00
|
|
|
orte_dss_arith_uint32((uint32_t*)value->data, &u32one, ORTE_DSS_ADD);
|
2006-02-07 06:32:36 +03:00
|
|
|
break;
|
|
|
|
|
|
|
|
case ORTE_INT64:
|
|
|
|
i64one = 1;
|
2006-08-23 07:32:36 +04:00
|
|
|
orte_dss_arith_int64((int64_t*)value->data, &i64one, ORTE_DSS_ADD);
|
2006-02-07 06:32:36 +03:00
|
|
|
break;
|
|
|
|
|
|
|
|
case ORTE_UINT64:
|
|
|
|
u64one = 1;
|
2006-08-23 07:32:36 +04:00
|
|
|
orte_dss_arith_uint64((uint64_t*)value->data, &u64one, ORTE_DSS_ADD);
|
2006-02-07 06:32:36 +03:00
|
|
|
break;
|
|
|
|
|
|
|
|
case ORTE_DAEMON_CMD:
|
|
|
|
daemoncmdone = 1;
|
2006-08-23 07:32:36 +04:00
|
|
|
orte_dss_arith_daemon_cmd((orte_daemon_cmd_flag_t*)value->data, &daemoncmdone, ORTE_DSS_ADD);
|
2006-02-07 06:32:36 +03:00
|
|
|
break;
|
|
|
|
|
2007-03-17 02:11:45 +03:00
|
|
|
#if OPAL_ENABLE_FT == 1
|
|
|
|
case ORTE_CKPT_CMD:
|
|
|
|
ckptcmdone = 1;
|
|
|
|
orte_dss_arith_ckpt_cmd(value->data, &ckptcmdone, ORTE_DSS_ADD);
|
|
|
|
break;
|
|
|
|
#endif
|
|
|
|
|
2006-02-07 06:32:36 +03:00
|
|
|
case ORTE_DATA_TYPE:
|
|
|
|
datatypeone = 1;
|
2006-08-23 07:32:36 +04:00
|
|
|
orte_dss_arith_data_type((orte_data_type_t*)value->data, &datatypeone, ORTE_DSS_ADD);
|
2006-02-07 06:32:36 +03:00
|
|
|
break;
|
|
|
|
|
2006-08-15 23:54:10 +04:00
|
|
|
case ORTE_STD_CNTR:
|
|
|
|
stdcntrone = 1;
|
2006-08-23 07:32:36 +04:00
|
|
|
orte_dss_arith_std_cntr((orte_std_cntr_t*)value->data, &stdcntrone, ORTE_DSS_ADD);
|
2006-08-15 23:54:10 +04:00
|
|
|
break;
|
|
|
|
|
2006-02-07 06:32:36 +03:00
|
|
|
default:
|
|
|
|
ORTE_ERROR_LOG(ORTE_ERR_OPERATION_UNSUPPORTED);
|
|
|
|
return ORTE_ERR_OPERATION_UNSUPPORTED;
|
|
|
|
}
|
|
|
|
|
|
|
|
return ORTE_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
int orte_dss_decrement(orte_data_value_t *value)
|
|
|
|
{
|
|
|
|
int one;
|
|
|
|
unsigned int uone;
|
|
|
|
size_t sone;
|
|
|
|
pid_t pone;
|
|
|
|
uint8_t u8one;
|
|
|
|
int8_t i8one;
|
|
|
|
uint16_t u16one;
|
|
|
|
int16_t i16one;
|
|
|
|
uint32_t u32one;
|
|
|
|
int32_t i32one;
|
|
|
|
uint64_t u64one;
|
|
|
|
int64_t i64one;
|
|
|
|
orte_daemon_cmd_flag_t daemoncmdone;
|
|
|
|
orte_data_type_t datatypeone;
|
2006-08-15 23:54:10 +04:00
|
|
|
orte_std_cntr_t stdcntrone;
|
2007-03-17 02:11:45 +03:00
|
|
|
#if OPAL_ENABLE_FT == 1
|
|
|
|
orte_daemon_cmd_flag_t ckptcmdone;
|
|
|
|
#endif
|
2006-02-07 06:32:36 +03:00
|
|
|
|
|
|
|
/* check for error */
|
|
|
|
if (NULL == value) {
|
|
|
|
ORTE_ERROR_LOG(ORTE_ERR_BAD_PARAM);
|
|
|
|
return ORTE_ERR_BAD_PARAM;
|
|
|
|
}
|
|
|
|
/* Lookup the arith function for this type and call it */
|
|
|
|
|
|
|
|
switch(value->type) {
|
|
|
|
case ORTE_INT:
|
|
|
|
one = 1;
|
2006-08-23 07:32:36 +04:00
|
|
|
orte_dss_arith_int((int*)value->data, &one, ORTE_DSS_SUB);
|
2006-02-07 06:32:36 +03:00
|
|
|
break;
|
|
|
|
|
|
|
|
case ORTE_UINT:
|
|
|
|
uone = 1;
|
2006-08-23 07:32:36 +04:00
|
|
|
orte_dss_arith_uint((uint*)value->data, &uone, ORTE_DSS_SUB);
|
2006-02-07 06:32:36 +03:00
|
|
|
break;
|
|
|
|
|
|
|
|
case ORTE_SIZE:
|
|
|
|
sone = 1;
|
2006-08-23 07:32:36 +04:00
|
|
|
orte_dss_arith_size((size_t*)value->data, &sone, ORTE_DSS_SUB);
|
2006-02-07 06:32:36 +03:00
|
|
|
break;
|
|
|
|
|
|
|
|
case ORTE_PID:
|
|
|
|
pone = 1;
|
2006-08-23 07:32:36 +04:00
|
|
|
orte_dss_arith_pid((pid_t*)value->data, &pone, ORTE_DSS_SUB);
|
2006-02-07 06:32:36 +03:00
|
|
|
break;
|
|
|
|
|
|
|
|
case ORTE_BYTE:
|
|
|
|
case ORTE_UINT8:
|
|
|
|
u8one = 1;
|
2006-08-23 07:32:36 +04:00
|
|
|
orte_dss_arith_byte((uint8_t*)value->data, &u8one, ORTE_DSS_SUB);
|
2006-02-07 06:32:36 +03:00
|
|
|
break;
|
|
|
|
|
|
|
|
case ORTE_INT8:
|
|
|
|
i8one = 1;
|
2006-08-23 07:32:36 +04:00
|
|
|
orte_dss_arith_int8((int8_t*)value->data, &i8one, ORTE_DSS_SUB);
|
2006-02-07 06:32:36 +03:00
|
|
|
break;
|
|
|
|
|
|
|
|
case ORTE_INT16:
|
|
|
|
i16one = 1;
|
2006-08-23 07:32:36 +04:00
|
|
|
orte_dss_arith_int16((int16_t*)value->data, &i16one, ORTE_DSS_SUB);
|
2006-02-07 06:32:36 +03:00
|
|
|
break;
|
|
|
|
|
|
|
|
case ORTE_UINT16:
|
|
|
|
u16one = 1;
|
2006-08-23 07:32:36 +04:00
|
|
|
orte_dss_arith_uint16((uint16_t*)value->data, &u16one, ORTE_DSS_SUB);
|
2006-02-07 06:32:36 +03:00
|
|
|
break;
|
|
|
|
|
|
|
|
case ORTE_INT32:
|
|
|
|
i32one = 1;
|
2006-08-23 07:32:36 +04:00
|
|
|
orte_dss_arith_int32((int32_t*)value->data, &i32one, ORTE_DSS_SUB);
|
2006-02-07 06:32:36 +03:00
|
|
|
break;
|
|
|
|
|
|
|
|
case ORTE_UINT32:
|
|
|
|
u32one = 1;
|
2006-08-23 07:32:36 +04:00
|
|
|
orte_dss_arith_uint32((uint32_t*)value->data, &u32one, ORTE_DSS_SUB);
|
2006-02-07 06:32:36 +03:00
|
|
|
break;
|
|
|
|
|
|
|
|
case ORTE_INT64:
|
|
|
|
i64one = 1;
|
2006-08-23 07:32:36 +04:00
|
|
|
orte_dss_arith_int64((int64_t*)value->data, &i64one, ORTE_DSS_SUB);
|
2006-02-07 06:32:36 +03:00
|
|
|
break;
|
|
|
|
|
|
|
|
case ORTE_UINT64:
|
|
|
|
u64one = 1;
|
2006-08-23 07:32:36 +04:00
|
|
|
orte_dss_arith_uint64((uint64_t*)value->data, &u64one, ORTE_DSS_SUB);
|
2006-02-07 06:32:36 +03:00
|
|
|
break;
|
|
|
|
|
|
|
|
case ORTE_DAEMON_CMD:
|
|
|
|
daemoncmdone = 1;
|
2006-08-23 07:32:36 +04:00
|
|
|
orte_dss_arith_daemon_cmd((orte_daemon_cmd_flag_t*)value->data, &daemoncmdone, ORTE_DSS_SUB);
|
2006-02-07 06:32:36 +03:00
|
|
|
break;
|
|
|
|
|
2007-03-17 02:11:45 +03:00
|
|
|
#if OPAL_ENABLE_FT == 1
|
|
|
|
case ORTE_CKPT_CMD:
|
|
|
|
ckptcmdone = 1;
|
|
|
|
orte_dss_arith_ckpt_cmd(value->data, &ckptcmdone, ORTE_DSS_SUB);
|
|
|
|
break;
|
|
|
|
#endif
|
|
|
|
|
2006-02-07 06:32:36 +03:00
|
|
|
case ORTE_DATA_TYPE:
|
|
|
|
datatypeone = 1;
|
2006-08-23 07:32:36 +04:00
|
|
|
orte_dss_arith_data_type((orte_data_type_t*)value->data, &datatypeone, ORTE_DSS_SUB);
|
2006-02-07 06:32:36 +03:00
|
|
|
break;
|
|
|
|
|
2006-08-15 23:54:10 +04:00
|
|
|
case ORTE_STD_CNTR:
|
|
|
|
stdcntrone = 1;
|
2006-08-23 07:32:36 +04:00
|
|
|
orte_dss_arith_std_cntr((orte_std_cntr_t*)value->data, &stdcntrone, ORTE_DSS_SUB);
|
2006-08-15 23:54:10 +04:00
|
|
|
break;
|
|
|
|
|
2006-02-07 06:32:36 +03:00
|
|
|
default:
|
|
|
|
ORTE_ERROR_LOG(ORTE_ERR_OPERATION_UNSUPPORTED);
|
|
|
|
return ORTE_ERR_OPERATION_UNSUPPORTED;
|
|
|
|
}
|
|
|
|
|
|
|
|
return ORTE_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* NUMERIC arith FUNCTIONS
|
|
|
|
*/
|
|
|
|
static void orte_dss_arith_int(int *value, int *operand, orte_dss_arith_op_t operation)
|
|
|
|
{
|
|
|
|
switch(operation) {
|
|
|
|
case ORTE_DSS_ADD:
|
|
|
|
(*value) += *operand;
|
2006-04-20 19:35:58 +04:00
|
|
|
break;
|
2006-02-07 06:32:36 +03:00
|
|
|
|
|
|
|
case ORTE_DSS_SUB:
|
|
|
|
(*value) -= *operand;
|
2006-04-20 19:35:58 +04:00
|
|
|
break;
|
2006-02-07 06:32:36 +03:00
|
|
|
|
|
|
|
case ORTE_DSS_MUL:
|
|
|
|
(*value) *= *operand;
|
2006-04-20 19:35:58 +04:00
|
|
|
break;
|
2006-02-07 06:32:36 +03:00
|
|
|
|
|
|
|
case ORTE_DSS_DIV:
|
|
|
|
if (0 == *operand) {
|
|
|
|
ORTE_ERROR_LOG(ORTE_ERR_OPERATION_UNSUPPORTED);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
(*value) /= *operand;
|
2006-04-20 19:35:58 +04:00
|
|
|
break;
|
2006-02-07 06:32:36 +03:00
|
|
|
|
|
|
|
default:
|
|
|
|
ORTE_ERROR_LOG(ORTE_ERR_OPERATION_UNSUPPORTED);
|
2006-04-20 19:35:58 +04:00
|
|
|
break;
|
2006-02-07 06:32:36 +03:00
|
|
|
}
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void orte_dss_arith_uint(uint *value, uint *operand, orte_dss_arith_op_t operation)
|
|
|
|
{
|
|
|
|
switch(operation) {
|
|
|
|
case ORTE_DSS_ADD:
|
|
|
|
(*value) += *operand;
|
2006-04-20 19:35:58 +04:00
|
|
|
break;
|
2006-02-07 06:32:36 +03:00
|
|
|
|
|
|
|
case ORTE_DSS_SUB:
|
|
|
|
(*value) -= *operand;
|
2006-04-20 19:35:58 +04:00
|
|
|
break;
|
2006-02-07 06:32:36 +03:00
|
|
|
|
|
|
|
case ORTE_DSS_MUL:
|
|
|
|
(*value) *= *operand;
|
2006-04-20 19:35:58 +04:00
|
|
|
break;
|
2006-02-07 06:32:36 +03:00
|
|
|
|
|
|
|
case ORTE_DSS_DIV:
|
|
|
|
if (0 == *operand) {
|
|
|
|
ORTE_ERROR_LOG(ORTE_ERR_OPERATION_UNSUPPORTED);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
(*value) /= *operand;
|
2006-04-20 19:35:58 +04:00
|
|
|
break;
|
2006-02-07 06:32:36 +03:00
|
|
|
|
|
|
|
default:
|
|
|
|
ORTE_ERROR_LOG(ORTE_ERR_OPERATION_UNSUPPORTED);
|
2006-04-20 19:35:58 +04:00
|
|
|
break;
|
2006-02-07 06:32:36 +03:00
|
|
|
}
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void orte_dss_arith_size(size_t *value, size_t *operand, orte_dss_arith_op_t operation)
|
|
|
|
{
|
|
|
|
switch(operation) {
|
|
|
|
case ORTE_DSS_ADD:
|
|
|
|
(*value) += *operand;
|
2006-04-20 19:35:58 +04:00
|
|
|
break;
|
2006-02-07 06:32:36 +03:00
|
|
|
|
|
|
|
case ORTE_DSS_SUB:
|
|
|
|
(*value) -= *operand;
|
2006-04-20 19:35:58 +04:00
|
|
|
break;
|
2006-02-07 06:32:36 +03:00
|
|
|
|
|
|
|
case ORTE_DSS_MUL:
|
|
|
|
(*value) *= *operand;
|
2006-04-20 19:35:58 +04:00
|
|
|
break;
|
2006-02-07 06:32:36 +03:00
|
|
|
|
|
|
|
case ORTE_DSS_DIV:
|
|
|
|
if (0 == *operand) {
|
|
|
|
ORTE_ERROR_LOG(ORTE_ERR_OPERATION_UNSUPPORTED);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
(*value) /= *operand;
|
2006-04-20 19:35:58 +04:00
|
|
|
break;
|
2006-02-07 06:32:36 +03:00
|
|
|
|
|
|
|
default:
|
|
|
|
ORTE_ERROR_LOG(ORTE_ERR_OPERATION_UNSUPPORTED);
|
2006-04-20 19:35:58 +04:00
|
|
|
break;
|
2006-02-07 06:32:36 +03:00
|
|
|
}
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void orte_dss_arith_pid(pid_t *value, pid_t *operand, orte_dss_arith_op_t operation)
|
|
|
|
{
|
|
|
|
switch(operation) {
|
|
|
|
case ORTE_DSS_ADD:
|
|
|
|
(*value) += *operand;
|
2006-04-20 19:35:58 +04:00
|
|
|
break;
|
2006-02-07 06:32:36 +03:00
|
|
|
|
|
|
|
case ORTE_DSS_SUB:
|
|
|
|
(*value) -= *operand;
|
2006-04-20 19:35:58 +04:00
|
|
|
break;
|
2006-02-07 06:32:36 +03:00
|
|
|
|
|
|
|
case ORTE_DSS_MUL:
|
|
|
|
(*value) *= *operand;
|
2006-04-20 19:35:58 +04:00
|
|
|
break;
|
2006-02-07 06:32:36 +03:00
|
|
|
|
|
|
|
case ORTE_DSS_DIV:
|
|
|
|
if (0 == *operand) {
|
|
|
|
ORTE_ERROR_LOG(ORTE_ERR_OPERATION_UNSUPPORTED);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
(*value) /= *operand;
|
2006-04-20 19:35:58 +04:00
|
|
|
break;
|
2006-02-07 06:32:36 +03:00
|
|
|
|
|
|
|
default:
|
|
|
|
ORTE_ERROR_LOG(ORTE_ERR_OPERATION_UNSUPPORTED);
|
2006-04-20 19:35:58 +04:00
|
|
|
break;
|
2006-02-07 06:32:36 +03:00
|
|
|
}
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void orte_dss_arith_byte(uint8_t *value, uint8_t *operand, orte_dss_arith_op_t operation)
|
|
|
|
{
|
|
|
|
switch(operation) {
|
|
|
|
case ORTE_DSS_ADD:
|
|
|
|
(*value) += *operand;
|
2006-04-20 19:35:58 +04:00
|
|
|
break;
|
2006-02-07 06:32:36 +03:00
|
|
|
|
|
|
|
case ORTE_DSS_SUB:
|
|
|
|
(*value) -= *operand;
|
2006-04-20 19:35:58 +04:00
|
|
|
break;
|
2006-02-07 06:32:36 +03:00
|
|
|
|
|
|
|
case ORTE_DSS_MUL:
|
|
|
|
(*value) *= *operand;
|
2006-04-20 19:35:58 +04:00
|
|
|
break;
|
2006-02-07 06:32:36 +03:00
|
|
|
|
|
|
|
case ORTE_DSS_DIV:
|
|
|
|
if (0 == *operand) {
|
|
|
|
ORTE_ERROR_LOG(ORTE_ERR_OPERATION_UNSUPPORTED);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
(*value) /= *operand;
|
2006-04-20 19:35:58 +04:00
|
|
|
break;
|
2006-02-07 06:32:36 +03:00
|
|
|
|
|
|
|
default:
|
|
|
|
ORTE_ERROR_LOG(ORTE_ERR_OPERATION_UNSUPPORTED);
|
2006-04-20 19:35:58 +04:00
|
|
|
break;
|
2006-02-07 06:32:36 +03:00
|
|
|
}
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void orte_dss_arith_int8(int8_t *value, int8_t *operand, orte_dss_arith_op_t operation)
|
|
|
|
{
|
|
|
|
switch(operation) {
|
|
|
|
case ORTE_DSS_ADD:
|
|
|
|
(*value) += *operand;
|
2006-04-20 19:35:58 +04:00
|
|
|
break;
|
2006-02-07 06:32:36 +03:00
|
|
|
|
|
|
|
case ORTE_DSS_SUB:
|
|
|
|
(*value) -= *operand;
|
2006-04-20 19:35:58 +04:00
|
|
|
break;
|
2006-02-07 06:32:36 +03:00
|
|
|
|
|
|
|
case ORTE_DSS_MUL:
|
|
|
|
(*value) *= *operand;
|
2006-04-20 19:35:58 +04:00
|
|
|
break;
|
2006-02-07 06:32:36 +03:00
|
|
|
|
|
|
|
case ORTE_DSS_DIV:
|
|
|
|
if (0 == *operand) {
|
|
|
|
ORTE_ERROR_LOG(ORTE_ERR_OPERATION_UNSUPPORTED);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
(*value) /= *operand;
|
2006-04-20 19:35:58 +04:00
|
|
|
break;
|
2006-02-07 06:32:36 +03:00
|
|
|
|
|
|
|
default:
|
|
|
|
ORTE_ERROR_LOG(ORTE_ERR_OPERATION_UNSUPPORTED);
|
2006-04-20 19:35:58 +04:00
|
|
|
break;
|
2006-02-07 06:32:36 +03:00
|
|
|
}
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void orte_dss_arith_int16(int16_t *value, int16_t *operand, orte_dss_arith_op_t operation)
|
|
|
|
{
|
|
|
|
switch(operation) {
|
|
|
|
case ORTE_DSS_ADD:
|
|
|
|
(*value) += *operand;
|
2006-04-20 19:35:58 +04:00
|
|
|
break;
|
2006-02-07 06:32:36 +03:00
|
|
|
|
|
|
|
case ORTE_DSS_SUB:
|
|
|
|
(*value) -= *operand;
|
2006-04-20 19:35:58 +04:00
|
|
|
break;
|
2006-02-07 06:32:36 +03:00
|
|
|
|
|
|
|
case ORTE_DSS_MUL:
|
|
|
|
(*value) *= *operand;
|
2006-04-20 19:35:58 +04:00
|
|
|
break;
|
2006-02-07 06:32:36 +03:00
|
|
|
|
|
|
|
case ORTE_DSS_DIV:
|
|
|
|
if (0 == *operand) {
|
|
|
|
ORTE_ERROR_LOG(ORTE_ERR_OPERATION_UNSUPPORTED);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
(*value) /= *operand;
|
2006-04-20 19:35:58 +04:00
|
|
|
break;
|
2006-02-07 06:32:36 +03:00
|
|
|
|
|
|
|
default:
|
|
|
|
ORTE_ERROR_LOG(ORTE_ERR_OPERATION_UNSUPPORTED);
|
2006-04-20 19:35:58 +04:00
|
|
|
break;
|
2006-02-07 06:32:36 +03:00
|
|
|
}
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void orte_dss_arith_uint16(uint16_t *value, uint16_t *operand, orte_dss_arith_op_t operation)
|
|
|
|
{
|
|
|
|
switch(operation) {
|
|
|
|
case ORTE_DSS_ADD:
|
|
|
|
(*value) += *operand;
|
2006-04-20 19:35:58 +04:00
|
|
|
break;
|
2006-02-07 06:32:36 +03:00
|
|
|
|
|
|
|
case ORTE_DSS_SUB:
|
|
|
|
(*value) -= *operand;
|
2006-04-20 19:35:58 +04:00
|
|
|
break;
|
2006-02-07 06:32:36 +03:00
|
|
|
|
|
|
|
case ORTE_DSS_MUL:
|
|
|
|
(*value) *= *operand;
|
2006-04-20 19:35:58 +04:00
|
|
|
break;
|
2006-02-07 06:32:36 +03:00
|
|
|
|
|
|
|
case ORTE_DSS_DIV:
|
|
|
|
if (0 == *operand) {
|
|
|
|
ORTE_ERROR_LOG(ORTE_ERR_OPERATION_UNSUPPORTED);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
(*value) /= *operand;
|
2006-04-20 19:35:58 +04:00
|
|
|
break;
|
2006-02-07 06:32:36 +03:00
|
|
|
|
|
|
|
default:
|
|
|
|
ORTE_ERROR_LOG(ORTE_ERR_OPERATION_UNSUPPORTED);
|
2006-04-20 19:35:58 +04:00
|
|
|
break;
|
2006-02-07 06:32:36 +03:00
|
|
|
}
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void orte_dss_arith_int32(int32_t *value, int32_t *operand, orte_dss_arith_op_t operation)
|
|
|
|
{
|
|
|
|
switch(operation) {
|
|
|
|
case ORTE_DSS_ADD:
|
|
|
|
(*value) += *operand;
|
2006-04-20 19:35:58 +04:00
|
|
|
break;
|
2006-02-07 06:32:36 +03:00
|
|
|
|
|
|
|
case ORTE_DSS_SUB:
|
|
|
|
(*value) -= *operand;
|
2006-04-20 19:35:58 +04:00
|
|
|
break;
|
2006-02-07 06:32:36 +03:00
|
|
|
|
|
|
|
case ORTE_DSS_MUL:
|
|
|
|
(*value) *= *operand;
|
2006-04-20 19:35:58 +04:00
|
|
|
break;
|
2006-02-07 06:32:36 +03:00
|
|
|
|
|
|
|
case ORTE_DSS_DIV:
|
|
|
|
if (0 == *operand) {
|
|
|
|
ORTE_ERROR_LOG(ORTE_ERR_OPERATION_UNSUPPORTED);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
(*value) /= *operand;
|
2006-04-20 19:35:58 +04:00
|
|
|
break;
|
2006-02-07 06:32:36 +03:00
|
|
|
|
|
|
|
default:
|
|
|
|
ORTE_ERROR_LOG(ORTE_ERR_OPERATION_UNSUPPORTED);
|
2006-04-20 19:35:58 +04:00
|
|
|
break;
|
2006-02-07 06:32:36 +03:00
|
|
|
}
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void orte_dss_arith_uint32(uint32_t *value, uint32_t *operand, orte_dss_arith_op_t operation)
|
|
|
|
{
|
|
|
|
switch(operation) {
|
|
|
|
case ORTE_DSS_ADD:
|
|
|
|
(*value) += *operand;
|
2006-04-20 19:35:58 +04:00
|
|
|
break;
|
2006-02-07 06:32:36 +03:00
|
|
|
|
|
|
|
case ORTE_DSS_SUB:
|
|
|
|
(*value) -= *operand;
|
2006-04-20 19:35:58 +04:00
|
|
|
break;
|
2006-02-07 06:32:36 +03:00
|
|
|
|
|
|
|
case ORTE_DSS_MUL:
|
|
|
|
(*value) *= *operand;
|
2006-04-20 19:35:58 +04:00
|
|
|
break;
|
2006-02-07 06:32:36 +03:00
|
|
|
|
|
|
|
case ORTE_DSS_DIV:
|
|
|
|
if (0 == *operand) {
|
|
|
|
ORTE_ERROR_LOG(ORTE_ERR_OPERATION_UNSUPPORTED);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
(*value) /= *operand;
|
2006-04-20 19:35:58 +04:00
|
|
|
break;
|
2006-02-07 06:32:36 +03:00
|
|
|
|
|
|
|
default:
|
|
|
|
ORTE_ERROR_LOG(ORTE_ERR_OPERATION_UNSUPPORTED);
|
2006-04-20 19:35:58 +04:00
|
|
|
break;
|
2006-02-07 06:32:36 +03:00
|
|
|
}
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void orte_dss_arith_int64(int64_t *value, int64_t *operand, orte_dss_arith_op_t operation)
|
|
|
|
{
|
|
|
|
switch(operation) {
|
|
|
|
case ORTE_DSS_ADD:
|
|
|
|
(*value) += *operand;
|
2006-04-20 19:35:58 +04:00
|
|
|
break;
|
2006-02-07 06:32:36 +03:00
|
|
|
|
|
|
|
case ORTE_DSS_SUB:
|
|
|
|
(*value) -= *operand;
|
2006-04-20 19:35:58 +04:00
|
|
|
break;
|
2006-02-07 06:32:36 +03:00
|
|
|
|
|
|
|
case ORTE_DSS_MUL:
|
|
|
|
(*value) *= *operand;
|
2006-04-20 19:35:58 +04:00
|
|
|
break;
|
2006-02-07 06:32:36 +03:00
|
|
|
|
|
|
|
case ORTE_DSS_DIV:
|
|
|
|
if (0 == *operand) {
|
|
|
|
ORTE_ERROR_LOG(ORTE_ERR_OPERATION_UNSUPPORTED);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
(*value) /= *operand;
|
2006-04-20 19:35:58 +04:00
|
|
|
break;
|
2006-02-07 06:32:36 +03:00
|
|
|
|
|
|
|
default:
|
|
|
|
ORTE_ERROR_LOG(ORTE_ERR_OPERATION_UNSUPPORTED);
|
2006-04-20 19:35:58 +04:00
|
|
|
break;
|
2006-02-07 06:32:36 +03:00
|
|
|
}
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void orte_dss_arith_uint64(uint64_t *value, uint64_t *operand, orte_dss_arith_op_t operation)
|
|
|
|
{
|
|
|
|
switch(operation) {
|
|
|
|
case ORTE_DSS_ADD:
|
|
|
|
(*value) += *operand;
|
2006-04-20 19:35:58 +04:00
|
|
|
break;
|
2006-02-07 06:32:36 +03:00
|
|
|
|
|
|
|
case ORTE_DSS_SUB:
|
|
|
|
(*value) -= *operand;
|
2006-04-20 19:35:58 +04:00
|
|
|
break;
|
2006-02-07 06:32:36 +03:00
|
|
|
|
|
|
|
case ORTE_DSS_MUL:
|
|
|
|
(*value) *= *operand;
|
2006-04-20 19:35:58 +04:00
|
|
|
break;
|
2006-02-07 06:32:36 +03:00
|
|
|
|
|
|
|
case ORTE_DSS_DIV:
|
|
|
|
if (0 == *operand) {
|
|
|
|
ORTE_ERROR_LOG(ORTE_ERR_OPERATION_UNSUPPORTED);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
(*value) /= *operand;
|
2006-04-20 19:35:58 +04:00
|
|
|
break;
|
2006-02-07 06:32:36 +03:00
|
|
|
|
|
|
|
default:
|
|
|
|
ORTE_ERROR_LOG(ORTE_ERR_OPERATION_UNSUPPORTED);
|
2006-04-20 19:35:58 +04:00
|
|
|
break;
|
2006-02-07 06:32:36 +03:00
|
|
|
}
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2006-08-15 23:54:10 +04:00
|
|
|
static void orte_dss_arith_std_cntr(orte_std_cntr_t *value, orte_std_cntr_t *operand, orte_dss_arith_op_t operation)
|
|
|
|
{
|
|
|
|
switch(operation) {
|
|
|
|
case ORTE_DSS_ADD:
|
|
|
|
(*value) += *operand;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case ORTE_DSS_SUB:
|
|
|
|
(*value) -= *operand;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case ORTE_DSS_MUL:
|
|
|
|
(*value) *= *operand;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case ORTE_DSS_DIV:
|
|
|
|
if (0 == *operand) {
|
|
|
|
ORTE_ERROR_LOG(ORTE_ERR_OPERATION_UNSUPPORTED);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
(*value) /= *operand;
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
ORTE_ERROR_LOG(ORTE_ERR_OPERATION_UNSUPPORTED);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2006-02-07 06:32:36 +03:00
|
|
|
static void orte_dss_arith_data_type(orte_data_type_t *value, orte_data_type_t *operand, orte_dss_arith_op_t operation)
|
|
|
|
{
|
|
|
|
switch(operation) {
|
|
|
|
case ORTE_DSS_ADD:
|
|
|
|
(*value) += *operand;
|
2006-04-20 19:35:58 +04:00
|
|
|
break;
|
2006-02-07 06:32:36 +03:00
|
|
|
|
|
|
|
case ORTE_DSS_SUB:
|
|
|
|
(*value) -= *operand;
|
2006-04-20 19:35:58 +04:00
|
|
|
break;
|
2006-02-07 06:32:36 +03:00
|
|
|
|
|
|
|
case ORTE_DSS_MUL:
|
|
|
|
(*value) *= *operand;
|
2006-04-20 19:35:58 +04:00
|
|
|
break;
|
2006-02-07 06:32:36 +03:00
|
|
|
|
|
|
|
case ORTE_DSS_DIV:
|
|
|
|
if (0 == *operand) {
|
|
|
|
ORTE_ERROR_LOG(ORTE_ERR_OPERATION_UNSUPPORTED);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
(*value) /= *operand;
|
2006-04-20 19:35:58 +04:00
|
|
|
break;
|
2006-02-07 06:32:36 +03:00
|
|
|
|
|
|
|
default:
|
|
|
|
ORTE_ERROR_LOG(ORTE_ERR_OPERATION_UNSUPPORTED);
|
2006-04-20 19:35:58 +04:00
|
|
|
break;
|
2006-02-07 06:32:36 +03:00
|
|
|
}
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void orte_dss_arith_daemon_cmd(orte_daemon_cmd_flag_t *value, orte_daemon_cmd_flag_t *operand, orte_dss_arith_op_t operation)
|
|
|
|
{
|
|
|
|
switch(operation) {
|
|
|
|
case ORTE_DSS_ADD:
|
|
|
|
(*value) += *operand;
|
2006-04-20 19:35:58 +04:00
|
|
|
break;
|
2006-02-07 06:32:36 +03:00
|
|
|
|
|
|
|
case ORTE_DSS_SUB:
|
|
|
|
(*value) -= *operand;
|
2006-04-20 19:35:58 +04:00
|
|
|
break;
|
2006-02-07 06:32:36 +03:00
|
|
|
|
|
|
|
case ORTE_DSS_MUL:
|
|
|
|
(*value) *= *operand;
|
2006-04-20 19:35:58 +04:00
|
|
|
break;
|
2006-02-07 06:32:36 +03:00
|
|
|
|
|
|
|
case ORTE_DSS_DIV:
|
|
|
|
if (0 == *operand) {
|
|
|
|
ORTE_ERROR_LOG(ORTE_ERR_OPERATION_UNSUPPORTED);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
(*value) /= *operand;
|
2006-04-20 19:35:58 +04:00
|
|
|
break;
|
2006-02-07 06:32:36 +03:00
|
|
|
|
|
|
|
default:
|
|
|
|
ORTE_ERROR_LOG(ORTE_ERR_OPERATION_UNSUPPORTED);
|
2006-04-20 19:35:58 +04:00
|
|
|
break;
|
2006-02-07 06:32:36 +03:00
|
|
|
}
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2007-03-17 02:11:45 +03:00
|
|
|
#if OPAL_ENABLE_FT == 1
|
|
|
|
static void orte_dss_arith_ckpt_cmd(orte_daemon_cmd_flag_t *value, orte_daemon_cmd_flag_t *operand, orte_dss_arith_op_t operation)
|
|
|
|
{
|
|
|
|
switch(operation) {
|
|
|
|
case ORTE_DSS_ADD:
|
|
|
|
(*value) += *operand;
|
|
|
|
return;
|
|
|
|
|
|
|
|
case ORTE_DSS_SUB:
|
|
|
|
(*value) -= *operand;
|
|
|
|
return;
|
|
|
|
|
|
|
|
case ORTE_DSS_MUL:
|
|
|
|
(*value) *= *operand;
|
|
|
|
return;
|
|
|
|
|
|
|
|
case ORTE_DSS_DIV:
|
|
|
|
if (0 == *operand) {
|
|
|
|
ORTE_ERROR_LOG(ORTE_ERR_OPERATION_UNSUPPORTED);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
(*value) /= *operand;
|
|
|
|
return;
|
|
|
|
|
|
|
|
default:
|
|
|
|
ORTE_ERROR_LOG(ORTE_ERR_OPERATION_UNSUPPORTED);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
#endif
|