[torquedev] submitfilter not being run against interactive job args
due to undefined PBS_Filter
Toni L. Harbaugh-Blackford [Contr]
harbaugh at ncifcrf.gov
Thu May 3 10:38:15 MDT 2007
In the function process_opts(), the 'l' case tests for an interactive job
and runs the submitfilter against the arguments if the submitfilter exists.
But the submitfilter name variable, PBS_Filter, is not set until *after*
process_opts() is run. So the PBS_Filter is not defined at the time
the interactive arguments are being tested, and thus the submitfilter is
not run against them.
I have attached a patch that moves the option processing immediately *after*
the reading of the config file and setting of PBS_Filter. The patch also
includes submit filter exit testing like that done for the submitfilter
in non-interactive cases.
It is important at our site that processing of interactive jobs be the same
as that for non-interactive jobs. So I would appreciate feedback about the
patch.
Thanks,
Toni
-------------------------------------------------------------------
Toni Harbaugh-Blackford harbaugh at ncifcrf.gov
System Administrator
Advanced Biomedical Computing Center (ABCC)
National Cancer Institute
Contractor - SAIC/Frederick
-------------- next part --------------
--- torque-2.2.0-snap.200703191105/src/cmds/qsub.c_orig 2007-03-16 14:17:34.000000000 -0400
+++ torque-2.2.0-snap.200703191105/src/cmds/qsub.c 2007-04-05 07:40:07.000000000 -0400
@@ -3262,6 +3262,7 @@
if (Interact_opt == 1)
{
+ int rc = 0;
/* Evaluate resources for interactive submission here. */
if ((tmpfd = mkstemp(tmp_name)) < 1)
@@ -3333,13 +3334,36 @@
strcat(cline," >");
strcat(cline,tmp_name2);
- if (system(cline) == -1)
+ if ((rc=system(cline)) == -1)
{
fprintf( stderr, "qsub: error writing filter o/p, %s\n",
tmp_name2);
exit(1);
}
+ else
+ {
+ if (WEXITSTATUS(rc) == (unsigned char)SUBMIT_FILTER_ADMIN_REJECT_CODE)
+ {
+ fprintf(stderr,"qsub: Your job has been administratively rejected by the queueing system.\n");
+ fprintf(stderr,"qsub: There may be a more detailed explanation prior to this notice.\n");
+
+ unlink(tmp_name2);
+ unlink(tmp_name);
+
+ exit(1);
+ }
+
+ if (WEXITSTATUS(rc))
+ {
+ fprintf(stderr,"qsub: submit filter returned an error code, aborting job submission.\n");
+
+ unlink(tmp_name2);
+ unlink(tmp_name);
+
+ exit(1);
+ }
+ }
fP = fopen(tmp_name2,"r+");
@@ -3605,23 +3629,6 @@
}
}
- errflg = process_opts(argc,argv,0); /* get cmd-line options */
-
- if (errflg || ((optind + 1) < argc))
- {
- static char usage[] =
-"usage: qsub [-a date_time] [-A account_string] [-b secs]\n\
-[-c { c[=<INTERVAL>] | s | n }] [-C directive_prefix] [-d path] [-D path]\n\
-[-e path] [-h] [-I] [-j oe] [-k {oe}] [-l resource_list] [-m {abe}]\n\
-[-M user_list] [-N jobname] [-o path] [-p priority] [-q queue] [-r y|n]\n\
-[-S path] [-t number_to_submit] [-u user_list] [-X] [-W otherattributes=value...]\n\
-[-v variable_list] [-V ] [-z] [script]\n";
-
- fprintf(stderr,usage);
-
- exit(2);
- }
-
/* check TORQUE config settings */
@@ -3692,6 +3699,23 @@
strncpy(PBS_Filter,DefaultFilterPath,255);
}
+ errflg = process_opts(argc,argv,0); /* get cmd-line options */
+
+ if (errflg || ((optind + 1) < argc))
+ {
+ static char usage[] =
+"usage: qsub [-a date_time] [-A account_string] [-b secs]\n\
+[-c { c[=<INTERVAL>] | s | n }] [-C directive_prefix] [-d path] [-D path]\n\
+[-e path] [-h] [-I] [-j oe] [-k {oe}] [-l resource_list] [-m {abe}]\n\
+[-M user_list] [-N jobname] [-o path] [-p priority] [-q queue] [-r y|n]\n\
+[-S path] [-t number_to_submit] [-u user_list] [-X] [-W otherattributes=value...]\n\
+[-v variable_list] [-V ] [-z] [script]\n";
+
+ fprintf(stderr,usage);
+
+ exit(2);
+ }
+
if (optind < argc)
strcpy(script,argv[optind]);
-------------- next part --------------
_______________________________________________
torquedev mailing list
torquedev at supercluster.org
http://www.supercluster.org/mailman/listinfo/torquedev
More information about the torquedev
mailing list