~maddevelopers/mg5amcnlo/3.0.2

« back to all changes in this revision

Viewing changes to tests/parallel_tests/test_ML5.py

  • Committer: Marco Zaro
  • Date: 2014-01-27 16:54:10 UTC
  • mfrom: (78.124.55 MG5_aMC_2.1)
  • Revision ID: marco.zaro@gmail.com-20140127165410-5lma8c2hzbzm426j
merged with lp:~maddevelopers/madgraph5/MG5_aMC_2.1 r 267

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
import loop_me_comparator
6
6
import me_comparator
7
7
import unittest
 
8
import re
8
9
 
9
10
 
10
11
from madgraph import MG5DIR
128
129
        """ A helper function to compare processes. 
129
130
        Note that the chosen_runner is what runner should to create the reference
130
131
        pickle if missing"""
131
 
        
 
132
 
132
133
        # Print out progress if it is a run for an individual process
133
134
        if len(my_proc_list)==1:
134
135
            print "\n== %s =="%my_proc_list[0][0]
149
150
        # Create a MERunner object for MadLoop 5 optimized
150
151
        ML5_opt = loop_me_comparator.LoopMG5Runner()
151
152
        ML5_opt.setup(_mg5_path, optimized_output=True, temp_dir=filename)
152
 
    
153
 
        # Create a MERunner object for MadLoop 5 default
154
 
        ML5_default = loop_me_comparator.LoopMG5Runner()
155
 
        ML5_default.setup(_mg5_path, optimized_output=False, temp_dir=filename) 
 
153
        
 
154
        file = open(os.path.join(_mg5_path,'Template','loop_material','StandAlone',
 
155
                                 'Cards','MadLoopParams.dat'), 'r')
 
156
 
 
157
        MLParams = file.read()
 
158
        MLred = re.search(r'#MLReductionLib\n',MLParams)
 
159
        MLredstr=MLParams[MLred.end():MLred.end()+1]
 
160
 
 
161
        if MLredstr=="1":
 
162
            # Create a MERunner object for MadLoop 5 default
 
163
            ML5_default = loop_me_comparator.LoopMG5Runner()
 
164
            ML5_default.setup(_mg5_path, optimized_output=False, temp_dir=filename) 
156
165
 
157
166
        # Create and setup a comparator
158
167
        my_comp = loop_me_comparator.LoopMEComparator()
159
168
        
160
169
        # Always put the saved run first if you use it, so that the corresponding PS
161
170
        # points will be used.
162
 
        if pickle_file != "":
163
 
            my_comp.set_me_runners(stored_runner,ML5_opt,ML5_default)
 
171
        if MLredstr=="1":
 
172
            # CutTools
 
173
            if pickle_file != "":
 
174
                my_comp.set_me_runners(stored_runner,ML5_opt,ML5_default)
 
175
            else:
 
176
                my_comp.set_me_runners(ML5_opt,ML5_default)
164
177
        else:
165
 
            my_comp.set_me_runners(ML5_opt,ML5_default)
 
178
            # TIR
 
179
            if pickle_file != "":
 
180
                my_comp.set_me_runners(stored_runner,ML5_opt)
 
181
            else:
 
182
                raise MadGraph5Error,"CANNOT find the stored result with TIR"
166
183
        
167
184
        # Run the actual comparison
168
185
        my_comp.run_comparison(my_proc_list,