NimbleSM
NimbleSM is a solid mechanics simulation code for dynamic systems
Loading...
Searching...
No Matches
nimble::TimingInfo Struct Reference

#include <nimble_timing_utils.h>

Public Member Functions

 TimingInfo ()=default
 
 TimingInfo (int i, std::string basicString, double t_sim, double t_internal, double t_contact, double t_exodus, double t_reduce)
 
void BinaryWrite () const
 

Public Attributes

int num_ranks = 1
 
std::string time_stamp
 
double total_simulation_time = 0.0
 
double total_internal_force_time = 0.0
 
double total_contact_time = 0.0
 
double total_exodus_write_time = 0.0
 
double total_vector_reduction_time = 0.0
 

Constructor & Destructor Documentation

◆ TimingInfo() [1/2]

nimble::TimingInfo::TimingInfo ( )
default

◆ TimingInfo() [2/2]

nimble::TimingInfo::TimingInfo ( int i,
std::string basicString,
double t_sim,
double t_internal,
double t_contact,
double t_exodus,
double t_reduce )
60 : num_ranks(i),
61 time_stamp(std::move(basicString)),
63 total_internal_force_time(t_internal),
64 total_contact_time(t_contact),
67{
68}
int num_ranks
Definition nimble_timing_utils.h:70
double total_internal_force_time
Definition nimble_timing_utils.h:74
double total_exodus_write_time
Definition nimble_timing_utils.h:76
double total_simulation_time
Definition nimble_timing_utils.h:73
double total_vector_reduction_time
Definition nimble_timing_utils.h:77
std::string time_stamp
Definition nimble_timing_utils.h:71
double total_contact_time
Definition nimble_timing_utils.h:75

Member Function Documentation

◆ BinaryWrite()

void nimble::TimingInfo::BinaryWrite ( ) const
72{
73 std::stringstream timinginfo;
74 timinginfo << num_ranks << "\t" << total_simulation_time << "\t" << total_internal_force_time << "\t"
76 std::string timingdatastr = timinginfo.str();
77
78 std::stringstream filename_stream;
79 filename_stream << "nimble_timing_data_n" << num_ranks << "_" << time_stamp << ".log";
80 std::string timingfilenamestr = filename_stream.str();
81 for (char& c : timingfilenamestr) {
82 if (c == ' ') c = '-';
83 }
84
85 std::fstream fs(timingfilenamestr, fs.binary | fs.trunc | fs.in | fs.out);
86 if (!fs.is_open()) {
87 std::cerr << "Failed to open timing data file"
88 << " (" << timingfilenamestr << ") " << std::endl;
89 } else {
90 fs << timingdatastr;
91 fs.flush();
92 fs.close();
93 }
94}

Member Data Documentation

◆ num_ranks

int nimble::TimingInfo::num_ranks = 1

◆ time_stamp

std::string nimble::TimingInfo::time_stamp

◆ total_contact_time

double nimble::TimingInfo::total_contact_time = 0.0

◆ total_exodus_write_time

double nimble::TimingInfo::total_exodus_write_time = 0.0

◆ total_internal_force_time

double nimble::TimingInfo::total_internal_force_time = 0.0

◆ total_simulation_time

double nimble::TimingInfo::total_simulation_time = 0.0

◆ total_vector_reduction_time

double nimble::TimingInfo::total_vector_reduction_time = 0.0

The documentation for this struct was generated from the following files: