Arrays pointers for parallel algorithms, Computer Networking

Arrays Pointers

An array is a set of the same type of data. Arrays are very well-liked data structures in parallel programming due to their easiness of use and declaration. At the single hand, arrays can be used as a common memory resource for the shared memory programming; on the other hand they can be simply partitioned into sub-arrays for data parallel programming. This is the easiness of the arrays that creates them most frequently used data structure in parallel programming.  We shall study arrays in the context of two languages C and Fortran 90.

Consider the array shown below. The size of the array is 10.











Index of the primary element in Fortran 90 is 1 but that in C is 0 and therefore the index of the last element in Fortran 90 is 10 and that in C is 9. If we assign the name of array as A, then ith element in Fortran 90 is A(i) but in C  it is A[i-1].  Arrays may be one- dimensional or they might be multi-dimensional.

General form of declaration of array in Fortran 90 is

type, DIMENSION(bound) [,attr] :: name

for example the declaration


declare an array A of size 5.

General form of declaration of array in C is

type array_name [size]

For example the declaration A

int A[10]

declares an array of size 10.

Fortran 90 allows one to use particular sections of an array. To access a section of an array, you require the name of the array followed by the two integer values divided by a colon enclosed in the parentheses. The integer values signify the indices of the section required.

For example, a(3:5) refers to elements 3, 4, 5 of the array, a(1:5:2) refers to elements 1, 3, 5 of the array , and b(1:3, 2:4) refers to the elements from rows 1 to 3 and columns 2 to 4. In C there is only one type of array whose size is determined statically, though there are provisions for dynamic allocation of storage by pointers and dynamic memory allocation functions like calloc and malloc functions. In Fortran 90, there are 3 possible kinds of arrays depending on the binding of an array to an amount of storage : Static arrays with fixed size at the time of declaration and cannot be altered during implementation ; Semi-dynamic arrays or automatic arrays: the size is determined after entering a subroutine and arrays can be formed to match the exact size needed, but local to a subroutine ; and Dynamic arrays or  allocatable arrays  : the size can be altered during implementation.

In these languages, array operations are written in a compact form that often makes programs more clear.

Consider the loop:


do i=1,n a(i)=b(i)+c(i)


end do

It can be written (in Fortran 90 notation) as follows:

a(1:n) = b(1:n) +c(1:n)


In addition to Fortran 90, there are lot of languages that gives succinct operations on arrays. Some of the most liked are APL, and MATLAB. While these languages were not developed for parallel computing, quite for expressiveness, they can be used to state parallelism since array operations can be easily implemented in parallel. Therefore, all the arithmetic operations (+, -, * /, **) engaged in a vector expression can be performed in parallel. Intrinsic reduction functions, such as the sum above, also can be done in a parallel .

Posted Date: 3/2/2013 7:37:53 AM | Location : United States

Related Discussions:- Arrays pointers for parallel algorithms, Assignment Help, Ask Question on Arrays pointers for parallel algorithms, Get Answer, Expert's Help, Arrays pointers for parallel algorithms Discussions

Write discussion on Arrays pointers for parallel algorithms
Your posts are moderated
Related Questions
Question : (a) How do you relate the subsequent terms in the context of an information system: data, information and decision-making. (b) Why do you think organisations nowa

Question: a) Compare Bluetooth and WIFI based networks over the following factors: Data rate, Range, Application Focus, Battery Power, Frequency Band, Security. b) Differe

Qustions: Simplify the following expression using a Karnaugh map: F = XY‾Z + X‾Y‾Z + XY Z +X‾ Y Z

What is difference among ARP and RARP? The address resolution protocol (ARP) is used to associate the 32 bit IP address with the 48 bit physical address, used by a host or a ro

Question: a) List three characteristics and two potential problems of a peer-to-peer environment. b) List three characteristics and two potential problems of a client/

Butterfly permutation This permutation is getting by interchanging the important significant bit in address with smallest significant bit.

On a LAN where are IP Datagram transported?

Explain about star topology This topology, obviously, needs a great deal of cabling. This design gives an excellent platform for reconfiguration and trouble-shooting. Changes t

Q Illustrate Unipolar line coding? - Simplest method is inexpensive - Utilizes only one voltage level - Polarity is habitually assigned to binary 1 a 0 is represented by

Q. What is Two Types of Errors? Single-Bit Errors: Merely one bit in the data unit has changed Burst Errors of length 'n': 2 or more bits in the data unit have changed (