| kspaceFirstOrder3D-CUDA 1.1 The CUDA/C++ implementation of the k-wave toolbox for the time-domain simulation of acoustic wave fields in 3D

- Main Page
- Related Pages
- Namespaces
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
CommandLineParameters.cpp
Go to the documentation of this file.
1 /**
2 * @file CommandLineParameters.cpp
3 *
4 * @author Jiri Jaros \n
5 * Faculty of Information Technology \n
6 * Brno University of Technology \n
7 * jarosjir@fit.vutbr.cz
8 *
9 * @brief The implementation file containing the command line parameters.
10 *
11 * @version kspaceFirstOrder3D 3.4
12 *
13 * @date 29 August 2012, 11:25 (created) \n
14 * 10 August 2016, 12:54 (revised)
15 *
16 * @section License
17 * This file is part of the C++ extension of the k-Wave Toolbox
18 * (http://www.k-wave.org).\n Copyright (C) 2016 Jiri Jaros and Bradley Treeby.
19 *
20 * This file is part of the k-Wave. k-Wave is free software: you can redistribute it and/or modify
21 * it under the terms of the GNU Lesser General Public License as published by the Free Software
22 * Foundation, either version 3 of the License, or (at your option) any later version.
23 *
24 * k-Wave is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
25 * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
26 * General Public License for more details.
27 *
28 * You should have received a copy of the GNU Lesser General Public License along with k-Wave.
29 * If not, see http://www.gnu.org/licenses/.
30 */
31
32 //Linux build
33 #ifdef __linux__
34 #include <getopt.h>
35 #endif
36
37 //Windows build
38 #ifdef _WIN64
39 #include <GetoptWin64/Getopt.h>
40 #endif
41
42 #ifdef _OPENMP
43 #include <omp.h>
44 #endif
45
46
47 #include <stdexcept>
48
49 #include <Logger/Logger.h>
50 #include <Parameters/CommandLineParameters.h>
51 #include <HDF5/HDF5_File.h>
52
53 using std::string;
54
55 //------------------------------------------------------------------------------------------------//
56 //------------------------------------------ Constants -------------------------------------------//
57 //------------------------------------------------------------------------------------------------//
58
59
60
61 //------------------------------------------------------------------------------------------------//
62 //--------------------------------------- Public methods -----------------------------------------//
63 //------------------------------------------------------------------------------------------------//
64
65 /**
66 * Constructor.
67 */
68 TCommandLineParameters::TCommandLineParameters() :
69 inputFileName(""), outputFileName (""), checkpointFileName(""),
70 #ifdef _OPENMP
71 numberOfThreads(omp_get_num_procs()),
72 #else
73 numberOfThreads(1),
74 #endif
75
76 cudaDeviceIdx(-1), // default is undefined -1
77
78 progressPrintInterval(DEFAULT_PROGRESS_PRINT_INTERVAL),
79 compressionLevel(DEFAULT_COMPRESSION_LEVEL),
80 benchmarkFlag (false), benchmarkTimeStepCount(0),
81 checkpointInterval(0),
82 printVersion (false),
83
84 store_p_raw(false), store_p_rms(false), store_p_max(false), store_p_min(false),
85 store_p_max_all(false), store_p_min_all(false), store_p_final(false),
86 store_u_raw(false), store_u_non_staggered_raw(false),
87 store_u_rms(false), store_u_max(false), store_u_min(false),
88 store_u_max_all(false), store_u_min_all(false), store_u_final(false),
89 copySensorMask(false),
90 startTimeStep(0)
91 {
92
93 }// end of TCommandLineParameters
94 //--------------------------------------------------------------------------------------------------
95
96 /**
97 * Print usage.
98 */
99 void TCommandLineParameters::PrintUsage()
100 {
101 TLogger::Log(TLogger::BASIC, OUT_FMT_USAGE_PART_1);
102
103 #ifdef _OPENMP
104 TLogger::Log(TLogger::BASIC,
105 OUT_FMT_USAGE_THREADS,
106 omp_get_num_procs());
107 #endif
108
109 TLogger::Log(TLogger::BASIC,
110 OUT_FMT_USAGE_PART_2,
111 DEFAULT_PROGRESS_PRINT_INTERVAL,
112 DEFAULT_COMPRESSION_LEVEL);
113 }// end of PrintUsage
114 //--------------------------------------------------------------------------------------------------
115
116 /**
117 * Print out commandline parameters.
118 */
119 void TCommandLineParameters::PrintComandlineParamers()
120 {
121 TLogger::Log(TLogger::ADVANCED, OUT_FMT_SEPARATOR);
122
123 TLogger::Log(TLogger::ADVANCED,
124 TLogger::WordWrapString(OUT_FMT_INPUT_FILE + inputFileName,
125 ERR_FMT_PATH_DELIMITERS,
126 15).c_str());
127
128 TLogger::Log(TLogger::ADVANCED,
129 TLogger::WordWrapString(OUT_FMT_OUTPUT_FILE + outputFileName,
130 ERR_FMT_PATH_DELIMITERS,
131 15).c_str());
132
133 if (IsCheckpointEnabled())
134 {
135 TLogger::Log(TLogger::ADVANCED,
136 TLogger::WordWrapString(OUT_FMT_CHECKPOINT_FILE + checkpointFileName,
137 ERR_FMT_PATH_DELIMITERS,
138 15).c_str());
139
140 TLogger::Log(TLogger::ADVANCED, OUT_FMT_SEPARATOR);
141
142 TLogger::Log(TLogger::ADVANCED, OUT_FMT_CHECKPOINT_INTERVAL, checkpointInterval);
143 }
144 else
145 {
146 TLogger::Log(TLogger::ADVANCED, OUT_FMT_SEPARATOR);
147 }
148
149
150 TLogger::Log(TLogger::ADVANCED, OUT_FMT_COMPRESSION_LEVEL, compressionLevel);
151
152 TLogger::Log(TLogger::FULL, OUT_FMT_PRINT_PROGRESS_INTERVAL, progressPrintInterval);
153
154 if (benchmarkFlag)
155 {
156 TLogger::Log(TLogger::FULL, OUT_FMT_BENCHMARK_TIME_STEP, benchmarkTimeStepCount);
157 }
158
159 TLogger::Log(TLogger::ADVANCED, OUT_FMT_SAMPLING_FLAGS);
160
161
162 string sampledQuantitiesList = "";
163 // Sampled p quantities
164
165 if (store_p_raw)
166 {
167 sampledQuantitiesList += "p_raw, ";
168 }
169 if (store_p_rms)
170 {
171 sampledQuantitiesList += "p_rms, ";
172 }
173 if (store_p_max)
174 {
175 sampledQuantitiesList += "p_max, ";
176 }
177 if (store_p_min)
178 {
179 sampledQuantitiesList += "p_min, ";
180 }
181 if (store_p_max_all)
182 {
183 sampledQuantitiesList += "p_max_all, ";
184 }
185 if (store_p_min_all)
186 {
187 sampledQuantitiesList += "p_min_all, ";
188 }
189 if (store_p_final)
190 {
191 sampledQuantitiesList += "p_final, ";
192 }
193
194 // Sampled u quantities
195 if (store_u_raw)
196 {
197 sampledQuantitiesList += "u_raw, ";
198 }
199 if (store_u_rms)
200 {
201 sampledQuantitiesList += "u_rms, ";
202 }
203 if (store_u_max)
204 {
205 sampledQuantitiesList += "u_max, ";
206 }
207 if (store_u_min)
208 {
209 sampledQuantitiesList += "u_min, ";
210 }
211 if (store_u_max_all)
212 {
213 sampledQuantitiesList += "u_max_all, ";
214 }
215 if (store_u_min_all)
216 {
217 sampledQuantitiesList += "u_min_all, ";
218 }
219 if (store_u_final)
220 {
221 sampledQuantitiesList += "u_final, ";
222 }
223
224 if (store_u_non_staggered_raw)
225 {
226 sampledQuantitiesList += "u_non_staggered_raw, ";
227 }
228
229 // remove comma and space symbols
230 if (sampledQuantitiesList.length() > 0)
231 {
232 sampledQuantitiesList.pop_back();
233 sampledQuantitiesList.pop_back();
234 }
235
236 TLogger::Log(TLogger::ADVANCED,
237 TLogger::WordWrapString(sampledQuantitiesList,
238 " ",2).c_str());
239
240 TLogger::Log(TLogger::ADVANCED, OUT_FMT_SEPARATOR);
241
242 TLogger::Log(TLogger::ADVANCED, OUT_FMT_SAMPLING_BEGINS_AT, startTimeStep + 1);
243
244 if (copySensorMask)
245 {
246 TLogger::Log(TLogger::ADVANCED, OUT_FMT_COPY_SENSOR_MASK);
247 }
248 }// end of PrintComandlineParamers
249 //--------------------------------------------------------------------------------------------------
250
251 /**
252 * Parse command line.
253 * @param [in, out] argc
254 * @param [in, out] argv
255 */
256 void TCommandLineParameters::ParseCommandLine(int argc, char** argv)
257 {
258 char c;
259 int longIndex = -1;
260 bool checkpointFlag = false;
261
262 const int errorLineIndentation = 9;
263
264 // all optional arguments are in fact requested. This was chosen to prevent
265 // getopt error messages and provide custom error handling.
266 #ifdef _OPENMP
267 const char* shortOpts = "i:o:r:c:t:g:puhs:";
268 #else
269 const char* shortOpts = "i:o:r:c:g:puhs:";
270 #endif
271
272 const struct option longOpts[] =
273 {
274 { "benchmark", required_argument, NULL, 1 },
275 { "copy_sensor_mask", no_argument, NULL, 2 },
276 { "checkpoint_file" , required_argument, NULL, 3 },
277 { "checkpoint_interval", required_argument, NULL, 4 },
278 { "help", no_argument, NULL, 'h'},
279 { "verbose", required_argument, NULL, 5 },
280 { "version", no_argument, NULL, 6 },
281
282 { "p_raw", no_argument, NULL,'p' },
283 { "p_rms", no_argument, NULL, 10 },
284 { "p_max", no_argument, NULL, 11 },
285 { "p_min", no_argument, NULL, 12 },
286 { "p_max_all", no_argument, NULL, 13 },
287 { "p_min_all", no_argument, NULL, 14 },
288 { "p_final", no_argument, NULL, 15 },
289
290 { "u_raw", no_argument, NULL,'u' },
291 { "u_rms", no_argument, NULL, 20},
292 { "u_max", no_argument, NULL, 21},
293 { "u_min", no_argument, NULL, 22},
294 { "u_max_all", no_argument, NULL, 23},
295 { "u_min_all", no_argument, NULL, 24},
296 { "u_final", no_argument, NULL, 25},
297 { "u_non_staggered_raw", no_argument, NULL, 26},
298
299 { NULL, no_argument, NULL, 0}
300 };
301
302 // all optional arguments are in fact requested. This was chosen to prevent
303 // getopt error messages and provide custom error handling.
304 opterr = 0;
305
306 // Short parameters //
307 while ((c = getopt_long (argc, argv, shortOpts, longOpts, &longIndex )) != -1)
308 {
309 switch (c)
310 {
311 case 'i':
312 {
313 // test if the wile was correctly entered (if not, getopt could eat
314 // the following parameter)
315 if ((optarg != NULL) &&
316 ((strlen(optarg) > 0) && (optarg[0] != '-')))
317 {
318 inputFileName = optarg;
319 }
320 else
321 {
322 PrintUsage();
323 TLogger::ErrorAndTerminate(TLogger::WordWrapString(ERR_FMT_NO_INPUT_FILE,
324 " ",
325 errorLineIndentation).c_str());
326 }
327 break;
328 }
329
330 case 'o':
331 {
332 // test if the wile was correctly entered (if not, getopt could eat
333 // the following parameter)
334 if ((optarg != NULL) &&
335 ((strlen(optarg) > 0) && (optarg[0] != '-')))
336 {
337 outputFileName = optarg;
338 }
339 else
340 {
341 PrintUsage();
342 TLogger::ErrorAndTerminate(TLogger::WordWrapString(ERR_FMT_NO_OUTPUT_FILE,
343 " ",
344 errorLineIndentation).c_str());
345 }
346 break;
347 }
348
349 case 'r':
350 {
351 try
352 {
353 int convertedValue = std::stoi(optarg);
354 if ((convertedValue < 1) || (convertedValue > 100))
355 {
356 throw std::invalid_argument("-r");
357 }
358 progressPrintInterval = std::stoll(optarg);
359 }
360 catch (...)
361 {
362 PrintUsage();
363 TLogger::ErrorAndTerminate(TLogger::WordWrapString(FMT_NO_PROGRESS_PRINT_INTERVAL,
364 " ",
365 errorLineIndentation).c_str());
366 }
367 break;
368 }
369
370 case 't':
371 {
372 try
373 {
374 if (std::stoi(optarg) < 1)
375 {
376 throw std::invalid_argument("-t");
377 }
378 numberOfThreads = std::stoll(optarg);
379 }
380 catch (...)
381 {
382 PrintUsage();
383 TLogger::ErrorAndTerminate(TLogger::WordWrapString(ERR_FMT_NO_THREAD_NUMBER,
384 " ",
385 errorLineIndentation).c_str());
386 }
387 break;
388 }
389
390 case 'g':
391 {
392 try
393 {
394 cudaDeviceIdx = std::stoi(optarg);
395 if (cudaDeviceIdx < 0)
396 {
397 throw std::invalid_argument("-g");
398 }
399 }
400 catch (...)
401 {
402 PrintUsage();
403 TLogger::ErrorAndTerminate(TLogger::WordWrapString(ERR_FMT_NO_GPU_NUMBER,
404 " ",
405 errorLineIndentation).c_str());
406 }
407 break;
408 }
409
410 case 'c':
411 {
412 try
413 {
414 int covertedValue = std::stoi(optarg);
415 if ((covertedValue < 0) || (covertedValue > 9))
416 {
417 throw std::invalid_argument("-c");
418 }
419 compressionLevel = std::stoll(optarg);
420 }
421 catch (...)
422 {
423 PrintUsage();
424 TLogger::ErrorAndTerminate(TLogger::WordWrapString(ERR_FMT_NO_COMPRESSION_LEVEL,
425 " ",
426 errorLineIndentation).c_str());
427 }
428 break;
429 }
430
431 case 'h':
432 {
433 PrintUsage();
434 exit(EXIT_SUCCESS);
435 }
436
437 case 's':
438 {
439 try
440 {
441 if (std::stoll(optarg) < 1)
442 {
443 throw std::invalid_argument("-s");
444 }
445 startTimeStep = std::stoll(optarg) - 1;
446 }
447 catch (...)
448 {
449 PrintUsage();
450 TLogger::ErrorAndTerminate(TLogger::WordWrapString(ERR_FMT_NO_START_TIME_STEP,
451 " ",
452 errorLineIndentation).c_str());
453 }
454 break;
455 }
456
457 case 1: // benchmark
458 {
459 try
460 {
461 benchmarkFlag = true;
462 if (std::stoll(optarg) <= 0)
463 {
464 throw std::invalid_argument("benchmark");
465 }
466 benchmarkTimeStepCount = std::stoll(optarg);
467 }
468 catch (...)
469 {
470 PrintUsage();
471 TLogger::ErrorAndTerminate(TLogger::WordWrapString(ERR_FMT_NO_BENCHMARK_STEP_SET,
472 " ",
473 errorLineIndentation).c_str());
474 }
475 break;
476 }
477
478 case 2: // copy_sensor_mask
479 {
480 copySensorMask = true;
481 break;
482 }
483
484 case 3: // checkpoint_file
485 {
486 checkpointFlag = true;
487 // test if the wile was correctly entered (if not, getopt could eat
488 // the following parameter)
489 if ((optarg != NULL) &&
490 ((strlen(optarg) > 0) && (optarg[0] != '-')))
491 {
492 checkpointFileName = optarg;
493 }
494 else
495 {
496 PrintUsage();
497 TLogger::ErrorAndTerminate(TLogger::WordWrapString(ERR_FMT_NO_CHECKPOINT_FILE,
498 " ",
499 errorLineIndentation).c_str());
500 }
501 break;
502 }
503
504 case 4: // checkpoint_interval
505 {
506 try
507 {
508 checkpointFlag = true;
509 if (std::stoll(optarg) <= 0)
510 {
511 throw std::invalid_argument("checkpoint_interval");
512 }
513 checkpointInterval = std::stoll(optarg);
514 }
515 catch (...)
516 {
517 PrintUsage();
518 TLogger::ErrorAndTerminate(TLogger::WordWrapString(ERR_FMT_NO_CHECKPOINT_INTERVAL,
519 " ",
520 errorLineIndentation).c_str());
521 }
522 break;
523 }
524
525 case 5: // verbose
526 {
527 try
528 {
529 int verboseLevel = std::stoi(optarg);
530 if ((verboseLevel < 0) || (verboseLevel > 2))
531 {
532 throw std::invalid_argument("verbose");
533 }
534 TLogger::SetLevel(static_cast<TLogger::TLogLevel> (verboseLevel));
535 }
536 catch (...)
537 {
538 PrintUsage();
539 TLogger::ErrorAndTerminate(TLogger::WordWrapString(ERR_FMT_NO_VERBOSE_LEVEL,
540 " ",
541 errorLineIndentation).c_str());
542 }
543 break;
544 }
545
546 case 6: // version
547 {
548 printVersion = true;
549 break;
550 }
551
552 case 'p':
553 {
554 store_p_raw = true;
555 break;
556 }
557
558 case 10: // p_rms
559 {
560 store_p_rms = true;
561 break;
562 }
563
564 case 11: // p_max
565 {
566 store_p_max = true;
567 break;
568 }
569
570 case 12: // p_min
571 {
572 store_p_min = true;
573 break;
574 }
575
576 case 13: // p_max_all
577 {
578 store_p_max_all = true;
579 break;
580 }
581
582 case 14: // p_min_all
583 {
584 store_p_min_all = true;
585 break;
586 }
587
588 case 15: // p_final
589 {
590 store_p_final = true;
591 break;
592 }
593
594 case 'u':
595 {
596 store_u_raw = true;
597 break;
598 }
599
600 case 20: // u_rms
601 {
602 store_u_rms = true;
603 break;
604 }
605
606 case 21: // u_max
607 {
608 store_u_max = true;
609 break;
610 }
611
612 case 22: // u_min
613 {
614 store_u_min = true;
615 break;
616 }
617
618 case 23: // u_max_all
619 {
620 store_u_max_all = true;
621 break;
622 }
623
624 case 24: // u_min_all
625 {
626 store_u_min_all = true;
627 break;
628 }
629
630 case 25: // u_final
631 {
632 store_u_final = true;
633 break;
634 }
635
636 case 26: // u_non_staggered_raw
637 {
638 store_u_non_staggered_raw = true;
639 break;
640 }
641
642 // unknown parameter or a missing mandatory argument
643 case ':':
644 case '?':
645 {
646 switch (optopt)
647 {
648 case 'i':
649 {
650 PrintUsage();
651 TLogger::ErrorAndTerminate(TLogger::WordWrapString(ERR_FMT_NO_INPUT_FILE,
652 " ",
653 errorLineIndentation).c_str());
654 break;
655 }
656 case 'o':
657 {
658 PrintUsage();
659 TLogger::ErrorAndTerminate(TLogger::WordWrapString(ERR_FMT_NO_OUTPUT_FILE,
660 " ",
661 errorLineIndentation).c_str());
662 break;
663 }
664
665 case 'r':
666 {
667 PrintUsage();
668 TLogger::ErrorAndTerminate(TLogger::WordWrapString(FMT_NO_PROGRESS_PRINT_INTERVAL,
669 " ",
670 errorLineIndentation).c_str());
671 break;
672 }
673
674 case 'c':
675 {
676 PrintUsage();
677 TLogger::ErrorAndTerminate(TLogger::WordWrapString(ERR_FMT_NO_COMPRESSION_LEVEL,
678 " ",
679 errorLineIndentation).c_str());
680 break;
681 }
682
683 case 't':
684 {
685 PrintUsage();
686 TLogger::ErrorAndTerminate(TLogger::WordWrapString(ERR_FMT_NO_THREAD_NUMBER,
687 " ",
688 errorLineIndentation).c_str());
689 break;
690 }
691
692 case 'g':
693 {
694 PrintUsage();
695 TLogger::ErrorAndTerminate(TLogger::WordWrapString(ERR_FMT_NO_GPU_NUMBER,
696 " ",
697 errorLineIndentation).c_str());
698 break;
699 }
700
701 case 's':
702 {
703 PrintUsage();
704 TLogger::ErrorAndTerminate(TLogger::WordWrapString(ERR_FMT_NO_START_TIME_STEP,
705 " ",
706 errorLineIndentation).c_str());
707 break;
708 }
709
710 case 1: // benchmark
711 {
712 PrintUsage();
713 TLogger::ErrorAndTerminate(TLogger::WordWrapString(ERR_FMT_NO_BENCHMARK_STEP_SET,
714 " ",
715 errorLineIndentation).c_str());
716 break;
717 }
718
719 case 3: // checkpoint_file
720 {
721 PrintUsage();
722 TLogger::ErrorAndTerminate(TLogger::WordWrapString(ERR_FMT_NO_CHECKPOINT_FILE,
723 " ",
724 errorLineIndentation).c_str());
725 break;
726 }
727
728 case 4: // checkpoint_interval
729 {
730 PrintUsage();
731 TLogger::ErrorAndTerminate(TLogger::WordWrapString(ERR_FMT_NO_CHECKPOINT_INTERVAL,
732 " ",
733 errorLineIndentation).c_str());
734 break;
735 }
736
737 case 5: // verbose
738 {
739 PrintUsage();
740 TLogger::ErrorAndTerminate(TLogger::WordWrapString(ERR_FMT_NO_VERBOSE_LEVEL,
741 " ",
742 errorLineIndentation).c_str());
743 break;
744 }
745
746 default :
747 {
748 PrintUsage();
749 TLogger::ErrorAndTerminate(TLogger::WordWrapString(ERR_FMT_UNKNOW_PARAMETER_OR_ARGUMENT,
750 " ",
751 errorLineIndentation).c_str());
752 break;
753 }
754 }
755 }
756
757 default:
758 {
759 PrintUsage();
760 TLogger::ErrorAndTerminate(TLogger::WordWrapString(ERR_FMT_UNKNOWN_PARAMETER,
761 " ",
762 errorLineIndentation).c_str());
763 break;
764 }
765 }
766 }
767
768 if (printVersion) return;
769
770 //-- Post checks --//
771 if (inputFileName == "")
772 {
773 PrintUsage();
774 TLogger::ErrorAndTerminate(TLogger::WordWrapString(ERR_FMT_NO_INPUT_FILE,
775 " ",
776 errorLineIndentation).c_str());
777 }
778
779 if (outputFileName == "")
780 {
781 PrintUsage();
782 TLogger::ErrorAndTerminate(TLogger::WordWrapString(ERR_FMT_NO_OUTPUT_FILE,
783 " ",
784 errorLineIndentation).c_str());
785 }
786
787 if (checkpointFlag)
788 {
789 if (checkpointFileName == "")
790 {
791 PrintUsage();
792 TLogger::ErrorAndTerminate(TLogger::WordWrapString(ERR_FMT_NO_CHECKPOINT_FILE,
793 " ",
794 errorLineIndentation).c_str());
795 }
796
797 if (checkpointInterval <= 0)
798 {
799 PrintUsage();
800 TLogger::ErrorAndTerminate(TLogger::WordWrapString(ERR_FMT_NO_CHECKPOINT_INTERVAL,
801 " ",
802 errorLineIndentation).c_str());
803 }
804 }
805
806 // set a default flag if necessary
807 if (!(store_p_raw || store_p_rms || store_p_max || store_p_min ||
808 store_p_max_all || store_p_min_all || store_p_final ||
809 store_u_raw || store_u_non_staggered_raw ||
810 store_u_rms || store_u_max || store_u_min ||
811 store_u_max_all || store_u_min_all || store_u_final ))
812 {
813 store_p_raw = true;
814 }
815 }// end of ParseCommandLine
816 //--------------------------------------------------------------------------------------------------
TCommandLineParameters::store_u_final
bool store_u_final
Store_u_final value.
Definition: CommandLineParameters.h:364
TCommandLineParameters::store_p_max
bool store_p_max
Store_p_max value.
Definition: CommandLineParameters.h:339
TLogger::WordWrapString
static std::string WordWrapString(const std::string &inputString, const std::string &delimiters, const int indentation=0, const int lineSize=65)
Wrap the line based on logger conventions.
Definition: Logger.cpp:130
OUT_FMT_USAGE_PART_1
TOutputMessage OUT_FMT_USAGE_PART_1
Usage massage.
Definition: OutputMessagesLinux.h:376
ERR_FMT_NO_BENCHMARK_STEP_SET
TErrorMessage ERR_FMT_NO_BENCHMARK_STEP_SET
Command line parameters error message.
Definition: ErrorMessages.h:169
ERR_FMT_PATH_DELIMITERS
TErrorMessage ERR_FMT_PATH_DELIMITERS
delimiters for linux paths
Definition: ErrorMessages.h:52
TCommandLineParameters::copySensorMask
bool copySensorMask
Copy sensor mask to the output file.
Definition: CommandLineParameters.h:367
TCommandLineParameters::store_p_final
bool store_p_final
Store_p_final value.
Definition: CommandLineParameters.h:347
OUT_FMT_PRINT_PROGRESS_INTERVAL
TOutputMessage OUT_FMT_PRINT_PROGRESS_INTERVAL
Output message.
Definition: OutputMessagesLinux.h:257
TCommandLineParameters::numberOfThreads
size_t numberOfThreads
Number of CPU threads value.
Definition: CommandLineParameters.h:314
TCommandLineParameters::store_p_raw
bool store_p_raw
Store_p_raw value.
Definition: CommandLineParameters.h:335
TCommandLineParameters::store_p_min_all
bool store_p_min_all
Store_p_min_all value.
Definition: CommandLineParameters.h:345
TCommandLineParameters::checkpointInterval
size_t checkpointInterval
Checkpoint interval in seconds.
Definition: CommandLineParameters.h:329
TCommandLineParameters::store_u_non_staggered_raw
bool store_u_non_staggered_raw
Store_u_non_staggered_raw value.
Definition: CommandLineParameters.h:352
OUT_FMT_CHECKPOINT_INTERVAL
TOutputMessage OUT_FMT_CHECKPOINT_INTERVAL
Output message.
Definition: OutputMessagesLinux.h:251
ERR_FMT_NO_COMPRESSION_LEVEL
TErrorMessage ERR_FMT_NO_COMPRESSION_LEVEL
Command line parameters error message.
Definition: ErrorMessages.h:163
OUT_FMT_USAGE_PART_2
TOutputMessage OUT_FMT_USAGE_PART_2
Usage massage.
Definition: OutputMessagesLinux.h:388
TLogger::SetLevel
static void SetLevel(const TLogLevel actualLogLevel)
Set the log level.
Definition: Logger.cpp:53
ERR_FMT_UNKNOW_PARAMETER_OR_ARGUMENT
TErrorMessage ERR_FMT_UNKNOW_PARAMETER_OR_ARGUMENT
Command line parameter error message.
Definition: ErrorMessages.h:191
TCommandLineParameters::PrintComandlineParamers
void PrintComandlineParamers()
Print setup.
Definition: CommandLineParameters.cpp:119
ERR_FMT_NO_CHECKPOINT_FILE
TErrorMessage ERR_FMT_NO_CHECKPOINT_FILE
Command line parameters error message.
Definition: ErrorMessages.h:182
TCommandLineParameters::benchmarkFlag
bool benchmarkFlag
BenchmarkFlag value.
Definition: CommandLineParameters.h:325
ERR_FMT_NO_INPUT_FILE
TErrorMessage ERR_FMT_NO_INPUT_FILE
Error message - input file was not specified.
Definition: ErrorMessages.h:176
TCommandLineParameters::cudaDeviceIdx
int cudaDeviceIdx
Id of selected GPU devices.
Definition: CommandLineParameters.h:317
OUT_FMT_COMPRESSION_LEVEL
TOutputMessage OUT_FMT_COMPRESSION_LEVEL
Output message.
Definition: OutputMessagesLinux.h:254
TLogger::ErrorAndTerminate
static void ErrorAndTerminate(const std::string &errorMessage)
Log an error and terminate the execution.
Definition: Logger.cpp:94
TCommandLineParameters::store_p_min
bool store_p_min
Store_p_min value.
Definition: CommandLineParameters.h:341
HDF5_File.h
The header file containing the HDF5 related classes.
OUT_FMT_SAMPLING_BEGINS_AT
TOutputMessage OUT_FMT_SAMPLING_BEGINS_AT
Output message.
Definition: OutputMessagesLinux.h:268
TCommandLineParameters::store_u_min_all
bool store_u_min_all
Store_u_min_all value.
Definition: CommandLineParameters.h:362
TLogger::FULL
Full level of verbosity.
Definition: Logger.h:67
TCommandLineParameters::printVersion
bool printVersion
print version of the code and exit.
Definition: CommandLineParameters.h:332
OUT_FMT_OUTPUT_FILE
TOutputMessage OUT_FMT_OUTPUT_FILE
Output message.
Definition: OutputMessagesLinux.h:245
TCommandLineParameters::IsCheckpointEnabled
bool IsCheckpointEnabled() const
Is checkpoint enabled?
Definition: CommandLineParameters.h:249
ERR_FMT_NO_THREAD_NUMBER
TErrorMessage ERR_FMT_NO_THREAD_NUMBER
Command line parameters error message.
Definition: ErrorMessages.h:157
TCommandLineParameters::DEFAULT_PROGRESS_PRINT_INTERVAL
static const size_t DEFAULT_PROGRESS_PRINT_INTERVAL
Default progress print interval.
Definition: CommandLineParameters.h:374
TCommandLineParameters::progressPrintInterval
size_t progressPrintInterval
ProgressInterval value.
Definition: CommandLineParameters.h:320
Logger.h
The header file containing a class responsible for printing out info and error messages (stdout...
OUT_FMT_BENCHMARK_TIME_STEP
TOutputMessage OUT_FMT_BENCHMARK_TIME_STEP
Output message.
Definition: OutputMessagesLinux.h:260
TCommandLineParameters::inputFileName
std::string inputFileName
Input file name.
Definition: CommandLineParameters.h:307
OUT_FMT_USAGE_THREADS
TOutputMessage OUT_FMT_USAGE_THREADS
Usage massage.
Definition: OutputMessagesLinux.h:441
TCommandLineParameters::store_p_max_all
bool store_p_max_all
Store_p_max_all value.
Definition: CommandLineParameters.h:343
TCommandLineParameters::store_u_max
bool store_u_max
Store_u_max value.
Definition: CommandLineParameters.h:356
FMT_NO_PROGRESS_PRINT_INTERVAL
TErrorMessage FMT_NO_PROGRESS_PRINT_INTERVAL
Command line parameters error message.
Definition: ErrorMessages.h:154
TCommandLineParameters::outputFileName
std::string outputFileName
Output file name.
Definition: CommandLineParameters.h:309
TCommandLineParameters::store_u_raw
bool store_u_raw
Store_u_raw value.
Definition: CommandLineParameters.h:350
TCommandLineParameters::benchmarkTimeStepCount
size_t benchmarkTimeStepCount
BenchmarkTimeStepsCount value.
Definition: CommandLineParameters.h:327
TLogger::BASIC
Basic (default) level of verbosity.
Definition: Logger.h:63
TCommandLineParameters::TCommandLineParameters
TCommandLineParameters()
Default constructor - only friend class can create an instance.
Definition: CommandLineParameters.cpp:68
ERR_FMT_NO_VERBOSE_LEVEL
TErrorMessage ERR_FMT_NO_VERBOSE_LEVEL
Command line parameters error message.
Definition: ErrorMessages.h:172
TCommandLineParameters::store_u_max_all
bool store_u_max_all
Store_u_max_all value.
Definition: CommandLineParameters.h:360
ERR_FMT_NO_CHECKPOINT_INTERVAL
TErrorMessage ERR_FMT_NO_CHECKPOINT_INTERVAL
Command line parameters error message.
Definition: ErrorMessages.h:185
ERR_FMT_NO_START_TIME_STEP
TErrorMessage ERR_FMT_NO_START_TIME_STEP
Command line parameters error message.
Definition: ErrorMessages.h:166
TCommandLineParameters::PrintUsage
void PrintUsage()
Print usage..
Definition: CommandLineParameters.cpp:99
TCommandLineParameters::store_p_rms
bool store_p_rms
Store_p_rms value.
Definition: CommandLineParameters.h:337
TCommandLineParameters::checkpointFileName
std::string checkpointFileName
Checkpoint file name.
Definition: CommandLineParameters.h:311
ERR_FMT_NO_OUTPUT_FILE
TErrorMessage ERR_FMT_NO_OUTPUT_FILE
Command line parameters error message.
Definition: ErrorMessages.h:179
CommandLineParameters.h
The header file containing the command line parameters.
TLogger::ADVANCED
Advanced level of verbosity.
Definition: Logger.h:65
ERR_FMT_UNKNOWN_PARAMETER
TErrorMessage ERR_FMT_UNKNOWN_PARAMETER
Command line parameter error message.
Definition: ErrorMessages.h:188
TCommandLineParameters::DEFAULT_COMPRESSION_LEVEL
static const size_t DEFAULT_COMPRESSION_LEVEL
Default compression level.
Definition: CommandLineParameters.h:372
TCommandLineParameters::store_u_min
bool store_u_min
Store_u_min value.
Definition: CommandLineParameters.h:358
TLogger::Log
static void Log(const TLogLevel queryLevel, const std::string &format, Args...args)
Log desired activity for a given log level, version with string format.
Definition: Logger.h:85
OUT_FMT_SEPARATOR
TOutputMessage OUT_FMT_SEPARATOR
Output message - separator.
Definition: OutputMessagesLinux.h:49
OUT_FMT_INPUT_FILE
TOutputMessage OUT_FMT_INPUT_FILE
Output message.
Definition: OutputMessagesLinux.h:242
TCommandLineParameters::startTimeStep
size_t startTimeStep
StartTimeStep value.
Definition: CommandLineParameters.h:369
ERR_FMT_NO_GPU_NUMBER
TErrorMessage ERR_FMT_NO_GPU_NUMBER
Command line parameters error message.
Definition: ErrorMessages.h:160
OUT_FMT_SAMPLING_FLAGS
TOutputMessage OUT_FMT_SAMPLING_FLAGS
Output message.
Definition: OutputMessagesLinux.h:263
OUT_FMT_CHECKPOINT_FILE
TOutputMessage OUT_FMT_CHECKPOINT_FILE
Output message.
Definition: OutputMessagesLinux.h:248
OUT_FMT_COPY_SENSOR_MASK
TOutputMessage OUT_FMT_COPY_SENSOR_MASK
Output message.
Definition: OutputMessagesLinux.h:271
TCommandLineParameters::compressionLevel
size_t compressionLevel
CompressionLevel value.
Definition: CommandLineParameters.h:322
TCommandLineParameters::store_u_rms
bool store_u_rms
Store_u_rms value.
Definition: CommandLineParameters.h:354
TCommandLineParameters::ParseCommandLine
void ParseCommandLine(int argc, char **argv)
Parse command line.
Definition: CommandLineParameters.cpp:256