Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions .github/workflows/master-test-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ jobs:

- name: Build Pybind11
run: |
/usr/bin/python3 -m pip install --upgrade pip pytest

cd extern/pybind11
mkdir -p build
cd build
Expand All @@ -60,8 +62,6 @@ jobs:
EOF

echo "PKG_CONFIG_PATH=$PKG_CONFIG_PATH:$(pwd)/mock_install/share/pkgconfig" >> $GITHUB_ENV

export LD_PRELOAD=/usr/local/lib/libnosv.so

- name: Setup
run: source /home/hicr/.bashrc && meson setup build -Dbuildtype=debug -Db_coverage=true -DdistributedEngine=mpi -DbuildTests=true -DbuildExamples=true -DcompileWarningsAsErrors=true -DexecutionStateType=nosv,boost -DprocessingUnitType=nosv,pthreads -DbuildPyTaskR=true
Expand All @@ -71,6 +71,8 @@ jobs:

- name: Running tests and creating coverage report
shell: bash
env:
LD_PRELOAD: /usr/local/lib/libnosv.so
run: |
echo "Running Tests..."
source /home/hicr/.bashrc
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/pr-development-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,8 @@ jobs:

- name: Build Pybind11
run: |
/usr/bin/python3 -m pip install --upgrade pip pytest
cd extern/pybind11
mkdir -p build
cd build
Expand All @@ -290,8 +292,6 @@ jobs:
EOF
echo "PKG_CONFIG_PATH=$PKG_CONFIG_PATH:$(pwd)/mock_install/share/pkgconfig" >> $GITHUB_ENV
export LD_PRELOAD=/usr/local/lib/libnosv.so
- name: Setup
run: source /home/hicr/.bashrc && meson setup build -Dbuildtype=debug -Db_coverage=true -DdistributedEngine=mpi -DbuildTests=true -DbuildExamples=true -DcompileWarningsAsErrors=true -DexecutionStateType=nosv,boost -DprocessingUnitType=nosv,pthreads -DbuildPyTaskR=true
Expand All @@ -301,6 +301,8 @@ jobs:

- name: Running tests and creating coverage report
shell: bash
env:
LD_PRELOAD: /usr/local/lib/libnosv.so
run: |
echo "Running Tests..."
source /home/hicr/.bashrc
Expand Down
5 changes: 1 addition & 4 deletions examples/abcTasks/python/abcTasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@
ITERATIONS = 100

def abcTasks(runtime):
# TODO: Setting onTaskFinish callback to free up task memory when it finishes (not sure if we will have this)
# runtime.setTaskCallbackHandler(HiCR::tasking::Task::callback_t::onTaskFinish, [&taskr](taskr::Task *task) { delete task; })
# runtime.setTaskCallbackHandler(taskr.onTaskFinish, lambda task : del task)

# Create the taskr Tasks
taskAfc = taskr.Function(lambda task : print(f"Task A {task.getLabel()}"))
Expand Down Expand Up @@ -47,7 +44,7 @@ def abcTasks(runtime):
runtime.run()

# Waiting current repetition to end
runtime.await_()
runtime.wait()

# Finalizing taskr
runtime.finalize()
7 changes: 2 additions & 5 deletions examples/abcTasks/python/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,10 @@
def main():

# Initialize taskr with the wanted compute manager backend and number of PUs
t = taskr.taskr(taskr.HiCRBackend.threading, 2)

# Get the runtime
runtime = t.get_runtime()
t = taskr.create(backend="threading", num_workers=2)

# Running simple example
abcTasks.abcTasks(runtime)
abcTasks.abcTasks(t)

if __name__ == "__main__":
main()
2 changes: 1 addition & 1 deletion examples/conditionVariable/python/conditionVariableWait.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def fc(task):
runtime.run()

# Waiting for task to finish
runtime.await_()
runtime.wait()

# Finalizing taskr
runtime.finalize()
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def fc(task):
runtime.run()

# Waiting for task to finish
runtime.await_()
runtime.wait()

# Finalizing taskr
runtime.finalize()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ def fc(task):
runtime.run()

# Waiting for task to finish
runtime.await_()
runtime.wait()

# Finalizing taskr
runtime.finalize()
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ def fc(task):
runtime.run()

# Waiting for task to finish
runtime.await_()
runtime.wait()

# Finalizing taskr
runtime.finalize()
Expand Down
13 changes: 5 additions & 8 deletions examples/conditionVariable/python/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,9 @@
def main():

# Initialize taskr with the wanted compute manager backend and number of PUs
t = taskr.taskr()
t = taskr.create()

# Get the runtime
runtime = t.get_runtime()

runtime.setTaskCallbackHandler(taskr.TaskCallback.onTaskSuspend, lambda task : runtime.resumeTask(task))
t.setTaskCallbackHandler(taskr.TaskCallback.onTaskSuspend, lambda task : t.resumeTask(task))

# Get the enviromnent variable for which function to call
test_function_name = os.getenv('__TEST_FUNCTION_')
Expand All @@ -40,11 +37,11 @@ def main():
test_function = globals()[test_function_name]

# Call the function
test_function(runtime)
test_function(t)

# Overwrite the onTaskSuspend fc to be None such that runtime no longer has
# a dependency to the previous fc and runtime can call the destructor
runtime.setTaskCallbackHandler(taskr.TaskCallback.onTaskSuspend, None)
# a dependency to the previous fc and can call the destructor
t.setTaskCallbackHandler(taskr.TaskCallback.onTaskSuspend, None)


if __name__ == "__main__":
Expand Down
2 changes: 1 addition & 1 deletion examples/energySaver/python/energySaver.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def energySaver(runtime, workTaskCount, secondsDelay, iterations):
# Running taskr
print("Starting (open 'htop' in another console to see the workers going to sleep during the long task)...\n")
runtime.run()
runtime.await_()
runtime.wait()
print("Finished.\n")

# Finalizing taskr
Expand Down
7 changes: 2 additions & 5 deletions examples/energySaver/python/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,10 @@ def main():
print(sys.argv, workTaskCount, secondsDelay, iterations)

# Initialize taskr with the wanted compute manager backend and number of PUs
t = taskr.taskr(taskr.HiCRBackend.threading)

# Get the runtime
runtime = t.get_runtime()
t = taskr.create(backend="threading")

# Running simple example
energySaver.energySaver(runtime, workTaskCount, secondsDelay, iterations)
energySaver.energySaver(t, workTaskCount, secondsDelay, iterations)

if __name__ == "__main__":
main()
2 changes: 1 addition & 1 deletion examples/fibonacci/python/fibonacci.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def Fc(task):
# Running taskr
startTime = time.time()
runtime.run()
runtime.await_()
runtime.wait()
endTime = time.time()

computeTime = endTime - startTime
Expand Down
2 changes: 1 addition & 1 deletion examples/fibonacci/python/fibonacci_mutex.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ def Fc(task):
# Running taskr
startTime = time.time()
runtime.run()
runtime.await_()
runtime.wait()
endTime = time.time()

computeTime = endTime - startTime
Expand Down
7 changes: 2 additions & 5 deletions examples/fibonacci/python/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,11 @@ def main():
if len(sys.argv) > 1: initialValue = int(sys.argv[1])

# Initialize taskr with the wanted compute manager backend and number of PUs
t = taskr.taskr(taskr.HiCRBackend.nosv)

# Get the runtime
runtime = t.get_runtime()
t = taskr.create()

# Running Fibonacci example
# result = fibonacci.fibonacciDriver(initialValue, runtime)
result = fibonacci_mutex.fibonacciDriver(initialValue, runtime)
result = fibonacci_mutex.fibonacciDriver(initialValue, t)

# Printing result
print(f"Fib({initialValue}) = {result}")
Expand Down
7 changes: 2 additions & 5 deletions examples/manyParallel/python/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,10 @@ def main():
if len(sys.argv) > 2: branchCount = int(sys.argv[2])

# Initialize taskr with the wanted compute manager backend and number of PUs
t = taskr.taskr(taskr.HiCRBackend.threading)

# Get the runtime
runtime = t.get_runtime()
t = taskr.create("threading")

# Running simple example
manyParallel.manyParallel(runtime, taskCount, branchCount)
manyParallel.manyParallel(t, taskCount, branchCount)

if __name__ == "__main__":
main()
2 changes: 1 addition & 1 deletion examples/manyParallel/python/manyParallel.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def manyParallel(runtime, branchCount, taskCount):
# Running taskr for the current repetition
startTime = time.time()
runtime.run()
runtime.await_()
runtime.wait()
endTime = time.time()
computeTime = endTime - startTime
print(f"Running Time: {computeTime:0.5f}s")
Expand Down
9 changes: 3 additions & 6 deletions examples/matmul/python/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,12 @@

def main():
# Initialize taskr with the wanted compute manager backend and number of PUs
t = taskr.taskr(taskr.HiCRBackend.nosv, 2)

# Get the runtime
runtime = t.get_runtime()
t = taskr.create(backend="nosv", num_workers=2)

# Running matmul example
matmul_cpp_Driver(runtime)
matmul_cpp_Driver(t)

# matmul_numpy_Driver(runtime)
# matmul_numpy_Driver(t)


if __name__ == "__main__":
Expand Down
4 changes: 2 additions & 2 deletions examples/matmul/python/matmul.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def matmul_cpp_Driver(runtime):
runtime.run()

# Waiting current repetition to end
runtime.await_()
runtime.wait()
print(f"total time: {time.time() - t_start}")

# Finalizing taskr
Expand Down Expand Up @@ -76,7 +76,7 @@ def matmul_numpy(task):
runtime.run()

# Waiting current repetition to end
runtime.await_()
runtime.wait()
print(f"total time: {time.time() - t_start}")

# Finalizing taskr
Expand Down
17 changes: 7 additions & 10 deletions examples/multiJob/python/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,26 +22,23 @@
def main():

# Initialize taskr with the wanted compute manager backend and number of PUs
t = taskr.taskr(taskr.HiCRBackend.threading)

# Get the runtime
runtime = t.get_runtime()
t = taskr.create(backend="threading")

# Running multiJob example
job1.job1(runtime)
job2.job2(runtime)
job1.job1(t)
job2.job2(t)

# Initializing taskr
runtime.initialize()
t.initialize()

# Running taskr for the current repetition
runtime.run()
t.run()

# Waiting current repetition to end
runtime.await_()
t.wait()

# Finalizing taskr
runtime.finalize()
t.finalize()

if __name__ == "__main__":
main()
7 changes: 2 additions & 5 deletions examples/mutex/python/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,10 @@
def main():

# Initialize taskr with the wanted compute manager backend and number of PUs
t = taskr.taskr(taskr.HiCRBackend.threading)

# Get the runtime
runtime = t.get_runtime()
t = taskr.create("threading")

# Running mutex example
mutex.mutex(runtime)
mutex.mutex(t)

if __name__ == "__main__":
main()
2 changes: 1 addition & 1 deletion examples/mutex/python/mutex.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def fc(task):
runtime.run()

# Waiting current repetition to end
runtime.await_()
runtime.wait()

# Finalizing taskr
runtime.finalize()
Expand Down
7 changes: 2 additions & 5 deletions examples/pendingOperation/python/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,10 @@
def main():

# Initialize taskr with the wanted compute manager backend and number of PUs
t = taskr.taskr(taskr.HiCRBackend.nosv)

# Get the runtime
runtime = t.get_runtime()
t = taskr.create()

# Running pendingOperation example
pendingOperation.pendingOperation(runtime)
pendingOperation.pendingOperation(t)

if __name__ == "__main__":
main()
2 changes: 1 addition & 1 deletion examples/pendingOperation/python/pendingOperation.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def pendingOperation(runtime):
runtime.run()

# Waiting current repetition to end
runtime.await_()
runtime.wait()

# Finalizing taskr
runtime.finalize()
Expand Down
Loading
Loading