CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > General Forums > Main CFD Forum

CPU time

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 16, 2003, 21:27
Default CPU time
  #1
R.
Guest
 
Posts: n/a
Hi guys,

Is there any simple way to find out the CPU time used for a code in FORTRAN. I just forgot the command. Your help is appreciated.
  Reply With Quote

Old   April 17, 2003, 06:52
Default Re: CPU time
  #2
Manosh
Guest
 
Posts: n/a
At the Unix prompt, enter:

time yourprog

Manosh
  Reply With Quote

Old   April 17, 2003, 09:45
Default Re: CPU time
  #3
Jean-François Simon
Guest
 
Posts: n/a
In Fortran directly,

REAL time_begin, time_end

... CALL CPU_TIME(time_begin)

... CALL CPU_TIME(time_end)
  Reply With Quote

Old   April 17, 2003, 16:08
Default Re: CPU time
  #4
R.
Guest
 
Posts: n/a
Thanks but none did work! Do I have to use the library?

I am writing my code on Unix computer.
  Reply With Quote

Old   April 17, 2003, 19:27
Default Re: CPU time
  #5
xueying
Guest
 
Posts: n/a
Are you using Fortran 90/95? Both of the methods work for my Fortran 90/95 code without linking to any library, however, if you direct your running results to some file, then the first method doesn't work.
  Reply With Quote

Old   April 17, 2003, 20:19
Default Re: CPU time
  #6
R.
Guest
 
Posts: n/a
Thanks a lot.

What about function ETIME

In the manual it says it should give the CPU time, what I get is very very small values!
  Reply With Quote

Old   April 18, 2003, 04:13
Default Re: CPU time
  #7
carlslack
Guest
 
Posts: n/a
This is a code snippet from my Windows Fortran90 program, if it's of any help...

use portlib

real elapsed_time

elapsed_time=timef() !start processor timer

... program stuff...

elapsed_time=timef() !stop processor timer

write(*,*) 'execution time: (sec)', elapsed_time

end program
  Reply With Quote

Old   April 18, 2003, 17:28
Default Re: CPU time
  #8
R.
Guest
 
Posts: n/a
Thank you very much!
  Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
TimeVaryingMappedFixedValue irishdave OpenFOAM Running, Solving & CFD 32 June 16, 2021 07:55
Computational time sunnysun OpenFOAM Running, Solving & CFD 5 March 16, 2009 04:32
AMG versus ICCG msrinath80 OpenFOAM Running, Solving & CFD 2 November 7, 2006 16:15
CPU time in Fluent5 HGG FLUENT 0 May 7, 2001 20:10
cpu time Gengsheng Wei Main CFD Forum 1 November 19, 1998 16:22


All times are GMT -4. The time now is 08:37.