"cluster.get_job_identifier runs unexpectedly" and "UnboundLocalError : local variable 'error' referenced before assignment" when running systematics on SLURM cluster

Asked by matteo maltoni

Dear MG5 experts,

I tried to run different processes (Zjj, W+photon, ...) on the Lemaitre3 cluster at LO in the SM, but when I ask for the systematics (use_syst=True in run_card), the computation stops with this message:

INFO: Running Systematics computation
ESC[1;34mWARNING: cluster.get_job_identifier runs unexpectedly. This should be fine but report this message if you have problem. ESC[0m
Start waiting for update. (more info in debug mode)
ESC[1;34mWARNING: cluster.get_job_identifier runs unexpectedly. This should be fine but report this message if you have problem. ESC[0m
ESC[1;34mWARNING: cluster.get_job_identifier runs unexpectedly. This should be fine but report this message if you have problem. ESC[0m
ESC[1;34mWARNING: cluster.get_job_identifier runs unexpectedly. This should be fine but report this message if you have problem. ESC[0m
ESC[1;34mWARNING: cluster.get_job_identifier runs unexpectedly. This should be fine but report this message if you have problem. ESC[0m
ESC[1;31mCommand "generate_events run_01" interrupted with error:
UnboundLocalError : local variable 'error' referenced before assignment
Please report this bug on https://bugs.launchpad.net/mg5amcnlo
More information is found in '/home/users/m/m/mmaltoni/MG5_aMC_v3_4_2/bin/pp_lva/sm_lo/run_01_tag_1_debug.log'.
Please attach this file to your report.ESC[0m
INFO: storing files of previous run
INFO: Done
INFO:
INFO:
quit
INFO:
quit

I'm not sure if this is a problem of modules I didn't load (only one I asked for is Python3), or else: can you please give me your opinion?
You can find the log file below.

Cheers,

Matteo

generate_events run_01
Traceback (most recent call last):
  File "/home/users/m/m/mmaltoni/MG5_aMC_v3_4_2/madgraph/interface/extended_cmd.py", line 1544, in onecmd
    return self.onecmd_orig(line, **opt)
  File "/home/users/m/m/mmaltoni/MG5_aMC_v3_4_2/madgraph/interface/extended_cmd.py", line 1493, in onecmd_orig
    return func(arg, **opt)
  File "/home/users/m/m/mmaltoni/MG5_aMC_v3_4_2/madgraph/interface/madevent_interface.py", line 2404, in do_generate_events
    self.run_generate_events(switch_mode, args)
  File "/home/users/m/m/mmaltoni/MG5_aMC_v3_4_2/madgraph/interface/common_run_interface.py", line 7634, in new_fct
    original_fct(obj, *args, **opts)
  File "/home/users/m/m/mmaltoni/MG5_aMC_v3_4_2/madgraph/interface/madevent_interface.py", line 2641, in run_generate_events
    self.exec_cmd('systematics %s %s ' % (self.run_name,
  File "/home/users/m/m/mmaltoni/MG5_aMC_v3_4_2/madgraph/interface/extended_cmd.py", line 1573, in exec_cmd
    stop = Cmd.onecmd_orig(current_interface, line, **opt)
  File "/home/users/m/m/mmaltoni/MG5_aMC_v3_4_2/madgraph/interface/extended_cmd.py", line 1493, in onecmd_orig
    return func(arg, **opt)
  File "/home/users/m/m/mmaltoni/MG5_aMC_v3_4_2/madgraph/interface/common_run_interface.py", line 1919, in do_systematics
    self.cluster.cluster_submit(prog, argument,
  File "/home/users/m/m/mmaltoni/MG5_aMC_v3_4_2/madgraph/various/cluster.py", line 211, in cluster_submit
    id = self.submit2(prog, argument, cwd, stdout, stderr, log, input_files,
  File "/home/users/m/m/mmaltoni/MG5_aMC_v3_4_2/madgraph/various/cluster.py", line 75, in deco_f_store
    id = f(self, **args)
  File "/home/users/m/m/mmaltoni/MG5_aMC_v3_4_2/madgraph/various/cluster.py", line 149, in submit2
    return self.submit(prog, argument, cwd, stdout, stderr, log,
  File "/home/users/m/m/mmaltoni/MG5_aMC_v3_4_2/madgraph/various/misc.py", line 439, in deco_f_retry
    raise my_error.__class__('[Fail %i times] \n %s ' % (i+1, error))
UnboundLocalError: local variable 'error' referenced before assignment
                              Run Options
                              -----------
               stdout_level : 20 (user set)

                         MadEvent Options
                         ----------------
     automatic_html_opening : False (user set)
        notification_center : True
                   run_mode : 1 (user set)
              cluster_queue : None (user set)
               cluster_time : None (user set)
               cluster_size : 150 (user set)
             cluster_memory : 150 (user set)
                    nb_core : 5 (user set)
          cluster_temp_path : None

                      Configuration Options
                      ---------------------
               pythia8_path : /home/users/m/m/mmaltoni/MG5_aMC_v3_4_2/HEPTools/pythia8 (user set)
                  hwpp_path : /home/users/m/m/mmaltoni/Herwig7 (user set)
                thepeg_path : /home/users/m/m/mmaltoni/Herwig7 (user set)
                 hepmc_path : /home/users/m/m/mmaltoni/Herwig7 (user set)
           madanalysis_path : None (user set)
          madanalysis5_path : None (user set)
            pythia-pgs_path : None (user set)
                    td_path : None (user set)
               delphes_path : None (user set)
        exrootanalysis_path : None (user set)
               syscalc_path : None (user set)
                 rivet_path : None
                  yoda_path : None
                     lhapdf : /home/users/m/m/mmaltoni/MG5_aMC_v3_4_2/HEPTools/lhapdf6_py3/bin/lhapdf-config (user set)
                 lhapdf_py2 : None
                 lhapdf_py3 : /home/users/m/m/mmaltoni/MG5_aMC_v3_4_2/HEPTools/lhapdf6_py3/bin/lhapdf-config (user set)
                    timeout : 60
              f2py_compiler : None
          f2py_compiler_py2 : None
          f2py_compiler_py3 : None
                web_browser : None
                 eps_viewer : None
                text_editor : None
           fortran_compiler : None
               cpp_compiler : None
                auto_update : 7 (user set)
               cluster_type : slurm (user set)
      cluster_status_update : (900, 60) (user set)
           cluster_nb_retry : 1
         cluster_local_path : None
         cluster_retry_wait : 1500 (user set)
#************************************************************
#* MadGraph5_aMC@NLO *
#* *
#* * * *
#* * * * * *
#* * * * * 5 * * * * *
#* * * * * *
#* * * *
#* *
#* *
#* VERSION 3.4.2 2023-01-20 *
#* *
#* 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 *
#* *
#************************************************************
set group_subprocesses Auto
set ignore_six_quark_processes False
set low_mem_multicore_nlo_generation False
set complex_mass_scheme False
set include_lepton_initiated_processes False
set gauge unitary
set loop_optimized_output True
set loop_color_flows False
set max_npoint_for_channel 0
set default_unset_couplings 99
set max_t_for_channel 99
set zerowidth_tchannel True
set nlo_mixed_expansion True
import model sm
define p = g u c d s u~ c~ d~ s~
define j = g u c d s u~ c~ d~ s~
define l+ = e+ mu+
define l- = e- mu-
define vl = ve vm vt
define vl~ = ve~ vm~ vt~
import model SMEFTatNLO-loopWWW
define p = 21 2 4 1 3 -2 -4 -1 -3 5 -5 # pass to 5 flavors
define j = p
generate p p > l+ vl a QCD=0 QED=3 NP=0 @0
add process p p > l- vl~ a QCD=0 QED=3 NP=0 @1
output pp_lva/sm_lo
######################################################################
## PARAM_CARD AUTOMATICALY GENERATED BY MG5 ####
######################################################################
###################################
## INFORMATION FOR DIM6
###################################
BLOCK DIM6 #
      1 1.100000e+03 # lambda
      6 1.100000e+00 # cwww
###################################
## INFORMATION FOR MASS
###################################
BLOCK MASS #
      6 1.720000e+02 # mt
      23 9.118760e+01 # mz
      24 7.982440e+01 # mw
      25 1.250000e+02 # mh
      1 0.000000e+00 # d : 0.0
      2 0.000000e+00 # u : 0.0
      3 0.000000e+00 # s : 0.0
      4 0.000000e+00 # c : 0.0
      5 0.000000e+00 # b : 0.0
      11 0.000000e+00 # e- : 0.0
      12 0.000000e+00 # ve : 0.0
      13 0.000000e+00 # mu- : 0.0
      14 0.000000e+00 # vm : 0.0
      15 0.000000e+00 # ta- : 0.0
      16 0.000000e+00 # vt : 0.0
      21 0.000000e+00 # g : 0.0
      22 0.000000e+00 # a : 0.0
      9000002 9.118760e+01 # ghz : mz
      9000003 7.982440e+01 # ghwp : mw
      9000004 7.982440e+01 # ghwm : mw
###################################
## INFORMATION FOR RENOR
###################################
BLOCK RENOR #
      1 9.118800e+01 # mueft
###################################
## INFORMATION FOR SMINPUTS
###################################
BLOCK SMINPUTS #
      2 1.166370e-05 # gf
      3 1.180023e-01 # as (note that parameter not used if you use a pdf set)
###################################
## INFORMATION FOR YUKAWA
###################################
BLOCK YUKAWA #
      6 1.720000e+02 # ymt
###################################
## INFORMATION FOR DECAY
###################################
DECAY 6 1.470800e+00 # wt
DECAY 23 2.416023e+00 # wz
DECAY 24 2.002950e+00 # ww
DECAY 25 4.088000e-03 # wh
DECAY 1 0.000000e+00 # d : 0.0
DECAY 2 0.000000e+00 # u : 0.0
DECAY 3 0.000000e+00 # s : 0.0
DECAY 4 0.000000e+00 # c : 0.0
DECAY 5 0.000000e+00 # b : 0.0
DECAY 11 0.000000e+00 # e- : 0.0
DECAY 12 0.000000e+00 # ve : 0.0
DECAY 13 0.000000e+00 # mu- : 0.0
DECAY 14 0.000000e+00 # vm : 0.0
DECAY 15 0.000000e+00 # ta- : 0.0
DECAY 16 0.000000e+00 # vt : 0.0
DECAY 21 0.000000e+00 # g : 0.0
DECAY 22 0.000000e+00 # a : 0.0
DECAY 9000002 2.416023e+00 # ghz : wz
DECAY 9000003 2.002950e+00 # ghwp : ww
DECAY 9000004 2.002950e+00 # ghwm : ww
###################################
## INFORMATION FOR QNUMBERS 9000001
###################################
BLOCK QNUMBERS 9000001 # gha
      1 0 # 3 times electric charge
      2 1 # number of spin states (2s+1)
      3 1 # colour rep (1: singlet, 3: triplet, 8: octet)
      4 1 # particle/antiparticle distinction (0=own anti)
###################################
## INFORMATION FOR QNUMBERS 9000002
###################################
BLOCK QNUMBERS 9000002 # ghz
      1 0 # 3 times electric charge
      2 1 # number of spin states (2s+1)
      3 1 # colour rep (1: singlet, 3: triplet, 8: octet)
      4 1 # particle/antiparticle distinction (0=own anti)
###################################
## INFORMATION FOR QNUMBERS 9000003
###################################
BLOCK QNUMBERS 9000003 # ghwp
      1 3 # 3 times electric charge
      2 1 # number of spin states (2s+1)
      3 1 # colour rep (1: singlet, 3: triplet, 8: octet)
      4 1 # particle/antiparticle distinction (0=own anti)
###################################
## INFORMATION FOR QNUMBERS 9000004
###################################
BLOCK QNUMBERS 9000004 # ghwm
      1 -3 # 3 times electric charge
      2 1 # number of spin states (2s+1)
      3 1 # colour rep (1: singlet, 3: triplet, 8: octet)
      4 1 # particle/antiparticle distinction (0=own anti)
###################################
## INFORMATION FOR QNUMBERS 9000005
###################################
BLOCK QNUMBERS 9000005 # ghg
      1 0 # 3 times electric charge
      2 1 # number of spin states (2s+1)
      3 8 # colour rep (1: singlet, 3: triplet, 8: octet)
      4 1 # particle/antiparticle distinction (0=own anti)

#*********************************************************************
# MadGraph5_aMC@NLO *
# *
# run_card.dat MadEvent *
# *
# This file is used to set the parameters of the run. *
# *
# Some notation/conventions: *
# *
# Lines starting with a '# ' are info or comments *
# *
# mind the format: value = variable ! comment *
# *
# To display more options, you can type the command: *
# update to_full *
#*********************************************************************
#
#*********************************************************************
# Tag name for the run (one word) *
#*********************************************************************
  tag_1 = run_tag ! name of the run
#*********************************************************************
# Number of events and rnd seed *
# Warning: Do not generate more than 1M events in a single run *
#*********************************************************************
  100000 = nevents ! Number of unweighted events requested
  0 = iseed ! rnd seed (0=assigned automatically=default))
#*********************************************************************
# Collider type and energy *
# lpp: 0=No PDF, 1=proton, -1=antiproton, 2=elastic photon of proton,*
# +/-3=PDF of electron/positron beam *
# +/-4=PDF of muon/antimuon beam *
#*********************************************************************
  1 = lpp1 ! beam 1 type
  1 = lpp2 ! beam 2 type
  6500.0 = ebeam1 ! beam 1 total energy in GeV
  6500.0 = ebeam2 ! beam 2 total energy in GeV
# To see polarised beam options: type "update beam_pol"

#*********************************************************************
# PDF CHOICE: this automatically fixes alpha_s and its evol. *
# pdlabel: lhapdf=LHAPDF (installation needed) [1412.7420] *
# iww=Improved Weizsaecker-Williams Approx.[hep-ph/9310350] *
# eva=Effective W/Z/A Approx. [21yy.zzzzz] *
# none=No PDF, same as lhapdf with lppx=0 *
#*********************************************************************
  lhapdf = pdlabel ! PDF set
  260000 = lhaid ! if pdlabel=lhapdf, this is the lhapdf number
# To see heavy ion options: type "update ion_pdf"
#*********************************************************************
# Renormalization and factorization scales *
#*********************************************************************
  False = fixed_ren_scale ! if .true. use fixed ren scale
  False = fixed_fac_scale ! if .true. use fixed fac scale
  91.188 = scale ! fixed ren scale
  91.188 = dsqrt_q2fact1 ! fixed fact scale for pdf1
  91.188 = dsqrt_q2fact2 ! fixed fact scale for pdf2
  3 = dynamical_scale_choice ! Choose one of the preselected dynamical choices
  1.0 = scalefact ! scale factor for event-by-event scales

#*********************************************************************
# Type and output format
#*********************************************************************
  False = gridpack !True = setting up the grid pack
  -1.0 = time_of_flight ! threshold (in mm) below which the invariant livetime is not written (-1 means not written)
  average = event_norm ! average/sum. Normalization of the weight in the LHEF
#*********************************************************************
# Matching parameter (MLM only)
#*********************************************************************
 1 = ickkw ! 0 no matching, 1 MLM
 1.0 = alpsfact ! scale factor for QCD emission vx
 False = chcluster ! cluster only according to channel diag
 5 = asrwgtflavor ! highest quark flavor for a_s reweight
 True = auto_ptj_mjj ! Automatic setting of ptj and mjj if xqcut >0
                                   ! (turn off for VBF and single top processes)
 1.0 = xqcut ! minimum kt jet measure between partons

#*********************************************************************
#
#*********************************************************************
# Phase-Space Optimization strategy (basic options)
#*********************************************************************
  0 = nhel ! using helicities importance sampling or not.
                             ! 0: sum over helicity, 1: importance sampling
  2 = sde_strategy ! default integration strategy (hep-ph/2021.00773)
                             ! 1 is old strategy (using amp square)
        ! 2 is new strategy (using only the denominator)
# To see advanced option for Phase-Space optimization: type "update psoptim"
#*********************************************************************
# Generation bias, check the wiki page below for more information: *
# 'cp3.irmp.ucl.ac.be/projects/madgraph/wiki/LOEventGenerationBias' *
#*********************************************************************
  None = bias_module ! Bias type of bias, [None, ptj_bias, -custom_folder-]
  {} = bias_parameters ! Specifies the parameters of the module.
#
#*******************************
# Parton level cuts definition *
#*******************************
  0.0 = dsqrt_shat ! minimal shat for full process
#
#
#*********************************************************************
# BW cutoff (M+/-bwcutoff*Gamma) ! Define on/off-shell for "$" and decay
#*********************************************************************
  15.0 = bwcutoff ! (M+/-bwcutoff*Gamma)
#*********************************************************************
# Standard Cuts *
#*********************************************************************
# Minimum and maximum pt's (for max, -1 means no cut) *
#*********************************************************************
  150.0 = pta ! minimum pt for the photons
  80.0 = ptl ! minimum pt for the charged leptons
  40.0 = misset ! minimum missing Et (sum of neutrino's momenta)
  -1.0 = ptamax ! maximum pt for the photons
  -1.0 = ptlmax ! maximum pt for the charged leptons
  -1.0 = missetmax ! maximum missing Et (sum of neutrino's momenta)
  {} = pt_min_pdg ! pt cut for other particles (use pdg code). Applied on particle and anti-particle
  {} = pt_max_pdg ! pt cut for other particles (syntax e.g. {6: 100, 25: 50})
#
# For display option for energy cut in the partonic center of mass frame type 'update ecut'
#
#*********************************************************************
# Maximum and minimum absolute rapidity (for max, -1 means no cut) *
#*********************************************************************
  2.5 = etaa ! max rap for the photons
  2.5 = etal ! max rap for the charged leptons
  0.0 = etajmin ! min rap for the jets
  0.0 = etaamin ! min rap for the photons
  0.0 = etalmin ! main rap for the charged leptons
  {} = eta_min_pdg ! rap cut for other particles (use pdg code). Applied on particle and anti-particle
  {} = eta_max_pdg ! rap cut for other particles (syntax e.g. {6: 2.5, 23: 5})
#*********************************************************************
# Minimum and maximum DeltaR distance *
#*********************************************************************
  0.7 = dral ! min distance between gamma and lepton
  -1.0 = dralmax ! maxdistance between gamma and lepton
#*********************************************************************
# Minimum and maximum invariant mass for pairs *
#*********************************************************************
  {} = mxx_min_pdg ! min invariant mass of a pair of particles X/X~ (e.g. {6:250})
  {'default': False} = mxx_only_part_antipart ! if True the invariant mass is applied only
                       ! to pairs of particle/antiparticle and not to pairs of the same pdg codes.
 #*********************************************************************
 # Minimum and maximum invariant mass for all letpons *
 #*********************************************************************
  0.0 = mmnl ! min invariant mass for all letpons (l+- and vl)
  -1.0 = mmnlmax ! max invariant mass for all letpons (l+- and vl)
 #*********************************************************************
 # Minimum and maximum pt for 4-momenta sum of leptons / neutrino *
 # for pair of lepton includes only same flavor, opposite charge
 #*********************************************************************
#*********************************************************************
# Inclusive cuts *
#*********************************************************************
#*********************************************************************
# maximal pdg code for quark to be considered as a light jet *
# (otherwise b cuts are applied) *
#*********************************************************************
  4 = maxjetflavor ! Maximum jet pdg code
#*********************************************************************
#
#*********************************************************************
# Store info for systematics studies *
# WARNING: Do not use for interference type of computation *
#*********************************************************************
  True = use_syst ! Enable systematics studies
#
  systematics = systematics_program ! none, systematics [python], SysCalc [depreceted, C++]
  ['--mur=0.5,1,2', '--muf=0.5,1,2', '--pdf=errorset'] = systematics_arguments ! see: https://cp3.irmp.ucl.ac.be/projects/madgraph/wiki/Systematics#Systematicspythonmodule

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,

On the same cluster, with the following module:
Currently Loaded Modules:
  1) tis/2018.01 (S) 4) GCCcore/11.2.0 7) bzip2/1.0.8-GCCcore-11.2.0 10) Tcl/8.6.11-GCCcore-11.2.0 13) GMP/6.2.1-GCCcore-11.2.0 16) Python/3.9.6-GCCcore-11.2.0
  2) releases/2021b (S) 5) zlib/1.2.11-GCCcore-11.2.0 8) ncurses/6.2-GCCcore-11.2.0 11) SQLite/3.36-GCCcore-11.2.0 14) libffi/3.4.2-GCCcore-11.2.0
  3) StdEnv (H) 6) binutils/2.37-GCCcore-11.2.0 9) libreadline/8.1-GCCcore-11.2.0 12) XZ/5.2.5-GCCcore-11.2.0 15) OpenSSL/1.1

and updating the following two environment variable:
export PYTHONPATH=$PYTHONPATH:/home/users/o/m/omatt/mg5amcnlo/HEPTools/lhapdf6_py3//lib/python3.9/site-packages/
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/users/o/m/omatt/mg5amcnlo/HEPTools/lhapdf6_py3//lib

to use the version of lhapdf installed via "install lhapdf6".

It works without any problem (with the latest git release (so 3.5.2))
So maybe can you try 3.5.2, likely this will solve your problem.

Cheers,

Olivier

Revision history for this message
matteo maltoni (matteo-maltoni) said :
#2

Thanks Olivier Mattelaer, that solved my question.