MadGraph freezes when creating matching plots

Asked by Jean-Loup Tastet

When using MadGraph 3.5.x on macOS Sonoma (14.3.1) with parton shower performed by Pythia8 using the built-in interface, MadGraph always freezes (with no significant CPU usage) and never terminates while creating the matching plots:

...
Pythia8 shower jobs: 0 Idle, 0 Running, 10 Done [24 seconds]
Merging results from the split PY8 runs...
INFO: Create matching plots for Pythia8
^Crm jobs on queue
INFO: Stop by the user

This happens for a variety of processes, models and parameters. A minimal example that produces the issue on my machine is:

>generate p p > j j
>add process p p > j j j
>launch
>shower=Pythia8
>done
>done

Looking at the output, the .lhe and .hepmc event files are successfully generated, as well as the .gnuplot files, the .HwU files, and a single .ps file (that contains a correct-looking plot after I manually convert it to PDF using ps2pdf).

> > ls -1 PROC_sm_0/HTML/run_01/tag_1_PY8_plots/
central_qCut_djr_plots.HwU
central_qCut_djr_plots.gnuplot
central_qCut_pt_plots.HwU
central_qCut_pt_plots.gnuplot
min_max_qCut_djr_comparison.HwU
min_max_qCut_djr_comparison.gnuplot
min_max_qCut_pt_comparison.HwU
min_max_qCut_pt_comparison.gnuplot
qCut_67.5_djr_plots.HwU
qCut_67.5_djr_plots.gnuplot
qCut_67.5_djr_plots.ps
qCut_67.5_pt_plots.HwU
qCut_67.5_pt_plots.gnuplot
qCut_90_djr_plots.HwU
qCut_90_djr_plots.gnuplot
qCut_90_pt_plots.HwU
qCut_90_pt_plots.gnuplot

I remember this same install working about a year ago, but both MadGraph and the OS have been updated in the meantime. I tried again with a clean install of MadGraph 3.5.3, with the exact same result.

Looking at how a single .ps file is present, and considering the removal of PostScript in macOS Sonoma, makes me suspect that this could be related to the issue.

I am running MadGraph within a virtual environment with Python 3.10.9 and the following packages installed:

> pip freeze
attrs==22.2.0
click==8.1.3
cycler==0.11.0
jsonpatch==1.32
jsonpointer==2.3
jsonschema==4.17.3
kiwisolver==1.4.4
lxml==4.9.2
matplotlib==3.2.2
numpy==1.24.2
pyhf==0.6.3
pyparsing==3.0.9
pyrsistent==0.19.3
python-dateutil==2.8.2
PyYAML==6.0
scipy==1.10.1
six==1.16.0
tqdm==4.64.1

gnuplot, ps and ps2pdf are all in the PATH.

Do you know how to fix or work around this issue? Feel free to request any additional information or tests.

Thanks!

Question information

Language:
English Edit question
Status:
Solved
For:
MadGraph5_aMC@NLO Edit question
Assignee:
No assignee Edit question
Solved by:
Olivier Mattelaer
Solved:
Last query:
Last reply:
Revision history for this message
Olivier Mattelaer (olivier-mattelaer) said :
#1

My guess is that gnuplot is responsible for this?
Could you remove it from the path to see if this fix your issue?

Cheers,

Olivier

Revision history for this message
Jean-Loup Tastet (jltastet) said :
#2

Thanks for the incredibly fast answer!

I uninstalled gnuplot, and it indeed allowed MadGraph to finish. However, I now only have the matching plots in .HwU and .gnuplot formats (they are also missing from the MadAnalysis output, but this might be user error; I’ll double-check my cards).

Cheers,
Jean-Loup

Revision history for this message
Best Olivier Mattelaer (olivier-mattelaer) said :
#3

Then maybe you can run gnuplot by hand on one of those files to see if gnuplot provides information on the why he is freezing...

Cheers,

Olivier

Revision history for this message
Jean-Loup Tastet (jltastet) said (last edit ):
#4

Running gnuplot manually (as `gnuplot qCut_67.5_djr_plots.gnuplot`) successfully generates the plot, but with a number of warnings:

-p destination: Broken pipe # Repeated a dozen times or so

plot2d.c:702 caught a complex value # Repeated hundreds of times

"qCut_67.5_djr_plots.gnuplot" line 149: warning: Did you try to plot a complex-valued function?
"qCut_67.5_djr_plots.gnuplot" line 153: warning: could not confirm linked axis inverse mapping function
             y axis min/max 0.00010778 0.50554 data_min/max 0.00015141 0.0437186
                set_min/max -2.8242 11.603 link: primary y
    primary y axis min/max -3.96746 -0.296244 data_min/max 0.00015141 0.0437186
                set_min/max nan 1.06457 link: none

Line 149 is: unset label
Line 153 is: set size 1.0000e+00, 1.5000e-01

Reinstalling/upgrading gnuplot also didn’t solve the freezing problem when running MadGraph.

> gnuplot --version
gnuplot 6.0 patchlevel 0

> which gnuplot
/opt/homebrew/bin/gnuplot

If you want, I can send you the .gnuplot file and the full output by email. And as a temporary workaround, I can try to install it out-of-path (EDIT: since I only use gnuplot for MadGraph, the easiest fix was just to rename the gnuplot executable).

Cheers,
Jean-Loup

Revision history for this message
Jean-Loup Tastet (jltastet) said :
#5

Thanks Olivier Mattelaer, that solved my question.