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

Test all setups with MPI in the workflow #217

Merged
merged 14 commits into from
Feb 17, 2022

Conversation

conradtchan
Copy link
Collaborator

@conradtchan conradtchan commented Feb 4, 2022

Type of PR:
other

Description:
Currently, only the testkd setup is tested against MPI. There is also a bug in the action that causes DEBUG=yes to not be tested. This PR adds every test from the serial tests.

 - ['test', '']
 - ['testkd', '']
 - ['testdust', 'dust']
 - ['testgr', 'gr']
 - ['testgrav', 'gravity ptmass']
 - ['testgrowth', 'dustgrowth']
 - ['testnimhd', 'nimhd']
 - ['test2', '']
 - ['testcyl', '']

Resolves #210

Resolves #231 by testing:

  • 4 OpenMP tasks - to lift any degeneracies encountered with 2
  • 4 MPI tasks - to lift any degeneracies encountered with 2
  • 1 MPI task the trivial case, which should be functionally the same as a non-MPI run, but includes a global tree building step

Testing:
Not all tests currently pass. Tests should be fixed before merging this PR.

Did you run the bots? yes

using only 2 threads may not catch all bugs
4 tasks ensures most degeneracies are lifted
1 task tests the trivial case (which is special for tree building)
so 4 tasks can run on runners with 2 cores
@danieljprice
Copy link
Owner

We are failing the sink particle creation test. This attempts to create a sink particle at the location of the SPH particle with maximum density (rhomax). So something must be missing with the reduction across MPI threads for this.

@conradtchan
Copy link
Collaborator Author

We are failing the sink particle creation test. This attempts to create a sink particle at the location of the SPH particle with maximum density (rhomax). So something must be missing with the reduction across MPI threads for this.

#234 should fix this 🙂

conradtchan added a commit that referenced this pull request Feb 17, 2022
Type of PR: 
Bug fix

Description:
Required for #217, discovered when `mpirun -n 4` was added

In ptmass.F90, during sink creation, whether the particle is at the potential minimum is checked:
```
       ! CHECK 7: particle i is at minimum in potential
       if (poteni > potenj_min) then
          ifail = inosink_poten
          ifail_array(inosink_poten) = 1
       endif
```

This check fails because an identical particle distribution gets created on every task, resulting in close comparisons when determining which particle to create a sink at.

This is fixed by only creating the particles on the master task, and allowing derivs to rebalance them.

`itest` needs to be calculated after calling derivs or else it will be incorrect. The `xcofm` calculation has been removed because the result is not used anywhere.

Testing:
```
make MPI=yes SETUP=testgrav phantomtest
mpirun -n 4 bin/phantomtest ptmass
```

Did you run the bots? yes, pre-commit
conradtchan added a commit that referenced this pull request Feb 17, 2022
Type of PR: 
Bug fix

Description:
Required for #217 

In a93bc90, as part of implementing MPI support for nimhd tests, the L2 error variables were reduced across tasks.

There is a typo resulting in the `v_x` and `B_y` error being overwritten by the density error. This produces a test failure due to the tolerance not being met.

In df72df1, NICIL 2.1 was added to phantom, where the tolerance for `B_y` was changed to `tolb=3.1d-2`. This was change was made possibly because the apparent improved accuracy was wrongly attributed to improvements to the code, rather than because the the density error was overwriting the `B_y` error.

`tolb` has been reverted to the original value of `1.1d-1`.

Testing:
```
make MPI=yes SETUP=testnimhd OPENMP=no phantomtest
mpirun -n 4 bin/phantomtest nimhd
```

Did you run the bots? no, not required
@conradtchan conradtchan marked this pull request as ready for review February 17, 2022 02:28
@conradtchan conradtchan merged commit e2b7bcd into danieljprice:master Feb 17, 2022
@conradtchan conradtchan deleted the mpi-tests branch February 17, 2022 03:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants