-
Notifications
You must be signed in to change notification settings - Fork 6
Injob
In order to use COMDIRAC commands inside a DIRAC job, one requirement is to have the JobPilot installed with COMDIRAC extension. Contact your DIRAC administrator if this is not the case in your setup.
Inside jobs, COMDIRAC session must be initialized from the proxy of the current running job. The --fromProxy
option of dinit
does just this, but one still has to make sure there is a configuration file created for the job beforehand.
Using dconfig --guess
will create the configuration file, hopefully deducing the correct values from the DIRAC Configuration Service.
It is a good practice to set configuration and session files in a per-job location in order to avoid collisions between jobs (especially if the JobPilots are shared between several DIRAC payload jobs).
Here is an example of COMDIRAC initialization inside a job shell script:
#!/bin/bash
# initialize job for COMDIRAC commands
export DCOMMANDS_CONFIG_DIR=$PWD
dconfig --guess
dinit --fromProxy
# Do some COMDIRAC commands