MetOffice / MetOffice/lfric_core

mesh generator size limitations

Open
#439 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Fortran
Stars
26
Forks
73
Avg merge
1d 8h
Merged PRs (30d)
4

Description

### Are there any linked Issues or Pull Requests?

_No response_

### Brief description

The mesh generator has some limits on the size of mesh that it can generate that are not related to memory or CPU limitations.

For example, the mesh generator ought to be able to generated a non-partitioned C16384 mesh on a single Genoa node (700GB) if the following were fixed:

1. To generate, say, a C8192 mesh, the program needs to be changed to define nf90_netcdf4 rather than nf90_64bit_offset when creating the file (see ncdf_quad_mod.f90). With that change, it was possible to create a mesh up to around C12288 mesh.
2. Above around C12288, we start to hit the 32-bit integer limit for some of the program variables - issues with `ncells` were seen. Ideally, the particular variables should individually be identified and promoted to `int64`. Note that care must be taken with some existing allocate statements that use arithmetic to compute size. For example, `allocate( x(2 * ncells)` will breach 32-bit limits even if `ncells` is 64-bit if default precision of `2` is `int32`.

### Further details of the issue.

_No response_

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by inspecting ncdf_quad_mod.f90 and the mesh-generator code that handles ncells and related allocation sizes. Reproduce the C8192 or larger generation case, checking NetCDF file mode and integer-width assumptions, including arithmetic such as allocate(x(2 * ncells)). Done means the identified limits are removed and larger meshes can be generated without memory or CPU being the cause of failure.

Written by the indexing model from the issue text.

Assessment

Tech stack
fortran
Domain
hpc
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.