Skip to content

[newchem-cpp] internal scratch-buffer interface update#333

Merged
brittonsmith merged 14 commits into
grackle-project:newchem-cppfrom
mabruzzo:gen2024transcribe/internal_types_updates
Aug 13, 2025
Merged

[newchem-cpp] internal scratch-buffer interface update#333
brittonsmith merged 14 commits into
grackle-project:newchem-cppfrom
mabruzzo:gen2024transcribe/internal_types_updates

Conversation

@mabruzzo

@mabruzzo mabruzzo commented May 18, 2025

Copy link
Copy Markdown
Collaborator

This PR was originally proposed as brittonsmith#26


This must be reviewed after #332.


This consists of a few commits that tweak the general interface of the internal-type I have been creating (their nominal role is to carry around collections of scratch buffers). Basically I formalize the idea that each of these types should support the visitor design pattern for visiting the data-members of these types (we were already doing to help with allocation and destruction).
A longer description of the design pattern is provided within the modified files.

This is important for the at least the initial transcription of step_rate_newton_raphson. We may be able to get rid of this machinery down the road.

While the new visitor machinery makes fairly heavy use of C++, it's relatively compartmentalized. In my view this makes the more C-like nature of the rest of the code a lot more ergonomic. But, we can always revisit this later.

This machinery could be very useful for aggregating memory allocations, the initial port to GPUs (i.e. copying data to and from the GPU), and debugging (e.g. printing out the contents of the buffers tracked by a particular buffer in a nicely formatted manner)

@mabruzzo mabruzzo added the refactor internal reorganization or code simplification with no behavior changes label May 18, 2025
@mabruzzo mabruzzo moved this to Awaiting Review in New Chemistry and C++ Transcription May 18, 2025
@brittonsmith brittonsmith changed the base branch from newchem-cpp to main August 13, 2025 09:48
@brittonsmith brittonsmith changed the base branch from main to newchem-cpp August 13, 2025 09:48
@brittonsmith

Copy link
Copy Markdown
Contributor

@mabruzzo can you resolve these merger conflicts?

@brittonsmith brittonsmith merged commit 33ae34c into grackle-project:newchem-cpp Aug 13, 2025
5 checks passed
@github-project-automation github-project-automation Bot moved this from Awaiting Review to Done in New Chemistry and C++ Transcription Aug 13, 2025
@mabruzzo mabruzzo deleted the gen2024transcribe/internal_types_updates branch August 19, 2025 19:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

refactor internal reorganization or code simplification with no behavior changes

Projects

Development

Successfully merging this pull request may close these issues.

2 participants