Commit 34faff46 authored by Rachid Mazini's avatar Rachid Mazini
Browse files

Merge branch 'sweep-tmxml-fixes-21.0-mc16a' into '21.0-mc16a'

Sweep TriggerMenuXML fixes from 21.0 to 21.0-mc16a

See merge request atlas/athena!37534
parents c0b53f28 5ef8ef25
......@@ -42,7 +42,7 @@ function( atlas_build_trigger_menu menu )
COMMAND ${CMAKE_COMMAND} -E make_directory
${CMAKE_CURRENT_BINARY_DIR}/Menus/${menu}
COMMAND ${CMAKE_BINARY_DIR}/atlas_build_run.sh
${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/XMLDumperFromAthena.sh ${menu}
${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/XMLDumperFromAthena.sh -r ${CMAKE_PROJECT_VERSION} ${menu}
${CMAKE_CURRENT_BINARY_DIR}/Menus/${menu}
COMMAND ${CMAKE_COMMAND} -E make_directory
${CMAKE_XML_OUTPUT_DIRECTORY}/TriggerMenuXML
......@@ -74,7 +74,7 @@ function( atlas_build_trigger_menu menu )
execute_process(
COMMAND ${CMAKE_BINARY_DIR}/atlas_build_run.sh
${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/XMLDumperFromAthena.sh
${menu} ${CMAKE_CURRENT_BINARY_DIR}/Menus/${menu} )
-r ${CMAKE_PROJECT_VERSION} ${menu} ${CMAKE_CURRENT_BINARY_DIR}/Menus/${menu} )
endif()" )
# Install the generated XML files. Note that this installation rule is
......
package TriggerMenuXML
# This package is used to create the trigger menu xml files during the release build.
# The menus are defined below via 'build_menu'. Different menus can be defined for
# different projects. Usage:
#
# cmt make : Build all menus defined for current project
# cmt make build_menu_<menu> : Build only MENU (e.g. <menu>=Physics_pp_v4)
# cmt -tag_add=<target>_menus make : Only build menus for target project (e.g. <target>=p1hlt or prod)
#
use AtlasPolicy AtlasPolicy-*
private
# The 'use' statements to enforce the build order are obsolete now (see Savannah #93077)
# Pattern to run athena for a given trigger menu and target release
# Usage: [apply_pattern] build_menu target=ABC menu=XYZ
#
pattern build_menu \
action build_menu_<menu> "../scripts/XMLDumperFromAthena.sh <menu> ../data" ; \
macro_append build_<target>_menus " build_menu_<menu>" ; \
macro build_menu_<menu>_dependencies " install_joboptions "
#------------------------------------------------------------------------
# P1HLT menus
#------------------------------------------------------------------------
# Physics
build_menu target=p1hlt menu="Physics_pp_v6"
build_menu target=p1hlt menu="Physics_pp_v6_tight_physics_prescale"
build_menu target=p1hlt menu="MC_pp_v6"
build_menu target=p1hlt menu="MC_pp_v6_tight_mc_prescale"
build_menu target=p1hlt menu="MC_pp_v6_tightperf_mc_prescale"
build_menu target=p1hlt menu="Physics_pp_v7"
build_menu target=p1hlt menu="MC_pp_v7"
build_menu target=p1hlt menu="Physics_HI_v3"
build_menu target=p1hlt menu="MC_HI_v3"
build_menu target=p1hlt menu="MC_HI_v3_tight_mc_prescale"
# Heavy Ion 2015
build_menu target=p1hlt menu="Physics_HI_v3"
build_menu target=p1hlt menu="Physics_HI_v4"
build_menu target=p1hlt menu="MC_HI_v4"
build_menu target=p1hlt menu="MC_HI_v4_tight_mc_prescale"
#------------------------------------------------------------------------
#------------------------------------------------------------------------
# Offline (AtlasProduction) menus
#------------------------------------------------------------------------
# Physics
build_menu target=prod menu="Physics_pp_v7"
build_menu target=prod menu="MC_pp_v7"
build_menu target=prod menu="Physics_pp_v6"
build_menu target=prod menu="Physics_pp_v6_tight_physics_prescale"
build_menu target=prod menu="MC_pp_v6"
build_menu target=prod menu="MC_pp_v6_loose_mc_prescale"
build_menu target=prod menu="MC_pp_v6_tight_mc_prescale"
build_menu target=prod menu="MC_pp_v6_tightperf_mc_prescale"
build_menu target=prod menu="Physics_HI_v3"
build_menu target=prod menu="MC_HI_v3"
build_menu target=prod menu="MC_HI_v3_tight_mc_prescale"
build_menu target=prod menu="Physics_HI_v4"
build_menu target=prod menu="MC_HI_v4"
build_menu target=prod menu="MC_HI_v4_tight_mc_prescale"
#------------------------------------------------------------------------
apply_pattern declare_joboptions files="*.py"
apply_pattern declare_xmls
#apply_pattern declare_runtime files="../data/TriggerMenuSQLiteFile*.sqlite"
# Build set of menus depending on release we are in
# The _scripts tags are CMT-internal tags that can be used to determine the project
tag AtlasP1HLT_scripts p1hlt_menus
tag AtlasCAFHLT_scripts p1hlt_menus
tag AtlasTestHLT_scripts p1hlt_menus
# Build menus before installing XML files
macro_prepend check_install_xmls_dependencies "$(build_prod_menus) " \
prod_menus "$(build_prod_menus) " \
p1hlt_menus "$(build_p1hlt_menus) "
# Install the menu creation script for interactive menu generation
apply_pattern declare_scripts \
files="-s=../scripts CreateTriggerMenuXML.sh"
......@@ -3,10 +3,21 @@
#
if [ $# -lt 1 ]; then
echo "Syntax: XMLDumperFromAthena.sh MENU [DEST]"
echo "Syntax: XMLDumperFromAthena.sh [-r VERSION] MENU [DEST]"
exit 1
fi
while true; do
case "$1" in
-r)
release=$2
shift 2
;;
*)
break
esac
done
menu=$1
dest=$2
if [ -z "$dest" ]; then
......@@ -17,35 +28,8 @@ fi
dest=`cd $dest; pwd`
jo=TriggerMenuXML/runHLT_forXMLgeneration.py
sqliteFile=TriggerMenuSQLiteFile.sqlite
uploadLog=TriggerMenuUpload.log
doDBUpload="false"
if [[ "$NICOS_ATLAS_RELEASE" != "" ]]; then
if [[ "$NICOS_ATLAS_ALT_RELEASE" != "None" ]]; then # MIG nightlies
release=$NICOS_ATLAS_ALT_RELEASE
else
release=$NICOS_ATLAS_RELEASE
fi
if [[ "$AtlasProject" != "AtlasP1HLT" && "$AtlasProject" != "AtlasCAFHLT" && "$AtlasProject" != "AtlasTestHLT" ]]; then
#doDBUpload="true" # Temporarily disabled due to sqlite slowness (Savannah #102038)
# we upload the default menu
menuForUpload=`python -c "from TriggerJobOpts import TriggerFlags;print TriggerFlags.triggerMenuSetup().get_Value()" | tail -1`
fi
else
release=`python -c "from TriggerJobOpts import TriggerFlags; print(TriggerFlags.menuVersion().get_Value())" | tail -1`
fi
if [[ -e MenusKeys.txt ]]; then
echo "XMLDumperFromAthena: Removing old MenusKeys.txt "
rm -f MenusKeys.txt
fi
# Setup TriggerTool
if [ ${doDBUpload} = "true" ]; then
source /afs/cern.ch/sw/lcg/external/Java/bin/setup.sh
get_files -data -remove -symlink TriggerTool.jar
export _JAVA_OPTIONS="-Xms256m -Xmx1048m"
if [ -z "$release" ]; then
release=${AtlasVersion} # for interactive use
fi
# Temporary run directroy and cleanup traps in case of termination
......@@ -60,11 +44,6 @@ TRAPTERM() {
}
## menu generation starts here
if [ -n "${AtlasTrigger_PLATFORM}" ]; then # CMAKE
platform=${AtlasTrigger_PLATFORM}
else # CMT
platform=${CMTCONFIG}
fi
echo "XMLDumperFromAthena: Building menu: ${menu} for ${release}"
logfiletopo=topo${menu}.log
logfile=${menu}.log
......@@ -90,28 +69,6 @@ else
echo "XMLDumperFromAthena: $menu FAILED | Exit code: $athena_exit | Log: $dest/$logfile"
fi
#upload default menu into to the SQLite file
#doDBUpload is True if we are in NICOS and not in the P1HLT cache
if [[ ( ${doDBUpload} = "true" ) && ( ${menu} = ${menuForUpload} ) && ( -s outputHLTconfig.xml ) ]]; then
echo "XMLDumperFromAthena: Uploading the xml files to the DB"
rm -f $sqliteFile
cmd=(java -jar TriggerTool.jar -up -release $release -l1_menu outputLVL1config.xml -hlt_menu outputHLTconfig.xml -name $menu -offlineconfig -dbConn "sqlite_file:$sqliteFile" --outputLevel FINER --output $uploadLog)
echo "XMLDumperFromAthena: Upload command: java $cmd"
${cmd}
cp $uploadLog $dest/TriggerMenuUpload.log
echo "Copying sqlite file $sqliteFile to $dest/TriggerMenuSQLiteFile_${release}.sqlite"
chmod 777 $sqliteFile
cp $sqliteFile ${dest}/TriggerMenuSQLiteFile_${release}.sqlite
if [[ -e MenusKeys.txt ]]; then
echo "Copying MenuKeys.txt to ${dest}/MenusKeys_${release}.txt"
cp MenusKeys.txt ${dest}/MenusKeys_${release}.txt
else
echo "Error : MenuKeys.txt does not exist, likely a DB upload problem "
fi
fi
if [[ -e outputLVL1config.xml ]]; then
cp outputLVL1config.xml ${dest}/LVL1config_${menu}_${release}.xml
cp outputHLTconfig.xml ${dest}/HLTconfig_${menu}_${release}.xml
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment