Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ceed*Get[CeedObject] Needs Destroy #1702

Merged
merged 7 commits into from
Oct 23, 2024
Merged

Ceed*Get[CeedObject] Needs Destroy #1702

merged 7 commits into from
Oct 23, 2024

Conversation

jeremylt
Copy link
Member

@jeremylt jeremylt commented Oct 22, 2024

Requiring Ceed objects returned from Ceed*Get[CeedObject] to be destroyed

  • Ceed*GetCeed
  • CeedGetParent
  • CeedGetDelegate
  • CeedGetObjectFallback
  • CeedGetOperatorFallbackCeed
  • CeedQFunctionGetContext
  • CeedOperatorGetQFunction
  • CeedOperatorGetFallbackParentCeed

@jedbrown
Copy link
Member

Is MFEM going to need updates to track this?

Copy link
Member

@jedbrown jedbrown left a comment

Choose a reason for hiding this comment

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

Do the language bindings (Python, Julia, and Rust) need updates for these?

@jeremylt
Copy link
Member Author

Surprisingly, the updates MFEM needs for v0.13 are pretty minimal. I've got a branch open, and I don't think this PR will add any new changes. But Ratel and HONEE will need a couple of changes

@jeremylt jeremylt merged commit e3ae47f into main Oct 23, 2024
28 checks passed
@jeremylt jeremylt deleted the jeremy/get-ceed-object branch October 23, 2024 22:31
Comment on lines 2088 to +2091
let mut ptr_coarse = std::ptr::null_mut();
let mut ptr_prolong = std::ptr::null_mut();
let mut ptr_restrict = std::ptr::null_mut();
let ierr = unsafe {
self.op_core.check_error(unsafe {
Copy link
Member

Choose a reason for hiding this comment

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

In the future (definitely a different PR), this could be let (op_coarse, op_prolong, op_restrict) = ceed.op_core.check_error_with_3(|ptr_coarse, ptr_prolong, ptr_restrict| unsafe { ... })?;.

Note that Operator::from_raw should be unsafe because it will dereference a raw pointer. Just noticed that while browsing (also not for this PR, and I'm not trying to snipe you into working on it).

@jeremylt
Copy link
Member Author

@jrwrigh this is relevant to HONEE - you'll want a couple of Destroys probably

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants