Skip to content
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 1 addition & 7 deletions .github/halld_recon_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,9 @@ mkdir -p /cvmfs/oasis.opensciencegrid.org
mount -t cvmfs oasis.opensciencegrid.org /cvmfs/oasis.opensciencegrid.org
ln -s /cvmfs/oasis.opensciencegrid.org/gluex/group /group

export BMS_OSNAME_OVERRIDE="Linux_Alma9-x86_64-gcc11.4.1-cntr"
# The BMS_OSNAME override is needed because Alma9 retroactively switched its system gcc
# from 11.4.1 to 11.5. We cannot create a new Alma9 container that uses gcc11.4.1, but
# the CVMFS artifact repository hasn't been updated to reflect that.

source /group/halld/Software/build_scripts/gluex_env_boot_jlab.sh
gxenv /workspace/JANA2/.github/halld_recon_build_prereqs_version.xml
gxenv /workspace/JANA2/.github/version.xml

echo "ROOTSYS=$ROOTSYS"
cd /workspace/halld_recon/src
scons install -j12 DEBUG=1 OPTIMIZATION=0 SHOWBUILD=1

16 changes: 0 additions & 16 deletions .github/halld_recon_build_prereqs_version.xml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/jana_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export JANA_HOME=$PROJECT_ROOT/JANA2
export JANA_PLUGIN_PATH=$PROJECT_ROOT/JANA2/plugins

source $BUILD_SCRIPTS/gluex_env_boot_jlab.sh --bs $BUILD_SCRIPTS
gxenv $PROJECT_ROOT/JANA2/.github/jana_prereqs_version.xml
gxenv $PROJECT_ROOT/JANA2/.github/version.xml

echo "jana_home value: $JANA_HOME"

Expand Down
28 changes: 0 additions & 28 deletions .github/jana_prereqs_version.xml

This file was deleted.

28 changes: 28 additions & 0 deletions .github/version.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="https://halldweb.jlab.org/halld_versions/version8.xsl"?>
<gversions file="version_7.1.1.xml" date="2025-10-29">
<description>Bugfix in halld_recon, based on root6.32.08 and compiled with c++20.</description>
<package name="amptools" version="0.15.4" dirtag="root6.32.08"/>
<package name="ccdb" version="2.00.06"/>
<package name="cernlib" version="2005" word_length="64-bit"/>
<package name="diracxx" version="2.1.2" dirtag="root6.32.08"/>
<package name="evtgen" version="01.07.00"/>
<package name="geant4" version="10.07.p04"/>
<package name="gluex_MCwrapper" version="v2.11.0"/>
<package name="gluex_root_analysis" version="1.32.0" dirtag="root6.32.08_hdr571"/>
<package name="halld_recon" version="5.7.1" dirtag="root6.32.08"/>
<package name="halld_sim" version="5.4.0" dirtag="root6.32.08_hdr571"/>
<package name="hddm" version="5.0.0"/>
<package name="hdds" version="4.18.0"/>
<package name="hdgeant4" version="3.1.1" dirtag="root6.32.08_hdr571"/>
<package name="hd_utilities" version="1.56"/>
<package name="hepmc" version="2.06.10"/>
<package name="jana" version="2.4.3" home="/workspace/JANA2/"/>
<package name="lapack" version="3.9.0"/>
<package name="photos" version="3.61"/>
<package name="rcdb" version="0.09.01"/>
<package name="root" version="6.32.08"/>
<package name="sqlitecpp" version="3.1.1"/>
<package name="sqlite" version="3.36.0" year="2021"/>
<package name="xerces-c" version="3.2.3"/>
</gversions>
4 changes: 2 additions & 2 deletions .github/workflows/halld_recon.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
--platform linux/amd64 \
--privileged \
--mount type=bind,source=${{ github.workspace }},target=/workspace \
raiqarasool/gluex_build:cvmfs /bin/bash -c "source /workspace/JANA2/.github/jana_build.sh"
codecr.jlab.org/nbrei/jana2-ci/jana2_devenv_alma9:latest /bin/bash -c "source /workspace/JANA2/.github/jana_build.sh"

- name: Git Clone Halld_recon
run: |
Expand All @@ -42,7 +42,7 @@ jobs:
--platform linux/amd64 \
--privileged \
--mount type=bind,source=${{ github.workspace }},target=/workspace \
raiqarasool/gluex_build:cvmfs /bin/bash -c "source /workspace/JANA2/.github/halld_recon_build.sh"
codecr.jlab.org/nbrei/jana2-ci/jana2_devenv_alma9:latest /bin/bash -c "source /workspace/JANA2/.github/halld_recon_build.sh"

- name: Cleaning up created folders
if: always()
Expand Down
1 change: 1 addition & 0 deletions src/libraries/JANA/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ set(JANA2_SOURCES
Components/JComponentSummary.cc
Components/JDatabundle.cc
Components/JHasInputs.cc
Components/JHasOutputs.cc

Utils/JCpuInfo.cc
Utils/JProcessorMapping.cc
Expand Down
2 changes: 1 addition & 1 deletion src/libraries/JANA/Components/JHasInputs.cc
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ void JHasInputs::VariadicInputBase::TriggerFactoryCreate(const JEvent& event) {
}
throw JException("Could not find parent at level=" + toString(m_level));
}
if (!m_realized_databundle_names.empty()) {
if (!m_requested_databundle_names.empty()) {
for (auto& tag : m_requested_databundle_names) {
auto coll = facset->GetDatabundle(m_type_index, tag);
if (coll == nullptr && !m_is_optional) {
Expand Down
63 changes: 39 additions & 24 deletions src/libraries/JANA/Components/JHasInputs.h
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,9 @@ struct JHasInputs {
void SetRequestedDatabundleNames(std::vector<std::string> names) {
m_requested_databundle_names = names;
m_realized_databundle_names = names;
// If options.names are empty, m_realized_databundle_names will be filled later
// Otherwise, m_realized_databundle_names always matches m_requested_databundle_names
// This weirdness is an optimization to avoid having to repopulate m_realized_databundle_names for every event
}

void SetEmptyInputPolicy(EmptyInputPolicy policy) {
Expand All @@ -163,6 +166,10 @@ struct JHasInputs {

void Configure(const VariadicInputOptions& options) {
m_requested_databundle_names = options.names;
m_realized_databundle_names = options.names;
// If options.names are empty, m_realized_databundle_names will be filled later
// Otherwise, m_realized_databundle_names always matches m_requested_databundle_names
// This weirdness is an optimization to avoid having to repopulate m_realized_databundle_names for every event
m_level = options.level;
m_is_optional = options.is_optional;
}
Expand Down Expand Up @@ -339,6 +346,7 @@ struct JHasInputs {

void SetTags(std::vector<std::string> tags) {
m_requested_databundle_names = tags;
m_realized_databundle_names = tags;
}

const std::vector<std::vector<const T*>>& operator()() { return m_datas; }
Expand Down Expand Up @@ -526,37 +534,44 @@ struct JHasInputs {
return;
}

// Validate that we have the correct number of input databundle names
if (single_input_databundle_names.size() != m_inputs.size()) {
throw JException("Wrong number of (nonvariadic) input databundle names! Expected %d, found %d", m_inputs.size(), single_input_databundle_names.size());
}

if (variadic_input_databundle_names.size() != m_variadic_inputs.size()) {
throw JException("Wrong number of variadic input databundle names! Expected %d, found %d", m_variadic_inputs.size(), variadic_input_databundle_names.size());
}
if (!single_input_databundle_names.empty()) {

size_t i = 0;
for (auto* input : m_inputs) {
input->SetDatabundleName(single_input_databundle_names.at(i));
if (single_input_levels.empty()) {
input->SetLevel(component_level);
// Validate that we have the correct number of input databundle names
if (single_input_databundle_names.size() != m_inputs.size()) {
throw JException("Wrong number of (nonvariadic) input databundle names! Expected %d, found %d", m_inputs.size(), single_input_databundle_names.size());
}
else {
input->SetLevel(single_input_levels.at(i));

size_t i = 0;
for (auto* input : m_inputs) {
input->SetDatabundleName(single_input_databundle_names.at(i));
if (single_input_levels.empty()) {
input->SetLevel(component_level);
}
else {
input->SetLevel(single_input_levels.at(i));
}
i += 1;
}
i += 1;
}

i = 0;
for (auto* variadic_input : m_variadic_inputs) {
variadic_input->SetRequestedDatabundleNames(variadic_input_databundle_names.at(i));
if (variadic_input_levels.empty()) {
variadic_input->SetLevel(component_level);
if (!variadic_input_databundle_names.empty()) {

// Validate that we have the correct number of variadic input databundle names
if (variadic_input_databundle_names.size() != m_variadic_inputs.size()) {
throw JException("Wrong number of lists of variadic input databundle names! Expected %d, found %d", m_variadic_inputs.size(), variadic_input_databundle_names.size());
}
else {
variadic_input->SetLevel(variadic_input_levels.at(i));

size_t i = 0;
for (auto* variadic_input : m_variadic_inputs) {
variadic_input->SetRequestedDatabundleNames(variadic_input_databundle_names.at(i));
if (variadic_input_levels.empty()) {
variadic_input->SetLevel(component_level);
}
else {
variadic_input->SetLevel(variadic_input_levels.at(i));
}
i += 1;
}
i += 1;
}
}

Expand Down
15 changes: 15 additions & 0 deletions src/libraries/JANA/Components/JHasOutputs.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#include "JHasOutputs.h"
#include <JANA/JFactory.h>

void jana::components::UpdateFactoryStatusOnEulerianStore(JFactory* fac) {
// We need to set the factory status separately from the databundle status so
// that the factory doesn't accidentally get re-run.
// We do this inside a weird little free function because we need to avoid creating
// a circular definition of JFactory in our templates.
// Eventually we will need to refactor JFactory::Status and CreationStatus.

fac->SetStatus(JFactory::Status::Inserted);
fac->SetCreationStatus(JFactory::CreationStatus::Inserted);
}


47 changes: 30 additions & 17 deletions src/libraries/JANA/Components/JHasOutputs.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ class JFactorySet;

namespace jana::components {

void UpdateFactoryStatusOnEulerianStore(JFactory* fac);

class JHasOutputs {
public:
Expand Down Expand Up @@ -39,7 +40,7 @@ class JHasOutputs {
class VariadicOutputBase {
private:
std::vector<JDatabundle*> m_databundles;
JEventLevel m_level = JEventLevel::PhysicsEvent;
JEventLevel m_level = JEventLevel::None;

public:
virtual ~VariadicOutputBase() {
Expand Down Expand Up @@ -167,27 +168,39 @@ class JHasOutputs {
}
else {
// Do the obvious, sensible thing instead
size_t i = 0;
for (auto* output : m_outputs) {
output->SetLevel(component_level);
if (use_short_names) {
output->SetShortName(single_output_databundle_names.at(i));
if (!single_output_databundle_names.empty()) {
if (single_output_databundle_names.size() != m_outputs.size()) {
throw JException("Wrong number of (nonvariadic) output databundle names! Expected %d, found %d", m_outputs.size(), single_output_databundle_names.size());
}
else {
output->SetUniqueName(single_output_databundle_names.at(i));

size_t i = 0;
for (auto* output : m_outputs) {
output->SetLevel(component_level);
if (use_short_names) {
output->SetShortName(single_output_databundle_names.at(i));
}
else {
output->SetUniqueName(single_output_databundle_names.at(i));
}
i += 1;
}
i += 1;
}
i = 0;
for (auto* variadic_output : m_variadic_outputs) {
variadic_output->SetLevel(component_level);
if (use_short_names) {
variadic_output->SetShortNames(variadic_output_databundle_names.at(i));

if (!variadic_output_databundle_names.empty()) {
if (variadic_output_databundle_names.size() != m_variadic_outputs.size()) {
throw JException("Wrong number of lists of variadic output databundle names! Expected %d, found %d", m_variadic_outputs.size(), variadic_output_databundle_names.size());
}
else {
variadic_output->SetUniqueNames(variadic_output_databundle_names.at(i));
size_t i = 0;
for (auto* variadic_output : m_variadic_outputs) {
variadic_output->SetLevel(component_level);
if (use_short_names) {
variadic_output->SetShortNames(variadic_output_databundle_names.at(i));
}
else {
variadic_output->SetUniqueNames(variadic_output_databundle_names.at(i));
}
i += 1;
}
i += 1;
}
}
}
Expand Down
9 changes: 9 additions & 0 deletions src/libraries/JANA/Components/JLightweightOutput.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,10 @@ class Output : public JHasOutputs::OutputBase {
typed_bundle->GetData() = std::move(*m_external_data);
}
typed_bundle->SetStatus(JDatabundle::Status::Inserted);
auto fac = typed_bundle->GetFactory();
if (fac != nullptr) {
UpdateFactoryStatusOnEulerianStore(fac);
}
}
};

Expand Down Expand Up @@ -179,6 +183,11 @@ class VariadicOutput : public JHasOutputs::VariadicOutputBase {
}
typed_databundle->GetData() = std::move(m_transient_datas.at(i));
typed_databundle->SetStatus(JDatabundle::Status::Inserted);

auto fac = typed_databundle->GetFactory();
if (fac != nullptr) {
UpdateFactoryStatusOnEulerianStore(fac);
}
i += 1;
}
}
Expand Down
Loading
Loading