Changeset 56 for trunk/pbs_drmaa
- Timestamp:
- 01/08/12 17:21:05 (13 years ago)
- Location:
- trunk/pbs_drmaa
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/pbs_drmaa/job.c
r55 r56 508 508 pbsdrmaa_job_read_exit_status( const char *job_id, const char *job_state_dir_prefix) 509 509 { 510 char *status_file = NULL ;510 char *status_file = NULL, start_file = NULL; 511 511 FILE *fhandle = NULL; 512 512 int exit_status = -1; … … 515 515 516 516 status_file = fsd_asprintf("%s/%s.exitcode", job_state_dir_prefix, job_id); 517 start_file = fsd_asprintf("%s/%s.started", job_id, job_state_dir_prefix); 517 518 518 519 if ((fhandle = fopen(status_file, "r")) == NULL) 519 520 { 521 struct stat tmpstat; 522 520 523 fsd_log_error(("Failed to open job status file: %s", status_file)); 524 if (stat(start_file, &tmpstat) == 0 && (tmpstat.st_mode & S_IFREG)) 525 { 526 exit_status = 143; /* SIGTERM */ 527 fsd_log_info("But start file exist %s. Assuming that job was killed (exit_status=%d).", start_file, exit_status); 528 } 521 529 } 522 530 else … … 527 535 528 536 fsd_free(status_file); 537 fsd_free(start_file); 529 538 530 539 return exit_status; -
trunk/pbs_drmaa/submit.c
r53 r56 336 336 if( wd != NULL ) 337 337 script_len += strlen("cd ") + strlen(wd) + strlen("; "); 338 script_len += strlen("touch ") + strlen(((pbsdrmaa_session_t *)self->session)->job_exit_status_file_prefix) + strlen("/$PBS_JOBID.started;"); 338 339 script_len += strlen(executable); 339 340 if( argv != NULL ) … … 342 343 if( input_path != NULL ) 343 344 script_len += strlen(" <") + strlen(input_path); 344 if (((pbsdrmaa_session_t *)self->session)->job_exit_status_file_prefix) 345 345 346 script_len += strlen("; echo $? >") + strlen(((pbsdrmaa_session_t *)self->session)->job_exit_status_file_prefix) + strlen("/$PBS_JOBID.exitcode"); 346 347 } 347 348 … … 353 354 if( wd != NULL ) 354 355 s += sprintf( s, "cd %s; ", wd ); 356 s += sprintf( s, "touch %s/$PBS_JOBID.started;", ((pbsdrmaa_session_t *)self->session)->job_exit_status_file_prefix) 355 357 s += sprintf( s, "%s", executable ); 356 358 if( argv != NULL ) … … 359 361 if( input_path != NULL ) 360 362 s += sprintf( s, " <%s", input_path ); 361 if (((pbsdrmaa_session_t *)self->session)->job_exit_status_file_prefix) 362 363 364 s += sprintf( s, "; echo $? >%s/$PBS_JOBID.exitcode", ((pbsdrmaa_session_t *)self->session)->job_exit_status_file_prefix); 363 365 364 366 fsd_assert( s == script+script_len );
Note: See TracChangeset
for help on using the changeset viewer.