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

Fix the build option for LAMMPS to actually enable MPI #9185

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions L/LAMMPS/build_tarballs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ cmake -C ../cmake/presets/most.cmake -C ../cmake/presets/nolib.cmake ../cmake -D
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_SHARED_LIBS=ON \
-DLAMMPS_EXCEPTIONS=ON \
-DPKG_MPI=ON \
-DBUILD_MPI=ON \
-DPKG_EXTRA-FIX=ON \
-DPKG_ML-SNAP=ON \
-DPKG_ML-PACE=ON \
Expand Down Expand Up @@ -75,18 +75,19 @@ augment_platform_block = """
# platforms are passed in on the command line
# platforms = supported_platforms(; experimental=true)
platforms = supported_platforms()
platforms = expand_cxxstring_abis(platforms)

platforms, platform_dependencies = MPI.augment_platforms(platforms)
# Avoid platforms where the MPI implementation isn't supported
# OpenMPI
platforms = filter(p -> !(p["mpi"] == "openmpi" && arch(p) == "armv6l" && libc(p) == "glibc"), platforms)
platforms = filter(p -> !(p["mpi"] == "openmpi" && nbits(p) == 32), platforms)
Copy link
Member

Choose a reason for hiding this comment

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

You don't need to filter out 32-bit platforms if you build against OpenMPI 4:

platforms, platform_dependencies = MPI.augment_platforms(platforms; MPItrampoline_compat="5.3.1", OpenMPI_compat="4.1.6, 5")
. However, one issue I never had the time to look at is #8211 (this compat doesn't seem to be propagated correctly)

Copy link
Member Author

Choose a reason for hiding this comment

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

How does: OpenMPI_compat="4.1.6, 5" work? Do we not need to build against OpenMPI v4 and OpenMPI v5 separately?

Copy link
Member

@giordano giordano Aug 15, 2024

Choose a reason for hiding this comment

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

the compat forces the lower version as build version, for OpenMPI we don't need separate builds because the two major versions are ABI-compatible, we just have more platforms available with OpenMPI v4

# MPItrampoline
platforms = filter(p -> !(p["mpi"] == "mpitrampoline" && libc(p) == "musl"), platforms)
platforms = filter(p -> !(p["mpi"] == "mpitrampoline" && Sys.isfreebsd(p)), platforms)

platforms = filter(p -> !(Sys.isfreebsd(p) || libc(p) == "musl"), platforms)

platforms = expand_cxxstring_abis(platforms)
platforms = expand_gfortran_versions(platforms) # ABI dependent due to MPI
vchuravy marked this conversation as resolved.
Show resolved Hide resolved
vchuravy marked this conversation as resolved.
Show resolved Hide resolved

# The products that we will ensure are always built
products = [
LibraryProduct("liblammps", :liblammps),
Expand Down
2 changes: 1 addition & 1 deletion platforms/mpi.jl
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ function augment_platforms(platforms;
end
# NOTE: packages using this platform tag, must depend on MPIPreferences otherwise
# they will not be invalidated when the Preference changes.
push!(dependencies, Dependency(PackageSpec(name="MPIPreferences", uuid="3da0fdf6-3ccc-4f1b-acd9-58baa6c99267"); compat="0.1", top_level=true))
push!(dependencies, RuntimeDependency(PackageSpec(name="MPIPreferences", uuid="3da0fdf6-3ccc-4f1b-acd9-58baa6c99267"); compat="0.1", top_level=true))
return all_platforms, dependencies
end

Expand Down