Skip to Content.
Sympa Menu

forum - Re: [abinit-forum] bug in 15common/fresid.F90 (abinit-5.3.3)?

forum@abinit.org

Subject: The ABINIT Users Mailing List ( CLOSED )

List archive

Re: [abinit-forum] bug in 15common/fresid.F90 (abinit-5.3.3)?


Chronological Thread 
  • From: "Anglade Pierre-Matthieu" <anglade@gmail.com>
  • To: forum@abinit.org
  • Subject: Re: [abinit-forum] bug in 15common/fresid.F90 (abinit-5.3.3)?
  • Date: Mon, 26 Mar 2007 10:26:25 +0100
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=VtLkc72bRady/16Qx3Shi/7wyTlMJB4l0MykA7eAENpdpPFi1UjmCnOS0fOGz1TlyQ0bmIlr1ZhEfQU3AnNk2MLgUXWFhws4aDdByli/CfJ2GJoeVgeC20R+NCCtXd2Do+WkduupEvqCoeWYCIAToMaplnFZW+9mtreOETN9ohQ=

Hi,
In fact most compilers do not allow allocating twice the same array.
Unfortunately, as you told, some bugs are system dependent and are
triggered only on some system/compiler couples. Would you mind telling
us which of the automated test triggered the bug first ?
regards

PMA

On 3/26/07, Masao ARAI <ARAI.Masao@nims.go.jp> wrote:
Thank you for your reply.

On SR-11000, the error occurs on the tests supplied in
the abinit source tree.

The problem depends on systems or compilers.
In some (most?) systems, the problem is just ignored (with
possible memory leaks). But, unfortunately, compiler by Hitachi is
too strict. It does not allow us to allocate same array twice.

Best regards,
Masao Arai

> Hi,
>
> First, Yes this mailing list is appropriate for any type of comment,
> questions, remarks ... Yet, there is also a developer@abinit.org
> mailing list.
> It is very nice from you to come with this bug report + solution.
> Thank you very much. We would be very interesting in having an input
> file enabling us to reproduce this bug. This way it may become an
> automatic test and prevent the bug from popping up anytime in the
> future. It would also help us confirm the bug (although your code
> analysis looks very clear).
>
> best regards
> PMA
>
> On 3/26/07, Masao ARAI <ARAI.Masao@nims.go.jp> wrote:
>> Dear all,
>>
>> When I tested abinit-5.3.3 on Hitachi SR-11000, I got following error
>> from
>> abinip.
>>
>> KCHF503R allocatable array is already allocated.
>> 0x0000000100008194 _hf_err+0x554
>> 0x00000001000998bc _hf_alloc+0x2ac
>> 0x0000000100454c54 fresid+0x854
>>
>> This message indicates that some arrays are allocated multiple times.
>> I checked "15common/fresid.F90".
>>
>> At line 241, two arrays "rhor" and "work" are allocated.
>>
>> allocate(rhor(nfftot,dtset%nspden),work(nfftot,dtset%nspden))
>>
>> These arrays are deallocated at line 679 only when
>> (mpi_enreg%mode_para=='b').
>>
>> +677 if(mpi_enreg%mode_para=='b') then
>> +678 call
>> pre_scatter(work_slice,work,ngfft(1),ngfft(2),ngfft(3),mpi_enreg,'scatter')
>>
>> +679 deallocate(rhor,work)
>> +680 else
>> +681 work_slice(:,:)=work(:,:)
>> +682 end if
>>
>> So, if (mpi_enreg%mode_para != 'b"), the fresid will try to allocate the
>> same arrays each time
>> it is called.
>>
>> If the deallocate is moved after if-endif block,
>>
>> if(mpi_enreg%mode_para=='b') then
>> call
>> pre_scatter(work_slice,work,ngfft(1),ngfft(2),ngfft(3),mpi_enreg,'scatter')
>>
>> else
>> work_slice(:,:)=work(:,:)
>> end if
>> deallocate(rhor,work)
>>
>> the abinip seems to work fine.
>>
>> Best regards,
>> Masao Arai
>>
>> P.S.
>> Is this ML appropriate for sending these reports? Or, should I send to
>> developer ML?
>>
>> --
>> Masao Arai
>> CMSC, NIMS, JAPAN
>>
>
>




--
Pierre-Matthieu Anglade



Archive powered by MHonArc 2.6.16.

Top of Page