bugfix: statistics communication for derived fields
This commit is contained in:
parent
43a3ab56f6
commit
2e2f987f7f
|
|
@ -1306,7 +1306,8 @@ class ibmppp:
|
|||
if not key in self.spatialMean or self.spatialMean[key] is None:
|
||||
raise ValueError('Statistics not available')
|
||||
# Broadcast statistics
|
||||
self.spatialMean[key] = self.__comm.bcast(self.spatialMean[key],root=0)
|
||||
sendbuf = self.spatialMean[key] if self.__rank==0 else None
|
||||
self.spatialMean[key] = self.__comm.bcast(sendbuf,root=0)
|
||||
# Get dimensions
|
||||
dims = self.spatialMean[key].shape
|
||||
# Slice statistics for each processor
|
||||
|
|
@ -1330,8 +1331,10 @@ class ibmppp:
|
|||
not key in self.spatialMsqr or self.spatialMsqr[key] is None):
|
||||
raise ValueError('Statistics not available')
|
||||
# Broadcast statistics
|
||||
self.spatialMean[key] = self.__comm.bcast(self.spatialMean[key],root=0)
|
||||
self.spatialMsqr[key] = self.__comm.bcast(self.spatialMsqr[key],root=0)
|
||||
sendbuf = self.spatialMean[key] if self.__rank==0 else None
|
||||
self.spatialMean[key] = self.__comm.bcast(sendbuf,root=0)
|
||||
sendbuf = self.spatialMsqr[key] if self.__rank==0 else None
|
||||
self.spatialMsqr[key] = self.__comm.bcast(sendbuf,root=0)
|
||||
# Compute standard deviation
|
||||
assert(self.spatialMean[key].shape==self.spatialMsqr[key].shape)
|
||||
spatialStdDev = np.sqrt(self.spatialMsqr[key]-np.square(self.spatialMean[key]))
|
||||
|
|
|
|||
Loading…
Reference in New Issue