Intel® C++ Parallelism Exploration Compiler, Prototype Edition

Important Update for Downloaders

Features in the Intel® C++ Parallelism Exploration Compiler, Prototype Edition, have been incorporated into the Intel® Parallel Studio product now in public beta.  Go to the Intel® Parallel Studio page now, download the beta and start adding parallelism to your applications today.

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]; 

} 

}

 

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

Features in the Intel® C++ Parallelism Exploration Compiler, Prototype Edition, have been incorporated into the Intel® Parallel Studio product now in public beta.  Go to the Intel® Parallel Studio page now, download the beta and start adding parallelism to your applications today.


Frequently Asked Questions

Q - What happened to the Intel® C++ Parallelism Exploration Compiler, Prototype Edition?
A - Our experiment with this compiler was successful and it is no longer available as a prototype.  Features of the Prototype Edition have been incorporated into the Intel® Parallel Studio product now in public beta.  Go to the Intel® Parallel Studio page now, download it and start adding parallelism to your applications today.

 

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 license or try an evaluation copy of the Intel® C++ Compiler by visiting /en-us/

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 - Support for the prototype edition is no longer offered; past posts related to the prototype edition are viewable in the What If forum.  Support for Intel® Parallel Studio is available in the Intel® Parallel Studio forum.

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.


 

For more complete information about compiler optimizations, see our Optimization Notice.

Comments

cool, thats how intel's pro programmer indent their code. i have to show this to my teacher who always wants to me to use this weird tabulator stuff, hehe


#include<iostream>
#include<conio.h>
using namespace std;

class date{
int day, month, year;
char c;
public:
void getdate(){
cout<<"Enter date in [12/31/97] format: ";
cin >>day>>c>>month>>c>>year;}
void showdate() const { cout<<"Date is: "<<day<<c<<month<<c<<year;}};

void main(void)
{
cout<<"### Programmed By Amahdy(MrJava) ,right restricted.~~~~~~~~~~~~~~~~~~~~~~~~~~~~n";
cout<<"-------------------------------------------------------------------------------n"<<endl;

date x;

do{
x.getdate(); x.showdate();
cout<<"nn !Press c to continue or any key to exit."<<endl<<endl;
}while(getch()=='c');
}


I am new to learning C++. I going through basic books and cds. The code above is a little different than I have seen in the books. If I down load this trail version, would I be able to run some basic C++ codes? Please advice.




I reject the idea of adding yet another set of incompatible keywords to a particular compiler.
We see dozens of approaches to parallelism. From what I've read I see no difference to a &quot;#pragma omp parallel for&quot; statement. I'd strongly recommend to go ahead with just a single surface form.
Now what's under the hood could be completely different and innovative, that I can not judge. Here is the realm for new inventions. Please don't pollute the keywords.


For __par for, the execution model is not based on tasks. It is simply a OpenMP fork-join model with static-even loop partitioning based on the number of cores in the system.

Also, we have two modes for multi-processes running case, you can choose by setting the library environment KMP_LIBRARY=[turnaround | throughtput]
Details see the reply I posted in the discussion forum



Smith, A thread pool is

Smith, A thread pool is created to run programs that use the parallelism features. The number of threads in the pool is determined at runtime based on the number of logical cores available on the system. Tasks are then scheduled to those threads. The other processes running on the system are not directly taken into account. (Thanks to Rajiv for emailing me the answer). I've set up a thread on the forum for further discussion.