forked from AmbaPant/mantid
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathExecutionMode.cpp
43 lines (39 loc) · 1.43 KB
/
ExecutionMode.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
// Mantid Repository : https://github.com/mantidproject/mantid
//
// Copyright © 2018 ISIS Rutherford Appleton Laboratory UKRI,
// NScD Oak Ridge National Laboratory, European Spallation Source,
// Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
// SPDX - License - Identifier: GPL - 3.0 +
#include "MantidParallel/ExecutionMode.h"
namespace Mantid::Parallel {
/// Returns the corresponding ExecutionMode for a given StorageMode.
ExecutionMode getCorrespondingExecutionMode(StorageMode storageMode) {
switch (storageMode) {
case StorageMode::Cloned:
return ExecutionMode::Identical;
case StorageMode::Distributed:
return ExecutionMode::Distributed;
case StorageMode::MasterOnly:
return ExecutionMode::MasterOnly;
default:
return ExecutionMode::Invalid;
}
}
/// Returns a human-readable string representation of an ExecutionMode.
std::string toString(ExecutionMode mode) {
switch (mode) {
case ExecutionMode::Invalid:
return "Parallel::ExecutionMode::Invalid";
case ExecutionMode::Serial:
return "Parallel::ExecutionMode::Serial";
case ExecutionMode::Identical:
return "Parallel::ExecutionMode::Identical";
case ExecutionMode::Distributed:
return "Parallel::ExecutionMode::Distributed";
case ExecutionMode::MasterOnly:
return "Parallel::ExecutionMode::MasterOnly";
default:
return "Parallel::ExecutionMode::<undefined>";
}
}
} // namespace Mantid::Parallel