Intel® oneAPI HPC Toolkit
Get help with building, analyzing, optimizing, and scaling high-performance computing (HPC) applications.
The Intel sign-in experience has changed to support enhanced security controls. If you sign in, click here for more information.
2017 Discussions

Howto compile hybrid openMP/MPI code from command line


Hi all,

when set from Visual Studio 2005, Intel Compiler C++ project, it works but when trying from a command line the simplest possible command:

mpiicc /Feout /Qopenmp omp-mpi.c

it is not possible to run it elsewhere than on the localhost. Could you tell me what is the minimal set of compiler options necessary for the compilation of the code which uses MPI and openMP at once? The code runsindependent openMP threadson each parallel part of the code on each node.

I think that Visual Studio adds lot of extra options, but I don't know what are the mininmalistic way.

E.g. non-openMP code could be compiled and linked using

icl /Feout /I"%I_MPI_ROOT%em64tinclude" /fast prog.c "%I_MPI_ROOT%em64tlibimpi.lib"

or simpler mpiicc /Feout /fast prog.c

But addign a /Qopenmp option induces that it can't be run on the nodes. It says:

launch failed: CreateProcess(\mastercluster_shareout.exe) on 'node1.cluster.local' failed, error 14001 - This application has failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem.

Any idea, please, what I am doing wrong?


0 Kudos
4 Replies

My first guess is that theremay bea conflict between libguide.lib and libguide40.dll. Sometimes it works whenlibguide DLLis or it is not loaded in the memory. What exactly does the /Qopenmp and how to avoid the conflict? The hint is to set KMP_Duplicate_lib_ok = True but it says that this option should not be used as it is deprecated. So what can help better?



Still doesn't work... Has somebody compiled, linked and executed it on WCCS, please?



Hi Martin,

Thank you for really good point. I was able to reproduce situation you mentioned and going to analyze it tomorrow.

At this point I see:

1. Yes, you need KMP_DUPLICATE_LIB_OK=TRUE to get app running on a single node.

2. Windows application log contains error messages like this:

Activation context generation failed for "....mpi-omp.exe.Manifest". Dependent Assembly Microsoft.VC80.OpenMP,processorArchitecture="amd64",publicKeyToken="1fc8b3b9a1e18e3b",type="win32",version="8.0.50727.762" could not be found. Please use sxstrace.exe for detailed diagnosis.

As Internet suggests, a tricky workaround could be to copy amd64_microsoft.vc80.openmp_* folders from c:windowswinsxs directory of the build node to execution node. Unfortunately I could not check it at the moment due to insufficient privileges.

I'll try to find more suitable solution.

- Grigory


Hi Marting,

It appears to be all about compiler, not MPI library.

Here are my suggestions to solve the problem:

1. To avoid "OMP abort: Initializing libguide.lib, but found libguide40.dll already initialized" message, add build option: /nodefaultlib:libguide.lib

2. To avoid startup failure, disable generation of manifest file with /manifest:no command line option and remove generated if remain.

So the final command line would be like this:

> icl /Qopenmp omp.c /link -nodefaultlib:libguide.lib /manifest:no


> mpiicc /Qopenmp mpi-omp.c /link -nodefaultlib:libguide.lib /manifest:no

- Grigory