OpenMP Tasks not working.

OpenMP Tasks not working.

Hello

The following simple example does not work on my OS. I am evaluating the Parallel Studio.

The project properties have OpenMP enabled.

My OS is Vista x64 and the Composer is integrated into VS 2005 Academic Edition.

After starting the console application it goes into an infinite loop forcing me to reboot the OS.

It seems that no synchronisation points (taskwait) and termination conditions are considered.

Any tips on how to solve the issue are welcome.

Regards

Frank

#include "stdafx.h"

#include
#include

int fib(int n)
{
int i, j;
_RPTF1(_CRT_WARN, "Fib no = %d\n", n);
if (n<2)
return n;
else
{
#pragma omp task shared(i)
i=fib(n-1);
#pragma omp task shared(j)
j=fib(n-2);
#pragma omp taskwait
return i+j;
}
}

int _tmain(int argc, _TCHAR* argv[])
{
#pragma omp parallel
{
#pragma omp single
{
fib(20);
}
}
return 0;
}

8 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

Frank,
I don't see a problem with your code. However, I don't have a Visual Studio* 2005 Academic version available right now; I builtthe code onVisual Studio* 2008 Team SuiteEdition under Vista x64, but I don't think that this makes a difference.
Which is your Composer version? The neweset is Intel Parallel Composer Update 1.063 (in the Visual Studio About dialog).
Could youcheck if the path to the Intel libraries (including the Intel OpenMP* runtime library libiomp5md.dll) is set correctly (look at: Tools -> Options -> Intel Parallel Composer -> Compilers). It should be(default): C:Program Files (x86)IntelParallel StudioComposerlibintel64 Regards,
Hubert.

Quoting - Hubert Haberstock (Intel)
Frank,
I don't see a problem with your code. However, I don't have a Visual Studio* 2005 Academic version available right now; I builtthe code onVisual Studio* 2008 Team SuiteEdition under Vista x64, but I don't think that this makes a difference.
Which is your Composer version? The neweset is Intel Parallel Composer Update 1.063 (in the Visual Studio About dialog).
Could youcheck if the path to the Intel libraries (including the Intel OpenMP* runtime library libiomp5md.dll) is set correctly (look at: Tools -> Options -> Intel Parallel Composer -> Compilers). It should be(default): C:Program Files (x86)IntelParallel StudioComposerlibintel64 Regards,
Hubert.

Hello Hubert, thanks for your reply. I will check this as soon as I am at home. Furthermore I will install the Composer on my Windows XP 32-bit system and check how the application behaves there. Frank

Frank,
I don't see a problem on Windows XP* 32-bit under Visual Studio* 2005 or 2008 either.
You may have a look at the OpenMP* features of the Parallel Composer, the Intel Parallel Debugger Extension. In debug mode you will see a couple of OpenMP windows active (tasks, locks, barriers, teams, taskwaits).
Under Visual Studio 2005 you need to enable the exceptions manually, due to a technical restriction that cannot be solved:
Select Debug > Exceptions, expand the Win32 Exceptions tree, and enable items:
a1a01db0 Intel Parallel Debugger Extension Exception 0
a1a01db1 Intel Parallel Debugger Extension Exception 1
a1a01db2 Intel Parallel Debugger Extension Exception 2
This needs to be done once per project.
Hubert.

Hello Hubert
Please find below my configuration.
Moreover the dependency walker reported some errors:

Error: At least one module has an unresolved import due to a missing export function in an implicitly dependent module.
Error: Modules with different CPU types were found.

Please have a look at the attachments.
Thanks for your time.
Regards
Frank
-------------------------------------------------------------------------------------
Microsoft Visual Studio 2005
Version 8.0.50727.867 (vsvista.050727-8600)
Microsoft .NET Framework
Version 2.0.50727 SP2

Installed Edition: Standard

Microsoft Visual C++ 2005

Version 8.0.50727.867

Intel Parallel Composer Update 1
Intel Parallel Composer Update 1 (Package ID: composer_update1.063), Copyright 2002-2009 Intel Corporation

Microsoft Visual Studio 2005 Standard Edition - ENU Service Pack 1 (KB926601)
This service pack is for Microsoft Visual Studio 2005 Standard Edition - ENU.
If you later install a more recent service pack, this service pack will be uninstalled automatically.
For more information, visit http://support.microsoft.com/kb/926601

Update for Microsoft Visual Studio 2005 Standard Edition - ENU (KB932232)
This Update is for Microsoft Visual Studio 2005 Standard Edition - ENU.
If you later install a more recent service pack, this Update will be uninstalled automatically.
For more information, visit http://support.microsoft.com/kb/932232


Attachments: 

Hello

On Windows XP 32-bit the same project runs correctly. Results are correct too. Dependency walker reported no errors.

Frank

Quoting - minimax2000


Hi

I have some news. If I disable my firewall the debugger can connect to the win32 and x64 version of my application.

Otherwise I get an error message that the debugger cannot connect to the remote computer when trying to debug the x64 version. But what baffles me is that I want to debug locally and not remotely.

This thread covers the same problem.
http://social.msdn.microsoft.com/Forums/en-US/vsdebug/thread/945d20ae-6a48-4376-b44a-ff479d4836d6

So what settings of my firewall do I have to enable to get this working? I don't want to turn off my firewall during debug sessions. I have NetBios disabled by the way.

Frank

Quoting - minimax2000

Frank,
You can of course locally debug your application by choosing the local debugger instead of remote.
Project Properties -> Configuration Properties -> Debugging -> Choose 'Local Windows Debugger' from the Debugger to launch: drop-down menu.
Hubert.

Leave a Comment

Please sign in to add a comment. Not a member? Join today