scipion-pyworkflow 3.10.0__py3-none-any.whl → 3.10.2__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- pyworkflow/constants.py +1 -1
- pyworkflow/protocol/executor.py +11 -11
- pyworkflow/protocol/protocol.py +15 -6
- {scipion_pyworkflow-3.10.0.dist-info → scipion_pyworkflow-3.10.2.dist-info}/METADATA +1 -1
- {scipion_pyworkflow-3.10.0.dist-info → scipion_pyworkflow-3.10.2.dist-info}/RECORD +10 -10
- {scipion_pyworkflow-3.10.0.dist-info → scipion_pyworkflow-3.10.2.dist-info}/LICENSE.txt +0 -0
- {scipion_pyworkflow-3.10.0.dist-info → scipion_pyworkflow-3.10.2.dist-info}/WHEEL +0 -0
- {scipion_pyworkflow-3.10.0.dist-info → scipion_pyworkflow-3.10.2.dist-info}/dependency_links.txt +0 -0
- {scipion_pyworkflow-3.10.0.dist-info → scipion_pyworkflow-3.10.2.dist-info}/entry_points.txt +0 -0
- {scipion_pyworkflow-3.10.0.dist-info → scipion_pyworkflow-3.10.2.dist-info}/top_level.txt +0 -0
pyworkflow/constants.py
CHANGED
@@ -43,7 +43,7 @@ VERSION_1 = '1.0.0'
|
|
43
43
|
VERSION_1_1 = '1.1.0'
|
44
44
|
VERSION_1_2 = '1.2.0'
|
45
45
|
VERSION_2_0 = '2.0.0'
|
46
|
-
VERSION_3_0 = '3.10.
|
46
|
+
VERSION_3_0 = '3.10.2'
|
47
47
|
|
48
48
|
# For a new release, define a new constant and assign it to LAST_VERSION
|
49
49
|
# The existing one has to be added to OLD_VERSIONS list.
|
pyworkflow/protocol/executor.py
CHANGED
@@ -144,9 +144,9 @@ class StepExecutor:
|
|
144
144
|
|
145
145
|
class StepThread(threading.Thread):
|
146
146
|
""" Thread to run Steps in parallel. """
|
147
|
-
def __init__(self,
|
147
|
+
def __init__(self, step, lock):
|
148
148
|
threading.Thread.__init__(self)
|
149
|
-
self.thId =
|
149
|
+
self.thId = step.getObjId()
|
150
150
|
self.step = step
|
151
151
|
self.lock = lock
|
152
152
|
|
@@ -262,7 +262,7 @@ class ThreadStepExecutor(StepExecutor):
|
|
262
262
|
return []
|
263
263
|
else:
|
264
264
|
return gpus
|
265
|
-
def getFreeGpuSlot(self,
|
265
|
+
def getFreeGpuSlot(self, stepId=None):
|
266
266
|
""" Returns a free gpu slot available or None. If node is passed it also reserves it for that node
|
267
267
|
|
268
268
|
:param node: node to make the reserve of Gpus
|
@@ -272,10 +272,10 @@ class ThreadStepExecutor(StepExecutor):
|
|
272
272
|
if node < 0:
|
273
273
|
gpus = self.gpuDict[node]
|
274
274
|
|
275
|
-
if
|
275
|
+
if stepId is not None:
|
276
276
|
self.gpuDict.pop(node)
|
277
|
-
self.gpuDict[
|
278
|
-
logger.info("GPUs %s assigned to
|
277
|
+
self.gpuDict[stepId] = gpus
|
278
|
+
logger.info("GPUs %s assigned to step %s" % (gpus, stepId))
|
279
279
|
else:
|
280
280
|
logger.info("Free gpu slot found at %s" % node)
|
281
281
|
return gpus
|
@@ -288,14 +288,14 @@ class ThreadStepExecutor(StepExecutor):
|
|
288
288
|
if gpus is not None:
|
289
289
|
self.gpuDict.pop(node)
|
290
290
|
self.gpuDict[-node-1] = gpus
|
291
|
-
logger.info("GPUs %s freed from
|
291
|
+
logger.info("GPUs %s freed from step %s" % (gpus, node))
|
292
292
|
else:
|
293
|
-
logger.debug("
|
293
|
+
logger.debug("step id %s not found in GPU slots" % node)
|
294
294
|
|
295
295
|
def _isStepRunnable(self, step):
|
296
296
|
""" Overwrite this method to check GPUs availability"""
|
297
297
|
|
298
|
-
if self.gpuList and step.needsGPU() and self.getFreeGpuSlot() is None:
|
298
|
+
if self.gpuList and step.needsGPU() and self.getFreeGpuSlot(step.getObjId()) is None:
|
299
299
|
logger.info("Can't run step %s. Needs gpus and there are no free gpu slots" % step)
|
300
300
|
return False
|
301
301
|
|
@@ -337,7 +337,7 @@ class ThreadStepExecutor(StepExecutor):
|
|
337
337
|
for node in nodesFinished:
|
338
338
|
step = runningSteps.pop(node) # remove entry from runningSteps
|
339
339
|
freeNodes.append(node) # the node is available now
|
340
|
-
self.freeGpusSlot(
|
340
|
+
self.freeGpusSlot(step.getObjId())
|
341
341
|
# Notify steps termination and check if we should continue
|
342
342
|
doContinue = stepFinishedCallback(step)
|
343
343
|
if not doContinue:
|
@@ -361,7 +361,7 @@ class ThreadStepExecutor(StepExecutor):
|
|
361
361
|
node = freeNodes.pop(0) # take an available node
|
362
362
|
runningSteps[node] = step
|
363
363
|
logger.debug("Running step %s on node %s" % (step, node))
|
364
|
-
t = StepThread(
|
364
|
+
t = StepThread(step, sharedLock)
|
365
365
|
# won't keep process up if main thread ends
|
366
366
|
t.daemon = True
|
367
367
|
t.start()
|
pyworkflow/protocol/protocol.py
CHANGED
@@ -362,6 +362,18 @@ class Protocol(Step):
|
|
362
362
|
# prerequisites of steps, but is easier to keep it
|
363
363
|
stepsExecutionMode = STEPS_SERIAL
|
364
364
|
|
365
|
+
@classmethod
|
366
|
+
def modeSerial(cls):
|
367
|
+
""" Returns true if steps are run one after another"""
|
368
|
+
# Maybe this property can be inferred from the
|
369
|
+
# prerequisites of steps, but is easier to keep it
|
370
|
+
return cls.stepsExecutionMode == STEPS_SERIAL
|
371
|
+
|
372
|
+
@classmethod
|
373
|
+
def modeParallel(cls):
|
374
|
+
""" Returns true if steps are run in parallel"""
|
375
|
+
return not cls.modeSerial()
|
376
|
+
|
365
377
|
def __init__(self, **kwargs):
|
366
378
|
Step.__init__(self, **kwargs)
|
367
379
|
self._size = None
|
@@ -1316,7 +1328,7 @@ class Protocol(Step):
|
|
1316
1328
|
prot_id=self.getObjId(),
|
1317
1329
|
prot_name=self.getClassName(),
|
1318
1330
|
step_id=step._index))
|
1319
|
-
if step.isFailed() and self.
|
1331
|
+
if step.isFailed() and self.modeParallel():
|
1320
1332
|
# In parallel mode the executor will exit to close
|
1321
1333
|
# all working threads, so we need to close
|
1322
1334
|
self._endRun()
|
@@ -2434,7 +2446,7 @@ def runProtocolMain(projectPath, protDbPath, protId):
|
|
2434
2446
|
executor = None
|
2435
2447
|
nThreads = max(protocol.numberOfThreads.get(), 1)
|
2436
2448
|
|
2437
|
-
if protocol.
|
2449
|
+
if protocol.modeParallel() and nThreads > 1:
|
2438
2450
|
if protocol.useQueueForSteps():
|
2439
2451
|
executor = QueueStepExecutor(hostConfig,
|
2440
2452
|
protocol.getSubmitDict(),
|
@@ -2531,10 +2543,7 @@ class ProtStreamingBase(Protocol):
|
|
2531
2543
|
Minimum number of threads is 3 and should run in parallel mode.
|
2532
2544
|
"""
|
2533
2545
|
|
2534
|
-
|
2535
|
-
|
2536
|
-
super().__init__()
|
2537
|
-
self.stepsExecutionMode = STEPS_PARALLEL
|
2546
|
+
stepsExecutionMode = STEPS_PARALLEL
|
2538
2547
|
def _insertAllSteps(self):
|
2539
2548
|
# Insert the step that generates the steps
|
2540
2549
|
self._insertFunctionStep(self.resumableStepGeneratorStep, str(datetime.now()), needsGPU=False)
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: scipion-pyworkflow
|
3
|
-
Version: 3.10.
|
3
|
+
Version: 3.10.2
|
4
4
|
Summary: Simple workflow platform used in scientific applications, initially developed within the Scipion framework for image processing in Electron Microscopy.
|
5
5
|
Home-page: https://github.com/scipion-em/scipion-pyworkflow
|
6
6
|
Author: J.M. De la Rosa Trevin, Roberto Marabini, Grigory Sharov, Josue Gomez Blanco, Pablo Conesa, Yunior Fonseca Reyna
|
@@ -1,6 +1,6 @@
|
|
1
1
|
pyworkflow/__init__.py,sha256=Wr-MVKMQJy_Cy-rpPPB0-pyv8-8tx7GPPaLSNBrV1AI,1246
|
2
2
|
pyworkflow/config.py,sha256=_sq6YCRfcfE4WUNXLShgbICbBeTSLpD2KmPVapR1Wos,22306
|
3
|
-
pyworkflow/constants.py,sha256=
|
3
|
+
pyworkflow/constants.py,sha256=GG3_xDU181oUFld0DkGbvKq5lN606DjaCLnOsuVMDDQ,7448
|
4
4
|
pyworkflow/exceptions.py,sha256=3VFxuNJHcIWxRnLPR0vYg0RFAQMmxPBJZLZSi87VI8E,507
|
5
5
|
pyworkflow/object.py,sha256=yX3tBUuBssCI8aWGlTmyEKzFE59dJq_7NqllouVzMk0,55069
|
6
6
|
pyworkflow/plugin.py,sha256=JJm5plPyOnPAR4To6I5rXVIBda-1Dg-53zicdnLSrac,28858
|
@@ -67,12 +67,12 @@ pyworkflow/project/scripts/stop.py,sha256=vCeCxkwPCoUkLbna5HCxKWJ1hrsI4U19Sg9JD4
|
|
67
67
|
pyworkflow/protocol/__init__.py,sha256=bAdIpvUW4GAYdIuv92DZ44-OEkZ7lTtnp1S9T5cwtVs,1413
|
68
68
|
pyworkflow/protocol/bibtex.py,sha256=mCUk1Hp5Vp_i2lozDM1BQNOw10e_RSu86oXvrR63sOA,2122
|
69
69
|
pyworkflow/protocol/constants.py,sha256=DfuCs7eub-mLHJjEpHlIG9BW3fUpRwfTVwMYytNWv6U,3392
|
70
|
-
pyworkflow/protocol/executor.py,sha256=
|
70
|
+
pyworkflow/protocol/executor.py,sha256=x3v1q4NyF--iLMOMS2qsVpOEy-nge9IDuzWLllx5Tis,17769
|
71
71
|
pyworkflow/protocol/hosts.py,sha256=B9ENNclqYe75CPqAMOoPjwn-r3ST6HxTewXtsK_zWks,10453
|
72
72
|
pyworkflow/protocol/launch.py,sha256=7WKAiHma2tSuhqK4xVnxD_SnVt7Y5qyDFdQwTo8BLF0,11267
|
73
73
|
pyworkflow/protocol/package.py,sha256=L6x3HHKtbrhDQRJHD07SG3DQKNMGaRQ0ROoLEY3SuRQ,1444
|
74
74
|
pyworkflow/protocol/params.py,sha256=gP6QImgULvzCr-f0iseArIp1bjXm1JuUr9padmuMs7M,25901
|
75
|
-
pyworkflow/protocol/protocol.py,sha256=
|
75
|
+
pyworkflow/protocol/protocol.py,sha256=K-srKr4D220JLwYcDfAAlfBsAvrqf55gnyCZsSTt3uc,97442
|
76
76
|
pyworkflow/resources/Imagej.png,sha256=nU2nWI1wxZB_xlOKsZzdUjj-qiCTjO6GwEKYgZ5Risg,14480
|
77
77
|
pyworkflow/resources/chimera.png,sha256=AKCuwMqmZo0Cg2sddMUjBWUhmAq-nPsAVCBpVrYNeiQ,815
|
78
78
|
pyworkflow/resources/fa-exclamation-triangle_alert.png,sha256=31_XvRu0CkJ2dvHSpcBAR43378lIJTWwiag_A7SuUQc,585
|
@@ -131,10 +131,10 @@ pyworkflowtests/tests/test_protocol_export.py,sha256=z18nKPkOnrYLMU8KqcnVsF6-ylQ
|
|
131
131
|
pyworkflowtests/tests/test_protocol_output.py,sha256=8gnIFMRNmwPnIBRCG29WHJB6mqK4FLGn1jiXHtTD6pY,5980
|
132
132
|
pyworkflowtests/tests/test_streaming.py,sha256=vOH-bKCM-fVUSsejqNnCX5TPXhdUayk9ZtJHsNVcfCY,1615
|
133
133
|
pyworkflowtests/tests/test_utils.py,sha256=_pTYGCuXC7YNMdCBzUYNfSBCR3etrHsxHfIhsQi4VPc,7465
|
134
|
-
scipion_pyworkflow-3.10.
|
135
|
-
scipion_pyworkflow-3.10.
|
136
|
-
scipion_pyworkflow-3.10.
|
137
|
-
scipion_pyworkflow-3.10.
|
138
|
-
scipion_pyworkflow-3.10.
|
139
|
-
scipion_pyworkflow-3.10.
|
140
|
-
scipion_pyworkflow-3.10.
|
134
|
+
scipion_pyworkflow-3.10.2.dist-info/LICENSE.txt,sha256=ixuiBLtpoK3iv89l7ylKkg9rs2GzF9ukPH7ynZYzK5s,35148
|
135
|
+
scipion_pyworkflow-3.10.2.dist-info/METADATA,sha256=-H5H84If9BMyHHX3bBRSZGwyJurbKwmlsUOHyi8U3_Y,4682
|
136
|
+
scipion_pyworkflow-3.10.2.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
|
137
|
+
scipion_pyworkflow-3.10.2.dist-info/dependency_links.txt,sha256=D7r_CPRjYRtBb3q_OBocTdsaeXI5TwnYMu5ri0JFtzs,84
|
138
|
+
scipion_pyworkflow-3.10.2.dist-info/entry_points.txt,sha256=oR-zwsOICjEPINm-FWVPp-RfnpXZanVal4_XG6BWkkQ,127
|
139
|
+
scipion_pyworkflow-3.10.2.dist-info/top_level.txt,sha256=PzyJteyenJwLjAeSFP7oYrTN_U71GABQwET8oLZkh9k,27
|
140
|
+
scipion_pyworkflow-3.10.2.dist-info/RECORD,,
|
File without changes
|
File without changes
|
{scipion_pyworkflow-3.10.0.dist-info → scipion_pyworkflow-3.10.2.dist-info}/dependency_links.txt
RENAMED
File without changes
|
{scipion_pyworkflow-3.10.0.dist-info → scipion_pyworkflow-3.10.2.dist-info}/entry_points.txt
RENAMED
File without changes
|
File without changes
|