171 (argc==2 and std::string(argv[1]).compare(
"--help" )!=std::string::npos)
173 (argc==2 and std::string(argv[1]).compare(
"-h" )!=std::string::npos)
181 std::string logFilterFile =
"swift2.log-filter";
183 std::set<int> gpuDevices;
185 for (
int argument=1; argument<argc; argument+=2) {
186 std::string select = argv[argument];
188 if ( select.compare(
"--threads" ) ==0 ) {
189 cores = std::atoi(argv[argument+1]);
190 logInfo(
"parseCommandLineArguments(...)",
"manually reset number of used cores to " << cores );
192 else if ( select.compare(
"--gpus" ) ==0 ) {
193 std::string specifier = argv[argument+1];
194 std::string delimiter =
",";
195 if ( specifier.compare(
"all" ) ==0 ) {
196 logInfo(
"parseCommandLineArguments(...)",
"enable all devices" );
198 else if (specifier.find( delimiter ) == std::string::npos) {
199 int gpu = std::atoi(specifier.c_str());
200 gpuDevices.insert(gpu);
201 logInfo(
"parseCommandLineArguments(...)",
"enable only GPU " << gpu );
206 while ((pos = specifier.find(delimiter)) != std::string::npos) {
207 token = specifier.substr(0, pos);
208 int gpu = std::atoi(token.c_str());
209 gpuDevices.insert(gpu);
210 specifier.erase(0, pos + delimiter.length());
213 logInfo(
"parseCommandLineArguments(...)",
"manually set GPU filter with " << gpuDevices.size() <<
" devices enabled" );
216 else if ( select.compare(
"--log-filter-file" ) == 0 ) {
217 logFilterFile = argv[argument+1];
219 else if ( select.compare(
"--timeout" ) == 0 ) {
220 int timeout = std::atoi(argv[argument+1]);
222 logInfo(
"parseCommandLineArguments(...)",
"manually set timeout to " << timeout );
224 else if ( select.compare(
"--dynamic-load-balancing" ) == 0 ) {
225 std::string value = argv[argument+1];
226 if (value==std::string(
"on")) {
227 enableDynamicLoadBalancing =
true;
229 else if (value==std::string(
"off")) {
230 enableDynamicLoadBalancing =
false;
233 logError(
"parseCommandLineArguments(...)",
"load balancing value has to be on or off. Value had been " << value );
247 logWarning(
"main()",
"no exahype.log-filter file found or file has been corrupted. Use default logging configuration" );
Represents one entry of the filter list.
static const std::string TargetTrace
static const std::string TargetDebug
static const std::string TargetInfo
static const bool WhiteListEntry
static const std::string AlwaysOn
static const bool BlackListEntry