Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add __GangaInputData.txt__ to DIRAC executable jobs #2235

Merged
merged 4 commits into from
Dec 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 14 additions & 5 deletions ganga/GangaDirac/Lib/RTHandlers/ExeDiracRTHandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,20 @@
import GangaCore.Utility.Virtualization
from GangaCore import _gangaVersion
from GangaCore.Core.Sandbox.WNSandbox import PYTHON_DIR
from GangaDirac.Lib.RTHandlers.DiracRTHUtils import dirac_inputdata, dirac_ouputdata, mangle_job_name, diracAPI_script_template, diracAPI_script_settings, API_nullifier, dirac_outputfile_jdl
from GangaDirac.Lib.RTHandlers.DiracRTHUtils import (dirac_inputdata,
mangle_job_name,
diracAPI_script_template,
diracAPI_script_settings,
API_nullifier,
dirac_outputfile_jdl)
from GangaDirac.Lib.Files.DiracFile import DiracFile
from GangaDirac.Lib.RTHandlers.RunTimeHandlerUtils import master_sandbox_prepare, sandbox_prepare, script_generator
from GangaCore.GPIDev.Lib.File.LocalFile import LocalFile
from GangaCore.GPIDev.Lib.File.OutputFileManager import getOutputSandboxPatterns, getWNCodeForOutputPostprocessing
from GangaCore.GPIDev.Lib.File.OutputFileManager import (getWNCodeForOutputPostprocessing,
getWNCodeForInputdataListCreation)
from GangaCore.GPIDev.Adapters.IRuntimeHandler import IRuntimeHandler
from GangaCore.GPIDev.Adapters.StandardJobConfig import StandardJobConfig
from GangaCore.Core.exceptions import ApplicationConfigurationError
from GangaCore.Core.exceptions import ApplicationConfigurationError, GangaFileError
from GangaCore.GPIDev.Lib.File import File, FileBuffer
from GangaCore.Utility.Config import getConfig
from GangaCore.Utility.logging import getLogger
Expand Down Expand Up @@ -43,7 +49,6 @@ def master_prepare(self, app, appmasterconfig):
def prepare(self, app, appsubconfig, appmasterconfig, jobmasterconfig):
inputsandbox, outputsandbox = sandbox_prepare(app, appsubconfig, appmasterconfig, jobmasterconfig)
input_data, parametricinput_data = dirac_inputdata(app)
# outputdata, outputdata_path = dirac_ouputdata(app)

job = stripProxy(app).getJobObject()
outputfiles = [this_file for this_file in job.outputfiles if isType(this_file, DiracFile)]
Expand Down Expand Up @@ -82,7 +87,8 @@ def prepare(self, app, appsubconfig, appmasterconfig, jobmasterconfig):
contents = script_generator(contents,
COMMAND=repr(commandline),
PYTHONDIR=repr(PYTHON_DIR),
OUTPUTFILESINJECTEDCODE=getWNCodeForOutputPostprocessing(job, ''))
OUTPUTFILESINJECTEDCODE=getWNCodeForOutputPostprocessing(job, ''),
CREATEINPUTDATALIST=getWNCodeForInputdataListCreation(job, ''))

inputsandbox.append(FileBuffer(name=exe_script_name, contents=contents, executable=True))

Expand Down Expand Up @@ -180,6 +186,9 @@ def exe_script_template():
if path.isfile(path.abspath(execmd[0])):
execmd[0] = path.abspath(execmd[0])

# create inputdata list
###CREATEINPUTDATALIST###

###VIRTUALIZATION###

err = None
Expand Down
16 changes: 11 additions & 5 deletions ganga/GangaLHCb/Lib/RTHandlers/ExeDiracRTHandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,15 @@
from GangaCore import _gangaVersion
import GangaCore.Utility.Virtualization
from GangaCore.Core.Sandbox.WNSandbox import PYTHON_DIR
from GangaDirac.Lib.RTHandlers.DiracRTHUtils import dirac_inputdata, dirac_ouputdata, mangle_job_name, diracAPI_script_settings, API_nullifier
from GangaDirac.Lib.RTHandlers.DiracRTHUtils import (dirac_inputdata,
mangle_job_name,
diracAPI_script_settings,
API_nullifier)
from GangaDirac.Lib.Files.DiracFile import DiracFile
from GangaDirac.Lib.RTHandlers.RunTimeHandlerUtils import master_sandbox_prepare, sandbox_prepare, script_generator
from GangaCore.GPIDev.Lib.File.LocalFile import LocalFile
from GangaCore.GPIDev.Lib.File.OutputFileManager import getOutputSandboxPatterns, getWNCodeForOutputPostprocessing
from GangaCore.GPIDev.Lib.File.OutputFileManager import (getWNCodeForOutputPostprocessing,
getWNCodeForInputdataListCreation)
from GangaCore.GPIDev.Adapters.IRuntimeHandler import IRuntimeHandler
from GangaCore.GPIDev.Adapters.StandardJobConfig import StandardJobConfig
from GangaCore.Core.exceptions import ApplicationConfigurationError, GangaFileError
Expand All @@ -18,7 +22,6 @@
from GangaCore.Utility.util import unique
from GangaCore.GPIDev.Base.Proxy import isType, stripProxy
from GangaLHCb.Lib.RTHandlers.RTHUtils import lhcbdiracAPI_script_template, lhcbdirac_outputfile_jdl
from GangaDirac.Lib.RTHandlers.DiracRTHUtils import diracAPI_script_template, dirac_outputfile_jdl
logger = getLogger()
config = getConfig('DIRAC')
configLHCb = getConfig('LHCb')
Expand All @@ -45,7 +48,6 @@ def master_prepare(self, app, appmasterconfig):
def prepare(self, app, appsubconfig, appmasterconfig, jobmasterconfig):
inputsandbox, outputsandbox = sandbox_prepare(app, appsubconfig, appmasterconfig, jobmasterconfig)
input_data, parametricinput_data = dirac_inputdata(app)
# outputdata, outputdata_path = dirac_ouputdata(app)

job = stripProxy(app).getJobObject()
outputfiles = [this_file for this_file in job.outputfiles if isType(this_file, DiracFile)]
Expand Down Expand Up @@ -89,7 +91,8 @@ def prepare(self, app, appsubconfig, appmasterconfig, jobmasterconfig):
contents = script_generator(contents,
COMMAND=repr(commandline),
PYTHONDIR=repr(PYTHON_DIR),
OUTPUTFILESINJECTEDCODE=getWNCodeForOutputPostprocessing(job, ''))
OUTPUTFILESINJECTEDCODE=getWNCodeForOutputPostprocessing(job, ''),
CREATEINPUTDATALIST=getWNCodeForInputdataListCreation(job, ''))

inputsandbox.append(FileBuffer(name=exe_script_name, contents=contents, executable=True))

Expand Down Expand Up @@ -192,6 +195,9 @@ def exe_script_template():
if path.isfile(path.abspath(execmd[0])):
execmd[0] = path.abspath(execmd[0])

# create inputdata list
###CREATEINPUTDATALIST###

###VIRTUALIZATION###

err = None
Expand Down
Loading