Skip to content

{numlib}[foss/2023b] PETSc v3.21.2#20568

Closed
tanmoy1989 wants to merge 3 commits intoeasybuilders:developfrom
tanmoy1989:20240521141617_new_pr_PETSc3210
Closed

{numlib}[foss/2023b] PETSc v3.21.2#20568
tanmoy1989 wants to merge 3 commits intoeasybuilders:developfrom
tanmoy1989:20240521141617_new_pr_PETSc3210

Conversation

@tanmoy1989
Copy link
Copy Markdown
Contributor

@tanmoy1989 tanmoy1989 commented May 21, 2024

@zao
Copy link
Copy Markdown
Contributor

zao commented Jun 28, 2024

Test report by @zao
FAILED
Build succeeded for 0 out of 1 (1 easyconfigs in total)
eb-mix.zao.se - Linux Ubuntu 24.04 LTS (Noble Numbat), x86_64, AMD Ryzen 9 3900X 12-Core Processor (zen2), Python 3.12.3
See https://gist.github.com/zao/ef2263f51092705f33bc53cc11dcb383 for a full test report.

@zao
Copy link
Copy Markdown
Contributor

zao commented Jun 28, 2024

configure.log gist suggests it's having problems finding SuiteSparse headers directly in the include directory, on my system they ended up in $EBROOTSUITESPARSE/include/suitesparse.

@tanmoy1989
Copy link
Copy Markdown
Contributor Author

@zao: Thanks for checking it. What do you suggest now which part needs to be changed in the EasyConfig file?

@zao
Copy link
Copy Markdown
Contributor

zao commented Jul 2, 2024

The command lines to the build system are constructed in the easyblock for PETSc, which may need adjustment to also consider the inner directory, see:
https://github.com/easybuilders/easybuild-easyblocks/blob/7a9782e6cf776b79adb63d4e18d04e0a25ad1349/easybuild/easyblocks/p/petsc.py#L264-L265

@tanmoy1989
Copy link
Copy Markdown
Contributor Author

hi @zao: I have built PETSc on one of our HPCs by modifying the following line (line #264):
suitesparse_inc = os.path.join(suitesparse, "include", "suitesparse")
originally it was suitesparse_inc = os.path.join(suitesparse, "include")
That seems to be working for me. How would I make changes to petsc.py so that you can run the test successfully?

@zao
Copy link
Copy Markdown
Contributor

zao commented Jul 8, 2024

Mechanically, you would make a copy of the petsc.py easyblock, alter the logic to do what you want, and make a PR to the easybuild-easyblocks repository.
You can point out additional custom easyblock locations with something like --include-easyblocks="/path/to/blocks/*.py" or a similar entry in easybuild.cfg under [config].

On modifying easyblocks, it's very important to realize that an easyblock is used for all versions of a software and not just the one you're currently thinking about. This means that any logic changes you make have to still be valid for older versions of the software.
You can do this either by making it more general so that it works in both the old and new way, or have the logic branch on the version of the software or some other aspect of the configuration to do either one or the other thing.
This is particularly important as we haven't figured out SuiteSparse suddenly seems to emit files into a subdirectory; if it's version-specific or environment-specific. The safe solution is to consider both flavours of include directory loactions.

As I shared on Slack, my proposed hack for this would be to emit both the possible directories (.../include and .../include/suitesparse) in the search path, as the PETSc build will look in each until it finds what it wants:

--- /eb/develop/easybuild-easyblocks/easybuild/easyblocks/p/petsc.py    2024-04-09 17:25:49.442891855 +0200
+++ /eb/custom/easyblocks/petsc.py      2024-07-02 13:53:49.271577563 +0200
@@ -262,7 +262,9 @@
                         ss_libs = [x if x != "SLIP_LU" else "SPEX" for x in ss_libs]

                     suitesparse_inc = os.path.join(suitesparse, "include")
-                    inc_spec = "-include=[%s]" % suitesparse_inc
+                    # SuiteSparse can install its headers into a subdirectory of the include directory instead.
+                    suitesparse_incs = [suitesparse_inc, os.path.join(suitesparse_inc, 'suitesparse')]
+                    inc_spec = "-include=[%s]" % ','.join(suitesparse_incs)

                     suitesparse_libs = [os.path.join(suitesparse, "lib", "lib%s.so" % x.replace("_", "").lower())
                                         for x in ss_libs]

Once you have an easyblock PR submitted, you can say --include-easyblocks-from-pr=NNNN to use that PR as the easyblock. It also helps to then mention that the easyblock PR is needed in the description of this easyconfig PR (much like how you'd mention easyconfig PRs for dependencies) so that testers can consider it.

@tanmoy1989
Copy link
Copy Markdown
Contributor Author

@zao Many thanks for helping me out on this. I have considered your suggestions especially edited the comment section of this PR and incorporated the information that it needs the modified petsc.py from this PR.

@zao
Copy link
Copy Markdown
Contributor

zao commented Jul 16, 2024

Test report by @zao
Using easyblocks from PR(s) easybuilders/easybuild-easyblocks#3391
FAILED
Build succeeded for 0 out of 1 (1 easyconfigs in total)
eb-mix.zao.se - Linux Rocky Linux 9.4 (Blue Onyx), x86_64, AMD Ryzen 9 3900X 12-Core Processor (zen2), Python 3.9.18
See https://gist.github.com/zao/ef5fbe6ba5908b9dc8ab7dde92f1fddd for a full test report.

@zao
Copy link
Copy Markdown
Contributor

zao commented Jul 18, 2024

See the above test report for another problem - with a revised easyblock to address suitesparse include the build now complains about not being able to link -lpetsc later on in the build process.

@boegel
Copy link
Copy Markdown
Member

boegel commented Aug 28, 2024

@boegelbot please test @ generoso
EB_ARGS="--include-easyblocks-from-pr 3391 --installpath /tmp/$USER/pr20568"
CORE_CNT=16

@boegelbot
Copy link
Copy Markdown
Collaborator

@boegel: Request for testing this PR well received on login1

PR test command 'EB_PR=20568 EB_ARGS="--include-easyblocks-from-pr 3391 --installpath /tmp/$USER/pr20568" EB_CONTAINER= EB_REPO=easybuild-easyconfigs /opt/software/slurm/bin/sbatch --job-name test_PR_20568 --ntasks="16" ~/boegelbot/eb_from_pr_upload_generoso.sh' executed!

  • exit code: 0
  • output:
Submitted batch job 14152

Test results coming soon (I hope)...

Details

- notification for comment with ID 2316019261 processed

Message to humans: this is just bookkeeping information for me,
it is of no use to you (unless you think I have a bug, which I don't).

@boegelbot
Copy link
Copy Markdown
Collaborator

Test report by @boegelbot
Using easyblocks from PR(s) easybuilders/easybuild-easyblocks#3391
FAILED
Build succeeded for 0 out of 1 (1 easyconfigs in total)
cnx1 - Linux Rocky Linux 8.9, x86_64, Intel(R) Xeon(R) CPU E5-2667 v3 @ 3.20GHz (haswell), Python 3.6.8
See https://gist.github.com/boegelbot/344c359ff8387f971d8a7bf423fe16f7 for a full test report.

@boegel boegel added the update label Aug 28, 2024
@boegel boegel modified the milestones: 4.9.2, 4.x Aug 28, 2024
@boegel
Copy link
Copy Markdown
Member

boegel commented Aug 28, 2024

@tanmoy1989 As @zao already pointed out, there's another fix required to make this installation work, it seems:

It currently fails with:

cannot find -lpetsc: No such file or directory

Is that not the case for your local installation as well?

@tanmoy1989
Copy link
Copy Markdown
Contributor Author

tanmoy1989 commented Sep 4, 2024

@boegel Ah yes, I got that error now; PETSc/3.21.0 wouldn't build against foss/2023b. Not sure why I didn't see this before - maybe I was using a different version of PETSc? I can see I have deployed globally PETSc/3.21.2 built against foss/2023b. Any suggestions how to proceed?

@boegel
Copy link
Copy Markdown
Member

boegel commented Sep 4, 2024

@boegel Ah yes, I got that error now; PETSc/3.21.0 wouldn't build against foss/2023b. Not sure why I didn't see this before - maybe I was using a different version of PETSc? I can see I have deployed globally PETSc/3.21.2 built against foss/2023b. Any suggestions how to proceed?

It makes sense to me to update this PR to use PETSc 3.21.2 instead (or to close this one, and open a new PR)

@tanmoy1989 tanmoy1989 changed the title {numlib}[foss/2023b] PETSc v3.21.0 {numlib}[foss/2023b] PETSc v3.21.2 Sep 4, 2024
@tanmoy1989
Copy link
Copy Markdown
Contributor Author

@boegel I have update the PR with PETSc/3.21.2 and changed the title too to reflect the change in the easyconfig. Thanks for the suggestion.

@tanmoy1989
Copy link
Copy Markdown
Contributor Author

@boegel Any updates on this, please?

@Flamefire
Copy link
Copy Markdown
Contributor

The 3.21.0 version needs to be removed from this PR. You got 2 ECs here now

The old EC needs to be removed as there is a newer one
@github-actions
Copy link
Copy Markdown

Updated software PETSc-3.21.2-foss-2023b.eb

Diff against PETSc-3.20.3-foss-2023a.eb

easybuild/easyconfigs/p/PETSc/PETSc-3.20.3-foss-2023a.eb

diff --git a/easybuild/easyconfigs/p/PETSc/PETSc-3.20.3-foss-2023a.eb b/easybuild/easyconfigs/p/PETSc/PETSc-3.21.2-foss-2023b.eb
index 7c4db8a364..25512a25cf 100644
--- a/easybuild/easyconfigs/p/PETSc/PETSc-3.20.3-foss-2023a.eb
+++ b/easybuild/easyconfigs/p/PETSc/PETSc-3.21.2-foss-2023b.eb
@@ -3,35 +3,35 @@
 # Author:    Jasper Grimm (UoY)
 ##
 name = 'PETSc'
-version = '3.20.3'
+version = '3.21.2'
 
 homepage = 'https://www.mcs.anl.gov/petsc'
 description = """PETSc, pronounced PET-see (the S is silent), is a suite of data structures and routines for the
  scalable (parallel) solution of scientific applications modeled by partial differential equations."""
 
-toolchain = {'name': 'foss', 'version': '2023a'}
+toolchain = {'name': 'foss', 'version': '2023b'}
 toolchainopts = {'openmp': True, 'usempi': True, 'pic': True}
 
 source_urls = [
     'https://web.cels.anl.gov/projects/petsc/download/release-snapshots',
 ]
 sources = [SOURCELOWER_TAR_GZ]
-checksums = ['75a94fb44df0512f51ad093fa784e56b61f51b7ead5956fbe49185c203f8c245']
+checksums = ['a1ac62b6204bdf2f7f9b637abf45e6cff24d372d4d3d3702c50e157bdb56eb21']
 
-builddependencies = [('CMake', '3.26.3')]
+builddependencies = [('CMake', '3.27.6')]
 
 dependencies = [
-    ('Python', '3.11.3'),
-    ('SciPy-bundle', '2023.07'),
-    ('Boost', '1.82.0'),
+    ('Python', '3.11.5'),
+    ('SciPy-bundle', '2023.11'),
+    ('Boost', '1.83.0'),
     ('METIS', '5.1.0'),
-    ('SCOTCH', '7.0.3'),
+    ('SCOTCH', '7.0.4'),
     ('MUMPS', '5.6.1', '-metis'),
-    ('SuiteSparse', '7.1.0'),
-    ('Hypre', '2.29.0'),
+    ('SuiteSparse', '7.7.0', '-METIS-5.1.0'),
+    ('Hypre', '2.31.0'),
     ('ParMETIS', '4.0.3'),
-    ('SuperLU_DIST', '8.1.2'),
-    ('mpi4py', '3.1.4'),
+    ('SuperLU_DIST', '8.2.1'),
+    ('mpi4py', '3.1.5'),
 ]
 
 configopts = '--LIBS="$LIBS -lrt" --with-mpi4py=0 '
Diff against PETSc-3.19.2-foss-2022b.eb

easybuild/easyconfigs/p/PETSc/PETSc-3.19.2-foss-2022b.eb

diff --git a/easybuild/easyconfigs/p/PETSc/PETSc-3.19.2-foss-2022b.eb b/easybuild/easyconfigs/p/PETSc/PETSc-3.21.2-foss-2023b.eb
index 1a49fec088..25512a25cf 100644
--- a/easybuild/easyconfigs/p/PETSc/PETSc-3.19.2-foss-2022b.eb
+++ b/easybuild/easyconfigs/p/PETSc/PETSc-3.21.2-foss-2023b.eb
@@ -3,36 +3,35 @@
 # Author:    Jasper Grimm (UoY)
 ##
 name = 'PETSc'
-version = '3.19.2'
+version = '3.21.2'
 
 homepage = 'https://www.mcs.anl.gov/petsc'
 description = """PETSc, pronounced PET-see (the S is silent), is a suite of data structures and routines for the
  scalable (parallel) solution of scientific applications modeled by partial differential equations."""
 
-toolchain = {'name': 'foss', 'version': '2022b'}
+toolchain = {'name': 'foss', 'version': '2023b'}
 toolchainopts = {'openmp': True, 'usempi': True, 'pic': True}
 
 source_urls = [
-    'https://ftp.mcs.anl.gov/pub/petsc/release-snapshots/',
-    'ftp://ftp.mcs.anl.gov/pub/petsc/release-snapshots/',
+    'https://web.cels.anl.gov/projects/petsc/download/release-snapshots',
 ]
 sources = [SOURCELOWER_TAR_GZ]
-checksums = ['114f363f779bb16839b25c0e70f8b0ae0d947d50e72f7c6cddcb11b001079b16']
+checksums = ['a1ac62b6204bdf2f7f9b637abf45e6cff24d372d4d3d3702c50e157bdb56eb21']
 
-builddependencies = [('CMake', '3.24.3')]
+builddependencies = [('CMake', '3.27.6')]
 
 dependencies = [
-    ('Python', '3.10.8'),
-    ('SciPy-bundle', '2023.02'),
-    ('Boost', '1.81.0'),
+    ('Python', '3.11.5'),
+    ('SciPy-bundle', '2023.11'),
+    ('Boost', '1.83.0'),
     ('METIS', '5.1.0'),
-    ('SCOTCH', '7.0.3'),
+    ('SCOTCH', '7.0.4'),
     ('MUMPS', '5.6.1', '-metis'),
-    ('SuiteSparse', '5.13.0', '-METIS-5.1.0'),
-    ('Hypre', '2.27.0'),
+    ('SuiteSparse', '7.7.0', '-METIS-5.1.0'),
+    ('Hypre', '2.31.0'),
     ('ParMETIS', '4.0.3'),
-    ('SuperLU_DIST', '8.1.2'),
-    ('mpi4py', '3.1.4'),
+    ('SuperLU_DIST', '8.2.1'),
+    ('mpi4py', '3.1.5'),
 ]
 
 configopts = '--LIBS="$LIBS -lrt" --with-mpi4py=0 '
Diff against PETSc-3.18.4-intel-2021b.eb

easybuild/easyconfigs/p/PETSc/PETSc-3.18.4-intel-2021b.eb

diff --git a/easybuild/easyconfigs/p/PETSc/PETSc-3.18.4-intel-2021b.eb b/easybuild/easyconfigs/p/PETSc/PETSc-3.21.2-foss-2023b.eb
index 37ddfc1c7f..25512a25cf 100644
--- a/easybuild/easyconfigs/p/PETSc/PETSc-3.18.4-intel-2021b.eb
+++ b/easybuild/easyconfigs/p/PETSc/PETSc-3.21.2-foss-2023b.eb
@@ -1,41 +1,39 @@
+##
+# Author:    Robert Mijakovic <robert.mijakovic@lxp.lu>
+# Author:    Jasper Grimm (UoY)
+##
 name = 'PETSc'
-version = '3.18.4'
+version = '3.21.2'
 
 homepage = 'https://www.mcs.anl.gov/petsc'
 description = """PETSc, pronounced PET-see (the S is silent), is a suite of data structures and routines for the
  scalable (parallel) solution of scientific applications modeled by partial differential equations."""
 
-toolchain = {'name': 'intel', 'version': '2021b'}
+toolchain = {'name': 'foss', 'version': '2023b'}
 toolchainopts = {'openmp': True, 'usempi': True, 'pic': True}
 
 source_urls = [
-    'https://ftp.mcs.anl.gov/pub/petsc/release-snapshots/',
-    'ftp://ftp.mcs.anl.gov/pub/petsc/release-snapshots/',
+    'https://web.cels.anl.gov/projects/petsc/download/release-snapshots',
 ]
 sources = [SOURCELOWER_TAR_GZ]
-patches = [
-    'PETSc_ranlib-fix.patch',
-]
-checksums = [
-    {'petsc-3.18.4.tar.gz': '6173d30637261c5b740c0bea14747759200ca2012c7343139f9216bc296a6394'},
-    {'PETSc_ranlib-fix.patch': '64cf9d5008d5e92117e65bdec5316d991b6a6b8c8ecf7ea46eb790a498266297'},
-]
+checksums = ['a1ac62b6204bdf2f7f9b637abf45e6cff24d372d4d3d3702c50e157bdb56eb21']
 
-builddependencies = [('CMake', '3.22.1')]
+builddependencies = [('CMake', '3.27.6')]
 
 dependencies = [
-    ('Python', '3.9.6'),
-    ('SciPy-bundle', '2021.10'),
-    ('Boost', '1.77.0'),
+    ('Python', '3.11.5'),
+    ('SciPy-bundle', '2023.11'),
+    ('Boost', '1.83.0'),
     ('METIS', '5.1.0'),
-    ('SCOTCH', '6.1.2'),
-    ('MUMPS', '5.4.1', '-metis'),
-    ('SuiteSparse', '5.10.1', '-METIS-5.1.0'),
-    ('Hypre', '2.24.0'),
+    ('SCOTCH', '7.0.4'),
+    ('MUMPS', '5.6.1', '-metis'),
+    ('SuiteSparse', '7.7.0', '-METIS-5.1.0'),
+    ('Hypre', '2.31.0'),
+    ('ParMETIS', '4.0.3'),
+    ('SuperLU_DIST', '8.2.1'),
+    ('mpi4py', '3.1.5'),
 ]
 
-# enabling --with-mpi4py seems to be totally broken, leads to make errors like:
-# No rule to make target 'mpi4py-build'
 configopts = '--LIBS="$LIBS -lrt" --with-mpi4py=0 '
 
 shared_libs = 1

@Flamefire
Copy link
Copy Markdown
Contributor

I think I got the test issue sorted:
It is a known bug in 3.21.x which is fixed in 3.22.x so we could use that as a patch which seems to work (test running for >10min while they failed in 1min before)

However I think we should use #22084 for 2023b. 3.20.3 is the last release of 2023 to stay with the toolchain year. 3.21.2 is already from 29th May 2024.
Additionally that PR contains a few other useful easyconfigs. @tanmoy1989 wants to use PETsc for DOLFINx (Slack discussion). I'll run a test over the weekend if that would work with the versions in that other PR

@boegel
Copy link
Copy Markdown
Member

boegel commented Apr 5, 2025

I'm strongly in favor of going forward with PETSc 3.22.x, see #22696

Sorry for not staying on top of this @tanmoy1989, the effort on getting EasyBuild 5.0 out the door has definitely impacted this PR...

@laraPPr
Copy link
Copy Markdown
Contributor

laraPPr commented Jun 16, 2025

Closing this pr since PETSc-3.22.5-foss-2023b is now included in easyBuild.
Thanks for the effort @tanmoy1989.

@laraPPr laraPPr closed this Jun 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants