File: memTest.py

package info (click to toggle)
python-pyflow 1.1.20-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 996 kB
  • sloc: python: 4,154; sh: 219; ansic: 15; makefile: 5
file content (46 lines) | stat: -rwxr-xr-x 1,102 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/usr/bin/env python

#
# This demo shows possibly the simplist possible pyflow we can create -- 
# a single 'hello world' task. After experimenting with this file
# please see the 'simpleDemo' for coverage of a few more pyflow features
#

import os.path
import sys

# add module path by hand
#
sys.path.append(os.path.abspath(os.path.dirname(__file__))+"/../pyflow/src")


from pyflow import WorkflowRunner


# all pyflow workflows are written into classes derived from pyflow.WorkflowRunner:
#
class MemTestWorkflow(WorkflowRunner) :

    # a workflow is defined by overloading the WorkflowRunner.workflow() method:
    #
    def workflow(self) :

        # The following is our first and only task for this workflow:
        self.addTask("easy_task1","echo 'Hello World!'")
        self.addTask("easy_task2","echo 'Hello World!'")
        self.addTask("easy_task3","echo 'Hello World!'")
        self.addTask("easy_task4","echo 'Hello World!'",memMb=1)



# Instantiate the workflow
#
wflow = MemTestWorkflow()

# Run the worklow:
#
retval=wflow.run(nCores=8,memMb=2049)

# done!
sys.exit(retval)