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

Always check in the code for explicit parallel/serial choice #980

Merged
merged 4 commits into from
Oct 7, 2024

Conversation

starseeker
Copy link
Contributor

In order to avoid accident serial (or parallel, for that matter) compilation settings, always check in the code for an explicit and valid MANIFOLD_PAR value.

@starseeker starseeker mentioned this pull request Oct 7, 2024
Copy link

codecov bot commented Oct 7, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.21%. Comparing base (d437097) to head (1571516).
Report is 116 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #980      +/-   ##
==========================================
- Coverage   91.84%   88.21%   -3.63%     
==========================================
  Files          37       62      +25     
  Lines        4976     8670    +3694     
  Branches        0     1044    +1044     
==========================================
+ Hits         4570     7648    +3078     
- Misses        406     1022     +616     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@pca006132
Copy link
Collaborator

Nice. Maybe we want to do this to other flags as well? e.g. MANIFOLD_DEBUG.

@elalish what do you think?

Copy link
Owner

@elalish elalish left a comment

Choose a reason for hiding this comment

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

Thanks!

@elalish
Copy link
Owner

elalish commented Oct 7, 2024

Nice. Maybe we want to do this to other flags as well? e.g. MANIFOLD_DEBUG.

@elalish what do you think?

Yeah, actually it's probably a good idea to be uniform about this. This is basically to catch our own CMake errors, right? And those could happen with any flag, so let's make this part of our coding style.

@starseeker
Copy link
Contributor Author

The thing about doing it for the debugging flag... I would expect, by default, user codes wouldn't turn debugging on - so it may feel a little weird to them to have to explicitly say it is off. Parallel I think makes sense because of the importance - if you try to turn parallel on or off and get it wrong the consequences can be severe - but we might not want to force client codes to set a large number of defines to build.

@starseeker
Copy link
Contributor Author

The other alternative would be to put the compile failing checks for the define in the internal C++ files - right now I've got it in the public header. If we want this to be a for-manifold-compile-only thing, I should push it down to the internal files.

We want this check for Manifold compilation as a cross check on our CMake
logic, but this way client codes will work by default without being forced to
set it explicitly.
@pca006132
Copy link
Collaborator

Yeah, putting it in our internal files will be good enough.

@starseeker
Copy link
Contributor Author

Probably should do the debug flag in a separate PR?

Copy link
Owner

@elalish elalish left a comment

Choose a reason for hiding this comment

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

Looks good, thanks!

@elalish elalish merged commit 3febd48 into elalish:master Oct 7, 2024
21 checks passed
@starseeker starseeker deleted the mpar_check branch October 7, 2024 20:11
RahimovIR pushed a commit to RahimovIR/manifold that referenced this pull request Oct 18, 2024
…#980)

* Check at compile time that MANIFOLD_PAR is set to either P (parallel) or S (series) mode.

* Switch from 'P' and 'S' to 1 and -1

* fix formatting

* Put the MANIFOLD_PAR poison pill in an internal header.

We want this check for Manifold compilation as a cross check on our CMake
logic, but this way client codes will work by default without being forced to
set it explicitly.
@elalish elalish mentioned this pull request Nov 5, 2024
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.

3 participants