Skip to content

Commit

Permalink
Improved comments and one error message in create_xgrid.c based on
Browse files Browse the repository at this point in the history
input from r.benson and c.blanton.
  • Loading branch information
Miguel R Zuniga authored and Miguel R Zuniga committed Dec 14, 2023
1 parent f718c6e commit 9c34e56
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 13 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,9 @@ The tools available in FRE-NCtools are:


### Other Tools
There are several tools that have parallel versions and can overcome memory and cpu constrains of the serial conterpart.
E.g. fregrid_parallel is used to generate remapping weights for high resolution grids (for further information, see the
There are several tools that have parallel versions and can overcome memory and cpu constrains of the serial
conterpart. E.g. fregrid_parallel reproduces the functionality of fregrid, and among other things it is
commonly used to generate the remapping weights for high resolution grids. (for further information, see the
"extreme fregrid" document).
The [Ocean Model Grid Generator](https://github.com/NOAA-GFDL/ocean_model_grid_generator) can be copied or
cloned from its GFDL homepage.
Expand Down
24 changes: 14 additions & 10 deletions docs/extreme_fregrid_sample_runscript.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,21 @@
# generate this message when the remapping weights file is not available and
# grids are too large for it to process:
#
# FATAL Error: nxgrid is greater than MAXXGRID/nthreads, increase MAXXGRID, decrease
# nthreads, or increase number of MPI ranks
# FATAL Error: The xgrid size is too large for resources.
# nxgrid is greater than MAXXGRID/nthreads; increase MAXXGRID,
# decrease nthreads, or increase number of MPI ranks.
#
# fregrid_parallel should instead be used if such an error is encountered. fregrid_parallel
# can be used to generate the weights file, and the file is subsequently reused (usually
# as an input file to the serial fregrid) for regridding the fields. However, even
# fregrid_parallel can generate the same error if run with insufficient computational
# resources. Below (after the dashed line) is an example runscript configured for using
# fregrid_parallel with a sufficiently large number of ranks and cores to avoid the fatal
# error for a common "extreme fregrid" case. This configuration runs in about 43 minutes
# on Gaea . The tail end of the runs output follows:
# fregrid_parallel should instead be used if such an error is encountered. Like the
# serial version, it can be used to perform the remapping; but commonly it is used
# to perform only the compute intensive operations - the generation of the remapping
# weights file. The weights file is saved and in turn it is then used (and re-used)
# as an input file to the serial fregrid to quickly perform the remapping. However,
# even fregrid_parallel can generate the same error if run with insufficient
# computational resources. Below (after the dashed line) is an example runscript
# configured for running fregrid_parallel with a sufficiently large number of ranks
# and cores to avoid the fatal error for a common "extreme fregrid" case. This
# configuration runs in about 43 minutes on Gaea C5. The tail end of the runs output
# follows:
#
#> NOTE: done calculating index and weight for conservative interpolation
#> Memuse(MB) at After setup interp, min=4814.17, max=4881.2, avg=4834.05
Expand Down
Binary file modified docs/remapping_algorithm_cell_methods_measures.pdf
Binary file not shown.
4 changes: 3 additions & 1 deletion tools/libfrencutils/create_xgrid.c
Original file line number Diff line number Diff line change
Expand Up @@ -807,7 +807,9 @@ nxgrid = 0;
if( xarea/min_area > AREA_RATIO_THRESH ) {
pnxgrid[m]++;
if(pnxgrid[m]>= MAXXGRID/nthreads)
error_handler("nxgrid is greater than MAXXGRID/nthreads, increase MAXXGRID, decrease nthreads, or increase number of MPI ranks");
error_handler("The xgrid size is too large for resources.\n"
" nxgrid is greater than MAXXGRID/nthreads; increase MAXXGRID,\n"
" decrease nthreads, or increase number of MPI ranks.");
nn = pstart[m] + pnxgrid[m]-1;

pxgrid_area[nn] = xarea;
Expand Down

0 comments on commit 9c34e56

Please sign in to comment.