[Yt-svn] commit/yt: samskillman: Adding name to workgroup, initialized in ProcessorPool.add_workgroup().

Bitbucket commits-noreply at bitbucket.org
Mon Oct 24 08:35:40 PDT 2011


1 new changeset in yt:

http://bitbucket.org/yt_analysis/yt/changeset/6267774e2f34/
changeset:   6267774e2f34
branch:      yt
user:        samskillman
date:        2011-10-24 17:35:28
summary:     Adding name to workgroup, initialized in ProcessorPool.add_workgroup().
affected #:  1 file (-1 bytes)

--- a/yt/utilities/parallel_tools/parallel_analysis_interface.py	Fri Oct 21 18:54:27 2011 -0400
+++ b/yt/utilities/parallel_tools/parallel_analysis_interface.py	Mon Oct 24 09:35:28 2011 -0600
@@ -275,10 +275,11 @@
     return func
 
 class Workgroup(object):
-    def __init__(self, size, ranks, comm):
+    def __init__(self, size, ranks, comm, name):
         self.size = size
         self.ranks = ranks
         self.comm = comm
+	self.name = name
 
 class ProcessorPool(object):
     comm = None
@@ -293,7 +294,7 @@
         self.ranks = range(self.size)
         self.available_ranks = range(self.size)
     
-    def add_workgroup(self, size=None, ranks=None):
+    def add_workgroup(self, size=None, ranks=None, name=None):
         if size is None:
             size = len(self.available_ranks)
         if len(self.available_ranks) < size:
@@ -301,12 +302,16 @@
             raise RuntimeError
         if ranks is None:
             ranks = [self.available_ranks.pop(0) for i in range(size)]
-        
+
+	# Default name to the workgroup number.
+        if name is None: 
+	    name = string(len(workgroups))
+	    
         group = self.comm.comm.Get_group().Incl(ranks)
         new_comm = self.comm.comm.Create(group)
         if self.comm.rank in ranks:
             communication_system.communicators.append(Communicator(new_comm))
-        self.workgroups.append(Workgroup(len(ranks), ranks, new_comm))
+        self.workgroups.append(Workgroup(len(ranks), ranks, new_comm, name))
     
     def free_workgroup(self, workgroup):
         for i in workgroup.ranks:

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