View previous topic :: View next topic |
Author |
Message |
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7927 Location: Salford, UK
|
Posted: Mon Jun 20, 2016 8:29 am Post subject: |
|
|
The ichar failure has now been fixed but probably not in time for the impending new release.
high_res_clock@ seems to work OK for me. The documentation is out of date but it should be OK if used as in the documented sample. You must declare the type of the return as REAL(2). For both 32 bit and 64 bits it uses QueryPerformanceFrequency which is also used by SYSTEM_CLOCK. So the results should be similar. However, for safety I have made the internal code for 64 bit high_res_clock@ to be the same as that for SYSTEM_CLOCK.
Note that high_res_clock@ is provided so that legacy code can be ported. For future portability, something like SYSTEM_CLOCK is preferred assuming it provides sufficient accuracy. |
|
Back to top |
|
|
Chemie
Joined: 07 Mar 2015 Posts: 49
|
Posted: Wed Jul 06, 2016 9:41 am Post subject: Re: |
|
|
Now I'm using FTN95 8.05. When linking some programs, I get an error in SALFLIBC64DLL, there were missing or not defined
__ALLOCATE$ and
__DEALLOCATE@
What can I do?
Thanks
Chemie |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7927 Location: Salford, UK
|
Posted: Wed Jul 06, 2016 10:41 am Post subject: |
|
|
FTN95 makes calls to __ALLOCATE$ and __DEALLOCATE@ and these are currently located in clearwin64.dll.
It is possible that you have an old clearwin64.dll on your machine that is getting in the way. |
|
Back to top |
|
|
Chemie
Joined: 07 Mar 2015 Posts: 49
|
Posted: Fri Jul 08, 2016 11:38 am Post subject: Re: |
|
|
Sorry, but I have found an other problem.
winapp
program alloctest
use mswin
implicit none
integer*4 a,i3,aerror,xpix,ypix
character*1, dimension(:,:,, allocatable :: picture
i3=3
xpix=73728
ypix=81920
allocate(picture(i3,xpix,ypix),stat=aerror)
a=winio@('%ca[Meldung]&')
a=winio@('%2nlaerror= %wd x,y %wd %wd&',aerror,xpix,ypix)
a=winio@('%2nl%cn%9`bt[OK]')
if (aerror.gt.0) goto 1
picture(1,1,1)='a'
picture(3,73728,81920)='a'
1 end
In this example, I get no Error (aerror=0), when allocating ca. 17 GB (3 x 73728 x 81920), my PC has only 16 GB, this can't go. When I alter the values for xpix and ypix, sometimes aerror will be 1, other times 0.
Thanks Chemie |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7927 Location: Salford, UK
|
Posted: Fri Jul 08, 2016 5:52 pm Post subject: |
|
|
ALLOCATE calls upon the Windows API function HeapAlloc so any associated problems probably relate to HeapAlloc. My first thought is that HeapAlloc will not restrict the size to the amount of RAM and secondly that the result may depend on what else is running at the time.
The FTN95/ClearWin+ library function GlobalMemoryStatus@ may be useful in this context. See topic 368 in the ClearWin+ enhancements file cwplus.enh. |
|
Back to top |
|
|
Chemie
Joined: 07 Mar 2015 Posts: 49
|
Posted: Sat Jul 09, 2016 9:13 am Post subject: Re: |
|
|
Sorry, but for all options, the result is 0.
winapp
program memorystat
use mswin
implicit none
integer*4 a,i
integer*8 memorystatus
a=winio@('%ca[Meldung]&')
do i=1,7
memorystatus=GlobalMemoryStatus@(i)
a=winio@('%nli= %wd option= %wd&',i,memorystatus)
enddo
a=winio@('%2nl%cn%9`bt[OK]')
end
What is my error?
Thanks Chemie
PS: in case of __ALLOCATE$ and __DEALLOCATE@ I had an old version of clearwin64.dll on my pc. |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7927 Location: Salford, UK
|
Posted: Sat Jul 09, 2016 11:40 am Post subject: |
|
|
You need to declare the return type of GlobalMemoryStatus@
Code: | program memorystat
integer i
integer*8 GlobalMemoryStatus@
do i=1,7
print*, GlobalMemoryStatus@(i)
enddo
end |
|
|
Back to top |
|
|
Chemie
Joined: 07 Mar 2015 Posts: 49
|
Posted: Sat Jul 09, 2016 2:20 pm Post subject: Re: |
|
|
Thanks, now it works.
But, could it be, that allocate works only with integer*4, and I could not allocate memory up to 2GB (the highest value of integer*4)? The testprogramm stops at 2GB.
winapp
program alloctest
use mswin
implicit none
integer*8 aerror
integer*8 i,ihmio
integer*1, dimension(, allocatable :: arr
ihmio=100000000
do i= 1,200
allocate(arr(i*ihmio),stat=aerror)
print*, i,i*ihmio
if (aerror.gt.0) goto 1
deallocate(arr)
enddo
1 end
Thanks
Chemie |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7927 Location: Salford, UK
|
Posted: Sat Jul 09, 2016 4:00 pm Post subject: |
|
|
Yes you have found a bug. It is fixed now and I will see if we can release an interim clearwin64.dll for you. |
|
Back to top |
|
|
Chemie
Joined: 07 Mar 2015 Posts: 49
|
Posted: Sat Jul 09, 2016 5:37 pm Post subject: Re: |
|
|
PaulLaidler wrote: | Yes you have found a bug. It is fixed now and I will see if we can release an interim clearwin64.dll for you. |
Thanks for fixing the bug.
In this context (integer*8 <--> integer*4) I can't present big integer*8 values with %wd of winio@. The presentation gives fault values.
Chemie |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7927 Location: Salford, UK
|
Posted: Sat Jul 09, 2016 9:39 pm Post subject: |
|
|
Yes, %wd is for integer*4 values. I will make a note of this limitation. |
|
Back to top |
|
|
John-Silver
Joined: 30 Jul 2013 Posts: 1520 Location: Aerospace Valley
|
Posted: Mon Jul 11, 2016 3:11 pm Post subject: |
|
|
Reading through the continuation of this post (the 'new' problem since Fri July 6) I'm confused.
My understanding is that the oríginal query related to the ALLOCATE of 17Gb of memory when only 16Gb was physically available resultingin NO error message !
I don't clearly see how this has been resolved.
Later it mentions that there is a 'bug' relating to ALLOCATE only accepting Integer*4 values, thus limiting the allocation to 2Gb.
I'm confused by this latter state because I thought one of the main purposes of x64 was the ability to be able to allocate >2Gb of memory, and since the release I've seen no complaints from our 'heavy' users that this wasn't noq a problem with x64 version .
Is that because in fact ALLOCATE wasn't returning an error, and in fact wasn't allocating what is thught to be allocated, and if so how could that be ?
Has anyone got a clear summary explanation of the post and findings, because it's not clear to me ?
Does Paul's fix thus now allow >2Gb to be allocated whereas before it wasn't ? |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7927 Location: Salford, UK
|
Posted: Mon Jul 11, 2016 4:04 pm Post subject: |
|
|
John
There is a bug in the current release that limits ALLOCATE to 2GB.
This has been fixed for the next release. Also there may be an interim release of the relevant DLLs in order to keep things moving.
Previously (with 32 bit applications) the whole address space was limited to 2GB. For the moment (for 64 bit applications) a single ALLOCATE is limited to 2GB so I am not that surprised that the bug has not been spotted before. |
|
Back to top |
|
|
Chemie
Joined: 07 Mar 2015 Posts: 49
|
Posted: Mon Jul 11, 2016 6:39 pm Post subject: Re: |
|
|
I think, the problem is only that in the current release, ALLOCATE is limited to 2GB. When the numeric value is > 2GB, ALLOCATE sees only the last 32 bit, this will be a negativ value (e.g. in the range of 2GB to 4 GB) and a positiv value (e.g. in the range of 4GB to 6GB). Therefore somtimes the error will be 0 and other times 1.
How I can get the interim clearwin64.dll?
In the case of %wd with integer*8 I can write the integer*8 value to a string, and present the string with %ws. This works.
Chemie |
|
Back to top |
|
|
JohnCampbell
Joined: 16 Feb 2006 Posts: 2554 Location: Sydney
|
Posted: Tue Jul 12, 2016 11:40 am Post subject: |
|
|
I have tested recent releases and the allocate size problem is only with Ver. 8.05.0
I have written a program that tests large memory allocation. You may find it an interesting test. You may also want to change the parameter max_gb before trying to run it.
https://www.dropbox.com/s/zlc8sm0iyqlem8b/alloc_test.f90?dl=0 |
|
Back to top |
|
|
|