Closed mgduda closed 3 months ago
I should have checked that parallel builds work after adding the directory physics_noahmp, but did not (I do not use parallel builds very often). After compiling the sourcecode with the updated Makefile, parallel builds (-j 4) worked with the intel and gnu compilers. I approve this PR. Thanks for fixing the Makefile.
Upon further testing, it looks like there are other issues with parallel builds related to the creating or updating of libphys.a
. I'll see if it's possible to address those issues as part of this PR.
@ldfowler58 Can you re-review this PR? I've added another commit with the Makefile changes that allow us to build source directories in parallel, but to serialize the updating of libphys.a
.
I reviewed this PR and now understand the issue regarding the parallel build. After reviewing changes to the Makefile, I agree with the PR. Thanks.
This PR fixes intermittent parallel build failures in MPAS-A physics.
Firstly, this PR adds a missing dependency in
src/core_atmosphere/physics/Makefile
. Thecore_physics
target should depend not only oncore_physics_wrf
but also oncore_physics_noahmp
. Note thatcore_physics_wrf
already has a dependency oncore_physics_mmm
, and so it isn't necessary to also listcore_physics_mmm
as a dependency forcore_physics
.Secondly, this PR splits the compilation of source files in MPAS-A physics. Now, Makefiles have been modified so that source files in
physics_wrf
,physics_noahmp
, andphysics_mmm
can be compiled in parallel first, and as a subsequent step, object files from these directories are added tolibphys.a
in a serial fashion to avoid race conditions during library updates.