hpccondor

How does one get the job ID of an interactive job from an environment variable when using condor?


I usually got the job id with:

MY_CONDOR_JOB_ID

but I don't see it set if it's an interactive job. Is there a way to set it? When I am given the resources I see that there is a job id for my job. Is there a way to get it?

Here is what it should be

Submitting job(s).
1 job(s) submitted to cluster 4869.
Waiting for job to start...

Solution

  • HTCondor proper doesn't set MY_CONDOR_JOB_ID, so either your submit file or your administrator has set this up.

    If your submit file contains

    environment = CONDOR_JOB_ID=$(Cluster)
    

    Then HTCondor will insert the job cluster id into the environment variable CONDOR_JOB_ID. To get this into a condor_submit -i, you'll need to pass the name of this submit file to condor_submit. So, try putting that into a submit file, maybe named env.sub, and run

    condor_submit -i env.sub
    

    Or, if you already have a submit file which sets this, pass the name of that submit file to condor_submit -i