io Namespace Reference
SPADES API
|
spades::io Namespace Reference
IO functionality for SPADES. More...
Functions | |
void | print_usage (MPI_Comm comm, std::ostream &out) |
Print SPADES usage. | |
void | print_error (MPI_Comm comm, const std::string &msg) |
Print SPADES error. | |
void | print_banner (MPI_Comm comm, std::ostream &out) |
Print SPADES banner. | |
Detailed Description
IO functionality for SPADES.
Function Documentation
◆ print_banner()
void spades::io::print_banner | ( | MPI_Comm | comm, |
std::ostream & | out ) |
Print SPADES banner.
- Parameters
-
comm [in] MPI communicator out [out] output stream
65 : " << msg << std::endl;
66}
67
68void print_banner(MPI_Comm comm, std::ostream& out)
69{
70#ifdef AMREX_USE_MPI
71 int irank = 0;
72 int num_ranks = 1;
73 MPI_Comm_size(comm, &num_ranks);
74 MPI_Comm_rank(comm, &irank);
75
76 // Only root process does the printing
77 if (irank != 0) {
78 return;
79 }
80#else
81 amrex::ignore_unused(comm);
82#endif
83
84 auto etime = std::chrono::system_clock::now();
85 auto etimet = std::chrono::system_clock::to_time_t(etime);
86 amrex::Array<char, TIME_BUF_SIZE> time_buf;
87 ctime_r(&etimet, time_buf.begin());
88 const std::string tstamp(time_buf.begin());
89
90 const std::string dirty_tag = (version::SPADES_DIRTY_REPO == "DIRTY")
91 ? ("-" + version::SPADES_DIRTY_REPO)
92 : "";
93 const std::string spades_version = version::SPADES_VERSION + dirty_tag;
94 const std::string spades_git_sha = version::SPADES_GIT_SHA + dirty_tag;
95
96 // clang-format off
97 out << DBL_LINE
99 << std::endl << std::endl
100 << " SPADES version :: " << spades_version << std::endl
101 << " SPADES Git SHA :: " << spades_git_sha << std::endl
102 << " AMReX version :: " << amrex::Version() << std::endl << std::endl
103 << " Exec. time :: " << tstamp
107 << " MPI :: "
108#ifdef AMREX_USE_MPI
109 << "ON (Num. ranks = " << num_ranks << ")" << std::endl
110#else
111 << "OFF " << std::endl
112#endif
113 << " GPU :: "
114#ifdef AMREX_USE_GPU
115 << "ON "
116#if defined(AMREX_USE_CUDA)
117 << "(Backend: CUDA)"
118#elif defined(AMREX_USE_HIP)
119 << "(Backend: HIP)"
120#elif defined(AMREX_USE_SYCL)
121 << "(Backend: SYCL)"
122#endif
123 << std::endl
124#else
125 << "OFF" << std::endl
126#endif
127 << " OpenMP :: "
128#ifdef AMREX_USE_OMP
129 << "ON (max threads = " << amrex::OpenMP::get_max_threads()
130 << ")" << std::endl
131#else
132 << "OFF" << std::endl
133#endif
const char * buildInfoGetBuildDate()
const char * buildInfoGetCompVersion()
const char * buildInfoGetComp()
Here is the caller graph for this function:
◆ print_error()
void spades::io::print_error | ( | MPI_Comm | comm, |
const std::string & | msg ) |
Print SPADES error.
- Parameters
-
comm [in] MPI communicator msg [in] output message
41 :
42 input_file : Input file with simulation settings
43
44Optional:
45 param=value : Overrides for parameters during runtime
46)doc" << std::endl;
47}
48
49void print_error(MPI_Comm comm, const std::string& msg)
50{
51#ifdef AMREX_USE_MPI
52 int irank = 0;
53 int num_ranks = 1;
54 MPI_Comm_size(comm, &num_ranks);
55 MPI_Comm_rank(comm, &irank);
56
57 // Only root process does the printing
58 if (irank != 0) {
Here is the caller graph for this function:
◆ print_usage()
void spades::io::print_usage | ( | MPI_Comm | comm, |
std::ostream & | out ) |
Print SPADES usage.
- Parameters
-
comm [in] MPI communicator out [out] output stream
23{
24#ifdef AMREX_USE_MPI
25 int irank = 0;
26 int num_ranks = 1;
27 MPI_Comm_size(comm, &num_ranks);
28 MPI_Comm_rank(comm, &irank);
29
30 // Only root process does the printing
31 if (irank != 0) {
32 return;
33 }
34#else
35 amrex::ignore_unused(comm);
36#endif
37
38 out << R"doc(Usage:
39 spades <input_file> [param=value] [param=value] ...
Here is the caller graph for this function:
Generated by