Simplify default proc_allocation generation. (#1725)
* Consolidate default_concurrency, default_gpu functionality into arborenv/default_env.hpp, .cpp. * Add new arborenv function `default_allocation()` that uses environment variables ARBENV_NUM_THREADS and ARBENV_GPU_ID to create an `arb::proc_allocation`, with a fallback to `thread_concurrency()`. * Use arborenv-specific exceptions instead of generic std::runtime_error etc. * Update examples, docs to suit. Fixes #988 (except for reworking all the unit tests!)
Showing
- arbor/include/arbor/context.hpp 2 additions, 2 deletionsarbor/include/arbor/context.hpp
- arborenv/CMakeLists.txt 3 additions, 1 deletionarborenv/CMakeLists.txt
- arborenv/arbenvexcept.cpp 27 additions, 0 deletionsarborenv/arbenvexcept.cpp
- arborenv/concurrency.cpp 6 additions, 41 deletionsarborenv/concurrency.cpp
- arborenv/default_env.cpp 66 additions, 0 deletionsarborenv/default_env.cpp
- arborenv/default_gpu.cpp 0 additions, 32 deletionsarborenv/default_gpu.cpp
- arborenv/include/arborenv/arbenvexcept.hpp 37 additions, 0 deletionsarborenv/include/arborenv/arbenvexcept.hpp
- arborenv/include/arborenv/concurrency.hpp 4 additions, 20 deletionsarborenv/include/arborenv/concurrency.hpp
- arborenv/include/arborenv/default_env.hpp 49 additions, 0 deletionsarborenv/include/arborenv/default_env.hpp
- arborenv/include/arborenv/gpu_env.hpp 0 additions, 2 deletionsarborenv/include/arborenv/gpu_env.hpp
- arborenv/private_gpu.cpp 6 additions, 5 deletionsarborenv/private_gpu.cpp
- arborenv/read_envvar.cpp 49 additions, 0 deletionsarborenv/read_envvar.cpp
- arborenv/read_envvar.hpp 20 additions, 0 deletionsarborenv/read_envvar.hpp
- doc/cpp/hardware.rst 43 additions, 36 deletionsdoc/cpp/hardware.rst
- example/bench/bench.cpp 5 additions, 14 deletionsexample/bench/bench.cpp
- example/brunel/brunel.cpp 5 additions, 13 deletionsexample/brunel/brunel.cpp
- example/gap_junctions/gap_junctions.cpp 5 additions, 13 deletionsexample/gap_junctions/gap_junctions.cpp
- example/ring/ring.cpp 2 additions, 7 deletionsexample/ring/ring.cpp
- test/unit/test_domain_decomposition.cpp 1 addition, 1 deletiontest/unit/test_domain_decomposition.cpp
- test/unit/test_fvm_layout.cpp 17 additions, 42 deletionstest/unit/test_fvm_layout.cpp
Please register or sign in to comment