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

Delete unused multithreading macro #354

Merged
merged 2 commits into from
Jan 10, 2025
Merged

Conversation

jbreue16
Copy link
Contributor

@jbreue16 jbreue16 commented Jan 3, 2025

The macro CADET_PARFOR_END extends to a closed bracket when the project is build with multithreading enabled. This causes issues in some environments (build failed on MacOS), when the corresponding opening bracket is not defined.
This commit deletes unused CADET_PARFOR_END statements.

fixes #353

@spdavern
Copy link

spdavern commented Jan 3, 2025

This resolved the errors with LumpedRateModelWithPoresDG2D.cpp. Upon attempting building with these changes I encountered similar issues with LumpedRateModelWithPoresDG2D-InitialConditions.cpp lines 848 and 1290. Upon removing the same CADET_PARFOR_END; code on those two lines I was able to successfully build CADET-Core with the -DENABLE_THREADING=ON cmake flag. Also, the resulting CADET-Core allowed me to set nthreads to 5 and solve a simulation.

I tried to push a commit with the changes - as minimal as they are, but don't have permission. :-)

Thank you for such a quick and effective resolution!

@jbreue16
Copy link
Contributor Author

jbreue16 commented Jan 4, 2025

Thanks for reporting! :)

@jbreue16
Copy link
Contributor Author

jbreue16 commented Jan 4, 2025

Instead of removing the unused macros, Ive added parallel support of the corresponding loops as per the last commit.

@spdavern would you be so kind and build this branch again with the new changes - Ive got no MacOS machine at hand rn.
Ill merge the changes into master afterwards.

@spdavern
Copy link

spdavern commented Jan 4, 2025

Hey @jbreue16!
Here is the result of my attempt to:

cd Cadet
git checkout fix/parallel_build_macOS
git pull      # Verified the changes you submitted: Commit 43b78c28 checked out
cd build
make clean
cd ..
rm -rf build
rm -rf install
mkdir build
mkdir install
cd build
cmake -DCMAKE_INSTALL_PREFIX="<ROOT>/CADET/install" -DENABLE_THREADING=ON ../     # <Root> replaced.

Not sure all those steps are exactly required, but for full disclosure.
I got these errors:
image
image

The macro CADET_PARFOR_END extends to a closed bracket when the project
is build with multithreading enabled, which causes issues when the
corresponding opening bracket is not defined.
This commit deletes unused CADET_PARFOR_END statements.
@jbreue16 jbreue16 force-pushed the fix/parallel_build_macOS branch from 43b78c2 to 534d36b Compare January 10, 2025 12:57
@jbreue16
Copy link
Contributor Author

The updated commit works, thanks again for your help @spdavern

@jbreue16 jbreue16 merged commit cce8fc9 into master Jan 10, 2025
4 checks passed
@jbreue16 jbreue16 deleted the fix/parallel_build_macOS branch January 10, 2025 13:50
@github-actions github-actions bot locked and limited conversation to collaborators Jan 10, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Build from source enabling threading gives errors
2 participants