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

[MadGraph] Issues with gridpack_generation.sh in MG_265 (extramodels section) #2264

Open
covarell opened this issue Jun 13, 2019 · 4 comments

Comments

@covarell
Copy link
Contributor

covarell commented Jun 13, 2019

Apparently the gridpack_generation.sh script in the mg265 branch does not work properly for the "extramodels" section, probably because of unrecognized or not properly parsed bash syntax.

A simple description of the problem follows (observed at cmsconnect, but also verified by @lviliani at lxplus):

The command:
./submit_cmsconnect_gridpack_generation.sh llll_qcd_cHWB_13TeV cards/llll_qcd_cHWB_13TeV 1 "2 Gb"

fails with an extramodel card which anyway follows the suggested syntax:
$ more cards/llll_qcd_cHWB_13TeV/llll_qcd_cHWB_13TeV_extramodels.dat
smeft4vbs.tgz

I checked that the model is not downloaded from the web server to the models/ directory of MG as it should be.

However, simplifying the bash as follows (in principle that should be equivalent) everything works:

--- a/bin/MadGraph5_aMCatNLO/gridpack_generation.sh
+++ b/bin/MadGraph5_aMCatNLO/gridpack_generation.sh
@@ -187,26 +187,10 @@ make_gridpack () {
       #load extra models if needed
       if [ -e $CARDSDIR/${name}_extramodels.dat ]; then
         echo "Loading extra models specified in $CARDSDIR/${name}_extramodels.d
at"
-        #strip comments
-        sed 's:#.*$::g' $CARDSDIR/${name}_extramodels.dat | while read model
-        do
-          #get needed BSM model
-          if [[ $model = *[!\ ]* ]]; then
-            echo "Loading extra model $model"
-            wget --no-check-certificate https://cms-project-generators.web.cern
.ch/cms-project-generators/$model	
-            cd models
-            if [[ $model == *".zip"* ]]; then
-              unzip ../$model
-            elif [[ $model == *".tgz"* ]]; then
-              tar zxvf ../$model
-            elif [[ $model == *".tar"* ]]; then
-              tar xavf ../$model
-            else 
-              echo "A BSM model is specified but it is not in a standard archiv
e (.zip or .tar)"
-            fi
-            cd ..
-          fi
-        done
+        wget --no-check-certificate https://cms-project-generators.web.cern.ch/
cms-project-generators/smeft4vbs.tgz	
+        cd models
+        tar zxvf ../smeft4vbs.tgz
+        cd ..
       fi

The problem appears to be in the syntax "sed 's:#.*$::g' $CARDSDIR/${name}_extramodels.dat | while read model" (???) because the first "echo" message is found in the log, the second isn't.

@lviliani
Copy link
Contributor

lviliani commented Jun 13, 2019

The issue appears when the extramodel datacard does not contain EOL.
It can be fixed replacing this line:
sed 's:#.*$::g' $CARDSDIR/${name}_extramodels.dat | while read model
with
sed 's:#.*$::g' $CARDSDIR/${name}_extramodels.dat | while read -r model || [ -n "$model" ]
but there is probably even a simpler bash solution...

@covarell
Copy link
Contributor Author

I see as of today the same issue, can @lviliani make a PR of it please?

@lviliani
Copy link
Contributor

Here it is #2449.
Do you want the same PR also in UL2019 and mg265?

@agrohsje
Copy link
Collaborator

UL2019 is sufficient, as 265 is now the new master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants