-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add support for threading and for user-specified MPI dimension. Closes …
…#35 (#98) * mpi: outer, threads:2 * add TODO ids * add TODO label (3D support) * skipping multi-threading tests if JIT disabled * add pylint-disable comment * print number of cores on workers * log info about supported plotting options * debug: print num_threads per worker * debug: omit pylint * debug: omit pylint * hardcore threads * fix issue number * mpi_dim as scenarion ctor argument; new test for mpi_indices; more readable code around send/recv tags for threading * pylint fixes * pylint fixes ++ * pylint disable too-many-args for whole file * check thread number every time * increase workflow timeout * check if the 3rd-order-terms issue indeed is present? * indeed 3rd-order terms cause problems with mpi_dim=INNER :( * increase timeout to 120min * remove 4th worker from the test * increase timeout to 60min * updates to README to reflect threading support changes * removing debug leftover --------- Co-authored-by: Sylwester Arabas <[email protected]> Co-authored-by: Sylwester Arabas <[email protected]>
- Loading branch information
1 parent
ec2b26e
commit 3f07a87
Showing
13 changed files
with
190 additions
and
109 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,17 @@ | ||
# pylint: disable=missing-module-docstring,missing-function-docstring,missing-class-docstring,invalid-name | ||
""" MPI-aware domain decomposition utilities """ | ||
|
||
import numpy as np | ||
from PyMPDATA.impl.domain_decomposition import make_subdomain | ||
from PyMPDATA.impl.enumerations import OUTER | ||
|
||
MPI_DIM = OUTER | ||
|
||
subdomain = make_subdomain(jit_flags={}) | ||
|
||
|
||
def mpi_indices(grid, rank, size): | ||
start, stop = subdomain(grid[MPI_DIM], rank, size) | ||
xi, yi = np.indices((stop - start, grid[MPI_DIM - 1]), dtype=float) | ||
xi += start | ||
return xi, yi | ||
def mpi_indices(*, grid, rank, size, mpi_dim): | ||
"""returns a mapping from rank-local indices to domain-wide indices, | ||
(subdomain-aware equivalent of np.indices)""" | ||
start, stop = subdomain(grid[mpi_dim], rank, size) | ||
indices_arg = list(grid) | ||
indices_arg[mpi_dim] = stop - start | ||
xyi = np.indices(tuple(indices_arg), dtype=float) | ||
xyi[mpi_dim] += start | ||
return xyi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.