Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
4b58875
Initial plan
Copilot Aug 23, 2025
ca26b63
Implement janadot plugin with graph splitting functionality
Copilot Aug 23, 2025
080b349
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Aug 23, 2025
da54165
Implement plugin-based janadot splitting with period-separated naming
Copilot Aug 23, 2025
8948d9f
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Aug 23, 2025
d5a815f
Fix janadot plugin parameter conflict by renaming to eicjanadot
Copilot Aug 23, 2025
7ba3a28
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Aug 23, 2025
eb8fa25
Remove old janadot group parameters from CI workflow to fix parameter…
Copilot Aug 23, 2025
67e014c
Add eicjanadot plugin with enhanced plugin-based graph splitting and …
wdconinc Aug 23, 2025
62f5397
Revert plugin name back to janadot and implement major code refactoring
Copilot Aug 23, 2025
8aa02d3
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Aug 23, 2025
724f289
Fix workflow to use janadot plugin instead of eicjanadot
Copilot Aug 23, 2025
700d41a
Remove default plugin split_criteria option to minimize workflow defi…
wdconinc Aug 23, 2025
8be784d
Address review comments: update default split criteria, MakeNametag f…
Copilot Aug 23, 2025
3c513cf
Change default split_criteria back to plugin
Copilot Aug 23, 2025
5d40aed
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Aug 23, 2025
f886b6d
Test factory nametags and plugin_names
wdconinc Aug 23, 2025
4b6cddf
Add janadot plugin with enhanced plugin-based graph splitting and int…
wdconinc Aug 23, 2025
3a793d5
Re-add janadot groups functionality and .github/janadot.groups file
Copilot Aug 23, 2025
9713642
Remove LoadGroupDefinitions functionality and restore command line gr…
Copilot Aug 23, 2025
d272a06
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Aug 23, 2025
fc644a9
Refactor dot file renaming and conversion logic
wdconinc Aug 23, 2025
a82d7b3
Replace GetParameterNames with FilterParameters
wdconinc Aug 23, 2025
5af52d1
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Aug 23, 2025
b3711e1
Remove size, components, type split_criteria and fix compilation error
Copilot Aug 23, 2025
2da8f63
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Aug 23, 2025
1ac1e54
Remove unused variables and methods
wdconinc Aug 23, 2025
dd45977
Remove debugging output
wdconinc Aug 23, 2025
2979a0c
Add janadot plugin with plugin-based and group-based graph splitting …
wdconinc Aug 24, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
88 changes: 46 additions & 42 deletions .github/janadot.groups

Large diffs are not rendered by default.

58 changes: 44 additions & 14 deletions .github/workflows/linux-eic-shell.yml
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,7 @@ jobs:
export DETECTOR_CONFIG=${DETECTOR}_${{ matrix.detector_config }}
export LD_LIBRARY_PATH=$PWD/install/lib:$LD_LIBRARY_PATH
export JANA_PLUGIN_PATH=$PWD/install/lib/EICrecon/plugins${JANA_PLUGIN_PATH:+:${JANA_PLUGIN_PATH}}
$PWD/install/bin/eicrecon ${{env.JANA_OPTIONS}} ${{env.JANA_OPTIONS_GUN}} -Ppodio:output_collections=EventHeader,MCParticles,EcalBarrelScFiRawHits,EcalBarrelImagingRawHits -Ppodio:output_file=two_stage_raw_${{ matrix.particle }}_1GeV_20GeV_${{ matrix.detector_config }}.edm4eic.root sim_${{ matrix.particle }}_1GeV_20GeV_${{ matrix.detector_config }}.edm4hep.root -Pplugins=dump_flags,janadot -Pdump_flags:json=${{ matrix.particle }}_${{ matrix.detector_config }}_flags.json
$PWD/install/bin/eicrecon ${{env.JANA_OPTIONS}} ${{env.JANA_OPTIONS_GUN}} -Ppodio:output_collections=EventHeader,MCParticles,EcalBarrelScFiRawHits,EcalBarrelImagingRawHits -Ppodio:output_file=two_stage_raw_${{ matrix.particle }}_1GeV_20GeV_${{ matrix.detector_config }}.edm4eic.root sim_${{ matrix.particle }}_1GeV_20GeV_${{ matrix.detector_config }}.edm4hep.root -Pplugins=dump_flags,janadot -Pjanadot:split_criteria=groups $(<${{ github.workspace }}/.github/janadot.groups) -Pdump_flags:json=${{ matrix.particle }}_${{ matrix.detector_config }}_flags.json
- name: Upload digitization output
uses: actions/upload-artifact@v4
with:
Expand All @@ -565,7 +565,7 @@ jobs:
export DETECTOR_CONFIG=${DETECTOR}_${{ matrix.detector_config }}
export LD_LIBRARY_PATH=$PWD/install/lib:$LD_LIBRARY_PATH
export JANA_PLUGIN_PATH=$PWD/install/lib/EICrecon/plugins${JANA_PLUGIN_PATH:+:${JANA_PLUGIN_PATH}}
$PWD/install/bin/eicrecon ${{env.JANA_OPTIONS}} ${{env.JANA_OPTIONS_GUN}} -Ppodio:output_collections=EcalBarrelClusters,EcalBarrelClusterAssociations -Ppodio:output_file=two_stage_rec_${{ matrix.particle }}_1GeV_20GeV_${{ matrix.detector_config }}.edm4eic.root two_stage_raw_${{ matrix.particle }}_1GeV_20GeV_${{ matrix.detector_config }}.edm4eic.root -Pplugins=dump_flags,janadot -Pdump_flags:json=${{ matrix.particle }}_${{ matrix.detector_config }}_flags.json
$PWD/install/bin/eicrecon ${{env.JANA_OPTIONS}} ${{env.JANA_OPTIONS_GUN}} -Ppodio:output_collections=EcalBarrelClusters,EcalBarrelClusterAssociations -Ppodio:output_file=two_stage_rec_${{ matrix.particle }}_1GeV_20GeV_${{ matrix.detector_config }}.edm4eic.root two_stage_raw_${{ matrix.particle }}_1GeV_20GeV_${{ matrix.detector_config }}.edm4eic.root -Pplugins=dump_flags,janadot -Pjanadot:split_criteria=groups $(<${{ github.workspace }}/.github/janadot.groups) -Pdump_flags:json=${{ matrix.particle }}_${{ matrix.detector_config }}_flags.json
- name: Upload reconstruction output
uses: actions/upload-artifact@v4
with:
Expand Down Expand Up @@ -709,7 +709,7 @@ jobs:
export LD_LIBRARY_PATH=$PWD/install/lib:$LD_LIBRARY_PATH
export JANA_PLUGIN_PATH=$PWD/install/lib/EICrecon/plugins:/usr/local/plugins
prmon --json-summary rec_${{ matrix.particle }}_1GeV_20GeV_${{ matrix.detector_config }}.prmon.json -- \
$PWD/install/bin/eicrecon ${{env.JANA_OPTIONS}} ${{env.JANA_OPTIONS_GUN}} -Ppodio:output_file=rec_${{ matrix.particle }}_1GeV_20GeV_${{ matrix.detector_config }}.edm4eic.root sim_${{ matrix.particle }}_1GeV_20GeV_${{ matrix.detector_config }}.edm4hep.root -Pplugins=dump_flags,janadot,janatop $(<${{ github.workspace }}/.github/janadot.groups) -Pdump_flags:json=${{ matrix.particle }}_${{ matrix.detector_config }}_flags.json
$PWD/install/bin/eicrecon ${{env.JANA_OPTIONS}} ${{env.JANA_OPTIONS_GUN}} -Ppodio:output_file=rec_${{ matrix.particle }}_1GeV_20GeV_${{ matrix.detector_config }}.edm4eic.root sim_${{ matrix.particle }}_1GeV_20GeV_${{ matrix.detector_config }}.edm4hep.root -Pplugins=dump_flags,janadot,janatop -Pjanadot:split_criteria=groups $(<${{ github.workspace }}/.github/janadot.groups) -Pdump_flags:json=${{ matrix.particle }}_${{ matrix.detector_config }}_flags.json
- uses: actions/upload-artifact@v4
with:
name: rec_${{ matrix.particle }}_1GeV_20GeV_${{ matrix.detector_config }}.edm4eic.root
Expand All @@ -726,9 +726,19 @@ jobs:
platform-release: "${{ env.platform }}:${{ env.release }}"
setup: "/opt/detector/epic-${{ env.detector-version }}/bin/thisepic.sh"
run: |
mv jana.dot rec_${{ matrix.particle }}_1GeV_20GeV_${{ matrix.detector_config }}.dot
sed '/rank=sink/s/"podio::Frame";//; /podio::Frame/d; /rank=source/s/"JEventProcessorPODIO";//; /JEventProcessorPODIO/d' *.dot | dot -Tsvg > jana.svg
mv jana.svg rec_${{ matrix.particle }}_1GeV_20GeV_${{ matrix.detector_config }}.svg
for dotfile in jana*.dot; do
# Rename all jana dot files with matrix test name prefix
newname="rec_${{ matrix.particle }}_1GeV_20GeV_${{ matrix.detector_config }}.${dotfile#jana.}"
# Handle the case where jana.dot should become rec_..._dot without extra period
if [ "$dotfile" = "jana.dot" ]; then
newname="rec_${{ matrix.particle }}_1GeV_20GeV_${{ matrix.detector_config }}.dot"
fi
mv "$dotfile" "$newname"

# Convert all dot files to SVG (both main and plugin-specific files)
svgfile="${newname%.dot}.svg"
sed '/rank=sink/s/"podio::Frame";//; /podio::Frame/d; /rank=source/s/"JEventProcessorPODIO";//; /JEventProcessorPODIO/d' "$newname" | dot -Tsvg > "$svgfile"
done
continue-on-error: true
- uses: actions/upload-artifact@v4
with:
Expand Down Expand Up @@ -808,7 +818,7 @@ jobs:
export DETECTOR_CONFIG=${DETECTOR}_${{ matrix.detector_config }}
export LD_LIBRARY_PATH=$PWD/install/lib:$LD_LIBRARY_PATH
export JANA_PLUGIN_PATH=$PWD/install/lib/EICrecon/plugins:/usr/local/plugins
$PWD/install/bin/eicrecon ${{env.JANA_OPTIONS}} ${{env.JANA_OPTIONS_GUN}} -Ppodio:output_file=rec_${{ matrix.particle }}_EcalLumiSpec_${{ matrix.detector_config }}.edm4eic.root sim_${{ matrix.particle }}_EcalLumiSpec_${{ matrix.detector_config }}.edm4hep.root -Ppodio:output_collections=EcalLumiSpecRawHits,EcalLumiSpecRecHits,EcalLumiSpecClusters,EcalLumiSpecClusterAssociations -PLUMISPECCAL:EcalLumiSpecIslandProtoClusters:splitCluster=1 -Pplugins=dump_flags,janadot,janatop $(<${{ github.workspace }}/.github/janadot.groups) -Pdump_flags:json=${{ matrix.particle }}_${{ matrix.detector_config }}_flags.json
$PWD/install/bin/eicrecon ${{env.JANA_OPTIONS}} ${{env.JANA_OPTIONS_GUN}} -Ppodio:output_file=rec_${{ matrix.particle }}_EcalLumiSpec_${{ matrix.detector_config }}.edm4eic.root sim_${{ matrix.particle }}_EcalLumiSpec_${{ matrix.detector_config }}.edm4hep.root -Ppodio:output_collections=EcalLumiSpecRawHits,EcalLumiSpecRecHits,EcalLumiSpecClusters,EcalLumiSpecClusterAssociations -PLUMISPECCAL:EcalLumiSpecIslandProtoClusters:splitCluster=1 -Pplugins=dump_flags,janadot,janatop -Pjanadot:split_criteria=groups $(<${{ github.workspace }}/.github/janadot.groups) -Pdump_flags:json=${{ matrix.particle }}_${{ matrix.detector_config }}_flags.json
- uses: actions/upload-artifact@v4
with:
name: rec_${{ matrix.particle }}_EcalLumiSpec_${{ matrix.detector_config }}.edm4eic.root
Expand All @@ -820,9 +830,19 @@ jobs:
platform-release: "${{ env.platform }}:${{ env.release }}"
setup: "/opt/detector/epic-${{ env.detector-version }}/bin/thisepic.sh"
run: |
mv jana.dot rec_${{ matrix.particle }}_EcalLumiSpec_${{ matrix.detector_config }}.dot
sed '/rank=sink/s/"podio::Frame";//; /podio::Frame/d; /rank=source/s/"JEventProcessorPODIO";//; /JEventProcessorPODIO/d' *.dot | dot -Tsvg > jana.svg
mv jana.svg rec_${{ matrix.particle }}_EcalLumiSpec_${{ matrix.detector_config }}.svg
for dotfile in jana*.dot; do
# Rename all jana dot files with matrix test name prefix
newname="rec_${{ matrix.particle }}_1GeV_20GeV_${{ matrix.detector_config }}.${dotfile#jana.}"
# Handle the case where jana.dot should become rec_..._dot without extra period
if [ "$dotfile" = "jana.dot" ]; then
newname="rec_${{ matrix.particle }}_1GeV_20GeV_${{ matrix.detector_config }}.dot"
fi
mv "$dotfile" "$newname"

# Convert all dot files to SVG (both main and plugin-specific files)
svgfile="${newname%.dot}.svg"
sed '/rank=sink/s/"podio::Frame";//; /podio::Frame/d; /rank=source/s/"JEventProcessorPODIO";//; /JEventProcessorPODIO/d' "$newname" | dot -Tsvg > "$svgfile"
done
continue-on-error: true
- uses: actions/upload-artifact@v4
with:
Expand Down Expand Up @@ -911,7 +931,7 @@ jobs:
export LD_LIBRARY_PATH=$PWD/install/lib:$LD_LIBRARY_PATH
export JANA_PLUGIN_PATH=$PWD/install/lib/EICrecon/plugins:/usr/local/plugins
prmon --json-summary rec_dis_${{matrix.beam}}_minQ2=${{matrix.minq2}}_${{ matrix.detector_config }}${{matrix.nthreads > 0 && '_MT' || ''}}.prmon.json -- \
$PWD/install/bin/eicrecon ${{env.JANA_OPTIONS}} ${{matrix.nthreads > 1 && format('-Pnthreads={0}', matrix.nthreads) || ''}} -Ppodio:output_file=rec_dis_${{matrix.beam}}_minQ2=${{matrix.minq2}}_${{ matrix.detector_config }}${{matrix.nthreads > 0 && '_MT' || ''}}.edm4eic.root sim_dis_${{matrix.beam}}_minQ2=${{matrix.minq2}}_${{ matrix.detector_config }}.edm4hep.root -Pacts:WriteObj=true -Pacts:WritePly=true -Pplugins=janadot,janatop $(<${{ github.workspace }}/.github/janadot.groups)
$PWD/install/bin/eicrecon ${{env.JANA_OPTIONS}} ${{matrix.nthreads > 1 && format('-Pnthreads={0}', matrix.nthreads) || ''}} -Ppodio:output_file=rec_dis_${{matrix.beam}}_minQ2=${{matrix.minq2}}_${{ matrix.detector_config }}${{matrix.nthreads > 0 && '_MT' || ''}}.edm4eic.root sim_dis_${{matrix.beam}}_minQ2=${{matrix.minq2}}_${{ matrix.detector_config }}.edm4hep.root -Pacts:WriteObj=true -Pacts:WritePly=true -Pplugins=janadot,janatop -Pjanadot:split_criteria=groups $(<${{ github.workspace }}/.github/janadot.groups)
- uses: actions/upload-artifact@v4
with:
name: rec_dis_${{matrix.beam}}_minQ2=${{matrix.minq2}}_${{ matrix.detector_config }}${{matrix.nthreads > 0 && '_MT' || ''}}.edm4eic.root
Expand All @@ -928,9 +948,19 @@ jobs:
platform-release: "${{ env.platform }}:${{ env.release }}"
setup: "/opt/detector/epic-${{ env.detector-version }}/bin/thisepic.sh"
run: |
mv jana.dot rec_dis_${{matrix.beam}}_minQ2=${{matrix.minq2}}_${{ matrix.detector_config }}${{matrix.nthreads > 0 && '_MT' || ''}}.dot
sed '/rank=sink/s/"podio::Frame";//; /podio::Frame/d; /rank=source/s/"JEventProcessorPODIO";//; /JEventProcessorPODIO/d' *.dot | dot -Tsvg > jana.svg
mv jana.svg rec_dis_${{matrix.beam}}_minQ2=${{matrix.minq2}}_${{ matrix.detector_config }}${{matrix.nthreads > 0 && '_MT' || ''}}.svg
for dotfile in jana*.dot; do
# Rename all jana dot files with matrix test name prefix
newname="rec_${{ matrix.particle }}_1GeV_20GeV_${{ matrix.detector_config }}.${dotfile#jana.}"
# Handle the case where jana.dot should become rec_..._dot without extra period
if [ "$dotfile" = "jana.dot" ]; then
newname="rec_${{ matrix.particle }}_1GeV_20GeV_${{ matrix.detector_config }}.dot"
fi
mv "$dotfile" "$newname"

# Convert all dot files to SVG (both main and plugin-specific files)
svgfile="${newname%.dot}.svg"
sed '/rank=sink/s/"podio::Frame";//; /podio::Frame/d; /rank=source/s/"JEventProcessorPODIO";//; /JEventProcessorPODIO/d' "$newname" | dot -Tsvg > "$svgfile"
done
continue-on-error: true
- uses: actions/upload-artifact@v4
with:
Expand Down
40 changes: 40 additions & 0 deletions docs/howto/visualize_callgraph.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ sources in the event. It also times how long it takes each factory
to run, integrating it over all calls so that one can see the relative
time spent in each factory.

The `janadot` plugin in EICrecon includes enhanced functionality to automatically
split large graphs into multiple smaller graphs for better processing by graphviz
and improved readability.

*Note that this requires JANA2 v2.0.8 or later and EICrecon v0.3.6 or
later.*

Expand Down Expand Up @@ -43,6 +47,42 @@ you would run:
dot -Tpng jana.dot -o jana.png
~~~

### Graph Splitting for Large Call Graphs
When processing complex reconstructions with many algorithms, the resulting call graph can become too large for graphviz to handle efficiently. The janadot plugin automatically detects large graphs and splits them into multiple smaller graphs.

To control the splitting behavior, you can use these parameters:

~~~bash
# Enable/disable splitting (enabled by default)
eicrecon -Pplugins=janadot -Pjanadot:enable_splitting=false sim_file.edm4hep.root

# Control splitting thresholds
eicrecon -Pplugins=janadot \
-Pjanadot:max_nodes_per_graph=30 \
-Pjanadot:max_edges_per_graph=60 \
sim_file.edm4hep.root

# Change splitting method (plugin, size, components, or type)
eicrecon -Pplugins=janadot -Pjanadot:split_criteria=components sim_file.edm4hep.root
~~~

#### Plugin-based Splitting (Default)
The default splitting method groups components by detector subsystem plugins, providing both detailed subsystem views and high-level architectural overview:

~~~bash
# Plugin-based splitting for system architecture analysis
eicrecon -Pplugins=janadot -Pjanadot:split_criteria=plugin sim_file.edm4hep.root
~~~

This generates:
- `jana.tracking.dot` - All tracking-related components
- `jana.ecal_barrel.dot` - ECAL barrel subsystem components
- `jana.hcal_endcap.dot` - HCAL endcap subsystem components
- `jana.dot` - Overall inter-plugin connection summary

#### Other Splitting Methods
When graphs are split using size, components, or type methods, multiple files are created (`jana_part001.dot`, `jana_part002.dot`, etc.) along with an index file (`jana_index.txt`) that explains how to process them.

### Running for a single detector
By default `eicrecon` activates the full reconstruction. This will
result in a very busy callgraph that can be hard to read if you
Expand Down
1 change: 1 addition & 0 deletions src/utilities/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
add_subdirectory(dump_flags)
add_subdirectory(eicrecon)
add_subdirectory(janadot)
add_subdirectory(janatop)
13 changes: 13 additions & 0 deletions src/utilities/janadot/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Automatically set plugin name the same as the directory name Don't forget
# string(REPLACE " " "_" PLUGIN_NAME ${PLUGIN_NAME}) if this dir has spaces in
# its name
get_filename_component(PLUGIN_NAME ${CMAKE_CURRENT_LIST_DIR} NAME)

# Function creates ${PLUGIN_NAME}_plugin and ${PLUGIN_NAME}_library targets
# Setting default includes, libraries and installation paths
plugin_add(${PLUGIN_NAME})

# The macro grabs sources as *.cc *.cpp *.c and headers as *.h *.hh *.hpp Then
# correctly sets sources for ${_name}_plugin and ${_name}_library targets Adds
# headers to the correct installation directory
plugin_glob_all(${PLUGIN_NAME})
Loading
Loading