mailr24531 - /branches/frame_order_cleanup/specific_analyses/frame_order/api.py


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

Header


Content

Posted by edward on July 11, 2014 - 17:21:
Author: bugman
Date: Fri Jul 11 17:21:44 2014
New Revision: 24531

URL: http://svn.gna.org/viewcvs/relax?rev=24531&view=rev
Log:
Improvements for the parallelised grid search for the frame order analysis.

As each grid point can take wildly different numbers of CPU cycles to 
calculate the chi-squared
value for, the result of subdividing the grid search was that some 
subdivisions where incredibly
quick while others required much larger amounts of time.  To avoid this bad 
slave management, the
grid points are now randomised.  This means that the subdivisions will 
require about the same amount
of time to optimise.


Modified:
    branches/frame_order_cleanup/specific_analyses/frame_order/api.py

Modified: branches/frame_order_cleanup/specific_analyses/frame_order/api.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/frame_order_cleanup/specific_analyses/frame_order/api.py?rev=24531&r1=24530&r2=24531&view=diff
==============================================================================
--- branches/frame_order_cleanup/specific_analyses/frame_order/api.py   
(original)
+++ branches/frame_order_cleanup/specific_analyses/frame_order/api.py   Fri 
Jul 11 17:21:44 2014
@@ -27,6 +27,7 @@
 from math import pi
 from minfx.grid import grid_split_array
 from numpy import array, dot, float64, zeros
+from random import shuffle
 from warnings import warn
 
 # relax module imports.
@@ -508,13 +509,18 @@
                     warn(RelaxWarning("The '%s' model parameters are not 
constrained, turning the linear constraint algorithm off." % cdp.model))
                 constraints = False
 
-
-        # Printout.
-        print("Parallelised grid search.")
-
         # Get the Processor box singleton (it contains the Processor 
instance) and alias the Processor.
         processor_box = Processor_box() 
         processor = processor_box.processor
+
+        # Set up for multi-processor execution.
+        if processor.processor_size() > 1:
+            # Printout.
+            print("Parallelised grid search.")
+            print("Randomising the grid points to equalise the time required 
for each grid subdivision.\n")
+
+            # Randomise the points.
+            shuffle(pts)
 
         # Loop over each grid subdivision, with all points violating 
constraints being eliminated.
         verbosity_init = True




Related Messages


Powered by MHonArc, Updated Fri Jul 11 18:00:02 2014