-
Notifications
You must be signed in to change notification settings - Fork 5
Enable CMake parallel build #89
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
base: master
Are you sure you want to change the base?
Conversation
For components using the CMake build tool; tested with ParFlow. Four threads appears to be the sweet spot. Walltimes (ParFlow only): -j 1 -> 164 s -j 2 -> 100 s -j 4 -> 64 s -j 8 -> 50 s
|
I don't know how to do this for ParFlow alone, but it should not break building of any other component as it is CMake native. Maybe CI is also faster now. Can this be checked? |
kvrigor
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not a good idea to hardcode --parallel 4 as it would pose a problem for coupled builds (see #62). Instead what I'd suggest is to parameterize the # of build threads, e.g.:
# default.env should provide a default setting for TSMP2_PARALLEL_JOBS.
# Either default=1 or a machine-specific default value.
export TSMP2_PARALLEL_JOBS=4
# Should be aware of TSMP2_PARALLEL_JOBS setting
./build_tsmp2.sh ...This way you can still enable parallel builds while keeping the default build behavior to a known working state (i.e. -j1).
|
Firstly, I don't see what Then, I suppose it is still not good enough, because your amended solution would mean that we have to test anyway if "-j 4" works on JSC machines. This is where I want to use it, at least sometimes. I suppose, by default it must everywhere be "-j 1", and we could introduce |
This reverts commit 7c7b303, because it would pose a problem for coupled builds.
|
I was thinking to use
It makes more sense to set the optimal |
| mkdir -p "${cmake_install_dir}" | ||
|
|
||
| if [ -v max_jobs ]; then | ||
| export CMAKE_BUILD_PARALLEL_LEVEL=${max_jobs} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CMAKE_BUILD_PARALLEL_LEVEL can trigger intercomponent parallel builds which we don't want (see #62)
For components using the CMake build tool; tested with ParFlow.
Four threads appears to be the sweet spot. Walltimes (ParFlow only):
-j 1 -> 164 s
-j 2 -> 100 s
-j 4 -> 64 s
-j 8 -> 50 s