Skip to content

Conversation

@barnaliy
Copy link
Contributor

@barnaliy barnaliy commented Aug 6, 2025

This PR reorganizes the configuration system that maps data products to storage technologies and file destinations.

What the Configuration System Does:
The configuration system allows users to specify:

Which storage technology to use for each data product (ROOT TTree, ROOT RNtuple, HDF5)
Which file each data product should be written to
Runtime flexibility rather than compile-time hardcoded storage decisions.

Tagging @gemmeren and @aolivier23
Requesting reviews from @knoepfel and @pcanal

@barnaliy barnaliy requested review from knoepfel and pcanal August 6, 2025 21:26
Copy link
Contributor

@gemmeren gemmeren left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mostly minor things now :)

…per constants to technology.hpp and update factories.hpp to use named constants instead of hardcoded values. Addresses code review feedback.
@barnaliy
Copy link
Contributor Author

Thanks @pcanal , @gemmeren for the detailed code reviews and thoughtful feedback! I couldn't respond to each comment individually, but I believe most or all of your suggestions have been addressed in the last few commits. Please let me know if I missed anything.

- Replace magic numbers with constexpr constants and Combine() helper
- Add HDF5 placeholder
- Remove redundant form/ directory from include paths
Update CMake and source files to match simplified directory structure
Copy link
Contributor

@gemmeren gemmeren left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Barnali, this looks good.

Copy link
Contributor

@pcanal pcanal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. Let's squash on merge.

Copy link
Member

@knoepfel knoepfel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@barnaliy, just some minor comments for your consideration.

Comment on lines +17 to +18
const std::string& top_name();
const std::string& col_name();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be const-qualified member functions:

Suggested change
const std::string& top_name();
const std::string& col_name();
const std::string& top_name() const;
const std::string& col_name() const;


Storage_Container::Storage_Container(const std::string& name) : m_name(name), m_file(nullptr) {}

Storage_Container::~Storage_Container() {}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment as before. Putting the implementation of the destructor in the .cpp makes sense. If you want it to be the default implementation, just specify it here:

Storage_Container::~Storage_Container() = default;

const form::experimental::config::parse_config& config) //factory takes form config
{
return std::unique_ptr<IPersistence>(new Persistence());
return std::unique_ptr<IPersistence>(new Persistence(config));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you're adjusting this line of code anyway, I suggest using std::make_unique:

Suggested change
return std::unique_ptr<IPersistence>(new Persistence(config));
return std::make_unique<Persistence>(config);

Comment on lines 21 to 24
m_store(nullptr), m_config(config) // constructor takes form config
{
m_store = createStorage();
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
m_store(nullptr), m_config(config) // constructor takes form config
{
m_store = createStorage();
}
m_store(createStorage()), m_config(config) // constructor takes form config
{}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@knoepfel: Thanks for the feedback! I've implemented your suggestions.

@knoepfel knoepfel merged commit 3cd9de7 into Framework-R-D:main Aug 25, 2025
1 check passed
@aolivier23 aolivier23 mentioned this pull request Sep 24, 2025
aolivier23 added a commit that referenced this pull request Sep 24, 2025
std::find_if() and simplified returning unique_ptr<>s with
std::make_unique().  Many of these changes were lost from PR #22, so I'm
going to make another commit later that restores the PR #22 changes and
still brings in technology configuration.
aolivier23 added a commit that referenced this pull request Sep 24, 2025
technology-specific configuration system.
knoepfel pushed a commit that referenced this pull request Sep 29, 2025
* First import of latest FORM developments from Phlex.  This will
eventually become a PR to add per-container configuration attributes.

* Restored include guard formatting that didn't all make it to the FORM
development repository.

* Restored CMakeLists.txt formatting to match the main branch when
possible.

* Restored formatting in a CMakeLists.txt that I missed.

* Change include guards to _HPP__ from _H__ to match file names after
reaching consensus with FORM team.

* Changed configuration examples to use enums from technology header
instead of magic numbers.

* Removed member variable of form interface and other small text changes
from PR review.

* Fixed most of the requests from PR #36. 

* Restored PR #22 upgrades to Persistence while keeping new
technology-specific configuration system.

* Committing clang-format changes

---------

Co-authored-by: Andrew Olivier <aolivier@anl.gov>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
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

Successfully merging this pull request may close these issues.

5 participants