mailr7847 - /branches/multi_processor_merge/multi/mpi4py_processor.py


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by edward on October 19, 2008 - 21:44:
Author: bugman
Date: Sun Oct 19 21:44:44 2008
New Revision: 7847

URL: http://svn.gna.org/viewcvs/relax?rev=7847&view=rev
Log:
Alphabetical ordering of functions and methods.


Modified:
    branches/multi_processor_merge/multi/mpi4py_processor.py

Modified: branches/multi_processor_merge/multi/mpi4py_processor.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/multi_processor_merge/multi/mpi4py_processor.py?rev=7847&r1=7846&r2=7847&view=diff
==============================================================================
--- branches/multi_processor_merge/multi/mpi4py_processor.py (original)
+++ branches/multi_processor_merge/multi/mpi4py_processor.py Sun Oct 19 
21:44:44 2008
@@ -58,10 +58,24 @@
     sys.exit()
 
 
+def broadcast_command(command):
+    for i in range(1, MPI.size):
+        if i != 0:
+            MPI.COMM_WORLD.Send(buf=command, dest=i)
+
+
+def ditch_all_results():
+    for i in range(1, MPI.size):
+        if i != 0:
+            while 1:
+                result = MPI.COMM_WORLD.Recv(source=i)
+                if result.completed:
+                    break
+
+
 # wrapper sys.exit function
 # CHECKME is status ok
 def exit(status=None):
-
     if MPI.rank != 0:
         if in_main_loop:
             raise Exception('sys.exit unexpectedley called on slave!')
@@ -79,21 +93,6 @@
         exit_mpi()
         #MPI.COMM_WORLD.Abort(1)
         _sys_exit(status)
-
-
-def broadcast_command(command):
-    for i in range(1, MPI.size):
-        if i != 0:
-            MPI.COMM_WORLD.Send(buf=command, dest=i)
-
-
-def ditch_all_results():
-    for i in range(1, MPI.size):
-        if i != 0:
-            while 1:
-                result = MPI.COMM_WORLD.Recv(source=i)
-                if result.completed:
-                    break
 
 
 def exit_mpi():
@@ -129,10 +128,6 @@
         MPI.COMM_WORLD.Abort()
 
 
-    def rank(self):
-        return MPI.rank
-
-
     #TODO: MAY NEED support for widths?
     def get_intro_string(self):
         version_info = MPI.Get_version()
@@ -143,10 +138,6 @@
         return '%s-pid%s' % (MPI.Get_processor_name(), os.getpid())
 
 
-    def return_result_command(self, result_object):
-        MPI.COMM_WORLD.Send(buf=result_object, dest=0)
-
-
     def master_queue_command(self, command, dest):
         MPI.COMM_WORLD.Send(buf=command, dest=dest)
 
@@ -155,8 +146,12 @@
         return MPI.COMM_WORLD.Recv(source=MPI.ANY_SOURCE)
 
 
-    def slave_recieve_commands(self):
-        return MPI.COMM_WORLD.Recv(source=0)
+    def rank(self):
+        return MPI.rank
+
+
+    def return_result_command(self, result_object):
+        MPI.COMM_WORLD.Send(buf=result_object, dest=0)
 
 
     def run(self):
@@ -165,3 +160,6 @@
         super(Mpi4py_processor, self).run()
         in_main_loop = False
 
+
+    def slave_recieve_commands(self):
+        return MPI.COMM_WORLD.Recv(source=0)




Related Messages


Powered by MHonArc, Updated Sun Oct 19 22:00:02 2008