XGC1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
diagnostics.hpp
Go to the documentation of this file.
1 #ifndef DIAGNOSTICS_HPP
2 #define DIAGNOSTICS_HPP
3 
4 #include "push_diagnostic.hpp"
5 #include "heat_diagnostics.hpp"
7 #include "tracer_diag.hpp"
8 
9 /* Contains all the diagnostics */
10 struct Diagnostics{
15 
16  void open_streams(int step){
17 #ifdef ADIOS2
19  adios2::Mode mode = (!pseudo_inv_diag.has_been_triggered(step) ? adios2::Mode::Write : adios2::Mode::Append);
20  pseudo_inv_diag.open_stream("xgc.pseudo_inv.bp", mode);
21 #ifdef NO_CPP17
22 exit_XGC("\nError: If this diagnostic is needed on Polaris before Oct 16, sorry - let me know and we'll fix it. - ALS\n");
23 #endif
24  }
25  if(tracer_diag.is_on){
26  tracer_diag.open_stream("xgc.tracer_diag2.bp", adios2::Mode::Write);
27  }
28 #endif
29  }
30 
31  void close_streams(){
32 #ifdef ADIOS2
33  if(pseudo_inv_diag.is_on) pseudo_inv_diag.close_stream();
34  if(tracer_diag.is_on) tracer_diag.close_stream();
35 #endif
36  }
37 };
38 
39 #endif
TracerDiagnostics tracer_diag
Definition: diagnostics.hpp:14
Definition: diagnostics.hpp:10
PseudoInvDiagnostics pseudo_inv_diag
Definition: diagnostics.hpp:13
bool is_on
Definition: diagnostic.hpp:24
PushDiagnostic< DeviceType > push_diag
Definition: diagnostics.hpp:11
Definition: pseudo_inverse_diag.hpp:26
Definition: tracer_diag.hpp:12
void open_streams(int step)
Definition: diagnostics.hpp:16
void exit_XGC(std::string msg)
Definition: globals.hpp:37
bool has_been_triggered(int step)
Definition: diagnostic.hpp:34
void close_streams()
Definition: diagnostics.hpp:31
HeatDiagnostics< DeviceType > heat_diag
Definition: diagnostics.hpp:12