Intel® C++ Parallelism Exploration Compiler, Prototype Edition

Author: Intel® Software Network
Published On: Wednesday, January 02, 2008 | Last Modified On: Tuesday, June 03, 2008

Product Overview

In recent years, multicore processors have overtaken single core processors as the predominant processor in the hardware system marketplace. Multicore processors provide a greater performance advantage when software is written with parallel programming. The need for new APIs continues to grow as current well known APIs serve only particular segments of the developer market.   

The Intel® C++ Parallel Exploration Compiler, Prototype Edition, uses novel C and C++ language extensions to make parallel programming easier. There are four keywords introduced within this version of the prototype compiler - __parallel, __spawn, __par, and __critical.  These are used as statement prefixes.  In order for the application to benefit from the parallelism afforded by these keywords, the compiler switch /Qpar must be used during compilation.  The compiler will link in the appropriate runtime support libraries, and the runtime system will manage the actual degree of parallelism.   

Sample Code

Example 1
This example demonstrates the difference between summing the elements of two arrays in a third array using a conventional compiler and using the Intel® C++ Parallel Exploration Compiler, Prototype Edition. Since the arrays are independent of each other, these tasks can be performed in parallel using the __parallel and __spawn prefixes.

Computing a Sum of Elements
The following is a function that computes the sum of elements:

int a[1000], b[1000], c[1000]; 

void f_sum ( int length, int *a, int *b, int *c )
{
int i;
for (i=0; i<length; i++)
{
c[i] = a[i] + b[i];
}
}

Typical Compiler – Call the Function Sequentially
In a conventional compiler, the following statement uses the above function to sum the elements of two arrays sequentially:

f_sum(1000, a, b, c);

Intel C++ Parallelism Exploration Compiler Method 1 – Call the Function in Parallel using _spawn and _parallel
The Intel® C++ Parallel Exploration Compliler, Prototype Edition allows you to change the way this function is called. The loop is divided into two concurrent computations:

__parallel 
{
__spawn f_sum(500, a, b, c);
__spawn f_sum(500, a+500, b+500, c+500);
}

Intel C++ Parallelism Exploration Compiler Method 2 – Parallelize the Function using _par
The Intel® C++ Parallel Exploration Compliler, Prototype Edition allows you to modify the function for parallel processing. Assuming that there is no overlap among arguments, the f_sum function is modified with the addition of the __par keyword. With no change to the way the function is called, the computation is parallelized.

void f_sum ( int length, int *a, int *b, int *c ) 
{
int i;
__par for (i=0; i<length; i++)
{
c[i] = a[i] + b[i];
}
}
Example 2
The following example uses the Intel® C++ Parallel Exploration Compiler, Prototype Edition to perform two parallel searches within a binary tree.

To compile this example, use the following command line to create the binary.

icl /Qpar example2.c
 
Please download and review the files example2.c , dict.txt and sample.txt.

The program works with a dictionary dict.txt file and an input sample.txt file. To sum the number of times each word in the dict.txt files appears in the sample.txt file, invoke the program with the following command:

Example2.exe sample.txt dict.txt

Technical Requirements

The Intel® C++ Parallel Exploration Compiler Prototype Edition works with applications running Microsoft Windows* on IA-32 processors. It has been built and tested in a Windows* XP* operating system environment running Microsoft* Service Pack 2. Performance in other environments may vary. The requirements are similar to the requirement Intel® C++ Compiler 10.1, Professional and Standard Editions, for Windows* found here.

Frequently Asked Questions

Q - What are some of the prerequisites to using these keywords?
A - These keywords are available on a Windows* operating system with C and C++ programming languages., using the Intel® C++ Compiler.

Q - Do I have to buy the Intel compiler to use these?
A - No you don't. You just need to make sure that you have an active license of the Intel® C++ Compiler. for Windows on your system. Acquire a commercial licence or try an evaluation copy of the Intel® C++ Compiler by visiting http://www.intel.com/cd/software/products/asmo-na/eng/compilers/284132.htm

Q – What type of feedback is the development team of Intel® C++ Parallel Exploration Compiler Prototype Edition looking for?
A – We are interested in your opinion on the usability of these extensions. We would like to know if they help you write parallel programs or if they impose too many restrictions. Also, please inform us if you find any yet unknown limitations.

Q - How do I get support?
A - You are welcome to join our What If forum and post your question. The team will keep any eye on the discussion board and do our best to answer your questions.

Q - What are the complete licensing terms for this product?
A - The licensing terms are listed on the download page.

Primary Technology Contact

Rajiv Deodhar
Senior Staff Engineer in Intel’s Compiler Lab. Rajiv has worked on compilers / architecture for a range of processors including embedded i960, the IXP network processor, IA-32 and Intel® Itanium. He has written assemblers and linkers and developed compilers for Pascal, C/C++, COBOL, and some proprietary languages. His current interests are in heterogeneous compilation: built-in compiler support for architectures that include a host processor and attached accelerators. His other interest is in making parallel programming more accessible by providing simple interfaces built into the programming language. Rajiv holds a Bachelors degree in Electrical Engineering and a Masters in Computer Science both from the Indian Institute of Technology, Bombay.

Post a comment If you have any questions, please contact our support team.