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

levelset: rework overall design #422

Merged
merged 27 commits into from
Feb 5, 2024
Merged

levelset: rework overall design #422

merged 27 commits into from
Feb 5, 2024

Conversation

andrea-iob
Copy link
Member

The main purpose of the rework is to reduce the memory footprint of the levelset. To achieve this goal, the values computed by the levelset are stored in separate caches. Each cache can be enabled separately form the other and can operate in one of the following modes:

  • values can be cached as their are evaluated;
  • values can be pre-computed inside the narrow band;
  • values can be pre-computed on the whole domain.

When no caches are enabled, the only memory used by the levelset is the memory that each object uses to store its own information (for example the object that evaluates the levelset of a segmentation stored information about the normals of the segmentation).

When no cached are enabled, the evaluation of the levelset is thread safe and this allows to use the levelset object inside parallel OpenMP regions.

This new levelset aims to be 100% compatible with the existing levelset. Some functions are now deprecated, but thay should still work as before.

The pull request is a draft, because more tests should be performed.

@andrea-iob
Copy link
Member Author

The final implementation is not 100% compatible with the current version. The names of a couple of classes have changed, but, overall, I think that adapting an existing code to the new implementation should be easy.

@andrea-iob andrea-iob marked this pull request as ready for review November 16, 2023 16:31
@andrea-iob andrea-iob force-pushed the levelset.cache branch 2 times, most recently from 4f3cfee to e038aa8 Compare December 13, 2023 16:06
The main purpose of the rework is to reduce the memory footprint of the
levelset. To achieve this goal, the values computed by the levelset are
stored in separate caches. Each cache can be enabled separately form the
other and can operate in one of the following modes:

    values can be cached as their are evaluated;
    values can be pre-computed inside the narrow band;
    values can be pre-computed on the whole domain.

When no caches are enabled, the only memory used by the levelset is the
memory that each object uses to store its own information (for example
the object that evaluates the levelset of a segmentation stored
information about the normals of the segmentation).

When no cached are enabled, the evaluation of the levelset is thread
safe and this allows to use the levelset object inside parallel OpenMP
regions.
@andrea-iob
Copy link
Member Author

I fixed a problem with the update of empty objects. Hopefully, this should address the last problems we had with this branch.

Copy link
Member

@marcocisternino marcocisternino left a comment

Choose a reason for hiding this comment

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

I tested in a complex geometry case. Differences are very small and results very similar.

@andrea-iob andrea-iob merged commit 00fd135 into master Feb 5, 2024
6 checks passed
@andrea-iob andrea-iob deleted the levelset.cache branch February 5, 2024 07:44
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