Skip to content

Commit

Permalink
Fixing a bug when the length of pset is changed in mpi mode
Browse files Browse the repository at this point in the history
Per the Issue reported in #1193
  • Loading branch information
erikvansebille committed Jul 11, 2022
1 parent 31f81d5 commit 989eb67
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 989eb67

Please sign in to comment.