[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [HTCondor-users] Specifying sequential input files



I really like Dan's method.  There is another way, using ClassAd functions.  I
admit it's harder to read, but it would allow for more flexibility if you need
to start numbering from somewhere other than zero, do odd numbers only or other
math on $(Process), don't want a job with /dev/null as input, or whatever.

Put this in your submit file:

	padded_process = $$([strcat(substr(\"0000\",size(string(1+$(Process)))),string(1+$(Process)))])
	input = input_$(padded_process).txt
	output = output_$(padded_process).out


The one drawback is that the evaluation of that expression is not done by
condor_submit, so when you do run condor_submit, you need to pass the
"-disable" flag so that it doesn't try to open expression as a literal file.


Cheers,
-zach



On Wed, Oct 16, 2013 at 02:13:58PM -0400, Frederick Luehring wrote:
> Brilliant! Thanks!
> 
> On 10/16/13 2:12 PM, Daniel Forrest wrote:
> > Fred,
> > 
> >>    I want to use the queue command to submit multiple jobs with sequentially
> >> numbered input files. The catch is that the numbers in the files are padded
> >> with zeros: input_0001.txt, input_0002.txt, ...  I see from the example that I
> >> can get input files named input_1.txt, input_2.txt, ... using this statement:
> >>
> >> Input = input_%(Process).txt
> >>
> >> Any help doing this would be appreciated.
> > 
> > This does the full range 0001-9999.
> > 
> > # 0000
> > Input = /dev/null
> > Queue 1
> > # 0001 - 0009
> > Input = input_000%(Process).txt
> > Queue 9
> > # 0010 - 0099
> > Input = input_00%(Process).txt
> > Queue 90
> > # 0100 - 0999
> > Input = input_0%(Process).txt
> > Queue 900
> > # 1000 - 9999
> > Input = input_%(Process).txt
> > Queue 9000
> > 
> 
> 
> -- 
> Fred Luehring Indiana U. HEP mailto:luehring@xxxxxxxxxxx  +1 812 855 1025 IU
> http://cern.ch/Fred.Luehring mailto:Fred.Luehring@xxxxxxx +41 22 767 1172 CERN
> http://cern.ch/Fred.Luehring/Luehring_pub.asc             +1 812 391 0225 GSM
> _______________________________________________
> HTCondor-users mailing list
> To unsubscribe, send a message to htcondor-users-request@xxxxxxxxxxx with a
> subject: Unsubscribe
> You can also unsubscribe by visiting
> https://lists.cs.wisc.edu/mailman/listinfo/htcondor-users
> 
> The archives can be found at:
> https://lists.cs.wisc.edu/archive/htcondor-users/