Merge lp:~maddevelopers/mg5amcnlo/COLLIER into lp:~maddevelopers/mg5amcnlo/2.4.1

Proposed by Valentin Hirschi
Status: Superseded
Proposed branch: lp:~maddevelopers/mg5amcnlo/COLLIER
Merge into: lp:~maddevelopers/mg5amcnlo/2.4.1
Diff against target: 28088 lines (+18883/-1449)
162 files modified
MadSpin/decay.py (+28/-8)
Template/LO/Source/make_opts (+4/-4)
Template/LO/SubProcesses/genps.f (+1/-1)
Template/LO/SubProcesses/myamp.f (+1/-1)
Template/LO/SubProcesses/refine.sh (+40/-13)
Template/LO/SubProcesses/setcuts.f (+226/-88)
Template/NLO/SubProcesses/BinothLHA.f (+8/-4)
Template/NLO/SubProcesses/check_poles.f (+2/-0)
Template/NLO/SubProcesses/makefile_loop.inc (+1/-0)
Template/loop_material/StandAlone/Cards/MadLoopParams.dat (+81/-12)
Template/loop_material/StandAlone/SubProcesses/MadLoopCommons.inc (+151/-6)
Template/loop_material/StandAlone/SubProcesses/MadLoopParamReader.f (+62/-7)
Template/loop_material/StandAlone/SubProcesses/MadLoopParams.inc (+12/-5)
Template/loop_material/StandAlone/SubProcesses/makefile (+2/-0)
UpdateNotes.txt (+15/-2)
VERSION (+2/-2)
input/.mg5_configuration_default.txt (+7/-2)
madgraph/interface/amcatnlo_run_interface.py (+19/-14)
madgraph/interface/common_run_interface.py (+10/-6)
madgraph/interface/extended_cmd.py (+3/-1)
madgraph/interface/loop_interface.py (+4/-2)
madgraph/interface/madevent_interface.py (+52/-34)
madgraph/interface/madgraph_interface.py (+34/-8)
madgraph/iolibs/export_fks.py (+42/-12)
madgraph/iolibs/export_v4.py (+58/-18)
madgraph/iolibs/template_files/loop/check_sa.inc (+1/-0)
madgraph/iolibs/template_files/loop/check_sa_loop_induced.inc (+1/-0)
madgraph/iolibs/template_files/loop_optimized/COLLIER_interface.inc (+646/-0)
madgraph/iolibs/template_files/loop_optimized/CT_interface.inc (+8/-8)
madgraph/iolibs/template_files/loop_optimized/GOLEM_interface.inc (+2/-2)
madgraph/iolibs/template_files/loop_optimized/TIR_interface.inc (+36/-13)
madgraph/iolibs/template_files/loop_optimized/loop_matrix_standalone.inc (+102/-16)
madgraph/iolibs/template_files/matrix_loop_induced_madevent.inc (+4/-1)
madgraph/iolibs/template_files/matrix_loop_induced_madevent_group.inc (+4/-1)
madgraph/loop/loop_exporters.py (+129/-26)
madgraph/madevent/gen_ximprove.py (+1/-0)
madgraph/madevent/sum_html.py (+5/-2)
madgraph/various/banner.py (+20/-6)
madgraph/various/cluster.py (+2/-0)
madgraph/various/lhe_parser.py (+53/-39)
madgraph/various/misc.py (+8/-1)
madgraph/various/process_checks.py (+53/-13)
madgraph/various/q_polynomial.py (+14/-0)
tests/IOTests.py (+1/-1)
tests/acceptance_tests/test_cmd.py (+1/-0)
tests/acceptance_tests/test_histograms.py (+0/-1)
tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_dxu_wp%V0_dxu_wp%COLLIER_interface.f (+693/-0)
tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_dxu_wp%V0_dxu_wp%CT_interface.f (+6/-3)
tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_dxu_wp%V0_dxu_wp%GOLEM_interface.f (+2/-1)
tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_dxu_wp%V0_dxu_wp%TIR_interface.f (+10/-4)
tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_dxu_wp%V0_dxu_wp%check_sa.f (+2/-0)
tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_dxu_wp%V0_dxu_wp%loop_matrix.f (+116/-10)
tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_dxu_wp%V0_dxu_wp%mp_compute_loop_coefs.f (+13/-3)
tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_dxu_wp%V0_dxu_wp%unique_id.inc (+2/-0)
tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_udx_wp%V0_udx_wp%COLLIER_interface.f (+693/-0)
tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_udx_wp%V0_udx_wp%CT_interface.f (+6/-3)
tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_udx_wp%V0_udx_wp%GOLEM_interface.f (+2/-1)
tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_udx_wp%V0_udx_wp%TIR_interface.f (+10/-4)
tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_udx_wp%V0_udx_wp%check_sa.f (+2/-0)
tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_udx_wp%V0_udx_wp%loop_matrix.f (+116/-10)
tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_udx_wp%V0_udx_wp%mp_compute_loop_coefs.f (+13/-3)
tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_udx_wp%V0_udx_wp%unique_id.inc (+2/-0)
tests/input_files/IOTestsComparison/LoopSquaredOrder_IOTest/Loop_sqso_uux_ddx/loop_matrix_QCDQEDpert_QCDsq_eq_4.f (+116/-10)
tests/input_files/IOTestsComparison/LoopSquaredOrder_IOTest/Loop_sqso_uux_ddx/loop_matrix_QCDQEDpert_QCDsq_gt_0_QEDAmpAndQEDsq_gt_2.f (+116/-10)
tests/input_files/IOTestsComparison/LoopSquaredOrder_IOTest/Loop_sqso_uux_ddx/loop_matrix_QCDQEDpert_QCDsq_gt_4.f (+116/-10)
tests/input_files/IOTestsComparison/LoopSquaredOrder_IOTest/Loop_sqso_uux_ddx/loop_matrix_QCDQEDpert_QEDsq_le_4.f (+116/-10)
tests/input_files/IOTestsComparison/LoopSquaredOrder_IOTest/Loop_sqso_uux_ddx/loop_matrix_QCDQEDpert_WGTsq_le_10_QEDAmpAndQEDsq_gt_2.f (+116/-10)
tests/input_files/IOTestsComparison/LoopSquaredOrder_IOTest/Loop_sqso_uux_ddx/loop_matrix_QCDQEDpert_default.f (+116/-10)
tests/input_files/IOTestsComparison/LoopSquaredOrder_IOTest/Loop_sqso_uux_ddx/loop_matrix_QCDpert_default.f (+116/-10)
tests/input_files/IOTestsComparison/LoopSquaredOrder_IOTest/Loop_sqso_uux_ddx/loop_matrix_QEDpert_default.f (+116/-10)
tests/input_files/IOTestsComparison/MadLoop_output_from_the_interface/TIR_output/%ggttx_IOTest%SubProcesses%MadLoopCommons.f (+140/-8)
tests/input_files/IOTestsComparison/MadLoop_output_from_the_interface/TIR_output/%ggttx_IOTest%SubProcesses%MadLoopParamReader.f (+62/-7)
tests/input_files/IOTestsComparison/MadLoop_output_from_the_interface/TIR_output/%ggttx_IOTest%SubProcesses%P0_gg_ttx%COLLIER_interface.f (+701/-0)
tests/input_files/IOTestsComparison/MadLoop_output_from_the_interface/TIR_output/%ggttx_IOTest%SubProcesses%P0_gg_ttx%CT_interface.f (+6/-3)
tests/input_files/IOTestsComparison/MadLoop_output_from_the_interface/TIR_output/%ggttx_IOTest%SubProcesses%P0_gg_ttx%GOLEM_interface.f (+2/-1)
tests/input_files/IOTestsComparison/MadLoop_output_from_the_interface/TIR_output/%ggttx_IOTest%SubProcesses%P0_gg_ttx%TIR_interface.f (+11/-4)
tests/input_files/IOTestsComparison/MadLoop_output_from_the_interface/TIR_output/%ggttx_IOTest%SubProcesses%P0_gg_ttx%check_sa.f (+2/-0)
tests/input_files/IOTestsComparison/MadLoop_output_from_the_interface/TIR_output/%ggttx_IOTest%SubProcesses%P0_gg_ttx%loop_matrix.f (+116/-10)
tests/input_files/IOTestsComparison/MadLoop_output_from_the_interface/TIR_output/%ggttx_IOTest%SubProcesses%P0_gg_ttx%mp_compute_loop_coefs.f (+13/-3)
tests/input_files/IOTestsComparison/TestCmdMatchBox/MatchBoxOutput/%TEST%SubProcesses%P1_uux_uux%COLLIER_interface.f (+693/-0)
tests/input_files/IOTestsComparison/TestCmdMatchBox/MatchBoxOutput/%TEST%SubProcesses%P1_uux_uux%CT_interface.f (+6/-3)
tests/input_files/IOTestsComparison/TestCmdMatchBox/MatchBoxOutput/%TEST%SubProcesses%P1_uux_uux%GOLEM_interface.f (+2/-1)
tests/input_files/IOTestsComparison/TestCmdMatchBox/MatchBoxOutput/%TEST%SubProcesses%P1_uux_uux%TIR_interface.f (+11/-4)
tests/input_files/IOTestsComparison/TestCmdMatchBox/MatchBoxOutput/%TEST%SubProcesses%P1_uux_uux%check_sa.f (+2/-0)
tests/input_files/IOTestsComparison/TestCmdMatchBox/MatchBoxOutput/%TEST%SubProcesses%P1_uux_uux%loop_matrix.f (+116/-10)
tests/input_files/IOTestsComparison/TestCmdMatchBox/MatchBoxOutput/%TEST%SubProcesses%P1_uux_uux%mp_compute_loop_coefs.f (+13/-3)
tests/input_files/IOTestsComparison/TestCmdMatchBox/MatchBoxOutput/%TEST%SubProcesses%P1_uux_uux%unique_id.inc (+2/-0)
tests/input_files/IOTestsComparison/long_ML_SMQCD_default/dux_mumvmxg/check_sa.f (+2/-0)
tests/input_files/IOTestsComparison/long_ML_SMQCD_default/dux_mumvmxg/unique_id.inc (+2/-0)
tests/input_files/IOTestsComparison/long_ML_SMQCD_default/gg_wmtbx/check_sa.f (+2/-0)
tests/input_files/IOTestsComparison/long_ML_SMQCD_default/gg_wmtbx/unique_id.inc (+2/-0)
tests/input_files/IOTestsComparison/long_ML_SMQCD_optimized/dux_mumvmxg/CT_interface.f (+2/-1)
tests/input_files/IOTestsComparison/long_ML_SMQCD_optimized/dux_mumvmxg/TIR_interface.f (+11/-4)
tests/input_files/IOTestsComparison/long_ML_SMQCD_optimized/dux_mumvmxg/check_sa.f (+2/-0)
tests/input_files/IOTestsComparison/long_ML_SMQCD_optimized/dux_mumvmxg/loop_matrix.f (+111/-10)
tests/input_files/IOTestsComparison/long_ML_SMQCD_optimized/dux_mumvmxg/unique_id.inc (+2/-0)
tests/input_files/IOTestsComparison/long_ML_SMQCD_optimized/gg_wmtbx/CT_interface.f (+2/-1)
tests/input_files/IOTestsComparison/long_ML_SMQCD_optimized/gg_wmtbx/TIR_interface.f (+11/-4)
tests/input_files/IOTestsComparison/long_ML_SMQCD_optimized/gg_wmtbx/check_sa.f (+2/-0)
tests/input_files/IOTestsComparison/long_ML_SMQCD_optimized/gg_wmtbx/loop_matrix.f (+111/-10)
tests/input_files/IOTestsComparison/long_ML_SMQCD_optimized/gg_wmtbx/unique_id.inc (+2/-0)
tests/input_files/IOTestsComparison/short_ML_SMQCD_LoopInduced/gg_hh/check_sa.f (+2/-0)
tests/input_files/IOTestsComparison/short_ML_SMQCD_LoopInduced/gg_hh/unique_id.inc (+2/-0)
tests/input_files/IOTestsComparison/short_ML_SMQCD_default/ddx_ttx/check_sa.f (+2/-0)
tests/input_files/IOTestsComparison/short_ML_SMQCD_default/ddx_ttx/unique_id.inc (+2/-0)
tests/input_files/IOTestsComparison/short_ML_SMQCD_default/gg_ttx/check_sa.f (+2/-0)
tests/input_files/IOTestsComparison/short_ML_SMQCD_default/gg_ttx/unique_id.inc (+2/-0)
tests/input_files/IOTestsComparison/short_ML_SMQCD_optimized/ddx_ttx/CT_interface.f (+2/-1)
tests/input_files/IOTestsComparison/short_ML_SMQCD_optimized/ddx_ttx/TIR_interface.f (+11/-4)
tests/input_files/IOTestsComparison/short_ML_SMQCD_optimized/ddx_ttx/check_sa.f (+2/-0)
tests/input_files/IOTestsComparison/short_ML_SMQCD_optimized/ddx_ttx/loop_matrix.f (+111/-10)
tests/input_files/IOTestsComparison/short_ML_SMQCD_optimized/ddx_ttx/unique_id.inc (+2/-0)
tests/input_files/IOTestsComparison/short_ML_SMQCD_optimized/gg_ttx/CT_interface.f (+2/-1)
tests/input_files/IOTestsComparison/short_ML_SMQCD_optimized/gg_ttx/TIR_interface.f (+11/-4)
tests/input_files/IOTestsComparison/short_ML_SMQCD_optimized/gg_ttx/check_sa.f (+2/-0)
tests/input_files/IOTestsComparison/short_ML_SMQCD_optimized/gg_ttx/loop_matrix.f (+111/-10)
tests/input_files/IOTestsComparison/short_ML_SMQCD_optimized/gg_ttx/unique_id.inc (+2/-0)
tests/parallel_tests/test_ML5.py (+1/-2)
tests/time_db (+230/-229)
tests/unit_tests/iolibs/test_export_v4.py (+6/-3)
vendor/CutTools/src/avh/avh_olo.f90 (+425/-425)
vendor/CutTools/src/cts/cts_cutroutines.f90 (+1/-1)
vendor/CutTools/src/cts/cts_cuttools.f90 (+2/-2)
vendor/CutTools/src/cts/cts_loopfunctions.f90 (+2/-2)
vendor/IREGI/src/makefile_ML5_lib (+11/-8)
vendor/IREGI/src/mis_warp.f90 (+1/-1)
vendor/IREGI/src/oneloop/ONI/example/example.f (+4/-4)
vendor/IREGI/src/oneloop/avh_olo_foriregi.f90 (+11045/-0)
vendor/IREGI/src/oneloop/example/example.f (+4/-4)
vendor/IREGI/src/oneloop/example_arprec/f_test.f (+4/-4)
vendor/IREGI/src/oneloop/example_ddfun90/example.f (+4/-4)
vendor/IREGI/src/oneloop/example_mpfun90/example.f (+4/-4)
vendor/IREGI/src/oneloop/example_qdcpp/f_test.f (+4/-4)
vendor/IREGI/src/oneloop/src/avh_olo_a0.h90 (+1/-1)
vendor/IREGI/src/oneloop/src/avh_olo_an.h90 (+1/-1)
vendor/IREGI/src/oneloop/src/avh_olo_arprec.f90 (+3/-3)
vendor/IREGI/src/oneloop/src/avh_olo_arrays.f90 (+3/-3)
vendor/IREGI/src/oneloop/src/avh_olo_auxfun.f90 (+3/-3)
vendor/IREGI/src/oneloop/src/avh_olo_b0.h90 (+1/-1)
vendor/IREGI/src/oneloop/src/avh_olo_b11.h90 (+1/-1)
vendor/IREGI/src/oneloop/src/avh_olo_bn.h90 (+1/-1)
vendor/IREGI/src/oneloop/src/avh_olo_bnlog.f90 (+7/-7)
vendor/IREGI/src/oneloop/src/avh_olo_box.f90 (+7/-7)
vendor/IREGI/src/oneloop/src/avh_olo_boxc.f90 (+6/-6)
vendor/IREGI/src/oneloop/src/avh_olo_bub.f90 (+6/-6)
vendor/IREGI/src/oneloop/src/avh_olo_c0.h90 (+2/-2)
vendor/IREGI/src/oneloop/src/avh_olo_comb.f90 (+25/-25)
vendor/IREGI/src/oneloop/src/avh_olo_d0.h90 (+2/-2)
vendor/IREGI/src/oneloop/src/avh_olo_ddfun90.f90 (+2/-2)
vendor/IREGI/src/oneloop/src/avh_olo_dilog.f90 (+8/-8)
vendor/IREGI/src/oneloop/src/avh_olo_intrinsic.f90 (+3/-3)
vendor/IREGI/src/oneloop/src/avh_olo_kinds.f90 (+1/-1)
vendor/IREGI/src/oneloop/src/avh_olo_main.f90 (+9/-9)
vendor/IREGI/src/oneloop/src/avh_olo_mpfun90.f90 (+3/-3)
vendor/IREGI/src/oneloop/src/avh_olo_olog.f90 (+6/-6)
vendor/IREGI/src/oneloop/src/avh_olo_print.f90 (+2/-2)
vendor/IREGI/src/oneloop/src/avh_olo_qdcpp.f90 (+2/-2)
vendor/IREGI/src/oneloop/src/avh_olo_qmplx.f90 (+6/-6)
vendor/IREGI/src/oneloop/src/avh_olo_tri.f90 (+6/-6)
vendor/IREGI/src/oneloop/src/avh_olo_units.f90 (+1/-1)
vendor/IREGI/src/oneloop/src/avh_olo_version.f90 (+1/-1)
vendor/IREGI/src/oneloop/src/avh_olo_wrp01.f90 (+14/-14)
To merge this branch: bzr merge lp:~maddevelopers/mg5amcnlo/COLLIER
Reviewer Review Type Date Requested Status
Olivier Mattelaer Needs Fixing
marco zaro Pending
Rikkert Frederix Pending
davide.pagani.85 Pending
Hua-Sheng Shao Pending
Review via email: mp+295787@code.launchpad.net

This proposal has been superseded by a proposal from 2016-06-24.

Description of the change

This branch introduces the longed-for interface to COLLIER!

All tests pass (incl. the comparison with the multitude of benchmark processes) and MG5aMC user can now effortlessly use COLLIER for all the applications that can involve MadLoop.

So please give it a try simply by running a couple of loop processes with different setup, and after having installed COLLIER with

MG5_aMC> install collier

Regarding performances, COLLIER holds up to its promises (when properly using its global caching system). I compiled a tex document that summarizes the profiling I did so far:

https://drive.google.com/open?id=0By4qXx23HZGESkU2c0RMQ0J1RGs

In summary, we observe that:

a) COLLIER is faster than CutTools but slower than Ninja, although one must keep in mind that Ninja's timings must be doubled in practice for the stability test.

b) COLLIER scales worse than integrand reduction with the rank of the loop *and its multiplicity* (and significantly so, something I had not appreciated before). This is striking when looking at the timings of the 2 > 6 process. But it is nice that the COLI branch of COLLIER has no hard limitation in rank or multiplicity.

c) COLLIER's stability is indeed astonishing! The numerical stability plots speak for themselves... And this was not even for the most difficult processes we can generate with MadLoop (see http://arxiv.org/pdf/1604.01363.pdf). However, COLLIER's internal stability assessment is quite a bit over-conservative.

Finally, there are a number of new COLLIER-related parameters that you can find at the end of the MadLoopParams.dat card (please have a look). Speaking of which, notice that I decided to change the default value of the following three existing MadLoop parameters starting from this version:

    a) NRotationsDP 1-> 0
       We have been using that for quite some time and it doubles
       MadLoop runtime. I think we now have enough confidence in the
       loop direction stability test to drop it.

    b) COLLIERUseInternalStabilityTest False -> True
       Even though for complicated processes this test seems to
       overshoot the actual stability by up to 5 digits, it seems to never
       undershoots it, so it is safe to rely on it and it comes in at no
       additional computational time.
       So we can use it and if at some point too many unstable PS point show
       (but that should almost never occur) with COLLIER, then we can turn this off
       and fall back on the loop-direction stability test instead.

    c) UseQPIntegrandForNinja False -> True
       For complicated processes where a lot of points need stability rescuing
       with Ninja, it turns out that quad. prec. in the integrand can
       significantly increases the accuracy (up to 4-5 digits), so it
       is actually better to leave this on, especially since we
       now have COLLIER first.

Let me know your comments/questions on the above, the interface and the code if you want to look at it.

Cheers

To post a comment you must log in.
Revision history for this message
Olivier Mattelaer (olivier-mattelaer) wrote :

Hi Valentin,

This is so cool.
I did not have the time to check yet but this is some first comment:

1) I would refrain to include this in 2.4.1, mainly because I want to have that version as bug fix only and be released very very soon (in max two weeks).

2) I do not understand the reason "UseQPIntegrandForNinja False -> True". You said "especially since we now have COLLIER first." This is actually not really True 99% of the user will not install collier and your option should reflect that scenario (or you update your option according to the tool available which can be really interesting.

Cheers,

Olivier

Revision history for this message
Valentin Hirschi (valentin-hirschi) wrote :

Hi Olivier,

On Thu, May 26, 2016 at 2:03 AM, Olivier Mattelaer <
<email address hidden>> wrote:

> Hi Valentin,
>
> This is so cool.
> I did not have the time to check yet but this is some first comment:
>
> 1) I would refrain to include this in 2.4.1, mainly because I want to have
> that version as bug fix only and be released very very soon (in max two
> weeks).
>

I understand. But I think that this implementation is fairly robust as it
doesn't modify anything else except MadLoop's output (to the exception of
the 'unique_id' additional option to generate_subrpocess_v4).
But still, I understand if you would rather delay it, just for safety; I'm
ok with this.

> 2) I do not understand the reason "UseQPIntegrandForNinja False -> True".
> You said "especially since we now have COLLIER first." This is actually not
> really True 99% of the user will not install collier and your option should
> reflect that scenario (or you update your option according to the tool
> available which can be really interesting.
>

I will have COLLIER installed by default from a local copy that can then be
updated at any point by the user from the online tarball using the command
'install collier'. (I'll ask D&D for their consent on this first, event
though the tool is public, just to be politically correct). Basically, the
same strategy as I used for Ninja.
And COLLIER has *no dependence*, is in plain fortran90 and only needs a
minute or so to install. So yes, everybody will have it :).

Regarding the order, I think I want to still keep Ninja first, then
followed by COLLIER and finally CutTools (though it should almost never get
there anymore).

Cheers,

>
> Cheers,
>
> Olivier
>
>
> --
> https://code.launchpad.net/~maddevelopers/mg5amcnlo/COLLIER/+merge/295787
> Your team MadDevelopers is subscribed to branch
> lp:~maddevelopers/mg5amcnlo/2.4.1.
>

--
Valentin

lp:~maddevelopers/mg5amcnlo/COLLIER updated
423. By Valentin Hirschi

1. Fixed a small issue in the check profile function.

424. By Valentin Hirschi

1. Added '--collier_mode=' option to the checks.
2. Fixed the propagation of COLLIER's internal numerical accuracy error estimate.

425. By Valentin Hirschi

1. Improved the propagation of COLLIER accuracy internal estimate which now only falls 1 order of magnitude short typically.

426. By Valentin Hirschi

1. Added local automatic installation of COLLIER.
2. 'Fixed' rank 7+ reduction by COLLIER by turning off all caches system temporarily.

Revision history for this message
Olivier Mattelaer (olivier-mattelaer) wrote :

Hi Valentin,

I wanted to start this review today. But I was stop quickly:

Enter COLLIER directory and installing COLLIER
/Users/omatt/Documents/eclipse/COLLIER/HEPTools/HEPToolsInstallers/installCOLLIER.sh: line 14: cmake: command not found
make: *** No targets specified and no makefile found. Stop.
Copying the static library and modules generated to target directory
cp: libcollier.a: No such file or directory
cp: modules/*.mod: No such file or directory
Finished installing COLLIER

Cheers,

Olivier

review: Needs Fixing
lp:~maddevelopers/mg5amcnlo/COLLIER updated
427. By Valentin Hirschi

1. Added the automatic installation of the dependency 'cmake' of COLLIER if necessary.

428. By Valentin Hirschi

1. Added LARS's fix to COLLIER for rank 7+
2. Completely isolated the OneLOop of IREGI and CutTools so as to prevent interferences with other reduction tools using OneLOop.

429. By Valentin Hirschi

1. Fixed BinothLHA.f

430. By Valentin Hirschi

1.

431. By Valentin Hirschi

1. Merged with latest version 2.4.3

432. By Valentin Hirschi

1. Added comments and updated the Offline HEPTools installer.

433. By Valentin Hirschi

1. Changed the default value of the ML reduction order to 6|7|1.

434. By Valentin Hirschi

1. Fixed IOTests and default config tests.

435. By Valentin Hirschi

1. Merged with latest 2.4.3

436. By Valentin Hirschi

1. Fixed an issue in the compilation of SMWidth
2. Updated all IOTest to correspond to a setup without Ninja Quad prec. We will do so until clang releases a version supporting __float128 (and quadmath in general).

437. By Valentin Hirschi

1. Reinstated the 'wrong' loop_MSSM for parallel tests, but only in the input_files.
2. Merged with latest version of 2.4.3.

Unmerged revisions

437. By Valentin Hirschi

1. Reinstated the 'wrong' loop_MSSM for parallel tests, but only in the input_files.
2. Merged with latest version of 2.4.3.

436. By Valentin Hirschi

1. Fixed an issue in the compilation of SMWidth
2. Updated all IOTest to correspond to a setup without Ninja Quad prec. We will do so until clang releases a version supporting __float128 (and quadmath in general).

435. By Valentin Hirschi

1. Merged with latest 2.4.3

434. By Valentin Hirschi

1. Fixed IOTests and default config tests.

433. By Valentin Hirschi

1. Changed the default value of the ML reduction order to 6|7|1.

432. By Valentin Hirschi

1. Added comments and updated the Offline HEPTools installer.

431. By Valentin Hirschi

1. Merged with latest version 2.4.3

430. By Valentin Hirschi

1.

429. By Valentin Hirschi

1. Fixed BinothLHA.f

428. By Valentin Hirschi

1. Added LARS's fix to COLLIER for rank 7+
2. Completely isolated the OneLOop of IREGI and CutTools so as to prevent interferences with other reduction tools using OneLOop.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'MadSpin/decay.py'
2--- MadSpin/decay.py 2016-06-08 20:19:53 +0000
3+++ MadSpin/decay.py 2016-06-24 21:04:21 +0000
4@@ -1224,6 +1224,7 @@
5 'P%s' % me.get('processes')[0].shell_string())
6 topo['decays'] = []
7 topo['total_br'] = 0
8+ topo['Pid'] = proc.get('id')
9
10 if skip:
11 self.add_me_symmetric(skip, topo)
12@@ -2115,7 +2116,7 @@
13 # launch the decay and reweighting
14 self.mscmd.update_status('MadSpin: Decaying Events')
15 efficiency = self.decaying_events(self.inverted_decay_mapping)
16- if efficiency != 1:
17+ if efficiency != 1 and any(v==-1 for v in self.br_per_id.values()):
18 # need to change the banner information [nb_event/cross section]
19 files.cp(self.outputfile.name, '%s_tmp' % self.outputfile.name)
20 self.outputfile = open(self.outputfile.name, 'w')
21@@ -2685,13 +2686,13 @@
22 proc_nb = '@ %i' % proc_nb
23 else:
24 proc_nb = ''
25-
26+
27 if ',' in proc:
28 raise MadSpinError, 'MadSpin can not decay event which comes from a decay chain.'+\
29 '\n The full decay chain should either be handle by MadGraph or by Masdspin.'
30
31 if '[' not in proc:
32- commandline+="add process %s --no_warning=duplicate;" % proc
33+ commandline+="add process %s %s --no_warning=duplicate;" % (proc, proc_nb)
34 else:
35 process, order, final = re.split('\[\s*(.*)\s*\]', proc)
36 commandline+="add process %s %s --no_warning=duplicate;" % (process, proc_nb)
37@@ -2723,6 +2724,7 @@
38 commandline +='add process %s pert_%s %s --no_warning=duplicate;' % (process,order, proc_nb)
39 commandline = commandline.replace('add process', 'generate',1)
40 logger.info(commandline)
41+
42 mgcmd.exec_cmd(commandline, precmd=True)
43 commandline = 'output standalone_msP %s %s' % \
44 (pjoin(path_me,'production_me'), ' '.join(self.list_branches.keys()))
45@@ -3876,16 +3878,24 @@
46 ms_banner = ""
47 cross_section = True # tell if possible to write the cross-section in advance
48 total_br = []
49+ self.br_per_id = {}
50 for production in self.all_ME.values():
51 one_br = 0
52+ partial_br = 0
53 for decay in production['decays']:
54 if not decay['decay_tag']:
55 cross_section = False
56 one_br += decay['br']
57 continue
58+ partial_br += decay['br']
59 ms_banner += "# %s\n" % ','.join(decay['decay_tag']).replace('\n',' ')
60 ms_banner += "# BR: %s\n# max_weight: %s\n" % (decay['br'], decay['max_weight'])
61 one_br += decay['br']
62+
63+ if production['Pid'] not in self.br_per_id:
64+ self.br_per_id[production['Pid']] = partial_br
65+ elif self.br_per_id[production['Pid']] != partial_br:
66+ self.br_per_id[production['Pid']] = -1
67 total_br.append(one_br)
68
69 if __debug__:
70@@ -3893,7 +3903,6 @@
71 assert production['total_br'] - min(total_br) < 1e-4
72
73 self.branching_ratio = max(total_br) * eff
74-
75 #self.banner['madspin'] += ms_banner
76 # Update cross-section in the banner
77 if 'mggenerationinfo' in self.banner:
78@@ -3924,18 +3933,29 @@
79 mg_info[i] = '%s : %s' % (info, value * self.branching_ratio)
80 self.banner['mggenerationinfo'] = '\n'.join(mg_info)
81
82-
83-
84- if 'init' in self.banner:
85+
86+ if 'init' in self.banner and (eff!=1 or not any(v==-1 for v in self.br_per_id.values())):
87 new_init =''
88+ curr_proc = 0
89+ has_missing=False
90 for line in self.banner['init'].split('\n'):
91 if len(line.split()) != 4:
92 new_init += '%s\n' % line
93 else:
94+ curr_proc += 1
95 data = [float(nb) for nb in line.split()]
96- data[:3] = [ data[i] * self.branching_ratio for i in range(3)]
97+ id = int(data[-1])
98+ if id in self.br_per_id and not any(v==-1 for v in self.br_per_id.values()):
99+ data[:3] = [data[i] * self.br_per_id[id] for i in range(3)]
100+ else:
101+ data[:3] = [ data[i] * self.branching_ratio for i in range(3)]
102+ has_missing=True
103 new_init += ' %.12E %.12E %.12E %i\n' % tuple(data)
104 self.banner['init'] = new_init
105+ if has_missing and curr_proc not in [0,1]:
106+ logger.warning('''The partial cross section for each subprocess can not be determine. due
107+ Reason: multiple final state in the same subprocess (and the presence of multiple BR)
108+ Consequence: the <init> information of the lhe will therefore be incorrect. Please correct it if needed.''')
109 self.banner.write(self.outputfile, close_tag=False)
110
111 def terminate_fortran_executables(self, path_to_decay=0 ):
112
113=== modified file 'Template/LO/Source/make_opts'
114--- Template/LO/Source/make_opts 2016-06-10 16:31:39 +0000
115+++ Template/LO/Source/make_opts 2016-06-24 21:04:21 +0000
116@@ -1,9 +1,9 @@
117 DEFAULT_F2PY_COMPILER=f2py
118 DEFAULT_F_COMPILER=gfortran
119-MACFLAG=-mmacosx-version-min=10.7
120-DEFAULT_CPP_COMPILER=clang
121-STDLIB=-lc++
122-STDLIB_FLAG=-stdlib=libc++
123+MACFLAG=
124+DEFAULT_CPP_COMPILER=g++
125+STDLIB=-lstdc++
126+STDLIB_FLAG=
127 #end_of_make_opts_variables
128 # Rest of the makefile
129
130
131=== modified file 'Template/LO/SubProcesses/genps.f'
132--- Template/LO/SubProcesses/genps.f 2014-11-06 01:54:56 +0000
133+++ Template/LO/SubProcesses/genps.f 2016-06-24 21:04:21 +0000
134@@ -1159,7 +1159,7 @@
135
136 C IF THERE IS NO S CHANNEL POLE USE BELOW:
137
138- TAUMIN = SMIN/S
139+ TAUMIN = 0d0 !SMIN/S !keep scale fix
140 TAUMAX = 1D0
141 TAU = (TAUMAX-TAUMIN)*X(1)+TAUMIN
142 SJACOBI= sjacobi*(TAUMAX-TAUMIN)
143
144=== modified file 'Template/LO/SubProcesses/myamp.f'
145--- Template/LO/SubProcesses/myamp.f 2016-04-13 13:49:42 +0000
146+++ Template/LO/SubProcesses/myamp.f 2016-06-24 21:04:21 +0000
147@@ -606,7 +606,7 @@
148 c-----------------------
149 if (swidth(i) .eq. 0d0) then
150 if (xo.lt.smin/stot)then
151- xo = -1d0*smin/stot
152+ xo = 1d0*smin/stot
153 endif
154 swidth(i) = xo
155 spole(i)= -2.0d0 ! 1/s pole
156
157=== modified file 'Template/LO/SubProcesses/refine.sh'
158--- Template/LO/SubProcesses/refine.sh 2015-05-22 18:00:40 +0000
159+++ Template/LO/SubProcesses/refine.sh 2016-06-24 21:04:21 +0000
160@@ -8,7 +8,12 @@
161 if [[ -e MadLoop5_resources.tar.gz && ! -e MadLoop5_resources ]]; then
162 tar -xzf MadLoop5_resources.tar.gz
163 fi
164-k=%(name)s_app.log
165+keeplog=%(keeplog)s
166+if [ "$keeplog" = true ] ; then
167+ k=%(name)s_app.log
168+else
169+ k=/dev/null
170+fi
171 script=%(script_name)s
172
173 grid_directory=%(base_directory)s
174@@ -24,9 +29,10 @@
175 fi
176 fi
177 fi
178-
179 cd $j
180- rm -f $k
181+ if [ "$keeplog" = true ] ; then
182+ rm -f $k
183+ fi
184 rm -f moffset.dat >& /dev/null
185 echo %(offset)s > moffset.dat
186 if [[ -e ftn26 ]]; then
187@@ -50,17 +56,27 @@
188 # filesystem problem (executable not found)
189 for((try=1;try<=16;try+=1));
190 do
191- ../madevent 2>&1 >> $k <input_sg.txt | tee -a $k;
192- status_code=${PIPESTATUS[0]};
193- if [ -s $k ]
194- then
195- break
196- else
197- echo $try > fail.log
198- fi
199+ if [ "$keeplog" = true ] ; then
200+ ../madevent 2>&1 >> $k <input_sg.txt | tee -a $k;
201+ status_code=${PIPESTATUS[0]};
202+ if [ -s $k ]
203+ then
204+ break
205+ else
206+ echo $try > fail.log
207+ fi
208+ else
209+ ../madevent 2>&1 >> log.txt <input_sg.txt | tee -a log.txt;
210+ status_code=${PIPESTATUS[0]};
211+ if [ -s log.txt ]
212+ then
213+ rm log.txt
214+ break
215+ else
216+ echo $try > fail.log
217+ fi
218+ fi
219 done
220- echo "" >> $k; echo "ls status:" >> $k; ls >> $k
221- cat $k >> log.txt
222 if [[ $status_code -ne 0 ]]; then
223 rm results.dat
224 echo "ERROR DETECTED"
225@@ -69,5 +85,16 @@
226 if [[ -e ftn26 ]]; then
227 cp ftn26 ftn25
228 fi
229+
230+ if [ "$keeplog" = true ] ; then
231+ echo "" >> $k; echo "ls status:" >> $k; ls >> $k
232+ else
233+ rm ftn26 > /dev/null
234+ fi
235+
236+
237+
238+
239+
240 cd ../
241
242
243=== modified file 'Template/LO/SubProcesses/setcuts.f'
244--- Template/LO/SubProcesses/setcuts.f 2016-05-11 10:34:14 +0000
245+++ Template/LO/SubProcesses/setcuts.f 2016-06-24 21:04:21 +0000
246@@ -107,6 +107,11 @@
247 $ ,ptll_max_save,etmin_save,etmax_save,emin_save,emax_save
248 $ ,etamin_save,etamax_save
249 c
250+c count the number of j/bjet/photon/lepton
251+c
252+ integer nb_j, nb_b, nb_a, nb_l, nb_nocut
253+ double precision smin_p, smin_m ! local variable to compute smin
254+c
255 c setup masses for the final-state particles
256 c
257 include 'pmass.inc'
258@@ -133,6 +138,8 @@
259 fixed_fac_scale=.true.
260 use_syst=.false.
261 endif
262+
263+
264 c
265 c set ptj and s_min if xqcut and ktscheme = 1, to improve
266 c integration speed, and set drjj and drjl to 0.
267@@ -221,61 +228,63 @@
268 if (abs(idup(i,1,iproc)).eq.16) is_a_nu(i)=.true. ! no cuts on vt vt~
269 if (pmass(i).gt.10d0) is_heavy(i)=.true. ! heavy fs particle
270 c-onium
271- if (idup(i,1,iproc).eq.441) is_a_onium(i)=.true. ! charmonium
272- if (idup(i,1,iproc).eq.10441) is_a_onium(i)=.true. ! charmonium
273- if (idup(i,1,iproc).eq.100441) is_a_onium(i)=.true. ! charmonium
274- if (idup(i,1,iproc).eq.443) is_a_onium(i)=.true. ! charmonium
275- if (idup(i,1,iproc).eq.10443) is_a_onium(i)=.true. ! charmonium
276- if (idup(i,1,iproc).eq.20443) is_a_onium(i)=.true. ! charmonium
277- if (idup(i,1,iproc).eq.100443) is_a_onium(i)=.true. ! charmonium
278- if (idup(i,1,iproc).eq.30443) is_a_onium(i)=.true. ! charmonium
279- if (idup(i,1,iproc).eq.9000443) is_a_onium(i)=.true. ! charmonium
280- if (idup(i,1,iproc).eq.9010443) is_a_onium(i)=.true. ! charmonium
281- if (idup(i,1,iproc).eq.9020443) is_a_onium(i)=.true. ! charmonium
282- if (idup(i,1,iproc).eq.445) is_a_onium(i)=.true. ! charmonium
283- if (idup(i,1,iproc).eq.9000445) is_a_onium(i)=.true. ! charmonium
284-
285- if (idup(i,1,iproc).eq.551) is_a_onium(i)=.true. ! bottomonium
286- if (idup(i,1,iproc).eq.10551) is_a_onium(i)=.true. ! bottomonium
287- if (idup(i,1,iproc).eq.100551) is_a_onium(i)=.true. ! bottomonium
288- if (idup(i,1,iproc).eq.110551) is_a_onium(i)=.true. ! bottomonium
289- if (idup(i,1,iproc).eq.200551) is_a_onium(i)=.true. ! bottomonium
290- if (idup(i,1,iproc).eq.210551) is_a_onium(i)=.true. ! bottomonium
291- if (idup(i,1,iproc).eq.553) is_a_onium(i)=.true. ! bottomonium
292- if (idup(i,1,iproc).eq.10553) is_a_onium(i)=.true. ! bottomonium
293- if (idup(i,1,iproc).eq.20553) is_a_onium(i)=.true. ! bottomonium
294- if (idup(i,1,iproc).eq.30553) is_a_onium(i)=.true. ! bottomonium
295- if (idup(i,1,iproc).eq.100553) is_a_onium(i)=.true. ! bottomonium
296- if (idup(i,1,iproc).eq.110553) is_a_onium(i)=.true. ! bottomonium
297- if (idup(i,1,iproc).eq.120553) is_a_onium(i)=.true. ! bottomonium
298- if (idup(i,1,iproc).eq.130553) is_a_onium(i)=.true. ! bottomonium
299- if (idup(i,1,iproc).eq.200553) is_a_onium(i)=.true. ! bottomonium
300- if (idup(i,1,iproc).eq.210553) is_a_onium(i)=.true. ! bottomonium
301- if (idup(i,1,iproc).eq.220553) is_a_onium(i)=.true. ! bottomonium
302- if (idup(i,1,iproc).eq.300553) is_a_onium(i)=.true. ! bottomonium
303- if (idup(i,1,iproc).eq.9000553) is_a_onium(i)=.true. ! bottomonium
304- if (idup(i,1,iproc).eq.9010553) is_a_onium(i)=.true. ! bottomonium
305- if (idup(i,1,iproc).eq.555) is_a_onium(i)=.true. ! bottomonium
306- if (idup(i,1,iproc).eq.10555) is_a_onium(i)=.true. ! bottomonium
307- if (idup(i,1,iproc).eq.20555) is_a_onium(i)=.true. ! bottomonium
308- if (idup(i,1,iproc).eq.100555) is_a_onium(i)=.true. ! bottomonium
309- if (idup(i,1,iproc).eq.110555) is_a_onium(i)=.true. ! bottomonium
310- if (idup(i,1,iproc).eq.200555) is_a_onium(i)=.true. ! bottomonium
311- if (idup(i,1,iproc).eq.557) is_a_onium(i)=.true. ! bottomonium
312- if (idup(i,1,iproc).eq.100557) is_a_onium(i)=.true. ! bottomonium
313-
314- if (idup(i,1,iproc).eq.541) is_a_onium(i)=.true. ! Bc
315- if (idup(i,1,iproc).eq.10541) is_a_onium(i)=.true. ! Bc
316- if (idup(i,1,iproc).eq.543) is_a_onium(i)=.true. ! Bc
317- if (idup(i,1,iproc).eq.10543) is_a_onium(i)=.true. ! Bc
318- if (idup(i,1,iproc).eq.20543) is_a_onium(i)=.true. ! Bc
319- if (idup(i,1,iproc).eq.545) is_a_onium(i)=.true. ! Bc
320+c if (idup(i,1,iproc).eq.441) is_a_onium(i)=.true. ! charmonium
321+c if (idup(i,1,iproc).eq.10441) is_a_onium(i)=.true. ! charmonium
322+c if (idup(i,1,iproc).eq.100441) is_a_onium(i)=.true. ! charmonium
323+c if (idup(i,1,iproc).eq.443) is_a_onium(i)=.true. ! charmonium
324+c if (idup(i,1,iproc).eq.10443) is_a_onium(i)=.true. ! charmonium
325+c if (idup(i,1,iproc).eq.20443) is_a_onium(i)=.true. ! charmonium
326+c if (idup(i,1,iproc).eq.100443) is_a_onium(i)=.true. ! charmonium
327+c if (idup(i,1,iproc).eq.30443) is_a_onium(i)=.true. ! charmonium
328+c if (idup(i,1,iproc).eq.9000443) is_a_onium(i)=.true. ! charmonium
329+c if (idup(i,1,iproc).eq.9010443) is_a_onium(i)=.true. ! charmonium
330+c if (idup(i,1,iproc).eq.9020443) is_a_onium(i)=.true. ! charmonium
331+c if (idup(i,1,iproc).eq.445) is_a_onium(i)=.true. ! charmonium
332+c if (idup(i,1,iproc).eq.9000445) is_a_onium(i)=.true. ! charmonium
333+
334+c if (idup(i,1,iproc).eq.551) is_a_onium(i)=.true. ! bottomonium
335+c if (idup(i,1,iproc).eq.10551) is_a_onium(i)=.true. ! bottomonium
336+c if (idup(i,1,iproc).eq.100551) is_a_onium(i)=.true. ! bottomonium
337+c if (idup(i,1,iproc).eq.110551) is_a_onium(i)=.true. ! bottomonium
338+c if (idup(i,1,iproc).eq.200551) is_a_onium(i)=.true. ! bottomonium
339+c if (idup(i,1,iproc).eq.210551) is_a_onium(i)=.true. ! bottomonium
340+c if (idup(i,1,iproc).eq.553) is_a_onium(i)=.true. ! bottomonium
341+c if (idup(i,1,iproc).eq.10553) is_a_onium(i)=.true. ! bottomonium
342+c if (idup(i,1,iproc).eq.20553) is_a_onium(i)=.true. ! bottomonium
343+c if (idup(i,1,iproc).eq.30553) is_a_onium(i)=.true. ! bottomonium
344+c if (idup(i,1,iproc).eq.100553) is_a_onium(i)=.true. ! bottomonium
345+c if (idup(i,1,iproc).eq.110553) is_a_onium(i)=.true. ! bottomonium
346+c if (idup(i,1,iproc).eq.120553) is_a_onium(i)=.true. ! bottomonium
347+c if (idup(i,1,iproc).eq.130553) is_a_onium(i)=.true. ! bottomonium
348+c if (idup(i,1,iproc).eq.200553) is_a_onium(i)=.true. ! bottomonium
349+c if (idup(i,1,iproc).eq.210553) is_a_onium(i)=.true. ! bottomonium
350+c if (idup(i,1,iproc).eq.220553) is_a_onium(i)=.true. ! bottomonium
351+c if (idup(i,1,iproc).eq.300553) is_a_onium(i)=.true. ! bottomonium
352+c if (idup(i,1,iproc).eq.9000553) is_a_onium(i)=.true. ! bottomonium
353+c if (idup(i,1,iproc).eq.9010553) is_a_onium(i)=.true. ! bottomonium
354+c if (idup(i,1,iproc).eq.555) is_a_onium(i)=.true. ! bottomonium
355+c if (idup(i,1,iproc).eq.10555) is_a_onium(i)=.true. ! bottomonium
356+c if (idup(i,1,iproc).eq.20555) is_a_onium(i)=.true. ! bottomonium
357+c if (idup(i,1,iproc).eq.100555) is_a_onium(i)=.true. ! bottomonium
358+c if (idup(i,1,iproc).eq.110555) is_a_onium(i)=.true. ! bottomonium
359+c if (idup(i,1,iproc).eq.200555) is_a_onium(i)=.true. ! bottomonium
360+c if (idup(i,1,iproc).eq.557) is_a_onium(i)=.true. ! bottomonium
361+c if (idup(i,1,iproc).eq.100557) is_a_onium(i)=.true. ! bottomonium
362+
363+c if (idup(i,1,iproc).eq.541) is_a_onium(i)=.true. ! Bc
364+c if (idup(i,1,iproc).eq.10541) is_a_onium(i)=.true. ! Bc
365+c if (idup(i,1,iproc).eq.543) is_a_onium(i)=.true. ! Bc
366+c if (idup(i,1,iproc).eq.10543) is_a_onium(i)=.true. ! Bc
367+c if (idup(i,1,iproc).eq.20543) is_a_onium(i)=.true. ! Bc
368+c if (idup(i,1,iproc).eq.545) is_a_onium(i)=.true. ! Bc
369 enddo
370
371+
372+
373+
374 c
375 c et and eta cuts
376 c
377- Smin = 0d0
378 do i=nincoming+1,nexternal
379 etmin(i) = 0d0
380 etmax(i) = -1
381@@ -291,7 +300,6 @@
382 c JET
383 if(is_a_j(i))then
384 etmin(i)=ptj
385- SMIN = SMIN + max(ptj,ej)
386 etmax(i)=ptjmax
387 emin(i)=ej
388 emax(i)=ejmax
389@@ -301,7 +309,6 @@
390 c LEPTON
391 if(is_a_l(i))then
392 etmin(i)=ptl
393- SMIN = SMIN + max(ptl,el)
394 etmax(i)=ptlmax
395 emin(i)=el
396 emax(i)=elmax
397@@ -311,7 +318,6 @@
398 c BJET
399 if(is_a_b(i))then
400 etmin(i)=ptb
401- SMIN = SMIN + max(ptb,eb)
402 etmax(i)=ptbmax
403 emin(i)=eb
404 emax(i)=ebmax
405@@ -321,7 +327,6 @@
406 c PHOTON
407 if(is_a_a(i))then
408 etmin(i) = max(pta, ptgmin)
409- SMIN = SMIN + max(etmin(i),ea)
410 etmax(i)=ptamax
411 emin(i)=ea
412 emax(i)=eamax
413@@ -329,14 +334,16 @@
414 etamin(i)=etaamin
415 endif
416 c QUARKONIUM
417- if(is_a_onium(i))then
418- etmin(i)=ptonium
419- SMIN = SMIN + ptonium
420- etamax(i)=etaonium
421- endif
422+c if(is_a_onium(i))then
423+c etmin(i)=ptonium
424+c SMIN = SMIN + max(0d0,ptonium**2
425+c etamax(i)=etaonium
426+c endif
427 endif
428 enddo
429- SMIN = SMIN **2
430+
431+
432+
433 c
434 c delta r cut
435 c
436@@ -473,35 +480,166 @@
437
438
439 c
440-c Compute Smin (for efficiency
441+c Compute Smin (for efficiency purpose)
442 c
443- do i=nincoming+1,nexternal-1
444- do j=nincoming+1,nexternal-1
445- if(j.lt.i)then
446- s_min(i,j) = max(s_min(j,i),s_min(i,j))
447- else
448- smin=0.0d0**2
449-
450- if(do_cuts(i).and.do_cuts(j)) then
451- if(is_a_j(i).and.is_a_j(j)) s_min(j,i)=mmjj*dabs(mmjj)
452- if(is_a_a(i).and.is_a_a(j)) s_min(j,i)=mmaa*dabs(mmaa)
453- if( is_a_b(i).and.is_a_b(j) ) s_min(j,i)=mmbb*dabs(mmbb)
454- if((is_a_l(i).and.is_a_l(j)).and.
455- & (abs(idup(i,1,iproc)).eq.abs(idup(j,1,iproc))).and.
456- & (idup(i,1,iproc)*idup(j,1,iproc).lt.0))
457- & s_min(j,i)=mmll*dabs(mmll) !only on l+l- pairs (same flavour)
458-
459- if(is_a_j(i).and.is_a_j(j)) s_max(j,i)=mmjjmax*dabs(mmjjmax)
460- if(is_a_a(i).and.is_a_a(j)) s_max(j,i)=mmaamax*dabs(mmaamax)
461- if( is_a_b(i).and.is_a_b(j) ) s_max(j,i)=mmbbmax*dabs(mmbbmax)
462- if((is_a_l(i).and.is_a_l(j)).and.
463- & (abs(idup(i,1,iproc)).eq.abs(idup(j,1,iproc))).and.
464- & (idup(i,1,iproc)*idup(j,1,iproc).lt.0))
465- & s_max(j,i)=mmllmax*dabs(mmllmax) !only on l+l- pairs (same flavour)
466- endif
467- endif
468- enddo
469- enddo
470+ smin = 0d0
471+c check for the jet
472+ smin_m = 0d0
473+ smin_p = 0d0
474+ nb_j = 0
475+ nb_nocut = 0
476+ do i=nincoming+1,nexternal
477+ if (is_a_j(i)) then
478+ nb_j = nb_j + 1
479+ smin_m = smin_m - pmass(i)**2
480+ if (do_cuts(i))then
481+ if (nb_j.eq.1) then
482+ smin_p = smin_p + max(ej,ptj,xptj,0d0,
483+ & max(ptj1min,ptj2min,ptj3min,ptj4min))
484+ elseif(nb_j.eq.2) then
485+ smin_p = max(ht2min, smin_p + max(ej,ptj,0d0,
486+ & max(ptj2min,ptj3min,ptj4min)))
487+ elseif(nb_j.eq.3) then
488+ smin_p = max(ht3min, smin_p + max(ej,ptj,0d0,
489+ & max(ptj3min,ptj4min)))
490+ elseif(nb_j.eq.4) then
491+ smin_p = max(ht4min, smin_p + max(ej,ptj,ptj4min,0d0))
492+ else
493+ smin_p = smin_p + max(ej,ptj,0d0)
494+ endif
495+ else
496+ nb_nocut = nb_nocut + 1
497+ if (nb_j.eq.1) then
498+ smin_p = smin_p + max(0d0,ptj1min,ptj2min,ptj3min,ptj4min)
499+ elseif(nb_j.eq.2) then
500+ smin_p = max(ht2min, smin_p + max(ptj2min,ptj3min,ptj4min,0d0))
501+ elseif(nb_j.eq.3) then
502+ smin_p = max(ht3min, smin_p + max(0d0,ptj3min,ptj4min))
503+ elseif(nb_j.eq.4) then
504+ smin_p = max(ht4min, smin_p + max(ptj4min,0d0))
505+ endif
506+ endif
507+ endif
508+ enddo
509+ if (nb_j.gt.0)then
510+ if ((nb_j-nb_nocut).gt.0)then
511+ smin_m = smin_m + (nb_j-nb_nocut)*(nb_j-nb_nocut-1)/2d0*mmjj**2
512+ endif
513+ smin = smin + max(smin_p**2, smin_m, htjmin**2)
514+ endif
515+c check for the bjet
516+ smin_m = 0d0
517+ smin_p = 0d0
518+ nb_b = 0
519+ nb_nocut = 0
520+ do i=nincoming+1,nexternal
521+ if (is_a_b(i).and.do_cuts(i)) then
522+ nb_b = nb_b + 1
523+ smin_m = smin_m - pmass(i)**2
524+ if (do_cuts(i)) then
525+ if (nb_b.eq.1) then
526+ smin_p = smin_p + max(eb,ptb,xptb,0d0)
527+ else
528+ smin_p = smin_p + max(eb,ptb,0d0)
529+ endif
530+ else
531+ nb_nocut = nb_nocut +1
532+ if (nb_b.eq.1) then
533+ smin_p = smin_p + max(xptb,0d0)
534+ endif
535+ endif
536+ endif
537+ enddo
538+ if (nb_b.gt.0)then
539+ if ((nb_b-nb_nocut).gt.0) then
540+ smin_m = smin_m + (nb_b-nb_nocut)*(nb_b-nb_nocut-1)/2d0*mmbb**2
541+ endif
542+ smin = smin + max(smin_p**2, smin_m, (ihtmin**2-htjmin**2))
543+ endif
544+c check for the photon
545+ smin_m = 0d0
546+ smin_p = 0d0
547+ nb_a = 0
548+ nb_nocut = 0
549+ do i=nincoming+1,nexternal
550+ if (is_a_a(i))then
551+ nb_a = nb_a + 1
552+ if (do_cuts(i))then
553+ if (ptgmin.eq.0d0) then
554+ if (nb_a.eq.1) then
555+ smin_p = smin_p + max(ea,pta,xpta,0d0)
556+ else
557+ smin_p = smin_p + max(ea,pta,0d0)
558+ endif
559+ endif
560+ else
561+ nb_nocut = nb_nocut + 1
562+ if(ptgmin.eq.0d0)then
563+ if (nb_a.eq.1) then
564+ smin_p = smin_p + max(xpta,0d0)
565+ endif
566+ endif
567+ endif
568+ endif
569+ enddo
570+ if (nb_a.gt.0) then
571+ if ((nb_a-nb_nocut).gt.0)then
572+ smin_m = (nb_a-nb_nocut)*(nb_a-nb_nocut-1)/2d0*mmaa**2
573+ endif
574+ smin = smin + max(smin_p**2, smin_m)
575+ endif
576+c check for lepton
577+ smin_m = 0d0
578+ smin_p = 0d0
579+ nb_l = 0
580+ nb_nocut = 0
581+ do i=nincoming+1,nexternal-1
582+ if (is_a_l(i))then
583+ nb_l = nb_l + 1
584+ smin_m = smin_m - pmass(i)**2
585+ if (do_cuts(i))then
586+ if (nb_l.eq.1) then
587+ smin_p = smin_p + max(el,ptl,xptl,0d0,
588+ & max(ptl1min,ptl2min,ptl3min,ptl4min))
589+ elseif(nb_l.eq.2) then
590+ smin_p = smin_p + max(el,ptl,0d0,max(ptl2min,ptl3min,ptl4min))
591+ elseif(nb_l.eq.3) then
592+ smin_p = smin_p + max(el,ptl,0d0, max(ptl3min,ptl4min))
593+ elseif(nb_l.eq.4) then
594+ smin_p = smin_p + max(el,ptl,ptl4min,0d0)
595+ else
596+ smin_p = smin_p + max(el,ptl,0d0)
597+ endif
598+ else
599+ nb_nocut = nb_nocut + 1
600+ if (nb_l.eq.1) then
601+ smin_p = smin_p + max(xptl,0d0,
602+ & max(ptl1min,ptl2min,ptl3min,ptl4min))
603+ elseif(nb_l.eq.2) then
604+ smin_p = smin_p + max(0d0,ptl2min,ptl3min,ptl4min)
605+ elseif(nb_l.eq.3) then
606+ smin_p = smin_p + max(0d0,ptl3min,ptl4min)
607+ elseif(nb_l.eq.4) then
608+ smin_p = smin_p + max(ptl4min,0d0)
609+ endif
610+ endif
611+ endif
612+ enddo
613+ if (nb_l.gt.0)then
614+ if ((nb_l-nb_nocut).gt.0)then
615+ smin_m = smin_m + (nb_l-nb_nocut)*((nb_l-nb_nocut)-1)/2d0*mmll**2
616+ endif
617+ smin = smin + max(smin_p**2, smin_m, mmnl**2, ptllmin**2, misset**2)
618+ endif
619+c ensure symmetry of s_min(i,j)
620+ do i=nincoming+1,nexternal-1
621+ do j=nincoming+1,nexternal-1
622+ if(j.lt.i)then
623+ s_min(i,j) = max(s_min(j,i),s_min(i,j))
624+ endif
625+ enddo
626+ enddo
627+ write(*,*) "Define smin to", smin
628
629 c Check that results are consistent among all the grouped subprocesses
630
631
632=== modified file 'Template/NLO/SubProcesses/BinothLHA.f'
633--- Template/NLO/SubProcesses/BinothLHA.f 2016-03-02 09:31:23 +0000
634+++ Template/NLO/SubProcesses/BinothLHA.f 2016-06-24 21:04:21 +0000
635@@ -85,6 +85,8 @@
636 c itself again to perform stability check to make sure no unstable EPS
637 c splips unnoticed.
638 CALL FORCE_STABILITY_CHECK(.TRUE.)
639+ CALL COLLIER_COMPUTE_UV_POLES(.FALSE.)
640+ CALL COLLIER_COMPUTE_IR_POLES(.FALSE.)
641 firsttime_run = .false.
642 endif
643 if (firsttime) then
644@@ -102,6 +104,7 @@
645 c Just set the accuracy found to a positive value as it is not specified
646 c once the initial pole check is performed.
647 if (mc_hel.eq.0) then
648+
649 call sloopmatrix_thres(p,virt_wgts,tolerance,accuracies
650 $ ,ret_code)
651 prec_found = accuracies(0)
652@@ -164,18 +167,19 @@
653 c MadLoop initialization PS points.
654 cpol=.false.
655 if ((firsttime .or. mc_hel.eq.0) .and. mod(ret_code,100)/10.ne.3
656- $ .and. mod(ret_code,100)/10.ne.4) then
657+ $ .and. mod(ret_code,100)/10.ne.4) then
658 call getpoles(p,QES2,madfks_double,madfks_single,fksprefact)
659 avgPoleRes(1)=(single+madfks_single)/2.0d0
660 avgPoleRes(2)=(double+madfks_double)/2.0d0
661 PoleDiff(1)=dabs(single - madfks_single)
662 PoleDiff(2)=dabs(double - madfks_double)
663 if ((dabs(avgPoleRes(1))+dabs(avgPoleRes(2))).ne.0d0) then
664- cpol = .not. (((PoleDiff(1)+PoleDiff(2))/
665+ cpol = .not. ((((PoleDiff(1)+PoleDiff(2))/
666 $ (dabs(avgPoleRes(1))+dabs(avgPoleRes(2)))) .lt.
667- $ tolerance*10d0)
668+ $ tolerance*10d0).or.(mod(ret_code,10).eq.7))
669 else
670- cpol = .not.(PoleDiff(1)+PoleDiff(2).lt.tolerance*10d0)
671+ cpol = .not.((PoleDiff(1)+PoleDiff(2).lt.tolerance*10d0).or.
672+ $ (mod(ret_code,10).eq.7))
673 endif
674 if (tolerance.lt.0.0d0) then
675 cpol = .false.
676
677=== modified file 'Template/NLO/SubProcesses/check_poles.f'
678--- Template/NLO/SubProcesses/check_poles.f 2016-03-02 09:31:23 +0000
679+++ Template/NLO/SubProcesses/check_poles.f 2016-06-24 21:04:21 +0000
680@@ -116,6 +116,8 @@
681 c Make sure that stability checks are always used by MadLoop, even for
682 c initialization
683 CALL FORCE_STABILITY_CHECK(.TRUE.)
684+ CALL COLLIER_COMPUTE_UV_POLES(.TRUE.)
685+ CALL COLLIER_COMPUTE_IR_POLES(.TRUE.)
686
687 200 continue
688 calculatedborn = .false.
689
690=== modified file 'Template/NLO/SubProcesses/makefile_loop.inc'
691--- Template/NLO/SubProcesses/makefile_loop.inc 2016-03-02 03:03:20 +0000
692+++ Template/NLO/SubProcesses/makefile_loop.inc 2016-06-24 21:04:21 +0000
693@@ -24,6 +24,7 @@
694 $(patsubst %(dotf)s,%(doto)s,$(wildcard mp_coef_construction_*.f)) \
695 $(patsubst %(dotf)s,%(doto)s,$(wildcard TIR_interface.f)) \
696 $(patsubst %(dotf)s,%(doto)s,$(wildcard GOLEM_interface.f)) \
697+ $(patsubst %(dotf)s,%(doto)s,$(wildcard COLLIER_interface.f)) \
698 $(patsubst %(dotf)s,%(doto)s,$(wildcard compute_color_flows.f))
699
700 # This is the core of madloop computationally wise, so make sure to turn optimizations on and bound checks off.
701
702=== modified file 'Template/loop_material/StandAlone/Cards/MadLoopParams.dat'
703--- Template/loop_material/StandAlone/Cards/MadLoopParams.dat 2016-04-06 10:19:13 +0000
704+++ Template/loop_material/StandAlone/Cards/MadLoopParams.dat 2016-06-24 21:04:21 +0000
705@@ -4,8 +4,8 @@
706
707 !
708 #MLReductionLib
709-!6|1|2
710-! Default :: 6|1|2
711+!7|6|1|2
712+! Default :: 7|6|1|2
713 ! The tensor integral reduction library.The current choices are:
714 ! 1 | CutTools
715 ! 2 | PJFry++
716@@ -13,6 +13,7 @@
717 ! 4 | Golem95
718 ! 5 | Samurai
719 ! 6 | Ninja
720+! 7 | COLLIER
721 ! One can use the combinations to reduce integral,e.g.
722 ! 1|2|3 means first use CutTools, if it is not stable, use PJFry++,
723 ! if it is still unstable, use IREGI. If it failed, use QP of CutTools.
724@@ -22,15 +23,15 @@
725 ! When using quadruple precision with Ninja or CutTools, the reduction will
726 ! always be done in quadruple precision, but the parameters below allow you to
727 ! chose if you want to also recompute the *integrand* in quadruple precision.
728-! Doing so is slow and typically does not improve the accuracy for Ninja, so it
729-! is disabled by default in this case.
730+! Doing so is slow but might improve the accuracy in some situation.
731 #UseQPIntegrandForCutTools
732 !.TRUE.
733 ! Default :: .TRUE.
734 #UseQPIntegrandForNinja
735-!.FALSE.
736-! Default :: .FALSE.
737+!.TRUE.
738+! Default :: .TRUE.
739 !
740+
741 ! =================================================================================
742 ! The parameters below set the parameters for IREGI
743 ! =================================================================================
744@@ -38,9 +39,9 @@
745 #IREGIMODE
746 !2
747 ! Default :: 2
748-! IMODE=0, IBP reduction
749-! IMODE=1, PaVe reduction
750-! IMODE=2, PaVe reduction with stablility improved by IBP reduction
751+! IREGIMODE=0, IBP reduction
752+! IREGIMODE=1, PaVe reduction
753+! IREGIMODE=2, PaVe reduction with stablility improved by IBP reduction
754
755 #IREGIRECY
756 !.TRUE.
757@@ -59,7 +60,7 @@
758 ! 2 | Double precision, loops reduced with propagator with reversed order
759 ! 4 | Quadruple precision, loops reduced with propagator in original order
760 ! 5 | Quadruple precision, loops reduced with propagator with reversed order
761-! -1 |  Exhaustive automated numerical stability checks. See below for details.
762+! -1 | Exhaustive automated numerical stability checks. See below for details.
763 !
764 ! Due to the architecture of the program, you are better off
765 ! rerunning the full PS point in quadruple precision than just a single loop
766@@ -84,8 +85,8 @@
767 ! Below you can chose if you want to use zero, one or two rotations of the PS point
768 ! in QP.
769 #NRotations_DP
770-!1
771-! Default :: 1
772+!0
773+! Default :: 0
774 #NRotations_QP
775 !0
776 ! Default :: 0
777@@ -114,6 +115,7 @@
778 #ImprovePSPoint
779 !2
780 ! Default :: 2
781+
782 ! =================================================================================
783 ! The parameters below set two CutTools internal parameters accessible to the user.
784 ! =================================================================================
785@@ -226,4 +228,71 @@
786 !.FALSE.
787 ! Default :: .FALSE.
788
789+! =================================================================================
790+! The parameters below set the main parameters for COLLIER
791+! To edit more specific technical COLLIER parameters, modify directly the content
792+! of the subroutine 'INITCOLLIER' in the file 'MadLoopCommons.f'
793+! =================================================================================
794+
795+! Decide if COLLIER must be computed multiple times to evaluate the UV pole residues
796+! (Withing a Monte-Carlo performed in MG5aMC, this is automatically disabled internally)
797+#COLLIERComputeUVpoles
798+!.TRUE.
799+! Default :: .TRUE.
800+
801+! Decide if COLLIER must be computed multiple times to evaluate the IR pole residues
802+! (Withing a Monte-Carlo performed in MG5aMC, this is automatically disabled internally)
803+#COLLIERComputeIRpoles
804+!.TRUE.
805+! Default :: .TRUE.
806+
807+! Decide if COLLIER must be computed multiple times to evaluate the IR pole residues
808+#COLLIERRequiredAccuracy
809+!1.0d-8
810+! Default :: 1.0d-8
811+! A value of -1.0d0 means that it will be automatically set from MLStabThres.
812+! The default value of 1.0d-8 corresponds to the value for which COLLIER's authors
813+! have optimized the library.
814+
815+! Decide whether to use COLLIER's internal stability test or the loop-direction
816+! switch test instead.
817+#COLLIERUseInternalStabilityTest
818+!.TRUE.
819+! Default :: .TRUE.
820+! COLLIER's internal stability test is at no extra cost but not as reliable
821+! as the loop-direction switch test, which however doubles the reduction time.
822+! This parameter is only relevant when running MadLoop with CTModeRun=-1.
823+! If you find a large number of unstable points with COLLIER for complicated
824+! processes, set this parameter to .FALSE. to make sure the PS points flagged
825+! as unstable with COLLIER really are so.
826+
827+! Set up to which N-loop to use the COLLIER global caching system.
828+#COLLIERGlobalCache
829+!-1
830+! Default :: -1
831+! -1 : Enable the global cache for all loops
832+! 0 : Disable the global cache alltogether
833+! N : Enable the global cache but only for up to N-loops
834+
835+! Use the global cache when evaluating the poles as well (more memory consuming)
836+! During a Monte-Carlo it is typically not useful anyway, because the pole
837+! computation is automatically disabled for COLLIER, irrespectively of the value
838+! of the parameters COLLIERCompute<UV/IR>poles specified above.
839+#COLLIERUseCacheForPoles
840+!.FALSE.
841+! Default :: .FALSE.
842+
843+! Choose which branch(es) of COLLIER have to be used
844+#COLLIERMode
845+!1
846+! Default :: 1
847+! COLLIERMode=1 : COLI branch
848+! COLLIERMode=2 : DD branch
849+! COLLIERMode=3 : Both DD and COLI branch compared
850+
851+! Decide if COLLIER can output its information in a log directory.
852+#COLLIERCanOutput
853+!.FALSE.
854+! Default :: .FALSE.
855+
856 /* End of param file */
857
858=== modified file 'Template/loop_material/StandAlone/SubProcesses/MadLoopCommons.inc'
859--- Template/loop_material/StandAlone/SubProcesses/MadLoopCommons.inc 2016-02-08 23:58:00 +0000
860+++ Template/loop_material/StandAlone/SubProcesses/MadLoopCommons.inc 2016-06-24 21:04:21 +0000
861@@ -30,6 +30,86 @@
862
863 end
864
865+
866+## if(collier_available){
867+ SUBROUTINE INITCOLLIER()
868+C
869+C INITIALISATION OF COLLIER
870+C
871+C
872+C MODULE
873+C
874+ USE COLLIER
875+C
876+C CONSTANTS
877+C
878+ character(len=*) no_folder
879+ parameter (no_folder='')
880+ character(len=*) folderOutput
881+ parameter (folderOutput='COLLIER_output')
882+
883+C Force COLLIER to completely reset from scratch
884+ logical noreset
885+ parameter (noreset=.FALSE.)
886+C
887+C LOCAL VARIABLES
888+C
889+ INTEGER N_CACHES
890+C
891+C GLOBAL VARIABLES
892+C
893+ include 'MadLoopParams.inc'
894+C Now obtain the overall maximum rank, maximum external lines
895+C and maximal number of processes.
896+ include 'global_specs.inc'
897+
898+C ----------
899+C BEGIN CODE
900+C ----------
901+
902+C Initialize Collier
903+ IF (.NOT.COLLIERCanOutput) THEN
904+ CALL Init_cll(MAXNEXTERNAL,OVERALLMAXRANK,no_folder,noreset)
905+ ELSE
906+ CALL Init_cll(MAXNEXTERNAL,OVERALLMAXRANK,folderOutput,noreset)
907+ ENDIF
908+
909+C Set target accuracy, be conservative w.r.t user request
910+C Keep in mind that COLLIER has been optimized for 1d-8.
911+ IF (COLLIERRequiredAccuracy.eq.-1.0d0) THEN
912+ CALL SetReqAcc_cll(MLStabThres*1.0d-3)
913+ ELSE
914+ CALL SetReqAcc_cll(COLLIERRequiredAccuracy)
915+ ENDIF
916+
917+C Set COLLIER mode
918+ CALL SetMode_cll(COLLIERMode)
919+
920+C Set the global cache strategy
921+C If we use the caches for the poles as well, then it is a total of
922+C 4 caches per process.
923+ IF (COLLIERUseCacheForPoles) THEN
924+ N_CACHES =4*NPROCS
925+ ELSE
926+ N_CACHES =NPROCS
927+ ENDIF
928+ IF (COLLIERGlobalCache.eq.-1) THEN
929+ CALL InitCacheSystem_cll(N_CACHES,MAXNEXTERNAL)
930+ ELSEIF(COLLIERGlobalCache.gt.0) THEN
931+ CALL InitCacheSystem_cll(N_CACHES,COLLIERGlobalCache)
932+ ENDIF
933+
934+C Make sure to start by first switching off all cache
935+ IF (COLLIERGlobalCache.ne.0) THEN
936+ call SwitchOffCacheSystem_cll()
937+ ENDIF
938+
939+C Specify below your other custom COLLIER parameter settings
940+C [user_specific_COLLIER_settings]
941+
942+ END
943+## }
944+
945 SUBROUTINE SET_FORBID_HEL_DOUBLECHECK(ONOFF)
946 C
947 C Give the possibility to overwrite the value of MadLoopParams.dat
948@@ -67,9 +147,10 @@
949 DATA ML_INIT/.TRUE./
950 common/ML_INIT/ML_INIT
951
952- LOGICAL CTINIT,TIRINIT,GOLEMINIT,SAMURAIINIT,NINJAINIT
953- DATA CTINIT,TIRINIT,GOLEMINIT,SAMURAIINIT,NINJAINIT/.TRUE.,.TRUE.,.TRUE.,.TRUE.,.TRUE./
954- COMMON/REDUCTIONCODEINIT/CTINIT, TIRINIT, GOLEMINIT, SAMURAIINIT, NINJAINIT
955+ LOGICAL CTINIT,TIRINIT,GOLEMINIT,SAMURAIINIT,NINJAINIT,COLLIERINIT
956+ DATA CTINIT,TIRINIT,GOLEMINIT,SAMURAIINIT,NINJAINIT,COLLIERINIT/.TRUE.,.TRUE.,.TRUE.,.TRUE.,.TRUE.,.TRUE./
957+ COMMON/REDUCTIONCODEINIT/CTINIT, TIRINIT, GOLEMINIT, SAMURAIINIT, NINJAINIT, COLLIERINIT
958+
959
960 character(512) MLPath
961 data MLPath/'[[NA]]'/
962@@ -163,6 +244,8 @@
963 C Stable with Samurai.
964 C U == 6
965 C Stable with Ninja in double precision.
966+C U == 7
967+C Stable with COLLIER.
968 C U == 8
969 C Stable with Ninja in quadruple precision.
970 C U == 9
971@@ -201,10 +284,10 @@
972 STOP 'Only CutTools and Ninja can use quardruple precision'
973 ENDIF
974 ENDIF
975- IF(MLRed.GE.1.AND.MLRed.LE.6)THEN
976+ IF(MLRed.GE.1.AND.MLRed.LE.7)THEN
977 SET_RET_CODE_U=MLRed
978 ELSE
979- STOP 'Only CutTools, PJFry++, IREGI, Golem95, Samurai and Ninja are available'
980+ STOP 'Only CutTools, PJFry++, IREGI, Golem95, Samurai, Ninja and COLLIER are available'
981 ENDIF
982 END
983
984@@ -249,8 +332,11 @@
985 ELSEIF(LIBNUM.EQ.6)THEN
986 C Ninja
987 CALL DETECT_NINJA(NLOOPLINE,RANK,complex_mass,LPASS)
988+ ELSEIF(LIBNUM.EQ.7)THEN
989+C Collier
990+ CALL DETECT_COLLIER(NLOOPLINE,RANK,complex_mass,LPASS)
991 ELSE
992- STOP 'ONLY CUTTOOLS,PJFry++,IREGI,Golem95 and Samurai are available'
993+ STOP 'Only CutTools, PJFry++, IREGI, Golem95, Samurai, Ninja and COLLIER are available'
994 ENDIF
995 RETURN
996 END
997@@ -358,6 +444,65 @@
998 RETURN
999 END
1000
1001+## if(collier_available){
1002+ SUBROUTINE DETECT_COLLIER(NLOOPLINE,RANK,complex_mass,LPASS)
1003+C
1004+C Detect whether Collier can be used or not
1005+C
1006+ USE COLLIER
1007+ IMPLICIT NONE
1008+C
1009+C CONSTANTS
1010+C
1011+C
1012+C ARGUMENTS
1013+C
1014+ INTEGER NLOOPLINE,RANK
1015+ LOGICAL complex_mass,LPASS
1016+C
1017+C LOCAL VARIABLES
1018+C
1019+ INTEGER CURRENT_COLLIERMODE
1020+C
1021+C GLOBAL VARIABLES
1022+C
1023+ LOGICAL CTINIT,TIRINIT,GOLEMINIT,SAMURAIINIT,NINJAINIT,COLLIERINIT
1024+ COMMON/REDUCTIONCODEINIT/CTINIT, TIRINIT, GOLEMINIT, SAMURAIINIT, NINJAINIT, COLLIERINIT
1025+ include 'MadLoopParams.inc'
1026+C ----------
1027+C BEGIN CODE
1028+C ----------
1029+ if (.NOT.COLLIERINIT) THEN
1030+ CALL GETMODE_CLL(CURRENT_COLLIERMODE)
1031+ ELSE
1032+ CURRENT_COLLIERMODE = COLLIERMODE
1033+ ENDIF
1034+ LPASS=.TRUE.
1035+ IF (CURRENT_COLLIERMODE.NE.1) THEN
1036+C The DD branch is used and it has limitations
1037+ IF((NLOOPLINE.GT.6).OR.(RANK.GT.NLOOPLINE)) then
1038+ LPASS=.FALSE.
1039+ endif
1040+ ELSE
1041+C Limitations of the COLI branch are academic.
1042+ LPASS=.TRUE.
1043+ ENDIF
1044+ RETURN
1045+ END
1046+## }else{
1047+ SUBROUTINE DETECT_COLLIER(NLOOPLINE,RANK,complex_mass,LPASS)
1048+C
1049+C ARGUMENTS
1050+C
1051+ INTEGER NLOOPLINE,RANK
1052+ LOGICAL complex_mass,LPASS
1053+C
1054+C COLLIER is not available in this output. This subroutine is dummy.
1055+C
1056+ LPASS=.True.
1057+ END
1058+## }
1059+
1060 SUBROUTINE DETECT_PJFRY(NLOOPLINE,RANK,complex_mass,LPASS)
1061 C
1062 C DETECT whether PJFRY++ CAN BE USED OR NOT
1063
1064=== modified file 'Template/loop_material/StandAlone/SubProcesses/MadLoopParamReader.f'
1065--- Template/loop_material/StandAlone/SubProcesses/MadLoopParamReader.f 2016-02-18 11:42:56 +0000
1066+++ Template/loop_material/StandAlone/SubProcesses/MadLoopParamReader.f 2016-06-24 21:04:21 +0000
1067@@ -33,6 +33,12 @@
1068 stop 'CTModeRun must be >= -1 and <=6.'
1069 endif
1070
1071+ else if (buff .eq. '#COLLIERGlobalCache') then
1072+ read(666,*,end=999) COLLIERGlobalCache
1073+ if (COLLIERGlobalCache .lt. -1) then
1074+ stop 'COLLIERGlobalCache must be >= -1'
1075+ endif
1076+
1077 else if (buff .eq. '#NRotations_DP') then
1078 read(666,*,end=999) NRotations_DP
1079 if (NRotations_DP .lt. 0 .or.
1080@@ -52,7 +58,14 @@
1081 if (MLStabThres.lt.0.0d0) then
1082 stop 'MLStabThres must be >= 0'
1083 endif
1084-
1085+
1086+ else if (buff .eq. '#COLLIERRequiredAccuracy') then
1087+ read(666,*,end=999) COLLIERRequiredAccuracy
1088+ if (COLLIERRequiredAccuracy.le.0.0d0.and.
1089+ & COLLIERRequiredAccuracy.ne.-1.0d0) then
1090+ stop 'COLLIERRequiredAccuracy must be > 0 or = -1.0'
1091+ endif
1092+
1093 else if (buff .eq. '#CTLoopLibrary') then
1094 read(666,*,end=999) CTLoopLibrary
1095 if (CTLoopLibrary.lt.2 .or.
1096@@ -90,6 +103,21 @@
1097 stop 'MaxAttempts must be >= 1'
1098 endif
1099
1100+ else if (buff .eq. '#COLLIERComputeUVpoles') then
1101+ read(666,*,end=999) COLLIERComputeUVpoles
1102+
1103+ else if (buff .eq. '#COLLIERComputeIRpoles') then
1104+ read(666,*,end=999) COLLIERComputeIRpoles
1105+
1106+ else if (buff .eq. '#COLLIERUseInternalStabilityTest') then
1107+ read(666,*,end=999) COLLIERUseInternalStabilityTest
1108+
1109+ else if (buff .eq. '#COLLIERUseCacheForPoles') then
1110+ read(666,*,end=999) COLLIERUseCacheForPoles
1111+
1112+ else if (buff .eq. '#COLLIERCanOutput') then
1113+ read(666,*,end=999) COLLIERCanOutput
1114+
1115 else if (buff .eq. '#UseLoopFilter') then
1116 read(666,*,end=999) UseLoopFilter
1117
1118@@ -127,7 +155,7 @@
1119
1120 else if (buff .eq. '#MLReductionLib') then
1121 read(666,*,end=999) MLReductionLib_str
1122- MLReductionLib(1:6)=0
1123+ MLReductionLib(1:7)=0
1124 MLReductionLib_str_save=MLReductionLib_str
1125 j=0
1126 DO
1127@@ -149,6 +177,8 @@
1128 MLRed=5
1129 ELSEIF(MLReductionLib_char.EQ.'6 ')THEN
1130 MLRed=6
1131+ ELSEIF(MLReductionLib_char.EQ.'7 ')THEN
1132+ MLRed=7
1133 ELSE
1134 PRINT *, 'MLReductionLib is wrong: '//
1135 $ TRIM(MLReductionLib_str_save)
1136@@ -171,6 +201,12 @@
1137 MLReductionLib_str=MLReductionLib_str(i+1:)
1138 ENDIF
1139 ENDDO
1140+ else if (buff .eq. '#COLLIERMode') then
1141+ read(666,*,end=999) COLLIERMode
1142+ if (COLLIERMode .lt. 1 .or.
1143+ & COLLIERMode .gt.3) then
1144+ stop 'COLLIERMode must be >=1 and <=3.'
1145+ endif
1146 else if (buff .eq. '#IREGIRECY') then
1147 read(666,*,end=999) IREGIRECY
1148 else if (buff .eq. '#IREGIMODE') then
1149@@ -218,8 +254,6 @@
1150 & '==============================================================='
1151 write(*,*) ' > MLReductionLib = '
1152 $ //TRIM(MLReductionLib_str_save)
1153- write(*,*) ' > IREGIMODE = ',IREGIMODE
1154- write(*,*) ' > IREGIRECY = ',IREGIRECY
1155 write(*,*) ' > CTModeRun = ',CTModeRun
1156 write(*,*) ' > MLStabThres = ',MLStabThres
1157 write(*,*) ' > NRotations_DP = ',NRotations_DP
1158@@ -243,6 +277,19 @@
1159 &UseQPIntegrandForNinja
1160 write(*,*) ' > UseQPIntegrandForCutTools = ',
1161 &UseQPIntegrandForCutTools
1162+ write(*,*) ' > IREGIMODE = ',IREGIMODE
1163+ write(*,*) ' > IREGIRECY = ',IREGIRECY
1164+ write(*,*) ' > COLLIERMode = ',COLLIERMode
1165+ write(*,*) ' > COLLIERRequiredAccuracy = ',
1166+ $COLLIERRequiredAccuracy
1167+ write(*,*) ' > COLLIERCanOutput = ',COLLIERCanOutput
1168+ write(*,*) ' > COLLIERComputeUVpoles = ',COLLIERComputeUVpoles
1169+ write(*,*) ' > COLLIERComputeIRpoles = ',COLLIERComputeIRpoles
1170+ write(*,*) ' > COLLIERGlobalCache = ',COLLIERGlobalCache
1171+ write(*,*) ' > COLLIERUseCacheForPoles = ',
1172+ &COLLIERUseCacheForPoles
1173+ write(*,*) ' > COLLIERUseInternalStabilityTest = ',
1174+ &COLLIERUseInternalStabilityTest
1175 write(*,*)
1176 & '==============================================================='
1177 paramPrinted=.TRUE.
1178@@ -259,12 +306,20 @@
1179 include "MadLoopParams.inc"
1180
1181 MLReductionLib(1)=6
1182- MLReductionLib(2:6)=0
1183+ MLReductionLib(2:7)=0
1184 IREGIMODE=2
1185 IREGIRECY=.TRUE.
1186+ COLLIERComputeIRpoles = .TRUE.
1187+ COLLIERComputeUVpoles = .TRUE.
1188+ COLLIERUseCacheForPoles = .FALSE.
1189+ COLLIERCanOutput = .FALSE.
1190+ COLLIERGlobalCache = -1
1191+ COLLIERMode=1
1192+ COLLIERRequiredAccuracy=1.0d-8
1193+ COLLIERUseInternalStabilityTest = .TRUE.
1194 CTModeInit=0
1195 CTModeRun=-1
1196- NRotations_DP=1
1197+ NRotations_DP=0
1198 NRotations_QP=0
1199 MLStabThres=1.0d-3
1200 CTStabThres=1.0d-2
1201@@ -281,6 +336,6 @@
1202 OSThres=1.0d-13
1203 ImprovePSPoint=2
1204 UseQPIntegrandForCutTools=.True.
1205- UseQPIntegrandForNinja=.False.
1206+ UseQPIntegrandForNinja=.True.
1207
1208 end
1209
1210=== modified file 'Template/loop_material/StandAlone/SubProcesses/MadLoopParams.inc'
1211--- Template/loop_material/StandAlone/SubProcesses/MadLoopParams.inc 2016-02-18 11:42:56 +0000
1212+++ Template/loop_material/StandAlone/SubProcesses/MadLoopParams.inc 2016-06-24 21:04:21 +0000
1213@@ -7,17 +7,24 @@
1214 !
1215 integer CTModeInit,CTModeRun,CheckCycle,MaxAttempts,
1216 &CTLoopLibrary,NRotations_DP,NRotations_QP,ImprovePSPoint,
1217- &MLReductionLib(7),IREGIMODE,HelicityFilterLevel
1218-
1219- real*8 MLStabThres,CTStabThres,ZeroThres,OSThres
1220-
1221- logical UseLoopFilter,LoopInitStartOver,DoubleCheckHelicityFilter
1222+ &MLReductionLib(8),IREGIMODE,HelicityFilterLevel,COLLIERMode,
1223+ &COLLIERGlobalCache
1224+
1225+ real*8 MLStabThres,CTStabThres,ZeroThres,OSThres,COLLIERRequiredAccuracy
1226+
1227+ logical UseLoopFilter,LoopInitStartOver,DoubleCheckHelicityFilter,
1228+ &COLLIERComputeIRpoles,COLLIERComputeUVpoles,COLLIERCanOutput
1229 logical HelInitStartOver,IREGIRECY,WriteOutFilters
1230 logical UseQPIntegrandForNinja, UseQPIntegrandForCutTools
1231+ logical COLLIERUseCacheForPoles,COLLIERUseInternalStabilityTest
1232
1233 common /MADLOOP/CTModeInit,CTModeRun,NRotations_DP,NRotations_QP,
1234+ &COLLIERMode,COLLIERGlobalCache,
1235 &ImprovePSPoint,CheckCycle, MaxAttempts,UseLoopFilter,MLStabThres,
1236+ &COLLIERRequiredAccuracy,
1237 &CTStabThres,CTLoopLibrary,LoopInitStartOver,
1238+ &COLLIERComputeIRpoles,COLLIERComputeUVpoles,COLLIERCanOutput,
1239+ &COLLIERUseCacheForPoles,COLLIERUseInternalStabilityTest,
1240 &DoubleCheckHelicityFilter,ZeroThres,OSThres,HelInitStartOver,
1241 &MLReductionLib,IREGIMODE,HelicityFilterLevel,IREGIRECY,
1242 &WriteOutFilters,UseQPIntegrandForNinja,UseQPIntegrandForCutTools
1243
1244=== modified file 'Template/loop_material/StandAlone/SubProcesses/makefile'
1245--- Template/loop_material/StandAlone/SubProcesses/makefile 2016-05-26 23:36:59 +0000
1246+++ Template/loop_material/StandAlone/SubProcesses/makefile 2016-06-24 21:04:21 +0000
1247@@ -45,6 +45,7 @@
1248 $(patsubst $(DOTF),$(DOTO),$(wildcard mp_coef_construction_*.f)) \
1249 $(patsubst $(DOTF),$(DOTO),$(wildcard TIR_interface.f)) \
1250 $(patsubst $(DOTF),$(DOTO),$(wildcard GOLEM_interface.f)) \
1251+ $(patsubst $(DOTF),$(DOTO),$(wildcard COLLIER_interface.f)) \
1252 $(patsubst $(DOTF),$(DOTO),$(wildcard compute_color_flows.f))
1253
1254 OLP_PROCESS= MadLoopParamReader.o MadLoopCommons.o \
1255@@ -64,6 +65,7 @@
1256 $(patsubst $(DOTF),$(DOTO),$(wildcard $(LOOP_PREFIX)*/mp_coef_construction_*.f)) \
1257 $(patsubst $(DOTF),$(DOTO),$(wildcard $(LOOP_PREFIX)*/TIR_interface.f)) \
1258 $(patsubst $(DOTF),$(DOTO),$(wildcard $(LOOP_PREFIX)*/GOLEM_interface.f)) \
1259+ $(patsubst $(DOTF),$(DOTO),$(wildcard $(LOOP_PREFIX)*/COLLIER_interface.f)) \
1260 $(patsubst $(DOTF),$(DOTO),$(wildcard $(LOOP_PREFIX)*/compute_color_flows.f))
1261
1262 $(PROG): check_sa.o $(PROCESS) makefile $(LIBS)
1263
1264=== modified file 'UpdateNotes.txt'
1265--- UpdateNotes.txt 2016-06-08 08:59:13 +0000
1266+++ UpdateNotes.txt 2016-06-24 21:04:21 +0000
1267@@ -1,6 +1,19 @@
1268 Update notes for MadGraph5_aMC@NLO (in reverse time order)
1269
1270-2.4.1 (xx/xx/xx)
1271+2.4.3 (xx/xx/xx)
1272+ OM: Reduce the amount of log file/output generated for LO run (output can use up to three times less output).
1273+ OM: For the LO combination of events (unweighting) pass to the method previously used for loop-induced.
1274+ This method is faster and requires less I/O operation.
1275+ This fully remove the need of the file events.lhe.gz which is not created anymore (further reduce the ouput size)
1276+ OM: Optimise the code in order to be able to run scan with more than 2k steps.
1277+ OM: Optimise the lhe_parser module (use for the unweighting/re-weighing/...) around 20% faster than before.
1278+
1279+
1280+2.4.2 (10/06/16)
1281+ OM: fix a compilation problem for non standard gfortran system
1282+ OM: reduce the need of lhapdf for standard LO run. (was making some run to test due to missing dependencies)
1283+
1284+2.4.1 (10/06/16)
1285 OM: Fix a bug in fix target experiment with PDF on the particle at rest.
1286 The cross-section was correct but the z-boost was not performed correctly.
1287 OM: Fix various bug in MadSpin
1288@@ -8,7 +21,7 @@
1289 OM: Allow to specify a path for a custom directory where to look for model via the environment
1290 variable PYTHONPATH. Note this used AFTER the standard ./models directory
1291
1292-2.4.0 (12/06/16)
1293+2.4.0 (12/05/16)
1294 OM: Allowing the proper NLO reweighting for NLO sample
1295 RF: For NLO processes allow for multiple PDF and scales reweighting, directy by inputting lists
1296 in the run_card.dat.
1297
1298=== modified file 'VERSION'
1299--- VERSION 2016-05-13 12:40:54 +0000
1300+++ VERSION 2016-06-24 21:04:21 +0000
1301@@ -1,5 +1,5 @@
1302-version = 2.4.1.beta
1303-date = 2016-04-06
1304+version = 2.4.2
1305+date = 2016-06-10
1306
1307
1308
1309
1310=== modified file 'input/.mg5_configuration_default.txt'
1311--- input/.mg5_configuration_default.txt 2016-04-28 19:07:40 +0000
1312+++ input/.mg5_configuration_default.txt 2016-06-24 21:04:21 +0000
1313@@ -180,12 +180,17 @@
1314 #! if samurai=/PATH/TO/samurai/lib: use that specific installation path for samurai
1315 # samurai = None
1316
1317-#! Set the samurai directory containing ninja's library
1318-#! if auto: try to find it automatically on the system (default)
1319+#! Set the Ninja directory containing ninja's library
1320 #! if '' or None: disabling ninja
1321 #! if ninja=/PATH/TO/ninja/lib: use that specific installation path for ninja
1322 # ninja = ./HEPTools/lib
1323
1324+#! Set the COLLIER directory containing COLLIER's library
1325+#! if '' or None: disabling COLLIER
1326+#! if ninja=/PATH/TO/ninja/lib: use that specific installation path for COLLIER
1327+# Note that it is necessary that you have generated a static library for COLLIER
1328+# collier = ./HEPTools/lib
1329+
1330 #! Set how MadLoop dependencies (such as CutTools) should be handled
1331 #! > external : ML5 places a link to the MG5_aMC-wide libraries
1332 #! > internal : ML5 copies all dependencies in the output so that it is independent
1333
1334=== modified file 'madgraph/interface/amcatnlo_run_interface.py'
1335--- madgraph/interface/amcatnlo_run_interface.py 2016-05-26 09:31:57 +0000
1336+++ madgraph/interface/amcatnlo_run_interface.py 2016-06-24 21:04:21 +0000
1337@@ -120,7 +120,8 @@
1338 input = pjoin(me_dir, '%s_input.txt' % test)
1339 #this can be improved/better written to handle the output
1340 misc.call(['./%s' % (test)], cwd=this_dir,
1341- stdin = open(input), stdout=open(pjoin(this_dir, '%s.log' % test), 'w'))
1342+ stdin = open(input), stdout=open(pjoin(this_dir, '%s.log' % test), 'w'),
1343+ close_fds=True)
1344 if test == 'check_poles' and os.path.exists(pjoin(this_dir,'MadLoop5_resources')) :
1345 tf=tarfile.open(pjoin(this_dir,'MadLoop5_resources.tar.gz'),'w:gz',
1346 dereference=True)
1347@@ -132,7 +133,8 @@
1348 open(pjoin(this_dir, 'gensym_input.txt'), 'w').write('%s\n' % run_mode)
1349 misc.call(['./gensym'],cwd= this_dir,
1350 stdin=open(pjoin(this_dir, 'gensym_input.txt')),
1351- stdout=open(pjoin(this_dir, 'gensym.log'), 'w'))
1352+ stdout=open(pjoin(this_dir, 'gensym.log'), 'w'),
1353+ close_fds=True)
1354 #compile madevent_mintMC/mintFO
1355 misc.compile([exe], cwd=this_dir, job_specs = False)
1356 if mode in ['aMC@NLO', 'aMC@LO', 'noshower', 'noshowerLO']:
1357@@ -516,7 +518,8 @@
1358 input_file = filenames[0]
1359 output_file = pjoin(self.me_dir, 'Events', 'pythia_events.hep')
1360 lock = cluster.asyncrone_launch('gunzip',stdout=open(output_file,'w'),
1361- argument=['-c', input_file])
1362+ argument=['-c', input_file],
1363+ close_fds=True)
1364 else:
1365 if tag:
1366 self.run_card['run_tag'] = tag
1367@@ -576,7 +579,8 @@
1368 input_file = filenames[0]
1369 output_file = pjoin(self.me_dir, 'Events', 'pythia_events.hep')
1370 lock = cluster.asyncrone_launch('gunzip',stdout=open(output_file,'w'),
1371- argument=['-c', input_file])
1372+ argument=['-c', input_file],
1373+ close_fds=True)
1374 else:
1375 if tag:
1376 self.run_card['run_tag'] = tag
1377@@ -1331,8 +1335,6 @@
1378 nevents=self.run_card['nevents']
1379 return self.reweight_and_collect_events(options, mode, nevents, event_norm)
1380
1381- devnull = os.open(os.devnull, os.O_RDWR)
1382-
1383 if mode in ['LO', 'NLO']:
1384 # this is for fixed order runs
1385 mode_dict = {'NLO': 'all', 'LO': 'born'}
1386@@ -1962,7 +1964,6 @@
1387 logger.info('The results of this run' + \
1388 ' have been saved in %s' % pjoin(self.me_dir, 'Events', self.run_name))
1389
1390-
1391 def combine_plots_HwU(self,jobs,out,normalisation=None):
1392 """Sums all the plots in the HwU format."""
1393 logger.debug('Combining HwU plots.')
1394@@ -2399,6 +2400,7 @@
1395 4 : 'Golem95',
1396 5 : 'Samurai',
1397 6 : 'Ninja (double precision)',
1398+ 7 : 'COLLIER',
1399 8 : 'Ninja (quadruple precision)',
1400 9 : 'CutTools (quadruple precision)'}
1401 RetUnit_finder =re.compile(
1402@@ -2887,8 +2889,8 @@
1403 fjwrapper_lines[fjwrapper_lines.index(line)] = include_line
1404 if '//NAMESPACE_FJ' in line:
1405 fjwrapper_lines[fjwrapper_lines.index(line)] = namespace_line
1406- open(pjoin(self.me_dir, 'MCatNLO', 'srcCommon', 'myfastjetfortran.cc'), 'w').write(\
1407- '\n'.join(fjwrapper_lines) + '\n')
1408+ with open(pjoin(self.me_dir, 'MCatNLO', 'srcCommon', 'myfastjetfortran.cc'), 'w') as fsock:
1409+ fsock.write('\n'.join(fjwrapper_lines) + '\n')
1410
1411 extrapaths = self.shower_card['extrapaths'].split()
1412
1413@@ -2940,7 +2942,8 @@
1414
1415 misc.call(['./MCatNLO_MadFKS.inputs'], stdout=open(mcatnlo_log, 'w'),
1416 stderr=open(mcatnlo_log, 'w'),
1417- cwd=pjoin(self.me_dir, 'MCatNLO'))
1418+ cwd=pjoin(self.me_dir, 'MCatNLO'),
1419+ close_fds=True)
1420
1421 exe = 'MCATNLO_%s_EXE' % shower
1422 if not os.path.exists(pjoin(self.me_dir, 'MCatNLO', exe)) and \
1423@@ -3017,8 +3020,8 @@
1424 out_id = 'TOP'
1425
1426 # write the executable
1427- open(pjoin(rundir, 'shower.sh'), 'w').write(\
1428- open(pjoin(self.me_dir, 'MCatNLO', 'shower_template.sh')).read() \
1429+ with open(pjoin(rundir, 'shower.sh'), 'w') as fsock:
1430+ fsock.write(open(pjoin(self.me_dir, 'MCatNLO', 'shower_template.sh')).read() \
1431 % {'extralibs': ':'.join(extrapaths)})
1432 subprocess.call(['chmod', '+x', pjoin(rundir, 'shower.sh')])
1433
1434@@ -4097,7 +4100,8 @@
1435 exe = 'madevent_mintMC'
1436 tests = ['test_ME', 'test_MC']
1437 # write an analyse_opts with a dummy analysis so that compilation goes through
1438- open(pjoin(self.me_dir, 'SubProcesses', 'analyse_opts'),'w').write('FO_ANALYSE=analysis_dummy.o dbook.o open_output_files_dummy.o HwU_dummy.o\n')
1439+ with open(pjoin(self.me_dir, 'SubProcesses', 'analyse_opts'),'w') as fsock:
1440+ fsock.write('FO_ANALYSE=analysis_dummy.o dbook.o open_output_files_dummy.o HwU_dummy.o\n')
1441
1442 #directory where to compile exe
1443 p_dirs = [d for d in \
1444@@ -4161,7 +4165,8 @@
1445 if line.strip().startswith('APPLLIBS=$'):
1446 line=appllibs
1447 text_out.append(line)
1448- open(pjoin(self.me_dir,'Source','make_opts'),'w').writelines(text_out)
1449+ with open(pjoin(self.me_dir,'Source','make_opts'),'w') as fsock:
1450+ fsock.writelines(text_out)
1451 else:
1452 self.make_opts_var['applgrid'] = ""
1453
1454
1455=== modified file 'madgraph/interface/common_run_interface.py'
1456--- madgraph/interface/common_run_interface.py 2016-06-09 23:25:41 +0000
1457+++ madgraph/interface/common_run_interface.py 2016-06-24 21:04:21 +0000
1458@@ -2214,7 +2214,8 @@
1459 content_variables += '\n%s' % tag
1460
1461 if diff:
1462- open(make_opts, 'w').write(content_variables + '\n'.join(content))
1463+ with open(make_opts, 'w') as fsock:
1464+ fsock.write(content_variables + '\n'.join(content))
1465 return
1466
1467
1468@@ -2901,7 +2902,8 @@
1469 p_card, flags=(re.M+re.I))
1470 if n==0:
1471 p_card = '%s \n QCUT= %s' % (p_card, args[1])
1472- open(pythia_path, 'w').write(p_card)
1473+ with open(pythia_path, 'w') as fsock:
1474+ fsock.write(p_card)
1475 return
1476 # Special case for the showerkt value
1477 if args[0].lower() == 'showerkt':
1478@@ -2914,7 +2916,8 @@
1479 p_card, flags=(re.M+re.I))
1480 if n==0:
1481 p_card = '%s \n SHOWERKT= %s' % (p_card, args[1].upper())
1482- open(pythia_path, 'w').write(p_card)
1483+ with open(pythia_path, 'w') as fsock:
1484+ fsock.write(p_card)
1485 return
1486
1487
1488@@ -3384,7 +3387,6 @@
1489 logger.info("change madspin_card to add one decay to %s: %s" %(particle, line.strip()), '$MG:color:BLACK')
1490
1491 text = text.replace('launch', "\ndecay %s\nlaunch\n" % line,1)
1492- open(path,'w').write(text)
1493 else:
1494 # Here we have to remove all the previous definition of the decay
1495 #first find the particle
1496@@ -3395,8 +3397,10 @@
1497 text= open(path).read()
1498 text = decay_pattern.sub('', text)
1499 text = text.replace('launch', "\ndecay %s\nlaunch\n" % line,1)
1500- open(path,'w').write(text)
1501-
1502+
1503+ with open(path,'w') as fsock:
1504+ fsock.write(text)
1505+
1506
1507
1508 def do_compute_widths(self, line):
1509
1510=== modified file 'madgraph/interface/extended_cmd.py'
1511--- madgraph/interface/extended_cmd.py 2016-03-05 08:26:48 +0000
1512+++ madgraph/interface/extended_cmd.py 2016-06-24 21:04:21 +0000
1513@@ -841,10 +841,12 @@
1514 try:
1515 cmd.Cmd.onecmd(self, 'history %s' % self.debug_output.replace(' ', '\ '))
1516 except Exception, error:
1517- logger.error(error)
1518+ logger.error(error)
1519
1520 debug_file = open(self.debug_output, 'a')
1521 traceback.print_exc(file=debug_file)
1522+ if hasattr(error, 'filename'):
1523+ debug_file.write("Related File: %s\n" % error.filename)
1524 # Create a nice error output
1525 if self.history and line == self.history[-1]:
1526 error_text = 'Command \"%s\" interrupted with error:\n' % line
1527
1528=== modified file 'madgraph/interface/loop_interface.py'
1529--- madgraph/interface/loop_interface.py 2016-05-24 09:52:16 +0000
1530+++ madgraph/interface/loop_interface.py 2016-06-24 21:04:21 +0000
1531@@ -538,10 +538,11 @@
1532
1533 # Fortran MadGraph5_aMC@NLO Standalone
1534 if self._export_format in self.supported_ML_format:
1535- for me in matrix_elements:
1536+ for unique_id, me in enumerate(matrix_elements):
1537 calls = calls + \
1538 self._curr_exporter.generate_subprocess_directory_v4(\
1539- me, self._curr_fortran_model)
1540+ me, self._curr_fortran_model, (unique_id+1))
1541+ self._curr_exporter.write_global_specs(matrix_elements)
1542 # If all ME's do not share the same maximum loop vertex rank and the
1543 # same loop maximum wavefunction size, we need to set the maximum
1544 # in coef_specs.inc of the HELAS Source. The SubProcesses/P* directory
1545@@ -554,6 +555,7 @@
1546 if len(set(max_lwfspins))>1 or len(set(max_loop_vert_ranks))>1:
1547 self._curr_exporter.fix_coef_specs(max(max_lwfspins),\
1548 max(max_loop_vert_ranks))
1549+ self._curr_exporter.write_global_specs(matrix_elements)
1550
1551 # Just the matrix.f files
1552 if self._export_format == 'matrix':
1553
1554=== modified file 'madgraph/interface/madevent_interface.py'
1555--- madgraph/interface/madevent_interface.py 2016-06-10 16:31:39 +0000
1556+++ madgraph/interface/madevent_interface.py 2016-06-24 21:04:21 +0000
1557@@ -2540,7 +2540,7 @@
1558 # helicity filters.
1559 self.MadLoopparam.set('CheckCycle',4, ifnotdefault=False)
1560
1561- # For now it is tricky to have eahc channel performing the helicity
1562+ # For now it is tricky to have each channel performing the helicity
1563 # double check. What we will end up doing is probably some kind
1564 # of new initialization round at the beginning of each launch
1565 # command, to reset the filters.
1566@@ -2548,7 +2548,7 @@
1567 ifnotdefault=False)
1568
1569 # Thanks to TIR recycling, TIR is typically much faster for Loop-induced
1570- # processes, so that we place OPP last.
1571+ # processes when not doing MC over helicities, so that we place OPP last.
1572 if not hasattr(self, 'run_card'):
1573 run_card = banner_mod.RunCard(opt['run_card'])
1574 else:
1575@@ -2561,7 +2561,7 @@
1576 """You chose to set the preferred reduction technique in MadLoop to be OPP (see parameter MLReductionLib).
1577 Beware that this can bring significant slowdown; the optimal choice --when not MC over helicity-- being to first start with TIR reduction.""")
1578 # We do not include GOLEM for now since it cannot recycle TIR coefs yet.
1579- self.MadLoopparam.set('MLReductionLib','2|6|1', ifnotdefault=False)
1580+ self.MadLoopparam.set('MLReductionLib','7|6|1', ifnotdefault=False)
1581 else:
1582 if 'MLReductionLib' in self.MadLoopparam.user_set and \
1583 not (self.MadLoopparam.get('MLReductionLib').startswith('1') or
1584@@ -2569,7 +2569,7 @@
1585 logger.warning(
1586 """You chose to set the preferred reduction technique in MadLoop to be different than OPP (see parameter MLReductionLib).
1587 Beware that this can bring significant slowdown; the optimal choice --when MC over helicity-- being to first start with OPP reduction.""")
1588- self.MadLoopparam.set('MLReductionLib','6|1|2', ifnotdefault=False)
1589+ self.MadLoopparam.set('MLReductionLib','6|7|1', ifnotdefault=False)
1590
1591 # Also TIR cache will only work when NRotations_DP=0 (but only matters
1592 # when not MC-ing over helicities) so it will be hard-reset by MadLoop
1593@@ -2900,14 +2900,13 @@
1594 self.update_status('Combining Events', level='parton')
1595
1596
1597- if not hasattr(self, "refine_mode") or self.refine_mode == "old":
1598+ if False: #not hasattr(self, "refine_mode") or self.refine_mode == "old":
1599 try:
1600 os.remove(pjoin(self.me_dir,'SubProcesses', 'combine.log'))
1601 except Exception:
1602 pass
1603
1604- tmpcluster = cluster.MultiCore(nb_core=1)
1605- tmpcluster.launch_and_wait('../bin/internal/run_combine',
1606+ cluster.onecore.launch_and_wait('../bin/internal/run_combine',
1607 args=[self.run_name],
1608 cwd=pjoin(self.me_dir,'SubProcesses'),
1609 stdout=pjoin(self.me_dir,'SubProcesses', 'combine.log'),
1610@@ -2958,7 +2957,7 @@
1611 out=pjoin(self.me_dir,'Events', self.run_name, 'unweighted_events.lhe'))
1612
1613
1614- elif self.refine_mode == "new":
1615+ elif True:#self.refine_mode == "new":
1616 # Define The Banner
1617 tag = self.run_card['run_tag']
1618 # Update the banner with the pythia card
1619@@ -2975,9 +2974,12 @@
1620 '%s_%s_banner.txt' % (self.run_name, tag)))
1621
1622
1623+ get_wgt = lambda event: event.wgt
1624 AllEvent = lhe_parser.MultiEventFile()
1625 AllEvent.banner = self.banner
1626
1627+ partials = 0 # if too many file make some partial unweighting
1628+ sum_xsec, sum_xerru, sum_axsec = 0,[],0
1629 for Gdir,mfactor in self.get_Gdir():
1630 if os.path.exists(pjoin(Gdir, 'events.lhe')):
1631 result = sum_html.OneResult('')
1632@@ -2987,12 +2989,28 @@
1633 result.get('xerru'),
1634 result.get('axsec')
1635 )
1636-
1637- get_wgt = lambda event: event.wgt
1638+ sum_xsec += result.get('xsec')
1639+ sum_xerru.append(result.get('xerru'))
1640+ sum_axsec += result.get('axsec')
1641+ if len(AllEvent) >= 80: #perform a partial unweighting
1642+ AllEvent.unweight(pjoin(self.me_dir, "Events", self.run_name, "partials%s.lhe.gz" % partials),
1643+ get_wgt, log_level=logging.DEBUG)
1644+ AllEvent = lhe_parser.MultiEventFile()
1645+ AllEvent.add(pjoin(self.me_dir, "Events", self.run_name, "partials%s.lhe.gz" % partials),
1646+ sum_xsec,
1647+ math.sqrt(sum(x**2 for x in sum_xerru)),
1648+ sum_axsec)
1649+ partials +=1
1650+
1651 nb_event = AllEvent.unweight(pjoin(self.me_dir, "Events", self.run_name, "unweighted_events.lhe.gz"),
1652 get_wgt, trunc_error=1e-2, event_target=self.run_card['nevents'],
1653 log_level=logging.DEBUG)
1654
1655+ if partials:
1656+ misc.sprint("used partials")
1657+ for i in range(partials):
1658+ os.remove(pjoin(self.me_dir, "Events", self.run_name, "partials%s.lhe.gz" % i))
1659+
1660 self.results.add_detail('nb_event', nb_event)
1661
1662 self.to_store.append('event')
1663@@ -3025,9 +3043,9 @@
1664 os.mkdir(pjoin(self.me_dir, 'HTML', run))
1665
1666 # 1) Store overall process information
1667- input = pjoin(self.me_dir, 'SubProcesses', 'results.dat')
1668- output = pjoin(self.me_dir, 'SubProcesses', '%s_results.dat' % run)
1669- files.cp(input, output)
1670+ #input = pjoin(self.me_dir, 'SubProcesses', 'results.dat')
1671+ #output = pjoin(self.me_dir, 'SubProcesses', '%s_results.dat' % run)
1672+ #files.cp(input, output)
1673
1674
1675 # 2) Treat the files present in the P directory
1676@@ -3048,14 +3066,14 @@
1677 os.remove(pjoin(G_path, 'events.lhe'))
1678 except Exception:
1679 continue
1680- try:
1681- # Store results.dat
1682- if os.path.exists(pjoin(G_path, 'results.dat')):
1683- input = pjoin(G_path, 'results.dat')
1684- output = pjoin(G_path, '%s_results.dat' % run)
1685- files.cp(input, output)
1686- except Exception:
1687- continue
1688+ #try:
1689+ # # Store results.dat
1690+ # if os.path.exists(pjoin(G_path, 'results.dat')):
1691+ # input = pjoin(G_path, 'results.dat')
1692+ # output = pjoin(G_path, '%s_results.dat' % run)
1693+ # files.cp(input, output)
1694+ #except Exception:
1695+ # continue
1696 # Store log
1697 try:
1698 if os.path.exists(pjoin(G_path, 'log.txt')):
1699@@ -3064,18 +3082,18 @@
1700 files.mv(input, output)
1701 except Exception:
1702 continue
1703- try:
1704- # Grid
1705- for name in ['ftn26']:
1706- if os.path.exists(pjoin(G_path, name)):
1707- if os.path.exists(pjoin(G_path, '%s_%s.gz'%(run,name))):
1708- os.remove(pjoin(G_path, '%s_%s.gz'%(run,name)))
1709- input = pjoin(G_path, name)
1710- output = pjoin(G_path, '%s_%s' % (run,name))
1711- files.mv(input, output)
1712- misc.gzip(pjoin(G_path, output), error=None)
1713- except Exception:
1714- continue
1715+ #try:
1716+ # # Grid
1717+ # for name in ['ftn26']:
1718+ # if os.path.exists(pjoin(G_path, name)):
1719+ # if os.path.exists(pjoin(G_path, '%s_%s.gz'%(run,name))):
1720+ # os.remove(pjoin(G_path, '%s_%s.gz'%(run,name)))
1721+ # input = pjoin(G_path, name)
1722+ # output = pjoin(G_path, '%s_%s' % (run,name))
1723+ # files.mv(input, output)
1724+ # misc.gzip(pjoin(G_path, output), error=None)
1725+ #except Exception:
1726+ # continue
1727 # Delete ftn25 to ensure reproducible runs
1728 if os.path.exists(pjoin(G_path, 'ftn25')):
1729 os.remove(pjoin(G_path, 'ftn25'))
1730@@ -5056,7 +5074,7 @@
1731 if MG_options:
1732 mcore = cluster.MultiCore(**MG_options)
1733 else:
1734- mcore = cluster.MultiCore(nb_core=1)
1735+ mcore = cluster.onecore
1736 def run_initialization_wrapper(run_dir, infos, attempts):
1737 if attempts is None:
1738 n_PS = MadLoopInitializer.run_initialization(
1739
1740=== modified file 'madgraph/interface/madgraph_interface.py'
1741--- madgraph/interface/madgraph_interface.py 2016-06-07 09:34:40 +0000
1742+++ madgraph/interface/madgraph_interface.py 2016-06-24 21:04:21 +0000
1743@@ -910,8 +910,11 @@
1744
1745 user_options = {'--energy':'1000','--split_orders':'-1',
1746 '--reduction':'1|2|3|4|5|6','--CTModeRun':'-1',
1747- '--helicity':'-1','--seed':'-1'}
1748-
1749+ '--helicity':'-1','--seed':'-1','--collier_cache':'-1',
1750+ '--collier_req_acc':'auto',
1751+ '--collier_internal_stability_test':'False',
1752+ '--collier_mode':'1'}
1753+
1754 if args[0] in ['cms'] or args[0].lower()=='cmsoptions':
1755 # increase the default energy to 5000
1756 user_options['--energy']='5000'
1757@@ -2630,7 +2633,7 @@
1758 'update', 'Delphes2', 'SysCalc', 'Golem95', 'PJFry',
1759 'QCDLoop']
1760 # The targets below are installed using the HEPToolsInstaller.py script
1761- _advanced_install_opts = ['ninja']
1762+ _advanced_install_opts = ['ninja','collier']
1763
1764 # The options below are commented for now but already available
1765 # _advanced_install_opts += ['pythia8','zlib','boost','lhapdf6','lhapdf5','hepmc','mg5amc_py8_interface','oneloop']
1766@@ -2685,6 +2688,7 @@
1767 'golem':'auto',
1768 'samurai':None,
1769 'ninja':'./HEPTools/lib',
1770+ 'collier':'./HEPTools/lib',
1771 'lhapdf':'lhapdf-config',
1772 'applgrid':'applgrid-config',
1773 'amcfast':'amcfast-config',
1774@@ -3527,6 +3531,15 @@
1775 " must be an integer, not %s."%option[1])
1776 elif option[0]=='--reduction':
1777 MLoptions['MLReductionLib']=[int(ir) for ir in option[1].split('|')]
1778+ elif option[0]=='--collier_mode':
1779+ MLoptions['COLLIERMode']=int(option[1])
1780+ elif option[0]=='--collier_cache':
1781+ MLoptions['COLLIERGlobalCache']=int(option[1])
1782+ elif option[0]=='--collier_req_acc':
1783+ if option[1]!='auto':
1784+ MLoptions['COLLIERRequiredAccuracy']=float(option[1])
1785+ elif option[0]=='--collier_internal_stability_test':
1786+ MLoptions['COLLIERUseInternalStabilityTest']=eval(option[1])
1787 elif option[0]=='--CTModeRun':
1788 try:
1789 MLoptions['CTModeRun']=int(option[1])
1790@@ -3891,6 +3904,14 @@
1791 logger_check.warning('Samurai not available on your system; it will be skipped.')
1792 MLoptions["MLReductionLib"].remove(5)
1793
1794+ if 'collier' in self.options and isinstance(self.options['collier'],str):
1795+ TIR_dir['collier_dir']=self.options['collier']
1796+ else:
1797+ if "MLReductionLib" in MLoptions:
1798+ if 7 in MLoptions["MLReductionLib"]:
1799+ logger_check.warning('Collier not available on your system; it will be skipped.')
1800+ MLoptions["MLReductionLib"].remove(7)
1801+
1802 if 'ninja' in self.options and isinstance(self.options['ninja'],str):
1803 TIR_dir['ninja_dir']=self.options['ninja']
1804 else:
1805@@ -5390,7 +5411,9 @@
1806 self.options['mg5amc_py8_interface_path'] = \
1807 pjoin(MG5DIR,'HEPTools','MG5aMC_PY8_interface')
1808 self.exec_cmd('save options')
1809-
1810+ elif tool == 'collier':
1811+ self.options['collier'] = pjoin(os.curdir,'HEPTools','lib')
1812+ self.exec_cmd('save options')
1813 elif tool == 'ninja':
1814 if not misc.get_ninja_quad_prec_support(pjoin(
1815 MG5DIR,'HEPTools','ninja','lib')):
1816@@ -5489,6 +5512,7 @@
1817 'hepmc':['CPC 134 (2001) 41-46'],
1818 'mg5amc_py8_interface':['arXiv:1410.3012','arXiv:XXXX.YYYYY'],
1819 'ninja':['arXiv:1203.0291','arXiv:1403.1229','arXiv:1604.01363'],
1820+ 'collier':['arXiv:1604.06792'],
1821 'oneloop':['arXiv:1007.4716']}
1822
1823 if args[0] in advertisements:
1824@@ -5675,10 +5699,10 @@
1825 # to
1826 #DELPHES_LIBS = $(shell $(RC) --libs) -lEG $(SYSLIBS) -Wl,-rpath,/Applications/root_v6.04.08/lib/
1827 rootsys = os.environ['ROOTSYS']
1828- text = open('./Delphes/Makefile').read()
1829+ text = open(pjoin(MG5DIR, 'Delphes','Makefile')).read()
1830 text = text.replace('DELPHES_LIBS = $(shell $(RC) --libs) -lEG $(SYSLIBS)',
1831 'DELPHES_LIBS = $(shell $(RC) --libs) -lEG $(SYSLIBS) -Wl,-rpath,%s/lib/' % rootsys)
1832- open('./Delphes/Makefile','w').write(text)
1833+ open(pjoin(MG5DIR, 'Delphes','Makefile'),'w').write(text)
1834
1835 # For SysCalc link to lhapdf
1836 if name == 'SysCalc':
1837@@ -6852,8 +6876,8 @@
1838 logger.info('set fastjet to %s' % args[1])
1839 self.options[args[0]] = args[1]
1840
1841- elif args[0] in ['pjfry','golem','samurai','ninja'] and \
1842- not (args[0]=='ninja' and args[1]=='./HEPTools/lib'):
1843+ elif args[0] in ['pjfry','golem','samurai','ninja','collier'] and \
1844+ not (args[0] in ['ninja','collier'] and args[1]=='./HEPTools/lib'):
1845 if args[1] in ['None',"''",'""']:
1846 self.options[args[0]] = None
1847 else:
1848@@ -7253,6 +7277,8 @@
1849 if self._export_format == 'madevent':
1850 calls += self._curr_exporter.export_processes(self._curr_matrix_elements,
1851 self._curr_fortran_model)
1852+ self._curr_exporter.write_global_specs(
1853+ self._curr_matrix_elements.get_matrix_elements())
1854
1855 # Write the procdef_mg5.dat file with process info
1856 card_path = pjoin(path, os.path.pardir, 'SubProcesses', \
1857
1858=== modified file 'madgraph/iolibs/export_fks.py'
1859--- madgraph/iolibs/export_fks.py 2016-05-12 10:46:19 +0000
1860+++ madgraph/iolibs/export_fks.py 2016-06-24 21:04:21 +0000
1861@@ -187,7 +187,8 @@
1862 writer = writers.FortranWriter(os.path.join(self.dir_path,
1863 "SubProcesses","MadLoopCommons.f"))
1864 writer.writelines(MadLoopCommon%{
1865- 'print_banner_commands':self.MadLoop_banner})
1866+ 'print_banner_commands':self.MadLoop_banner},
1867+ context={'collier_available':False})
1868 writer.close()
1869
1870 # Write the cts_mpc.h and cts_mprec.h files imported from CutTools
1871@@ -1573,12 +1574,19 @@
1872 matrix_element.get('processes')[0].nice_string(print_weighted=False))
1873 plot.draw()
1874
1875+ # We also need to write the overall maximum quantities for this group
1876+ # of processes in 'global_specs.inc'. In aMCatNLO, there is always
1877+ # only one process, so this is trivial
1878+ self.write_global_specs(matrix_element)
1879+ open('unique_id.inc','w').write(
1880+""" integer UNIQUE_ID
1881+ parameter(UNIQUE_ID=1)""")
1882+
1883 linkfiles = ['coupl.inc', 'mp_coupl.inc', 'mp_coupl_same_name.inc',
1884 'cts_mprec.h', 'cts_mpc.h', 'MadLoopParamReader.f',
1885- 'MadLoopCommons.f','MadLoopParams.inc']
1886+ 'MadLoopCommons.f','MadLoopParams.inc','global_specs.inc']
1887
1888 # We should move to MadLoop5_resources directory from the SubProcesses
1889-
1890 ln(pjoin(os.path.pardir,os.path.pardir,'MadLoopParams.dat'),
1891 pjoin('..','MadLoop5_resources'))
1892
1893@@ -3090,17 +3098,31 @@
1894 libpath,"lib%s.a"%tir,tir_name=tir)
1895 setattr(self,tir_dir,libpath)
1896 if libpath != "":
1897- if tir in ['pjfry','ninja','golem', 'samurai']:
1898+ if tir in ['pjfry','ninja','golem', 'samurai','collier']:
1899 # We should link dynamically when possible, so we use the original
1900 # location of these libraries.
1901 link_tir_libs.append('-L%s/ -l%s'%(libpath,tir))
1902 tir_libs.append('%s/lib%s.$(libext)'%(libpath,tir))
1903- # We must add the corresponding includes for golem, samurai
1904- # and ninja
1905- if tir in ['golem','samurai','ninja']:
1906+ # For Ninja, we must also link against OneLoop.
1907+ if tir in ['ninja']:
1908+ if not any(os.path.isfile(pjoin(libpath,'libavh_olo.%s'%ext))
1909+ for ext in ['a','dylib','so']):
1910+ raise MadGraph5Error(
1911+"The OneLOop library 'libavh_olo.(a|dylib|so)' could no be found in path '%s'. Please place a symlink to it there."%libpath)
1912+ link_tir_libs.append('-L%s/ -l%s'%(libpath,'avh_olo'))
1913+ tir_libs.append('%s/lib%s.$(libext)'%(libpath,'avh_olo'))
1914+ # We must add the corresponding includes for these TIR
1915+ if tir in ['golem','samurai','ninja','collier']:
1916 trg_path = pjoin(os.path.dirname(libpath),'include')
1917- to_include = misc.find_includes_path(trg_path,
1918+ if os.path.isdir(trg_path):
1919+ to_include = misc.find_includes_path(trg_path,
1920 self.include_names[tir])
1921+ else:
1922+ to_include = None
1923+ # Special possible location for collier
1924+ if to_include is None and tir=='collier':
1925+ to_include = misc.find_includes_path(
1926+ pjoin(libpath,'modules'),self.include_names[tir])
1927 if to_include is None:
1928 logger.error(
1929 'Could not find the include directory for %s, looking in %s.\n' % (tir ,str(trg_path))+
1930@@ -3170,7 +3192,8 @@
1931 writer = writers.FortranWriter(os.path.join(self.dir_path,
1932 "SubProcesses","MadLoopCommons.f"))
1933 writer.writelines(MadLoopCommon%{
1934- 'print_banner_commands':self.MadLoop_banner})
1935+ 'print_banner_commands':self.MadLoop_banner},
1936+ context={'collier_available':self.tir_available_dict['collier']})
1937 writer.close()
1938
1939 # link the files from the MODEL
1940@@ -3280,14 +3303,21 @@
1941 print_weighted=False))
1942 plot.draw()
1943
1944+ # We also need to write the overall maximum quantities for this group
1945+ # of processes in 'global_specs.inc'. In aMCatNLO, there is always
1946+ # only one process, so this is trivial
1947+ self.write_global_specs(matrix_element)
1948+ open('unique_id.inc','w').write(
1949+""" integer UNIQUE_ID
1950+ parameter(UNIQUE_ID=1)""")
1951+
1952 linkfiles = ['coupl.inc', 'mp_coupl.inc', 'mp_coupl_same_name.inc',
1953 'cts_mprec.h', 'cts_mpc.h', 'MadLoopParamReader.f',
1954- 'MadLoopParams.inc','MadLoopCommons.f']
1955+ 'MadLoopParams.inc','MadLoopCommons.f','global_specs.inc']
1956
1957 for file in linkfiles:
1958 ln('../../%s' % file)
1959-
1960-
1961+
1962 os.system("ln -s ../../makefile_loop makefile")
1963
1964 # We should move to MadLoop5_resources directory from the SubProcesses
1965
1966=== modified file 'madgraph/iolibs/export_v4.py'
1967--- madgraph/iolibs/export_v4.py 2016-04-16 23:51:09 +0000
1968+++ madgraph/iolibs/export_v4.py 2016-06-24 21:04:21 +0000
1969@@ -102,9 +102,11 @@
1970
1971 calls = 0
1972 if isinstance(matrix_elements, group_subprocs.SubProcessGroupList):
1973+ unique_id=1
1974 for (group_number, me_group) in enumerate(matrix_elements):
1975 calls = calls + self.generate_subprocess_directory_v4(\
1976- me_group, fortran_model, group_number)
1977+ me_group, fortran_model, group_number, unique_id=unique_id)
1978+ unique_id += len(me_group.get('matrix_elements'))
1979 else:
1980 for me_number, me in enumerate(matrix_elements.get_matrix_elements()):
1981 calls = calls + self.generate_subprocess_directory_v4(\
1982@@ -112,7 +114,16 @@
1983
1984 return calls
1985
1986-
1987+ #===========================================================================
1988+ # Generate an include file with global quantities about all ME's output.
1989+ #===========================================================================
1990+ def write_global_specs(self, matrix_elements):
1991+ """ Writes the file global_specs.inc which contains general information
1992+ about *all* the ME's output in this directory."""
1993+
1994+ # Do nothing here, but daughter classes such as LoopOptimizedExporterFortran
1995+ # overwrites this.
1996+ pass
1997
1998 #===========================================================================
1999 # create the run_card
2000@@ -4462,10 +4473,12 @@
2001 #===========================================================================
2002 def generate_subprocess_directory_v4(self, subproc_group,
2003 fortran_model,
2004- group_number):
2005+ group_number,
2006+ unique_id=None):
2007 """Generate the Pn directory for a subprocess group in MadEvent,
2008 including the necessary matrix_N.f files, configs.inc and various
2009- other helper files"""
2010+ other helper files. Unique_id is dummy here, but not in
2011+ LoopInducedExporterMEGroup, so it must be kept."""
2012
2013 assert isinstance(subproc_group, group_subprocs.SubProcessGroup), \
2014 "subproc_group object not SubProcessGroup"
2015@@ -6261,34 +6274,58 @@
2016 else:
2017 curr_proc = None
2018
2019- requires_ninja = opt['loop_optimized_output'] and (not curr_proc is None) and \
2020- (curr_proc.get('perturbation_couplings') != [] and \
2021- not curr_proc.get('NLO_mode') in [None,'real','tree','LO','LOonly'])
2022+ requires_reduction_tool = opt['loop_optimized_output'] and \
2023+ (not curr_proc is None) and \
2024+ (curr_proc.get('perturbation_couplings') != [] and \
2025+ not curr_proc.get('NLO_mode') in [None,'real','tree','LO','LOonly'])
2026 # An installation is required then, but only if the specified path is the
2027 # default local one and that the Ninja library appears missing.
2028- if requires_ninja and (not opt['ninja'] is None) and\
2029+ if requires_reduction_tool:
2030+ if (not opt['ninja'] is None) and\
2031 os.path.abspath(opt['ninja'])==pjoin(MG5DIR,'HEPTools','lib') and\
2032 not os.path.isfile(pjoin(MG5DIR,'HEPTools','lib','libninja.a')):
2033- # Then install Ninja here from the tarballs in the vendor
2034- # directory so that it would work offline too.
2035- logger.info(
2036+ # Then install Ninja here from the tarballs in the vendor
2037+ # directory so that it would work offline too.
2038+ logger.info(
2039 """MG5aMC will now install the loop reduction tool 'Ninja' from the local offline installer.
2040 Use the command 'install ninja' if you want to update to the latest online version.
2041 This installation can take some time but only needs to be performed once.""",'$MG:color:GREEN')
2042- try:
2043- cmd.do_install('ninja',paths={'HEPToolsInstaller':
2044+ try:
2045+ cmd.do_install('ninja',paths={'HEPToolsInstaller':
2046 pjoin(MG5DIR,'vendor','OfflineHEPToolsInstaller.tar.gz')},
2047- additional_options=[
2048+ additional_options=[
2049 '--ninja_tarball=%s'%pjoin(MG5DIR,'vendor','ninja.tar.gz'),
2050 '--oneloop_tarball=%s'%pjoin(MG5DIR,'vendor','oneloop.tar.gz')])
2051- except InvalidCmd:
2052+ except InvalidCmd:
2053 logger.warning(
2054 """The offline installation of Ninja was unsuccessful, and MG5aMC disabled it.
2055 In the future, if you want to reactivate Ninja, you can do so by re-attempting
2056 its online installation with the command 'install ninja' or install it on your
2057 own and set the path to its library in the MG5aMC option 'ninja'.""")
2058 cmd.exec_cmd("set ninja ''")
2059- cmd.exec_cmd('save options')
2060+ cmd.exec_cmd('save options')
2061+ if (not opt['collier'] is None) and\
2062+ os.path.abspath(opt['collier'])==pjoin(MG5DIR,'HEPTools','lib') and\
2063+ not os.path.isfile(pjoin(MG5DIR,'HEPTools','lib','libcollier.a')):
2064+ # Then install Collier here from the tarballs in the vendor
2065+ # directory so that it would work offline too.
2066+ logger.info(
2067+"""MG5aMC will now install the loop reduction tool 'COLLIER' from the local offline installer.
2068+Use the command 'install collier' if you want to update to the latest online version.
2069+This installation can take some time but only needs to be performed once.""",'$MG:color:GREEN')
2070+ try:
2071+ cmd.do_install('collier',paths={'HEPToolsInstaller':
2072+ pjoin(MG5DIR,'vendor','OfflineHEPToolsInstaller.tar.gz')},
2073+ additional_options=[
2074+ '--collier_tarball=%s'%pjoin(MG5DIR,'vendor','collier.tar.gz')])
2075+ except InvalidCmd:
2076+ logger.warning(
2077+"""The offline installation of COLLIER was unsuccessful, and MG5aMC disabled it.
2078+In the future, if you want to reactivate COLLIER, you can do so by re-attempting
2079+its online installation with the command 'install collier' or install it on your
2080+own and set the path to its library in the MG5aMC option 'collier'.""")
2081+ cmd.exec_cmd("set collier ''")
2082+ cmd.exec_cmd('save options')
2083
2084
2085 # ==========================================================================
2086@@ -6304,6 +6341,7 @@
2087 'golem_dir':cmd.options['golem'],
2088 'samurai_dir':cmd.options['samurai'],
2089 'ninja_dir':cmd.options['ninja'],
2090+ 'collier_dir':cmd.options['collier'],
2091 'fortran_compiler':cmd.options['fortran_compiler'],
2092 'f2py_compiler':cmd.options['f2py_compiler'],
2093 'output_dependencies':cmd.options['output_dependencies'],
2094@@ -6431,10 +6469,12 @@
2095 #===========================================================================
2096 def generate_subprocess_directory_v4(self, subproc_group,
2097 fortran_model,
2098- group_number):
2099+ group_number,
2100+ unique_id=None):
2101 """Generate the Pn directory for a subprocess group in MadEvent,
2102 including the necessary matrix_N.f files, configs.inc and various
2103- other helper files"""
2104+ other helper files. Unique_id is dummy here, but not in
2105+ LoopInducedExporterMEGroup, so it must be kept."""
2106
2107 if not isinstance(subproc_group, group_subprocs.SubProcessGroup):
2108 raise base_objects.PhysicsObject.PhysicsObjectError,\
2109
2110=== modified file 'madgraph/iolibs/template_files/loop/check_sa.inc'
2111--- madgraph/iolibs/template_files/loop/check_sa.inc 2016-02-17 21:24:01 +0000
2112+++ madgraph/iolibs/template_files/loop/check_sa.inc 2016-06-24 21:04:21 +0000
2113@@ -262,6 +262,7 @@
2114 write(*,*) 'Estimated accuracy could not be computed for an unknown reason.'
2115 endif
2116 endif
2117+ Write (*,'(1x,a23,3x,i3)') 'MadLoop return code =',RETURNCODE
2118 write (*,*) "---------------------------------"
2119 IF (NBORNCHOSEN.EQ.0) THEN
2120 write (*,*) "No Born contribution satisfied the squared order constraints."
2121
2122=== modified file 'madgraph/iolibs/template_files/loop/check_sa_loop_induced.inc'
2123--- madgraph/iolibs/template_files/loop/check_sa_loop_induced.inc 2016-02-17 21:24:01 +0000
2124+++ madgraph/iolibs/template_files/loop/check_sa_loop_induced.inc 2016-06-24 21:04:21 +0000
2125@@ -241,6 +241,7 @@
2126 write(*,*) 'Estimated accuracy could not be computed for an unknown reason.'
2127 endif
2128 endif
2129+ Write (*,'(1x,a23,3x,i3)') 'MadLoop return code =',RETURNCODE
2130 write (*,*) "---------------------------------"
2131 IF (NLOOPCHOSEN.ne.NSQUAREDSO) THEN
2132 write (*,*) "Selected squared coupling orders combination for the loop summed result below:"
2133
2134=== added file 'madgraph/iolibs/template_files/loop_optimized/COLLIER_interface.inc'
2135--- madgraph/iolibs/template_files/loop_optimized/COLLIER_interface.inc 1970-01-01 00:00:00 +0000
2136+++ madgraph/iolibs/template_files/loop_optimized/COLLIER_interface.inc 2016-06-24 21:04:21 +0000
2137@@ -0,0 +1,646 @@
2138+ SUBROUTINE %(proc_prefix)sCOLLIERLOOP(CTMODE, NLOOPLINE,RANK,PL,PDEN,M2L,TIRCOEFS,TIRCOEFSERRORS)
2139+C
2140+%(info_lines)s
2141+C
2142+C Interface between MG5 and COLLIER.
2143+C It supports any rank when 1 < NLOOPLINE < 7.
2144+C
2145+%(process_lines)s
2146+C
2147+C
2148+C MODULES
2149+C
2150+ USE COLLIER
2151+ IMPLICIT NONE
2152+C
2153+C CONSTANTS
2154+C
2155+ LOGICAL checkPConservation
2156+ PARAMETER (checkPConservation=.TRUE.)
2157+ %(real_dp_format)s PIVALUE
2158+ PARAMETER(PIVALUE=3.14159265358979323846D0)
2159+ integer MAXRANK
2160+ parameter (MAXRANK=%(maxrank)d)
2161+ INTEGER NLOOPGROUPS
2162+ PARAMETER (NLOOPGROUPS=%(nloop_groups)d)
2163+ include 'loop_max_coefs.inc'
2164+C
2165+C ARGUMENTS
2166+C
2167+ INTEGER NLOOPLINE, RANK, CTMODE
2168+ %(real_dp_format)s PL(0:3,NLOOPLINE)
2169+ %(real_dp_format)s PDEN(0:3,NLOOPLINE-1)
2170+ %(mass_dp_format)s M2L(NLOOPLINE)
2171+ %(complex_dp_format)s RES(3)
2172+ %(complex_dp_format)s TIRCOEFS(0:LOOPMAXCOEFS-1,3)
2173+ %(complex_dp_format)s TIRCOEFSERRORS(0:LOOPMAXCOEFS-1,3)
2174+
2175+C
2176+C LOCAL VARIABLES
2177+C
2178+ INTEGER N, I, J, K, L
2179+ INTEGER C0,C1,C2,C3
2180+ INTEGER N_CACHES
2181+ INTEGER CURR_RANK, SGN
2182+ INTEGER CURR_INDEX
2183+ INTEGER CURR_MAXCOEF
2184+ %(real_dp_format)s RBUFF(0:3)
2185+
2186+ INTEGER COEFMAP_ZERO(0:LOOPMAXCOEFS-1)
2187+ INTEGER COEFMAP_ONE(0:LOOPMAXCOEFS-1)
2188+ INTEGER COEFMAP_TWO(0:LOOPMAXCOEFS-1)
2189+ INTEGER COEFMAP_THREE(0:LOOPMAXCOEFS-1)
2190+ %(collier_coefmap)s
2191+
2192+ %(real_dp_format)s REF_NORMALIZATION
2193+
2194+ double complex M2LCOLLIER(0:NLOOPLINE-1)
2195+ double complex MomVec(0:3,NLOOPLINE-1)
2196+ double complex MomInv((NLOOPLINE*(NLOOPLINE-1))/2)
2197+
2198+ double complex TNten(0:RANK,0:RANK,0:RANK,0:RANK)
2199+ double complex TNtenuv(0:RANK,0:RANK,0:RANK,0:RANK)
2200+ double precision TNtenerr(0:RANK)
2201+
2202+ %(real_dp_format)s MaxCoefForRank(0:RANK)
2203+
2204+C These quantities are for the pole evaluation
2205+ double complex TNten_UV(0:RANK,0:RANK,0:RANK,0:RANK)
2206+ double complex TNtenuv_UV(0:RANK,0:RANK,0:RANK,0:RANK)
2207+ double precision TNtenerr_UV(0:RANK)
2208+ double complex TNten_IR1(0:RANK,0:RANK,0:RANK,0:RANK)
2209+ double complex TNtenuv_IR1(0:RANK,0:RANK,0:RANK,0:RANK)
2210+ double precision TNtenerr_IR1(0:RANK)
2211+ double complex TNten_IR2(0:RANK,0:RANK,0:RANK,0:RANK)
2212+ double complex TNtenuv_IR2(0:RANK,0:RANK,0:RANK,0:RANK)
2213+ double precision TNtenerr_IR2(0:RANK)
2214+C
2215+C GLOBAL VARIABLES
2216+C
2217+ include 'coupl.inc'
2218+ include 'MadLoopParams.inc'
2219+ include 'unique_id.inc'
2220+ include 'global_specs.inc'
2221+
2222+## if(not AmplitudeReduction) {
2223+ INTEGER ID,SQSOINDEX,R
2224+ common/%(proc_prefix)sLOOP/ID,SQSOINDEX,R
2225+## }else{
2226+ INTEGER ID,R
2227+ common/%(proc_prefix)sLOOP/ID,R
2228+## }
2229+
2230+C
2231+C These global variables cache the coefficients already computed by COLLIER
2232+C so that they can be reused. In particular, in CTMODE 2, the cached ERROR
2233+C quantities for eahc rank will be used to make use of COLLIER's internal
2234+C assessment of the numerical accuracy.
2235+C
2236+ logical LOOP_ID_DONE(NLOOPGROUPS)
2237+ DATA LOOP_ID_DONE/NLOOPGROUPS*.FALSE./
2238+ %(complex_dp_format)s TIR_COEFS_DIRECT_MODE(0:LOOPMAXCOEFS-1,3,NLOOPGROUPS)
2239+ %(real_dp_format)s TIR_COEFS_ERROR(0:MAXRANK,NLOOPGROUPS)
2240+ common/%(proc_prefix)sCOLLIER_TIR_COEFS/TIR_COEFS_DIRECT_MODE,TIR_COEFS_ERROR,LOOP_ID_DONE
2241+
2242+ INTEGER COLLIER_CACHE_ACTIVE, NCALLS_IN_CACHE(4), NCOLLIERCALLS(4)
2243+ LOGICAL MUST_INIT_EVENT
2244+ COMMON/%(proc_prefix)sCOLLIER_CACHE_STATUS/COLLIER_CACHE_ACTIVE,NCALLS_IN_CACHE, NCOLLIERCALLS,MUST_INIT_EVENT
2245+
2246+ LOGICAL CTINIT, TIRINIT, GOLEMINIT, SAMURAIINIT, NINJAINIT, COLLIERINIT
2247+ COMMON/REDUCTIONCODEINIT/CTINIT, TIRINIT,GOLEMINIT,SAMURAIINIT,NINJAINIT, COLLIERINIT
2248+
2249+C ----------
2250+C BEGIN CODE
2251+C ----------
2252+
2253+ IF (COLLIERUseCacheForPoles) THEN
2254+ N_CACHES = 4
2255+ ELSE
2256+ N_CACHES =1
2257+ ENDIF
2258+
2259+C Initialize COLLIER if needed
2260+ IF (COLLIERINIT) THEN
2261+ COLLIERINIT=.FALSE.
2262+ CALL INITCOLLIER()
2263+ ENDIF
2264+
2265+C Initialize the event if it is the first time collier is called on this PS point
2266+ IF(MUST_INIT_EVENT) THEN
2267+ MUST_INIT_EVENT = .False.
2268+ IF (COLLIERGlobalCache.eq.0) THEN
2269+ CALL InitEvent_cll()
2270+ ELSE
2271+ DO I=1,N_CACHES
2272+C Record how many events where put in the cache. On the first PS point.
2273+ IF (NCALLS_IN_CACHE(I).eq.-1.AND.NCOLLIERCALLS(I).gt.0) THEN
2274+ NCALLS_IN_CACHE(I) = NCOLLIERCALLS(I)
2275+ ENDIF
2276+ ENDDO
2277+ DO I=1,N_CACHES
2278+C Now apply a safety check that our last event had as many calls as the cache is setup for.
2279+C The only case for now when it can be half of the calls when we are doing the true loop-direction test with also the computation of a rotated PS point (which is computed for one mode only).
2280+ IF (NCALLS_IN_CACHE(I).ne.-1.and..NOT. ( NCOLLIERCALLS(I).eq.NCALLS_IN_CACHE(I).or. ( CTModeRun.eq.-1.and..not.COLLIERUseInternalStabilityTest.and.NRotations_DP.gt.0.and.MOD(NCALLS_IN_CACHE(I),2).eq.0.and.(NCALLS_IN_CACHE(I)/2).eq.NCOLLIERCALLS(I) ) ) ) then
2281+ WRITE(*,*) 'WARNING: A consistency check in MadLoop failed and, for safety, forced MadLoop to reinitialize the global cache of COLLIER. Report this to MadLoop authors. The problematic cache was number ',I
2282+ IF (COLLIERGLOBALCACHE.EQ.-1) THEN
2283+ CALL INITCACHESYSTEM_CLL(N_CACHES*NPROCS,MAXNEXTERNAL)
2284+ ELSE
2285+ CALL INITCACHESYSTEM_CLL(N_CACHES*NPROCS,COLLIERGLOBALCACHE)
2286+ ENDIF
2287+C Make sure all caches are switched off at first.
2288+ call SwitchOffCacheSystem_cll()
2289+C Reset the cache design property
2290+ NCALLS_IN_CACHE(:) = -1
2291+ NCOLLIERCALLS(:) = 0
2292+ IF (COLLIER_CACHE_ACTIVE.eq.1) THEN
2293+ CALL SwitchOnCache_cll((unique_id-1)*N_CACHES+1)
2294+ ENDIF
2295+C No need to check the other caches since we already had to reset here.
2296+ EXIT
2297+ ENDIF
2298+ ENDDO
2299+ CALL InitEvent_cll((UNIQUE_ID-1)*N_CACHES+1)
2300+ NCOLLIERCALLS(1) = 0
2301+ IF(COLLIERComputeUVpoles.and.COLLIERUseCacheForPoles) THEN
2302+ CALL InitEvent_cll((UNIQUE_ID-1)*N_CACHES+2)
2303+ NCOLLIERCALLS(2) = 0
2304+ ENDIF
2305+ IF(COLLIERComputeIRpoles.and.COLLIERUseCacheForPoles) THEN
2306+ CALL InitEvent_cll((UNIQUE_ID-1)*N_CACHES+3)
2307+ NCOLLIERCALLS(3) = 0
2308+ CALL InitEvent_cll((UNIQUE_ID-1)*N_CACHES+4)
2309+ NCOLLIERCALLS(4) = 0
2310+ ENDIF
2311+ ENDIF
2312+ CALL SetDeltaIR_cll(0.0d0,(PIVALUE**2)/6.0d0)
2313+ CALL SetDeltaUV_cll(0.0d0)
2314+ CALL SetMuIR2_cll(mu_r**2)
2315+ CALL SetMuUV2_cll(mu_r**2)
2316+ ENDIF
2317+
2318+C Now really start the reduction with COLLIER
2319+
2320+C Number of coefficients for the current rank
2321+ CURR_MAXCOEF = 0
2322+ DO I=0,RANK
2323+ CURR_MAXCOEF=CURR_MAXCOEF+(3+I)*(2+I)*(1+I)/6
2324+ ENDDO
2325+
2326+ IF (CTMODE.ne.1.and.CTMODE.ne.2) THEN
2327+ WRITE(*,*) 'ERROR: COLLIER only support the computational mode CTMODE equal to 1 or 2, not',CTMODE
2328+ stop 'Incorrect computational mode specified to the COLLIER MG5aMC interface.'
2329+ ENDIF
2330+
2331+ DO I=0,CURR_MAXCOEF-1
2332+ DO K=1,3
2333+ TIRCOEFSERRORS(I,K)=DCMPLX(0.0d0,0.0d0)
2334+ ENDDO
2335+ ENDDO
2336+
2337+ IF (COLLIERUseInternalStabilityTest) THEN
2338+C Use MADLOOP internal cache dedicated to COLLIER that emulates the CTMODE 2
2339+ IF (LOOP_ID_DONE(ID)) THEN
2340+ DO I=0,CURR_MAXCOEF-1
2341+ DO K=1,3
2342+ TIRCOEFS(I,K)=TIR_COEFS_DIRECT_MODE(I,K,ID)
2343+ ENDDO
2344+ ENDDO
2345+ DO I=0,RANK
2346+ MaxCoefForRank(I) = 0.0d0
2347+ ENDDO
2348+ DO I=0,CURR_MAXCOEF-1
2349+ CURR_RANK = COEFMAP_ZERO(I)+COEFMAP_ONE(I)+COEFMAP_TWO(I)+COEFMAP_THREE(I)
2350+ MaxCoefForRank(CURR_RANK)=max(MaxCoefForRank(CURR_RANK),abs(TIR_COEFS_DIRECT_MODE(I,1,ID)))
2351+ ENDDO
2352+ DO I=0,CURR_MAXCOEF-1
2353+ CURR_RANK = COEFMAP_ZERO(I)+COEFMAP_ONE(I)+COEFMAP_TWO(I)+COEFMAP_THREE(I)
2354+ IF (MaxCoefForRank(CURR_RANK).ne.0.0d0) THEN
2355+ DO K=1,3
2356+C The expression below is like taking the absolute value when summing errors linearly
2357+C TIRCOEFSERRORS(I,K)=(TIR_COEFS_ERROR(CURR_RANK,ID)/MaxCoefForRank(CURR_RANK))*DCMPLX( ABS(DBLE(TIRCOEFS(I,K))),ABS(DIMAG(TIRCOEFS(I,K))) )
2358+C But empirically, I observed that retaining the original complex phase leads to slightly more accurate estimates
2359+ TIRCOEFSERRORS(I,K)=(TIR_COEFS_ERROR(CURR_RANK,ID)/MaxCoefForRank(CURR_RANK))*TIRCOEFS(I,K)
2360+ ENDDO
2361+ ENDIF
2362+ ENDDO
2363+ RETURN
2364+ ENDIF
2365+ ELSE
2366+C Apply the loop-direction switching here.
2367+ CALL %(proc_prefix)sSWITCH_ORDER(CTMODE,NLOOPLINE,PL,PDEN,M2L)
2368+ ENDIF
2369+
2370+C Make sure masses are complex
2371+ do I=1,NLOOPLINE
2372+ M2LCOLLIER(I-1)=DCMPLX(M2L(I))
2373+ ENDDO
2374+
2375+C Now convert the loop offset momenta to COLLIER conventions
2376+ DO i=0,3
2377+ DO j=1,NLOOPLINE-1
2378+ MomVec(i,j)=DCMPLX(PDEN(i,j),0.0d0)
2379+ ENDDO
2380+ ENDDO
2381+
2382+C This first do loop spans over 'N' in '\foreach_N \foreach_i(k_i+k_{i+1}+..+k_{i+N})^2'
2383+ CURR_INDEX = 0
2384+ DO N=0,NLOOPLINE-1
2385+C We stop whenever we reached the target number of invariants
2386+ IF (CURR_INDEX.GE.((NLOOPLINE*(NLOOPLINE-1))/2)) THEN
2387+ EXIT
2388+ ENDIF
2389+C This do loop spans over 'i' in the expression above.
2390+ DO I=1,NLOOPLINE
2391+ IF (CURR_INDEX.GE.((NLOOPLINE*(NLOOPLINE-1))/2)) THEN
2392+ EXIT
2393+ ENDIF
2394+
2395+ CURR_INDEX = CURR_INDEX+1
2396+ RBUFF(:) = 0.0D0
2397+ DO J=I,I+N
2398+ RBUFF(:) = RBUFF(:) + PL(:,MOD(J-1,NLOOPLINE)+1)
2399+ ENDDO
2400+ MomInv(CURR_INDEX) = DCMPLX(RBUFF(0)**2-RBUFF(1)**2-RBUFF(2)**2-RBUFF(3)**2,0.0d0)
2401+
2402+C Now regularize the onshell behavior of the kinematic invarients
2403+C All loop masses are tested, but that might be a bit too inclusive.
2404+ DO K=1,NLOOPLINE
2405+ IF(ABS(M2L(K)).NE.0.0d0) THEN
2406+ IF(ABS((MomInv(CURR_INDEX)-M2L(K))/M2L(K)).LT.OSTHRES) THEN
2407+ MomInv(CURR_INDEX)=DCMPLX(M2L(K))
2408+ ENDIF
2409+ ENDIF
2410+ ENDDO
2411+C For the massless onshell-case, we base the threshold only on the energy component
2412+ REF_NORMALIZATION=0.0D0
2413+ DO L=0,0
2414+ REF_NORMALIZATION = REF_NORMALIZATION + ABS(RBUFF(L))
2415+ ENDDO
2416+ REF_NORMALIZATION = (REF_NORMALIZATION/(N+1))**2
2417+ IF(REF_NORMALIZATION.NE.0.0D0)THEN
2418+ IF(ABS(MomInv(CURR_INDEX)/REF_NORMALIZATION).LT.OSTHRES)THEN
2419+ MomInv(CURR_INDEX)=DCMPLX(0.0d0,0.0d0)
2420+ ENDIF
2421+ ENDIF
2422+
2423+ ENDDO
2424+ ENDDO
2425+
2426+C We can now call COLLIER
2427+ IF (NLOOPLINE.ne.1) THEN
2428+ CALL TNten_cll(TNten, TNtenuv, MomVec, MomInv, M2LCOLLIER, NLOOPLINE, RANK, TNtenerr)
2429+ ELSE
2430+ CALL TNten_cll(TNten, TNtenuv, M2LCOLLIER, NLOOPLINE, RANK, TNtenerr)
2431+ ENDIF
2432+ IF (COLLIER_CACHE_ACTIVE.eq.1) THEN
2433+ NCOLLIERCALLS(1) = NCOLLIERCALLS(1)+1
2434+ ENDIF
2435+
2436+C Now compute the UV poles if asked for
2437+ IF (COLLIERComputeUVpoles) THEN
2438+ IF(COLLIER_CACHE_ACTIVE.eq.1) THEN
2439+ CALL SwitchOffCache_cll((unique_id-1)*N_CACHES+1)
2440+ IF(COLLIERUseCacheForPoles) THEN
2441+ CALL SwitchOnCache_cll((unique_id-1)*N_CACHES+2)
2442+ ENDIF
2443+ ENDIF
2444+ CALL SetDeltaUV_cll(1.0d0)
2445+ IF (NLOOPLINE.ne.1) THEN
2446+ CALL TNten_cll(TNten_UV, TNtenuv_UV, MomVec, MomInv, M2LCOLLIER, NLOOPLINE, RANK, TNtenerr_UV)
2447+ ELSE
2448+ CALL TNten_cll(TNten_UV, TNtenuv_UV, M2LCOLLIER, NLOOPLINE, RANK, TNtenerr_UV)
2449+ ENDIF
2450+ IF (COLLIER_CACHE_ACTIVE.eq.1) THEN
2451+ NCOLLIERCALLS(2) = NCOLLIERCALLS(2)+1
2452+ ENDIF
2453+ IF(COLLIER_CACHE_ACTIVE.eq.1) THEN
2454+ IF(COLLIERUseCacheForPoles) THEN
2455+ CALL SwitchOffCache_cll((unique_id-1)*N_CACHES+2)
2456+ ENDIF
2457+ CALL SwitchOnCache_cll((unique_id-1)*N_CACHES+1)
2458+ ENDIF
2459+ CALL SetDeltaUV_cll(0.0d0)
2460+ ENDIF
2461+
2462+C Now compute the IR poles if asked for
2463+ IF (COLLIERComputeIRpoles) THEN
2464+ IF(COLLIER_CACHE_ACTIVE.eq.1) THEN
2465+ CALL SwitchOffCache_cll((unique_id-1)*N_CACHES+1)
2466+ IF(COLLIERUseCacheForPoles) THEN
2467+ CALL SwitchOnCache_cll((unique_id-1)*N_CACHES+3)
2468+ ENDIF
2469+ ENDIF
2470+ CALL SetDeltaIR_cll(1.0d0,(PIVALUE**2)/6.0d0)
2471+ IF (NLOOPLINE.ne.1) THEN
2472+ CALL TNten_cll(TNten_IR1, TNtenuv_IR1, MomVec, MomInv, M2LCOLLIER, NLOOPLINE, RANK, TNtenerr_IR1)
2473+ ELSE
2474+ CALL TNten_cll(TNten_IR1, TNtenuv_IR1, M2LCOLLIER, NLOOPLINE, RANK, TNtenerr_IR1)
2475+ ENDIF
2476+ IF (COLLIER_CACHE_ACTIVE.eq.1) THEN
2477+ NCOLLIERCALLS(3) = NCOLLIERCALLS(3)+1
2478+ ENDIF
2479+ IF(COLLIER_CACHE_ACTIVE.eq.1.AND.COLLIERUseCacheForPoles) THEN
2480+ CALL SwitchOffCache_cll((unique_id-1)*N_CACHES+3)
2481+ CALL SwitchOnCache_cll((unique_id-1)*N_CACHES+4)
2482+ ENDIF
2483+ CALL SetDeltaIR_cll(0.0d0,1.0d0+(PIVALUE**2)/6.0d0)
2484+ IF (NLOOPLINE.ne.1) THEN
2485+ CALL TNten_cll(TNten_IR2, TNtenuv_IR2, MomVec, MomInv, M2LCOLLIER, NLOOPLINE, RANK, TNtenerr_IR2)
2486+ ELSE
2487+ CALL TNten_cll(TNten_IR2, TNtenuv_IR2, M2LCOLLIER, NLOOPLINE, RANK, TNtenerr_IR2)
2488+ ENDIF
2489+ IF (COLLIER_CACHE_ACTIVE.eq.1) THEN
2490+ NCOLLIERCALLS(4) = NCOLLIERCALLS(4)+1
2491+ ENDIF
2492+ IF(COLLIER_CACHE_ACTIVE.eq.1) THEN
2493+ IF(COLLIERUseCacheForPoles) THEN
2494+ CALL SwitchOffCache_cll((unique_id-1)*N_CACHES+4)
2495+ ENDIF
2496+ CALL SwitchOnCache_cll((unique_id-1)*N_CACHES+1)
2497+ ENDIF
2498+ CALL SetDeltaIR_cll(0.0d0,(PIVALUE**2)/6.0d0)
2499+ ENDIF
2500+
2501+ DO I=0,(CURR_MAXCOEF-1)
2502+ C0 = COEFMAP_ZERO(I)
2503+ C1 = COEFMAP_ONE(I)
2504+ C2 = COEFMAP_TWO(I)
2505+ C3 = COEFMAP_THREE(I)
2506+ CURR_RANK = C0+C1+C2+C3
2507+C Because we must set q -> -q, we apply a minus sign to coefs of odd rank
2508+ IF (MOD(CURR_RANK,2).eq.1) THEN
2509+ SGN = -1
2510+ ELSE
2511+ SGN = 1
2512+ ENDIF
2513+ TIRCOEFS(I,1) = SGN*TNten(C0,C1,C2,C3)
2514+ IF (COLLIERComputeUVpoles) THEN
2515+ TIRCOEFS(I,2) = SGN*( TNten_UV(C0,C1,C2,C3)-TNten(C0,C1,C2,C3) )
2516+ ELSE
2517+ TIRCOEFS(I,2) = DCMPLX(0.0d0,0.0d0)
2518+ ENDIF
2519+ IF (COLLIERComputeIRpoles) THEN
2520+ TIRCOEFS(I,2) = TIRCOEFS(I,2) + SGN*( TNten_IR1(C0,C1,C2,C3)-TNten(C0,C1,C2,C3) )
2521+ TIRCOEFS(I,3) = SGN*( TNten_IR2(C0,C1,C2,C3)-TNten(C0,C1,C2,C3) )
2522+ ELSE
2523+ TIRCOEFS(I,3) = DCMPLX(0.0d0,0.0d0)
2524+ ENDIF
2525+ ENDDO
2526+
2527+ IF (COLLIERUseInternalStabilityTest) THEN
2528+c Finish by caching the coefficients and error just computed
2529+ LOOP_ID_DONE(ID) = .TRUE.
2530+ DO J=0,CURR_MAXCOEF-1
2531+ DO K=1,3
2532+ TIR_COEFS_DIRECT_MODE(J,K,ID) = TIRCOEFS(J,K)
2533+ ENDDO
2534+ ENDDO
2535+ DO J=0,RANK
2536+ TIR_COEFS_ERROR(J,ID)=TNtenerr(J)
2537+ ENDDO
2538+
2539+C Now compute the errors on each coefficient
2540+ DO I=0,RANK
2541+ MaxCoefForRank(I) = 0.0d0
2542+ ENDDO
2543+ DO I=0,CURR_MAXCOEF-1
2544+ CURR_RANK = COEFMAP_ZERO(I)+COEFMAP_ONE(I)+COEFMAP_TWO(I)+COEFMAP_THREE(I)
2545+ MaxCoefForRank(CURR_RANK)=max(MaxCoefForRank(CURR_RANK),abs(TIRCOEFS(I,1)))
2546+ ENDDO
2547+ DO I=0,CURR_MAXCOEF-1
2548+ CURR_RANK = COEFMAP_ZERO(I)+COEFMAP_ONE(I)+COEFMAP_TWO(I)+COEFMAP_THREE(I)
2549+ IF (MaxCoefForRank(CURR_RANK).ne.0.0d0) THEN
2550+ DO K=1,3
2551+C The expression below is like taking the absolute value when summing errors linearly
2552+C TIRCOEFSERRORS(I,K)=(TNtenerr(CURR_RANK)/MaxCoefForRank(CURR_RANK))*DCMPLX( ABS(DBLE(TIRCOEFS(I,K))),ABS(DIMAG(TIRCOEFS(I,K))) )
2553+C But empirically, I observed that retaining the original complex phase leads to slightly more accurate estimates
2554+ TIRCOEFSERRORS(I,K)=(TNtenerr(CURR_RANK)/MaxCoefForRank(CURR_RANK))*TIRCOEFS(I,K)
2555+ ENDDO
2556+ ENDIF
2557+ ENDDO
2558+
2559+ ENDIF
2560+
2561+ END SUBROUTINE %(proc_prefix)sCOLLIERLOOP
2562+
2563+ SUBROUTINE %(proc_prefix)sCLEAR_COLLIER_CACHE()
2564+
2565+ USE COLLIER
2566+
2567+ include 'loop_max_coefs.inc'
2568+ INTEGER NLOOPGROUPS
2569+ PARAMETER (NLOOPGROUPS=%(nloop_groups)d)
2570+ integer MAXRANK
2571+ parameter (MAXRANK=%(maxrank)d)
2572+
2573+ integer I,J,K
2574+
2575+ include 'MadLoopParams.inc'
2576+
2577+ logical LOOP_ID_DONE(NLOOPGROUPS)
2578+ %(complex_dp_format)s TIR_COEFS_DIRECT_MODE(0:LOOPMAXCOEFS-1,3,NLOOPGROUPS)
2579+ %(complex_dp_format)s TIR_COEFS_ERROR(0:MAXRANK,NLOOPGROUPS)
2580+ common/%(proc_prefix)sCOLLIER_TIR_COEFS/TIR_COEFS_DIRECT_MODE,TIR_COEFS_ERROR,LOOP_ID_DONE
2581+
2582+ INTEGER COLLIER_CACHE_ACTIVE, NCALLS_IN_CACHE(4), NCOLLIERCALLS(4)
2583+ LOGICAL MUST_INIT_EVENT
2584+ COMMON/%(proc_prefix)sCOLLIER_CACHE_STATUS/COLLIER_CACHE_ACTIVE,NCALLS_IN_CACHE, NCOLLIERCALLS,MUST_INIT_EVENT
2585+
2586+C Make sure that next time the COLLIER Subroutine is called it will call the subroutine initEvent of Collier.
2587+ MUST_INIT_EVENT = .True.
2588+
2589+C Reinitialize the ML cache for COLLIER
2590+ DO I=1,NLOOPGROUPS
2591+ LOOP_ID_DONE(I) = .FALSE.
2592+ DO J=0,LOOPMAXCOEFS-1
2593+ DO K=1,3
2594+ TIR_COEFS_DIRECT_MODE(J,K,I) = DCMPLX(0.0d0,0.0d0)
2595+ ENDDO
2596+ ENDDO
2597+ DO J=0,MAXRANK
2598+ TIR_COEFS_ERROR(J,I)=0.0d0
2599+ ENDDO
2600+ ENDDO
2601+
2602+ END
2603+
2604+ SUBROUTINE %(proc_prefix)sSET_COLLIER_GLOBAL_CACHE(ONOFF)
2605+C
2606+C This routine is used by loop_matrix.f to turn on the global
2607+C cache of COLLIER when it the main SLOOP subroutine starts and
2608+C turn it off when it ends.
2609+C However several checks are performed to verify that it is safe
2610+C to turn it on and to reinitialize it if necessary.
2611+C
2612+C MODULES
2613+C
2614+ USE COLLIER
2615+ implicit none
2616+C
2617+C ARGUMENTS
2618+C
2619+ LOGICAL ONOFF
2620+C
2621+C LOCAL VARIABLES
2622+C
2623+ LOGICAL NEED_REINITIALIZATION
2624+ INTEGER N_CACHES
2625+C
2626+C GLOBAL VARIABLES
2627+C
2628+C
2629+C This common blocks saves the relevant ML parameters when activating the
2630+C global cache of COLLIER so that we know when we must reinitialize it.
2631+C COLLIER_CACHE_ACTIVE is set to -1 when it has never been turned on yet and
2632+C to 1 for 'Active' and 0 for 'Inactive'.
2633+C The integer NCALLS_IN_CACHE saves how many calls the cache is setup for, for each of the up to four caches.
2634+C When it is the first PS points, it is set to -1.
2635+ INTEGER COLLIER_CACHE_ACTIVE, NCALLS_IN_CACHE(4), NCOLLIERCALLS(4)
2636+ DATA COLLIER_CACHE_ACTIVE/-1/
2637+ DATA NCALLS_IN_CACHE/-1,-1,-1,-1/
2638+ DATA NCOLLIERCALLS/0,0,0,0/
2639+C This is a flag to tell the COLLIER subroutine that it must init the event when called.
2640+ LOGICAL MUST_INIT_EVENT
2641+ DATA MUST_INIT_EVENT/.TRUE./
2642+ COMMON/%(proc_prefix)sCOLLIER_CACHE_STATUS/COLLIER_CACHE_ACTIVE, NCALLS_IN_CACHE, NCOLLIERCALLS,MUST_INIT_EVENT
2643+
2644+ LOGICAL COLLIERUseInternalStabilityTest_BU
2645+ INTEGER USERHEL_BU, SQSO_TARGET_BU, COLLIERMode_BU,CTModeRun_BU
2646+ COMMON/%(proc_prefix)sCOLLIER_CACHE_RELEVANT_PARAMS/USERHEL_BU,SQSO_TARGET_BU,COLLIERMode_BU,CTModeRun_BU,COLLIERUseInternalStabilityTest_BU
2647+
2648+C The common blocks below are to retrieve the necessary information about
2649+C MadLoop running mode and store it in the sCOLLIER_CACHE_RELEVANT_PARAMS common block.
2650+
2651+ include 'MadLoopParams.inc'
2652+ include 'unique_id.inc'
2653+ include 'global_specs.inc'
2654+
2655+ LOGICAL CTINIT, TIRINIT, GOLEMINIT, SAMURAIINIT, NINJAINIT, COLLIERINIT
2656+ COMMON/REDUCTIONCODEINIT/CTINIT, TIRINIT,GOLEMINIT,SAMURAIINIT,NINJAINIT, COLLIERINIT
2657+
2658+ LOGICAL CHECKPHASE
2659+ LOGICAL HELDOUBLECHECKED
2660+ common/%(proc_prefix)sINIT/CHECKPHASE, HELDOUBLECHECKED
2661+
2662+ INTEGER USERHEL
2663+ common/%(proc_prefix)sUSERCHOICE/USERHEL
2664+
2665+ INTEGER SQSO_TARGET
2666+ common/%(proc_prefix)sSOCHOICE/SQSO_TARGET
2667+
2668+C
2669+C BEGIN CODE
2670+C
2671+
2672+ IF (COLLIERUseCacheForPoles) THEN
2673+ N_CACHES = 4
2674+ ELSE
2675+ N_CACHES =1
2676+ ENDIF
2677+
2678+C Do nothing if COLLIER still has to be initialized or if global caches are disabled
2679+ IF(COLLIERINIT.OR.COLLIERGlobalCache.eq.0) THEN
2680+ RETURN
2681+ ENDIF
2682+
2683+C Never activate anything in the checkphase
2684+ IF (ONOFF.AND.CHECKPHASE) THEN
2685+ RETURN
2686+ ENDIF
2687+
2688+C Handle the request of turning off the caching
2689+ IF (.NOT.ONOFF) THEN
2690+ IF (COLLIER_CACHE_ACTIVE.eq.1) THEN
2691+ CALL SwitchOffCache_cll((unique_id-1)*4+1)
2692+ COLLIER_CACHE_ACTIVE = 0
2693+ ENDIF
2694+C If we were asked to turn the cache off but it was already so, then do nothing
2695+ RETURN
2696+ ENDIF
2697+
2698+C Handle the request of turning on the caching
2699+
2700+C If asked to activate it but already active, then do nothing
2701+ IF (ONOFF.AND.COLLIER_CACHE_ACTIVE.eq.1) THEN
2702+ RETURN
2703+ ENDIF
2704+
2705+C We are now in the position where we are asked to activate the global cache but it was *not* already active.
2706+
2707+C If we activate it for the first time, make sure to store the value of the relevant parameters, activate and return.
2708+ IF (COLLIER_CACHE_ACTIVE.eq.-1) THEN
2709+ USERHEL_BU = USERHEL
2710+ SQSO_TARGET_BU = SQSO_TARGET
2711+ COLLIERMode_BU = COLLIERMode
2712+ COLLIERUseInternalStabilityTest_BU = COLLIERUseInternalStabilityTest
2713+ CTModeRun_BU = CTModeRun
2714+ CALL SwitchOnCache_cll((unique_id-1)*4+1)
2715+ COLLIER_CACHE_ACTIVE = 1
2716+ RETURN
2717+ ENDIF
2718+
2719+C Now perform sanity check before the activation to decide if we need to reinitialize the cache system first.
2720+ NEED_REINITIALIZATION = .FALSE.
2721+
2722+ IF (SQSO_TARGET.NE.SQSO_TARGET_BU) THEN
2723+ NEED_REINITIALIZATION = .TRUE.
2724+ ENDIF
2725+
2726+ IF (COLLIERMode.NE.COLLIERMode_BU) THEN
2727+ NEED_REINITIALIZATION = .TRUE.
2728+ ENDIF
2729+
2730+ IF (COLLIERUseInternalStabilityTest.NEQV.COLLIERUseInternalStabilityTest_BU) THEN
2731+ NEED_REINITIALIZATION = .TRUE.
2732+ ENDIF
2733+
2734+ IF (CTModeRun_BU.ne.CTModeRun.and.(.not.COLLIERUseInternalStabilityTest)) THEN
2735+ NEED_REINITIALIZATION = .TRUE.
2736+ ENDIF
2737+
2738+## if(AmplitudeReduction){
2739+C When doing amplitude reduction, the parameter USERHEL impacts the number of COLLIER calls/order if
2740+C it involves a different number of helicity configurations or always if the Loop filter is on, which
2741+C it should almost never be by now.
2742+ IF(UseLoopFilter.and.(USERHEL.ne.USERHEL_BU)) THEN
2743+ NEED_REINITIALIZATION = .TRUE.
2744+ ENDIF
2745+ IF((USERHEL.eq.-1).and.(USERHEL_BU.ne.-1)) THEN
2746+ NEED_REINITIALIZATION = .TRUE.
2747+ ENDIF
2748+ IF((USERHEL.ne.-1).and.(USERHEL_BU.eq.-1)) THEN
2749+ NEED_REINITIALIZATION = .TRUE.
2750+ ENDIF
2751+## }else{
2752+C When doing amplitude reduction the parameter USERHEL does not impact the number/order of COLLIER calls
2753+C except if the LoopFilter is ON which really shouldn't be the case anymore.
2754+ IF(UseLoopFilter.and.(USERHEL.ne.USERHEL_BU)) THEN
2755+ NEED_REINITIALIZATION = .TRUE.
2756+ ENDIF
2757+## }
2758+
2759+ IF(NEED_REINITIALIZATION) THEN
2760+C Log the event because if it happens a lot of time and floods the screen, the user must see it
2761+C and either change its usage of MadLoop or turnoff COLLIER cache
2762+ WRITE(*,*) 'INFO: MadLoop detected that the global cache of COLLIER had to be reset because of a change in your use of MadLoop. This should not happend for each event.'
2763+ USERHEL_BU = USERHEL
2764+ SQSO_TARGET_BU = SQSO_TARGET
2765+ COLLIERMode_BU = COLLIERMode
2766+ COLLIERUseInternalStabilityTest_BU = COLLIERUseInternalStabilityTest
2767+ CTModeRun_BU = CTModeRun
2768+ IF (COLLIERGLOBALCACHE.EQ.-1) THEN
2769+ CALL INITCACHESYSTEM_CLL(N_CACHES*NPROCS,MAXNEXTERNAL)
2770+ ELSE
2771+ CALL INITCACHESYSTEM_CLL(N_CACHES*NPROCS,COLLIERGLOBALCACHE)
2772+ ENDIF
2773+ NCOLLIERCALLS(:) = 0
2774+ NCALLS_IN_CACHE(:) = -1
2775+C Make sure all caches are switched off at first.
2776+ call SwitchOffCacheSystem_cll()
2777+ ENDIF
2778+
2779+C Now we can finally activate the cache
2780+ CALL SwitchOnCache_cll((unique_id-1)*4+1)
2781+ COLLIER_CACHE_ACTIVE = 1
2782+
2783+ END
2784
2785=== modified file 'madgraph/iolibs/template_files/loop_optimized/CT_interface.inc'
2786--- madgraph/iolibs/template_files/loop_optimized/CT_interface.inc 2016-04-28 23:52:58 +0000
2787+++ madgraph/iolibs/template_files/loop_optimized/CT_interface.inc 2016-06-24 21:04:21 +0000
2788@@ -34,8 +34,8 @@
2789 C
2790 %(complex_dp_format)s R1, ACC
2791 INTEGER I, J, K
2792- LOGICAL CTINIT, TIRINIT, GOLEMINIT, SAMURAIINIT, NINJAINIT
2793- COMMON/REDUCTIONCODEINIT/CTINIT,TIRINIT,GOLEMINIT,SAMURAIINIT,NINJAINIT
2794+ LOGICAL CTINIT, TIRINIT, GOLEMINIT, SAMURAIINIT, NINJAINIT,COLLIERINIT
2795+ COMMON/REDUCTIONCODEINIT/CTINIT,TIRINIT,GOLEMINIT,SAMURAIINIT,NINJAINIT,COLLIERINIT
2796 C
2797 C EXTERNAL FUNCTIONS
2798 C
2799@@ -351,8 +351,8 @@
2800 %(complex_dp_format)s R1, ACC
2801 INTEGER I, J, K
2802 %(real_dp_format)s PDEN_DUMMY(0:3,NLOOPLINE-1)
2803- LOGICAL CTINIT, TIRINIT, GOLEMINIT, SAMURAIINIT, NINJAINIT
2804- COMMON/REDUCTIONCODEINIT/CTINIT,TIRINIT,GOLEMINIT,SAMURAIINIT,NINJAINIT
2805+ LOGICAL CTINIT, TIRINIT, GOLEMINIT, SAMURAIINIT, NINJAINIT,COLLIERINIT
2806+ COMMON/REDUCTIONCODEINIT/CTINIT,TIRINIT,GOLEMINIT,SAMURAIINIT,NINJAINIT,COLLIERINIT
2807 C
2808 C EXTERNAL FUNCTIONS
2809 C
2810@@ -649,8 +649,8 @@
2811 C
2812 include 'coupl.inc'
2813
2814- LOGICAL CTINIT, TIRINIT, GOLEMINIT, SAMURAIINIT, NINJAINIT
2815- COMMON/REDUCTIONCODEINIT/CTINIT,TIRINIT,GOLEMINIT,SAMURAIINIT,NINJAINIT
2816+ LOGICAL CTINIT, TIRINIT, GOLEMINIT, SAMURAIINIT, NINJAINIT,COLLIERINIT
2817+ COMMON/REDUCTIONCODEINIT/CTINIT,TIRINIT,GOLEMINIT,SAMURAIINIT,NINJAINIT,COLLIERINIT
2818
2819 %(real_dp_format)s LSCALE
2820 INTEGER CTMODE
2821@@ -875,8 +875,8 @@
2822 C
2823 include 'coupl.inc'
2824
2825- LOGICAL CTINIT, TIRINIT, GOLEMINIT, SAMURAIINIT, NINJAINIT
2826- COMMON/REDUCTIONCODEINIT/CTINIT,TIRINIT,GOLEMINIT,SAMURAIINIT,NINJAINIT
2827+ LOGICAL CTINIT, TIRINIT, GOLEMINIT, SAMURAIINIT, NINJAINIT,COLLIERINIT
2828+ COMMON/REDUCTIONCODEINIT/CTINIT,TIRINIT,GOLEMINIT,SAMURAIINIT,NINJAINIT,COLLIERINIT
2829
2830 %(real_dp_format)s LSCALE
2831 INTEGER CTMODE
2832
2833=== modified file 'madgraph/iolibs/template_files/loop_optimized/GOLEM_interface.inc'
2834--- madgraph/iolibs/template_files/loop_optimized/GOLEM_interface.inc 2016-03-10 00:23:21 +0000
2835+++ madgraph/iolibs/template_files/loop_optimized/GOLEM_interface.inc 2016-06-24 21:04:21 +0000
2836@@ -103,8 +103,8 @@
2837 common/%(proc_prefix)sLOOP/ID,R
2838 ## }
2839
2840- LOGICAL CTINIT, TIRINIT, GOLEMINIT, SAMURAIINIT, NINJAINIT
2841- COMMON/REDUCTIONCODEINIT/CTINIT, TIRINIT,GOLEMINIT,SAMURAIINIT,NINJAINIT
2842+ LOGICAL CTINIT, TIRINIT, GOLEMINIT, SAMURAIINIT, NINJAINIT,COLLIERINIT
2843+ COMMON/REDUCTIONCODEINIT/CTINIT, TIRINIT,GOLEMINIT,SAMURAIINIT,NINJAINIT,COLLIERINIT
2844
2845 INTEGER NLOOPGROUPS
2846 PARAMETER (NLOOPGROUPS=%(nloop_groups)d)
2847
2848=== modified file 'madgraph/iolibs/template_files/loop_optimized/TIR_interface.inc'
2849--- madgraph/iolibs/template_files/loop_optimized/TIR_interface.inc 2016-03-10 00:23:21 +0000
2850+++ madgraph/iolibs/template_files/loop_optimized/TIR_interface.inc 2016-06-24 21:04:21 +0000
2851@@ -43,14 +43,14 @@
2852 C
2853 INTEGER I, J, K
2854 INTEGER NLOOPCOEFS
2855- LOGICAL CTINIT, TIRINIT, GOLEMINIT, SAMURAIINIT, NINJAINIT
2856- COMMON/REDUCTIONCODEINIT/CTINIT,TIRINIT,GOLEMINIT,SAMURAIINIT,NINJAINIT
2857+ LOGICAL CTINIT, TIRINIT, GOLEMINIT, SAMURAIINIT, NINJAINIT,COLLIERINIT
2858+ COMMON/REDUCTIONCODEINIT/CTINIT,TIRINIT,GOLEMINIT,SAMURAIINIT,NINJAINIT,COLLIERINIT
2859
2860 c This variable will be used to detect changes in the TIR library used so as to force the reset of the TIR filter.
2861 INTEGER LAST_LIB_USED
2862 DATA LAST_LIB_USED/-1/
2863
2864- %(complex_dp_format)s TIRCOEFS(0:LOOPMAXCOEFS-1,3)
2865+ %(complex_dp_format)s TIRCOEFS(0:LOOPMAXCOEFS-1,3),TIRCOEFSERRORS(0:LOOPMAXCOEFS-1,3)
2866 %(complex_dp_format)s PJCOEFS(0:LOOPMAXCOEFS-1,3)
2867 ## if(TIRCaching){
2868 integer TIR_CACHE_INDEX
2869@@ -72,9 +72,13 @@
2870 %(real_dp_format)s LSCALE
2871 common/%(proc_prefix)sCT/LSCALE,CTMODE
2872
2873-C The variables below are just for monitoring purposes.
2874+## if(not AmplitudeReduction) {
2875 INTEGER ID,SQSOINDEX,R
2876- COMMON/%(proc_prefix)sLOOP/ID,SQSOINDEX,R
2877+ common/%(proc_prefix)sLOOP/ID,SQSOINDEX,R
2878+## }else{
2879+ INTEGER ID,R
2880+ common/%(proc_prefix)sLOOP/ID,R
2881+## }
2882
2883 c The argument ILIB is the TIR library to be used for that specific library.
2884 INTEGER LIBINDEX
2885@@ -178,9 +182,9 @@
2886 enddo
2887
2888 do I=0,3
2889- do J=1,(NLOOPLINE-1)
2890- PDEN(I,J)=PCT(I,J)
2891- enddo
2892+ do J=1,(NLOOPLINE-1)
2893+ PDEN(I,J)=PCT(I,J)
2894+ enddo
2895 enddo
2896 C NUMBER OF INDEPEDENT LOOPCOEFS FOR RANK=RANK
2897 NLOOPCOEFS=0
2898@@ -220,6 +224,23 @@
2899 WRITE(*,*) 'ERROR:: IREGI is not interfaced.'
2900 STOP
2901 ## }
2902+ CASE(7)
2903+C COLLIER
2904+## if(collier_available){
2905+ CALL %(proc_prefix)sCOLLIERLOOP(CTMODE,NLOOPLINE,RANK,PL,PDEN,M2L,TIRCOEFS,TIRCOEFSERRORS)
2906+C Shift the TIR coefficients by the corresponding COLLIER error if in CTMODE 2.
2907+ if (COLLIERUseInternalStabilityTest.and.CTMODE.eq.2) THEN
2908+C We add here the numerical inaccuracies linearly to be conservative
2909+ DO I=1,3
2910+ DO J=0,NLOOPCOEFS-1
2911+ TIRCOEFS(J,I)=TIRCOEFS(J,I)+TIRCOEFSERRORS(J,I)
2912+ ENDDO
2913+ ENDDO
2914+ ENDIF
2915+## } else {
2916+ WRITE(*,*) 'ERROR:: COLLIER is not interfaced.'
2917+ STOP
2918+## }
2919 END SELECT
2920 ## if(TIRCaching){
2921 C The zero index is dummy and means no caching at all since TIR_CACHE_SIZE=0.
2922@@ -262,6 +283,8 @@
2923 C WRITE(*,*) 'PJFry: Loop ID',ID,' =',RES(1),RES(2),RES(3)
2924 C ELSEIF(MLReductionLib(I_LIB).EQ.3) THEN
2925 C WRITE(*,*) 'Iregi: Loop ID',ID,' =',RES(1),RES(2),RES(3)
2926+C ELSEIF(MLReductionLib(I_LIB).EQ.7) THEN
2927+C WRITE(*,*) 'COLLIER: Loop ID',ID,' =',RES(1),RES(2),RES(3)
2928 C ENDIF
2929 END
2930
2931@@ -385,8 +408,8 @@
2932 C GLOBAL VARIABLES
2933 C
2934 include 'MadLoopParams.inc'
2935- LOGICAL CTINIT, TIRINIT, GOLEMINIT, SAMURAIINIT, NINJAINIT
2936- COMMON/REDUCTIONCODEINIT/CTINIT,TIRINIT,GOLEMINIT,SAMURAIINIT,NINJAINIT
2937+ LOGICAL CTINIT, TIRINIT, GOLEMINIT, SAMURAIINIT, NINJAINIT,COLLIERINIT
2938+ COMMON/REDUCTIONCODEINIT/CTINIT,TIRINIT,GOLEMINIT,SAMURAIINIT,NINJAINIT,COLLIERINIT
2939
2940 C ----------
2941 C BEGIN CODE
2942@@ -428,7 +451,7 @@
2943 C CONSTANTS
2944 C
2945 INTEGER NLOOPLIB
2946- PARAMETER (NLOOPLIB=4)
2947+ PARAMETER (NLOOPLIB=7)
2948 INTEGER QP_NLOOPLIB
2949 ## if(ninja_supports_quad_prec) {
2950 PARAMETER (QP_NLOOPLIB=2)
2951@@ -479,8 +502,8 @@
2952 ENDIF
2953 ENDDO
2954 IF(J_LIB.EQ.0)THEN
2955- SELECT_LIBINDEX=SELECT_LIBINDEX+1
2956- IF(SELECT_LIBINDEX.GT.NLOOPLIB.OR.MLReductionLib(SELECT_LIBINDEX).EQ.0)SELECT_LIBINDEX=1
2957+ SELECT_LIBINDEX=SELECT_LIBINDEX+1
2958+ IF(SELECT_LIBINDEX.GT.NLOOPLIB.OR.MLReductionLib(SELECT_LIBINDEX).EQ.0)SELECT_LIBINDEX=1
2959 ENDIF
2960 ENDDO
2961 I=J_LIB
2962
2963=== modified file 'madgraph/iolibs/template_files/loop_optimized/loop_matrix_standalone.inc'
2964--- madgraph/iolibs/template_files/loop_optimized/loop_matrix_standalone.inc 2016-04-05 23:57:17 +0000
2965+++ madgraph/iolibs/template_files/loop_optimized/loop_matrix_standalone.inc 2016-06-24 21:04:21 +0000
2966@@ -97,9 +97,9 @@
2967 INTEGER NSQUAREDSOP1
2968 PARAMETER (NSQUAREDSOP1=NSQUAREDSO+1)
2969 C The total number of loop reduction libraries
2970-C At present, there are only CutTools,PJFry++,IREGI,Golem95,Samurai and Ninja
2971+C At present, there are only CutTools,PJFry++,IREGI,Golem95,Samurai, Ninja and COLLIER
2972 INTEGER NLOOPLIB
2973- PARAMETER (NLOOPLIB=6)
2974+ PARAMETER (NLOOPLIB=7)
2975 C Only CutTools or possibly Ninja (if installed with qp support) provide QP
2976 INTEGER QP_NLOOPLIB
2977 ## if(ninja_supports_quad_prec) {
2978@@ -235,6 +235,7 @@
2979 C GLOBAL VARIABLES
2980 C
2981 include 'process_info.inc'
2982+ include 'unique_id.inc'
2983 include 'coupl.inc'
2984 include 'mp_coupl.inc'
2985 include 'MadLoopParams.inc'
2986@@ -267,20 +268,20 @@
2987 DATA MP_DONE/.FALSE./
2988 common/%(proc_prefix)sMP_DONE/MP_DONE
2989 C A FLAG TO DENOTE WHETHER THE CORRESPONDING LOOPLIBS ARE AVAILABLE OR NOT
2990- LOGICAL LOOPLIBS_AVAILABLE(6)
2991+ LOGICAL LOOPLIBS_AVAILABLE(NLOOPLIB)
2992 DATA LOOPLIBS_AVAILABLE/%(data_looplibs_av)s/
2993 common/%(proc_prefix)sLOOPLIBS_AV/ LOOPLIBS_AVAILABLE
2994 C A FLAG TO DENOTE WHETHER THE CORRESPONDING DIRECTION TESTS AVAILABLE OR NOT IN THE LOOPLIBS
2995- LOGICAL LOOPLIBS_DIRECTEST(6)
2996- DATA LOOPLIBS_DIRECTEST /.TRUE.,.TRUE.,.TRUE.,.TRUE.,.TRUE.,.TRUE./
2997+ LOGICAL LOOPLIBS_DIRECTEST(NLOOPLIB)
2998+ DATA LOOPLIBS_DIRECTEST /.TRUE.,.TRUE.,.TRUE.,.TRUE.,.TRUE.,.TRUE.,.TRUE./
2999 C Specifying for which reduction tool quadruple precision is available.
3000 C The index 0 is dummy and simply means that the corresponding loop_library is not available
3001 C in which case neither is its quadruple precision version.
3002- LOGICAL LOOPLIBS_QPAVAILABLE(0:6)
3003+ LOGICAL LOOPLIBS_QPAVAILABLE(0:7)
3004 ## if(ninja_supports_quad_prec) {
3005- DATA LOOPLIBS_QPAVAILABLE /.FALSE.,.TRUE.,.FALSE.,.FALSE.,.FALSE.,.FALSE.,.TRUE./
3006+ DATA LOOPLIBS_QPAVAILABLE /.FALSE.,.TRUE.,.FALSE.,.FALSE.,.FALSE.,.FALSE.,.TRUE.,.FALSE./
3007 ## } else {
3008- DATA LOOPLIBS_QPAVAILABLE /.FALSE.,.TRUE.,.FALSE.,.FALSE.,.FALSE.,.FALSE.,.FALSE./
3009+ DATA LOOPLIBS_QPAVAILABLE /.FALSE.,.TRUE.,.FALSE.,.FALSE.,.FALSE.,.FALSE.,.FALSE.,.FALSE./
3010 ## }
3011 C PS CAN POSSIBILY BE PASSED THROUGH IMPROVE_PS BUT IS NOT MODIFIED FOR THE PURPOSE OF THE STABILITY TEST
3012 C EVEN THOUGH THEY ARE PUT IN COMMON BLOCK, FOR NOW THEY ARE NOT USED ANYWHERE ELSE
3013@@ -329,7 +330,7 @@
3014 DATA CT_REQ_SO_DONE/.FALSE./
3015 DATA MP_CT_REQ_SO_DONE/.FALSE./
3016 DATA LOOP_REQ_SO_DONE/.FALSE./
3017- DATA MP_LOOP_REQ_SO_DONE/.FALSE./
3018+ DATA MP_LOOP_REQ_SO_DONE/.FALSE./
3019 DATA CTCALL_REQ_SO_DONE/.FALSE./
3020 DATA FILTER_SO/.FALSE./
3021 common/%(proc_prefix)sSO_REQS/UVCT_REQ_SO_DONE,MP_UVCT_REQ_SO_DONE,CT_REQ_SO_DONE,MP_CT_REQ_SO_DONE,LOOP_REQ_SO_DONE,MP_LOOP_REQ_SO_DONE,CTCALL_REQ_SO_DONE,FILTER_SO
3022@@ -345,11 +346,10 @@
3023 integer I_LIB
3024 DATA I_LIB/1/
3025 common/%(proc_prefix)sI_LIB/I_LIB
3026-C UTIL NOW, ONLY CUTTOOLS PROVIDE QP
3027- LOGICAL QP_TOOLS_AVAILABLE
3028- DATA QP_TOOLS_AVAILABLE/.FALSE./
3029- INTEGER INDEX_QP_TOOLS(QP_NLOOPLIB+1)
3030- common/%(proc_prefix)sLOOP_TOOLS/QP_TOOLS_AVAILABLE,INDEX_QP_TOOLS
3031+ LOGICAL QP_TOOLS_AVAILABLE
3032+ DATA QP_TOOLS_AVAILABLE/.FALSE./
3033+ INTEGER INDEX_QP_TOOLS(QP_NLOOPLIB+1)
3034+ common/%(proc_prefix)sLOOP_TOOLS/QP_TOOLS_AVAILABLE,INDEX_QP_TOOLS
3035
3036 ## if(not LoopInduced) {
3037 %(complex_dp_format)s AMP(NBORNAMPS)
3038@@ -420,9 +420,16 @@
3039 DATA MP_DONE_ONCE/.FALSE./
3040 common/%(proc_prefix)sMP_DONE_ONCE/MP_DONE_ONCE
3041
3042- character(512) MLPath
3043+ character(512) MLPath
3044 common/MLPATH/MLPath
3045
3046+C This is just so that if the user disabled the computation of poles by COLLIER
3047+C using the MadLoop subroutine, we don't overwrite his choice when reading the parameters
3048+ LOGICAL FORCED_CHOICE_OF_COLLIER_UV_POLE_COMPUTATION, FORCED_CHOICE_OF_COLLIER_IR_POLE_COMPUTATION
3049+ LOGICAL COLLIER_UV_POLE_COMPUTATION_CHOICE, COLLIER_IR_POLE_COMPUTATION_CHOICE
3050+ DATA FORCED_CHOICE_OF_COLLIER_UV_POLE_COMPUTATION,FORCED_CHOICE_OF_COLLIER_IR_POLE_COMPUTATION/.FALSE.,.FALSE./
3051+ COMMON/%(proc_prefix)sCOLLIERPOLESFORCEDCHOICE/FORCED_CHOICE_OF_COLLIER_UV_POLE_COMPUTATION, FORCED_CHOICE_OF_COLLIER_IR_POLE_COMPUTATION,COLLIER_UV_POLE_COMPUTATION_CHOICE,COLLIER_IR_POLE_COMPUTATION_CHOICE
3052+
3053 C This variable controls the general initialization which is *common* between all MadLoop SubProcesses.
3054 C For example setting the MadLoopPath or reading the ML runtime parameters.
3055 LOGICAL ML_INIT
3056@@ -440,6 +447,7 @@
3057 LOGICAL FPE_IN_DP_REDUCTION, FPE_IN_QP_REDUCTION
3058 data FPE_IN_DP_REDUCTION, FPE_IN_QP_REDUCTION/.FALSE.,.FALSE./
3059 COMMON/%(proc_prefix)sFPE_IN_REDUCTION/FPE_IN_DP_REDUCTION, FPE_IN_QP_REDUCTION
3060+
3061 C ----------
3062 C BEGIN CODE
3063 C ----------
3064@@ -451,6 +459,12 @@
3065 CALL setMadLoopPath(TMP)
3066 CALL JOINPATH(MLPATH,PARAMFNAME,PARAMFN)
3067 CALL MADLOOPPARAMREADER(PARAMFN,.TRUE.)
3068+ IF (FORCED_CHOICE_OF_COLLIER_UV_POLE_COMPUTATION) THEN
3069+ COLLIERComputeUVpoles = COLLIER_UV_POLE_COMPUTATION_CHOICE
3070+ ENDIF
3071+ IF (FORCED_CHOICE_OF_COLLIER_IR_POLE_COMPUTATION) THEN
3072+ COLLIERComputeIRpoles = COLLIER_IR_POLE_COMPUTATION_CHOICE
3073+ ENDIF
3074 IF (FORBID_HEL_DOUBLECHECK) THEN
3075 DoubleCheckHelicityFilter = .False.
3076 ENDIF
3077@@ -801,6 +815,11 @@
3078 CALL %(proc_prefix)sCLEAR_CACHES()
3079 ENDIF
3080
3081+## if(collier_available){
3082+C Now make sure to turn on the global COLLIER cache if applicable
3083+CALL %(proc_prefix)sSET_COLLIER_GLOBAL_CACHE(.TRUE.)
3084+## }
3085+
3086 IF (ImprovePSPoint.ge.0) THEN
3087 C Make the input PS more precise (exact onshell and energy-momentum conservation)
3088 CALL %(proc_prefix)sIMPROVE_PS_POINT_PRECISION(PS)
3089@@ -1812,14 +1831,27 @@
3090 IF (AUTOMATIC_CACHE_CLEARING) THEN
3091 CALL %(proc_prefix)sCLEAR_CACHES()
3092 ENDIF
3093+
3094+## if(collier_available){
3095+C Now make sure to turn off the global COLLIER cache if applicable
3096+CALL %(proc_prefix)sSET_COLLIER_GLOBAL_CACHE(.FALSE.)
3097+## }
3098+
3099 END
3100
3101 SUBROUTINE %(proc_prefix)sCLEAR_CACHES()
3102-C Clears all the caches used at some point in MadLoop
3103+C
3104+C This routine can be called directly from the user if
3105+C AUTOMATIC_CACHE_CLEARING is set to False. It must then be called after
3106+C ech event
3107+C
3108 CALL %(proc_prefix)sCLEAR_TIR_CACHE()
3109 ## if(ninja_available){
3110 call ninja_clear_integral_cache()
3111 ## }
3112+## if(collier_available){
3113+ call %(proc_prefix)sCLEAR_COLLIER_CACHE()
3114+## }
3115 END
3116
3117 C --=========================================--
3118@@ -1952,6 +1984,13 @@
3119 real*8 accuracies(3)
3120 real*8 list(maxstabilitylength)
3121
3122+C
3123+C GLOBAL VARIABLES
3124+C
3125+ integer I_LIB
3126+ common/%(proc_prefix)sI_LIB/I_LIB
3127+ include 'MadLoopParams.inc'
3128+
3129 C ----------
3130 C BEGIN CODE
3131 C ----------
3132@@ -1998,6 +2037,13 @@
3133 if (avg.ne.0.0d0) then
3134 acc(k) = acc(k) / ( ABS(AVG) / 3.0d0)
3135 endif
3136+
3137+C When using COLLIER with the internal stability test, the first evaluation is typically more reliable so we do not want to use the average but rather the first evaluation.
3138+ IF (MLREDUCTIONLIB(I_LIB).eq.7.and.COLLIERUseInternalStabilityTest) THEN
3139+ DO I=1,3
3140+ estimate(i,k) = fulllist(i,k,1)
3141+ ENDDO
3142+ ENDIF
3143
3144 enddo
3145
3146@@ -2326,6 +2372,46 @@
3147 C Definition of additional access routines
3148 C --=========================================--
3149
3150+ SUBROUTINE %(proc_prefix)sCOLLIER_COMPUTE_UV_POLES(ONOFF)
3151+C
3152+C This function can be called by the MadLoop user so as to chose to have COLLIER
3153+C compute the UV pole or not (it costs more time).
3154+C
3155+ LOGICAL ONOFF
3156+
3157+ include 'MadLoopParams.inc'
3158+
3159+ LOGICAL FORCED_CHOICE_OF_COLLIER_UV_POLE_COMPUTATION, FORCED_CHOICE_OF_COLLIER_IR_POLE_COMPUTATION
3160+ LOGICAL COLLIER_UV_POLE_COMPUTATION_CHOICE, COLLIER_IR_POLE_COMPUTATION_CHOICE
3161+ COMMON/%(proc_prefix)sCOLLIERPOLESFORCEDCHOICE/FORCED_CHOICE_OF_COLLIER_UV_POLE_COMPUTATION, FORCED_CHOICE_OF_COLLIER_IR_POLE_COMPUTATION,COLLIER_UV_POLE_COMPUTATION_CHOICE,COLLIER_IR_POLE_COMPUTATION_CHOICE
3162+
3163+ COLLIERComputeUVpoles = ONOFF
3164+C This is just so that if we read the param again, we don't overwrite the choice made here
3165+ FORCED_CHOICE_OF_COLLIER_UV_POLE_COMPUTATION = .TRUE.
3166+ COLLIER_UV_POLE_COMPUTATION_CHOICE = ONOFF
3167+
3168+ END SUBROUTINE
3169+
3170+ SUBROUTINE %(proc_prefix)sCOLLIER_COMPUTE_IR_POLES(ONOFF)
3171+C
3172+C This function can be called by the MadLoop user so as to chose to have COLLIER
3173+C compute the IR pole or not (it costs more time).
3174+C
3175+ LOGICAL ONOFF
3176+
3177+ include 'MadLoopParams.inc'
3178+
3179+ LOGICAL FORCED_CHOICE_OF_COLLIER_UV_POLE_COMPUTATION, FORCED_CHOICE_OF_COLLIER_IR_POLE_COMPUTATION
3180+ LOGICAL COLLIER_UV_POLE_COMPUTATION_CHOICE, COLLIER_IR_POLE_COMPUTATION_CHOICE
3181+ COMMON/%(proc_prefix)sCOLLIERPOLESFORCEDCHOICE/FORCED_CHOICE_OF_COLLIER_UV_POLE_COMPUTATION, FORCED_CHOICE_OF_COLLIER_IR_POLE_COMPUTATION,COLLIER_UV_POLE_COMPUTATION_CHOICE,COLLIER_IR_POLE_COMPUTATION_CHOICE
3182+
3183+ COLLIERComputeIRpoles = ONOFF
3184+C This is just so that if we read the param again, we don't overwrite the choice made here
3185+ FORCED_CHOICE_OF_COLLIER_IR_POLE_COMPUTATION = .TRUE.
3186+ COLLIER_IR_POLE_COMPUTATION_CHOICE = ONOFF
3187+
3188+ END SUBROUTINE
3189+
3190 SUBROUTINE %(proc_prefix)sFORCE_STABILITY_CHECK(ONOFF)
3191 C
3192 C This function can be called by the MadLoop user so as to always have stability
3193
3194=== modified file 'madgraph/iolibs/template_files/matrix_loop_induced_madevent.inc'
3195--- madgraph/iolibs/template_files/matrix_loop_induced_madevent.inc 2016-02-18 03:09:50 +0000
3196+++ madgraph/iolibs/template_files/matrix_loop_induced_madevent.inc 2016-06-24 21:04:21 +0000
3197@@ -125,6 +125,9 @@
3198
3199 IF(.NOT.INIT_MADLOOP) THEN
3200 INIT_MADLOOP = .TRUE.
3201+C We don't use the poles, so let's not compute them with COLLIER
3202+ CALL %(ml_prefix)sCOLLIER_COMPUTE_UV_POLES(.False.)
3203+ CALL %(ml_prefix)sCOLLIER_COMPUTE_IR_POLES(.False.)
3204 C Unless this is the first iteration, make sure to never double check the helicity filter again
3205 IF (read_grid_file) THEN
3206 CALL SET_FORBID_HEL_DOUBLECHECK(.True.)
3207@@ -392,7 +395,7 @@
3208 return
3209 endif
3210
3211- IF (((OneEps+TwoEps)/finite).gt.(1000d0*PREC).AND.(((OneEps+TwoEps)/finite).gt.1.0d-5)) THEN
3212+ IF (U.NE.7.AND.((OneEps+TwoEps)/finite).gt.(1000d0*PREC).AND.(((OneEps+TwoEps)/finite).gt.1.0d-5)) THEN
3213 WARNING_COUNTERS(2) = WARNING_COUNTERS(2) + 1
3214 IF (WARNING_COUNTERS(2).le.10) THEN
3215 WRITE(*,*) "WARNING : The residue of the single and double pole of the loop matrix element being integrated does not seem to vanish."
3216
3217=== modified file 'madgraph/iolibs/template_files/matrix_loop_induced_madevent_group.inc'
3218--- madgraph/iolibs/template_files/matrix_loop_induced_madevent_group.inc 2016-02-18 03:09:50 +0000
3219+++ madgraph/iolibs/template_files/matrix_loop_induced_madevent_group.inc 2016-06-24 21:04:21 +0000
3220@@ -133,6 +133,9 @@
3221
3222 IF(.NOT.INIT_MADLOOP) THEN
3223 INIT_MADLOOP = .TRUE.
3224+C We don't use the poles, so let's not compute them with COLLIER
3225+ CALL %(ml_prefix)sCOLLIER_COMPUTE_UV_POLES(.False.)
3226+ CALL %(ml_prefix)sCOLLIER_COMPUTE_IR_POLES(.False.)
3227 C Unless this is the first iteration, make sure to never double check the helicity filter again
3228 IF (read_grid_file) THEN
3229 CALL SET_FORBID_HEL_DOUBLECHECK(.True.)
3230@@ -405,7 +408,7 @@
3231 return
3232 endif
3233
3234- IF (((OneEps+TwoEps)/finite).gt.(1000d0*PREC).AND.(((OneEps+TwoEps)/finite).gt.1.0d-5)) THEN
3235+ IF (U.NE.7.and.((OneEps+TwoEps)/finite).gt.(1000d0*PREC).AND.(((OneEps+TwoEps)/finite).gt.1.0d-5)) THEN
3236 WARNING_COUNTERS(2) = WARNING_COUNTERS(2) + 1
3237 IF (WARNING_COUNTERS(2).le.10) THEN
3238 WRITE(*,*) "WARNING : The residue of the single and double pole of the loop matrix element being integrated does not seem to vanish."
3239
3240=== modified file 'madgraph/loop/loop_exporters.py'
3241--- madgraph/loop/loop_exporters.py 2016-05-11 21:44:52 +0000
3242+++ madgraph/loop/loop_exporters.py 2016-06-24 21:04:21 +0000
3243@@ -90,7 +90,8 @@
3244
3245 include_names = {'ninja' : 'mninja.mod',
3246 'golem' : 'generic_function_1p.mod',
3247- 'samurai':'msamurai.mod'}
3248+ 'samurai':'msamurai.mod',
3249+ 'collier': 'collier.mod'}
3250
3251 def __init__(self, mgme_dir="", dir_path = "", opt=None):
3252 """Initiate the LoopExporterFortran with directory information on where
3253@@ -263,17 +264,18 @@
3254 calls = self.write_loop_makefile_definitions(
3255 writers.MakefileWriter(filePath),link_tir_libs,tir_libs)
3256
3257-
3258 # We need minimal editing of MadLoopCommons.f
3259+ # For the optimized output, this file will be overwritten once the
3260+ # availability of COLLIER has been determined.
3261 MadLoopCommon = open(os.path.join(self.loop_dir,'StandAlone',
3262 "SubProcesses","MadLoopCommons.inc")).read()
3263 writer = writers.FortranWriter(os.path.join(self.dir_path,
3264 "SubProcesses","MadLoopCommons.f"))
3265 writer.writelines(MadLoopCommon%{
3266- 'print_banner_commands':self.MadLoop_banner})
3267+ 'print_banner_commands':self.MadLoop_banner}, context={
3268+ 'collier_available':False})
3269 writer.close()
3270
3271-
3272 # Copy the whole MadLoop5_resources directory (empty at this stage)
3273 if not os.path.exists(pjoin(self.dir_path,'SubProcesses',
3274 'MadLoop5_resources')):
3275@@ -678,7 +680,7 @@
3276 # generate_subprocess_directory_v4
3277 #===========================================================================
3278 def generate_loop_subprocess(self, matrix_element, fortran_model,
3279- group_number = None, proc_id = None, config_map=None):
3280+ group_number = None, proc_id = None, config_map=None, unique_id=None):
3281 """Generate the Pxxxxx directory for a loop subprocess in MG4 standalone,
3282 including the necessary loop_matrix.f, born_matrix.f and include files.
3283 Notice that this is too different from generate_subprocess_directory_v4
3284@@ -705,6 +707,14 @@
3285
3286 logger.info('Creating files in directory %s' % dirpath)
3287
3288+ if unique_id is None:
3289+ raise MadGraph5Error, 'A unique id must be provided to the function'+\
3290+ 'generate_loop_subprocess of LoopProcessExporterFortranSA.'
3291+ # Create an include with the unique consecutive ID assigned
3292+ open('unique_id.inc','w').write(
3293+""" integer UNIQUE_ID
3294+ parameter(UNIQUE_ID=%d)"""%unique_id)
3295+
3296 # Extract number of external particles
3297 (nexternal, ninitial) = matrix_element.get_nexternal_ninitial()
3298
3299@@ -778,7 +788,7 @@
3300 'cts_mprec.h', 'cts_mpc.h', 'mp_coupl.inc',
3301 'mp_coupl_same_name.inc',
3302 'MadLoopParamReader.f','MadLoopCommons.f',
3303- 'MadLoopParams.inc']
3304+ 'MadLoopParams.inc','global_specs.inc']
3305
3306 for file in linkfiles:
3307 ln('../%s' % file)
3308@@ -1014,11 +1024,13 @@
3309
3310 writer.writelines(proc_include)
3311
3312- def generate_subprocess_directory_v4(self, matrix_element, fortran_model):
3313+ def generate_subprocess_directory_v4(self, matrix_element, fortran_model,
3314+ unique_id):
3315 """ To overload the default name for this function such that the correct
3316 function is used when called from the command interface """
3317
3318- return self.generate_loop_subprocess(matrix_element,fortran_model)
3319+ return self.generate_loop_subprocess(matrix_element,fortran_model,
3320+ unique_id=unique_id)
3321
3322 def write_check_sa(self, writer, matrix_element):
3323 """Writes out the steering code check_sa. In the optimized output mode,
3324@@ -1576,7 +1588,7 @@
3325 # make sure that ninja appears first in the list of -L because
3326 # it is the tool for which the user is most susceptible of
3327 # using a standalone verison independent of gosam_contrib
3328- all_tir=['pjfry','iregi','ninja','golem','samurai']
3329+ all_tir=['pjfry','iregi','ninja','golem','samurai','collier']
3330
3331 def __init__(self, mgme_dir="", dir_path = "", opt=None):
3332 """Initiate the LoopProcessOptimizedExporterFortranSA with directory
3333@@ -1588,7 +1600,7 @@
3334
3335 # TIR available ones
3336 self.tir_available_dict={'pjfry':True,'iregi':True,'golem':True,
3337- 'samurai':True,'ninja':True}
3338+ 'samurai':True,'ninja':True,'collier':True}
3339
3340 for tir in self.all_tir:
3341 tir_dir="%s_dir"%tir
3342@@ -1627,7 +1639,7 @@
3343 for tir in self.all_tir:
3344 context['%s_available'%tir]=self.tir_available_dict[tir]
3345 # safety check
3346- if tir not in ['golem','pjfry','iregi','samurai','ninja']:
3347+ if tir not in ['golem','pjfry','iregi','samurai','ninja','collier']:
3348 raise MadGraph5Error,"%s was not a TIR currently interfaced."%tir_name
3349
3350 return context
3351@@ -1648,16 +1660,30 @@
3352 tir_name=tir
3353 libpath = self.link_TIR(os.path.join(self.dir_path, 'lib'),
3354 libpath,libname,tir_name=tir_name)
3355- setattr(self,tir_dir,libpath)
3356 if libpath != "":
3357- if tir in ['ninja','pjfry','golem','samurai']:
3358+ if tir in ['ninja','pjfry','golem','samurai','collier']:
3359 # It is cleaner to use the original location of the libraries
3360 link_tir_libs.append('-L%s/ -l%s'%(libpath,tir))
3361 tir_libs.append('%s/lib%s.$(libext)'%(libpath,tir))
3362- if tir in ['ninja','golem', 'samurai']:
3363+ # For Ninja, we must also link against OneLoop.
3364+ if tir in ['ninja']:
3365+ if not any(os.path.isfile(pjoin(libpath,'libavh_olo.%s'%ext))
3366+ for ext in ['a','dylib','so']):
3367+ raise MadGraph5Error(
3368+"The OneLOop library 'libavh_olo.(a|dylib|so)' could no be found in path '%s'. Please place a symlink to it there."%libpath)
3369+ link_tir_libs.append('-L%s/ -l%s'%(libpath,'avh_olo'))
3370+ tir_libs.append('%s/lib%s.$(libext)'%(libpath,'avh_olo'))
3371+ if tir in ['ninja','golem', 'samurai','collier']:
3372 trgt_path = pjoin(os.path.dirname(libpath),'include')
3373- to_include = misc.find_includes_path(trgt_path,
3374+ if os.path.isdir(trgt_path):
3375+ to_include = misc.find_includes_path(trgt_path,
3376 self.include_names[tir])
3377+ else:
3378+ to_include = None
3379+ # Special possible location for collier
3380+ if to_include is None and tir=='collier':
3381+ to_include = misc.find_includes_path(
3382+ pjoin(libpath,'modules'),self.include_names[tir])
3383 if to_include is None:
3384 logger.error(
3385 'Could not find the include directory for %s, looking in %s.\n' % (tir, str(trgt_path))+
3386@@ -1669,7 +1695,7 @@
3387 # (such as what is done with the Sherpa interface), we
3388 # place here an easy handle on the golem includes
3389 name_map = {'golem':'golem95','samurai':'samurai',
3390- 'ninja':'ninja'}
3391+ 'ninja':'ninja','collier':'collier'}
3392 ln(to_include, starting_dir=pjoin(self.dir_path,'lib'),
3393 name='%s_include'%name_map[tir],abspath=True)
3394 ln(libpath, starting_dir=pjoin(self.dir_path,'lib'),
3395@@ -1687,6 +1713,17 @@
3396 writers.MakefileWriter(MadLoop_makefile_definitions),
3397 link_tir_libs,tir_libs, tir_include=tir_include)
3398
3399+ # Finally overwrite MadLoopCommons.f now that we know the availibility of
3400+ # COLLIER.
3401+ MadLoopCommon = open(os.path.join(self.loop_dir,'StandAlone',
3402+ "SubProcesses","MadLoopCommons.inc")).read()
3403+ writer = writers.FortranWriter(os.path.join(self.dir_path,
3404+ "SubProcesses","MadLoopCommons.f"))
3405+ writer.writelines(MadLoopCommon%{
3406+ 'print_banner_commands':self.MadLoop_banner}, context={
3407+ 'collier_available':self.tir_available_dict['collier']})
3408+ writer.close()
3409+
3410 def link_files_from_Subprocesses(self,proc_name):
3411 """ Does the same as the mother routine except that it also links
3412 coef_specs.inc in the HELAS folder."""
3413@@ -1704,7 +1741,7 @@
3414 """Link the TIR source directory inside the target path given
3415 in argument"""
3416
3417- if tir_name in ['pjfry','golem','samurai','ninja']:
3418+ if tir_name in ['pjfry','golem','samurai','ninja','collier']:
3419 # not self-contained libraries
3420 if (not isinstance(libpath,str)) or (not os.path.exists(libpath)) \
3421 or (not os.path.isfile(pjoin(libpath,libname))):
3422@@ -1742,7 +1779,7 @@
3423 return ""
3424
3425 if self.dependencies=='internal':
3426- if tir_name in ['pjfry','golem','samurai','ninja']:
3427+ if tir_name in ['pjfry','golem','samurai','ninja','collier']:
3428 self.tir_available_dict[tir_name]=False
3429 logger.info("When using the 'output_dependencies=internal' "+\
3430 " MG5_aMC option, the (optional) reduction library %s cannot be employed because"%tir_name+\
3431@@ -1793,7 +1830,7 @@
3432 self.tir_available_dict[tir_name]=False
3433 return ""
3434 # We link the tools below directly to the lib directory of the output
3435- if not tir_name in ['pjfry','golem','samurai','ninja']:
3436+ if not tir_name in ['pjfry','golem','samurai','ninja','collier']:
3437 ln(os.path.join(libpath,libname),targetPath,abspath=True)
3438
3439 elif self.dependencies=='environment_paths':
3440@@ -1804,7 +1841,7 @@
3441 logger.info('MG5_aMC is using %s installation found at %s.'%\
3442 (tir_name,newlibpath))
3443 # We link the tools below directly to directly where the library is detected
3444- if not tir_name in ['pjfry','golem','samurai','ninja']:
3445+ if not tir_name in ['pjfry','golem','samurai','ninja','collier']:
3446 ln(newlibpath,targetPath,abspath=True)
3447 self.tir_available_dict[tir_name]=True
3448 return os.path.dirname(newlibpath)
3449@@ -1911,6 +1948,11 @@
3450 self.write_GOLEM_interface(writers.FortranWriter(filename),
3451 matrix_element)
3452
3453+ if 'collier' in self.tir_available_dict and self.tir_available_dict['collier']:
3454+ filename = 'COLLIER_interface.f'
3455+ self.write_COLLIER_interface(writers.FortranWriter(filename),
3456+ matrix_element)
3457+
3458 filename = 'loop_num.f'
3459 self.write_loop_num(writers.FortranWriter(filename),\
3460 matrix_element,OptimizedFortranModel)
3461@@ -2042,6 +2084,40 @@
3462 else:
3463 return file
3464
3465+ def write_COLLIER_interface(self, writer, matrix_element):
3466+ """ Create the file COLLIER_interface.f"""
3467+
3468+ # First write GOLEM_interface which interfaces MG5 with TIR.
3469+ replace_dict=copy.copy(matrix_element.rep_dict)
3470+
3471+ file = open(os.path.join(self.template_dir,'COLLIER_interface.inc')).read()
3472+
3473+ FPR = q_polynomial.FortranPolynomialRoutines(replace_dict['maxrank'],\
3474+ coef_format=replace_dict['complex_dp_format'],\
3475+ sub_prefix=replace_dict['proc_prefix'])
3476+ map_definition = []
3477+ collier_map = FPR.get_COLLIER_mapping()
3478+
3479+ chunk_size = 10
3480+ for map_name, indices_list in \
3481+ [('COEFMAP_ZERO',[c[0] for c in collier_map]),
3482+ ('COEFMAP_ONE',[c[1] for c in collier_map]),
3483+ ('COEFMAP_TWO',[c[2] for c in collier_map]),
3484+ ('COEFMAP_THREE',[c[3] for c in collier_map])]:
3485+ for k in xrange(0, len(indices_list), chunk_size):
3486+ map_definition.append("DATA (%s(I),I=%3r,%3r) /%s/" % \
3487+ (map_name,k, min(k + chunk_size, len(indices_list))-1,
3488+ ','.join('%2r'%ind for ind in indices_list[k:k + chunk_size])))
3489+
3490+ replace_dict['collier_coefmap'] = '\n'.join(map_definition)
3491+
3492+ file = file % replace_dict
3493+
3494+ if writer:
3495+ writer.writelines(file,context=self.get_context(matrix_element))
3496+ else:
3497+ return file
3498+
3499 def write_GOLEM_interface(self, writer, matrix_element):
3500 """ Create the file GOLEM_interface.f which does NOT contain the subroutine
3501 defining the loop HELAS-like calls along with the general interfacing
3502@@ -2371,6 +2447,27 @@
3503
3504 writer.writelines(file,context=self.get_context(matrix_element))
3505
3506+ def write_global_specs(self, matrix_element_list):
3507+ """ From the list of matrix element, or the single matrix element, derive
3508+ the global quantities to write in global_coef_specs.inc"""
3509+
3510+ if isinstance(matrix_element_list, list):
3511+ me_list = matrix_element_list
3512+ else:
3513+ me_list = [matrix_element_list]
3514+
3515+ open(pjoin(self.dir_path,'SubProcesses','global_specs.inc'),'w').write(
3516+""" integer MAXNEXTERNAL
3517+ parameter(MAXNEXTERNAL=%d)
3518+ integer OVERALLMAXRANK
3519+ parameter(OVERALLMAXRANK=%d)
3520+ integer NPROCS
3521+ parameter(NPROCS=%d)"""%(
3522+ max(me.get_nexternal_ninitial()[0] for me in me_list),
3523+ max(me.get_max_loop_rank() for me in me_list),
3524+ len(me_list)))
3525+
3526+
3527 def fix_coef_specs(self, overall_max_lwf_spin, overall_max_loop_vert_rank):
3528 """ If processes with different maximum loop wavefunction size or
3529 different maximum loop vertex rank have to be output together, then
3530@@ -2572,7 +2669,7 @@
3531 looplibs_av=['.TRUE.']
3532 # one should be careful about the order in the following as it must match
3533 # the ordering in MadLoopParamsCard.
3534- for tir_lib in ['pjfry','iregi','golem','samurai','ninja']:
3535+ for tir_lib in ['pjfry','iregi','golem','samurai','ninja','collier']:
3536 looplibs_av.append('.TRUE.' if tir_lib in self.all_tir and \
3537 self.tir_available_dict[tir_lib] else '.FALSE.')
3538 replace_dict['data_looplibs_av']=','.join(looplibs_av)
3539@@ -2944,11 +3041,15 @@
3540 LoopInducedExporterME.finalize_v4_directory(self,*args,**opts)
3541
3542 def generate_subprocess_directory_v4(self, subproc_group,
3543- fortran_model,group_number):
3544+ fortran_model,group_number, unique_id=None):
3545 """Generate the Pn directory for a subprocess group in MadEvent,
3546 including the necessary matrix_N.f files, configs.inc and various
3547 other helper files"""
3548-
3549+
3550+ if unique_id is None:
3551+ raise MadGraph5Error, 'A unique_id must be provided to '+\
3552+ 'generate_subprocess_directory_v4 in LoopInducedExporterMEGroup.'
3553+
3554 # Generate the MadLoop files
3555 calls = 0
3556 matrix_elements = subproc_group.get('matrix_elements')
3557@@ -2956,7 +3057,8 @@
3558 calls += self.generate_loop_subprocess(matrix_element,fortran_model,
3559 group_number = group_number, proc_id = str(ime+1),
3560 # group_number = str(subproc_group.get('number')), proc_id = str(ime+1),
3561- config_map = subproc_group.get('diagram_maps')[ime])
3562+ config_map = subproc_group.get('diagram_maps')[ime],
3563+ unique_id=unique_id+ime)
3564
3565 # Then generate the MadEvent files
3566 export_v4.ProcessExporterFortranMEGroup.generate_subprocess_directory_v4(
3567@@ -3107,14 +3209,15 @@
3568 # care of MadLoop virtuals initialization
3569 LoopInducedExporterME.finalize_v4_directory(self,*args,**opts)
3570
3571- def generate_subprocess_directory_v4(self, matrix_element, fortran_model, me_number):
3572+ def generate_subprocess_directory_v4(self, matrix_element, fortran_model,
3573+ me_number):
3574 """Generate the Pn directory for a subprocess group in MadEvent,
3575 including the necessary matrix_N.f files, configs.inc and various
3576 other helper files"""
3577
3578 # Then generate the MadLoop files
3579 calls = self.generate_loop_subprocess(matrix_element,fortran_model,
3580- group_number = me_number)
3581+ group_number = me_number, unique_id=me_number)
3582
3583
3584 # First generate the MadEvent files
3585
3586=== modified file 'madgraph/madevent/gen_ximprove.py'
3587--- madgraph/madevent/gen_ximprove.py 2016-04-16 23:51:09 +0000
3588+++ madgraph/madevent/gen_ximprove.py 2016-06-24 21:04:21 +0000
3589@@ -1100,6 +1100,7 @@
3590 break
3591 info = jobs[j]
3592 info['script_name'] = 'ajob%i' % script_number
3593+ info['keeplog'] = 'false'
3594 if "base_directory" not in info:
3595 info["base_directory"] = "./"
3596 fsock.write(template_text % info)
3597
3598=== modified file 'madgraph/madevent/sum_html.py'
3599--- madgraph/madevent/sum_html.py 2016-01-30 05:06:31 +0000
3600+++ madgraph/madevent/sum_html.py 2016-06-24 21:04:21 +0000
3601@@ -57,6 +57,7 @@
3602 'Samurai_usage' : 0,
3603 'Ninja_usage' : 0,
3604 'Ninja_QP_usage' : 0,
3605+ 'COLLIER_usage' : 0,
3606 'max_precision' : 1.0e99,
3607 'min_precision' : 0.0,
3608 'averaged_timing' : 0.0,
3609@@ -119,6 +120,7 @@
3610 self['Golem_usage'] = u_codes[4]
3611 self['Samurai_usage'] = u_codes[5]
3612 self['Ninja_usage'] = u_codes[6]
3613+ self['COLLIER_usage'] = u_codes[7]
3614 self['Ninja_QP_usage'] = u_codes[8]
3615 self['CutTools_QP_usage'] = u_codes[9]
3616 t_return_code = xml_node.getElementsByTagName('t_return_code')
3617@@ -177,6 +179,7 @@
3618 ('Golem',float(self['Golem_usage'])/self['n_madloop_calls']),
3619 ('IREGI',float(self['IREGI_usage'])/self['n_madloop_calls']),
3620 ('Samurai',float(self['Samurai_usage'])/self['n_madloop_calls']),
3621+ ('COLLIER',float(self['COLLIER_usage'])/self['n_madloop_calls']),
3622 ('Ninja_DP',float(self['Ninja_usage'])/self['n_madloop_calls']),
3623 ('Ninja_QP',float(self['Ninja_QP_usage'])/self['n_madloop_calls'])]
3624
3625@@ -714,8 +717,8 @@
3626 for P_comb in Presults:
3627 P_text += P_comb.get_html(run, unit, cmd.me_dir)
3628 P_comb.compute_values()
3629- P_comb.write_results_dat(pjoin(cmd.me_dir, 'SubProcesses', P_comb.name,
3630- '%s_results.dat' % run))
3631+ #P_comb.write_results_dat(pjoin(cmd.me_dir, 'SubProcesses', P_comb.name,
3632+ # '%s_results.dat' % run))
3633
3634
3635 Presults.write_results_dat(pjoin(cmd.me_dir,'SubProcesses', 'results.dat'))
3636
3637=== modified file 'madgraph/various/banner.py'
3638--- madgraph/various/banner.py 2016-05-11 21:44:52 +0000
3639+++ madgraph/various/banner.py 2016-06-24 21:04:21 +0000
3640@@ -1526,7 +1526,7 @@
3641 elif lpp in (3,-3):
3642 return math.copysign(11, lpp)
3643 elif lpp == 0:
3644- logger.critical("Fail to write correct idbmup in the lhe file. Please correct those by hand")
3645+ #logger.critical("Fail to write correct idbmup in the lhe file. Please correct those by hand")
3646 return 0
3647 else:
3648 return lpp
3649@@ -2189,17 +2189,23 @@
3650 contains a parser to read it, facilities to write a new file,...
3651 """
3652
3653-
3654-
3655+ _ID_reduction_tool_map = {1:'CutTools',
3656+ 2:'PJFry++',
3657+ 3:'IREGI',
3658+ 4:'Golem95',
3659+ 5:'Samurai',
3660+ 6:'Ninja',
3661+ 7:'COLLIER'}
3662+
3663 def default_setup(self):
3664 """initialize the directory to the default value"""
3665
3666- self.add_param("MLReductionLib", "6|1|2")
3667+ self.add_param("MLReductionLib", "7|6|1|2")
3668 self.add_param("IREGIMODE", 2)
3669 self.add_param("IREGIRECY", True)
3670 self.add_param("CTModeRun", -1)
3671 self.add_param("MLStabThres", 1e-3)
3672- self.add_param("NRotations_DP", 1)
3673+ self.add_param("NRotations_DP", 0)
3674 self.add_param("NRotations_QP", 0)
3675 self.add_param("ImprovePSPoint", 2)
3676 self.add_param("CTLoopLibrary", 2)
3677@@ -2215,8 +2221,16 @@
3678 self.add_param("HelicityFilterLevel", 2)
3679 self.add_param("LoopInitStartOver", False)
3680 self.add_param("HelInitStartOver", False)
3681- self.add_param("UseQPIntegrandForNinja", False)
3682+ self.add_param("UseQPIntegrandForNinja", True)
3683 self.add_param("UseQPIntegrandForCutTools", True)
3684+ self.add_param("COLLIERMode", 1)
3685+ self.add_param("COLLIERComputeUVpoles", True)
3686+ self.add_param("COLLIERComputeIRpoles", True)
3687+ self.add_param("COLLIERRequiredAccuracy", 1.0e-8)
3688+ self.add_param("COLLIERCanOutput",False)
3689+ self.add_param("COLLIERGlobalCache",-1)
3690+ self.add_param("COLLIERUseCacheForPoles",False)
3691+ self.add_param("COLLIERUseInternalStabilityTest",True)
3692
3693 def read(self, finput):
3694 """Read the input file, this can be a path to a file,
3695
3696=== modified file 'madgraph/various/cluster.py'
3697--- madgraph/various/cluster.py 2016-02-23 22:55:27 +0000
3698+++ madgraph/various/cluster.py 2016-06-24 21:04:21 +0000
3699@@ -2126,3 +2126,5 @@
3700 'lsf': LSFCluster, 'ge':GECluster, 'slurm': SLURMCluster,
3701 'htcaas':HTCaaSCluster, 'htcaas2':HTCaaS2Cluster}
3702
3703+onecore=MultiCore(1) # create a thread to run simple bash job without having to
3704+ #fork the main process
3705\ No newline at end of file
3706
3707=== modified file 'madgraph/various/lhe_parser.py'
3708--- madgraph/various/lhe_parser.py 2016-06-07 09:34:40 +0000
3709+++ madgraph/various/lhe_parser.py 2016-06-24 21:04:21 +0000
3710@@ -20,22 +20,23 @@
3711
3712 class Particle(object):
3713 """ """
3714- pattern=re.compile(r'''^\s*
3715- (?P<pid>-?\d+)\s+ #PID
3716- (?P<status>-?\d+)\s+ #status (1 for output particle)
3717- (?P<mother1>-?\d+)\s+ #mother
3718- (?P<mother2>-?\d+)\s+ #mother
3719- (?P<color1>[+-e.\d]*)\s+ #color1
3720- (?P<color2>[+-e.\d]*)\s+ #color2
3721- (?P<px>[+-e.\d]*)\s+ #px
3722- (?P<py>[+-e.\d]*)\s+ #py
3723- (?P<pz>[+-e.\d]*)\s+ #pz
3724- (?P<E>[+-e.\d]*)\s+ #E
3725- (?P<mass>[+-e.\d]*)\s+ #mass
3726- (?P<vtim>[+-e.\d]*)\s+ #displace vertex
3727- (?P<helicity>[+-e.\d]*)\s* #helicity
3728- ($|(?P<comment>\#[\d|D]*)) #comment/end of string
3729- ''',66) #verbose+ignore case
3730+ # regular expression not use anymore to speed up the computation
3731+ #pattern=re.compile(r'''^\s*
3732+ # (?P<pid>-?\d+)\s+ #PID
3733+ # (?P<status>-?\d+)\s+ #status (1 for output particle)
3734+ # (?P<mother1>-?\d+)\s+ #mother
3735+ # (?P<mother2>-?\d+)\s+ #mother
3736+ # (?P<color1>[+-e.\d]*)\s+ #color1
3737+ # (?P<color2>[+-e.\d]*)\s+ #color2
3738+ # (?P<px>[+-e.\d]*)\s+ #px
3739+ # (?P<py>[+-e.\d]*)\s+ #py
3740+ # (?P<pz>[+-e.\d]*)\s+ #pz
3741+ # (?P<E>[+-e.\d]*)\s+ #E
3742+ # (?P<mass>[+-e.\d]*)\s+ #mass
3743+ # (?P<vtim>[+-e.\d]*)\s+ #displace vertex
3744+ # (?P<helicity>[+-e.\d]*)\s* #helicity
3745+ # ($|(?P<comment>\#[\d|D]*)) #comment/end of string
3746+ # ''',66) #verbose+ignore case
3747
3748
3749
3750@@ -78,17 +79,19 @@
3751
3752 def parse(self, line):
3753 """parse the line"""
3754-
3755- obj = self.pattern.search(line)
3756- if not obj:
3757- raise Exception, 'the line\n%s\n is not a valid format for LHE particle' % line
3758- for key, value in obj.groupdict().items():
3759- if key not in ['comment','pid']:
3760- setattr(self, key, float(value))
3761- elif key in ['pid', 'mother1', 'mother2']:
3762- setattr(self, key, int(value))
3763- else:
3764- self.comment = value
3765+
3766+ args = line.split()
3767+ keys = ['pid', 'status','mother1','mother2','color1', 'color2', 'px','py','pz','E',
3768+ 'mass','vtim','helicity']
3769+
3770+ for key,value in zip(keys,args):
3771+ setattr(self, key, float(value))
3772+ self.pid = int(self.pid)
3773+
3774+ self.comment = ' '.join(args[len(keys):])
3775+ if self.comment.startswith(('|','#')):
3776+ self.comment = self.comment[1:]
3777+
3778 # Note that mother1/mother2 will be modified by the Event parse function to replace the
3779 # integer by a pointer to the actual particle object.
3780
3781@@ -235,7 +238,7 @@
3782 line = ''
3783 mode = 0
3784 while '</event>' not in line:
3785- line = super(EventFile, self).next().lower()
3786+ line = super(EventFile, self).next()
3787 if '<event' in line:
3788 mode = 1
3789 text = ''
3790@@ -711,6 +714,17 @@
3791 run_card = self.banner.charge_card("run_card")
3792
3793 init_information = run_card.get_banner_init_information()
3794+ if init_information["idbmup1"] == 0:
3795+ event = self.next()
3796+ init_information["idbmup1"]= event[0].pdg
3797+ if init_information["idbmup2"] == 0:
3798+ init_information["idbmup2"]= event[1].pdg
3799+ self.seek(0)
3800+ if init_information["idbmup2"] == 0:
3801+ event = self.next()
3802+ init_information["idbmup2"] = event[1].pdg
3803+ self.seek(0)
3804+
3805 init_information["nprup"] = nb_group
3806
3807 if run_card["lhe_version"] < 3:
3808@@ -877,16 +891,16 @@
3809
3810 def parse(self, text):
3811 """Take the input file and create the structured information"""
3812- text = re.sub(r'</?event>', '', text) # remove pointless tag
3813+ #text = re.sub(r'</?event>', '', text) # remove pointless tag
3814 status = 'first'
3815 for line in text.split('\n'):
3816 line = line.strip()
3817 if not line:
3818 continue
3819- if line.startswith('#'):
3820+ elif line[0] == '#':
3821 self.comment += '%s\n' % line
3822 continue
3823- if "<event" in line:
3824+ elif line.startswith('<event'):
3825 if '=' in line:
3826 found = re.findall(r"""(\w*)=(?:(?:['"])([^'"]*)(?=['"])|(\S*))""",line)
3827 #for '<event line=4 value=\'3\' error="5" test=" 1 and 2">\n'
3828@@ -895,23 +909,23 @@
3829 # return {'test': ' 1 and 2', 'line': '4', 'value': '3', 'error': '5'}
3830 continue
3831
3832- if 'first' == status:
3833+ elif 'first' == status:
3834 if '<rwgt>' in line:
3835 status = 'tag'
3836-
3837- if 'first' == status:
3838- self.assign_scale_line(line)
3839- status = 'part'
3840- continue
3841-
3842+ else:
3843+ self.assign_scale_line(line)
3844+ status = 'part'
3845+ continue
3846 if '<' in line:
3847 status = 'tag'
3848
3849 if 'part' == status:
3850 self.append(Particle(line, event=self))
3851 else:
3852+ if '</event>' in line:
3853+ line = line.replace('</event>','',1)
3854 self.tag += '%s\n' % line
3855-
3856+
3857 self.assign_mother()
3858
3859 def assign_mother(self):
3860
3861=== modified file 'madgraph/various/misc.py'
3862--- madgraph/various/misc.py 2016-05-18 14:36:57 +0000
3863+++ madgraph/various/misc.py 2016-06-24 21:04:21 +0000
3864@@ -308,7 +308,7 @@
3865 log(msg)
3866
3867
3868- if dependency in ['pjfry','golem','samurai','ninja']:
3869+ if dependency in ['pjfry','golem','samurai','ninja','collier']:
3870 if cmd.options[dependency] not in ['None',None,'']:
3871 tell("Deactivating MG5_aMC dependency '%s'"%dependency)
3872 cmd.options[dependency] = None
3873@@ -350,6 +350,13 @@
3874 tell("Installing ninja...")
3875 cmd.do_install('ninja')
3876
3877+ if dependency=='collier':
3878+ if cmd.options['collier'] in ['None',None,''] or\
3879+ (cmd.options['collier'] == 'auto' and which_lib('libcollier.a') is None) or\
3880+ which_lib(pjoin(cmd.options['collier'],'libcollier.a')) is None:
3881+ tell("Installing COLLIER...")
3882+ cmd.do_install('collier')
3883+
3884 #===============================================================================
3885 # find a library
3886 #===============================================================================
3887
3888=== modified file 'madgraph/various/process_checks.py'
3889--- madgraph/various/process_checks.py 2016-04-15 11:14:25 +0000
3890+++ madgraph/various/process_checks.py 2016-06-24 21:04:21 +0000
3891@@ -613,7 +613,8 @@
3892 self.mg_root, export_dir, MLoptions)
3893 FortranModel = helas_call_writers.FortranUFOHelasCallWriter(model)
3894 FortranExporter.copy_v4template(modelname=model.get('name'))
3895- FortranExporter.generate_subprocess_directory_v4(matrix_element, FortranModel)
3896+ FortranExporter.generate_subprocess_directory_v4(matrix_element, FortranModel, 1)
3897+ FortranExporter.write_global_specs(matrix_element)
3898 wanted_lorentz = list(set(matrix_element.get_used_lorentz()))
3899 wanted_couplings = list(set([c for l in matrix_element.get_used_couplings() \
3900 for c in l]))
3901@@ -1155,7 +1156,8 @@
3902 FortranExporter = exporter_class(self.mg_root, export_dir, MLoptions)
3903 FortranModel = helas_call_writers.FortranUFOHelasCallWriter(model)
3904 FortranExporter.copy_v4template(modelname=model.get('name'))
3905- FortranExporter.generate_subprocess_directory_v4(matrix_element, FortranModel)
3906+ FortranExporter.generate_subprocess_directory_v4(matrix_element, FortranModel, 1)
3907+ FortranExporter.write_global_specs(matrix_element)
3908 wanted_lorentz = list(set(matrix_element.get_used_lorentz()))
3909 wanted_couplings = list(set([c for l in matrix_element.get_used_couplings() \
3910 for c in l]))
3911@@ -1470,8 +1472,8 @@
3912 tools=list(set(tools)) # remove the duplication ones
3913
3914 # not self-contained tir libraries
3915- tool_var={'pjfry':2,'golem':4,'samurai':5,'ninja':6}
3916- for tool in ['pjfry','golem','samurai','ninja']:
3917+ tool_var={'pjfry':2,'golem':4,'samurai':5,'ninja':6,'collier':7}
3918+ for tool in ['pjfry','golem','samurai','ninja','collier']:
3919 tool_dir='%s_dir'%tool
3920 if not tool_dir in self.tir_dir:
3921 continue
3922@@ -1493,8 +1495,8 @@
3923 export_dir=pjoin(self.mg_root,("SAVED" if keep_folder else "")+\
3924 temp_dir_prefix+"_%s"%proc_name)
3925
3926- tools_name={1:'CutTools',2:'PJFry++',3:'IREGI',4:'Golem95',5:'Samurai',
3927- 6:'Ninja'}
3928+ tools_name=bannermod.MadLoopParam._ID_reduction_tool_map
3929+
3930 return_dict={}
3931 return_dict['Stability']={}
3932 infos_save={'Process_output': None,
3933@@ -1517,7 +1519,7 @@
3934 # The exceptional PS points are those which stay unstable in quad prec.
3935 Exceptional_PS_points = []
3936
3937- MLoptions={}
3938+ MLoptions=MLOptions
3939 MLoptions["MLReductionLib"]=tool
3940 clean = (tool==tools[0]) and not nPoints==0
3941 if infos_IN==None or (tool_name not in infos_IN):
3942@@ -1606,7 +1608,7 @@
3943 str(datetime.timedelta(seconds=sec_needed)),\
3944 datetime.datetime.now().strftime("%d-%m-%Y %H:%M")))
3945 if logger.getEffectiveLevel()<logging.WARNING and \
3946- (sec_needed>5 or (reusing and infos['Initialization'] == None)):
3947+ (sec_needed>5 or infos['Initialization'] == None):
3948 widgets = ['Stability check:', pbar.Percentage(), ' ',
3949 pbar.Bar(),' ', pbar.ETA(), ' ']
3950 progress_bar = pbar.ProgressBar(widgets=widgets, maxval=nPoints,
3951@@ -2125,8 +2127,10 @@
3952
3953 timing2 = myProfiler.time_matrix_element(matrix_element, reusing,
3954 param_card, keep_folder=keep_folder,options=options,
3955- MLOptions = MLoptions)
3956+ MLOptions = MLoptions)
3957
3958+ timing2['reduction_tool'] = MLoptions['MLReductionLib'][0]
3959+
3960 if timing2 == None:
3961 return None, None
3962
3963@@ -2172,6 +2176,22 @@
3964 MLoptions = {}
3965 else:
3966 MLoptions = MLOptions
3967+ # Make sure that the poles computation is disabled for COLLIER
3968+ if 'COLLIERComputeUVpoles' not in MLoptions:
3969+ MLoptions['COLLIERComputeUVpoles']=False
3970+ if 'COLLIERComputeIRpoles' not in MLoptions:
3971+ MLoptions['COLLIERComputeIRpoles']=False
3972+ # Use high required accuracy in COLLIER's requirement if not specified
3973+ if 'COLLIERRequiredAccuracy' not in MLoptions:
3974+ MLoptions['COLLIERRequiredAccuracy']=1e-13
3975+ # Use loop-direction switching as stability test if not specifed (more reliable)
3976+ if 'COLLIERUseInternalStabilityTest' not in MLoptions:
3977+ MLoptions['COLLIERUseInternalStabilityTest']=False
3978+ # Finally we *must* forbid the use of COLLIER global cache here, because it
3979+ # does not work with the way we call independently CTMODERun 1 and 2
3980+ # with the StabilityChecker.
3981+ MLoptions['COLLIERGlobalCache'] = 0
3982+
3983 if "MLReductionLib" not in MLOptions:
3984 MLoptions["MLReductionLib"] = []
3985 if cuttools:
3986@@ -2186,6 +2206,8 @@
3987 MLoptions["MLReductionLib"].extend([5])
3988 if "ninja_dir" in tir:
3989 MLoptions["MLReductionLib"].extend([6])
3990+ if "collier_dir" in tir:
3991+ MLoptions["MLReductionLib"].extend([7])
3992
3993 stability = myStabilityChecker.check_matrix_element_stability(matrix_element,
3994 options=options,param_card=param_card,
3995@@ -2223,6 +2245,19 @@
3996 MLoptions = {}
3997 else:
3998 MLoptions = MLOptions
3999+ # Make sure that the poles computation is disabled for COLLIER
4000+ if 'COLLIERComputeUVpoles' not in MLoptions:
4001+ MLoptions['COLLIERComputeUVpoles']=False
4002+ if 'COLLIERComputeIRpoles' not in MLoptions:
4003+ MLoptions['COLLIERComputeIRpoles']=False
4004+ # And the COLLIER global cache is active, if not specified
4005+ if 'COLLIERGlobalCache' not in MLoptions:
4006+ MLoptions['COLLIERGlobalCache']=-1
4007+ # And time NINJA by default if not specified:
4008+ if 'MLReductionLib' not in MLoptions or \
4009+ len(MLoptions['MLReductionLib'])==0:
4010+ MLoptions['MLReductionLib'] = [6]
4011+
4012 timing2 = myTimer.time_matrix_element(matrix_element, reusing, param_card,
4013 keep_folder = keep_folder, options=options,
4014 MLOptions = MLoptions)
4015@@ -2233,6 +2268,7 @@
4016 # Return the merged two dictionaries
4017 res = dict(timing1.items()+timing2.items())
4018 res['loop_optimized_output']=myTimer.loop_optimized_output
4019+ res['reduction_tool'] = MLoptions['MLReductionLib'][0]
4020 return res
4021
4022 #===============================================================================
4023@@ -2678,7 +2714,8 @@
4024 # Use nicer name for the XML tag in the log file
4025 xml_toolname = {'GOLEM95':'GOLEM','IREGI':'IREGI',
4026 'CUTTOOLS':'CUTTOOLS','PJFRY++':'PJFRY',
4027- 'NINJA':'NINJA','SAMURAI':'SAMURAI'}[toolname.upper()]
4028+ 'NINJA':'NINJA','SAMURAI':'SAMURAI',
4029+ 'COLLIER':'COLLIER'}[toolname.upper()]
4030 if len(UPS)>0:
4031 res_str_i = "\nDetails of the %d/%d UPS encountered by %s\n"\
4032 %(len(UPS),nPS,toolname)
4033@@ -2819,7 +2856,7 @@
4034
4035 try:
4036 import matplotlib.pyplot as plt
4037- colorlist=['b','r','g','y','m','c']
4038+ colorlist=['b','r','g','y','m','c','k']
4039 for i,key in enumerate(data_plot_dict.keys()):
4040 color=colorlist[i]
4041 data_plot=data_plot_dict[key]
4042@@ -2860,6 +2897,8 @@
4043 # Define shortcut
4044 f = format_output
4045 loop_optimized_output = timings['loop_optimized_output']
4046+ reduction_tool = bannermod.MadLoopParam._ID_reduction_tool_map[
4047+ timings['reduction_tool']]
4048
4049 res_str = "%s \n"%process.nice_string()
4050 try:
4051@@ -2885,6 +2924,7 @@
4052 res_str += "|= Initialization............ %s\n"\
4053 %f(timings['Initialization'],'%.3gs')
4054
4055+ res_str += "\n= Reduction tool tested...... %s\n"%reduction_tool
4056 res_str += "\n= Helicity sum time / PSpoint ========== %.3gms\n"\
4057 %(timings['run_unpolarized_total']*1000.0)
4058 if loop_optimized_output:
4059@@ -2894,7 +2934,7 @@
4060 total=coef_time+loop_time
4061 res_str += "|= Coefs. computation time... %.3gms (%d%%)\n"\
4062 %(coef_time,int(round(100.0*coef_time/total)))
4063- res_str += "|= Loop evaluation (OPP) time %.3gms (%d%%)\n"\
4064+ res_str += "|= Loop evaluation time...... %.3gms (%d%%)\n"\
4065 %(loop_time,int(round(100.0*loop_time/total)))
4066 res_str += "\n= One helicity time / PSpoint ========== %.3gms\n"\
4067 %(timings['run_polarized_total']*1000.0)
4068@@ -2905,7 +2945,7 @@
4069 total=coef_time+loop_time
4070 res_str += "|= Coefs. computation time... %.3gms (%d%%)\n"\
4071 %(coef_time,int(round(100.0*coef_time/total)))
4072- res_str += "|= Loop evaluation (OPP) time %.3gms (%d%%)\n"\
4073+ res_str += "|= Loop evaluation time...... %.3gms (%d%%)\n"\
4074 %(loop_time,int(round(100.0*loop_time/total)))
4075 res_str += "\n= Miscellaneous ========================\n"
4076 res_str += "|= Number of hel. computed... %s/%s\n"\
4077
4078=== modified file 'madgraph/various/q_polynomial.py'
4079--- madgraph/various/q_polynomial.py 2016-06-09 00:59:23 +0000
4080+++ madgraph/various/q_polynomial.py 2016-06-24 21:04:21 +0000
4081@@ -362,6 +362,20 @@
4082
4083 return '\n'.join(lines)
4084
4085+ def get_COLLIER_mapping(self):
4086+ """ Returns a list of tuples of the form:
4087+ [ (COLLIER_ind0, COLLIER_ind1, COLLIER_ind2, COLLIER_ind3), ]
4088+ where the position in the list is the coef_ID in MadLoop ordering.
4089+ """
4090+ res = []
4091+ for coef_pos in range(0,get_number_of_coefs_for_rank(self.pq.rank)):
4092+ indices_list = self.pq.get_coef_at_position(coef_pos)
4093+ res.append((indices_list.count(0),
4094+ indices_list.count(1),
4095+ indices_list.count(2),
4096+ indices_list.count(3)))
4097+ return res
4098+
4099 def write_golem95_mapping(self):
4100 """ Returns a fortran subroutine which fills in the array of tensorial
4101 coefficients following golem95 standards using MadLoop coefficients."""
4102
4103=== modified file 'tests/IOTests.py'
4104--- tests/IOTests.py 2015-10-01 16:00:08 +0000
4105+++ tests/IOTests.py 2016-06-24 21:04:21 +0000
4106@@ -155,7 +155,7 @@
4107 myloopamp,optimized_output=isOptimized)
4108
4109 self.exporter.copy_v4template(model.get('name'))
4110- self.exporter.generate_loop_subprocess(hel_amp, self.helasModel)
4111+ self.exporter.generate_loop_subprocess(hel_amp, self.helasModel,unique_id=1)
4112 wanted_lorentz = hel_amp.get_used_lorentz()
4113 wanted_couplings = list(set(sum(hel_amp.get_used_couplings(),[])))
4114 self.exporter.convert_model_to_mg4(model,wanted_lorentz,wanted_couplings)
4115
4116=== modified file 'tests/acceptance_tests/test_cmd.py'
4117--- tests/acceptance_tests/test_cmd.py 2016-05-11 21:07:38 +0000
4118+++ tests/acceptance_tests/test_cmd.py 2016-06-24 21:04:21 +0000
4119@@ -189,6 +189,7 @@
4120 'f2py_compiler':None,
4121 'cluster_retry_wait': 300,
4122 'syscalc_path':'./SysCalc',
4123+ 'collier':'auto',
4124 'hepmc_path': './hepmc',
4125 'hwpp_path': './herwigPP',
4126 'thepeg_path': './thepeg',
4127
4128=== modified file 'tests/acceptance_tests/test_histograms.py'
4129--- tests/acceptance_tests/test_histograms.py 2016-06-09 00:59:23 +0000
4130+++ tests/acceptance_tests/test_histograms.py 2016-06-24 21:04:21 +0000
4131@@ -47,6 +47,5 @@
4132 histo_list.output(pjoin('%s','HistoOut'), format = 'gnuplot');
4133 ''' % (sys.path, _file_path, self.IOpath)
4134
4135- import os
4136 os.system('echo "%s" | python' % line)
4137
4138
4139=== added file 'tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_dxu_wp%V0_dxu_wp%COLLIER_interface.f'
4140--- tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_dxu_wp%V0_dxu_wp%COLLIER_interface.f 1970-01-01 00:00:00 +0000
4141+++ tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_dxu_wp%V0_dxu_wp%COLLIER_interface.f 2016-06-24 21:04:21 +0000
4142@@ -0,0 +1,693 @@
4143+ SUBROUTINE COLLIERLOOP(CTMODE, NLOOPLINE,RANK,PL,PDEN,M2L
4144+ $ ,TIRCOEFS)
4145+C
4146+C Generated by MadGraph5_aMC@NLO v. %(version)s, %(date)s
4147+C By the MadGraph5_aMC@NLO Development Team
4148+C Visit launchpad.net/madgraph5 and amcatnlo.web.cern.ch
4149+C
4150+C Interface between MG5 and COLLIER.
4151+C It supports any rank when 1 < NLOOPLINE < 7.
4152+C
4153+C Process: d~ u > w+ WEIGHTED<=2 QED<=1 [ all = QCD ]
4154+C Process: s~ c > w+ WEIGHTED<=2 QED<=1 [ all = QCD ]
4155+C
4156+C
4157+C MODULES
4158+C
4159+ USE COLLIER
4160+ IMPLICIT NONE
4161+C
4162+C CONSTANTS
4163+C
4164+ LOGICAL CHECKPCONSERVATION
4165+ PARAMETER (CHECKPCONSERVATION=.TRUE.)
4166+ REAL*8 PI
4167+ PARAMETER(PI=3.14159265358979323846D0)
4168+ INTEGER MAXRANK
4169+ PARAMETER (MAXRANK=2)
4170+ INTEGER NLOOPGROUPS
4171+ PARAMETER (NLOOPGROUPS=1)
4172+ INCLUDE 'loop_max_coefs.inc'
4173+C
4174+C ARGUMENTS
4175+C
4176+ INTEGER NLOOPLINE, RANK, CTMODE
4177+ REAL*8 PL(0:3,NLOOPLINE)
4178+ REAL*8 PDEN(0:3,NLOOPLINE-1)
4179+ COMPLEX*16 M2L(NLOOPLINE)
4180+ COMPLEX*16 RES(3)
4181+ COMPLEX*16 TIRCOEFS(0:LOOPMAXCOEFS-1,3)
4182+C
4183+C LOCAL VARIABLES
4184+C
4185+ INTEGER N, I, J, K, L
4186+ INTEGER C0,C1,C2,C3
4187+ INTEGER N_CACHES
4188+ INTEGER CURR_RANK, SGN
4189+ INTEGER CURR_INDEX
4190+ INTEGER CURR_MAXCOEF
4191+ REAL*8 RBUFF(0:3)
4192+
4193+ INTEGER COEFMAP_ZERO(0:LOOPMAXCOEFS-1)
4194+ INTEGER COEFMAP_ONE(0:LOOPMAXCOEFS-1)
4195+ INTEGER COEFMAP_TWO(0:LOOPMAXCOEFS-1)
4196+ INTEGER COEFMAP_THREE(0:LOOPMAXCOEFS-1)
4197+ DATA (COEFMAP_ZERO(I),I= 0, 9) / 0, 1, 0, 0, 0, 2, 1, 0, 1, 0/
4198+ DATA (COEFMAP_ZERO(I),I= 10, 14) / 0, 1, 0, 0, 0/
4199+ DATA (COEFMAP_ONE(I),I= 0, 9) / 0, 0, 1, 0, 0, 0, 1, 2, 0, 1/
4200+ DATA (COEFMAP_ONE(I),I= 10, 14) / 0, 0, 1, 0, 0/
4201+ DATA (COEFMAP_TWO(I),I= 0, 9) / 0, 0, 0, 1, 0, 0, 0, 0, 1, 1/
4202+ DATA (COEFMAP_TWO(I),I= 10, 14) / 2, 0, 0, 1, 0/
4203+ DATA (COEFMAP_THREE(I),I= 0, 9) / 0, 0, 0, 0, 1, 0, 0, 0, 0, 0/
4204+ DATA (COEFMAP_THREE(I),I= 10, 14) / 0, 1, 1, 1, 2/
4205+
4206+ REAL*8 REF_NORMALIZATION
4207+
4208+ DOUBLE COMPLEX M2LCOLLIER(0:NLOOPLINE-1)
4209+ DOUBLE COMPLEX MOMVEC(0:3,NLOOPLINE-1)
4210+ DOUBLE COMPLEX MOMINV((NLOOPLINE*(NLOOPLINE-1))/2)
4211+
4212+ DOUBLE COMPLEX TNTEN(0:RANK,0:RANK,0:RANK,0:RANK)
4213+ DOUBLE COMPLEX TNTENUV(0:RANK,0:RANK,0:RANK,0:RANK)
4214+ DOUBLE PRECISION TNTENERR(0:RANK)
4215+
4216+C These quantities are for the pole evaluation
4217+ DOUBLE COMPLEX TNTEN_UV(0:RANK,0:RANK,0:RANK,0:RANK)
4218+ DOUBLE COMPLEX TNTENUV_UV(0:RANK,0:RANK,0:RANK,0:RANK)
4219+ DOUBLE PRECISION TNTENERR_UV(0:RANK)
4220+ DOUBLE COMPLEX TNTEN_IR1(0:RANK,0:RANK,0:RANK,0:RANK)
4221+ DOUBLE COMPLEX TNTENUV_IR1(0:RANK,0:RANK,0:RANK,0:RANK)
4222+ DOUBLE PRECISION TNTENERR_IR1(0:RANK)
4223+ DOUBLE COMPLEX TNTEN_IR2(0:RANK,0:RANK,0:RANK,0:RANK)
4224+ DOUBLE COMPLEX TNTENUV_IR2(0:RANK,0:RANK,0:RANK,0:RANK)
4225+ DOUBLE PRECISION TNTENERR_IR2(0:RANK)
4226+C
4227+C GLOBAL VARIABLES
4228+C
4229+ INCLUDE 'coupl.inc'
4230+ INCLUDE 'MadLoopParams.inc'
4231+ INCLUDE 'unique_id.inc'
4232+ INCLUDE 'global_specs.inc'
4233+
4234+ INTEGER ID,SQSOINDEX,R
4235+ COMMON/LOOP/ID,SQSOINDEX,R
4236+
4237+C
4238+C These global variables cache the coefficients already computed
4239+C by COLLIER
4240+C so that they can be reused. In particular, in CTMODE 2, the
4241+C cached ERROR
4242+C quantities for eahc rank will be used to make use of COLLIER's
4243+C internal
4244+C assessment of the numerical accuracy.
4245+C
4246+ LOGICAL LOOP_ID_DONE(NLOOPGROUPS)
4247+ DATA LOOP_ID_DONE/NLOOPGROUPS*.FALSE./
4248+ COMPLEX*16 TIR_COEFS_DIRECT_MODE(0:LOOPMAXCOEFS-1,3,NLOOPGROUPS)
4249+ REAL*8 TIR_COEFS_ERROR(0:MAXRANK,NLOOPGROUPS)
4250+ COMMON/COLLIER_TIR_COEFS/TIR_COEFS_DIRECT_MODE,TIR_COEFS_ERROR
4251+ $ ,LOOP_ID_DONE
4252+
4253+ INTEGER COLLIER_CACHE_ACTIVE, NCALLS_IN_CACHE(4),
4254+ $ NCOLLIERCALLS(4)
4255+ LOGICAL MUST_INIT_EVENT
4256+ COMMON/COLLIER_CACHE_STATUS/COLLIER_CACHE_ACTIVE,NCALLS_IN_CACHE
4257+ $ , NCOLLIERCALLS,MUST_INIT_EVENT
4258+
4259+ LOGICAL CTINIT, TIRINIT, GOLEMINIT, SAMURAIINIT, NINJAINIT,
4260+ $ COLLIERINIT
4261+ COMMON/REDUCTIONCODEINIT/CTINIT, TIRINIT,GOLEMINIT,SAMURAIINIT
4262+ $ ,NINJAINIT, COLLIERINIT
4263+
4264+C ----------
4265+C BEGIN CODE
4266+C ----------
4267+
4268+ IF (COLLIERUSECACHEFORPOLES) THEN
4269+ N_CACHES = 4
4270+ ELSE
4271+ N_CACHES =1
4272+ ENDIF
4273+
4274+C Initialize COLLIER if needed
4275+ IF (COLLIERINIT) THEN
4276+ COLLIERINIT=.FALSE.
4277+ CALL INITCOLLIER()
4278+ ENDIF
4279+
4280+C Initialize the event if it is the first time collier is called
4281+C on this PS point
4282+ IF(MUST_INIT_EVENT) THEN
4283+ MUST_INIT_EVENT = .FALSE.
4284+ IF (COLLIERGLOBALCACHE.EQ.0) THEN
4285+ CALL INITEVENT_CLL()
4286+ ELSE
4287+ DO I=1,N_CACHES
4288+C Record how many events where put in the cache. On the
4289+C first PS point.
4290+ IF (NCALLS_IN_CACHE(I).EQ.-1.AND.NCOLLIERCALLS(I).GT.0)
4291+ $ THEN
4292+ NCALLS_IN_CACHE(I) = NCOLLIERCALLS(I)
4293+ ENDIF
4294+ ENDDO
4295+ DO I=1,N_CACHES
4296+C Now apply a safety check that our last event had as many
4297+C calls as the cache is setup for.
4298+C The only case for now when it can be half of the calls
4299+C when we are doing the true loop-direction test with also
4300+C the computation of a rotated PS point (which is computed
4301+C for one mode only).
4302+ IF (NCALLS_IN_CACHE(I).NE.-1.AND..NOT. ( NCOLLIERCALLS(I)
4303+ $ .EQ.NCALLS_IN_CACHE(I).OR. ( CTMODERUN.EQ.
4304+ $ -1.AND..NOT.COLLIERUSEINTERNALSTABILITYTEST.AND.NROTATIONS
4305+ $_DP.GT.0.AND.MOD(NCALLS_IN_CACHE(I),2).EQ.0.AND.(NCALLS_IN_CACHE(
4306+ $I)/2).EQ.NCOLLIERCALLS(I) ) ) ) THEN
4307+ WRITE(*,*) 'WARNING: A consistency check in MadLoop'
4308+ $ //' failed and, for safety, forced MadLoop to'
4309+ $ //' reinitialize the global cache of COLLIER. Report'
4310+ $ //' this to MadLoop authors. The problematic cache was'
4311+ $ //' number ',I
4312+ IF (COLLIERGLOBALCACHE.EQ.-1) THEN
4313+ CALL INITCACHESYSTEM_CLL(N_CACHES*NPROCS,MAXNEXTERNAL)
4314+ ELSE
4315+ CALL INITCACHESYSTEM_CLL(N_CACHES*NPROCS
4316+ $ ,COLLIERGLOBALCACHE)
4317+ ENDIF
4318+C Make sure all caches are switched off at first.
4319+ CALL SWITCHOFFCACHESYSTEM_CLL()
4320+C Reset the cache design property
4321+ NCALLS_IN_CACHE(:) = -1
4322+ NCOLLIERCALLS(:) = 0
4323+ IF (COLLIER_CACHE_ACTIVE.EQ.1) THEN
4324+ CALL SWITCHONCACHE_CLL((UNIQUE_ID-1)*N_CACHES+1)
4325+ ENDIF
4326+C No need to check the other caches since we already had
4327+C to reset here.
4328+ EXIT
4329+ ENDIF
4330+ ENDDO
4331+ CALL INITEVENT_CLL((UNIQUE_ID-1)*N_CACHES+1)
4332+ NCOLLIERCALLS(1) = 0
4333+ IF(COLLIERCOMPUTEUVPOLES.AND.COLLIERUSECACHEFORPOLES) THEN
4334+ CALL INITEVENT_CLL((UNIQUE_ID-1)*N_CACHES+2)
4335+ NCOLLIERCALLS(2) = 0
4336+ ENDIF
4337+ IF(COLLIERCOMPUTEIRPOLES.AND.COLLIERUSECACHEFORPOLES) THEN
4338+ CALL INITEVENT_CLL((UNIQUE_ID-1)*N_CACHES+3)
4339+ NCOLLIERCALLS(3) = 0
4340+ CALL INITEVENT_CLL((UNIQUE_ID-1)*N_CACHES+4)
4341+ NCOLLIERCALLS(4) = 0
4342+ ENDIF
4343+ ENDIF
4344+ CALL SETDELTAIR_CLL(0.0D0,(PI**2)/6.0D0)
4345+ CALL SETDELTAUV_CLL(0.0D0)
4346+ CALL SETMUIR2_CLL(MU_R**2)
4347+ CALL SETMUUV2_CLL(MU_R**2)
4348+ ENDIF
4349+
4350+C Now really start the reduction with COLLIER
4351+
4352+C Number of coefficients for the current rank
4353+ CURR_MAXCOEF = 0
4354+ DO I=0,RANK
4355+ CURR_MAXCOEF=CURR_MAXCOEF+(3+I)*(2+I)*(1+I)/6
4356+ ENDDO
4357+
4358+ IF (CTMODE.NE.1.AND.CTMODE.NE.2) THEN
4359+ WRITE(*,*) 'ERROR: COLLIER only support the computational mode'
4360+ $ //' CTMODE equal to 1 or 2, not',CTMODE
4361+ STOP 'Incorrect computational mode specified to the COLLIER'
4362+ $ //' MG5aMC interface.'
4363+ ENDIF
4364+
4365+ IF (COLLIERUSEINTERNALSTABILITYTEST) THEN
4366+C Use MADLOOP internal cache dedicated to COLLIER that emulates
4367+C the CTMODE 2
4368+C by using coefficients shifted by COLLIER internal error
4369+C estimate.
4370+ IF (CTMODE.EQ.1) THEN
4371+ IF (LOOP_ID_DONE(ID)) THEN
4372+ DO I=0,CURR_MAXCOEF-1
4373+ DO K=1,3
4374+ TIRCOEFS(I,K)=TIR_COEFS_DIRECT_MODE(I,K,ID)
4375+ ENDDO
4376+ ENDDO
4377+ RETURN
4378+ ENDIF
4379+ ELSEIF (CTMODE.EQ.2) THEN
4380+ IF (LOOP_ID_DONE(ID)) THEN
4381+ DO I=0,CURR_MAXCOEF-1
4382+ CURR_RANK = COEFMAP_ZERO(I)+COEFMAP_ONE(I)+COEFMAP_TWO(I)
4383+ $ +COEFMAP_THREE(I)
4384+ DO K=1,3
4385+ TIRCOEFS(I,K)=TIR_COEFS_DIRECT_MODE(I,K,ID)*(1.0D0
4386+ $ +TIR_COEFS_ERROR(CURR_RANK,ID))
4387+ ENDDO
4388+ ENDDO
4389+ RETURN
4390+ ENDIF
4391+ ENDIF
4392+ ELSE
4393+C Apply the loop-direction switching here.
4394+ CALL SWITCH_ORDER(CTMODE,NLOOPLINE,PL,PDEN,M2L)
4395+ ENDIF
4396+
4397+C Make sure masses are complex
4398+ DO I=1,NLOOPLINE
4399+ M2LCOLLIER(I-1)=DCMPLX(M2L(I))
4400+ ENDDO
4401+
4402+C Now convert the loop offset momenta to COLLIER conventions
4403+ DO I=0,3
4404+ DO J=1,NLOOPLINE-1
4405+ MOMVEC(I,J)=DCMPLX(PDEN(I,J),0.0D0)
4406+ ENDDO
4407+ ENDDO
4408+
4409+C This first do loop spans over 'N' in '\foreach_N'
4410+C //' \foreach_i(k_i+k_{i+1}+..+k_{i+N})^2'
4411+ CURR_INDEX = 0
4412+ DO N=0,NLOOPLINE-1
4413+C We stop whenever we reached the target number of invariants
4414+ IF (CURR_INDEX.GE.((NLOOPLINE*(NLOOPLINE-1))/2)) THEN
4415+ EXIT
4416+ ENDIF
4417+C This do loop spans over 'i' in the expression above.
4418+ DO I=1,NLOOPLINE
4419+ IF (CURR_INDEX.GE.((NLOOPLINE*(NLOOPLINE-1))/2)) THEN
4420+ EXIT
4421+ ENDIF
4422+
4423+ CURR_INDEX = CURR_INDEX+1
4424+ RBUFF(:) = 0.0D0
4425+ DO J=I,I+N
4426+ RBUFF(:) = RBUFF(:) + PL(:,MOD(J-1,NLOOPLINE)+1)
4427+ ENDDO
4428+ MOMINV(CURR_INDEX) = DCMPLX(RBUFF(0)**2-RBUFF(1)**2-RBUFF(2)
4429+ $ **2-RBUFF(3)**2,0.0D0)
4430+
4431+C Now regularize the onshell behavior of the kinematic
4432+C invarients
4433+C All loop masses are tested, but that might be a bit too
4434+C inclusive.
4435+ DO K=1,NLOOPLINE
4436+ IF(ABS(M2L(K)).NE.0.0D0) THEN
4437+ IF(ABS((MOMINV(CURR_INDEX)-M2L(K))/M2L(K)).LT.OSTHRES)
4438+ $ THEN
4439+ MOMINV(CURR_INDEX)=DCMPLX(M2L(K))
4440+ ENDIF
4441+ ENDIF
4442+ ENDDO
4443+C For the massless onshell-case, we base the threshold only on
4444+C the energy component
4445+ REF_NORMALIZATION=0.0D0
4446+ DO L=0,0
4447+ REF_NORMALIZATION = REF_NORMALIZATION + ABS(RBUFF(L))
4448+ ENDDO
4449+ REF_NORMALIZATION = (REF_NORMALIZATION/(N+1))**2
4450+ IF(REF_NORMALIZATION.NE.0.0D0)THEN
4451+ IF(ABS(MOMINV(CURR_INDEX)/REF_NORMALIZATION).LT.OSTHRES)
4452+ $ THEN
4453+ MOMINV(CURR_INDEX)=DCMPLX(0.0D0,0.0D0)
4454+ ENDIF
4455+ ENDIF
4456+
4457+ ENDDO
4458+ ENDDO
4459+
4460+C We can now call COLLIER
4461+ IF (NLOOPLINE.NE.1) THEN
4462+ CALL TNTEN_CLL(TNTEN, TNTENUV, MOMVEC, MOMINV, M2LCOLLIER,
4463+ $ NLOOPLINE, RANK, TNTENERR)
4464+ ELSE
4465+ CALL TNTEN_CLL(TNTEN, TNTENUV, M2LCOLLIER, NLOOPLINE, RANK,
4466+ $ TNTENERR)
4467+ ENDIF
4468+ IF (COLLIER_CACHE_ACTIVE.EQ.1) THEN
4469+ NCOLLIERCALLS(1) = NCOLLIERCALLS(1)+1
4470+ ENDIF
4471+
4472+C Now compute the UV poles if asked for
4473+ IF (COLLIERCOMPUTEUVPOLES) THEN
4474+ IF(COLLIER_CACHE_ACTIVE.EQ.1) THEN
4475+ CALL SWITCHOFFCACHE_CLL((UNIQUE_ID-1)*N_CACHES+1)
4476+ IF(COLLIERUSECACHEFORPOLES) THEN
4477+ CALL SWITCHONCACHE_CLL((UNIQUE_ID-1)*N_CACHES+2)
4478+ ENDIF
4479+ ENDIF
4480+ CALL SETDELTAUV_CLL(1.0D0)
4481+ IF (NLOOPLINE.NE.1) THEN
4482+ CALL TNTEN_CLL(TNTEN_UV, TNTENUV_UV, MOMVEC, MOMINV,
4483+ $ M2LCOLLIER, NLOOPLINE, RANK, TNTENERR_UV)
4484+ ELSE
4485+ CALL TNTEN_CLL(TNTEN_UV, TNTENUV_UV, M2LCOLLIER, NLOOPLINE,
4486+ $ RANK, TNTENERR_UV)
4487+ ENDIF
4488+ IF (COLLIER_CACHE_ACTIVE.EQ.1) THEN
4489+ NCOLLIERCALLS(2) = NCOLLIERCALLS(2)+1
4490+ ENDIF
4491+ IF(COLLIER_CACHE_ACTIVE.EQ.1) THEN
4492+ IF(COLLIERUSECACHEFORPOLES) THEN
4493+ CALL SWITCHOFFCACHE_CLL((UNIQUE_ID-1)*N_CACHES+2)
4494+ ENDIF
4495+ CALL SWITCHONCACHE_CLL((UNIQUE_ID-1)*N_CACHES+1)
4496+ ENDIF
4497+ CALL SETDELTAUV_CLL(0.0D0)
4498+ ENDIF
4499+
4500+C Now compute the IR poles if asked for
4501+ IF (COLLIERCOMPUTEIRPOLES) THEN
4502+ IF(COLLIER_CACHE_ACTIVE.EQ.1) THEN
4503+ CALL SWITCHOFFCACHE_CLL((UNIQUE_ID-1)*N_CACHES+1)
4504+ IF(COLLIERUSECACHEFORPOLES) THEN
4505+ CALL SWITCHONCACHE_CLL((UNIQUE_ID-1)*N_CACHES+3)
4506+ ENDIF
4507+ ENDIF
4508+ CALL SETDELTAIR_CLL(1.0D0,(PI**2)/6.0D0)
4509+ IF (NLOOPLINE.NE.1) THEN
4510+ CALL TNTEN_CLL(TNTEN_IR1, TNTENUV_IR1, MOMVEC, MOMINV,
4511+ $ M2LCOLLIER, NLOOPLINE, RANK, TNTENERR_IR1)
4512+ ELSE
4513+ CALL TNTEN_CLL(TNTEN_IR1, TNTENUV_IR1, M2LCOLLIER, NLOOPLINE
4514+ $ , RANK, TNTENERR_IR1)
4515+ ENDIF
4516+ IF (COLLIER_CACHE_ACTIVE.EQ.1) THEN
4517+ NCOLLIERCALLS(3) = NCOLLIERCALLS(3)+1
4518+ ENDIF
4519+ IF(COLLIER_CACHE_ACTIVE.EQ.1.AND.COLLIERUSECACHEFORPOLES) THEN
4520+ CALL SWITCHOFFCACHE_CLL((UNIQUE_ID-1)*N_CACHES+3)
4521+ CALL SWITCHONCACHE_CLL((UNIQUE_ID-1)*N_CACHES+4)
4522+ ENDIF
4523+ CALL SETDELTAIR_CLL(0.0D0,1.0D0+(PI**2)/6.0D0)
4524+ IF (NLOOPLINE.NE.1) THEN
4525+ CALL TNTEN_CLL(TNTEN_IR2, TNTENUV_IR2, MOMVEC, MOMINV,
4526+ $ M2LCOLLIER, NLOOPLINE, RANK, TNTENERR_IR2)
4527+ ELSE
4528+ CALL TNTEN_CLL(TNTEN_IR2, TNTENUV_IR2, M2LCOLLIER, NLOOPLINE
4529+ $ , RANK, TNTENERR_IR2)
4530+ ENDIF
4531+ IF (COLLIER_CACHE_ACTIVE.EQ.1) THEN
4532+ NCOLLIERCALLS(4) = NCOLLIERCALLS(4)+1
4533+ ENDIF
4534+ IF(COLLIER_CACHE_ACTIVE.EQ.1) THEN
4535+ IF(COLLIERUSECACHEFORPOLES) THEN
4536+ CALL SWITCHOFFCACHE_CLL((UNIQUE_ID-1)*N_CACHES+4)
4537+ ENDIF
4538+ CALL SWITCHONCACHE_CLL((UNIQUE_ID-1)*N_CACHES+1)
4539+ ENDIF
4540+ CALL SETDELTAIR_CLL(0.0D0,(PI**2)/6.0D0)
4541+ ENDIF
4542+
4543+ DO I=0,(CURR_MAXCOEF-1)
4544+ C0 = COEFMAP_ZERO(I)
4545+ C1 = COEFMAP_ONE(I)
4546+ C2 = COEFMAP_TWO(I)
4547+ C3 = COEFMAP_THREE(I)
4548+ CURR_RANK = C0+C1+C2+C3
4549+C Because we must set q -> -q, we apply a minus sign to coefs of
4550+C odd rank
4551+ IF (MOD(CURR_RANK,2).EQ.1) THEN
4552+ SGN = -1
4553+ ELSE
4554+ SGN = 1
4555+ ENDIF
4556+ TIRCOEFS(I,1) = SGN*TNTEN(C0,C1,C2,C3)
4557+ IF (COLLIERCOMPUTEUVPOLES) THEN
4558+ TIRCOEFS(I,2) = SGN*( TNTEN_UV(C0,C1,C2,C3)-TNTEN(C0,C1,C2
4559+ $ ,C3) )
4560+ ELSE
4561+ TIRCOEFS(I,2) = DCMPLX(0.0D0,0.0D0)
4562+ ENDIF
4563+ IF (COLLIERCOMPUTEIRPOLES) THEN
4564+ TIRCOEFS(I,2) = TIRCOEFS(I,2) + SGN*( TNTEN_IR1(C0,C1,C2,C3)
4565+ $ -TNTEN(C0,C1,C2,C3) )
4566+ TIRCOEFS(I,3) = SGN*( TNTEN_IR2(C0,C1,C2,C3)-TNTEN(C0,C1,C2
4567+ $ ,C3) )
4568+ ELSE
4569+ TIRCOEFS(I,3) = DCMPLX(0.0D0,0.0D0)
4570+ ENDIF
4571+ ENDDO
4572+
4573+ IF (COLLIERUSEINTERNALSTABILITYTEST) THEN
4574+C Finish by caching the coefficients and error just computed
4575+ LOOP_ID_DONE(ID) = .TRUE.
4576+ DO J=0,CURR_MAXCOEF-1
4577+ DO K=1,3
4578+ TIR_COEFS_DIRECT_MODE(J,K,ID) = TIRCOEFS(J,K)
4579+ ENDDO
4580+ ENDDO
4581+ DO J=0,RANK
4582+ TIR_COEFS_ERROR(J,ID)=TNTENERR(J)
4583+ ENDDO
4584+
4585+ IF (CTMODE.EQ.2) THEN
4586+ DO I=0,(CURR_MAXCOEF-1)
4587+ CURR_RANK = COEFMAP_ZERO(I)+COEFMAP_ONE(I)+COEFMAP_TWO(I)
4588+ $ +COEFMAP_THREE(I)
4589+ DO J=1,3
4590+ TIRCOEFS(I,J) = TIRCOEFS(I,J) * (1.0D0
4591+ $ +TNTENERR(CURR_RANK))
4592+ ENDDO
4593+ ENDDO
4594+ ENDIF
4595+ ENDIF
4596+
4597+ END SUBROUTINE COLLIERLOOP
4598+
4599+ SUBROUTINE CLEAR_COLLIER_CACHE()
4600+
4601+ USE COLLIER
4602+
4603+ INCLUDE 'loop_max_coefs.inc'
4604+ INTEGER NLOOPGROUPS
4605+ PARAMETER (NLOOPGROUPS=1)
4606+ INTEGER MAXRANK
4607+ PARAMETER (MAXRANK=2)
4608+
4609+ INTEGER I,J,K
4610+
4611+ INCLUDE 'MadLoopParams.inc'
4612+
4613+ LOGICAL LOOP_ID_DONE(NLOOPGROUPS)
4614+ COMPLEX*16 TIR_COEFS_DIRECT_MODE(0:LOOPMAXCOEFS-1,3,NLOOPGROUPS)
4615+ COMPLEX*16 TIR_COEFS_ERROR(0:MAXRANK,NLOOPGROUPS)
4616+ COMMON/COLLIER_TIR_COEFS/TIR_COEFS_DIRECT_MODE,TIR_COEFS_ERROR
4617+ $ ,LOOP_ID_DONE
4618+
4619+ INTEGER COLLIER_CACHE_ACTIVE, NCALLS_IN_CACHE(4),
4620+ $ NCOLLIERCALLS(4)
4621+ LOGICAL MUST_INIT_EVENT
4622+ COMMON/COLLIER_CACHE_STATUS/COLLIER_CACHE_ACTIVE,NCALLS_IN_CACHE
4623+ $ , NCOLLIERCALLS,MUST_INIT_EVENT
4624+
4625+C Make sure that next time the COLLIER Subroutine is called it
4626+C will call the subroutine initEvent of Collier.
4627+ MUST_INIT_EVENT = .TRUE.
4628+
4629+C Reinitialize the ML cache for COLLIER
4630+ DO I=1,NLOOPGROUPS
4631+ LOOP_ID_DONE(I) = .FALSE.
4632+ DO J=0,LOOPMAXCOEFS-1
4633+ DO K=1,3
4634+ TIR_COEFS_DIRECT_MODE(J,K,I) = DCMPLX(0.0D0,0.0D0)
4635+ ENDDO
4636+ ENDDO
4637+ DO J=0,MAXRANK
4638+ TIR_COEFS_ERROR(J,I)=0.0D0
4639+ ENDDO
4640+ ENDDO
4641+
4642+ END
4643+
4644+ SUBROUTINE SET_COLLIER_GLOBAL_CACHE(ONOFF)
4645+C
4646+C This routine is used by loop_matrix.f to turn on the global
4647+C cache of COLLIER when it the main SLOOP subroutine starts and
4648+C turn it off when it ends.
4649+C However several checks are performed to verify that it is safe
4650+C to turn it on and to reinitialize it if necessary.
4651+C
4652+C MODULES
4653+C
4654+ USE COLLIER
4655+ IMPLICIT NONE
4656+C
4657+C ARGUMENTS
4658+C
4659+ LOGICAL ONOFF
4660+C
4661+C LOCAL VARIABLES
4662+C
4663+ LOGICAL NEED_REINITIALIZATION
4664+ INTEGER N_CACHES
4665+C
4666+C GLOBAL VARIABLES
4667+C
4668+C
4669+C This common blocks saves the relevant ML parameters when
4670+C activating the
4671+C global cache of COLLIER so that we know when we must
4672+C reinitialize it.
4673+C COLLIER_CACHE_ACTIVE is set to -1 when it has never been turned
4674+C on yet and
4675+C to 1 for 'Active' and 0 for 'Inactive'.
4676+C The integer NCALLS_IN_CACHE saves how many calls the cache is
4677+C setup for, for each of the up to four caches.
4678+C When it is the first PS points, it is set to -1.
4679+ INTEGER COLLIER_CACHE_ACTIVE, NCALLS_IN_CACHE(4),
4680+ $ NCOLLIERCALLS(4)
4681+ DATA COLLIER_CACHE_ACTIVE/-1/
4682+ DATA NCALLS_IN_CACHE/-1,-1,-1,-1/
4683+ DATA NCOLLIERCALLS/0,0,0,0/
4684+C This is a flag to tell the COLLIER subroutine that it must init
4685+C the event when called.
4686+ LOGICAL MUST_INIT_EVENT
4687+ DATA MUST_INIT_EVENT/.TRUE./
4688+ COMMON/COLLIER_CACHE_STATUS/COLLIER_CACHE_ACTIVE,
4689+ $ NCALLS_IN_CACHE, NCOLLIERCALLS,MUST_INIT_EVENT
4690+
4691+ LOGICAL COLLIERUSEINTERNALSTABILITYTEST_BU
4692+ INTEGER USERHEL_BU, SQSO_TARGET_BU, COLLIERMODE_BU,CTMODERUN_BU
4693+ COMMON/COLLIER_CACHE_RELEVANT_PARAMS/USERHEL_BU,SQSO_TARGET_BU
4694+ $ ,COLLIERMODE_BU,CTMODERUN_BU,COLLIERUSEINTERNALSTABILITYTEST_BU
4695+
4696+C The common blocks below are to retrieve the necessary
4697+C information about
4698+C MadLoop running mode and store it in the sCOLLIER_CACHE_RELEVANT_
4699+C PARAMS common block.
4700+
4701+ INCLUDE 'MadLoopParams.inc'
4702+ INCLUDE 'unique_id.inc'
4703+ INCLUDE 'global_specs.inc'
4704+
4705+ LOGICAL CTINIT, TIRINIT, GOLEMINIT, SAMURAIINIT, NINJAINIT,
4706+ $ COLLIERINIT
4707+ COMMON/REDUCTIONCODEINIT/CTINIT, TIRINIT,GOLEMINIT,SAMURAIINIT
4708+ $ ,NINJAINIT, COLLIERINIT
4709+
4710+ LOGICAL CHECKPHASE
4711+ LOGICAL HELDOUBLECHECKED
4712+ COMMON/INIT/CHECKPHASE, HELDOUBLECHECKED
4713+
4714+ INTEGER USERHEL
4715+ COMMON/USERCHOICE/USERHEL
4716+
4717+ INTEGER SQSO_TARGET
4718+ COMMON/SOCHOICE/SQSO_TARGET
4719+
4720+C
4721+C BEGIN CODE
4722+C
4723+
4724+ IF (COLLIERUSECACHEFORPOLES) THEN
4725+ N_CACHES = 4
4726+ ELSE
4727+ N_CACHES =1
4728+ ENDIF
4729+
4730+C Do nothing if COLLIER still has to be initialized or if global
4731+C caches are disabled
4732+ IF(COLLIERINIT.OR.COLLIERGLOBALCACHE.EQ.0) THEN
4733+ RETURN
4734+ ENDIF
4735+
4736+C Never activate anything in the checkphase
4737+ IF (ONOFF.AND.CHECKPHASE) THEN
4738+ RETURN
4739+ ENDIF
4740+
4741+C Handle the request of turning off the caching
4742+ IF (.NOT.ONOFF) THEN
4743+ IF (COLLIER_CACHE_ACTIVE.EQ.1) THEN
4744+ CALL SWITCHOFFCACHE_CLL((UNIQUE_ID-1)*4+1)
4745+ COLLIER_CACHE_ACTIVE = 0
4746+ ENDIF
4747+C If we were asked to turn the cache off but it was already so,
4748+C then do nothing
4749+ RETURN
4750+ ENDIF
4751+
4752+C Handle the request of turning on the caching
4753+
4754+C If asked to activate it but already active, then do nothing
4755+ IF (ONOFF.AND.COLLIER_CACHE_ACTIVE.EQ.1) THEN
4756+ RETURN
4757+ ENDIF
4758+
4759+C We are now in the position where we are asked to activate the
4760+C global cache but it was *not* already active.
4761+
4762+C If we activate it for the first time, make sure to store the
4763+C value of the relevant parameters, activate and return.
4764+ IF (COLLIER_CACHE_ACTIVE.EQ.-1) THEN
4765+ USERHEL_BU = USERHEL
4766+ SQSO_TARGET_BU = SQSO_TARGET
4767+ COLLIERMODE_BU = COLLIERMODE
4768+ COLLIERUSEINTERNALSTABILITYTEST_BU = COLLIERUSEINTERNALSTABILIT
4769+ $YTEST
4770+ CTMODERUN_BU = CTMODERUN
4771+ CALL SWITCHONCACHE_CLL((UNIQUE_ID-1)*4+1)
4772+ COLLIER_CACHE_ACTIVE = 1
4773+ RETURN
4774+ ENDIF
4775+
4776+C Now perform sanity check before the activation to decide if we
4777+C need to reinitialize the cache system first.
4778+ NEED_REINITIALIZATION = .FALSE.
4779+
4780+ IF (SQSO_TARGET.NE.SQSO_TARGET_BU) THEN
4781+ NEED_REINITIALIZATION = .TRUE.
4782+ ENDIF
4783+
4784+ IF (COLLIERMODE.NE.COLLIERMODE_BU) THEN
4785+ NEED_REINITIALIZATION = .TRUE.
4786+ ENDIF
4787+
4788+ IF (COLLIERUSEINTERNALSTABILITYTEST.NEQV.COLLIERUSEINTERNALSTABIL
4789+ $ITYTEST_BU) THEN
4790+ NEED_REINITIALIZATION = .TRUE.
4791+ ENDIF
4792+
4793+ IF (CTMODERUN_BU.NE.CTMODERUN.AND.(.NOT.COLLIERUSEINTERNALSTABILI
4794+ $TYTEST)) THEN
4795+ NEED_REINITIALIZATION = .TRUE.
4796+ ENDIF
4797+
4798+C When doing amplitude reduction the parameter USERHEL does not
4799+C impact the number/order of COLLIER calls
4800+C except if the LoopFilter is ON which really shouldn't be the
4801+C case anymore.
4802+ IF(USELOOPFILTER.AND.(USERHEL.NE.USERHEL_BU)) THEN
4803+ NEED_REINITIALIZATION = .TRUE.
4804+ ENDIF
4805+
4806+ IF(NEED_REINITIALIZATION) THEN
4807+C Log the event because if it happens a lot of time and floods
4808+C the screen, the user must see it
4809+C and either change its usage of MadLoop or turnoff COLLIER cache
4810+ WRITE(*,*) 'INFO: MadLoop detected that the global cache of'
4811+ $ //' COLLIER had to be reset because of a change in your use'
4812+ $ //' of MadLoop. This should not happend for each event.'
4813+ USERHEL_BU = USERHEL
4814+ SQSO_TARGET_BU = SQSO_TARGET
4815+ COLLIERMODE_BU = COLLIERMODE
4816+ COLLIERUSEINTERNALSTABILITYTEST_BU = COLLIERUSEINTERNALSTABILIT
4817+ $YTEST
4818+ CTMODERUN_BU = CTMODERUN
4819+ IF (COLLIERGLOBALCACHE.EQ.-1) THEN
4820+ CALL INITCACHESYSTEM_CLL(N_CACHES*NPROCS,MAXNEXTERNAL)
4821+ ELSE
4822+ CALL INITCACHESYSTEM_CLL(N_CACHES*NPROCS,COLLIERGLOBALCACHE)
4823+ ENDIF
4824+ NCOLLIERCALLS(:) = 0
4825+ NCALLS_IN_CACHE(:) = -1
4826+C Make sure all caches are switched off at first.
4827+ CALL SWITCHOFFCACHESYSTEM_CLL()
4828+ ENDIF
4829+
4830+C Now we can finally activate the cache
4831+ CALL SWITCHONCACHE_CLL((UNIQUE_ID-1)*4+1)
4832+ COLLIER_CACHE_ACTIVE = 1
4833+
4834+ END
4835+
4836
4837=== modified file 'tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_dxu_wp%V0_dxu_wp%CT_interface.f'
4838--- tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_dxu_wp%V0_dxu_wp%CT_interface.f 2016-05-06 09:08:11 +0000
4839+++ tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_dxu_wp%V0_dxu_wp%CT_interface.f 2016-06-24 21:04:21 +0000
4840@@ -39,8 +39,9 @@
4841 COMPLEX*16 R1, ACC
4842 INTEGER I, J, K
4843 LOGICAL CTINIT, TIRINIT, GOLEMINIT, SAMURAIINIT, NINJAINIT
4844+ $ ,COLLIERINIT
4845 COMMON/REDUCTIONCODEINIT/CTINIT,TIRINIT,GOLEMINIT,SAMURAIINIT
4846- $ ,NINJAINIT
4847+ $ ,NINJAINIT,COLLIERINIT
4848 C
4849 C EXTERNAL FUNCTIONS
4850 C
4851@@ -392,8 +393,9 @@
4852 INCLUDE 'coupl.inc'
4853
4854 LOGICAL CTINIT, TIRINIT, GOLEMINIT, SAMURAIINIT, NINJAINIT
4855+ $ ,COLLIERINIT
4856 COMMON/REDUCTIONCODEINIT/CTINIT,TIRINIT,GOLEMINIT,SAMURAIINIT
4857- $ ,NINJAINIT
4858+ $ ,NINJAINIT,COLLIERINIT
4859
4860 REAL*8 LSCALE
4861 INTEGER CTMODE
4862@@ -616,8 +618,9 @@
4863 INCLUDE 'coupl.inc'
4864
4865 LOGICAL CTINIT, TIRINIT, GOLEMINIT, SAMURAIINIT, NINJAINIT
4866+ $ ,COLLIERINIT
4867 COMMON/REDUCTIONCODEINIT/CTINIT,TIRINIT,GOLEMINIT,SAMURAIINIT
4868- $ ,NINJAINIT
4869+ $ ,NINJAINIT,COLLIERINIT
4870
4871 REAL*8 LSCALE
4872 INTEGER CTMODE
4873
4874=== modified file 'tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_dxu_wp%V0_dxu_wp%GOLEM_interface.f'
4875--- tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_dxu_wp%V0_dxu_wp%GOLEM_interface.f 2016-03-31 10:53:12 +0000
4876+++ tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_dxu_wp%V0_dxu_wp%GOLEM_interface.f 2016-06-24 21:04:21 +0000
4877@@ -108,8 +108,9 @@
4878 COMMON/LOOP/ID,SQSOINDEX,R
4879
4880 LOGICAL CTINIT, TIRINIT, GOLEMINIT, SAMURAIINIT, NINJAINIT
4881+ $ ,COLLIERINIT
4882 COMMON/REDUCTIONCODEINIT/CTINIT, TIRINIT,GOLEMINIT,SAMURAIINIT
4883- $ ,NINJAINIT
4884+ $ ,NINJAINIT,COLLIERINIT
4885
4886 INTEGER NLOOPGROUPS
4887 PARAMETER (NLOOPGROUPS=1)
4888
4889=== modified file 'tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_dxu_wp%V0_dxu_wp%TIR_interface.f'
4890--- tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_dxu_wp%V0_dxu_wp%TIR_interface.f 2016-05-06 09:08:11 +0000
4891+++ tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_dxu_wp%V0_dxu_wp%TIR_interface.f 2016-06-24 21:04:21 +0000
4892@@ -45,8 +45,9 @@
4893 INTEGER I, J, K
4894 INTEGER NLOOPCOEFS
4895 LOGICAL CTINIT, TIRINIT, GOLEMINIT, SAMURAIINIT, NINJAINIT
4896+ $ ,COLLIERINIT
4897 COMMON/REDUCTIONCODEINIT/CTINIT,TIRINIT,GOLEMINIT,SAMURAIINIT
4898- $ ,NINJAINIT
4899+ $ ,NINJAINIT,COLLIERINIT
4900
4901 C This variable will be used to detect changes in the TIR library
4902 C used so as to force the reset of the TIR filter.
4903@@ -67,7 +68,6 @@
4904 REAL*8 LSCALE
4905 COMMON/CT/LSCALE,CTMODE
4906
4907-C The variables below are just for monitoring purposes.
4908 INTEGER ID,SQSOINDEX,R
4909 COMMON/LOOP/ID,SQSOINDEX,R
4910
4911@@ -184,6 +184,9 @@
4912 $ ,M2L,MU_R,PJCOEFS,STABLE)
4913 C CONVERT TO MADLOOP CONVENTION
4914 CALL CONVERT_IREGI_COEFFS(RANK,PJCOEFS,TIRCOEFS)
4915+ CASE(7)
4916+C COLLIER
4917+ CALL COLLIERLOOP(CTMODE,NLOOPLINE,RANK,PL,PDEN,M2L,TIRCOEFS)
4918 END SELECT
4919 DO I=1,3
4920 RES(I)=(0.0D0,0.0D0)
4921@@ -198,6 +201,8 @@
4922 C WRITE(*,*) 'PJFry: Loop ID',ID,' =',RES(1),RES(2),RES(3)
4923 C ELSEIF(MLReductionLib(I_LIB).EQ.3) THEN
4924 C WRITE(*,*) 'Iregi: Loop ID',ID,' =',RES(1),RES(2),RES(3)
4925+C ELSEIF(MLReductionLib(I_LIB).EQ.7) THEN
4926+C WRITE(*,*) 'COLLIER: Loop ID',ID,' =',RES(1),RES(2),RES(3)
4927 C ENDIF
4928 END
4929
4930@@ -322,8 +327,9 @@
4931 C
4932 INCLUDE 'MadLoopParams.inc'
4933 LOGICAL CTINIT, TIRINIT, GOLEMINIT, SAMURAIINIT, NINJAINIT
4934+ $ ,COLLIERINIT
4935 COMMON/REDUCTIONCODEINIT/CTINIT,TIRINIT,GOLEMINIT,SAMURAIINIT
4936- $ ,NINJAINIT
4937+ $ ,NINJAINIT,COLLIERINIT
4938
4939 C ----------
4940 C BEGIN CODE
4941@@ -366,7 +372,7 @@
4942 C CONSTANTS
4943 C
4944 INTEGER NLOOPLIB
4945- PARAMETER (NLOOPLIB=4)
4946+ PARAMETER (NLOOPLIB=7)
4947 INTEGER QP_NLOOPLIB
4948 PARAMETER (QP_NLOOPLIB=2)
4949 INTEGER NLOOPGROUPS
4950
4951=== modified file 'tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_dxu_wp%V0_dxu_wp%check_sa.f'
4952--- tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_dxu_wp%V0_dxu_wp%check_sa.f 2016-03-31 10:53:12 +0000
4953+++ tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_dxu_wp%V0_dxu_wp%check_sa.f 2016-06-24 21:04:21 +0000
4954@@ -294,6 +294,8 @@
4955 $ //' an unknown reason.'
4956 ENDIF
4957 ENDIF
4958+ WRITE (*,'(1x,a23,3x,i3)') 'MadLoop return code ='
4959+ $ ,RETURNCODE
4960 WRITE (*,*) '---------------------------------'
4961 IF (NBORNCHOSEN.EQ.0) THEN
4962 WRITE (*,*) 'No Born contribution satisfied the squared'
4963
4964=== modified file 'tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_dxu_wp%V0_dxu_wp%loop_matrix.f'
4965--- tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_dxu_wp%V0_dxu_wp%loop_matrix.f 2016-05-06 09:08:11 +0000
4966+++ tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_dxu_wp%V0_dxu_wp%loop_matrix.f 2016-06-24 21:04:21 +0000
4967@@ -77,9 +77,9 @@
4968 PARAMETER (NSQUAREDSOP1=NSQUAREDSO+1)
4969 C The total number of loop reduction libraries
4970 C At present, there are only CutTools,PJFry++,IREGI,Golem95,Samurai
4971-C and Ninja
4972+C , Ninja and COLLIER
4973 INTEGER NLOOPLIB
4974- PARAMETER (NLOOPLIB=6)
4975+ PARAMETER (NLOOPLIB=7)
4976 C Only CutTools or possibly Ninja (if installed with qp support)
4977 C provide QP
4978 INTEGER QP_NLOOPLIB
4979@@ -207,6 +207,7 @@
4980 C GLOBAL VARIABLES
4981 C
4982 INCLUDE 'process_info.inc'
4983+ INCLUDE 'unique_id.inc'
4984 INCLUDE 'coupl.inc'
4985 INCLUDE 'mp_coupl.inc'
4986 INCLUDE 'MadLoopParams.inc'
4987@@ -236,23 +237,23 @@
4988 COMMON/MP_DONE/MP_DONE
4989 C A FLAG TO DENOTE WHETHER THE CORRESPONDING LOOPLIBS ARE
4990 C AVAILABLE OR NOT
4991- LOGICAL LOOPLIBS_AVAILABLE(6)
4992+ LOGICAL LOOPLIBS_AVAILABLE(NLOOPLIB)
4993 DATA LOOPLIBS_AVAILABLE/.TRUE.,.TRUE.,.TRUE.,.TRUE.,.FALSE.
4994- $ ,.TRUE./
4995+ $ ,.TRUE.,.TRUE./
4996 COMMON/LOOPLIBS_AV/ LOOPLIBS_AVAILABLE
4997 C A FLAG TO DENOTE WHETHER THE CORRESPONDING DIRECTION TESTS
4998 C AVAILABLE OR NOT IN THE LOOPLIBS
4999- LOGICAL LOOPLIBS_DIRECTEST(6)
5000+ LOGICAL LOOPLIBS_DIRECTEST(NLOOPLIB)
The diff has been truncated for viewing.

Subscribers

People subscribed via source and target branches

to all changes: