1
1

Add some finer error checking that should help debug some recent problems with dynamic spawns.

This commit was SVN r9383.
Этот коммит содержится в:
Ralph Castain 2006-03-23 15:31:43 +00:00
родитель dc125cf7d5
Коммит 0552aef6bb
3 изменённых файлов: 43 добавлений и 4 удалений

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

@ -82,7 +82,10 @@ enum {
ORTE_ERR_UNKNOWN_DATA_TYPE = (ORTE_ERR_BASE - 19),
ORTE_ERR_DATA_TYPE_REDEF = (ORTE_ERR_BASE - 20),
ORTE_ERR_DATA_OVERWRITE_ATTEMPT = (ORTE_ERR_BASE - 21),
ORTE_ERR_OPERATION_UNSUPPORTED = (ORTE_ERR_BASE - 22)
ORTE_ERR_OPERATION_UNSUPPORTED = (ORTE_ERR_BASE - 22),
ORTE_ERR_PROC_STATE_MISSING = (ORTE_ERR_BASE - 23),
ORTE_ERR_PROC_EXIT_STATUS_MISSING = (ORTE_ERR_BASE - 24),
ORTE_ERR_INDETERMINATE_STATE_INFO = (ORTE_ERR_BASE - 25)
};
#define ORTE_ERR_MAX (ORTE_ERR_BASE - 100)

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

@ -72,6 +72,21 @@ int orte_soh_base_get_proc_soh(orte_proc_state_t *state,
goto CLEANUP;
}
/** there should be one - and only one - value returned. if cnt is anything else,
* we have a problem
*/
if (1 != cnt) {
if (0 == cnt) { /** check for special case - didn't find the process container */
ORTE_ERROR_LOG(ORTE_ERR_NOT_FOUND);
rc = ORTE_ERR_NOT_FOUND;
goto CLEANUP;
}
/** if not 0, then we have too many - report that */
ORTE_ERROR_LOG(ORTE_ERR_INDETERMINATE_STATE_INFO);
rc = ORTE_ERR_INDETERMINATE_STATE_INFO;
goto CLEANUP;
}
for (i=0; i < cnt; i++) {
keyvals = values[i]->keyvals;
if (NULL != keyvals) {
@ -97,10 +112,22 @@ int orte_soh_base_get_proc_soh(orte_proc_state_t *state,
/* see if we found everything */
if (!found1 || !found2) {
ORTE_ERROR_LOG(ORTE_ERR_GPR_DATA_CORRUPT);
rc = ORTE_ERR_GPR_DATA_CORRUPT;
if (found1) { /** we found the proc state, so we are missing the exit status */
ORTE_ERROR_LOG(ORTE_ERR_PROC_EXIT_STATUS_MISSING);
rc = ORTE_ERR_PROC_EXIT_STATUS_MISSING;
goto CLEANUP;
}
if (found2) { /** missing the proc state */
ORTE_ERROR_LOG(ORTE_ERR_PROC_STATE_MISSING);
rc = ORTE_ERR_PROC_STATE_MISSING;
goto CLEANUP;
}
/** if we get here, then we are missing them both! report that too */
ORTE_ERROR_LOG(ORTE_ERR_PROC_EXIT_STATUS_MISSING);
ORTE_ERROR_LOG(ORTE_ERR_PROC_STATE_MISSING);
rc = ORTE_ERR_PROC_STATE_MISSING; /** pick one to return */
}
CLEANUP:
for (i=0; i < 3; i++) {
if (NULL != keys[i]) free(keys[i]);

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

@ -94,6 +94,15 @@ orte_err2str(int errnum)
case ORTE_ERR_OPERATION_UNSUPPORTED:
retval = "Requested operation is not supported on referenced data type";
break;
case ORTE_ERR_PROC_STATE_MISSING:
retval = "The process state information is missing on the registry";
break;
case ORTE_ERR_PROC_EXIT_STATUS_MISSING:
retval = "The process exit status is missing on the registry";
break;
case ORTE_ERR_INDETERMINATE_STATE_INFO:
retval = "Request for state returned multiple responses";
break;
default:
retval = NULL;
}