Allow non-conservative simulations without stress#47
Allow non-conservative simulations without stress#47PicoCentauri wants to merge 2 commits intometatomicfrom
Conversation
|
If Alternatively, we could allow I don't have strong feeling here, we can either automatically use autodiff when the non_conservative output does not exists; or force the user to tell us and have |
|
I think a fallback to autodiff and write a warning might not be read by the user. I am more in favour of raising an error if either
|
|
I'm fine with the error, but it seems that there is a typo (
|
|
Yes sorry for the typo. Okay let's do this options. |
87bb247 to
eaf4f6f
Compare
eaf4f6f to
ae0531e
Compare
|
I assume, we have to add the same logic to ASE once we merged this. |
|
Yes, we can even start adding it now! |
Luthaf
left a comment
There was a problem hiding this comment.
Looks good, just one question about the error message!
| error->one(FLERR, | ||
| "{} Consider using 'non_conservative forces' or 'non_conservative off' instead.", | ||
| e.what() | ||
| ); |
There was a problem hiding this comment.
How does this looks like if the user made a typo in the variant name?
There was a problem hiding this comment.
Arghh yes this might look. Let me try if we can make this better.
There was a problem hiding this comment.
I changed the error message it now looks like:
ERROR on proc 0: output 'non_conservative_stress' not found in outputs
Exception raised from pick_output at /Users/runner/work/metatomic/metatomic/metatomic-torch/src/misc.cpp:188 (most recent call first):
frame #0: c10::Error::Error(c10::SourceLocation, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>) + 56 (0x105f3fd7c in libc10.dylib)
frame #1: metatomic_torch::pick_output(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>, c10::Dict<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>, c10::intrusive_ptr<metatomic_torch::ModelOutputHolder, c10::detail::intrusive_target_default_null_type<metatomic_torch::ModelOutputHolder>>>, std::__1::optional<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>) + 1548 (0x1064189e0 in libmetatomic_torch.dylib)
frame #2: LAMMPS_NS::PairMetatomic::settings(int, char**) + 4152 (0x104e32df8 in lmp)
frame #3: LAMMPS_NS::Input::pair_style() + 1460 (0x104b2ef78 in lmp)
frame #4: LAMMPS_NS::Input::execute_command() + 2380 (0x104b26b08 in lmp)
frame #5: LAMMPS_NS::Input::file() + 768 (0x104b259c0 in lmp)
frame #6: main + 80 (0x10490af98 in lmp)
frame #7: start + 6992 (0x18925fda4 in dyld)
Failed to select 'non_conservative_stress' output. If the model does not support non-conservative stress, use 'non_conservative forces' or 'non_conservative off'. If the model provides multiple variants, select one with 'variant/non_conservative_stress <name>'. (src/ML-METATOMIC/pair_metatomic.cpp:328)
There was a problem hiding this comment.
that's nicer, but maybe a few line breaks would help?
There was a problem hiding this comment.
I can do one before our extra message in the last line.
f532074 to
9bfdc6b
Compare
This is a bit delicate. The problem seems to be that the
vflag_globalis kind of always set. I tried a minimal NVE simulation and athermo_stylewhere there is no pressure output. But even during this run, the flag is set to true.The only workaround I see is to warn the user at init time and unfortunately silently ignore the pressure output during the run.
I am open to any better suggestions. @Luthaf or @HaoZeke.