|
[Sponsors] |
May 20, 2010, 17:50 |
Fortran Array/Vector choice optimization
|
#1 |
New Member
Join Date: Apr 2010
Posts: 20
Rep Power: 15 |
Hello everyone,
I want to ask a very basic question. Which one is faster(CPU),and economical (memory/RAM) reading a column of an array or directly a vector? Like I may create an array of size(5,n) or 5 vector of size(n). Do you suggest which one? (and in what condition, like coarse/fine mesh, using always, or to read just in an "if statement") Thanks, Emre |
|
May 21, 2010, 08:36 |
|
#2 |
Senior Member
Join Date: Nov 2009
Posts: 411
Rep Power: 19 |
On a serial machine probably the vector option will be faster, on a multiprocessor machine you can read your array columns in parallel! I suggest the use of MPI or OpenMP.
If you have a particular hardware in mind just implement a small test code and measure the time it needs to read a 5*n vector or a (n,5) array. Do |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
BOOK ON OPTIMIZATION OF FORTRAN CODES | Alberto | Main CFD Forum | 3 | November 10, 2008 06:07 |
Intrinsic Procedure 'ISNAN' in GNU FORTRAN 77 | hawk | Main CFD Forum | 1 | April 12, 2005 22:13 |
visual fortran | Monica | Main CFD Forum | 1 | August 28, 2004 20:45 |
Fortran77 or Fortran 90 | Swapnil | CFX | 2 | November 26, 2002 15:16 |
Why Favoring Fortran over C/C++? | Zi-Wei Chiou | Main CFD Forum | 35 | September 26, 2001 09:34 |