Skip to content

Commit

Permalink
Merge pull request #30445 from colizz/dev-mt-106X
Browse files Browse the repository at this point in the history
Fix the MadGraph bug for multithreading (backport #30444)
  • Loading branch information
cmsbuild committed Jun 30, 2020
2 parents e91615a + 8786954 commit 32c3438
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 23 deletions.
Expand Up @@ -111,6 +111,25 @@ else
math.sqrt(sum(x**2 for x in sum_xerru)),
sum_axsec)
EOF

# fix another bug related to cross-section computing in multiththread mode, as identified in: https://bugs.launchpad.net/mg5amcnlo/+bug/1884085
patch process/madevent/bin/internal/madevent_interface.py << EOF
=== modified file 'madgraph/interface/madevent_interface.py'
--- madgraph/interface/madevent_interface.py 2020-06-08 15:08:17 +0000
+++ madgraph/interface/madevent_interface.py 2020-06-18 20:18:17 +0000
@@ -6490,9 +6490,12 @@
os.chdir(self.me_dir)
else:
for line in open(pjoin(self.me_dir,'SubProcesses','subproc.mg')):
- os.mkdir(line.strip())
+ p = line.strip()
+ os.mkdir(p)
+ files.cp(pjoin(self.me_dir,'SubProcesses',p,'symfact.dat'),
+ pjoin(p, 'symfact.dat'))
def launch(self, nb_event, seed):
EOF
fi

# fix another multi-thread related bug for MG 2.6.1 only
Expand Down
@@ -1,9 +1,6 @@
--- runcmsgrid.sh 2020-05-01 03:27:51.000000001 +0200
+++ runcmsgrid.sh 2020-05-02 10:46:24.000000001 +0200
@@ -43,6 +43,30 @@
fi
cd $LHEWORKDIR

@@ -48,1 +48,25 @@
+# test if the current file system allow setting folder permission to read-only.
+succ_setreadonly=true
+mkdir testpermit
Expand All @@ -24,17 +21,12 @@
+fi
+
+if fs listacl &>/dev/null; then
+ fs sa -dir process/madevent -acl ${USER} all
+ fs sa -dir madevent -acl ${USER} all
+else
+ chmod +w process/madevent
+ chmod +w madevent
+fi
cd process

#make sure lhapdf points to local cmssw installation area
@@ -56,6 +80,18 @@
echo "nb_core = $ncpu" >> ./madevent/Cards/me5_configuration.txt
#fi

@@ -59,3 +83,15 @@
+function event_generate_per_thread () {
+
+# number of event to generate and seed in this thread
Expand All @@ -50,19 +42,10 @@
#########################################
# FORCE IT TO PRODUCE EXACTLY THE REQUIRED NUMBER OF EVENTS
#########################################
@@ -95,7 +131,7 @@
# run mg5_amc
echo "produced_lhe " $produced_lhe "nevt " $nevt "submitting_event " $submitting_event " remaining_event " $remaining_event
echo run.sh $submitting_event $run_random_seed
@@ -98,1 +134,1 @@
- ./run.sh $submitting_event $run_random_seed
+ ../process/run.sh $submitting_event $run_random_seed

# compute number of events produced in the iteration
produced_lhe=$(($produced_lhe+`zgrep \<event events.lhe.gz | wc -l`))
@@ -121,6 +157,56 @@
mv events_${run_counter}.lhe.gz events.lhe.gz
fi

@@ -124,3 +160,53 @@
+cd $LHEWORKDIR
+
+} ### end of function
Expand Down

0 comments on commit 32c3438

Please sign in to comment.