How to use the pyflow.demo.launchTasksUntil.launchTasksUntil.SyncronizedAccumulator function in pyflow

To help you get started, we’ve selected a few pyflow examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Illumina / pyflow / pyflow / demo / launchTasksUntil / launchTasksUntil.py View on Github external
def workflow(self):

        taskByIndex = []
        allTasks = set()
        completedTasks = set()
        totalWorkCompleted = SyncronizedAccumulator()

        def launchNextTask() :
            taskIndex = len(allTasks)
            workerTaskLabel = "workerTask_%05i" % (taskIndex)
            workerTaskFile = "outputFile_%05i" % (taskIndex)
            workerTaskCmd=[sys.executable, workerJob, workerTaskFile]
            self.addTask(workerTaskLabel, workerTaskCmd)

            allTasks.add(workerTaskLabel)
            taskByIndex.append(workerTaskLabel)

            sumTaskLabel="sumTask_%05i" % (taskIndex)
            self.addWorkflowTask(sumTaskLabel, SumWorkflow(taskIndex, workerTaskFile, totalWorkCompleted), dependencies=workerTaskLabel)

        def updateCompletedTasks() :
            for task in allTasks :