CFD Online Logo CFD Online URL
Home > Forums > Main CFD Forum

Fortran Array/Vector choice optimization

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

LinkBack Thread Tools Display Modes
Old   May 20, 2010, 17:50
Default Fortran Array/Vector choice optimization
New Member
Join Date: Apr 2010
Posts: 15
Rep Power: 9
ares is on a distinguished road
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")


ares is offline   Reply With Quote

Old   May 21, 2010, 08:36
Senior Member
Join Date: Nov 2009
Posts: 411
Rep Power: 13
DoHander is on a distinguished road
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.

DoHander is offline   Reply With Quote


Thread Tools
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 On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
BOOK ON OPTIMIZATION OF FORTRAN CODES Alberto Main CFD Forum 3 November 10, 2008 07: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 16:16
Why Favoring Fortran over C/C++? Zi-Wei Chiou Main CFD Forum 35 September 26, 2001 09:34

All times are GMT -4. The time now is 23:35.