Skip to content

Commit

Permalink
Bugfix #3075 main_v12.0 optimization (#3076)
Browse files Browse the repository at this point in the history
* Per #3075, update get_att_value_chars() utility function to store the attribute value in a string rather than a fixed-length character array for which overflow may occur.

* Per #3075, switch from compiling MET in Docker using the -g debug flag to using -O2 optimization since that's what how we configure installations on supported platforms. This makes the testing environment more simliar to the deployed versions. And we've found some bugs due to unexpected behavior when compiled with -O2 optimization.

* Per #3075, remove accidentally committed log file

* Per #3075, update TrackInfo::diag_name() to return a string rather than a pointer to temporary memory to solve the problem with diagnostic names in unit_tc_pairs.xml when compiled with optimization enabled.

* Per #3075, update read_netcdf_logic() to store pointers to class members rather than local variables which go out of scope.

* Per #3075, don't need to use local variables at all.

* Per #3075, switch to using STL vectors for memory management

* Per #3075, reimplement month_name_to_m() with stl strings to avoid variable length arrays.

* Per #3075, update MetNcFile::readFile() to use stl vectors instead of variable length arrays

* Per #3075, update NcCfFile member functions to use stl vectors instead of variable length arrays

* Per #3075, update is_netcdf_file() to use stl vectors instead of variable length arrays

* Per #3075, update 3d_conv.cc to use stl vectors instead of variable length arrays

* Per #3075, update the vx_util library to use stl vectors instead of variable length arrays

* Per #3075, update ensemble_stat to use stl vectors instead of variable length arrays

* Per #3075, update decode_lat_lon() to use stl vectors instead of variable length arrays

* Per #3075, update grid_diag to use stl vectors instead of variable length arrays

* Per #3075, update ioda2nc to use stl vectors instead of variable length arrays

* Per #3075, update madis2nc to use stl vectors instead of variable length arrays

* Per #3075, update mode_graphics to use stl vectors instead of variable length arrays

* Per #3075, update the vx_nc_obs library to use stl vectors instead of variable length arrays

* Per #3075, update plot_point_obs to use stl vectors instead of variable length arrays

* Per #3075, update point_stat to use stl vectors instead of variable length arrays

* Per #3075, update wavelet_stat to use stl vectors instead of variable length arrays

* Per #3075, no real code change, just whitespace

* Per #3075, removing commented out code

* Per #3075, need to add 2 to account for time_count being initialized to -1. An array of length 0 is different from a vector of length 0.

* Per #3075, can't use 2D vectors to read data from NetCDF files into a contiguous block of memory.

* Per #3075, can't use 2D vectors to read data from NetCDF files into a contiguous block of memory.

* Per #3075, update looping logic

* Per #3075, eliminate all instances of vector<vector<type>> since it's not stored in contiguous memory and therefore not useful for reading data from the NetCDF files.

* Per #303075, bit more madis2nc changes.

* Per #3075, fix Nx typo

* Per #3075, fix chaNetCDF attribute character type

* Per #3075, minor changes to satisfy SonarQube findings.

* Per #3075, when sizing vectors of type <char> add one for the trailing null.

* Per #3075, remove debugging code.

* Per #3075, unit_ioda2nc.xml fails when compiled with Intel since there are issues parsing NC_STRING attribute types. Reverting back to the previous logic from main_v12.0 since that works.

* Per #3750, back out the change to using -O2 in development.docker. With it, differences on flagged by GHA. I'd like to make sure all the changes on this branch cause NO differences before switching to using -O2... most likely in the develop branch rather than main_v12.0.

* Per #3075, getting segfault from point2grid. Null terminating character vectors after reading NetCDF attributes just to be safe.

* Unrelated to #3075, only whitespace changes.

* Per #3075, fix logic of the write_nc(...) function so that all variable attributes and added and defined prior to writing the data for that variable. Writing attributes AFTER the data, as we had been doing, causes unexpected failures, as found when compiled with Intel.

* Per #3075, update args to write_nc(...) to minimize regression test diffs.

* Per #3075, fix madis2nc i_buf definition problem.

* Per #3075, more refinement of i_buf definition in madis2nc for acars and raob inputs.

* Per #3075, remove FFLAGS from development.docker becuase there's no good reason to add it.

* replace raw array with std array

* replace raw array with std array in 2 other places

* Per #3075, fix clear bug in vx_bool_calc/tokenizer.cc where the = assignment operator is used when the == comparison operator is needed.

---------

Co-authored-by: George McCabe <[email protected]>
  • Loading branch information
JohnHalleyGotway and georgemccabe authored Feb 12, 2025
1 parent be35354 commit ca3c74d
Show file tree
Hide file tree
Showing 29 changed files with 888 additions and 2,263 deletions.
4 changes: 2 additions & 2 deletions internal/scripts/environment/development.docker
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export MET_PYTHON_BIN_EXE=${MET_PYTHON}/bin/python3
export MET_PYTHON_CC="-I${MET_PYTHON}/include/python3.10"
export MET_PYTHON_LD="-L${MET_PYTHON}/lib -lpython3.10 -lcrypt -lpthread -ldl -lutil -lm"

export CFLAGS="-DUNDERSCORE -fPIC -g"
export CFLAGS="-DUNDERSCORE -fPIC"
export CXXFLAGS=${CFLAGS}

# Set LDFLAGS to include -rpath settings when compiling MET
Expand Down Expand Up @@ -47,4 +47,4 @@ export SQLITE_INCLUDE_DIR=/usr/include
export SQLITE_LIB_DIR=/usr/lib/x86_64-linux-gnu

export BUFRLIB_NAME="-lbufr_4"
export GRIB2CLIB_NAME="-lg2c"
export GRIB2CLIB_NAME="-lg2c"
Loading

0 comments on commit ca3c74d

Please sign in to comment.