1
1

Update the compare_name_fields function to allow the caller to specify that wildcard values are to be treated as wildcards

This commit was SVN r23663.
Этот коммит содержится в:
Ralph Castain 2010-08-25 15:35:41 +00:00
родитель 4ecd9a0bbe
Коммит f72cdc4160
2 изменённых файлов: 25 добавлений и 14 удалений

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

@ -509,12 +509,17 @@ int orte_util_compare_name_fields(orte_ns_cmp_bitmask_t fields,
* In the case of wildcards, we check to ensure that the fields
* actually match those values - thus, a "wildcard" in this
* function does not actually stand for a wildcard value, but
* rather a specific value
* rather a specific value - UNLESS the CMP_WILD bitmask value
* is set
*/
/* check job id */
if (ORTE_NS_CMP_JOBID & fields) {
if (ORTE_NS_CMP_WILD & fields &&
(ORTE_JOBID_WILDCARD == name1->jobid ||
ORTE_JOBID_WILDCARD == name2->jobid)) {
goto check_vpid;
}
if (name1->jobid < name2->jobid) {
return OPAL_VALUE2_GREATER;
} else if (name1->jobid > name2->jobid) {
@ -525,8 +530,13 @@ int orte_util_compare_name_fields(orte_ns_cmp_bitmask_t fields,
/* get here if jobid's are equal, or not being checked
* now check vpid
*/
check_vpid:
if (ORTE_NS_CMP_VPID & fields) {
if (ORTE_NS_CMP_WILD & fields &&
(ORTE_VPID_WILDCARD == name1->vpid ||
ORTE_VPID_WILDCARD == name2->vpid)) {
return OPAL_EQUAL;
}
if (name1->vpid < name2->vpid) {
return OPAL_VALUE2_GREATER;
} else if (name1->vpid > name2->vpid) {

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

@ -44,7 +44,8 @@ typedef uint8_t orte_ns_cmp_bitmask_t; /**< Bit mask for comparing process nam
#define ORTE_NS_CMP_NONE 0x00
#define ORTE_NS_CMP_JOBID 0x02
#define ORTE_NS_CMP_VPID 0x04
#define ORTE_NS_CMP_ALL 0xff
#define ORTE_NS_CMP_ALL 0x0f
#define ORTE_NS_CMP_WILD 0x10
/* useful define to print name args in output messages */
ORTE_DECLSPEC char* orte_util_print_name_args(const orte_process_name_t *name);