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

WIP: nd280 updates for 2024/2025 #2393

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from
Open
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
16 changes: 1 addition & 15 deletions ganga/GangaND280/Highland/Highland.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
from GangaCore.GPIDev.Schema import Schema, SimpleItem, Version
from GangaCore.Utility.Config import getConfig
from GangaCore.Utility.files import expandfilename
from GangaCore.GPIDev.Adapters.ApplicationRuntimeHandlers import allHandlers

shared_path = os.path.join(
expandfilename(getConfig('Configuration')['gangadir']),
Expand Down Expand Up @@ -82,19 +83,6 @@ class Highland(IPrepareApp):
_name = 'Highland'
_scriptname = None
_exportmethods = ['prepare']
_GUIPrefs = [
{'attribute': 'exe', 'widget': 'File'},
{'attribute': 'args', 'widget': 'String_List'},
{'attribute': 'outputfile', 'widget': 'String'},
{'attribute': 'env', 'widget': 'DictOfString'},
]

_GUIAdvancedPrefs = [
{'attribute': 'exe', 'widget': 'File'},
{'attribute': 'args', 'widget': 'String_List'},
{'attribute': 'outputfile', 'widget': 'String'},
{'attribute': 'env', 'widget': 'DictOfString'},
]

def __init__(self):
super(Highland, self).__init__()
Expand Down Expand Up @@ -192,8 +180,6 @@ def prepare(self, app, appconfig, appmasterconfig, jobmasterconfig):
)


from GangaCore.GPIDev.Adapters.ApplicationRuntimeHandlers import allHandlers

allHandlers.add('Highland', 'LSF', RTHandler)
allHandlers.add('Highland', 'Local', RTHandler)
allHandlers.add('Highland', 'PBS', RTHandler)
Expand Down
16 changes: 7 additions & 9 deletions ganga/GangaND280/ND280Checkers/ND280Checker.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,20 @@
#
################################################################################

from GangaCore.GPIDev.Base import GangaObject
from GangaCore.GPIDev.Adapters.IPostProcessor import PostProcessException
from GangaCore.GPIDev.Adapters.IChecker import IChecker, IFileChecker
from GangaCore.GPIDev.Base.Proxy import GPIProxyObject
from GangaCore.GPIDev.Schema import ComponentItem, FileItem, Schema, SimpleItem, Version
from GangaCore.Utility.Plugin import allPlugins
from GangaCore.GPIDev.Adapters.IChecker import IFileChecker
from GangaCore.GPIDev.Schema import SimpleItem
from GangaCore.Utility.logging import getLogger

import subprocess
import copy
import os
import string
import shutil

# Simon's post_status - communicates to processing DB
from . import post_status
import urllib.request, urllib.error, urllib.parse
import urllib.request
import urllib.error
import urllib.parse

logger = getLogger()

Expand Down Expand Up @@ -178,7 +175,8 @@ def send_status(self):

logger.info('Result for %s %s %s %s is: %s, %s, %s, %s, %s' % (self.RUN,self.SUBRUN,self.TRIGTYPE,self.STAGE,self.site,self.ReturnCode,self.Time,self.EventsIn,self.EventsOut))

if self.range == 0: return # no remote status report for CosMC
if self.range == 0:
return # no remote status report for CosMC

if not self.path:
logger.error("No monitoring info sent because MONDIR is not defined")
Expand Down
4 changes: 2 additions & 2 deletions ganga/GangaND280/ND280Control/ND280Configs.py
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,7 @@ def CreateCosmicMCCF(self):
logger.error('Please make sure all options stated above are entered')
return ''

if not self.options['stage'] in ['base', 'fgd', 'tript', 'all']:
if self.options['stage'] not in ['base', 'fgd', 'tript', 'all']:
logger.error('"stage" options should be one of', ['base', 'fgd', 'tript', 'all'])
return ''

Expand Down Expand Up @@ -537,7 +537,7 @@ def CreateSandMCCF(self):
logger.error('Please make sure all options stated above are entered')
return ''

if not self.options['stage'] in ['neutMC', 'g4anal', 'neutSetup']:
if self.options['stage'] not in ['neutMC', 'g4anal', 'neutSetup']:
logger.error('"stage" options should be one of', ['neutMC', 'g4anal', 'neutSetup'])
return ''

Expand Down
16 changes: 2 additions & 14 deletions ganga/GangaND280/ND280Control/runND280.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
from GangaCore.GPIDev.Schema import Schema, SimpleItem, Version
from GangaCore.Utility.Config import getConfig
from GangaCore.Utility.files import expandfilename
from GangaCore.GPIDev.Adapters.ApplicationRuntimeHandlers import allHandlers

shared_path = os.path.join(
expandfilename(getConfig('Configuration')['gangadir']),
Expand Down Expand Up @@ -80,19 +81,7 @@ class runND280(IPrepareApp):
_category = 'applications'
_name = 'runND280'
_exportmethods = ['prepare']
_GUIPrefs = [
{'attribute': 'args', 'widget': 'String_List'},
{'attribute': 'cmtsetup', 'widget': 'String'},
{'attribute': 'configfile', 'widget': 'String'},
{'attribute': 'env', 'widget': 'DictOfString'},
]

_GUIAdvancedPrefs = [
{'attribute': 'args', 'widget': 'String_List'},
{'attribute': 'cmtsetup', 'widget': 'String'},
{'attribute': 'configfile', 'widget': 'String'},
{'attribute': 'env', 'widget': 'DictOfString'},
]

exe = 'runND280'

def __init__(self):
Expand Down Expand Up @@ -229,7 +218,6 @@ def prepare(self, app, appconfig, appmasterconfig, jobmasterconfig):
)


from GangaCore.GPIDev.Adapters.ApplicationRuntimeHandlers import allHandlers

allHandlers.add('runND280', 'LSF', RTHandler)
allHandlers.add('runND280', 'Local', RTHandler)
Expand Down
19 changes: 2 additions & 17 deletions ganga/GangaND280/ND280Control/runND280CosMC.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@
from GangaCore.GPIDev.Schema import Schema, SimpleItem, Version
from GangaCore.Utility.Config import getConfig
from GangaCore.Utility.files import expandfilename
from GangaCore.GPIDev.Adapters.ApplicationRuntimeHandlers import allHandlers
from . import ND280Configs

shared_path = os.path.join(
expandfilename(getConfig('Configuration')['gangadir']),
'shared',
getConfig('Configuration')['user'],
)

from . import ND280Configs


class runND280CosMC(IPrepareApp):
"""
Expand Down Expand Up @@ -82,19 +82,6 @@ class runND280CosMC(IPrepareApp):
_category = 'applications'
_name = 'runND280CosMC'
_exportmethods = ['prepare']
_GUIPrefs = [
{'attribute': 'args', 'widget': 'String_List'},
{'attribute': 'cmtsetup', 'widget': 'String'},
{'attribute': 'confopts', 'widget': 'String'},
{'attribute': 'env', 'widget': 'DictOfString'},
]

_GUIAdvancedPrefs = [
{'attribute': 'args', 'widget': 'String_List'},
{'attribute': 'cmtsetup', 'widget': 'String'},
{'attribute': 'confopts', 'widget': 'String'},
{'attribute': 'env', 'widget': 'DictOfString'},
]

def __init__(self):
super(runND280CosMC, self).__init__()
Expand Down Expand Up @@ -219,8 +206,6 @@ def prepare(self, app, appconfig, appmasterconfig, jobmasterconfig):
)


from GangaCore.GPIDev.Adapters.ApplicationRuntimeHandlers import allHandlers

allHandlers.add('runND280CosMC', 'LSF', RTHandler)
allHandlers.add('runND280CosMC', 'Local', RTHandler)
allHandlers.add('runND280CosMC', 'PBS', RTHandler)
Expand Down
17 changes: 2 additions & 15 deletions ganga/GangaND280/ND280Control/runND280CtrlSmpl.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
from GangaCore.GPIDev.Schema import Schema, SimpleItem, Version
from GangaCore.Utility.Config import getConfig
from GangaCore.Utility.files import expandfilename
from GangaCore.GPIDev.Adapters.ApplicationRuntimeHandlers import allHandlers

shared_path = os.path.join(
expandfilename(getConfig('Configuration')['gangadir']),
Expand Down Expand Up @@ -94,19 +95,7 @@ class runND280CtrlSmpl(IPrepareApp):
_category = 'applications'
_name = 'runND280CtrlSmpl'
_exportmethods = ['prepare']
_GUIPrefs = [
{'attribute': 'args', 'widget': 'String_List'},
{'attribute': 'cmtsetup', 'widget': 'String'},
{'attribute': 'configfile', 'widget': 'String'},
{'attribute': 'env', 'widget': 'DictOfString'},
]

_GUIAdvancedPrefs = [
{'attribute': 'args', 'widget': 'String_List'},
{'attribute': 'cmtsetup', 'widget': 'String'},
{'attribute': 'configfile', 'widget': 'String'},
{'attribute': 'env', 'widget': 'DictOfString'},
]

exe = 'runND280CtrlSmpl'

def __init__(self):
Expand Down Expand Up @@ -233,8 +222,6 @@ def prepare(self, app, appconfig, appmasterconfig, jobmasterconfig):
)


from GangaCore.GPIDev.Adapters.ApplicationRuntimeHandlers import allHandlers

allHandlers.add('runND280CtrlSmpl', 'LSF', RTHandler)
allHandlers.add('runND280CtrlSmpl', 'Local', RTHandler)
allHandlers.add('runND280CtrlSmpl', 'PBS', RTHandler)
Expand Down
16 changes: 1 addition & 15 deletions ganga/GangaND280/ND280Control/runND280Kin.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
from GangaCore.GPIDev.Schema import Schema, SimpleItem, Version
from GangaCore.Utility.Config import getConfig
from GangaCore.Utility.files import expandfilename
from GangaCore.GPIDev.Adapters.ApplicationRuntimeHandlers import allHandlers

shared_path = os.path.join(
expandfilename(getConfig('Configuration')['gangadir']),
Expand Down Expand Up @@ -79,19 +80,6 @@ class runND280Kin(IPrepareApp):
_category = 'applications'
_name = 'runND280Kin'
_exportmethods = ['prepare']
_GUIPrefs = [
{'attribute': 'args', 'widget': 'String_List'},
{'attribute': 'cmtsetup', 'widget': 'String'},
{'attribute': 'confopts', 'widget': 'String'},
{'attribute': 'env', 'widget': 'DictOfString'},
]

_GUIAdvancedPrefs = [
{'attribute': 'args', 'widget': 'String_List'},
{'attribute': 'cmtsetup', 'widget': 'String'},
{'attribute': 'confopts', 'widget': 'String'},
{'attribute': 'env', 'widget': 'DictOfString'},
]

def __init__(self):
super(runND280Kin, self).__init__()
Expand Down Expand Up @@ -199,8 +187,6 @@ def prepare(self, app, appconfig, appmasterconfig, jobmasterconfig):
)


from GangaCore.GPIDev.Adapters.ApplicationRuntimeHandlers import allHandlers

allHandlers.add('runND280Kin', 'LSF', RTHandler)
allHandlers.add('runND280Kin', 'Local', RTHandler)
allHandlers.add('runND280Kin', 'PBS', RTHandler)
Expand Down
36 changes: 19 additions & 17 deletions ganga/GangaND280/ND280Control/runND280RDP.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,16 @@
from GangaCore.GPIDev.Schema import Schema, SimpleItem, Version
from GangaCore.Utility.Config import getConfig
from GangaCore.Utility.files import expandfilename
from GangaCore.GPIDev.Adapters.ApplicationRuntimeHandlers import allHandlers
from GangaCore.Lib.Virtualization import Apptainer
from . import ND280Configs

shared_path = os.path.join(
expandfilename(getConfig('Configuration')['gangadir']),
'shared',
getConfig('Configuration')['user'],
)

from . import ND280Configs


class runND280RDP(IPrepareApp):
"""
Expand Down Expand Up @@ -75,24 +76,21 @@ class runND280RDP(IPrepareApp):
comparable=1,
doc='Location of shared resources. Presence of this attribute implies the application has been prepared.',
),
'container': SimpleItem(
defvalue=None, doc='Path to container', typelist=['type(None)', 'str']
),
'mounts': SimpleItem(
defvalue=[],
doc='Container paths to mount',
typelist=['str'],
sequence=1,
strict_sequence=0,
),
},
)
_category = 'applications'
_name = 'runND280RDP'
_exportmethods = ['prepare']
_GUIPrefs = [
{'attribute': 'args', 'widget': 'String_List'},
{'attribute': 'cmtsetup', 'widget': 'String'},
{'attribute': 'confopts', 'widget': 'String'},
{'attribute': 'env', 'widget': 'DictOfString'},
]

_GUIAdvancedPrefs = [
{'attribute': 'args', 'widget': 'String_List'},
{'attribute': 'cmtsetup', 'widget': 'String'},
{'attribute': 'confopts', 'widget': 'String'},
{'attribute': 'env', 'widget': 'DictOfString'},
]

def __init__(self):
super(runND280RDP, self).__init__()
Expand All @@ -101,6 +99,12 @@ def configure(self, masterappconfig):
args = convertIntToStringArgs(self.args)

job = self.getJobObject()
if self.container:
job.virtualization = Apptainer()
job.virtualization.image = self.container

if len(self.mounts) > 0:
job.virtualization.mounts = {mount: mount for mount in self.mounts}

if self.cmtsetup == []:
raise ApplicationConfigurationError('No cmt setup script given.')
Expand Down Expand Up @@ -219,8 +223,6 @@ def prepare(self, app, appconfig, appmasterconfig, jobmasterconfig):
)


from GangaCore.GPIDev.Adapters.ApplicationRuntimeHandlers import allHandlers

allHandlers.add('runND280RDP', 'LSF', RTHandler)
allHandlers.add('runND280RDP', 'Local', RTHandler)
allHandlers.add('runND280RDP', 'PBS', RTHandler)
Expand Down
19 changes: 2 additions & 17 deletions ganga/GangaND280/ND280Control/runND280SandMC.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@
from GangaCore.GPIDev.Schema import SimpleItem, Schema, Version
from GangaCore.Utility.Config import getConfig
from GangaCore.Utility.files import expandfilename
from GangaCore.GPIDev.Adapters.ApplicationRuntimeHandlers import allHandlers
from . import ND280Configs

shared_path = os.path.join(
expandfilename(getConfig('Configuration')['gangadir']),
'shared',
getConfig('Configuration')['user'],
)

from . import ND280Configs


class runND280SandMC(IPrepareApp):
"""
Expand Down Expand Up @@ -82,19 +82,6 @@ class runND280SandMC(IPrepareApp):
_category = 'applications'
_name = 'runND280SandMC'
_exportmethods = ['prepare']
_GUIPrefs = [
{'attribute': 'args', 'widget': 'String_List'},
{'attribute': 'cmtsetup', 'widget': 'String'},
{'attribute': 'confopts', 'widget': 'String'},
{'attribute': 'env', 'widget': 'DictOfString'},
]

_GUIAdvancedPrefs = [
{'attribute': 'args', 'widget': 'String_List'},
{'attribute': 'cmtsetup', 'widget': 'String'},
{'attribute': 'confopts', 'widget': 'String'},
{'attribute': 'env', 'widget': 'DictOfString'},
]

def __init__(self):
super(runND280SandMC, self).__init__()
Expand Down Expand Up @@ -222,8 +209,6 @@ def prepare(self, app, appconfig, appmasterconfig, jobmasterconfig):
)


from GangaCore.GPIDev.Adapters.ApplicationRuntimeHandlers import allHandlers

allHandlers.add('runND280SandMC', 'LSF', RTHandler)
allHandlers.add('runND280SandMC', 'Local', RTHandler)
allHandlers.add('runND280SandMC', 'PBS', RTHandler)
Expand Down
Loading
Loading