[MBDyn-users] newer netcdf c++ lib requires ncFile.h

Richard Crozier r.crozier at ed.ac.uk
Thu Jul 5 13:32:46 CEST 2018


No they are huge, about 2.5GB when the same result on linux is about 
100kb for the same sim. However, I'm using the same version of netcdf 
(4.1.3) on both platforms. It is obviously something wrong with my 
Windows build, but I just wanted to make sure it was not something 
already known. The problem will probably go away when your netcdf 
changes make it into the official version so I will probably just drop 
it for now.

Thanks,

Richard

On 04/07/18 13:39, Louis Gagnon wrote:
> Hi Richard,
> 
> I'm not sure how small is your simulation and how long you run it for, 
> but the files should not be much different in size than the usual ones 
> from the text output. If you have both outputs enabled, you will have 
> more data output. If you haven't yet done so, try disabling the text 
> output and any element and time ranges for which you don't need the output.
> 
> Some hints:
> 
> output results: netcdf (sync/orNot), notext;
> default output: none;
> output meter: define when and how often you want the ouput.
> Then, individually enable the elements you want to output.
> 
> Hope this helps,
> 
> Kind regards,
> 
> 
> -Louis
> 
> 
> On 04/07/2018 12:22, Richard Crozier wrote:
>> Hi Louis,
>>
>> Sorry to bother you again, I haven't been able to try out the patch 
>> yet. To solve my immediate problem (I can't apply your fixes easily to 
>> my own customised version of mbdyn) I decided to try and build against 
>> an older netcdf for windows, version 4.1.3. After a *lot* of pain I 
>> got the build to work, but mbdyn is producing huge netcdf files, GB in 
>> size for small simulations. Is this an issue you have ever come across?
>>
>> Regards,
>>
>> Richard
>>
>> On 28/06/18 09:21, Louis Gagnon wrote:
>>> Dear Richard,
>>>
>>> Here is the patch. I had to make most modifications to fit with the 
>>> private repository and to temporarily disable output from the other 
>>> elements to allow testing. Some patched lines will thus be useless if 
>>> you are using the 1.7.3 version of MBDyn.
>>>
>>> The most useful patch files are probably those: configure.ac 
>>> autostr.cc dataman2.cc  output.cc  output.h  strnode.cc
>>>
>>> I defined these compiler directives to distinguish between working 
>>> with the classic/legacy, USE_NETCDFC, and the new/4 version of the 
>>> wrapper, USE_NETCDF4.
>>>
>>> Yes, I also had to bring some considerable changes to work with the 
>>> interface of the new c++ wrapper. I tried to take advantage of this 
>>> to make the output as abstract as possible, and thus allow a 
>>> simplification (if time permits) of the whole output sequence.
>>>
>>> None of us need the netcdf4 mode, but it seems to be progressively 
>>> becoming the only one which is supported on many systems, thus the 
>>> upgrade... The good news is that from my preliminary tests, it is 
>>> roughly 10-15% faster that the classic one.
>>>
>>> I hope we can integrate it in the next MBDyn version, feel free to 
>>> comment/review, I am actually waiting for feedback before batch 
>>> processing all the elements with the new syntax, which is required to 
>>> use netcdf4.
>>>
>>> Let me know if some patches don't work well, I'll send you the 
>>> corresponding modified source files directly...
>>>
>>> Kind regards,
>>>
>>>
>>> -Louis
>>>
>>>
>>>
>>>
>>> On 27/06/2018 17:30, Louis Gagnon wrote:
>>>> Dear Richard,
>>>>
>>>> In its current version, MBDyn only supports legacy netcdf, which 
>>>> means non netcdf4 format (which does not necessarily imply that you 
>>>> need pre 4.x versions).
>>>>
>>>> I have a patch ready for netcdf4 support, but it still needs to 
>>>> undergo review. If you want to play around with it, I can post it, 
>>>> but it is not final yet and I have only covered a few elements.
>>>>
>>>> Otherwise, you could try an older version of netcdf and netcdf-c++, 
>>>> look for NetCDF-3 C++ on this page: 
>>>> https://www.unidata.ucar.edu/downloads/netcdf/index.jsp
>>>>
>>>> Kind regards,
>>>>
>>>>
>>>> -Louis
>>>>
>>>>
>>>>
>>>> On 27/06/2018 17:16, Richard Crozier wrote:
>>>>>
>>>>> I'm  doing a windows build of mbdyn with netcdf support enabled. To 
>>>>> do this I'm using netcdf 4.3.0 (not the latest version which is 
>>>>> 4.6.1). The C++ library is now separate in netcdf-cxx4. Building 
>>>>> this I get the configure error:
>>>>>
>>>>> configure: error: Could not locate netcdfcpp.h/netcdf.h header
>>>>>
>>>>> however, this is because the configure test is like this:
>>>>>
>>>>> #include <netcdf.h>
>>>>>                  ],[
>>>>>          /* test for netcdf */
>>>>>          NcFile nc("foobar", NcFile::Replace); // Create and leave 
>>>>> in define mode
>>>>>                  ],[
>>>>>                      have_libnetcdf=yes
>>>>>                      NETCDF_LIBS="$try_NETCDF_LIBS"
>>>>>                  ])
>>>>>
>>>>>
>>>>> but ncFile is now defined in another file, ncFile.h
>>>>>
>>>>> Best regards,
>>>>>
>>>>> Richard
>>>>>
>>>>
>>>
>>
> 

-- 
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.



More information about the MBDyn-users mailing list