NCI has 256 core licenses for linaro-forge ddt and map tools - would that be sufficient for your needs? (Performance-report goes up to 2048 cores but only provides aggregate data, and not source-level info.)
I have used linaro-forge map for profiling ESM1.6 - fairly straightforward to setup through payu. Happy to assist if you would like.
Once your run finishes, you can examine the generated profile (file extension .map) with the same map command, but without the --profile flag - i.e., map <path/to/mapfilename.map>. The mapfilename itself contains the executable name, the number of PBS nodes, OMP threads and the date-time string - so should be unique everytime you run the profiler.
Clone the desired model repository, and add fflags='-O0 -g -traceback cflags='-O0 -g -fno-omit-frame-pointer (I know those fflags work, haven’t actually tried the cflags yet so @Manodeep may correct me?) to the model specs.
Call spack concretize -f then spack install --keep-stage- the keep-stage is necessary to prevent Spack from cleaning up the source code used to compile the executable.
At this point, you should be able to use the NCI instructions for using Linaro DDT.
@lachlanswhyborn I would recommend using the flags that you are planning to use for production runs - otherwise, the generated instructions can be dramatically different and the insights from profiling (with an un-optimised build) may not be applicable to your production exe.
The instructions look spot-on - you certainly would want to use --keep-stage to keep the pre-processed source files and point the profiler to the relevant source directory. It is good to add the -fno-omit-frame-pointer - I have not noticed any performance hits but seems to improve symbol resolution and pinpointing runtime exes into the source line of code.
This is for debugging rather than profiling- for profiling, yes I’d certainly use the same flags as used in production. I tried debugging with optimisation flags on and the debugger often seemed to get confused as to where the program was up to, relative to the source code.
Just an update. I have the DDT debugger and connected to a UM task. In this case, an ACCESS-AM3 suite.
At NCI’s suggestion, I have downloaded a Linaro Forge client which I run from my local laptop (Mac in my case).
When you launch the Linaro client, activate the “Remote Launch” Configure pull down menu and create a session for gadi. I specified the following:
connection name : gadi
Host Name : <user-id>@gadi.nci.org.au
Remote Installation Directory : /apps/linaro-forge/24.0.2/
You can then click ‘Test Remove Launch’ to check this works correctly.
Then activate your ‘gadi’ Remote Launch, and you will have a pop-up menu which states something like
”A new Reverse Connect request is available from gadi-hmem-clx-XXXX.gadi.nci.org.au for Linaro DDT.”
Click accept, and then run.
Now you’re debugging the UM inside your rose-cycle suite!
@manodeep - following on from our discussion at RSE meeting on Oct 24, the default compile flags used within the ACCESS-AM3 suite are provided in the file
@Paul.Gregory Just came by this topic again and realised I hadn’t quite answered your compiler flags question. Regardless of which compiler (classic/oneAPI) suite you use, you would want to include a architecture flag. For example, if you are building with spack and running on gadi, you would want to set a generic target = x86_64_v4 for an exe that would run on both normal and normalsr queues. If you want to be specifically using the normalsr queue, then you can set the target to sapphirerapids. Additionally, in your spack.yaml file, you would also need to set the concretizer target granularity to microarchitectures, i.e., concretizer->targets->granularity: microarchitectures (instead of generic)
There are quite a few compiler flags that could be performance boosting but you would need to test those. Some such flags for the oneAPI Fortran compiler could be:
-qopt-zmm-usage=high (which forces using the 512bit vector registers),
-vec-threshold0 (which is related to the zmm flag above, and forces the compiler to vectorise every vectorisable loop, regardless of the compute cost)
-unroll (unrolls the loops using compiler heuristics),
-flto (for link-time optimisation, needs all compile-time flags to be repeated at link-time and-fuse-ld=lld specifically for link-time flags. Note, this will reduce compile times but can dramatically increase run-time link-time)
The first three options might change answers, the last two should not (but may). If you have many expensive math library calls, then using Intel MKL could also be another option to try.
There’s also profile-generate and profile-use, but that’s probably when the code is in a stable state.
Might be worth trying -xsapphirerapids instead of -march=sapphirerapids(noting that that exe may not run on the normal queue, or any AMD cpus). The -x<arch> flag seems to enable some extra Intel-specific optimisations and I have seen few % performance boosts relative to the -march=<arch> flag.