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

Re: [Condor-users] mcnp5 and condor -- file not found, unit 39?



On 5/15/07, Grant Goodyear <grant@xxxxxxxxxxxxxxxxx> wrote:
Matt Hope <matthew.hope@...> writes:

> should you be able to set this via the submit file? i.e on windows
> environment = TEMP=%_CONDOR_SCRATCH_DIR%
> or
> environment = TEMP=%_CONDOR_SCRATCH_DIR%\temp
>
> (note to users - you _probably_ want it to be in a subdirectory since
> the temp files will then not be transfered back by default which is
> probably the desired behaviour)
> Obviously the \temp one has issues of your app needing to ensure that
> said directory exists before using it but this is probably possible
>
> It would be quite nice to be able to automatically make this happen
> (at the moment I use a batch script and rely on starting in the
> execute directory but the more I can move out of the batch file the
> better.
>
> to do this in a batch (cmd) file on windows
>
> echo "making temp directory in current working directory"
> mkdir temp
> set TMP=%CD%\temp
> set TEMP=%CD%\temp

I ended up using a batch file very similar to this one.  Thanks!
That was an enormous help.

I would have liked using

 environment = "TMP=%_CONDOR_SCRATCH_DIR% TEMP=%_CONDOR_SCRATCH_DIR%"

in the submission file instead, but I'm not seeing the environment set.

Here's my test case.  Any idea what I'm doing wrong?

testenv.sub
-----------

Executable = testenv.bat
Universe   = vanilla
Output     = testenv.out
Log        = testenv.log
Error      = testenv.err
environment = "TEMP=%_CONDOR_SCRATCH_DIR% TMP=%_CONDOR_SCRATCH_DIR%"
should_transfer_files = YES
when_to_transfer_output = ON_EXIT

queue

testenv.bat
-----------

echo "Should be set by submission file:"
echo "TMP:  ", %TMP%
echo "TEMP: ", %TEMP%
set TMP=%_CONDOR_SCRATCH_DIR%
set TEMP=%_CONDOR_SCRATCH_DIR%
echo "Set in batch file:"
echo "TMP:  ", %TMP%
echo "TEMP: ", %TEMP%

testenv.out
-----------

"Should be set by submission file:"
"TMP:  ", %_CONDOR_SCRATCH_DIR%
"TEMP: ", %_CONDOR_SCRATCH_DIR%
"Set in batch file:"
"TMP:  ", C:\condor\execute\dir_5652
"TEMP: ", C:\condor\execute\dir_5652

At a guess either:
The submission process is escaping the % characters
or
The insertion of _CONDOR_SCRATCH_DIR into the environment happens
after the others...
I'm guessing the latter.

Note that windows shell and most *nix related sheels behave
differently (even though neither is useful for the problem at hand),
for example

cmd:
C:\WINNT>set FOO=%BAR%
C:\WINNT>echo %FOO%
%BAR%
C:\WINNT>set BAR=REAL
C:\WINNT>set FOO=%BAR%
C:\WINNT>echo %FOO%
REAL

verses bash on cygwin

$ export FOO=$BAR
$ echo ...$FOO...
......
$ export BAR=REAL
$ export FOO=$BAR
$ echo ...$FOO...
...REAL...

If it is the ordering then you're a bit stuck unless someone changes
the logic inside condor sorry

Matt