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