mailr21101 - in /branches/relax_disp/specific_analyses/relax_disp: api.py optimisation.py


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

Header


Content

Posted by edward on October 14, 2013 - 20:22:
Author: bugman
Date: Mon Oct 14 20:22:50 2013
New Revision: 21101

URL: http://svn.gna.org/viewcvs/relax?rev=21101&view=rev
Log:
The dispersion multi-processor optimisation code now prints out its own 
simulation messages.

This is to fix bug #21190 (https://gna.org/bugs/?21190).

The memo object now is feed in the spin IDs of the cluster and stores this as 
the cluster_name
variable.  This is used by the results object run() method, which is run on 
the master at the end,
to print out a message along the lines of "Simulation X, cluster yyy".  
Therefore the message is
only printed out once the calculation of that slave command is complete and 
returned to the master.


Modified:
    branches/relax_disp/specific_analyses/relax_disp/api.py
    branches/relax_disp/specific_analyses/relax_disp/optimisation.py

Modified: branches/relax_disp/specific_analyses/relax_disp/api.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/relax_disp/specific_analyses/relax_disp/api.py?rev=21101&r1=21100&r2=21101&view=diff
==============================================================================
--- branches/relax_disp/specific_analyses/relax_disp/api.py (original)
+++ branches/relax_disp/specific_analyses/relax_disp/api.py Mon Oct 14 
20:22:50 2013
@@ -1024,7 +1024,7 @@
             command = Disp_minimise_command(spins=spins, spin_ids=spin_ids, 
sim_index=sim_index, scaling_matrix=scaling_matrix, min_algor=min_algor, 
min_options=min_options, func_tol=func_tol, grad_tol=grad_tol, 
max_iterations=max_iterations, constraints=constraints, verbosity=verbosity, 
lower=lower, upper=upper, inc=inc, fields=fields)
 
             # Set up the memo.
-            memo = Disp_memo(spins=spins, sim_index=sim_index, 
scaling_matrix=scaling_matrix, verbosity=verbosity)
+            memo = Disp_memo(spins=spins, cluster_name=spin_ids, 
sim_index=sim_index, scaling_matrix=scaling_matrix, verbosity=verbosity)
 
             # Add the slave command and memo to the processor queue.
             processor.add_to_queue(command, memo)

Modified: branches/relax_disp/specific_analyses/relax_disp/optimisation.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/relax_disp/specific_analyses/relax_disp/optimisation.py?rev=21101&r1=21100&r2=21101&view=diff
==============================================================================
--- branches/relax_disp/specific_analyses/relax_disp/optimisation.py 
(original)
+++ branches/relax_disp/specific_analyses/relax_disp/optimisation.py Mon Oct 
14 20:22:50 2013
@@ -186,7 +186,7 @@
 class Disp_memo(Memo):
     """The relaxation dispersion memo class."""
 
-    def __init__(self, spins=None, sim_index=None, scaling_matrix=None, 
verbosity=None):
+    def __init__(self, spins=None, cluster_name=None, sim_index=None, 
scaling_matrix=None, verbosity=None):
         """Initialise the relaxation dispersion memo class.
 
         This is used for handling the optimisation results returned from a 
slave processor.  It runs on the master processor and is used to store data 
which is passed to the slave processor and then passed back to the master via 
the results command.
@@ -194,6 +194,8 @@
 
         @keyword spins:             The list of spin data container for the 
cluster.  If this argument is supplied, then the spin_id argument will be 
ignored.
         @type spins:                list of SpinContainer instances
+        @keyword cluster_name:      The name of the cluster to optimise.  
This is used for printouts.
+        @type cluster_name:         list of str
         @keyword sim_index:         The optional MC simulation index.
         @type sim_index:            int
         @keyword scaling_matrix:    The diagonal, square scaling matrix.
@@ -207,6 +209,7 @@
 
         # Store the arguments.
         self.spins = spins
+        self.cluster_name = cluster_name
         self.sim_index = sim_index
         self.scaling_matrix = scaling_matrix
         self.verbosity = verbosity
@@ -510,3 +513,7 @@
 
                 # The printout.
                 print("%-20s %25.15f" % (param_text, 
param_vector[param_index]))
+
+        # Printout.
+        print("Simulation %s, cluster %s" % (memo.sim_index+1, 
memo.cluster_name))
+




Related Messages


Powered by MHonArc, Updated Tue Oct 15 09:00:01 2013