Skip to content

Commit

Permalink
EXODUS: Better error message for misconfigured netcdf library
Browse files Browse the repository at this point in the history
  • Loading branch information
gdsjaar committed Nov 5, 2024
1 parent 2567621 commit f765d5d
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/seacas/libraries/exodus/include/exodusII.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,12 @@
#endif

/* EXODUS version number */
#define EXODUS_VERSION "9.03"
#define EXODUS_VERSION "9.04"
#define EXODUS_VERSION_MAJOR 9
#define EXODUS_VERSION_MINOR 3
#define EXODUS_RELEASE_DATE "October 2, 2024"
#define EXODUS_VERSION_MINOR 4
#define EXODUS_RELEASE_DATE "November 5, 2024"

#define EX_API_VERS 9.03f
#define EX_API_VERS 9.04f
#define EX_API_VERS_NODOT (100 * EXODUS_VERSION_MAJOR + EXODUS_VERSION_MINOR)
#define EX_VERS EX_API_VERS

Expand Down
8 changes: 8 additions & 0 deletions packages/seacas/libraries/exodus/src/ex_open.c
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,8 @@ int ex_open_int(const char *path, int mode, int *comp_ws, int *io_ws, float *ver
"issue.\n",
canon_path);
ex_err(__func__, errmsg, status);
free(canon_path);
EX_FUNC_LEAVE(EX_FATAL);
#else
/* This is an hdf5 (netcdf4) file. If NC_HAS_HDF5 is not defined,
then we either don't have hdf5 support in this netcdf version,
Expand All @@ -206,6 +208,8 @@ int ex_open_int(const char *path, int mode, int *comp_ws, int *io_ws, float *ver
"other issue.\n",
canon_path);
ex_err(__func__, errmsg, status);
free(canon_path);
EX_FUNC_LEAVE(EX_FATAL);
#endif
}
else if (type == 4) {
Expand All @@ -217,6 +221,8 @@ int ex_open_int(const char *path, int mode, int *comp_ws, int *io_ws, float *ver
"issue \n",
canon_path);
ex_err(__func__, errmsg, status);
free(canon_path);
EX_FUNC_LEAVE(EX_FATAL);
#else
/* This is an cdf5 (64BIT_DATA) file. If NC_64BIT_DATA is not defined,
then we either don't have cdf5 support in this netcdf version,
Expand All @@ -233,6 +239,8 @@ int ex_open_int(const char *path, int mode, int *comp_ws, int *io_ws, float *ver
"other issue \n",
canon_path);
ex_err(__func__, errmsg, status);
free(canon_path);
EX_FUNC_LEAVE(EX_FATAL);

#endif
}
Expand Down
12 changes: 12 additions & 0 deletions packages/seacas/libraries/exodus/src/ex_open_par.c
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,8 @@ int ex_open_par_int(const char *path, int mode, int *comp_ws, int *io_ws, float
"issue \n",
canon_path);
ex_err(__func__, errmsg, status);
free(canon_path);
EX_FUNC_LEAVE(EX_FATAL);
#else
/* This is an hdf5 (netcdf4) file. If NC_HAS_HDF5 is not defined,
then we either don't have hdf5 support in this netcdf version,
Expand All @@ -238,6 +240,8 @@ int ex_open_par_int(const char *path, int mode, int *comp_ws, int *io_ws, float
"other issue \n",
canon_path);
ex_err(__func__, errmsg, status);
free(canon_path);
EX_FUNC_LEAVE(EX_FATAL);
#endif
}
else if (type == 4) {
Expand All @@ -249,6 +253,8 @@ int ex_open_par_int(const char *path, int mode, int *comp_ws, int *io_ws, float
"issue \n",
canon_path);
ex_err(__func__, errmsg, status);
free(canon_path);
EX_FUNC_LEAVE(EX_FATAL);
#else
/* This is an cdf5 (64BIT_DATA) file. If NC_64BIT_DATA is not defined,
then we either don't have cdf5 support in this netcdf version,
Expand All @@ -265,6 +271,8 @@ int ex_open_par_int(const char *path, int mode, int *comp_ws, int *io_ws, float
"other issue \n",
canon_path);
ex_err(__func__, errmsg, status);
free(canon_path);
EX_FUNC_LEAVE(EX_FATAL);
#endif
}
else if (type == 1 || type == 2) {
Expand All @@ -277,6 +285,8 @@ int ex_open_par_int(const char *path, int mode, int *comp_ws, int *io_ws, float
"issue \n",
canon_path);
ex_err(__func__, errmsg, status);
free(canon_path);
EX_FUNC_LEAVE(EX_FATAL);
#else
/* This is an normal NetCDF format file, for parallel reading, the PNetCDF
library is required but that is not compiled into this version.
Expand All @@ -287,6 +297,8 @@ int ex_open_par_int(const char *path, int mode, int *comp_ws, int *io_ws, float
"built with PNetCDF support as required for parallel access to this file.\n",
canon_path);
ex_err(__func__, errmsg, status);
free(canon_path);
EX_FUNC_LEAVE(EX_FATAL);
#endif
}

Expand Down

0 comments on commit f765d5d

Please sign in to comment.