|
[Sponsors] |
April 16, 2003, 21:27 |
CPU time
|
#1 |
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. |
|
April 17, 2003, 06:52 |
Re: CPU time
|
#2 |
Guest
Posts: n/a
|
At the Unix prompt, enter:
time yourprog Manosh |
|
April 17, 2003, 09:45 |
Re: CPU time
|
#3 |
Guest
Posts: n/a
|
In Fortran directly,
REAL time_begin, time_end ... CALL CPU_TIME(time_begin) ... CALL CPU_TIME(time_end) |
|
April 17, 2003, 16:08 |
Re: CPU time
|
#4 |
Guest
Posts: n/a
|
Thanks but none did work! Do I have to use the library?
I am writing my code on Unix computer. |
|
April 17, 2003, 19:27 |
Re: CPU time
|
#5 |
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.
|
|
April 17, 2003, 20:19 |
Re: CPU time
|
#6 |
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! |
|
April 18, 2003, 04:13 |
Re: CPU time
|
#7 |
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 |
|
April 18, 2003, 17:28 |
Re: CPU time
|
#8 |
Guest
Posts: n/a
|
Thank you very much!
|
|
Thread Tools | Search this Thread |
Display Modes | |
|
|
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 |