mailr7720 - in /branches/multi_processor_merge/multi: mpi4py_processor.py processor.py uni_processor.py


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

Header


Content

Posted by edward on October 15, 2008 - 22:55:
Author: bugman
Date: Wed Oct 15 22:55:11 2008
New Revision: 7720

URL: http://svn.gna.org/viewcvs/relax?rev=7720&view=rev
Log:
Manually ported r3246 from the multi_processor branch.

The command used was:
svn merge -r3245:3246 
svn+ssh://bugman@xxxxxxxxxxx/svn/relax/branches/multi_processor .

.....
  r3246 | varioustoxins | 2007-03-29 19:43:49 +0200 (Thu, 29 Mar 2007) | 3 
lines
  Changed paths:
     M /branches/multi_processor/multi/mpi4py_processor.py
     A /branches/multi_processor/multi/processor.py
     M /branches/multi_processor/multi/uni_processor.py

  corrections to remove unexpected calls of from  mpi4py import MPI in
  mpi4py_processor from uniprocessor leading to an unexpected requirement of 
mpi4py
.....


Added:
    branches/multi_processor_merge/multi/processor.py
      - copied unchanged from r3246, 
branches/multi_processor/multi/processor.py
Modified:
    branches/multi_processor_merge/multi/mpi4py_processor.py
    branches/multi_processor_merge/multi/uni_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=7720&r1=7719&r2=7720&view=diff
==============================================================================
--- branches/multi_processor_merge/multi/mpi4py_processor.py (original)
+++ branches/multi_processor_merge/multi/mpi4py_processor.py Wed Oct 15 
22:55:11 2008
@@ -5,6 +5,9 @@
 import os
 import math
 import time,datetime
+
+from multi.processor import Memo,Slave_command
+from multi.processor import Result_command,Result_string
 
 #FIXME: me move top generic command module
 from maths_fns.mf import Mf
@@ -53,71 +56,6 @@
         ditch_all_results()
 
 
-class Result(object):
-    def __init__(self):
-        pass
-
-
-class Result_string(Result):
-    #FIXME move result up a level
-    def __init__(self,string,completed):
-        super(Result_string,self).__init__()
-        self.string=string
-        self.completed=completed
-
-class Result_command(Result):
-    def __init__(self,completed,memo_id=None):
-        super(Result_command,self).__init__()
-        self.completed=completed
-        self.memo_id=memo_id
-
-    def run(self,relax,processor,memo):
-        pass
-
-class Null_result_command(Result_command):
-    def __init__(self):
-        super(Null_result_command,self).__init__(completed=True)
-
-NULL_RESULT=Null_result_command()
-
-
-class Slave_command(object):
-    def __init__(self):
-        self.memo_id=None
-
-    def set_memo_id(self,memo):
-        if memo != None:
-            self.memo_id = memo.memo_id()
-        else:
-            self.memo_id=None
-
-    def run(self,processor):
-        pass
-
-#FIXME do some inheritance
-
-class Exit_command(Slave_command):
-    def __init__(self):
-        super(Exit_command,self).__init__()
-
-    def run(self,processor):
-        processor.return_object(NULL_RESULT)
-        processor.do_quit=True
-
-
-
-class Get_name_command(Slave_command):
-    def __init__(self):
-        super(Exit_command,self).__init__()
-
-    def run(self,processor):
-        msg = processor.get_name()
-        result = Result_string(msg,True)
-        processor.return_object(result)
-
-class Memo(object):
-    def memo_id(self):
-        return id(self)
 
 
 #not quit a momento so a memo
@@ -272,7 +210,6 @@
 #                #FIXME can't cope with multiple lines
 #                print i,elem
         #queue = [command for i in range(1,MPI.size*2)]
-
         running_set=set()
         idle_set=set([i for i in range(1,MPI.size)])
 

Modified: branches/multi_processor_merge/multi/uni_processor.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/multi_processor_merge/multi/uni_processor.py?rev=7720&r1=7719&r2=7720&view=diff
==============================================================================
--- branches/multi_processor_merge/multi/uni_processor.py (original)
+++ branches/multi_processor_merge/multi/uni_processor.py Wed Oct 15 22:55:11 
2008
@@ -4,6 +4,8 @@
 import sys
 import multi
 import time,datetime
+
+from multi.processor import Result_command,Result_string
 
 #FIXME need to subclass
 class Uni_processor(object):
@@ -56,7 +58,7 @@
 
 
 
-        if isinstance(result, multi.mpi4py_processor.Result_command):
+        if isinstance(result, Result_command):
             memo=None
             if result.memo_id != None:
                 memo=self.memo_map[result.memo_id]
@@ -64,7 +66,7 @@
             if result.memo_id != None and result.completed:
                        del self.memo_map[result.memo_id]
 
-           elif isinstance(result, multi.mpi4py_processor.Result_string):
+           elif isinstance(result, Result_string):
                #FIXME can't cope with multiple lines
                print result.rank,result.string
            else:




Related Messages


Powered by MHonArc, Updated Wed Oct 15 23:00:02 2008