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

Auto exclusions has a regression in 4.3-dev #4650

Closed
jngrad opened this issue Jan 12, 2023 · 0 comments · Fixed by #4654
Closed

Auto exclusions has a regression in 4.3-dev #4650

jngrad opened this issue Jan 12, 2023 · 0 comments · Fixed by #4654

Comments

@jngrad
Copy link
Member

jngrad commented Jan 12, 2023

A regression was introduced in 4.3-dev by 5add7f8 from #4541. The auto-exclusion feature no longer runs in parallel due to a missing MPI guard in the script interface System class:

$ mpiexec -n 2 ./pypresso testsuite/python/auto_exclusions.py
terminate called after throwing an instance of 'std::logic_error'
  what():  Callbacks can only be invoked on rank 0.

The following patch fixes the regression:

diff --git a/src/script_interface/system/System.cpp b/src/script_interface/system/System.cpp
index aaa3ca554..62f743396 100644
--- a/src/script_interface/system/System.cpp
+++ b/src/script_interface/system/System.cpp
@@ -82,6 +82,8 @@ Variant System::do_call_method(std::string const &name,
 #ifdef EXCLUSIONS
   if (name == "auto_exclusions") {
-    auto const distance = get_value<int>(parameters, "distance");
-    auto_exclusions(distance);
+    if (context()->is_head_node()) {
+      auto const distance = get_value<int>(parameters, "distance");
+      auto_exclusions(distance);
+    }
     return {};
   }

This regression was not caught by the testsuite, because auto_exclusions.py doesn't run in parallel.

@jngrad jngrad self-assigned this Jan 12, 2023
@jngrad jngrad changed the title Auto exclusions is broken Auto exclusions has a regression in 4.3-dev Jan 12, 2023
@kodiakhq kodiakhq bot closed this as completed in #4654 Jan 19, 2023
@kodiakhq kodiakhq bot closed this as completed in 7c003a3 Jan 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant