Skip to content

Commit

Permalink
Merge pull request #1194 from OceanParcels/mpi_psetchange_bug
Browse files Browse the repository at this point in the history
Bugfix for ParticleSet.add() in mpi mode
  • Loading branch information
erikvansebille committed Jul 19, 2022
2 parents 7ef4923 + 56915f4 commit 5ed7445
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion parcels/collection/collectionsoa.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def __init__(self, pclass, lon, lat, depth, time, lonlatdepth_dtype, pid_orig, p

if mpi_size > 1:
if partitions is not False:
if self._pu_indicators is None:
if (self._pu_indicators is None) or (len(self._pu_indicators) != len(lon)):
if mpi_rank == 0:
coords = np.vstack((lon, lat)).transpose()
kmeans = KMeans(n_clusters=mpi_size, random_state=0).fit(coords)
Expand Down

0 comments on commit 5ed7445

Please sign in to comment.