Author: bugman Date: Wed Oct 31 15:57:32 2012 New Revision: 17943 URL: http://svn.gna.org/viewcvs/relax?rev=17943&view=rev Log: Fixes for the pseudo-ellipse frame order model when running in multi-processor mode. Previously the back-calculated PCS data was not being returned from the slaves, causing the chi-squared value to be a fixed value as the real values were always compared to zero. Modified: branches/frame_order_testing/maths_fns/frame_order/__init__.py branches/frame_order_testing/maths_fns/frame_order/pseudo_ellipse.py Modified: branches/frame_order_testing/maths_fns/frame_order/__init__.py URL: http://svn.gna.org/viewcvs/relax/branches/frame_order_testing/maths_fns/frame_order/__init__.py?rev=17943&r1=17942&r2=17943&view=diff ============================================================================== --- branches/frame_order_testing/maths_fns/frame_order/__init__.py (original) +++ branches/frame_order_testing/maths_fns/frame_order/__init__.py Wed Oct 31 15:57:32 2012 @@ -54,7 +54,7 @@ from maths_fns.rotation_matrix import euler_to_R_zyz from maths_fns.rotation_matrix import two_vect_to_R from maths_fns.rdc import rdc_tensor -from multi import Processor_box +from multi import fetch_data, Processor_box from physical_constants import pcs_constant from relax_errors import RelaxError @@ -64,7 +64,7 @@ def __init__(self, model=None, init_params=None, full_tensors=None, full_in_ref_frame=None, rdcs=None, rdc_errors=None, rdc_weights=None, rdc_vect=None, dip_const=None, pcs=None, pcs_errors=None, pcs_weights=None, atomic_pos=None, temp=None, frq=None, paramag_centre=zeros(3), scaling_matrix=None, num_int_pts=500, pivot=zeros(3), pivot_opt=False, quad_int=True): """Set up the target functions for the Frame Order theories. - + @keyword model: The name of the Frame Order model. @type model: str @keyword init_params: The initial parameter values. @@ -294,7 +294,7 @@ # The quasi-random integration via the multi-processor. if not quad_int and self.pcs_flag_sum and model not in ['rigid']: # Get the Processor box singleton (it contains the Processor instance) and alias the Processor. - processor_box = Processor_box() + processor_box = Processor_box() self.processor = processor_box.processor # The Sobol' sequence data and target function aliases (quasi-random integration). @@ -1215,6 +1215,9 @@ # Wait for completion. self.processor.run_queue() + # Get the PCS values. + self.pcs_theta = fetch_data('pcs_theta') + # Calculate the PCS and error. num = data.num_pts for i in range(len(self.pcs_theta)): Modified: branches/frame_order_testing/maths_fns/frame_order/pseudo_ellipse.py URL: http://svn.gna.org/viewcvs/relax/branches/frame_order_testing/maths_fns/frame_order/pseudo_ellipse.py?rev=17943&r1=17942&r2=17943&view=diff ============================================================================== --- branches/frame_order_testing/maths_fns/frame_order/pseudo_ellipse.py (original) +++ branches/frame_order_testing/maths_fns/frame_order/pseudo_ellipse.py Wed Oct 31 15:57:32 2012 @@ -34,7 +34,7 @@ # relax module imports. from maths_fns.frame_order.matrix_ops import pcs_pivot_motion_full, pcs_pivot_motion_full_qrint, rotate_daeg from maths_fns.frame_order.pec import pec -from multi import Memo, Result_command, Slave_command +from multi import fetch_data_store, Memo, Result_command, Slave_command def compile_1st_matrix_pseudo_ellipse(matrix, theta_x, theta_y, sigma_max): @@ -689,6 +689,11 @@ self.num_pts = num_pts self.pcs_theta = pcs_theta + # Remove the old PCS data from the data store (required for the uniprocessor). + data_store = fetch_data_store() + if hasattr(data_store, 'pcs_theta'): + del data_store.pcs_theta + def run(self, processor, memo): """The process the partial PCS calculation. @@ -702,6 +707,16 @@ # Store the number of points in the data container. memo.data.num_pts += self.num_pts + # Get the master processor data store (this is running on the master!). + data_store = fetch_data_store() + + # Place the PCS data into the store, if not already there. + if not hasattr(data_store, 'pcs_theta'): + data_store.pcs_theta = self.pcs_theta + + # Otherwise sum the data. + else: + data_store.pcs_theta += self.pcs_theta class Slave_command_pcs_pseudo_ellipse_qrint(Slave_command):