Did you know LQ has a Linux Hardware Compatibility List?
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


Search this Thread
Old 07-05-2012, 03:31 PM   #1
Registered: Aug 2011
Distribution: Slackware 14, Debian 7.0.0 Wheezy, Windows 7, Windows 8
Posts: 116

Rep: Reputation: Disabled
Does calling an element of an array calls the whole array

I am working on code to multiply matrices of higher dimensions eg. 10000x10000.
Code is working, but i want to reduce the time elapsed as much as possible.

So i used Cannon's Matrix Multiplication algorithm, (In this algorithm Matrix is divided into partitions of smaller size, as 5,10,20,100 or whatever we want). I have a doubt that whenever i access any partition(element) of that 2d array, Does the whole row or column of that 2d array is fetched to memory or cpu ? Or only that specific partition(element) is fetched ?

If the whole row or column is fetched. Suggest some ways to fetch only that specific partition(element). Can vectors do that? Or i have to create N smaller 2d matrices (N = number of partitions) and copy data of matrix into smaller matrices.

PS: This seems to be part of Computer Architecture to me.
Old 07-05-2012, 07:52 PM   #2
Senior Member
Registered: Jul 2006
Location: Kolkata, India
Distribution: 64-bit GNU/Linux, Kubuntu64, Fedora QA, Slackware,
Posts: 2,758

Rep: Reputation: Disabled
It depends on your code.
library: blas?
Usually it should be about distributing tasks to processors.
Old 07-05-2012, 09:07 PM   #3
Registered: Aug 2011
Distribution: Slackware 14, Debian 7.0.0 Wheezy, Windows 7, Windows 8
Posts: 116

Original Poster
Rep: Reputation: Disabled
Well i am distributing partitions to different Processors. Coding OpenMP.
Old 07-06-2012, 08:50 PM   #4
Registered: Jan 2005
Location: Midwest USA, Central Illinois
Distribution: SlackwareŽ
Posts: 11,381
Blog Entries: 3

Rep: Reputation: 1478Reputation: 1478Reputation: 1478Reputation: 1478Reputation: 1478Reputation: 1478Reputation: 1478Reputation: 1478Reputation: 1478Reputation: 1478
Moderator Response

Moved: This thread is more suitable in <Programming> and has been moved accordingly to help your thread/question get the exposure it deserves.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Regarding Out of bound array element acess Santoshkb Programming 2 01-31-2010 08:27 PM
[perl] copying an array element into another array s0l1dsnak3123 Programming 2 05-17-2008 02:47 AM
Every Element in C++ Array Points to the Same Thing anamericanjoe Programming 5 12-14-2006 09:26 PM
index of an element in the array ? thelonius Programming 1 09-24-2005 01:41 PM
C++ Six Element Array petercool Programming 2 08-20-2003 12:08 PM

All times are GMT -5. The time now is 05:04 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration