[MOAB-dev] netcdf nc_max_dims exceeded

Iulian Grindeanu iulian at mcs.anl.gov
Tue Nov 12 20:52:48 CST 2013


So it seems that in newer releases, they removed this limit 
https://bugtracking.unidata.ucar.edu/browse/NCF-71 
This limit is removed in c based netcdf version 4.3.0; right now, we are configuring with 4.0.1 :) too old 
We can either change the limits before recompiling netcdf or move to a newer version of netcdf. 

During our configuration of moab , we test if netcdf library supports more than 65536 dimensions in a file. the configure answer is no :). 

.... 
configure:29995: $? = 0 
configure:29995: result: yes 
configure:29995: checking for netcdf.h 
configure:29995: result: yes 
configure:30006: checking if NC_MAX_DIMS is at least 65536 
.... 
| int FC_DUMMY_MAIN() { return 1; } 
| #endif 
| #endif 
| int 
| main () 
| { 
| int arr[1 + (int)(NC_MAX_DIMS) - (int)(65536)]; 
| ; 
| return 0; 
| } 
configure:30031: result: no 

in configure.ac, we have a special paragraph and warning for this problem: 

*************************************************************************]) 
elif test "xno" = "x$NETCDF_SUFFICIENT_DIMS_VARS"; then 
AC_MSG_WARN([ 
************************************************************************* 
* The configured NetCDF library does not have sufficient constant limits 
* to support reading of ExodusII with large numbers of blocks or sidesets 
* or nodesets. Please consider re-compiling your NetCDF library after 
* increasing the constants NC_MAX_DIMS and NC_MAX_VARS in netcdf.h to 
* 65536 and 524288, respectively. See: 
* http://cubit.sandia.gov/help-version11.1/finite_element_model/export/exporting_exodus2_file.htm 

----- Original Message -----

| NetCDF has a limit of 1024 for NC_MAX_DIMS.
| Why is this limit set at 1024?
| Are there problems if I increase this limit?

| Some background:
| An h5m file can be successfully created by CoreGen program in MeshKit
| that has 300 + sidesets,
| converting this .h5m file to exodus fails*, because it hits this
| limit while creating dist factors for sidesets (1859).

| // sideset distribution factors
| 1855 int num_df_ss = -1;
| 1856 INS_ID(wname, "num_df_ss%d", index);
| 1857 if (nc_def_dim(ncFile, wname,
| (size_t)side_set.ss_dist_factors.size(), &num_df_ss) != NC_NOERR)
| 1858 {
| 1859 mWriteIface->report_error("WriteNCDF: failed to define number of
| dist factors in side set %d",
| 1860 side_set.id);
| 1861 return(MB_FAILURE); /* exit define mode and return */
| 1862 }

| *mbconvert doesn't give an error and writes a files that seems to be
| of correct size. I get to see this error only in the debugger.
| https://trac.mcs.anl.gov/projects/ITAPS/ticket/286

| Rajeev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/moab-dev/attachments/20131112/af2f02c2/attachment.html>


More information about the moab-dev mailing list