Is it possible to specify an extra command for instrumenting a newly-built UM executable?
I would like to use the CrayPat software available on the ARCHER2 machine to profile the UM code
and so would need to run "pat_build um-atmos.exe " in order to create an instrumented file called
“um-atmos.exe+pat”.
Is there some setting within “./u-ch330-EPCC/site/archer2.rc” that could handle this?
Also, how would I ensure that the instrumented executable, “um-atmos.exe+pat”, is run instead of
“um-atmos.exe”? Is this just a case of editing the “rose-app.conf” file.
You can export variables, put multiple commands into the post-script, or even put a wrapper script with everything you need in your suite’s bin directory if this is easier. There are loads of ways to bodge things…
If I ever do this kind of thing, I usually run it once to set everything up, then edit and submit job files myself rather than with ‘cylc restart’ etc - that might help??
[[fcm_make2_um]]
inherit = UMBUILD, UMBUILD_RESOURCE
post-script = """
cd $CYLC_SUITE_SHARE_DIR/fcm_make_um/build-atmos/bin
pat_build -O apa um-atmos.exe
"""
but pat_build failed, saying ERROR: Program '/mnt/lustre/a2fs-work2/work/n02/n02/grenvill/cylc-run/u-cn134-RS-2level/share/fcm_make_um/build-atmos/bin/um-atmos.exe' is already instrumented with PerfTools
in
$CYLC_SUITE_SHARE_DIR/fcm_make_um/build-atmos/bin
-rwxr-xr-x 1 grenvill n02 127529040 Nov 2 08:03 um-atmos.exe+orig
-rwxr-xr-x 1 grenvill n02 128517200 Nov 2 08:03 um-atmos.exe
Running ‘pat_build’ isn’t required when you use perftools-lite - that step is done automatically (hence the appearance of the ‘um-atmos.exe+orig’ file). All you need is the ‘module load perftools-lite’ command.
What I’m trying to do is use the full-fat perftools module which does require ‘pat-build’.
I’ve tried some changes to ‘suite.rc’, which haven’t worked, but looking at your example, I now understand to use “”" delimiters and $CYLC_SUITE_SHARE_DIR.
I can’t get CrayPat to work with the u-ch330-EPCC suite.
fcm_make_um succeeds (does that stage just do the code checkout?), but
fcm_make2_um fails with the following error.
ERROR: Missing required ELF section ‘.note.link’ from the program ‘/mnt/lustre/a2fs-work2/work/n02/n02/mrbn02/cylc-run/u-ch330-EPCC/share/fcm_make_um/build-atmos/bin/um-atmos.exe’. Load the correct ‘perftools’ module and rebuild the program.
2022-11-03T10:51:24Z CRITICAL - failed/EXIT
Looks like this error could be coming from the pat_build command and is caused by the the perftools
module not being loaded during the compile.
Grenville, my module setup is different to your u-cn134-RS-2level suite.
For the HPC task (./site/archer2.rc) I have,
That module list appears in the fcm_make2_um “job.out” file.
It doesn’t look like I have perftools (or any modules) loaded for the fcm_make_um task - is that a problem?
I’m not sure which config file is missing, but looking into ‘um-atmos-high.cfg’ it could be
‘um-atmos-common.cfg’, which in any case exists at ‘/home/mbareford/vn11.6_archer2_compile/fcm-make/inc/um-atmos-common.cfg’
[FAIL] localhost:/home/mbareford/vn11.6_archer2_compile/fcm-make/ncas-ex-cce/um-atmos-high.cfg: cannot be read
[FAIL] Host key verification failed.^M
so I’m guessing it’s because you have added localhhost (I’ve never added that to the config filename) - try just /home/mbareford/vn11.6_archer2_compile for config_root_path
This comes from the fcm_make2_um task and it might originate from the pat_build command:
the executable has been created (“./cylc-run/u-ch330-EPCC/share/fcm_make_um/build-atmos/bin/um-atmos.exe”).
I didn’t know there was a um-atmos library - sure enough, it doesn’t exist anywhere within “/work/n02/n02/mrbn02”.