Skip to content

Commit 7beb75c

Browse files
committed
add compute_file_suffix given a string
1 parent ad59f47 commit 7beb75c

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

src/CheckPoint.C

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -299,6 +299,10 @@ void CheckPoint::compute_file_suffix(int cycle, std::stringstream& fileSuffix) {
299299
fileSuffix << ".sw4checkpoint";
300300
}
301301

302+
void CheckPoint::compute_file_suffix(const char* cycle, std::stringstream& fileSuffix) {
303+
fileSuffix << mCheckPointFile << "." << cycle << ".sw4checkpoint";
304+
}
305+
302306
//-----------------------------------------------------------------------
303307
void CheckPoint::write_checkpoint(float_sw4 a_time, int a_cycle,
304308
vector<Sarray>& a_Um, vector<Sarray>& a_U,
@@ -606,7 +610,7 @@ float_sw4 CheckPoint::getDt() {
606610
// TODO: this is not right, but you get the idea...
607611
std::stringstream fileSuffix;
608612
compute_file_suffix(cycle_num, fileSuffix);
609-
s << fileSuffix;
613+
s << fileSuffix.str();
610614

611615
// Ask SCR for the path to open our checkpoint file
612616
char scr_file[SCR_MAX_FILENAME];
@@ -1382,7 +1386,7 @@ void CheckPoint::read_checkpoint_hdf5(float_sw4& a_time, int& a_cycle,
13821386
// TODO: this is not right, but you get the idea...
13831387
std::stringstream fileSuffix;
13841388
compute_file_suffix(cycle_num, fileSuffix);
1385-
s << fileSuffix;
1389+
s << fileSuffix.str();
13861390

13871391
// Ask SCR for the path to open our checkpoint file
13881392
char scr_file[SCR_MAX_FILENAME];

src/CheckPoint.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ void write_checkpoint_scr(float_sw4 a_time, int a_cycle,
7575
void define_pio();
7676
void setSteps(int a_steps);
7777
void compute_file_suffix(int cycle, std::stringstream& fileSuffix);
78+
void compute_file_suffix(const char* cycle, std::stringstream& fileSuffix);
7879
void cycle_checkpoints(string fname);
7980
void write_header(int& fid, float_sw4 a_time, int a_cycle, int& hsize);
8081
void read_header(int& fid, float_sw4& a_time, int& a_cycle, int& hsize);

0 commit comments

Comments
 (0)