[petsc-dev] PETSc optimization

Liu Wei AWE Wei.Liu at awe.co.uk
Tue Aug 8 11:35:13 CDT 2023


Hi all

I am currently building a large software stack using Spack with PETSc 3.19 as part of the dependency library.

Spotted the following message during the build process

Using default optimization C flags "-g -O". You might consider manually setting optimal optimization flags for your system with
COPTFLAGS="optimization flags" see config/examples/arch-*-opt.py for examples

Previously when we install PETSc manually, optimisation flags are enforced via configure script e.g.
COPTFLAGS="-g -O3 -march=native"
CXXOPTFLAGS="-g -O3 -march=native"
...
(or "-g -O3 -xhost" for intel compiler)

Whilst spack spec syntax allows compiler parameters via cflags/cxxflags/fflags
https://github.com/spack/spack/blob/develop/var/spack/repos/builtin/packages/petsc/package.py<https://github.com/spack/spack/blob/develop/var/spack/repos/builtin/packages/petsc/package.py#L400>
the requirement is not obvious, especially in a long build process.

The question is should optimisation be amended at spack recipe stage or should PETSc configure enforce some compiler optimisation (if -with-debugging=0 is set) ?

Regards

Dr Wei Liu
High Performance Computing
To chat with me on Teams click here<https://teams.microsoft.com/l/chat/0/0?users=wei.liu@awe.co.uk>
T: +44 01189 856209
M: wei.liu at awe.co.uk<mailto:wei.liu at awe.co.uk>
AWE Aldermaston,
Reading, Berkshire, RG7 4PR

The information in this email and in any attachment(s) is commercial in confidence. If you are not the named addressee(s) or if you receive this email in error then any distribution, copying or use of this communication or the information in it is strictly prohibited. Please notify us immediately by email at admin.internet(at)awe.co.uk, and then delete this message from your computer. While attachments are virus checked, AWE plc does not accept any liability in respect of any virus which is not detected. AWE Plc Registered in England and Wales Registration No 02763902 AWE, Aldermaston, Reading, RG7 4PR
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20230808/ead2efa5/attachment.html>


More information about the petsc-dev mailing list