iLCDirac - DIRAC extension for ILC/CLIC/FCC
iLCDirac is the iLC/CLIC/FCC extension of DIRAC, providing tools and services for distributed computing within the International Linear Collider, CLIC, and Future Circular Collider communities. It is currently at version 35.0.11 and follows the release schedule of the main DIRAC project, with frequent updates.
Warnings
- breaking Major version upgrades of ILCDirac (e.g., from 34.x to 35.x) or its underlying DIRAC framework often introduce significant API changes, especially in job definition and application handling interfaces. The `NewInterface` implies older interfaces may be deprecated or removed.
- gotcha ILCDirac is a client library for the DIRAC grid. Actual job submission and interaction with the grid requires a separate DIRAC client installation and configuration, including a valid VOMS proxy for authentication. `pip install ilcdirac` alone only provides the Python library components.
- gotcha Incorrectly specified Logical File Names (LFNs) for input/output data, or non-existent/inaccessible Storage Elements (SEs) for outputs, are common causes of job failures on the grid. Paths must be valid within the distributed file system.
Install
-
pip install ilcdirac
Imports
- LCJob
from ILCDIRAC.Interfaces.API.NewInterface.LCJob import LCJob
- Marlin
from ILCDIRAC.Interfaces.API.NewInterface.Applications import Marlin
Quickstart
from ILCDIRAC.Interfaces.API.NewInterface.LCJob import LCJob
from ILCDIRAC.Interfaces.API.NewInterface.Applications import Marlin
# Note: A full DIRAC environment (with configuration and a valid VOMS proxy)
# is required for actual job submission. This example focuses on API object creation.
# 1. Create an LCJob instance
job = LCJob()
job.setName('MyILCDiracJob')
job.setPlatform('x86_64-slc6-gcc44-opt') # Example platform, choose one appropriate for your grid
job.setCPUTime(3600) # Example: 1 hour CPU time limit
# 2. Define an application, e.g., Marlin
marlin_app = Marlin()
marlin_app.setVersion('v01-08-01') # Specify a valid Marlin version available on the grid
marlin_app.setSteeringFile('my_steering_file.xml') # Path to a steering file
marlin_app.setInputData(['LFN:/ilc/user/exampleuser/input.slcio']) # Logical File Name for input data
# 3. Add the application to the job
job.appendApplication(marlin_app)
# 4. Define output data and where to store it
job.setOutputData(['output.root'], OutputSE='CERN-USER') # Store output.root in CERN-USER Storage Element
job.setOutputSandbox(['stdout.log', 'stderr.log']) # Files to retrieve to local sandbox
# Print job definition summary
print(f"Created ILCDIRAC Job '{job.getName()}'")
print(f" Platform: {job.getPlatform()}")
print(f" CPU Time: {job.getCPUTime()} seconds")
if job.applications:
print(f" Application: {job.applications[0].__class__.__name__} (Version: {job.applications[0].version})")
print(f" Output Data: {job.outputData}")
print(f" Output Sandbox: {job.outputSandbox}")
# To submit this job to the DIRAC grid, you would typically use:
# from DIRAC.Core.Base.Script import parseCommandLine
# parseCommandLine() # This initializes the DIRAC environment
# result = job.submit()
# if result['OK']:
# print(f"Job submitted with ID: {result['Value']}")
# else:
# print(f"Submission failed: {result['Message']}")