|
1 | 1 |
|
2 | 2 | #pragma once |
3 | 3 |
|
4 | | -#include <iostream> |
5 | 4 | #include <type_traits> |
6 | 5 | #include <vector> |
7 | 6 |
|
@@ -550,14 +549,12 @@ inline std::enable_if_t<std::is_arithmetic<typename T::value_type>::value, T> al |
550 | 549 | } |
551 | 550 |
|
552 | 551 | /// Initialise a threaded MPI environment |
553 | | -inline thread initialise(int argc, char** argv, thread const thread_required) |
| 552 | +inline void initialise(int argc, char** argv, thread const thread_required) |
554 | 553 | { |
555 | 554 | // MPI thread level provided |
556 | 555 | auto thread_provided = static_cast<int>(thread_required); |
557 | 556 |
|
558 | 557 | MPI_Init_thread(&argc, &argv, static_cast<int>(thread_required), &thread_provided); |
559 | | - |
560 | | - return static_cast<thread>(thread_provided); |
561 | 558 | } |
562 | 559 |
|
563 | 560 | /// Initialise a non-threaded MPI environment |
@@ -587,28 +584,7 @@ class instance |
587 | 584 | /// Threaded MPI environment |
588 | 585 | instance(int argc, char** argv, thread const thread_required) |
589 | 586 | { |
590 | | - auto const provided = mpi::initialise(argc, argv, thread_required); |
591 | | - |
592 | | - if (mpi::rank() == 0) |
593 | | - { |
594 | | - switch (provided) |
595 | | - { |
596 | | - case mpi::thread::single: |
597 | | - std::cout << "MPI_Init_thread level = MPI_THREAD_SINGLE\n"; |
598 | | - break; |
599 | | - case mpi::thread::funnelled: |
600 | | - std::cout << "MPI_Init_thread level = MPI_THREAD_FUNNELED\n"; |
601 | | - break; |
602 | | - case mpi::thread::serialised: |
603 | | - std::cout << "MPI_Init_thread level = MPI_THREAD_SERIALIZED\n"; |
604 | | - break; |
605 | | - case mpi::thread::multiple: |
606 | | - std::cout << "MPI_Init_thread level = MPI_THREAD_MULTIPLE\n"; |
607 | | - break; |
608 | | - default: |
609 | | - std::cout << "MPI_Init_thread level = ???\n"; |
610 | | - } |
611 | | - } |
| 587 | + mpi::initialise(argc, argv, thread_required); |
612 | 588 | } |
613 | 589 |
|
614 | 590 | ~instance() { mpi::finalise(); } |
|
0 commit comments