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

Inconsistent symlink following behavior in checkpoint/restart #21134

Closed
dschwen opened this issue May 25, 2022 · 5 comments · Fixed by #21147 or #26840
Closed

Inconsistent symlink following behavior in checkpoint/restart #21134

dschwen opened this issue May 25, 2022 · 5 comments · Fixed by #21147 or #26840
Assignees
Labels
T: task An enhancement to the software.

Comments

@dschwen
Copy link
Member

dschwen commented May 25, 2022

Reason

MOOSE's "paths relative to the input file" logic, follows symlinks. I.e. if I have two directories a and b and

a/input.i
b/input.i -> ../a/input.i

the file in b is a symlink back to a. And I want to run two different simulation in those dirs (let's say with CLI args to modify parameters)...
If I'm using restart, MOOSE looks for a/input_out_cp/* in both cases. Even though the b simulation CheckpointIO writes to b/input_out_cp/*...

Design

One part of the code seems to apply realPath to follow symlinks, while the other does not. Symlinking inputs to different directories to make it easy to keep multiple outputs seems like a very reasonable thing to do. And at the very least the behavior should be consistent.

I propose not following the symlinks.

Impact

Consistent restart behavior w.r.t. symlinks.

@dschwen dschwen added the T: task An enhancement to the software. label May 25, 2022
@dschwen dschwen self-assigned this May 25, 2022
@dschwen
Copy link
Member Author

dschwen commented May 25, 2022

Ok, I think it is time to push for std::filesystem, @permcody .

This issue can be solved easily by replacing MooseUtils::realPath(path) with std::filesystem::absolute(path). That's the right behavior IMO. It produces a full path that keeps symlinks intact. The current behavior is that of std::filesystem::canonical(path), which follows symlinks.

I'll go ahead and put up a PR to make this small change and see if/where our minimal compiler targets fail...

dschwen added a commit to dschwen/moose that referenced this issue May 25, 2022
@dschwen
Copy link
Member Author

dschwen commented May 25, 2022

Using this library may require additional compiler/linker options. GNU implementation prior to 9.1 requires linking with -lstdc++fs and LLVM implementation prior to LLVM 9.0 requires linking with -lc++fs.

Ugh

@dschwen
Copy link
Member Author

dschwen commented May 25, 2022

We're at gcc7 and clang5, right?

@dschwen
Copy link
Member Author

dschwen commented May 25, 2022

Ok, in the framework tests I only get two failing tests, and both cases are non matching expected errors, where the error message actually improved.

Failed to get real path for
->
Unable to open file "/home/schwd/Programs/moose-std-filesytsem/test/tests/misc/realpath_exception/not_exist.i". Check to make sure that it exists and that you have read permission.

and

Failed to get real path for missing_input_file.i
->
Unable to open file "/home/schwd/Programs/moose-std-filesytsem/test/tests/misc/check_error/missing_input_file.i". Check to make sure that it exists and that you have read permission.

dschwen added a commit to dschwen/moose that referenced this issue May 25, 2022
@loganharbour
Copy link
Member

Ah yeah.... I see you're talking to yourself here about the problem I discussed in #21137

dschwen added a commit to dschwen/moose that referenced this issue May 25, 2022
dschwen added a commit to dschwen/moose that referenced this issue May 25, 2022
dschwen added a commit to dschwen/moose that referenced this issue May 25, 2022
dschwen added a commit to dschwen/moose that referenced this issue May 25, 2022
dschwen added a commit to dschwen/moose that referenced this issue May 25, 2022
dschwen added a commit to dschwen/moose that referenced this issue May 25, 2022
dschwen added a commit to dschwen/moose that referenced this issue Mar 6, 2023
dschwen added a commit to dschwen/moose that referenced this issue Mar 6, 2023
dschwen added a commit to dschwen/moose that referenced this issue Mar 7, 2023
dschwen added a commit to dschwen/moose that referenced this issue Mar 16, 2023
dschwen added a commit to dschwen/moose that referenced this issue Mar 16, 2023
dschwen added a commit to dschwen/moose that referenced this issue Mar 16, 2023
dschwen added a commit to dschwen/moose that referenced this issue May 9, 2023
dschwen added a commit to dschwen/moose that referenced this issue May 9, 2023
dschwen added a commit to dschwen/moose that referenced this issue May 9, 2023
dschwen added a commit to dschwen/moose that referenced this issue Aug 29, 2023
dschwen added a commit to dschwen/moose that referenced this issue Aug 29, 2023
dschwen added a commit to dschwen/moose that referenced this issue Aug 29, 2023
dschwen added a commit to dschwen/moose that referenced this issue Feb 14, 2024
dschwen added a commit to dschwen/moose that referenced this issue Feb 14, 2024
dschwen added a commit to dschwen/moose that referenced this issue Feb 14, 2024
dschwen added a commit to dschwen/moose that referenced this issue Feb 19, 2024
dschwen added a commit to dschwen/moose that referenced this issue Feb 19, 2024
dschwen added a commit to dschwen/moose that referenced this issue Feb 19, 2024
dschwen added a commit to dschwen/moose that referenced this issue Feb 19, 2024
dschwen added a commit to dschwen/moose that referenced this issue Feb 20, 2024
dschwen added a commit to dschwen/moose that referenced this issue Feb 20, 2024
pbehne pushed a commit to pbehne/moose that referenced this issue Feb 27, 2024
pbehne pushed a commit to pbehne/moose that referenced this issue Feb 27, 2024
pbehne pushed a commit to pbehne/moose that referenced this issue Feb 27, 2024
pbehne pushed a commit to pbehne/moose that referenced this issue Feb 27, 2024
pbehne pushed a commit to pbehne/moose that referenced this issue Feb 27, 2024
schakrabortygithub pushed a commit to schakrabortygithub/moose that referenced this issue Mar 12, 2024
schakrabortygithub pushed a commit to schakrabortygithub/moose that referenced this issue Mar 12, 2024
schakrabortygithub pushed a commit to schakrabortygithub/moose that referenced this issue Mar 12, 2024
schakrabortygithub pushed a commit to schakrabortygithub/moose that referenced this issue Mar 12, 2024
schakrabortygithub pushed a commit to schakrabortygithub/moose that referenced this issue Mar 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T: task An enhancement to the software.
Projects
None yet
2 participants