-
Notifications
You must be signed in to change notification settings - Fork 2
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 corrections eff #114
base: master
Are you sure you want to change the base?
Add corrections eff #114
Changes from 7 commits
ca1a330
44f8327
a6e6f49
12c45ee
9862e08
4d85d0a
144fd4e
3d550e8
9fdeaf8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
|
@@ -187,6 +187,9 @@ def massive(): | |||
help="Select the cluster partition") | ||||
parser.add_argument('--reservation', type=str, | ||||
help="Select the reservation") | ||||
parser.add_argument('--no-batch-mode', dest='no_batch_mode', action='store_true', | ||||
help="Use massive-cax without batch queue submission.") | ||||
|
||||
|
||||
args = parser.parse_args() | ||||
|
||||
|
@@ -195,6 +198,7 @@ def massive(): | |||
exit() | ||||
|
||||
run_once = args.once | ||||
no_batch_mode = args.no_batch_mode | ||||
|
||||
config_arg = '' | ||||
if args.config_file: | ||||
|
@@ -288,10 +292,48 @@ def massive(): | |||
docs = list(collection.find(query, | ||||
sort=sort_key, | ||||
projection=['start', 'number','name', | ||||
'detector', '_id'])) | ||||
'detector', '_id', 'processor'])) | ||||
|
||||
for doc in docs: | ||||
|
||||
#If no_batch_mode is chosen, no jobs will submitted to batch queues | ||||
if no_batch_mode == True: | ||||
|
||||
#Define basic command: | ||||
basic_command = """#!/bin/bash | ||||
cax --once {config} --name {name} | ||||
""" | ||||
|
||||
print("no-batch-mode") | ||||
|
||||
#Pre-read the config file for the no-batch-mode modus: | ||||
config.set_json(os.path.abspath(args.config_file)) | ||||
task_list = config.get_config(config.get_hostname())['task_list'] | ||||
|
||||
#This is a list of tasks which refer to apply corrections to a run: | ||||
task_list_correction = ['AddElectronLifetime', 'AddGains', 'AddDriftVelocity', 'SetS2xyMap', 'SetLightCollectionEfficiency', 'SetFieldDistortion', 'SetNeuralNetwork'] | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd like put a warning here. If the user doesn't select json file |
||||
|
||||
#-------------------- | ||||
#Start with single activities: Apply corrections only to data sets which do not have any correction yet: | ||||
if bool(set(task_list) & set(task_list_correction)) or task_list_correction == task_list: | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not so familiar with this bitwise operation on Python sets, but isn't the second condition after the Also, what if I want to run in no-batch mode without running corrections? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't know exactly what does set, maybe it creates a "set" of elements, but yes, the second command should not to be necessary. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes it is included and you would not mind if you run the full set of corrections such as they are defined in line ( Line 314 in 144fd4e
In case we come up with more corrections we would need to adjust line 314. But I think this is ok. |
||||
|
||||
this_run_version = doc.get('processor', {}).get('correction_versions', {}) | ||||
if len(this_run_version) == 0: | ||||
command = basic_command.format(config=config_arg, name=doc['name']) | ||||
logging.info(command) | ||||
stdout_value = qsub.command_submission( command ) | ||||
|
||||
#Return command output: | ||||
for i in stdout_value: | ||||
logging.info('AddCorrections: %s', i) | ||||
|
||||
#-------------------- | ||||
#Start with single activities: Add another activity: | ||||
|
||||
#Nothing else | ||||
continue | ||||
|
||||
#Start with processing via batch (if no 'add corrections' was requested) | ||||
job_name = '' | ||||
|
||||
if doc['detector'] == 'tpc': | ||||
|
@@ -336,10 +378,10 @@ def massive(): | |||
|
||||
if run_once: | ||||
break | ||||
#else: | ||||
# pace = 5 | ||||
# logging.info("Done, waiting %d minutes" % pace) | ||||
# time.sleep(60*pace) # Pace 5 minutes | ||||
else: | ||||
pace = 5 | ||||
logging.info("Done, waiting %d minutes" % pace) | ||||
time.sleep(60*pace) # Pace 5 minutes | ||||
|
||||
|
||||
def move(): | ||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indentation problem maybe
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be ok for a string definition, similar to this