You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If a kernel (directly or indirectly) uses for example chi2llr from sci_chi_transform_mod, the whole sci_chi_transform_mod is inlined, which includes init_chi_transforms -> local_mesh_mod -> halo_comms_mod -> yaxt
In this case, init_chi_transform is not called, so de-facto there is no dependency to yaxt, but the driver will not compile.
Of course, yaxt could be linked in - and while in general just linking with yaxt would not work since the initialisation is not done, but since the halo functions that use yaxt are not called, this solves the problem. But a better solution would be exclude subroutines that are not called.
While in the above example, the code is clean:
SUBROUTINE init_chi_transforms(mesh_collection, north_pole_arg, equator_lat_arg)
USE local_mesh_mod, ONLY: local_mesh_type
USE mesh_collection_mod, ONLY: mesh_collection_type
USE mesh_mod, ONLY: mesh_type
All the used modules will sooner or later call import halo_comms_mod, so removing this subroutine is enough. But it could be that a module is used in the outer module scope, which might also need to be removed:
module sci_chi_transform_mod
USE local_mesh_mod, ONLY: local_mesh_type
contains
SUBROUTINE init_chi_transforms(mesh_collection, north_pole_arg, equator_lat_arg)
... do something with local_mesh_type
In this case the local_mesh_mod in the module declaration would also need to be removed :(
The text was updated successfully, but these errors were encountered:
hiker
added
PSyData
NG-ARCH
Issues relevant to the GPU parallelisation of LFRic and other models expected to be used in NG-ARCH
labels
Feb 9, 2025
hiker
changed the title
[PSyData] Kernel driver contains unnecessary modules
[PSyData] Kernel driver contains unnecessary modules with references to yaxt
Feb 10, 2025
If a kernel (directly or indirectly) uses for example
chi2llr
fromsci_chi_transform_mod
, the wholesci_chi_transform_mod
is inlined, which includesinit_chi_transforms
->local_mesh_mod
->halo_comms_mod
->yaxt
In this case,
init_chi_transform
is not called, so de-facto there is no dependency toyaxt
, but the driver will not compile.Of course, yaxt could be linked in - and while in general just linking with yaxt would not work since the initialisation is not done, but since the halo functions that use yaxt are not called, this solves the problem. But a better solution would be exclude subroutines that are not called.
While in the above example, the code is clean:
All the used modules will sooner or later call import
halo_comms_mod
, so removing this subroutine is enough. But it could be that a module is used in the outer module scope, which might also need to be removed:In this case the
local_mesh_mod
in the module declaration would also need to be removed :(The text was updated successfully, but these errors were encountered: