[yt-svn] commit/yt: MatthewTurk: Adding an option so that if you set njobs <= 0, it sets the number of jobs

Bitbucket commits-noreply at bitbucket.org
Mon Nov 28 03:30:07 PST 2011


1 new commit in yt:


https://bitbucket.org/yt_analysis/yt/changeset/a519b8754ba8/
changeset:   a519b8754ba8
branch:      yt
user:        MatthewTurk
date:        2011-11-28 12:29:37
summary:     Adding an option so that if you set njobs <= 0, it sets the number of jobs
equal to the number of tasks: i.e., 1:1 mapping of objects to tasks.
affected #:  1 file

diff -r 4ec73cabefb6bbf87f117ec671ecc21fa9eb7233 -r a519b8754ba86d786f6ed525584101183e86c6cc yt/utilities/parallel_tools/parallel_analysis_interface.py
--- a/yt/utilities/parallel_tools/parallel_analysis_interface.py
+++ b/yt/utilities/parallel_tools/parallel_analysis_interface.py
@@ -349,6 +349,8 @@
         mylog.warn("parallel_objects() is being used when parallel_capable is false. The loop is not being run in parallel. This may not be what was expected.")
     my_communicator = communication_system.communicators[-1]
     my_size = my_communicator.size
+    if njobs <= 0:
+        njobs = my_size
     if njobs > my_size:
         mylog.error("You have asked for %s jobs, but you only have %s processors.",
             njobs, my_size)

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