Skip to content

Explore transmute further with aerosol_ukca_kernel_mod conv_comorph_kernel_mod #657

Open

Description

Are there any linked Issues or Pull Requests?

Umbrella: #424
PR: #691

Brief description

#607 has run into issues compiling aerosol_ukca_kernel_mod and conv_comorph_kernel_mod after they have been Transmuted with CCE.

After discussing possible causes with STFC, we think the best course is to:

  • Explore MaximalOMPParallelRegionTrans to reduce parallel sections - main...MetBenjaminWent:lfric_apps:aero_ukca_conv_como_explore
  • See if GCC is affected - Not thought so currently!
  • Reduce optimisation with CCE: Lower -h ipalevel to 0 or increase -m msg_level to 4
  • See if Transmuted, but no optmisation, fails

Further details of the issue.

No response

Activity

  1. MetBenjaminWent commented on Jul 23, 2026

    @MetBenjaminWent
    ContributorAuthor

    Recommendation from Aidan:
    I think also its worth compiling the file with PSyclone with no (or an empty) optimisation script, just to sanity check that the cause is indeed OpenMP or optimisation related and not related to if/elseif vs case. If we absolutely had to I think there is a reasonable way for us to regenerate case statements as an option somewhere (though our preference is to avoid doing it wherever possible)

  2. MetBenjaminWent commented on Jul 27, 2026

    @MetBenjaminWent
    ContributorAuthor

    Branch exploring using PSyclone to move the default case logging Call outside into a new loop, but still flip a boolean inside the else default case to then use the new if block as needed.
    main...MetBenjaminWent:lfric_apps:aero_ukca_conv_como_explore

  3. MetBenjaminWent commented on Jul 28, 2026

    @MetBenjaminWent
    ContributorAuthor

    -hipa0 for conv_comorph_kernel_mod with the local script (so lots of parallel sections), has not worked.

    Adding -hmsgs to aerosol_ukca_kernel_mod as well as -hipa0, and also trying override script which adds fewer parallel sections

  4. MetBenjaminWent commented on Jul 28, 2026

    @MetBenjaminWent
    ContributorAuthor

    https://cylchub/services/cylc-review/taskjobs?user=benjamin.went&suite=aero_ukca_conv_como_explore%2Frun6&no_fuzzy_time=0&cycles=&tasks=&task_status=waiting&task_status=expired&task_status=preparing&task_status=submit-failed&task_status=submitted&task_status=running&task_status=failed&job_status=&order=time_desc&per_page=300

    So with aerosol_ukca_kernel_mod -hipa0 -hmsgs with reduced OMP sections with a script, it builds but fails KGO.

    I'll try a pass build and see what happens - KGO change isn't entirely out of the question, we have reduced optimisation in 2x files in some way.
    However likely the missing tracer step has gone a bit weird (even if it shouldn't affect KGO)

  5. MetBenjaminWent commented on Jul 28, 2026

    @MetBenjaminWent
    ContributorAuthor

    Note similar sounding issues with the following in the UM:
    # cce 8.7.x-16.0.0: Decrease optimisation and disable OpenMP to dramatically improve build times.
    build-atmos.prop{fc.flags}[um/src/atmosphere/convection/comorph/interface/um/comorph_interface_um.F90] = $fcflags_common -O0 -Ovector0 -hfp0 -hflex_mp=strict -G1 -hipa0 -h noomp $fcflags_drhook $fcflags_overrides

  6. MetBenjaminWent commented on Jul 28, 2026

    @MetBenjaminWent
    ContributorAuthor

    Just the first loop, with a force private of case_default_used, and only over i or j loops, it passes KGO.
    https://cylchub/services/cylc-review/taskjobs?user=benjamin.went&suite=aero_ukca_conv_como_explore%2Frun7&no_fuzzy_time=0&cycles=&tasks=&task_status=waiting&task_status=expired&task_status=preparing&task_status=submit-failed&task_status=submitted&task_status=running&task_status=failed&task_status=succeeded&job_status=&order=time_desc&per_page=300

    Force private only works on the first m loop wierdly......

    Now re-extending the first 2x m loops, one with and one without, same functionality.

    We could also avoid all of the m tracer case/if loops and just do the other copies?

  7. MetBenjaminWent commented on Aug 3, 2026

    @MetBenjaminWent
    ContributorAuthor

    So:
    https://cylchub/services/cylc-review/taskjobs?user=benjamin.went&suite=aero_ukca_conv_como_explore%2Frun9&no_fuzzy_time=0&cycles=&tasks=&task_status=waiting&task_status=expired&task_status=preparing&task_status=submit-failed&task_status=submitted&task_status=running&task_status=failed&job_status=&order=time_desc&per_page=300

    For privates failing in the second section means we fail KGOs - bug to flag with PSyclone again....
    PSyclone/src/psyclone/psyir/transformations/parallel_region_trans.py
    It seems for some reason the symbol table checks are not working wierdly, it is right there.....

    But the build works, where we have a spanned parallel section instead of loads.
    This means less works, so we can use this and add them where able currently, store the rest and move on.

  8. MetBenjaminWent commented on Aug 4, 2026

    @MetBenjaminWent
    ContributorAuthor

    So aerosol_ukca_kernel_mod works, conv_comorph_kernel_mod does not and fails the build.....

    Current stats:
    aerosol_ukca_kernel_mod:

    • 50x parallels
    • 12x paralllel dos

    conv_comorph_kernel_mod :

    • 50x parallels
    • 43x parallel dos - need to shift these to just parallels
      Rewrite:
    • 20x parallels
    • 10x parallel dos
  9. MetBenjaminWent commented on Aug 4, 2026

    @MetBenjaminWent
    ContributorAuthor

    HoT build time is roughly:
    Elapsed Time: 0:36:12 (2172 seconds, 60% of total)
    No change really with aerosol_ukca_kernel_mod:
    Elapsed Time: 0:34:25 (2065 seconds, 57% of total)

  10. MetBenjaminWent commented on Aug 4, 2026

    @MetBenjaminWent
    ContributorAuthor

    conv_comorph_kernel_mod still fails with a few parallel and lots of dos.

    Trying with PSyclone transmute regardless, possibly it's the if blocks still then for this file
    Works without any OMP.

    Adding in specific parallel sections, with multiple loops, either over the tracers or the rest of the file causes the build issues.
    Adding 1 parallel section at the beginning causes build issues with Transmute.
    Adding 1 parallel section manually causes build issues, compiler bug
    Image
    (Loops tested against, both manfully or with Transmute, ref original source with hand OMP)

    As this seems to be a compiler bug with CCE 15, exploring raising this as a bug for CCE compiler.

  11. MetBenjaminWent commented on Aug 5, 2026

    @MetBenjaminWent
    ContributorAuthor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

enhancementNew feature or request

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions