Skip to content

Commit 96e23e0

Browse files
authored
fixing stuff and style of Jacobi3D (#19)
* fixing stuff and style * updating the HiCR version * making python examples faster * removing mpi-nosv jacobid test for now
1 parent 4a782fd commit 96e23e0

File tree

8 files changed

+29
-25
lines changed

8 files changed

+29
-25
lines changed

examples/jacobi3d/meson.build

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,13 @@ if 'mpi' in distributedEngines
1313
endif
1414
endif
1515

16-
# TODO: deadlocking (even for mpirun -n 1)
17-
if 'nosv' in get_option('executionStateType') and 'nosv' in get_option('processingUnitType')
18-
nosv = executable('mpi-nosv', [ 'source/nosv.cpp', 'source/grid.cpp' ], dependencies: [ TaskRBuildDep ], cpp_args: [ TaskRDistributedCppFlag ] )
16+
# if 'nosv' in get_option('executionStateType') and 'nosv' in get_option('processingUnitType')
17+
# nosv = executable('mpi-nosv', [ 'source/nosv.cpp', 'source/grid.cpp' ], dependencies: [ TaskRBuildDep ], cpp_args: [ TaskRDistributedCppFlag ] )
1918

20-
if get_option('buildTests')
21-
test('mpi-nosv', mpirunExecutable, args : [ '-n', '2', '--oversubscribe', nosv.full_path(), '-px', '1', '-py', '1', '-pz', '2', '-lx', '1', '-ly', '2', '-lz', '2', '-n', '64', '-i', '10'], is_parallel : false, suite: testSuite + ['mpi'], workdir: nosv.full_path() + '.p' )
22-
endif
23-
endif
19+
# if get_option('buildTests')
20+
# test('mpi-nosv', mpirunExecutable, args : [ '-n', '2', '--oversubscribe', nosv.full_path(), '-px', '1', '-py', '1', '-pz', '2', '-lx', '1', '-ly', '2', '-lz', '2', '-n', '64', '-i', '10'], is_parallel : false, suite: testSuite + ['mpi'], workdir: nosv.full_path() + '.p' )
21+
# endif
22+
# endif
2423
endif
2524

2625
if 'lpf' in distributedEngines
@@ -37,11 +36,12 @@ if 'lpf' in distributedEngines
3736
endif
3837

3938

40-
if 'nosv' in get_option('executionStateType') and 'nosv' in get_option('processingUnitType')
41-
nosv = executable('lpf-nosv', [ 'source/nosv.cpp', 'source/grid.cpp' ], dependencies: [ TaskRBuildDep ], cpp_args: [ TaskRDistributedCppFlag ] )
42-
43-
if get_option('buildTests')
44-
test('lpf-nosv', mpirunExecutable, args : [ '-n', '2', '--oversubscribe', 'env', 'LPF_ENGINE=zero', nosv.full_path(), '-px', '1', '-py', '1', '-pz', '2', '-lx', '1', '-ly', '2', '-lz', '2', '-n', '64', '-i', '10'], is_parallel : false, suite: testSuite + ['lpf'], workdir: nosv.full_path() + '.p' )
45-
endif
46-
endif
39+
# TODO: Actually works but with an error message of MPI not finalizing properly
40+
# if 'nosv' in get_option('executionStateType') and 'nosv' in get_option('processingUnitType')
41+
# nosv = executable('lpf-nosv', [ 'source/nosv.cpp', 'source/grid.cpp' ], dependencies: [ TaskRBuildDep ], cpp_args: [ TaskRDistributedCppFlag ] )
42+
43+
# if get_option('buildTests')
44+
# test('lpf-nosv', mpirunExecutable, args : [ '-n', '2', '--oversubscribe', 'env', 'LPF_ENGINE=zero', nosv.full_path(), '-px', '1', '-py', '1', '-pz', '2', '-lx', '1', '-ly', '2', '-lz', '2', '-n', '64', '-i', '10'], is_parallel : false, suite: testSuite + ['lpf'], workdir: nosv.full_path() + '.p' )
45+
# endif
46+
# endif
4747
endif

examples/jacobi3d/source/nosv.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,10 @@ void jacobiDriver(HiCR::InstanceManager *instanceManager, HiCR::CommunicationMan
133133
// running the Jacobi3D example
134134
jacobi3d(instanceManager, taskr, g.get(), gDepth, N, nIters, pt, lt);
135135

136+
#ifdef _TASKR_DISTRIBUTED_ENGINE_MPI
136137
// Finalizing instances
137138
instanceManager->finalize();
139+
#endif
138140

139141
// Detaching the main thread
140142
check(nosv_detach(NOSV_DETACH_NONE));
@@ -242,7 +244,7 @@ int main(int argc, char *argv[])
242244
jacobiDriver(instanceManager.get(), communicationManager.get(), memoryManager.get());
243245
#endif
244246

245-
#ifdef _TASKR_DISTRIBUTED_ENGINE_NONE // This one segfaults (check why)
247+
#ifdef _TASKR_DISTRIBUTED_ENGINE_NONE // TODO: This one segfaults (check why)
246248
std::unique_ptr<HiCR::InstanceManager> instanceManager = std::make_unique<HiCR::backend::hwloc::InstanceManager>();
247249
std::unique_ptr<HiCR::CommunicationManager> communicationManager = std::make_unique<HiCR::backend::pthreads::CommunicationManager>();
248250
std::unique_ptr<HiCR::MemoryManager> memoryManager = HiCR::backend::hwloc::MemoryManager::createDefault();

examples/mutex/python/mutex.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616

1717
import taskr
1818

19-
_CONCURRENT_TASKS = 32
20-
_ITERATIONS_ = 1000
19+
_CONCURRENT_TASKS = 4
20+
_ITERATIONS_ = 100
2121

2222
def mutex(runtime):
2323

examples/suspend/python/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
def main():
2323
# Getting arguments, if provided
2424
taskCount = 2
25-
branchCount = 100
25+
branchCount = 10
2626
if len(sys.argv) > 1: taskCount = int(sys.argv[1])
2727
if len(sys.argv) > 2: branchCount = int(sys.argv[2])
2828

examples/suspend/python/suspend.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
import taskr
2020

21-
NSUSPENDS = 1000
21+
NSUSPENDS = 100
2222

2323
def suspend(runtime, branchCount, taskCount):
2424
# Allowing tasks to immediately resume upon suspension -- they won't execute until their pending operation is finished

extern/HiCR

include/pytaskr/README.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# pybind11 installation
22

3-
To install pybind11 go inside `extern/pybind11` and type
3+
To install pybind11 do: `git clone --branch stable https://github.com/pybind/pybind11.git`
4+
5+
and then:
46

57
```
68
mkdir build
@@ -14,19 +16,19 @@ Be sure all the tests are passing!
1416
Now, inside the `build` folder it will create another folder called `mock_install/share/pkgconfig` and this pkg-config file `pybind11.pc` type this:
1517

1618
```
17-
prefix=<location of taskr>/taskr/extern/pybind11/
19+
prefix=/path/to/pybind11
1820
includedir=${prefix}/include
1921
2022
Name: pybind11
2123
Description: Seamless operability between C++11 and Python
22-
Version: 2.13.6
24+
Version: <current-stable-version>
2325
Cflags: -I${includedir}
2426
```
2527

2628
and add the PKG-CONFIG PATH in your `.bashrc` file:
2729

2830
```
29-
export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:<location of taskr>/taskr/extern/pybind11/build/mock_install/share/pkgconfig
31+
export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/path/to/pybind11/build/mock_install/share/pkgconfig
3032
```
3133

3234
run `source ~/.bashrc` and now, you should be good-to-go with running `meson setup`.

include/pytaskr/meson.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ python_mod = import('python')
77
py = python_mod.find_installation(pure: true)
88

99
if not py.found()
10-
py = python_mod.find_installation('/usr/bin/python3', pure: false, required: true)
10+
py = python_mod.find_installation('python3', pure: false, required: true)
1111
endif
1212

1313
pybind11_dep = dependency('pybind11', required: true)

0 commit comments

Comments
 (0)