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

Re: [HTCondor-users] Getting $_CONDOR_SCRATCH_DIR in submit file



Hi Suchandra,

 

I just recently ran into the same question with a variable that needed to be derived before job startup based on the files in the scratch directory.

 

One thing to remember is that $_CONDOR_SCRATCH_DIR is the same value as $TMPDIR in the job environment, in case that helps.

 

Hereâs the trick if it doesnât:

 

Executable = /bin/sh

Transfer_executable = False

Arguments = " -c 'export YOUR_ENV_VARIABLE=$(DOLLAR)_CONDOR_SCRATCH_DIR; exec your_real_executable arg1 arg2 arg3â â

 

The exec prevents the /bin/sh âc process from hanging around and potentially disrupting the jobâs signal handling. The side effect is that you wonât see condor_exec.exec for your HTCondor job executable name. And needless to say it wonât work on Windows.

 

                -Michael Pelletier.

 

From: HTCondor-users [mailto:htcondor-users-bounces@xxxxxxxxxxx] On Behalf Of Suchandra Thapa
Sent: Thursday, July 20, 2017 3:22 PM
To: HTCondor-Users Mail List <htcondor-users@xxxxxxxxxxx>
Subject: [HTCondor-users] Getting $_CONDOR_SCRATCH_DIR in submit file

 

Hi,

I'd like to set an environment variable for my jobs to be the same value as $__CONDOR_SCRATCH_DIR .  Ideally, I'd like to set this in the job submit file using the enviroment command but there doesn't seem to be a way to specify it.  It looks like  $$(CONDOR_SCRATCH_DIR) would work but there's no classad that with the scratch dir.  Is there a way to do this?

Suchandra


Suchandra Thapa
sthapa@xxxxxxxxxxxxxxx
Computation Institute
Searle Chemistry Laboratory #201A
5735 South Ellis Avenue
Chicago, IL 60637