Skip to content

Commit 78cec35

Browse files
committed
Allow duplicate wfs
1 parent 2e3c187 commit 78cec35

File tree

3 files changed

+28
-13
lines changed

3 files changed

+28
-13
lines changed

Configuration/PyReleaseValidation/python/MatrixRunner.py

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,26 @@
11
import os, sys, time
22

3+
from collections import Counter
4+
35
from Configuration.PyReleaseValidation.WorkFlow import WorkFlow
46
from Configuration.PyReleaseValidation.WorkFlowRunner import WorkFlowRunner
5-
7+
from Configuration.PyReleaseValidation.MatrixUtil import check_dups
68
# ================================================================================
79

810
class MatrixRunner(object):
911

10-
def __init__(self, wfIn=None, nThrMax=4, nThreads=1):
12+
def __init__(self, wfIn=None, nThrMax=4, nThreads=1, gpu=False):
1113

1214
self.workFlows = wfIn
1315

1416
self.threadList = []
1517
self.maxThreads = nThrMax
1618
self.nThreads = nThreads
19+
self.gpu = gpu
20+
21+
if self.gpu:
22+
print("Checks for GPU")
23+
pass
1724

1825
#the directories in which it happened
1926
self.runDirs={}
@@ -43,12 +50,19 @@ def runTests(self, opt):
4350
print('resetting to default number of process threads = %s' % self.maxThreads)
4451

4552
print('Running %s %s %s, each with %s thread%s per process' % ('up to' if self.maxThreads > 1 else '', self.maxThreads, 'concurrent jobs' if self.maxThreads > 1 else 'job', self.nThreads, 's' if self.nThreads > 1 else ''))
46-
47-
48-
for wf in self.workFlows:
49-
50-
if testList and float(wf.numId) not in [float(x) for x in testList]: continue
51-
53+
54+
njob = None
55+
wfs_to_run = self.workFlows
56+
withDups = False
57+
if testList:
58+
withDups = len(check_dups(testList))>0
59+
wfs_to_run = [wf for wf in self.workFlows if float(wf.numId) in testList for i in range(Counter(testList)[wf.numId])]
60+
61+
for n,wf in enumerate(wfs_to_run):
62+
63+
if withDups and opt.nProcs > 1: # to avoid overwriting the work areas
64+
njob = n
65+
5266
item = wf.nameId
5367
if os.path.islink(item) : continue # ignore symlinks
5468

@@ -58,7 +72,7 @@ def runTests(self, opt):
5872

5973
print('\nPreparing to run %s %s' % (wf.numId, item))
6074
sys.stdout.flush()
61-
current = WorkFlowRunner(wf,opt,noRun,dryRun,cafVeto)
75+
current = WorkFlowRunner(wf,opt,noRun,dryRun,cafVeto,njob)
6276
self.threadList.append(current)
6377
current.start()
6478
if not dryRun:

Configuration/PyReleaseValidation/python/WorkFlowRunner.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
from datetime import datetime
88

99
class WorkFlowRunner(Thread):
10-
def __init__(self, wf, opt, noRun=False, dryRun=False, cafVeto=True):
10+
def __init__(self, wf, opt, noRun=False, dryRun=False, cafVeto=True, jobNumber=None):
1111
Thread.__init__(self)
1212
self.wf = wf
1313

@@ -29,6 +29,9 @@ def __init__(self, wf, opt, noRun=False, dryRun=False, cafVeto=True):
2929
self.recycle = opt.recycle
3030

3131
self.wfDir=str(self.wf.numId)+'_'+self.wf.nameId
32+
if jobNumber is not None:
33+
self.wfDir = self.wfDir + '_job' + str(jobNumber)
34+
print(self.wfDir)
3235
return
3336

3437
def doCmd(self, cmd):

Configuration/PyReleaseValidation/scripts/runTheMatrix.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@ def runSelected(opt):
2828
testSet = set(opt.testList)
2929
undefSet = testSet - definedSet
3030
if len(undefSet)>0: raise ValueError('Undefined workflows: '+', '.join(map(str,list(undefSet))))
31-
duplicates = [wf for wf in testSet if definedWf.count(wf)>1 ]
32-
if len(duplicates)>0: raise ValueError('Duplicated workflows: '+', '.join(map(str,list(duplicates))))
3331

3432
ret = 0
3533
if opt.show:
@@ -497,7 +495,7 @@ def stepOrIndex(s):
497495
except:
498496
print(entry,'is not a possible selected entry')
499497

500-
opt.testList = list(set(testList))
498+
opt.testList = list(testList)
501499

502500
if opt.wmcontrol:
503501
performInjectionOptionTest(opt)

0 commit comments

Comments
 (0)