LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Does calling an element of an array calls the whole array (https://www.linuxquestions.org/questions/programming-9/does-calling-an-element-of-an-array-calls-the-whole-array-4175415101/)

unkn(0)wn 07-05-2012 02:31 PM

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.

amani 07-05-2012 06:52 PM

It depends on your code.
library: blas?
Usually it should be about distributing tasks to processors.

unkn(0)wn 07-05-2012 08:07 PM

Well i am distributing partitions to different Processors. Coding OpenMP.

onebuck 07-06-2012 07:50 PM

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.


All times are GMT -5. The time now is 06:08 PM.