p*******s 发帖数: 91 | 1 We have some Monte Carlo simulation code in Fortran,
it is very slow,
if assuming the code is reasonable written
do you think rewriting it in C will improve the performance a lot?
if just wrap it using C, will speed it ?
thanks | f****r 发帖数: 27 | 2 Generally speaking, the performance of Fortran 77 program is better than
Fortran 90, while both of them are better than C and C++.
See www.cs.rpi.edu/~nortonc/OOF90/performance.html for some benchmark.
【在 p*******s 的大作中提到】 : We have some Monte Carlo simulation code in Fortran, : it is very slow, : if assuming the code is reasonable written : do you think rewriting it in C will improve the performance a lot? : if just wrap it using C, will speed it ? : thanks
| p*******s 发帖数: 91 | 3 thanks a lot
【在 f****r 的大作中提到】 : Generally speaking, the performance of Fortran 77 program is better than : Fortran 90, while both of them are better than C and C++. : See www.cs.rpi.edu/~nortonc/OOF90/performance.html for some benchmark.
| h***o 发帖数: 539 | 4 use gnu profile (gprof) to analyze which part is the most time
consuming, then try to optimize that part.
【在 p*******s 的大作中提到】 : We have some Monte Carlo simulation code in Fortran, : it is very slow, : if assuming the code is reasonable written : do you think rewriting it in C will improve the performance a lot? : if just wrap it using C, will speed it ? : thanks
| n******t 发帖数: 4406 | 5
~~~
move this out.
【在 f****r 的大作中提到】 : Generally speaking, the performance of Fortran 77 program is better than : Fortran 90, while both of them are better than C and C++. : See www.cs.rpi.edu/~nortonc/OOF90/performance.html for some benchmark.
| f****r 发帖数: 27 | 6 Well, the performance of C could be really close to Fortran, but need some
extra work on programming. For example, quoted from
"www.hpcf.cam.ac.uk/C_rant.html",
The bottom line effect of this difficulty easy to see: compiling the standard
sources of LINPACK on babbage achieves 54 MFLOPS in FORTRAN and only
34 MFLOPS in C - significantly in FORTRAN's favour. The use of
(non-portable) directives does improve
this, with equal performance being achievable with C
and FORTRAN on babbage.
【在 n******t 的大作中提到】 : : ~~~ : move this out.
| r*****d 发帖数: 54 | 7 no, I think Fortran is faster than C in most cases.
Why do you think it is slow?
【在 p*******s 的大作中提到】 : We have some Monte Carlo simulation code in Fortran, : it is very slow, : if assuming the code is reasonable written : do you think rewriting it in C will improve the performance a lot? : if just wrap it using C, will speed it ? : thanks
| o******d 发帖数: 1552 | 8 they are comparable, when you check the corresponding assembly codes of
the C and Fortran. this claim is true. Fortran does not support recursion.
if you use recursions in C, but use the functionally equivalent loops in
Fortran, of course Fortran outperforms C.
【在 r*****d 的大作中提到】 : no, I think Fortran is faster than C in most cases. : Why do you think it is slow?
| n******t 发帖数: 4406 | 9 I think we are talking about a different concept.
the potential speed of a certian language and
the difficulty of an optimize implemention.
【在 f****r 的大作中提到】 : Well, the performance of C could be really close to Fortran, but need some : extra work on programming. For example, quoted from : "www.hpcf.cam.ac.uk/C_rant.html", : The bottom line effect of this difficulty easy to see: compiling the standard : sources of LINPACK on babbage achieves 54 MFLOPS in FORTRAN and only : 34 MFLOPS in C - significantly in FORTRAN's favour. The use of : (non-portable) directives does improve : this, with equal performance being achievable with C : and FORTRAN on babbage.
|
|