@@ -402,36 +402,40 @@ static void torque_debug(const torque_driver_type *driver, const char *fmt,
402
402
}
403
403
404
404
static int torque_job_parse_qsub_stdout (const torque_driver_type *driver,
405
- const char *stdout_file) {
405
+ const char *stdout_file,
406
+ const char *stderr_file) {
406
407
int jobid;
407
408
{
408
- FILE *stream = util_fopen (stdout_file, " r" );
409
+ FILE *stdout_stream = util_fopen (stdout_file, " r" );
409
410
410
- char *jobid_string = util_fscanf_alloc_upto (stream , " ." , false );
411
+ char *jobid_string = util_fscanf_alloc_upto (stdout_stream , " ." , false );
411
412
412
413
bool possible_jobid;
413
414
if (jobid_string == NULL ) {
414
415
/* We get here if the '.' separator is not found */
415
- possible_jobid = util_fscanf_int (stream , &jobid);
416
+ possible_jobid = util_fscanf_int (stdout_stream , &jobid);
416
417
torque_debug (driver, " Torque job ID int: '%d'" , jobid);
417
418
} else {
418
419
possible_jobid = util_sscanf_int (jobid_string, &jobid);
419
420
torque_debug (driver, " Torque job ID string: '%s'" , jobid_string);
420
421
}
421
422
422
423
if (!possible_jobid) {
423
- char *file_content =
424
+ char *stdout_content =
424
425
util_fread_alloc_file_content (stdout_file, NULL );
426
+ char *stderr_content =
427
+ util_fread_alloc_file_content (stderr_file, NULL );
425
428
fprintf (stderr, " Failed to get torque job id from file: %s \n " ,
426
429
stdout_file);
427
- fprintf (stderr, " qsub command : %s \n " ,
428
- driver->qsub_cmd );
429
- fprintf (stderr, " File content: [%s]\n " , file_content);
430
- free (file_content);
430
+ fprintf (stderr, " qsub command: %s \n " , driver->qsub_cmd );
431
+ fprintf (stderr, " qsub output: %s\n " , stdout_content);
432
+ fprintf (stderr, " qsub errors: %s\n " , stderr_content);
433
+ free (stdout_content);
434
+ free (stderr_content);
431
435
util_exit (" %s: \n " , __func__);
432
436
}
433
437
free (jobid_string);
434
- fclose (stream );
438
+ fclose (stdout_stream );
435
439
}
436
440
return jobid;
437
441
}
@@ -560,7 +564,8 @@ static int torque_driver_submit_shell_job(torque_driver_type *driver,
560
564
}
561
565
}
562
566
563
- job_id = torque_job_parse_qsub_stdout (driver, tmp_std_file);
567
+ job_id =
568
+ torque_job_parse_qsub_stdout (driver, tmp_std_file, tmp_err_file);
564
569
565
570
util_unlink_existing (tmp_std_file);
566
571
util_unlink_existing (tmp_err_file);
0 commit comments