Skip to content

Commit c785535

Browse files
committed
PyRuntime and Runtime working, now it is up to the Task class to be pybind11
1 parent b3626ae commit c785535

13 files changed

Lines changed: 47 additions & 86 deletions

File tree

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@ build
44
.vscode
55
atlas_*.sh
66
**/matrix/
7-
**/__pycache__/
7+
**/__pycache__/
8+
**/ovni/

examples/local/simple/meson.build

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ if get_option('buildTests')
1313
endif
1414

1515
if get_option('buildPyTaskR')
16-
pysimple_cpp = executable('pysimple_cpp', [ 'source/pysimple.cpp'], dependencies: [ TaskRBuildDep ])
16+
pyruntime = executable('pyruntime', [ 'source/pyruntime.cpp'], dependencies: [ TaskRBuildDep ])
1717

1818
if get_option('buildTests')
19-
test('pysimple_cpp', pysimple_cpp, args : [ ], suite: testSuite, workdir: pysimple_cpp.path() + '.p' )
19+
test('pyruntime', pyruntime, args : [ ], suite: testSuite, workdir: pyruntime.path() + '.p' )
2020

2121
test('pysimple',
2222
py,

examples/local/simple/ovni/loom.nbaumann-ThinkStation-P340.9/proc.992751/thread.992751/stream.json

Lines changed: 0 additions & 14 deletions
This file was deleted.
Binary file not shown.

examples/local/simple/ovni/loom.nbaumann-ThinkStation-P340.9/proc.998152/thread.998152/stream.json

Lines changed: 0 additions & 14 deletions
This file was deleted.
Binary file not shown.

examples/local/simple/ovni/loom.nbaumann-ThinkStation-P340.9/proc.999875/thread.999875/stream.json

Lines changed: 0 additions & 14 deletions
This file was deleted.
Binary file not shown.

examples/local/simple/py_source/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ def main():
77
t = taskr.taskr("threading", 1)
88

99
# Get the runtime
10-
runtime = t.get_runtime
10+
runtime = t.get_runtime()
1111

1212
# Running simple example
1313
simple.simple(runtime)
Lines changed: 18 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,29 @@
11
import taskr
22

33
def simple(runtime):
4-
print(f"hello I am {runtime}")
5-
6-
# # Setting onTaskFinish callback to free up task memory when it finishes (not sure if we will have this)
7-
# #runtime.setTaskCallbackHandler(HiCR::tasking::Task::callback_t::onTaskFinish, [&taskr](taskr::Task *task) { delete task; })
4+
# Setting onTaskFinish callback to free up task memory when it finishes (not sure if we will have this)
5+
#runtime.setTaskCallbackHandler(HiCR::tasking::Task::callback_t::onTaskFinish, [&taskr](taskr::Task *task) { delete task; })
86

9-
# # Initializing taskr
10-
# runtime.initialize
7+
# Initializing taskr
8+
runtime.initialize()
119

12-
# fc = lambda task : print(f"Hello, I am task {task.getLabel()}")
10+
fc = lambda task : print(f"Hello, I am task {task.getLabel()}")
1311

14-
# # Create the taskr Tasks
15-
# taskfc = taskr.Function(fc)
12+
# Create the taskr Tasks
13+
taskfc = taskr.Function(fc)
1614

17-
# # Creating the execution units (functions that the tasks will run)
18-
# for i in range(1):
19-
# task = taskr.Task(i, taskfc)
15+
# Creating the execution units (functions that the tasks will run)
16+
for i in range(1):
17+
task = taskr.Task(i, taskfc)
2018

21-
# # Adding to taskr
22-
# runtime.addTask = task
19+
# Adding to taskr
20+
runtime.addTask(task)
2321

24-
# # Running taskr for the current repetition
25-
# runtime.run
22+
# Running taskr for the current repetition
23+
runtime.run()
2624

27-
# # Waiting current repetition to end
28-
# runtime.await_
25+
# Waiting current repetition to end
26+
runtime.await_()
2927

30-
# # Finalizing taskr
31-
# runtime.finalize
28+
# Finalizing taskr
29+
runtime.finalize()

0 commit comments

Comments
 (0)