Author: varioustoxins Date: Tue Mar 27 15:35:16 2007 New Revision: 3241 URL: http://svn.gna.org/viewcvs/relax?rev=3241&view=rev Log: installation of simplistic remote minimisation command Modified: branches/multi_processor/maths_fns/mf.py branches/multi_processor/multi/mpi4py_processor.py Modified: branches/multi_processor/maths_fns/mf.py URL: http://svn.gna.org/viewcvs/relax/branches/multi_processor/maths_fns/mf.py?rev=3241&r1=3240&r2=3241&view=diff ============================================================================== --- branches/multi_processor/maths_fns/mf.py (original) +++ branches/multi_processor/maths_fns/mf.py Tue Mar 27 15:35:16 2007 @@ -37,7 +37,11 @@ class Mf: - def __init__(self, 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): + def __init__(self, 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): """The model-free minimisation class. This class should be initialised before every calculation. @@ -45,7 +49,8 @@ Arguments ~~~~~~~~~ - + FIXME: widths + FIXME: no arguments equation: The model-free equation string which should be either 'mf_orig' or 'mf_ext'. param_types: An array of the parameter types used in minimisation. @@ -115,7 +120,7 @@ dthetaj dthetaj - dNOE() gH 1 / dsigma_noe() dR1() \ + dNOE() gH 1 / dsigma_noe() dR1() \ ------- = -- . ------- . | R1() . ------------ - sigma_noe() . ------- | dthetaj gN R1()**2 \ dthetaj dthetaj / @@ -141,11 +146,11 @@ dthetai.dthetaj dthetai.dthetaj - d2NOE() gH 1 / / dR1() dR1() d2R1() \ + d2NOE() gH 1 / / dR1() dR1() d2R1() \ --------------- = -- . ------- . | sigma_noe() . | 2 . ------- . ------- - R1() . --------------- | dthetai.dthetaj gN R1()**3 \ \ dthetai dthetaj dthetai.dthetaj / - / dsigma_noe() dR1() dR1() dsigma_noe() d2sigma_noe() \ \ + / dsigma_noe() dR1() dR1() dsigma_noe() d2sigma_noe() \ \ - R1() . | ------------ . ------- + ------- . ------------ - R1() . --------------- | | \ dthetai dthetaj dthetai dthetaj dthetai.dthetaj / / @@ -168,7 +173,7 @@ The chi-sqared gradient ~~~~~~~~~~~~~~~~~~~~~~~ _n_ - dChi2 \ / Ri - Ri() dRi() \ + dChi2 \ / Ri - Ri() dRi() \ ------- = -2 > | ---------- . ------- | dthetaj /__ \ sigma_i**2 dthetaj / i=1 @@ -182,7 +187,7 @@ The chi-sqared Hessian ~~~~~~~~~~~~~~~~~~~~~~ _n_ - d2chi2 \ 1 / dRi() dRi() d2Ri() \ + d2chi2 \ 1 / dRi() dRi() d2Ri() \ --------------- = 2 > ---------- | ------- . ------- - (Ri - Ri()) . --------------- | dthetaj.dthetak /__ sigma_i**2 \ dthetaj dthetak dthetaj.dthetak / i=1 Modified: branches/multi_processor/multi/mpi4py_processor.py URL: http://svn.gna.org/viewcvs/relax/branches/multi_processor/multi/mpi4py_processor.py?rev=3241&r1=3240&r2=3241&view=diff ============================================================================== --- branches/multi_processor/multi/mpi4py_processor.py (original) +++ branches/multi_processor/multi/mpi4py_processor.py Tue Mar 27 15:35:16 2007 @@ -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: