Changeset 33482
- Timestamp:
- Mar 12, 2012, 5:48:27 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20111122/Ohana/src/libdvo/src/HostTable.c
r33478 r33482 289 289 290 290 // find the host which has finished 291 int j;292 291 int found = FALSE; 293 for ( j = 0; (j < table->Nhosts) && !found; j++) {294 if (table->hosts[ j].pid != pid) continue;292 for (i = 0; (i < table->Nhosts) && !found; i++) { 293 if (table->hosts[i].pid != pid) continue; 295 294 found = TRUE; 296 295 296 HostInfo *host = &table->hosts[i]; 297 297 298 // check on the status of this and report any output? 298 fprintf (stdout, "job finished for %s (%d)\n", table->hosts[j].hostname, pid);299 fprintf (stdout, "job finished for %s (%d)\n", host->hostname, pid); 299 300 300 301 // read stdout 301 EmptyIOBuffer (& table->hosts[j].stdout, 100, table->hosts[j].stdio[HOST_STDOUT]);302 fprintf (stdout, "--- stdout from %s ---\n", table->hosts[j].hostname);303 write (STDOUT_FILENO, table->hosts[j].stdout.buffer, table->hosts[j].stdout.Nbuffer);304 FlushIOBuffer (& table->hosts[i].stdout);302 EmptyIOBuffer (&host->stdout, 100, host->stdio[HOST_STDOUT]); 303 fprintf (stdout, "--- stdout from %s ---\n", host->hostname); 304 write (STDOUT_FILENO, host->stdout.buffer, host->stdout.Nbuffer); 305 FlushIOBuffer (&host->stdout); 305 306 fprintf (stdout, "\n"); 306 307 307 308 // read stderr 308 EmptyIOBuffer (& table->hosts[j].stderr, 100, table->hosts[j].stdio[HOST_STDERR]);309 fprintf (stdout, "--- stderr from %s ---\n", table->hosts[j].hostname);310 write (STDOUT_FILENO, table->hosts[j].stderr.buffer, table->hosts[j].stderr.Nbuffer);311 FlushIOBuffer (& table->hosts[i].stderr);309 EmptyIOBuffer (&host->stderr, 100, host->stdio[HOST_STDERR]); 310 fprintf (stdout, "--- stderr from %s ---\n", host->hostname); 311 write (STDOUT_FILENO, host->stderr.buffer, host->stderr.Nbuffer); 312 FlushIOBuffer (&host->stderr); 312 313 fprintf (stdout, "\n"); 313 314 314 315 if (WIFEXITED(status)) { 315 316 fprintf (stdout, "normal completion, exit status is %d\n", WEXITSTATUS(status)); 316 table->hosts[j].status = WEXITSTATUS(status);317 if ( table->hosts[j].status) {318 fprintf (stdout, "job failed on %s\n", table->hosts[j].hostname);317 host->status = WEXITSTATUS(status); 318 if (host->status) { 319 fprintf (stdout, "job failed on %s\n", host->hostname); 319 320 } 320 321 } else { 321 table->hosts[j].status = -1;322 fprintf (stdout, "job exited abnormally on %s\n", table->hosts[j].hostname);322 host->status = -1; 323 fprintf (stdout, "job exited abnormally on %s\n", host->hostname); 323 324 continue; 324 325 }
Note:
See TracChangeset
for help on using the changeset viewer.
