Skip to content

Commit c1edb0b

Browse files
authored
Remove iostream and return types from initialise
1 parent 6a1deb7 commit c1edb0b

File tree

1 file changed

+2
-26
lines changed

1 file changed

+2
-26
lines changed

include/mpi.hpp

Lines changed: 2 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11

22
#pragma once
33

4-
#include <iostream>
54
#include <type_traits>
65
#include <vector>
76

@@ -550,14 +549,12 @@ inline std::enable_if_t<std::is_arithmetic<typename T::value_type>::value, T> al
550549
}
551550

552551
/// 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)
554553
{
555554
// MPI thread level provided
556555
auto thread_provided = static_cast<int>(thread_required);
557556

558557
MPI_Init_thread(&argc, &argv, static_cast<int>(thread_required), &thread_provided);
559-
560-
return static_cast<thread>(thread_provided);
561558
}
562559

563560
/// Initialise a non-threaded MPI environment
@@ -587,28 +584,7 @@ class instance
587584
/// Threaded MPI environment
588585
instance(int argc, char** argv, thread const thread_required)
589586
{
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);
612588
}
613589

614590
~instance() { mpi::finalise(); }

0 commit comments

Comments
 (0)