Skip to content

Commit

Permalink
Simplification of the MPI partition_function explanation
Browse files Browse the repository at this point in the history
This PR is a follow-up for #1414
  • Loading branch information
erikvansebille committed Sep 4, 2023
1 parent bed2400 commit fd1269e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions docs/examples/documentation_MPI.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,10 @@
"outputs": [],
"source": [
"def simple_partition_function(coords, mpi_size=1):\n",
" \"\"\"A very simple partition function that assigns particles to processors\"\"\"\n",
" return np.array(\n",
" [int(i) for i in np.linspace(0, mpi_size, coords.shape[0], endpoint=False)]\n",
" )"
" \"\"\"A very simple partition function\n",
" that assigns particles to processors\n",
" \"\"\"\n",
" return np.linspace(0, mpi_size, coords.shape[0], endpoint=False, dtype=np.int32)"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/example_stommel.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def AgeP(particle, fieldset, time):

def simple_partition_function(coords, mpi_size=1):
"""A very simple partition function that assigns particles to processors (for MPI testing purposes))"""
return np.array([int(i) for i in np.linspace(0, mpi_size, coords.shape[0], endpoint=False)])
return np.linspace(0, mpi_size, coords.shape[0], endpoint=False, dtype=np.int32)

Check warning on line 91 in docs/examples/example_stommel.py

View check run for this annotation

Codecov / codecov/patch

docs/examples/example_stommel.py#L91

Added line #L91 was not covered by tests


def stommel_example(npart=1, mode='jit', verbose=False, method=AdvectionRK4, grid_type='A',
Expand Down

0 comments on commit fd1269e

Please sign in to comment.