Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Ethan A Merritt Newsgroups: comp.graphics.apps.gnuplot Subject: Re: Integer overflow when using binary and skip Date: Mon, 14 Apr 2014 12:49:05 -0700 Organization: gnuplot development Lines: 38 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7Bit Injection-Date: Mon, 14 Apr 2014 19:49:08 +0000 (UTC) Injection-Info: mx05.eternal-september.org; posting-host="8e86a57dfa599721f116da4577f3d1af"; logging-data="20905"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19OklEdZmbFKf71Vfp0s5s9" User-Agent: KNode/4.10.5 Cancel-Lock: sha1:aelvCNObH9PGOWSvXoMl21PUvtk= Xref: csiph.com comp.graphics.apps.gnuplot:2409 a.daitche@gmail.com wrote: > Hi, > > i am plotting data from a large binary file using something like > splot "file.bin" binary record=100000 skip=2000*100000*3*4 u 1:2:3 w d > > The file contains the positions of 100000 particles at 10000 time-points. > The above example should plot the particle positions at the 2000th > time-point, but throws the following error message "Number of bytes to > skip must be positive integer" > > The reason is that 2000*100000*3*4 is larger then the largest 32bit > integer and an overflow would occur. To prevent this gnuplot converts the > number to a float, which, unfortunately, is not accepted as an argument > for skip. > > Ideally i would tell gnuplot to use 64bit integer, however this doesn't > seem to be possible. Do you have any ideas for a workaround? > > With best regards > Anton Large file support has been added to the development branch and will be in the release candidate for version 5, which we hope will be ready in the next month or so. A subset of this change has been back-ported to version 4.6 so that the specific problem reported here is handled on 64-bit systems (but not 32bit systems). Unfortunately this fix just missed the bugfix release 4.6.5, so it will not be in an official release version for another 6 months or so. As always, both the current version (4.6) and the development version (5.0) can be built from source code available on SourceForge. Ethan