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

Re: [HTCondor-users] Macro substitutions in submit file - filenames?



On Wed, 17 Sep 2014, Greg.Hitchen@xxxxxxxx wrote:

I've done this with arguments successfully, but when trying the following:

log = cpubound_$(Cluster)_$$([$(Process)+5]).log

These files get created:

16/09/2014  04:37 PM                87 cpubound_5651_$$([0+5]).log
16/09/2014  04:37 PM                87 cpubound_5651_$$([1+5]).log
16/09/2014  04:37 PM                87 cpubound_5651_$$([2+5]).log
16/09/2014  04:37 PM                87 cpubound_5651_$$([3+5]).log
16/09/2014  04:37 PM                87 cpubound_5651_$$([4+5]).log
16/09/2014  04:42 PM               911 cpubound_5651_5.log
16/09/2014  04:42 PM             1,054 cpubound_5651_6.log
16/09/2014  04:42 PM               911 cpubound_5651_7.log
16/09/2014  04:42 PM               912 cpubound_5651_8.log
16/09/2014  04:42 PM             1,055 cpubound_5651_9.log

The 1st 5 files all contain the "Job submitted from host" line only,
and the next 5 contain the rest of the expected output,
i.e. "Job executing on host", "Image size of job updated",
"Job terminated", etc.

I guess it's to do with when the submit file is parsed and at what stage
the substitution is done?

Yes, you're right. What you're seeing is the expected behavior. The $$ macros don't get evaluated until a job is matched. So when you do the submit, a log file with $$ unexpanded is created, which gets the submit event as you saw. Then, once the job is matched, the $$ is expanded, which creates the second log file that gets the subsequent events.

If you don't need the +5, this will work, of course:

  log = cpubound_$(Cluster)_$(Process).log

Kent Wenger
CHTC Team