Skip to content

Commit

Permalink
Revert "Add options while setting up Rocoto XML that are useful for CI (
Browse files Browse the repository at this point in the history
#1363)"

This reverts commit c318cbd.
  • Loading branch information
aerorahul committed Mar 2, 2023
1 parent 5395215 commit b5d551d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 23 deletions.
2 changes: 0 additions & 2 deletions docs/source/setup.rst
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,6 @@ Example:

./setup_xml.py /some_safe_disk_area/Joe.Schmo/expdir/test

Additional options for setting up Rocoto are available with `setup_xml.py -h` that allow users to change the number of failed tries, number of concurrent cycles and tasks as well as Rocoto's verbosity levels.

****************************************
Step 4: Confirm files from setup scripts
****************************************
Expand Down
12 changes: 5 additions & 7 deletions workflow/rocoto/workflow_xml.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,16 @@
from datetime import datetime
from pygw.timetools import to_timedelta
from collections import OrderedDict
from typing import Dict
from applications import AppConfig
from rocoto.workflow_tasks import get_wf_tasks
import rocoto.rocoto as rocoto


class RocotoXML:

def __init__(self, app_config: AppConfig, rocoto_config: Dict) -> None:
def __init__(self, app_config: AppConfig) -> None:

self._app_config = app_config
self.rocoto_config = rocoto_config

self._base = self._app_config.configs['base']

Expand Down Expand Up @@ -62,7 +60,7 @@ def _get_definitions(self) -> str:
entity['ROTDIR'] = self._base['ROTDIR']
entity['JOBS_DIR'] = self._base['BASE_JOB']

entity['MAXTRIES'] = self.rocoto_config['maxtries']
entity['MAXTRIES'] = self._base.get('ROCOTO_MAXTRIES', 2)

# Put them all in an XML key-value syntax
strings = []
Expand All @@ -77,9 +75,9 @@ def _get_workflow_header(self):
"""

scheduler = self._app_config.scheduler
cyclethrottle = self.rocoto_config['cyclethrottle']
taskthrottle = self.rocoto_config['taskthrottle']
verbosity = self.rocoto_config['verbosity']
cyclethrottle = self._base.get('ROCOTO_CYCLETHROTTLE', 3)
taskthrottle = self._base.get('ROCOTO_TASKTHROTTLE', 25)
verbosity = self._base.get('ROCOTO_VERBOSITY', 10)

expdir = self._base['EXPDIR']

Expand Down
15 changes: 1 addition & 14 deletions workflow/setup_xml.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,6 @@ def input_args():
parser.add_argument('expdir', help='full path to experiment directory containing config files',
type=str, default=os.environ['PWD'])

parser.add_argument('--maxtries', help='maximum number of retries', type=int,
default=2, required=False)
parser.add_argument('--cyclethrottle', help='maximum number of concurrent cycles', type=int,
default=3, required=False)
parser.add_argument('--taskthrottle', help='maximum number of concurrent tasks', type=int,
default=25, required=False)
parser.add_argument('--verbosity', help='verbosity level of Rocoto', type=int,
default=10, required=False)

args = parser.parse_args()

return args
Expand All @@ -54,10 +45,6 @@ def check_expdir(cmd_expdir, cfg_expdir):
if __name__ == '__main__':

user_inputs = input_args()
rocoto_param_dict = {'maxtries': user_inputs['maxtries'],
'cyclethrottle': user_inputs['cyclethrottle'],
'taskthrottle': user_inputs['taskthrottle'],
'verbosity': user_inputs['verbosity']}

cfg = Configuration(user_inputs.expdir)

Expand All @@ -67,5 +54,5 @@ def check_expdir(cmd_expdir, cfg_expdir):
app_config = AppConfig(cfg)

# Create Rocoto Tasks and Assemble them into an XML
xml = RocotoXML(app_config, rocoto_param_dict)
xml = RocotoXML(app_config)
xml.write()

0 comments on commit b5d551d

Please sign in to comment.