(WIP) Allow parallel and incremental compilation for lmr (out-of-tree as well)#103
(WIP) Allow parallel and incremental compilation for lmr (out-of-tree as well)#103bezmi wants to merge 9 commits intogdtk-uq:masterfrom
Conversation
|
|
|
If you want to use mold: |
|
Some (non-scientific) timing tests below. Times are in milliseconds. time.sh# time.sh from: https://unix.stackexchange.com/questions/334145/universal-non-bash-time-benchmark-alternative/334152#334152
START=$(date +%s.%N)
"$@"
END=$(date +%s.%N)
DIFF=$( echo "scale=3; (${END} - ${START})*1000/1" | bc )
echo "${DIFF}"Standard makefileClean build, standard linker:Clean build,
|
|
Tested |
Currently only works for the 'lmr' target, so the other ones like lmr-run need to be added. The install target also needs to be fixes. `make LINKER_FLAGS="--linker=mold" -f parallel.make -j(nproc)` will put the lmr binary in $(BUILD_DIR)/ (../../build by default)
also added changes to allow species database and ugrid_partitin to be built out-of-tree
- removed force_tuple_instantiation.d as it's not needed with allisnt flag (possibly at the expense of compilation times and binary sizes, but hasn't hurt in practice) - removed lmr-parallel-files.mk as it's no longer necessary - fixed lmr build targets so they use the correct built objects of the CMD_FILES that they require
|
@Alex-Muirhead, I wanted to talk about this as part of my lightning talk on Friday, so I spent some time over the weekend getting it up to date and working with MPI builds on the latest master. I also removed the majority of the extra files that I had in the previous version, and it essentially only changes the main lmr makefile. I'll post a summary of changes, as well as benchmarks after the lightning talks! |
Just putting this up so people can test. It needs a little bit of work adding the remaining targets
and fixing the(installtargetinstalnow works for the most part). Filenamesparallel.makeare temporary and some of theabspathstuff can do with re-workCurrently only works for thelmrtarget.Works for most targets except the test jacobian ones, which I haven't put in yet.
The command above will put the
lmrbinary (as well as all other object files, libraries and archives) inBUILD_DIR, which is./buildby default.Disclaimer: I haven't tested with any actual sims yet. I compiled it and checked that it doesn't immediately crash when calling
lmrand various sub-commands.No longer required with theforce_tuple_instantiation.dis there to stop the linker from complaining.--allinst flag.Please test this properly for me, I'm not an eilmer user, I just enjoy the colours when all the bars in
htopare maxed out.