mailr7717 - /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 15, 2008 - 22:10:
Author: bugman
Date: Wed Oct 15 22:10:31 2008
New Revision: 7717

URL: http://svn.gna.org/viewcvs/relax?rev=7717&view=rev
Log:
Partially ported r3241 from the multi_processor branch.

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

The changes to maths_fns/mf.py didn't need to be ported across.

.....
  r3241 | varioustoxins | 2007-03-27 15:35:16 +0200 (Tue, 27 Mar 2007) | 2 
lines
  Changed paths:
     M /branches/multi_processor/maths_fns/mf.py
     M /branches/multi_processor/multi/mpi4py_processor.py

  installation of simplistic remote minimisation command
.....


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=7717&r1=7716&r2=7717&view=diff
==============================================================================
--- branches/multi_processor_merge/multi/mpi4py_processor.py (original)
+++ branches/multi_processor_merge/multi/mpi4py_processor.py Wed Oct 15 
22:10:31 2008
@@ -5,6 +5,9 @@
 import os
 import math
 
+#FIXME: me move top generic command module
+from maths_fns.mf import Mf
+from minimise.generic import generic_minimise
 
 # load mpi
 try:
@@ -74,6 +77,7 @@
 
 NULL_RESULT=Null_result_command()
 
+
 class Slave_command(object):
     def run(self,processor):
         pass
@@ -92,6 +96,41 @@
         msg = processor.get_name()
         result = Result_string(msg,True)
         processor.return_object(result)
+
+class MF_minimise_command(Slave_command):
+    def __init__(self):
+        #!! 'a0':1.0,'mu':0.0001,'eta':0.1,
+        self.minimise_map={'args':(), 'x0':None, 'min_algor':None, 
'min_options':None, 'func_tol':1e-25, 'grad_tol':None,
+                     'maxiter':1e6, 'A':None, 'b':'None', 'l':None, 
'u':None, 'c':None, 'dc':None, 'd2c':None,
+                     'dc':None, 'd2c':None, 'full_output':0, 'print_flag':0,
+                     'print_prefix':""}
+
+
+
+        self.mf_map={'init_params':None, 'param_set':None, 'diff_type':None, 
'diff_params':None,
+                      'scaling_matrix':None, 'num_res':None, 
'equations':None, 'param_types':None,
+                      'param_values':None, 'relax_data':None, 'errors':None, 
'bond_length':None,
+                      'csa':None, 'num_frq':0, 'frq':None, 'num_ri':None, 
'remap_table':None, 'noe_r1_table':None,
+                      'ri_labels':None, 'gx':0, 'gh':0, 'g_ratio':0, 
'h_bar':0, 'mu0':0, 'num_params':None, 'vectors':None}
+
+
+    #FIXME: bad names
+    def set_mf(self, **kwargs):
+        self.mf_map.update(**kwargs)
+
+
+    def set_minimise(self,**kwargs):
+        self.minimise_map.update(**kwargs)
+
+    def build_mf(self):
+        return  Mf(**self.mf_map)
+
+    def do_minimise(self):
+        return generic_minimise(func=self.mf.func, dfunc=self.mf.dfunc, 
d2func=self.mf.d2func, **self.minimise_map)
+
+    def run(self,processor):
+        self.mf = self.build_mf()
+        self.results = generic_minimise(func=self.mf.func, 
dfunc=self.mf.dfunc, d2func=self.mf.d2func, **self.minimise_map)
 
 #FIXME do some inheritance
 class Mpi4py_processor:




Related Messages


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