ESCOMP / ESCOMP/CTSM

Dimension clumps object by clumps_proc rather than global nclumps

Open
#3,466 7 comments 0 reactions 2 assignees Claimed by @briandobbins View on GitHub
b4b performance
Dominant language
Fortran
Stars
352
Forks
361
Avg merge
6d 6h
Merged PRs (30d)
8

Description

The clumps object in decompMod is an array over all the clumps for the entire grid, and is on each task. When initializing the decomposition it's used to setup the decomposition, but after initialization only the clumps over the local processor are needed.

Hence, we can save memory at least by saving a copy of the local clumps for the given task, and then deallocating clumps and reallocating only the part for the local task.

So something like:

``` fortran
type(clump_type), allocatable :: clumps_local(:)
.
.
.
nclumps = bounds_proc%nclumps
allocate( clumps_local(nclumps) )
clumps_local = clumps(nclumps)
deallocate( clumps )
allocate( clumps(nclumps) )
clumps(:) = clumps_local(:)
deallocate( clumps_local )
```

Definition of done:
- [ ] Dimension clumps as clump_pproc rather than nclumps
- [ ] Change decompMod: get_proc_global to do a mpi_reduce to get the totals over all processors to log about
- [ ] deallocate lcid sooner in decompInit_lnd
- [ ] Change code in decompInit_clumps as follows:
- [ ] Change loops over nclumps to over clump_pproc
- [ ] Remove mpi operations
- [ ] Change or remove the logging at the end

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.