madgraph crashes without an error code

Asked by Jona Ackerschott

I am generating tth events in madgraph with a slightly modified version of the higgs characterisation UFO model. Specifically I need to generate a large number (~1000) of small batches with different model parameters, which I do by generating a madgraph proc card that continously updates two model parameters and re-launches the generation (I can't use scan, since I need to update two parameters together and don't want to do a grid search over these). When I run madgraph however, it crashes at exactly run 811 (this seems to consistent over order 100 identical runs launched at the same time), partially with a proper return code, such that my configured pipeline stops here and partially without a proper return code, leaving the pipeline unable to detect a failure. The one without a proper return code has the following error:

```
"launch" with error:
RuntimeError : can't start new thread
```

and with a proper return code I get

```
Command "generate_events run_811" interrupted with error:
RuntimeError : can't start new thread
```

Could this be an "out of resource" error and how can I circumvent that? How can I force madgraph to always return a non-zero return code if it fails?

Note: This is the template for my proc card:

```
#************************************************************
#* MadGraph5_aMC@NLO *
#* *
#* * * *
#* * * * * *
#* * * * * 5 * * * * *
#* * * * * *
#* * * *
#* *
#* *
#* VERSION 3.2.0 2021-08-22 *
#* *
#* The MadGraph5_aMC@NLO Development Team - Find us at *
#* https://server06.fynu.ucl.ac.be/projects/madgraph *
#* *
#************************************************************
#* *
#* Command File for MadGraph5_aMC@NLO *
#* *
#* run as ./bin/mg5_aMC filename *
#* *
#************************************************************

# define model
import model {{ model_path }}

# define process
define l+ = e+ mu+
define nu = vl vl~
# ensure that the tops, ws and the higgs are on-shell as defined by bwcutoff;
# QNP=0 removes new physics couplings from the corresponding decays
generate p p > t t~ x0, x0 > a a, (t > w+ b QNP=0, w+ > l+ nu QNP=0), (t~ > w- b~ QNP=0, w- > j j QNP=0)
output {{ output_dir }}
launch

# simulation after hard process
shower=Pythia8
detector=off
done

# set run parameters
set run_card run_tag main
set run_card nevents {{ event_count }}
set run_card iseed {{ seed }}
set run_card lpp1 1 # proton beam
set run_card lpp2 1 # proton beam
set run_card ebeam1 6500
set run_card ebeam2 6500

# set pythia parameters
set pythia8_card PartonLevel:MPI off
set pythia8_card PartonLevel:ISR on
set pythia8_card PartonLevel:FSR off
set pythia8_card HadronLevel:all on

# set model parameters
#set param_card cosa scan: [{{ ",".join(cos_alpha_prior) }}]
#set param_card kHtt scan: [{{ ",".join(kappa_higgs_top_prior) }}]
#set param_card kAtt scan: [{{ ",".join(kappa_pseudo_higgs_top_prior) }}]

set param_card cosa {{ cosa_prior[0] }}
set param_card kHtt {{ kappa_higgs_top_prior[0] }}
set param_card kAtt {{ kappa_pseudo_higgs_top_prior[0] }}
done

{% for i in range(kappa_higgs_top_prior[1:]|length) %}
launch
done

set param_card cosa {{ cosa_prior[1:][i] }}
set param_card kHtt {{ kappa_higgs_top_prior[1:][i] }}
set param_card kAtt {{ kappa_pseudo_higgs_top_prior[1:][i] }}
done
{% endfor %}
```
I would also post the full log files, however I'm not sure how to attach files here and they are pretty long. I am using madgraph version 3.1.0.

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
Best Olivier Mattelaer (olivier-mattelaer) said :
#1

Hi,

So in principle the issue that madgraph is "leaking" thread is solved/improved with more recent version of the code.
(fix implemented in 2.9.13 for the LTS and in 3.4.2 for the feature oriented version)

Now, independently, it is possible to use the scan command for the setup that you use (but you are obviously not force to do it):

you can do
set param_card cosa scan1: [{{ ",".join(cos_alpha_prior) }}]
set param_card kHtt scan1: [{{ ",".join(kappa_higgs_top_prior) }}]
set param_card kAtt scan1: [{{ ",".join(kappa_pseudo_higgs_top_prior) }}]

the "scan:" can be replaced by "scanX:" where X can be any number.
All the list for a given value of X should have the same size and are scan toghether.
So the above line provides you a 1D scan.

How can I force madgraph to always return a non-zero return code if it fails?

You can use the command
set crash_on_error True
which should fix that issue.

Cheers,

Olivier

Revision history for this message
Jona Ackerschott (jackerschott) said :
#2

Thanks Olivier Mattelaer, that solved my question.