forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Salford run-time library
Goto page 1, 2  Next
 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Plato
View previous topic :: View next topic  
Author Message
AndreaFTN95



Joined: 14 Nov 2016
Posts: 7

PostPosted: Mon Nov 14, 2016 11:55 am    Post subject: Salford run-time library Reply with quote

Hi all, I'm new Fortran user

I have the following error:

Salford run-time library.
Re-link program with bigger stack value.
(stack:reserve, commit)


Can someone help me? please!

I use a SO Windows 8.1 64bit with 4GB of ram.

Thanks for collaboration
[/b]
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 4919
Location: Salford, UK

PostPosted: Mon Nov 14, 2016 12:09 pm    Post subject: Reply with quote

How big is your program? Can you post it here?
If not then can you produce the failure in a small program?

You may need a larger stack size when linking but it may be a programming error.
Back to top
View user's profile Send private message
AndreaFTN95



Joined: 14 Nov 2016
Posts: 7

PostPosted: Mon Nov 14, 2016 12:16 pm    Post subject: Re: Reply with quote

PaulLaidler wrote:
How big is your program? Can you post it here?
If not then can you produce the failure in a small program?

You may need a larger stack size when linking but it may be a programming error.



How check the total size of the program?

This program calculate a matrix.

So, I tried with a small matrix and it is all correct but as soon as I insert a bix matrix 1000 rows per 1000 column the error above display.
Back to top
View user's profile Send private message
mecej4



Joined: 31 Oct 2006
Posts: 732

PostPosted: Mon Nov 14, 2016 1:08 pm    Post subject: Re: Reply with quote

AndreaFTN95 wrote:
How check the total size of the program?

This is a basic task in using any operating system. In a command window, the DIR command will show you the size of the file. Or, in the Windows Explorer, highlight the file in question and right click to view the properties of the file.
Back to top
View user's profile Send private message
AndreaFTN95



Joined: 14 Nov 2016
Posts: 7

PostPosted: Mon Nov 14, 2016 1:24 pm    Post subject: Re: Reply with quote

mecej4 wrote:
AndreaFTN95 wrote:
How check the total size of the program?

This is a basic task in using any operating system. In a command window, the DIR command will show you the size of the file. Or, in the Windows Explorer, highlight the file in question and right click to view the properties of the file.



you are right but my doubt is why the code invokes several files, however progrm.exe has a size of 80MB
Back to top
View user's profile Send private message
mecej4



Joined: 31 Oct 2006
Posts: 732

PostPosted: Mon Nov 14, 2016 1:56 pm    Post subject: Re: Reply with quote

AndreaFTN95 wrote:
... my doubt is why the code invokes several files, however progrm.exe has a size of 80MB
The request in #2 was for, I think, information on the size of the source files, not the size of the EXE.

A short program may produce a huge EXE, or vice versa. Mostly, it is the presence of large saved arrays in the program that causes the EXE to be large. On the other hand, stack overflow is often caused by having large local arrays.

In order to troubleshoot the issue, it would be helpful to have access to the source code, if it is acceptable to you to make it available. If you do not wish to make the source code public, you can zip up the source files, load the zip file to a cloud service such as Dropbox, and pass along the download link in a private message to Paul. Otherwise, post the link in your reply.

You can only post source code in the forum if the size is about a hundred lines.
Back to top
View user's profile Send private message
AndreaFTN95



Joined: 14 Nov 2016
Posts: 7

PostPosted: Mon Nov 14, 2016 2:15 pm    Post subject: Re: Reply with quote

I'm sorry but in this moment I can't post or sent privitly the source code, becase It is copyrighted.

I know that is difficult for you solve the problem without the source code.

The program works correctly, but when I increase the number or rows and column of matrix, It appears the error:

Salford run-time library.
Re-link program with bigger stack value.
(stack:reserve, commit)

So I think it is a problem of memory of pc, but I know if it possible change the setting of Fortran or Plato per increase the memory.
Back to top
View user's profile Send private message
DanRRight



Joined: 10 Mar 2008
Posts: 1548
Location: South Pole, Antarctica

PostPosted: Mon Nov 14, 2016 2:25 pm    Post subject: Reply with quote

Try in command prompt after you have made your OBJ file

>slink your.obj /stack:100000000

you may also add /3GB switch too

If not help that means you may have made some stupid error in array sizes.
One-two arrays of the size (1000,1000) are easily bearable without modification of the stack.

Some here already use 64 bit compiler for super large sizes, no stack needed


Last edited by DanRRight on Mon Nov 14, 2016 3:16 pm; edited 1 time in total
Back to top
View user's profile Send private message
AndreaFTN95



Joined: 14 Nov 2016
Posts: 7

PostPosted: Mon Nov 14, 2016 2:51 pm    Post subject: Re: Reply with quote

DanRRight wrote:
Try
slink your.obj /stack:100000000

you may also add /3GB switch too

If not help that means you may have made some stupid error in array sizes.
One-two arrays of the size (1000,1000) are easily bearable without modification of the stack.

Some here already use 64 bit compiler for super large sizes, no stack needed



Sorry, but I not understand what I will try with slink your.obj /stack:100000000
I'm a new user and I'm not very practical.


I use a Plato 4.73 version Silverfrost Ltd 2016
and use this library salflibc.dll within the program folder (else it nor start)

and I use a CheckMate x32 becouse if use CheckMate x64 tthis error appears:

Compiling file: corretto-Bingham.for
error 1205: - /CHECK is not available in FTN95/64
Compilation completed with no errors.



thanks again for the collaboration
Back to top
View user's profile Send private message
mecej4



Joined: 31 Oct 2006
Posts: 732

PostPosted: Mon Nov 14, 2016 3:11 pm    Post subject: Reply with quote

You can increase the stack available to your EXE by specifying the option /stack:<nnnnnnn> to the linker. If you are building inside Plato, look for a place to set the project options. Typically, you will have one place for specifying compilation options and another for linking options.

Alternatively, you can use the EDITBIN.EXE utility that is included in many Windows SDKS. This utility allows you to display and, optionally, change the stack size by directly editing the header of the EXE file.

If your program is already debugged, you can build using the 64 bit compiler by removing any /check and /opt options.
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 4919
Location: Salford, UK

PostPosted: Mon Nov 14, 2016 4:57 pm    Post subject: Reply with quote

Have you created a project in Plato or are you just directly building from one file?
Back to top
View user's profile Send private message
AndreaFTN95



Joined: 14 Nov 2016
Posts: 7

PostPosted: Mon Nov 14, 2016 5:30 pm    Post subject: Re: Reply with quote

I download gFortran and loccate the path after I open a file .for in Plato and then I compile it.......it seems work correctly

I'm doing a complete test...but is very long time....If it is all correctly I will post the sucess tonight or tomorrow, else I will write again.

thanks again for your collaboration
Back to top
View user's profile Send private message
JohnCampbell



Joined: 16 Feb 2006
Posts: 1774
Location: Sydney

PostPosted: Mon Nov 14, 2016 11:54 pm    Post subject: Reply with quote

My advice is to avoid the use of the stack wherever possible, especially with large arrays. Stack overflow is an error that should be better managed, but isn't.

You should try to change your program so the arrays do not go onto the stack.
You can do this by placing the arrays in COMMON or a MODULE, with a MODULE required if the arrays are allocatable.
Code:
!  program to have large arrays not on teh stack
module aaa
   real*8, allocatable :: a_array(:,:)
end module aaa

use aaa
   common /xyz/ b_array
   real*8 b_array(1000,2000)
   integer*4 n,stat
!
!  use b_array
   b_array = 1
   write (*,*) 'b_array has been used', b_array(1000,2000), size(b_array)
!
!  use a_array
   do n = 1000,8000,1000
     allocate (a_array(n,n),stat=stat)
     write (*,*) 'a_array set to',n,' stat=',stat
     a_array = n
     write (*,*) 'a_array size =',size(a_array)
     deallocate (a_array)
   end do
 end
Back to top
View user's profile Send private message
AndreaFTN95



Joined: 14 Nov 2016
Posts: 7

PostPosted: Thu Nov 17, 2016 7:30 pm    Post subject: Re: Reply with quote

I dont have created the source code and I not know what is its logic....and I not very experting in programming.....

I belive that this codex is created with fortran 90, and I wont replece it whit a new version for work with more date.....

In this moment the source code is compiled, whit no error but the results from the work is not correct...Maybe is a problem of code program...but my dubit concer the envirovement of Fortran/PLATO.

it is possible chage some setting for improve the compiletion????
Back to top
View user's profile Send private message
mecej4



Joined: 31 Oct 2006
Posts: 732

PostPosted: Thu Nov 17, 2016 7:39 pm    Post subject: Reply with quote

You can recompile with the /check or /checkmate options. Your program will run much more slowly, but most errors will be trapped. You can fix the errors, and recompile without /check.

There is no magical compiler option to make the code give you correct results.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Plato All times are GMT + 1 Hour
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group