1
1

Ensure the singleton wakes up when comm_spawn fails

This commit was SVN r14714.
Этот коммит содержится в:
Ralph Castain 2007-05-21 20:13:31 +00:00
родитель b771cfcce3
Коммит 677eb5e4bc
2 изменённых файлов: 33 добавлений и 2 удалений

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

@ -47,9 +47,37 @@ int orte_wakeup(orte_jobid_t job) {
};
orte_data_value_t dval = ORTE_DATA_VALUE_EMPTY;
/* first, let's ensure we cause any triggers on this job to fire */
if (ORTE_SUCCESS != (rc = orte_ns.get_vpid_range(job, &range))) {
ORTE_ERROR_LOG(rc);
}
if (ORTE_SUCCESS != (rc = orte_schema.get_job_segment_name(&segment, job))) {
ORTE_ERROR_LOG(rc);
}
num = range;
if (ORTE_SUCCESS != (rc = orte_dss.set(&dval, (void*)&num, ORTE_STD_CNTR))) {
ORTE_ERROR_LOG(rc);
}
if (ORTE_SUCCESS != (rc = orte_gpr.put_1(ORTE_GPR_OVERWRITE | ORTE_GPR_TOKENS_AND | ORTE_GPR_KEYS_OR,
segment, tokens, ORTE_PROC_NUM_TERMINATED, &dval))) {
ORTE_ERROR_LOG(rc);
}
/* clear the dval for future use */
dval.data = NULL;
/* now let's get the root job - note, this may not actually happen IF the
* prior trigger was enough to cause us to terminate the job
*/
if (ORTE_SUCCESS != (rc = orte_ns.get_root_job(&root, job))) {
ORTE_ERROR_LOG(rc);
}
/* if the root and the specified job are the same, stop here */
if (root == job) {
return ORTE_SUCCESS;
}
if (ORTE_SUCCESS != (rc = orte_ns.get_vpid_range(root, &range))) {
ORTE_ERROR_LOG(rc);
}

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

@ -19,8 +19,11 @@ int main(int argc, char* argv[])
if (MPI_COMM_NULL == parent) {
pid = getpid();
printf("Parent [pid %ld] about to spawn!\n", (long)pid);
MPI_Comm_spawn(argv[0], MPI_ARGV_NULL, size, MPI_INFO_NULL,
0, MPI_COMM_WORLD, &child, MPI_ERRCODES_IGNORE);
if (MPI_SUCCESS != MPI_Comm_spawn(argv[0], MPI_ARGV_NULL, size, MPI_INFO_NULL,
0, MPI_COMM_WORLD, &child, MPI_ERRCODES_IGNORE)) {
printf("Child failed to spawn\n");
exit(1);
}
printf("Parent done with spawn\n");
if (0 == rank) {
msg = 38;