[ADMB Users] 4 Gb limits

Allan.Hicks at noaa.gov Allan.Hicks at noaa.gov
Sun Nov 20 16:02:38 PST 2011


Hi John,

Nice work finding that. My machine showed the same behavior that you
have seen.

Are we getting into the intricacies of moving towards 64-bit?  Your
change makes sense because the variable "sz" is a long long int, and
when "i" is an unsigned int it would exhibit strange behavior when sz is
greater than (2^32-1).  I noticed that in the class DF_FILE, there are
some other variables that are unsigned int's. In particular, buff_size
and buff_end.  I imagine that these should also be changed to long long
int (in the fvar.hpp file).  This may also be an issue in the ad_sbuffer
class (see smartbuf.h)?

I'm in over my head now.
Allan

----- Original Message -----
From: John Sibert <sibert at hawaii.edu>
Date: Sunday, November 20, 2011 3:21 pm
Subject: Re: [ADMB Users] 4 Gb limits

> Hi Alan,
> The problem seems to be in this initialization loop in df_file.cpp 
> Adding the additional #ifdef seems to allow the program to execute.
> 
> Dave, is this initialization really necessary? It takes a long time 
> for 
> sz>4Gb (at least on the test machine).
> > #ifdef __BORLANDC__
> >       for (unsigned int i=0;i<sz;i++)
> >   #else
> >       for (long long int i=0;i<sz;i++)
> >   #endif
> >       {
> >         buff[i]='\0';
> >       }
> Also I noticed (rather the compiler noticed) a discrepancy in the 
> following two declarations:
> > df_file.cpp:  extern char ad_random_part[6];
> > gradstrc.cpp: extern char ad_random_part[7];
> Which is correct?
> 
> I will commit the changes eventually.
> 
> Cheers,
> John
> 
> 
> On 11/20/2011 08:39 AM, Allan.Hicks at noaa.gov wrote:
> > Hi John,
> >
> > I have a couple of thoughts, probably of which you have already 
> taken> care of. But, here goes:
> >
> > 1) Make sure that you are using ADMB 10.1. I noticed that the inputs
> > were still long int in version 10.0.
> >
> > 2) Make sure that AMB10.1 is compiled as 64-bit. I noticed that 
> there> are no 64-bit downloads on the website for ADMB 10.1 in 
> Linux.  I also
> > could not find 64-bit executables for Linux gcc on Buildbot (I 
> see a
> > 64-bit version for gcc 4.5 has been successfully built, but I do 
> not see
> > executables). But, given that you are using gcc 4.6, you probably
> > compiled it yourself, but I just wanted to make sure.
> >
> > 3) You may want to try setting the cbs value in the tpl file, 
> just to
> > make sure that there is no issue with the reading in from the 
> command line.
> >
> > If these aren't the answer, I'm not exactly sure where the 
> problem is.
> > Because it is at the exact breaking point of an unsigned long int
> > (2^32-1 is the maximum) then I imagine that there is something in 
> the> code that is declared as an unsigned long int and there is a 
> conversion> issue.  This is a bit over my head, and you warned me a 
> while ago that
> > converting to 64-bit is not as straightforward as simply changing 
> some> declarations.
> >
> > In the meantime, I will try to compile ADMB 10.1 in Linux 64-bit 
> and see
> > if I can reproduce your issue and investigate it further.
> >
> > Sorry that I can't be of more help,
> > Allan
> >
> >
> >
> >
> >
> > ----- Original Message -----
> > From: John Sibert<sibert at hawaii.edu>
> > Date: Saturday, November 19, 2011 6:31 pm
> > Subject: Re: [ADMB Users] 4 Gb limits
> >
> >> Nope. The value of the option behind -cbs is declared as a long
> >> long
> >> int. See nh99/xmodelm3.cpp.
> >>
> >> Ian Taylor and Alan Hicks resolved this issue for -gbs.
> >>
> >> John
> >>
> >>
> >>
> >> On 11/19/2011 03:57 PM, Weihai Liu wrote:
> >>> I would guess the size for cbs was defined as an unsigned long,
> >> which
> >>> is 32 bit, its range 0 to 4294967295, so 4294967296 will be just
> >> out
> >>> of range, although it = 2^32.
> >>>
> >>>
> >>> weihai
> >>>
> >>> On Sat, Nov 19, 2011 at 8:23 PM, John Sibert<sibert at hawaii.edu
> >>> <mailto:sibert at hawaii.edu>>  wrote:
> >>>
> >>>      Using simple.tpl
> >>>
> >>>      simple -cbs 4294967295 works fine
> >>>      simple -cbs 4294967296 hangs
> >>>
> >>>      ubuntu 11.10, 64 bit, 32Gb RAM, gcc 4.6.1
> >>>
> >>>      Any thoughts?
> >>>      John
> >>>
> >>>      --
> >>>      John Sibert
> >>>      Emeritus Researcher, SOEST
> >>>      University of Hawaii at Manoa
> >>>
> >>>      Visit the ADMB project http://admb-project.org/
> >>>
> >>>      _______________________________________________
> >>>      Users mailing list
> >>>      Users at admb-project.org<mailto:Users at admb-project.org>
> >>>      http://lists.admb-project.org/mailman/listinfo/users
> >>>
> >>>
> >> -- 
> >> John Sibert
> >> Emeritus Researcher, SOEST
> >> University of Hawaii at Manoa
> >>
> >> Visit the ADMB project http://admb-project.org/
> >>
> >> _______________________________________________
> >> Users mailing list
> >> Users at admb-project.org
> >> http://lists.admb-project.org/mailman/listinfo/users
> >>
> 
> -- 
> John Sibert
> Emeritus Researcher, SOEST
> University of Hawaii at Manoa
> 
> Visit the ADMB project http://admb-project.org/
> 
> 



More information about the Users mailing list