Intel® Moderncode for Parallel Architectures
Support for developing parallel programming applications on Intel® Architecture.

Core i7 software development

theintelid
Beginner
1,636 Views
Could you please suggest where to start learning how to develop multi-core software
for the i7 (or generally other Intel multi-core CPUs) ?

I am using MSVS 2008/2010 on Windows 7 (i7) and xcode on a MacBook Pro (i5).


I couldn't search through past posts so this might be a duplicate.


Thanks
R



0 Kudos
15 Replies
jimdempseyatthecove
Honored Contributor III
1,636 Views
Most compilers and operating systems support OpenMP in C, C++ Fortran and some of the other languages. I suggest you start there. Search your compiler documentation for OpenMP.

See: https://computing.llnl.gov/tutorials/openMP/

This should get you started.

Jim Dempsey
0 Kudos
theintelid
Beginner
1,636 Views
Thanks for response.

You have not mentioned TBB. Is there any reason or that OpenMP is lower-level in general ?

A while back someone was tryin to dicourage me using OpenMP saying it had too much over head.
Has this been an issue for developers ?

0 Kudos
TimP
Honored Contributor III
1,636 Views
TBB is available only for C++, and comes pre-configured only with Intel C++. It has at least as much overhead as OpenMP. In my opinion, it's more difficult in the cases where both are applicable. As you haven't given any background to change the recommendation, I agree with Jim's recommendation. The portable threading models all have a fair amount of overhead, such as in the sense that thousands of loop iterations are needed for it to pay off.
In intent, TBB (and Cilk+ and ArBB) are meant to be more flexible than OpenMP, for example in allowing multiple applications to play together automatically.
0 Kudos
Christopher_K_
Beginner
1,636 Views
Since you've mentioned VS 2010 and Xcode, I am going to go with the premise that you are writing your applications in the language of C/C++. Ever consider going .NET or Java? No direct access to new processor commands but with todays multi-core chips and the threading built-into C# and Java, you can accomplish your desired ends by different means. It would require less work on your part as both languages were built with threads from the start - less code to write. The OS (Windows and Mac) will schedule everything if you write multi-threaded apps in these languages. You can even pull off asymmetric scheduling in your app if you want to gain that much granularity of control. You can get machine speed performance out of a CLR or JRE program if it's written well. .NET is available for Mac OS X as Open Source Mono. Of course, Java is available in several forms...Apple, OpenJDK and Oracle-Sun JVMs. Just my two cents.

- CCK
0 Kudos
BW2
Beginner
1,636 Views

OpenMP is a good start butthe Intel Compiler 6.0 supports a new (-QPARALLEL) compiler flag option, which can identify loop structures(That OpenMP does not )that contain parallelism.The compilerwill attempts to decompose the parallelism into threads for parallel processing.

0 Kudos
jimdempseyatthecove
Honored Contributor III
1,636 Views
Excepting for trivial sample programs auto-parallelization is not as effective as explicit parallization using OpenMP directives. OpenMP does not identify any opportunities for parallel programming. It is the programmer's responsibility to inform the compiler, through use of OpenMP directives, the regions of code which the programmer wants to be performed in parallel.
0 Kudos
theintelid
Beginner
1,636 Views
Makes sense. I was actually wondering if I could emulate an MIMD execution environment where we program separate cores with separate memory areas. It looks like OpenMP helps more with data parallelism if I'm right? What would you suggest for this?
0 Kudos
techforums123
Beginner
1,636 Views
You could check with w3 schools .about the same,
0 Kudos
theintelid
Beginner
1,636 Views
sorry you lost me?
0 Kudos
TimP
Honored Contributor III
1,636 Views
You're correct that OpenMP concentrates most strongly on data parallelism, with the possible exception of the task facility. The recent C++ models, Cilk+ in particular, are meant to give more support for heterogeneous parallel tasks.
0 Kudos
jimdempseyatthecove
Honored Contributor III
1,636 Views
I think it wise for you to learn to walk before you learn to run. OpenMP is a good entry point for you to learn to walk.

With todays processors supporting SSE (SIMD / small vectors) and now AVX (larger small vectors) your programming model becomes MIMD + SIMD.

With a foundation in parallel programming using OpenMP you will find it quite easy to migrate to other parallel programming paradigms. Build your skill set slowly as it is much easier (and less frustrating) to learn from successes than to learn from failures. Although you will find some insight in experimenting with example programs (distributed with your compiler), my experience has been that nothing is a better learning process than taking your main application, one you are intimately familiar with, and step-by-step introduce improvements through parallization.

Expect that you will make mistakes so keep multi-levels of backups so you can always backtrack to a working copy of your code and verify what changes you made that broke the code. This will help you to correct your errors in programming.

Learn how to use the performance monitoring tools, but do not completely rely on them to tell you the best way to improve your code -this knowledge will come to you as you gain experience. You will find that some applications will benefit more from reorganization than focusing on "hot spots".

Few applications are completely data parallel, most will benefit with some degree of independent tasking with synchronization points combined with data parallel sections. OpenMP can handle this combination. Recent extensions to OpenMPinclude tasking and earlier standards supported nested parallel regions.

After reachinga moderate skill level using OpenMP, then explore using other parallel programmingparadigms.

In my opinion, the problem with starting parallel programming using TBB is it is too hard, the problem with starting parallel programming using Cilk++ is it is too easy (at least to do the simple parts). Starting with OpenMP will give you the experience in learning what the issues are in parallel programming and how to deal with these issues.

Jim Dempsey
0 Kudos
theintelid
Beginner
1,636 Views
Intel Parallel Studio seems to offer a very complete set of tools. Am I right?
I think I would be able to use both OpenMP as well as TBB with the C/C++ compiler in this package ?

I just like to know what the Parallel Advisor offers in particular ?
0 Kudos
TimP
Honored Contributor III
1,636 Views
If you've read the ads, there's not much for it but to go ahead and try it. Advisor is primarily to support prototyping proposed parallelization.
0 Kudos
theintelid
Beginner
1,636 Views
Thanks everyone for all your answers. Intel press has really good books which is also a great help.
0 Kudos
wardrobechoice
Beginner
1,636 Views
Thanks to your posts!It help me in solving problems on my pc.I will visit your site again.
____________________
0 Kudos
Reply