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

[Condor-users] getenv in submit file has no effect



Hi,

I have a problem with the getenv command in a submit file. I am using the following submit file:

universe = vanilla
executable = ./printenv
arguments =
environment =
getenv = True
log = logs/test.log
error = logs/test-$(cluster).err
output = logs/test-$(cluster).out
notification = never
queue 1


in which getenv is set to true, so, according to the documentation [1], "the job will therefore execute with the same set of environment variables that the user had at submit time.".

The executable printenv is just a simple python script to print out the content of the environment variable PFILES while this script is running:

#!/usr/bin/python
import os
print os.getenv('PFILES')

This variable does not get passed to the condor environment. Here are the steps I have made:

1. print the environment variable on the bash directly:
> echo $PFILES
/archive/home/dietz/pfiles;/archive/home/gcolclou/heasoft6.9/heasoft-6.9/x86_64-unknown-linux-gnu-libc2.5/syspfiles

2. Try the python script:
> ./printenv
/archive/home/dietz/pfiles;/archive/home/gcolclou/heasoft6.9/heasoft-6.9/x86_64-unknown-linux-gnu-libc2.5/syspfiles

3. Start the condor submit file in condor, and check the output file:
> condor_submit test.sub
Submitting job(s).
Logging submit event(s).
1 job(s) submitted to cluster 78937623.
> cat test.out
None

The 'None' indicates that the variable 'PFILES' is not set within the condor environment. I am using the following version of condor:

$CondorVersion: 7.4.2 Mar 29 2010 BuildID: 227044 $
$CondorPlatform: X86_64-LINUX_RHEL5 $

Is this behavior a feature or a bug? According to the documentation of condor_submit I expect a different behavior of this test. Can someone clarify this issue, and how I can make sure the environment variables I have set at the time I call condor_submit will be used on the node that runs the executable?


Thanks
  Alex


[1] <http://www.cs.wisc.edu/condor/manual/v6.6/condor_submit.html>