Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
mightqxc committed Dec 9, 2020
1 parent 2f16bf0 commit 7dea901
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 14 deletions.
2 changes: 1 addition & 1 deletion pandaharvester/commit_timestamp.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
timestamp = "09-12-2020 17:36:08 on flin (by fahui)"
timestamp = "09-12-2020 17:58:33 on flin (by fahui)"
15 changes: 9 additions & 6 deletions pandaharvester/harvestercore/db_proxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -844,7 +844,7 @@ def fill_panda_queue_table(self, panda_queue_list, queue_config_mapper, refill_t
try:
# get logger
tmpLog = core_utils.make_logger(_logger, method_name='fill_panda_queue_table')
tmpLog.debug('start')
tmpLog.debug('start, refill={0}'.format(refill_table))
# get existing queues
sqlE = "SELECT queueName FROM {0} ".format(pandaQueueTableName)
varMap = dict()
Expand Down Expand Up @@ -874,7 +874,13 @@ def fill_panda_queue_table(self, panda_queue_list, queue_config_mapper, refill_t
varMap[':jobType'] = PandaQueueSpec.JT_catchall
self.execute(sqlC, varMap)
resC = self.cur.fetchone()
if not refill_table and resC is not None:
if refill_table:
sqlD = "DELETE FROM {0} ".format(pandaQueueTableName)
sqlD += "WHERE queueName=:queueName "
varMap = dict()
varMap[':queueName'] = queueName
self.execute(sqlD, varMap)
if resC is not None and not refill_table:
# update limits just in case
varMap = dict()
sqlU = "UPDATE {0} SET ".format(pandaQueueTableName)
Expand Down Expand Up @@ -902,10 +908,7 @@ def fill_panda_queue_table(self, panda_queue_list, queue_config_mapper, refill_t
attrName_list.append(attrName)
tmpKey_list.append(tmpKey)
varMap[tmpKey] = getattr(queueConfig, attrName)
if refill_table:
sqlP = "REPLACE INTO {0} ({1}) ".format(pandaQueueTableName, ','.join(attrName_list))
else:
sqlP = "INSERT IGNORE INTO {0} ({1}) ".format(pandaQueueTableName, ','.join(attrName_list))
sqlP = "INSERT IGNORE INTO {0} ({1}) ".format(pandaQueueTableName, ','.join(attrName_list))
sqlS = "VALUES ({0}) ".format(','.join(tmpKey_list))
self.execute(sqlP + sqlS, varMap)
# commit
Expand Down
18 changes: 11 additions & 7 deletions pandaharvester/harvestersubmitter/htcondor_submitter.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,14 +227,18 @@ def _get_complicated_pilot_options(pilot_type, pilot_url=None):
return pilot_opt_dict


# get special flag of pilot wrapper to run with python 3 if pilot version is "3"
# get special flag of pilot wrapper about pilot version , and whehter to run with python 3 if pilot version is "3"
# FIXME: during pilot testing phase, only prodsourcelabel ptest and rc_test2 should run python3
# This constraint will be removed when pilot is ready
def _get_pilot_python_option(pilot_version, prod_source_label):
def _get_pilot_version_python_option(pilot_version, prod_source_label):
version = 'current'
option = ''
if pilot_version in ['3'] and prod_source_label in ['rc_test2', 'ptest']:
option = '-3'
return option
if pilot_version.startswith('3'):
if prod_source_label in ['rc_test2', 'ptest']:
option = '--pythonversion 3'
else:
version = pilot_version
return version, option


# submit a bag of workers
Expand Down Expand Up @@ -432,8 +436,8 @@ def make_a_jdl(workspec, template, n_core_per_node, log_dir, panda_queue_name, e
'ioIntensity': io_intensity,
'pilotType': pilot_type_opt,
'pilotUrlOption': pilot_url_str,
'pilotVersion': pilot_version,
'pilotPythonOption': _get_pilot_python_option(pilot_version, prod_source_label),
'pilotVersion': _get_pilot_version_python_option(pilot_version, prod_source_label)[0],
'pilotPythonOption': _get_pilot_version_python_option(pilot_version, prod_source_label)[1],
'submissionHost': workspec.submissionHost,
'submissionHostShort': workspec.submissionHost.split('.')[0],
}
Expand Down

0 comments on commit 7dea901

Please sign in to comment.