Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the MadGraph5 LO multithread utility #34437

Merged
merged 2 commits into from Jul 16, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -131,6 +131,27 @@ EOF
def launch(self, nb_event, seed):
EOF
fi

# fix another "readonly" mode issue related to proper handle of the integration grid,
# as identified in: https://answers.launchpad.net/mg5amcnlo/+question/696856
# this is fixed since 2.9.4 and 3.1.1, so we add a patch if MG is lower then these versions
if [[ ( ${MGVersion[0]} -eq 2 ) && ( ${MGVersion[1]} -lt 9 || ( ${MGVersion[1]} -eq 9 && ${MGVersion[2]} -le 3 ) ) ]] || \
[[ ( ${MGVersion[0]} -eq 3 ) && ( ${MGVersion[1]} -lt 1 || ( ${MGVersion[1]} -eq 1 && ${MGVersion[2]} -le 0 ) ) ]]; then
patch process/madevent/bin/internal/gen_ximprove.py << EOF
=== modified file 'madgraph/interface/gen_ximprove.py'
--- madgraph/interface/gen_ximprove.py
+++ madgraph/interface/gen_ximprove.py
@@ -1903,5 +1903,8 @@ class gen_ximprove_gridpack(gen_ximprove_v4):
'packet': None,
}
+ if self.readonly:
+ basedir = pjoin(os.path.dirname(__file__), '..','..','SubProcesses', info['P_dir'], info['directory'])
+ info['base_directory'] = basedir


jobs.append(info)
EOF
fi

# fix another multi-thread related bug for MG 2.6.1 only
if [[ ${MGVersion[1]} -eq 6 && ${MGVersion[2]} -eq 1 ]]; then
Expand Down
Expand Up @@ -45,7 +45,7 @@
@@ -98,1 +134,1 @@
- ./run.sh $submitting_event $run_random_seed
+ ../process/run.sh $submitting_event $run_random_seed
@@ -124,3 +160,53 @@
@@ -124,3 +160,58 @@
+cd $LHEWORKDIR
+
+} ### end of function
Expand All @@ -68,6 +68,11 @@
+
+ cd $LHEWORKDIR
+
+ # first do restore_data from the gridpack (necessary for the readonly mode)
+ cd process/madevent
+ ./bin/internal/restore_data default
+ cd ../..
+
+ # make the gridpack directory read-only to enable the multi-threading feature
+ if fs listacl &>/dev/null; then
+ fs sa -dir process/madevent -acl ${USER} read
Expand All @@ -90,7 +95,7 @@
+ cd process
+
+ # merge files produced in different threads
+ cp /cvmfs/cms.cern.ch/phys_generator/gridpacks/lhe_merger/merge.pl ./
+ curl -s -L -o merge.pl https://raw.githubusercontent.com/cms-sw/genproductions/master/bin/MadGraph5_aMCatNLO/Utilities/merge.pl
+ chmod 755 merge.pl
+ ./merge.pl ../thread*/events.lhe.gz events.lhe.gz banner.txt
+ rm -r ../thread* banner.txt;
Expand Down