mailr7737 - in /branches/multi_processor_merge: ./ multi/


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

Header


Content

Posted by edward on October 16, 2008 - 00:26:
Author: bugman
Date: Thu Oct 16 00:26:21 2008
New Revision: 7737

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

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

.....
  r3274 | varioustoxins | 2007-04-27 23:58:18 +0200 (Fri, 27 Apr 2007) | 2 
lines
  Changed paths:
     M /branches/multi_processor/minimise/generic.py
     M /branches/multi_processor/multi/PrependStringIO.py
     M /branches/multi_processor/multi/commands.py
     M /branches/multi_processor/multi/mpi4py_processor.py
     M /branches/multi_processor/multi/processor.py
     M /branches/multi_processor/relax

  correction to master slave output prefixes
.....


Modified:
    branches/multi_processor_merge/multi/PrependStringIO.py
    branches/multi_processor_merge/multi/commands.py
    branches/multi_processor_merge/multi/mpi4py_processor.py
    branches/multi_processor_merge/multi/processor.py
    branches/multi_processor_merge/relax

Modified: branches/multi_processor_merge/multi/PrependStringIO.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/multi_processor_merge/multi/PrependStringIO.py?rev=7737&r1=7736&r2=7737&view=diff
==============================================================================
--- branches/multi_processor_merge/multi/PrependStringIO.py (original)
+++ branches/multi_processor_merge/multi/PrependStringIO.py Thu Oct 16 
00:26:21 2008
@@ -1,5 +1,7 @@
 from  StringIO import StringIO
 import sys
+
+
 
 
 class PrependOut(StringIO):
@@ -9,14 +11,19 @@
         self.token = token
         self.token_length = len(token)
         self.first_time = True
+
         self.stream=stream
 
     def write(self,string):
+        #sys.__stdout__.write('<<' + string + '>>\n')
+
+        string = string.replace('\n', '\n' + self.token)
         if self.first_time == True:
-            string =self.token + string
+            string = '\n'+self.token + string
             self.first_time = False
-        string = string.replace('\n', '\n' + self.token)
+
         #StringIO.write(self,string)
+        #sys.__stdout__.write('<<' + string + '>>\n')
         self.stream.write(string)
         #self.truncate(0)
 
@@ -36,11 +43,20 @@
         self.token_length = len(token)
         self.first_time = True
 
+
     def write(self,string):
+        # FIXME: raising an exception here wedges mpi4py
+        file_name = sys._getframe(1).f_code.co_filename.split('/')[-1]
+        function_name = sys._getframe(1).f_code.co_name
+        line_number = sys._getframe(1).f_lineno
+        #msg = '<<%d - %s - %s - %d: %s>>'  
%(id(self),file_name,function_name,line_number,string)
+        #sys.__stdout__.write(msg)
+        string = string.replace('\n', '\n' + self.token)
         if self.first_time == True:
-            string =self.token + string
+            string ='\n' +self.token + string
             self.first_time = False
-        string = string.replace('\n', '\n' + self.token)
+
+
         StringIO.write(self,string)
 
 
@@ -49,10 +65,9 @@
 
     def getvalue(self):
         result = StringIO.getvalue(self)
-        #if len(result) <= len(self.token):
-        #   result = ''
-        #if result.endswith('\n' + self.token):
-        #    result = result[0:-self.token_length-1]
+        if len(result) > 0  and result[-1] == '\n':
+           result = result[0:-self.token_length-1]
+           result=result+'\n'
         return result
 
 if __name__ =='__main__':

Modified: branches/multi_processor_merge/multi/commands.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/multi_processor_merge/multi/commands.py?rev=7737&r1=7736&r2=7737&view=diff
==============================================================================
--- branches/multi_processor_merge/multi/commands.py (original)
+++ branches/multi_processor_merge/multi/commands.py Thu Oct 16 00:26:21 2008
@@ -255,8 +255,8 @@
         # add debug flag or extra channels that output immediately
         if processor.processor_size() > 1:
             pre_string = processor.rank_format_string() % processor.rank()
-            stderr_string = ' E> '
-            stdout_string  = ' S> '
+            stderr_string  =  ' E> '
+            stdout_string  =  ' S> '
         else:
             pre_string = ''
             stderr_string = ''
@@ -279,8 +279,8 @@
         return generic_minimise(func=self.mf.func, dfunc=self.mf.dfunc, 
d2func=self.mf.d2func, **self.minimise_map)
 
 
-    def process_result(self,processor):
-        self.process_results(self.results,processor,completed)
+#    def process_result(self,processor):
+#        self.process_results(self.results,processor,completed)
 
 
 
@@ -420,9 +420,10 @@
             self.h_count += results[OFFSET_H_COUNT]
             if results[OFFSET_WARNING] != None:
                 self.warning.append(results[OFFSET_WARNING])
-
+        #FIXME:
+        #TESTME: do we sue short results?
         else:
-            if results[OFFSET_SHORT_FK] < short_result[OFFSET_SHORT_FK]:
+            if results[OFFSET_SHORT_FK] < self.short_result[OFFSET_SHORT_FK]:
                 self.short_result[OFFSET_SHORT_MIN_PARAMS] = 
results[OFFSET_SHORT_MIN_PARAMS]
                 self.short_result[OFFSET_SHORT_FK] = results[OFFSET_SHORT_FK]
             self.short_result[OFFSET_SHORT_K] += results[OFFSET_SHORT_K]
@@ -460,7 +461,7 @@
 
         # FIXME: Check against full result
         # FIXME: names not consistent in memo
-        # FIXME too much repacking
+        # FIXME: too much repacking
         results = 
(self.param_vector,self.func,self.iter,self.fc,self.gc,self.hc, self.warning)
         memo.add_result(results)
 

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=7737&r1=7736&r2=7737&view=diff
==============================================================================
--- branches/multi_processor_merge/multi/mpi4py_processor.py (original)
+++ branches/multi_processor_merge/multi/mpi4py_processor.py Thu Oct 16 
00:26:21 2008
@@ -174,7 +174,7 @@
 
 
 
-#FIXME do some inheritance
+#FIXME: do some inheritance
 class Mpi4py_processor(Processor):
 
 

Modified: branches/multi_processor_merge/multi/processor.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/multi_processor_merge/multi/processor.py?rev=7737&r1=7736&r2=7737&view=diff
==============================================================================
--- branches/multi_processor_merge/multi/processor.py (original)
+++ branches/multi_processor_merge/multi/processor.py Thu Oct 16 00:26:21 2008
@@ -76,7 +76,7 @@
         sys.stdout = self.save_stdout
 
     def run_command_globally(self,command):
-        queue = [command for i in range(1,MPI.size)]
+        queue = [command for i in range(self.processor_size())]
         self.run_command_queue(queue)
 
     def abort(self):

Modified: branches/multi_processor_merge/relax
URL: 
http://svn.gna.org/viewcvs/relax/branches/multi_processor_merge/relax?rev=7737&r1=7736&r2=7737&view=diff
==============================================================================
--- branches/multi_processor_merge/relax (original)
+++ branches/multi_processor_merge/relax Thu Oct 16 00:26:21 2008
@@ -132,10 +132,11 @@
             self.interpreter = interpreter.Interpreter(self, intro_string)
             self.interpreter.run(self.script_file)
 
-        elif mode == 'slave':
-            self.interpreter = Interpreter(self)
-            self.dummy_mode=1
-            self.interpreter.run()
+        # FIXME no more threading
+#        elif mode == 'slave':
+#            self.interpreter = Interpreter(self)
+#            self.dummy_mode=1
+#            self.interpreter.run()
 
         # Execute the relax test suite
         elif mode == 'test suite':
@@ -244,14 +245,16 @@
 
         # Determine the relax mode and test for mutually exclusive modes.
         #################################################################
-
+# TODO: this should be a task
         # Show the version number.
         if options.version:
             mode = 'version'
 
         # Run the relax tests.
         elif options.test_suite or options.system_tests or 
options.unit_tests:
-            # Make sure no script is supplied.
+#FIXME: multiprocessor options should be  mostly resolved independant of the 
run mode
+            self.multiprocessor_type = options.multiprocessor
+            self.n_processors = options.n_processors           # Make sure 
no script is supplied.
             if self.script_file:
                 parser.error("a script should not be supplied when executing 
the test suite")
 




Related Messages


Powered by MHonArc, Updated Thu Oct 16 00:40:03 2008