Update the instruction of generate gridpacks of MadgraphData

After my Z4mu gridpack merged in MadgraphData, I made run-gauss again in decfile test again, but still failed. I checked the log and found

unlink: cannot unlink '42114001_6500_6500/madevent/lib/PDFsets': Is a directory
unlink: cannot unlink '42114001_6500_6500/lib/PDFsets': Is a directory

Then I realized the reason is, instruction of making gridpack is out of date, so I just ran the procedures in gridpack.sh manually, causing the missing step of linking PDFsets. Though it works in generating events while fail in CI test. Then with some test I think we could directly push the update of instruction.

When you follow the old instruction, you could meet the error like,

[shiwe@lxplus991 GaussDev_v56r8]$ source MadgraphData/cmt/gridpack.sh '$APPCONFIGOPTS/Gauss/Beam6500GeV-md100-2018-nu1.6
.py' '$LBMADGRAPHROOT/options/70000000.py' 
Creating the gridpack configuration.
Generating the gridpack.
# setting LC_ALL to "C"
Traceback (most recent call last):
  File "/cvmfs/lhcb.cern.ch/lib/lhcb/GAUDI/GAUDI_v36r9p1/InstallArea/x86_64_v2-centos7-gcc11-opt/bin/gaudirun.py", line 584, in <module>
    exec(o, g, l)
  File "<string>", line 1, in <module>
  File "/cvmfs/lhcb.cern.ch/lib/lhcb/GAUDI/GAUDI_v36r9p1/InstallArea/x86_64_v2-centos7-gcc11-opt/bin/gaudirun.py", line 538, in __call__
    from GaudiConfig2 import CALLABLE_FORMAT, invokeConfig, mergeConfigs
  File "/cvmfs/lhcb.cern.ch/lib/lhcb/GAUDI/GAUDI_v36r9p1/InstallArea/x86_64_v2-centos7-gcc11-opt/python/GaudiConfig2/__init__.py", line 12, in <module>
    from GaudiConfig2._db import ConfigurablesDB
  File "/cvmfs/lhcb.cern.ch/lib/lhcb/GAUDI/GAUDI_v36r9p1/InstallArea/x86_64_v2-centos7-gcc11-opt/python/GaudiConfig2/_db.py", line 54, in <module>
    _DB = ConfDB2()
  File "/cvmfs/lhcb.cern.ch/lib/lhcb/GAUDI/GAUDI_v36r9p1/InstallArea/x86_64_v2-centos7-gcc11-opt/python/GaudiConfig2/_db.py", line 33, in __init__
    for db in [shelve.open(f, "r") for f in dbfiles]:
  File "/cvmfs/lhcb.cern.ch/lib/lhcb/GAUDI/GAUDI_v36r9p1/InstallArea/x86_64_v2-centos7-gcc11-opt/python/GaudiConfig2/_db.py", line 33, in <listcomp>
    for db in [shelve.open(f, "r") for f in dbfiles]:
  File "/cvmfs/lhcb.cern.ch/lib/lcg/releases/Python/3.9.12-9a1bc/x86_64-centos7-gcc11-opt/lib/python3.9/shelve.py", line 243, in open
    return DbfilenameShelf(filename, flag, protocol, writeback)
  File "/cvmfs/lhcb.cern.ch/lib/lcg/releases/Python/3.9.12-9a1bc/x86_64-centos7-gcc11-opt/lib/python3.9/shelve.py", line 227, in __init__
    Shelf.__init__(self, dbm.open(filename, flag), protocol, writeback)
  File "/cvmfs/lhcb.cern.ch/lib/lcg/releases/Python/3.9.12-9a1bc/x86_64-centos7-gcc11-opt/lib/python3.9/dbm/__init__.py", line 91, in open
    raise error[0]("db type is {0}, but the module is not "
dbm.error: db type is dbm.gnu, but the module is not available
Finding the gridpack location.
ls: cannot access '[0-9]*/': No such file or directory
bash: -1: substring expression < 0
Removing unneeded NLO gridpack files.
Soft linking PDF sets.
Configuring run mode and number of cores.
Compressing final packaged gridpack.
tar: Cowardly refusing to create an empty archive
Try 'tar --help' or 'tar --usage' for more information.

I suggest the procedure should be updated to,

# Set the enviroment
$ lb-run Gauss/v56r8 bash

# Run, here '70000000.py' is the dummy event type.
git clone ssh://git@gitlab.cern.ch:7999/lhcb-datapkg/Gen/MadgraphData.git
source MadgraphData/cmt/gridpack.sh '$APPCONFIGOPTS/Gauss/Beam6500GeV-md100-2016-nu1.6.py' '$LBMADGRAPHROOT/options/70000000.py'

# This creates '70000000_6500_6500.tgz' in the current directory.
ls MadgraphData/gridpacks/${CMTCONFIG}

# Remove the run directory to test if things worked.
rm -r 70000000_6500_6500/

# To use this gridpack, the MADGRAPHDATAROOT path must be set.
export MADGRAPHDATAROOT=$PWD/MadgraphData
source '$LBMADGRAPHROOT/options/example_job.sh'

Also, for the convinient of compressing gridpack in current directory, we have better make some changes in MadgraphData/cmt/gridpack.sh, line 114~115,

mkdir -p $TOP/Add/gridpacks/$CMTCONFIG/
tar -cvf - $GRID | gzip --best > $TOP/Add/gridpacks/$CMTCONFIG/$GRID.tgz

It works on my lxplus.

Edited by Wenjie Shi