<br><br><div class="gmail_quote">On Thu, Jul 10, 2008 at 12:47 PM, Gabe Turner <<a href="mailto:gabe@msi.umn.edu">gabe@msi.umn.edu</a>> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
On Thu, Jul 10, 2008 at 10:19:27AM -0400, Glen Beane wrote:<br>
[snip]<br>
<div class="Ih2E3d">> I think a submit filter *should* also have access to anything passed on<br>
> the command line (but that doesn't mean that is what the current<br>
> implementation does, I would consider that a bug if it does not).<br>
<br>
</div>Can anyone confirm that a submit filter has access to qsub options passed<br>
on the command line? As far as I know, it just reads the submission script<br>
in line-by-line. The information in the Torque admin manual and on the<br>
wiki is sparse.</blockquote></div><br><br>in qsub.c, in the get_script() function, the code relaited to the submit filter does this, not ArgV, ArgC are parameters to get_script(), and get script is called with argc, argv for those parameters:<br>
<br><br> strcpy(cfilter,PBS_Filter);<br><br> for (index = 1;index < ArgC;index++)<br> {<br> if (ArgV[index] != NULL)<br> {<br> strcat(cfilter," ");<br><br> strcat(cfilter,ArgV[index]);<br>
}<br> } /* END for (index) */<br><br> strcat(cfilter," >");<br> strcat(cfilter,tmp_name2);<br> filter_pipe = popen(cfilter,"w");<br><br> while ((in = fgets(s,MAX_LINE_LEN,file)) != NULL)<br>
{<br> if (fputs(in,filter_pipe) < 0)<br> {<br> fprintf(stderr,"qsub: error writing to filter stdin\n");<br><br> fclose(filter_pipe);<br> unlink(tmp_name2);<br><br> return(3);<br>
}<br> }<br><br> rc = pclose(filter_pipe);<br><br><br>-----------------------------------------------------------------------------------------------<br><br>so the way the submit filter is actually called should be like this:<br>
<br>path_to_submit_filter qub_args... > /tmp/qsub.XXXXX<br><br>and then each line from the script gets written to the pipe created by calling popen on the command shown above<br><br><br><br>that being said, there may be some bugs in qsub with respect to the submit filter. i'm not sure if everything works 100% correctly with interactive jobs, I know some people had issues with that in the past and I'm not sure if they have been fixed yet<br>