[ADMB Users] 4 Gb limits

John Sibert sibert at hawaii.edu
Mon Nov 21 09:37:07 PST 2011


OK. got rid of initialization loop altogether. It works find with simpe 
-cbs 4294967296 and much larger values, too. Committed the code,  
revision 199, but it needs to be tested with other compilers.

John

On 11/21/2011 06:20 AM, dave fournier wrote:
> On 11-11-20 03:21 PM, John Sibert wrote:
>
> I don;t think it is needed now. I think it was just during development 
> looking for errors.
>
>> 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?
>
> Looking at the code
>
>  void fill_ad_random_part(void)
>   {
>    /*
>     time_t t,tt;
>     time(&t);
>     tt=t;
>     int div=1;
>     for (int i=0;i<6;i++)
>     {
>
>       ad_random_part[i]=(tt/div)%10+48;
>       div*=10;
>     }
>    */
>   }
>
> It seems that it is not used any more but it did use [6]
>
>
>>
>> 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