[yt-svn] commit/yt: xarthisius: Fix documentation for MosaicFisheyeCamera. Fix logic governing mpi procs division among computational patches
Bitbucket
commits-noreply at bitbucket.org
Thu Jan 19 05:26:16 PST 2012
1 new commit in yt:
https://bitbucket.org/yt_analysis/yt/changeset/98e269561222/
changeset: 98e269561222
branch: yt
user: xarthisius
date: 2012-01-19 13:51:52
summary: Fix documentation for MosaicFisheyeCamera. Fix logic governing mpi procs division among computational patches
affected #: 1 file
diff -r 8bf3fafb70d17df4a77564fd6ae9a4224aec325b -r 98e269561222ebfaee42c5f38df792204d4b1f03 yt/visualization/volume_rendering/camera.py
--- a/yt/visualization/volume_rendering/camera.py
+++ b/yt/visualization/volume_rendering/camera.py
@@ -965,7 +965,7 @@
>>> transfer_function = tf,
>>> sub_samples = 5,
>>> pf=pf,
- >>> nimx=2,nimy=2,procs_per_wg=4)
+ >>> nimx=2,nimy=2,procs_per_wg=2)
# Take a snapshot
>>> im = cam.snapshot()
@@ -977,8 +977,16 @@
ParallelAnalysisInterface.__init__(self)
PP = ProcessorPool()
+ npatches = nimy*nimx
if procs_per_wg is None:
- procs_per_wg = PP.size
+ if (PP.size % npatches):
+ raise RuntimeError("Cannot evenly divide %i procs to %i patches" % (PP.size,npatches))
+ else:
+ procs_per_wg = PP.size / npatches
+ else:
+ if (PP.size != npatches*procs_per_wg):
+ raise RuntimeError("You need %i processors to utilize %i procs per one patch in [%i,%i] grid"
+ % (npatches*procs_per_wg,procs_per_wg,nimx,nimy))
for j in range(nimy):
for i in range(nimx):
PP.add_workgroup(size=procs_per_wg, name='%04i_%04i'%(i,j))
Repository URL: https://bitbucket.org/yt_analysis/yt/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
More information about the yt-svn
mailing list