HOME

TheInfoList



OR:

Ateji PX is an
object-oriented Object-oriented programming (OOP) is a programming paradigm based on the concept of "objects", which can contain data and code. The data is in the form of fields (often known as attributes or ''properties''), and the code is in the form of ...
programming language A programming language is a system of notation for writing computer programs. Most programming languages are text-based formal languages, but they may also be graphical. They are a kind of computer language. The description of a programming ...
extension for
Java Java (; id, Jawa, ; jv, ꦗꦮ; su, ) is one of the Greater Sunda Islands in Indonesia. It is bordered by the Indian Ocean to the south and the Java Sea to the north. With a population of 151.6 million people, Java is the world's mo ...
. It is intended to facilliate
parallel computing Parallel computing is a type of computation in which many calculations or processes are carried out simultaneously. Large problems can often be divided into smaller ones, which can then be solved at the same time. There are several different f ...
on
multi-core processor A multi-core processor is a microprocessor on a single integrated circuit with two or more separate processing units, called cores, each of which reads and executes program instructions. The instructions are ordinary CPU instructions (such ...
s,
GPU A graphics processing unit (GPU) is a specialized electronic circuit designed to manipulate and alter memory to accelerate the creation of images in a frame buffer intended for output to a display device. GPUs are used in embedded systems, mobi ...
, Grid and Cloud. Ateji PX can be integrated with the
Eclipse IDE Eclipse is an integrated development environment (IDE) used in computer programming. It contains a base workspace and an extensible plug-in system for customizing the environment. It is the second-most-popular IDE for Java development, and, ...
, requires minimal learning of the additional parallel constructs and does not alter the development process.


Code examples


Hello World

public class HelloWorld Each , , symbol introduces a parallel branch. Running this program will print either
Hello
World
or
World
Hello
depending on how the parallel branches happen to be scheduled.


Data parallelism

, (int i : array.length) array +; The quantification (int i : N) creates one parallel branch for each value of i. The effect of this code is to increment all elements of array in parallel. This code is equivalent to , array , array , array rray.length-1+; More complex quantifications are possible. The following example quantifies over the upper left triangle of a square matrix: , (int i:N, int j:N, if i+jj+; ] Code that performs a similar and typically small operation on a large collection of elements is called Data parallelism, data parallel, and appears often in high-performance scientific applications. A typical representative of data-parallel languages for the C/C++ or Fortran ecosystems is
OpenMP OpenMP (Open Multi-Processing) is an application programming interface (API) that supports multi-platform shared-memory multiprocessing programming in C, C++, and Fortran, on many platforms, instruction-set architectures and operating syst ...
. Data parallelism features can also be implemented by libraries using dedicated data structures, such as
parallel array In computing, a group of parallel arrays (also known as structure of arrays or SoA) is a form of implicit data structure that uses multiple arrays to represent a singular array of records. It keeps a separate, homogeneous data array for each fi ...
s.


Task parallelism

The term task parallelism is used when work can conceptually be decomposed into a number of logical tasks. In this example, tasks are created recursively: int fib(int n) Task parallelism is implemented in languages such as
Cilk Cilk, Cilk++, Cilk Plus and OpenCilk are general-purpose programming languages designed for multithreaded parallel computing. They are based on the C and C++ programming languages, which they extend with constructs to express parallel loops ...
, and in libraries similar to the fork/join pair of Unix system calls.


Message-passing

Parallel branches have two ways of communicating; either by concurrently reading and writing shared variables, or by sending explicit messages. The operators ! and ? respectively send and receive a message on a channel. In this example, two parallel branches communicate via explicit message passing: Chan chan = new Chan(); , chan ! "Hello"; // branch 2 receives a value from the channel and prints it , , chan ? s; System.out.println(s);


Data-flow

A program is said to be data-flow when computation is initiated and synchronized by the availability of data in a flow. A typical example is an adder: it has two inputs, one output, and whenever the two inputs are ready, it sends their sum on the output. void adder(Chan in1, Chan in2, Chan out) Note the parallel read , in2 ? value2; /code>. It means that the two input values can come in any order. Without it, the code may deadlock if values were coming in the wrong order. This shows that parallel primitives in a programming language are not only about performance, but also about the behavior of programs. The adder by itself doesn't do anything, since it reacts on input data. It needs to be put in a context where other parts feed input values and read output values. The way to express this is to compose all pieces in a large parallel block: , source(c1); // generates values on c1 , , source(c2); // generates values on c2 , , adder(c1, c2, c3); , , sink(c3); // read values from c3 Anything that can be thought of as a combination of logical gates or electrical circuits can readily be expressed in this way as a data-flow program.


External links

* {{Parallel computing Object-oriented programming languages Concurrent programming languages Java programming language family Statically typed programming languages JVM programming languages