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

Fortran Array/Vector choice optimization

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 20, 2010, 17:50
Default Fortran Array/Vector choice optimization
  #1
New Member
 
Join Date: Apr 2010
Posts: 20
Rep Power: 15
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")

Thanks,

Emre
ares is offline   Reply With Quote

Old   May 21, 2010, 08:36
Default
  #2
Senior Member
 
Join Date: Nov 2009
Posts: 411
Rep Power: 19
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.

Do
DoHander is offline   Reply With Quote

Reply


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
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


All times are GMT -4. The time now is 02:20.