Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow creating outputs file when simulation starts at non-zero time #60

Merged
merged 3 commits into from
Oct 13, 2023

Conversation

JeenaYun
Copy link
Collaborator

The changes are made to allow the creation of probe outputs when the simulation starts at non-zero time. This feature might be useful in the case of loading checkpoints.

Copy link
Collaborator

@hpc4geo hpc4geo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please update the code

src/io/BoundaryProbeWriter.cpp Outdated Show resolved Hide resolved
src/io/ScalarWriter.cpp Outdated Show resolved Hide resolved
src/io/BoundaryProbeWriter.cpp Outdated Show resolved Hide resolved
src/io/BoundaryProbeWriter.cpp Outdated Show resolved Hide resolved
src/io/ScalarWriter.cpp Outdated Show resolved Hide resolved
src/io/ScalarWriter.cpp Outdated Show resolved Hide resolved
@JeenaYun
Copy link
Collaborator Author

Hi, thanks for the comment. I reflected your suggestions.

@dmay23
Copy link
Collaborator

dmay23 commented Oct 12, 2023 via email

@JeenaYun
Copy link
Collaborator Author

I followed the convention used inside the file ScalarWriter.cpp. The variable name pointing to the file name is already file_name_ not probe.file_name even before my commit. I guess it is because ScalarWriter.cpp is not related to 'probe' outputs, but rather used for fault scalar output. Correct me if I am wrong.

@hpc4geo
Copy link
Collaborator

hpc4geo commented Oct 13, 2023

I followed the convention used inside the file ScalarWriter.cpp. The variable name pointing to the file name is already file_name_ not probe.file_name even before my commit. I guess it is because ScalarWriter.cpp is not related to 'probe' outputs, but rather used for fault scalar output. Correct me if I am wrong.

symgrad:~/codes/tandem/src/io % grep probe ScalarWriter.cpp  
symgrad:~/codes/tandem/src/io %                                             <dmay/seas-checkpoint>

There is no reference to anything called probe in ScalarWriter.cpp

@JeenaYun
Copy link
Collaborator Author

Oh I see what you mean. That was a typo, sorry.

@dmay23
Copy link
Collaborator

dmay23 commented Oct 13, 2023 via email

@JeenaYun
Copy link
Collaborator Author

You're right. Just double-checked by compiling the code, and everything works fine.

Copy link
Collaborator

@hpc4geo hpc4geo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution Jeena.

@@ -19,7 +20,12 @@ void ScalarWriter::write(double time, mneme::span<double> scalars) const {
out_->open(file_name_, false);
write_header();
} else {
out_->open(file_name_, true);
if (std::filesystem::exists(probe.file_name_)) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JeenaYun This line needs to refer to file_name_ not probe.file_name_. probe.file_name_ is not even defined.

Look at the original code or the lines below...

@hpc4geo hpc4geo merged commit 1dc36db into TEAR-ERC:dmay/seas-checkpoint Oct 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants