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

petsc: update to use hdf5-mpi #167477

Merged
merged 2 commits into from
Mar 30, 2024
Merged

petsc: update to use hdf5-mpi #167477

merged 2 commits into from
Mar 30, 2024

Conversation

abhinavsns
Copy link
Contributor

Please see discussion on previous PR: #165097

petsc primarily depends on openmpi so should use hdf5-mpi, netcdf is an unneccesary dependency that depends on hdf5.
@chenrui333
Copy link
Member

@abhinavsns thanks for breaking down, any docs links for this?

Petsc in general relies on openMPI, any other library is likely to use petsc and hdf5-mpi together.

@abhinavsns
Copy link
Contributor Author

Yes. Please checkout the following issues where it is suggested to use hdf5-mpi:
https://groups.google.com/g/dealii/c/haqbBqbnZeg
https://lists.mcs.anl.gov/pipermail/petsc-users/2018-February/034382.html
https://fenicsproject.org/qa/9552/hdf5-error-when-building-dolfin/

We also maintain an open-source library (openFPM) and the issue is the same. (http://openfpm.mpi-cbg.de/building/)

Only reason I can think of to not go for this change would mean the user probably does not care about parallel read/write and possibly does not care about MPI as well. In that case, maybe one can add additional formula where petsc is compiled without MPI and then serial hdf5 could be used with netcdf. Or going for the other way round, like introducing petsc-mpi, petsc-complex-mpi.

@chenrui333
Copy link
Member

@abhinavsns make sense, thanks for the references!!

@chenrui333
Copy link
Member

@abhinavsns thanks for your first contribution to homebrew-core! 🎉

Copy link
Contributor

🤖 An automated task has requested bottles to be published to this PR.

@github-actions github-actions bot added the CI-published-bottle-commits The commits for the built bottles have been pushed to the PR branch. label Mar 30, 2024
@BrewTestBot BrewTestBot added this pull request to the merge queue Mar 30, 2024
Merged via the queue into Homebrew:master with commit e00d039 Mar 30, 2024
14 checks passed
@BrushXue
Copy link
Contributor

BrushXue commented Apr 1, 2024

@chenrui333 Now the upgrade fails because of a conflict. I can't have netcdf and petsc at the same time!

~ brew upgrade
==> Upgrading 1 outdated package:
petsc 3.20.5 -> 3.20.5_1
==> Downloading https://ghcr.io/v2/homebrew/core/petsc/manifests/3.20.5_1
==> Fetching dependencies for petsc: hdf5-mpi
==> Downloading https://ghcr.io/v2/homebrew/core/hdf5-mpi/manifests/1.14.3
==> Fetching hdf5-mpi
==> Downloading https://ghcr.io/v2/homebrew/core/hdf5-mpi/blobs/sha256:edaecb37c
==> Fetching petsc
==> Downloading https://ghcr.io/v2/homebrew/core/petsc/blobs/sha256:b1faad1c3141
==> Upgrading petsc
  3.20.5 -> 3.20.5_1
==> Installing dependencies for petsc: hdf5-mpi
==> Installing petsc dependency: hdf5-mpi
Error: Cannot install hdf5-mpi because conflicting formulae are installed.
  hdf5: because hdf5-mpi is a variant of hdf5, one can only use one or the other

Please `brew unlink hdf5` before continuing.

Unlinking removes a formula's symlinks from /opt/homebrew. You can
link the formula again after the install finishes. You can `--force` this
install, but the build may fail or cause obscure side effects in the
resulting software.

@BrushXue
Copy link
Contributor

BrushXue commented Apr 1, 2024

I think this change should be reverted. A lot of packages are using hdf5. You have to change everything, or please find a way to make hdf5 and hdf5-mpi coexist.

@abhinavsns
Copy link
Contributor Author

I agree with @BrushXue. The following packages have hdf5 as dependency and now will conflict with petsc.
Another idea could be to update hdf5 to use open-mpi and remove hdf5-mpi? This will install the parallel version as default and should not have a problem for single core applications. Currently hdf5-mpi is not used in any package and hence can be removed?
I will create another PR for hdf5 just in case we decide to go this route.

brew uses hdf5 --eval-all

  1. alembic
  2. caffe
  3. cgns
  4. field3d
  5. itk
  6. netcdf
  7. octave
  8. sratoolkit
  9. alpscore
  10. cdi
  11. csound
  12. flann
  13. kallisto
  14. netcdf-cxx
  15. openmodelica
  16. vtk
  17. armadillo
  18. cdo
  19. dynare
  20. gdal
  21. libmatio
  22. netcdf-fortran
  23. pdal

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI-published-bottle-commits The commits for the built bottles have been pushed to the PR branch.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants