Quantcast
Channel: Intel® Software - Intel® C++ Compiler
Viewing all 2797 articles
Browse latest View live

OpenMP parallel loop with ordered section is slow

$
0
0

In the attached C sample I try to parallelize formatted writes to file by doing the formatting into a string buffer inside OpenMP parallel for and then writing the buffer to file with fwrite (inside an OpenMP ordered section). I see nice speedups with gcc, however slowdown instead with icc.

The attached code first writes the data in a serial fashion for reference, than does it in parallel and compares timings.

icc -O2 -qopenmp parawrite.c
$ OMP_NUM_THREADS=6 ./a.out
Time elapsed serial: 6.723 s
Time elapsed parallel: 9.325 s

$icc -v
icc version 19.0.1.144 (gcc version 8.2.0 compatibility)

$ gcc -O2 -fopenmp parawrite.c
$ OMP_NUM_THREADS=6 ./a.out
Time elapsed serial: 6.721 s
Time elapsed parallel: 1.206 s

$gcc --version
gcc (GCC) 8.2.0

Any ideas what is going on? BTW I see a similar (bad) behavior also with equivalent code in Fortran and ifort...

Best regards
Pavel Ondračka

AttachmentSize
Downloadtext/x-csrcparawrite.c1.38 KB

Compilation error due to SDK (probably) incompatibility

$
0
0

Hi,

I am unable to build my project in visual studio 2017.

I seem to have correctly installed SDK version 10.0.17763.0, Intel MKL library, Intel C++ compiler 18.0 installed with VS2017.

Any help would be greatly appreciated. Please see the link. 

Properties and Error in VS2015

Thanks

Pulkit

Intel parallel studio XE on openSUSE - mpirun segmentation fault

$
0
0

Dear All,

I am wrining here in order to find some help by someone more expert than me with this problems. I have tried to install on openSUSE leap 15 the latest version of parallel studio XE. The install were fine except for a warning about some 32bit libraries which I am no able to find anywhere...  In any case I have disabled the installation of 32bit packages at all. 

I have tried to compile a simple helloWorld program which runs well under openmpi, but intel produces this error:

/home/eod/intel//compilers_and_libraries_2019.1.144/linux/mpi/intel64/bin/mpirun: line 103: 15964 Segmentation fault      (core dumped) mpiexec.hydra "$@" 0<&0

I have really no idea on how to fix this.

Any hint is hightly appreciated. Thanks

Edoardo

Problem with FFT code exemple and Visual Studio 2017

$
0
0

Hello

I am trying to run the FFT code exemple. I am using Visual Studio with the intel 2019 compiler

this is my code 
#include "pch.h"
#include <iostream>
#include "mkl_dfti.h"

int main()
{
	/* C example, float _Complex is defined in C9X */

	float _Complex x_in[32];
	float _Complex x_out[32];
	float y_in[32];
	float y_out[34];

	DFTI_DESCRIPTOR_HANDLE my_desc1_handle;
	DFTI_DESCRIPTOR_HANDLE my_desc2_handle;
	MKL_LONG status;
	//...put input data into x_in[0],...,x_in[31]; y_in[0],...,y_in[31]
	for (int i = 0; i < 32; i++)
	{
		x_in[i] = cos(2 * 3.1415926535897932384626433832795*i * 4 / 32);
		
	}
	
	status = DftiCreateDescriptor(&my_desc1_handle, DFTI_SINGLE,
		DFTI_COMPLEX, 1, 32);
	status = DftiSetValue(my_desc1_handle, DFTI_PLACEMENT, DFTI_NOT_INPLACE);
	status = DftiCommitDescriptor(my_desc1_handle);
	status = DftiComputeForward(my_desc1_handle, x_in, x_out);
	status = DftiFreeDescriptor(&my_desc1_handle);
	/* result is x_out[0], ..., x_out[31]*/
	status = DftiCreateDescriptor(&my_desc2_handle, DFTI_SINGLE,
		DFTI_REAL, 1, 32);
	Status = DftiSetValue(My_Desc2_Handle, DFTI_PLACEMENT, DFTI_NOT_INPLACE);
	status = DftiCommitDescriptor(my_desc2_handle);
	status = DftiComputeForward(my_desc2_handle, y_in, y_out);
	status = DftiFreeDescriptor(&my_desc2_handle);
	/* result is given by y_out in CCS format*/
}

And I have problems with the float _Complex type.

I have set the '/Qstd=c99' option in my project but visual studio returns an error about this option. It says "the '/Qstd=c99' option is not valid for C++ compilations"

My program is not a c++ program

Any idea to solve this problem

Remi

Warning code for catching semicolon after a while loop

$
0
0

Hello all.

I wonder if there is a warning code which

flags that there is placed an unintentional semicolon 

after a while loop.

while(condition);

{

  Body

}

I have already sought after the warning code my

self in the documentation and have written

code trying to provoke a warning but without

any luck. I have enabled all warnings but to

no avail. The compiler is Intel C++ 2019.

If there is no warning code for this, my vain

hope is that Intel will in time add an warning

for this, because I cannot be the first or the last

to have this kind of bug.

Please be kind it is my first posting in this

forum. Hope my attempt at writing in English

is understandable.

 

Best regards

Jan, DK. 

[OpenMP] class member variable in class member functions

$
0
0
class Foo {
    double scaleFactor;
    std::vector<double> a,b;
    
    void init(){
        scaleFactor = 0.5;
        // init a, b to same size
    }

    void bar(){
        const int len=a.size();
        // The bug is removed if I insert the following line
        // const double scaleFactor=this->scaleFactor;
        #pragma omp parallel for
        for(int i=0;i<len;i++){
                a[i]=b[i]*scaleFactor;
        }
    }
};

int main(){
    Foo foo;
    foo.init();
    foo.bar();
    return 0;
}

My code is like this (more complicated but can be simplified as this), and has a bug when compiled with icpc 2019 (gcc 7.4 in PATH), linked to iomp5. The scaleFactor in member function bar() has value 0 in the openmp loop. The bug can also be removed if one line is added as the comment described. If I switch to another compiler, like gcc 8.2 (no intel, linked to gomp), the extra line is not needed and the bug does not appear.

My question is:

(1) Can I use member variable in member function? It seems OK according to OpenMP 4.5 specification, 2.15.3.2:

 A variable that is part of another variable (as an array or structure element) cannot appear in a shared clause except if the shared clause is associated with a construct within a class non-static member function and the variable is an accessible data member of the object for which the non-static member function is invoked.

(2) Are there any best-practice recommendations?

 

boost Version 1.70.0 beta Intel C++ 19.0

$
0
0

Hello,

I have looked into beta version of boost libraries 1.70.0.

Unfortunately, it seems this version is not compatible with Intel C++ 19.0

boost_1_70_0\tools\build\src\tools\intel-win.jam:

.intel-autodetect-versions = 14.0 13.0 12.0 ;
.iclvars-12.0-supported-vcs = "10.0 9.0 8.0" ;
.iclvars-12.1-supported-vcs = "10.0 9.0 8.0" ;
.iclvars-13.0-supported-vcs = "11.0 10.0 9.0" ;
.iclvars-14.0-supported-vcs = "12.0 11.0 10.0 9.0" ;
.iclvars-15.0-supported-vcs = "12.0 11.0 10.0 9.0" ;
.iclvars-16.0-supported-vcs = "14.0 12.0 11.0 10.0 9.0" ;
.iclvars-17.0-supported-vcs = "14.0 12.0 11.0 10.0" ;
.iclvars-18.0-supported-vcs = "14.1 14.0 12.0 11.0 10.0" ;
.iclvars-version-alias-vc14.1 = vs2017 ;
.iclvars-version-alias-vc14 = vs2015 ;
.iclvars-version-alias-vc12 = vs2013 ;
.iclvars-version-alias-vc11 = vs2012 ;
.iclvars-version-alias-vc10 = vs2010 ;
.iclvars-version-alias-vc9 = vs2008 ;
.iclvars-version-alias-vc8 = vs2005 ;
.icl-target-subdirectories = ia32 ia32_intel64 intel64 ; 

Do you have contact with boost team and might remind to integrate the support of Intel C++ 19.0 into boost build system for 1.70.0 release?

Thank you

Intel 19.3 - RTTI typeinfo included on type compiled with /GR-

$
0
0

My question pertains specifically to the Windows compiler (v19 Update 3) running in VS2017 v15.9.9.

I have a class in a third-party lib that is compiled with no RTTI (/GR-). This library defines several C++ types.

My project subclasses one of these library types. The compilation (.cpp) unit that contains this subclassed type is also compiled with /GR-. In the client's calling function (which resides in a compilation (.cpp) unit compiled WITH RTTI enabled), I am finding that typeinfo is being injected anyway into instances of these "non-RTTI" types, such that statements like dynamic_cast<> and typeid(…) succeed. This behavior is inconsistent with what I observe under Linux and GCC which emits the expected:

"undefined reference to 'typeinfo' for 'ident'"

I do not believe the compiler should be silently "elevating" these non-RTTI types to RTTI types as it allows parts of the language to be used which are otherwise (and should be) unsafe. The only way I can achieve conformance with types compiled with /GR- is to ban RTTI for ALL compilation units in the project. This seems unnecessarily restrictive to clients. 

Is this behavior known? Expected?

Thanks.


Using intel Omp library in visual studio 2017

$
0
0

Hi, I am trying to use the unsequenced policies in Pstl library, and I can't link to the intel Omp library.

I'm using visual studio 2017, the parallel version worked well with openmp 2.0. When I'm trying to go through the unsequenced policy which requires \Qopenmp-simd, I encountered several problems. 

I'm following the guide on https://software.intel.com/en-us/cpp-compiler-developer-guide-and-reference-using-the-openmp-libraries

1. 2. If I'm using intel compiler c++ 19, do I still need to check _OPENMP_NOFORCE_MANIFEST?

2. I can't really find the path <Intel_compiler_installation_path>\IA32\LIB and <Intel_compiler_installation_path>\IA32\Bin, the most similar path I find would be C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2019.2.190\windows\compiler\lib\intel64 (I'm using a 64-bit system) and C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2019.2.190\windows\bin\intel64

3. at the additional options, I set " /nodefaultlib libiomp5md.lib" is it correct?

4. The OpenMP support in properties >C++ > language (intel c++) still says "enable openmp2.0 language extensions", and apparently there is no \Qopenmp-simd option.

Any help would be appreciated.

Intel Compiler crashing after update to Xcode 10.2

$
0
0

Yesterday I updated my Mac from macOS 10.14.3 and and Xcode 10.1 to macOS 10.14.4 and Xcode 10.2. Today I figured out that the Intel C++ compiler doesn't work with these updates. I have Intel C++ 2019.3 and it crashes with these error messages:

": internal error: ** The compiler has encountered an unexpected problem. ** Segmentation violation signal raised. ** Access violation or stack overflow. Please contact Intel Support for assistance.

Maybe it is a good idea for Intel to test the beta versions of Xcode and Visual Studio so that they are prepared in advance. It is also a shame that more than four months since the release of Visual Studio 2017.9 (November 13, 2018), still there is no version of the Intel Compiler that is compatible with it: https://software.intel.com/en-us/articles/intel-compilers-integration-su...

Using Intel C++ compiler with Visual Studio 2017/2019 cmake

$
0
0

Currently we use Visual Studio 2017 targeting Windows with Visual Studio solutions/projects files.
We want to build/debug our product for both Windows/Linux and trying to use Visual Studio build with cmake.
According to docs.microsoft.com/en-us/cpp/build/cmakesettings-reference?view=vs-2019 :
---

Any custom environment can be used, or these predefined environments:
linux_arm: Target ARM Linux remotely.
linux_x64: Target x64 Linux remotely.
linux_x86: Target x86 Linux remotely.
msvc_arm: Target ARM Windows with the MSVC compiler.
msvc_arm_x64: Target ARM Windows with the 64-bit MSVC compiler.
msvc_arm64: Target ARM64 Windows with the MSVC compiler.
msvc_arm64_x64: Target ARM64 Windows with the 64-bit MSVC compiler.
msvc_x64: Target x64 Windows with the MSVC compiler.
msvc_x64_x64: Target x64 Windows with the 64-bit MSVC compiler.
msvc_x86: Target x86 Windows with the MSVC compiler.
msvc_x86_x64: Target x86 Windows with the 64-bit MSVC compiler.

(though config dialog also mentions Mingw64 as an option).

Can you give recommendations how to configure VS 2017/2019 cmake to use Intel C++ compiler on both Windows and Linux?

Regards,

Sergei.

Implicit conversion warning (#1682) reported even if static_cast is used

$
0
0

I ran into a strange issue when building the code with -Wconversion flag.

std::vector<int> values{0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
std::uint8_t number_of_values = static_cast<uint8_t>(values.size());

The example above produces a warning:

warning #1682: implicit conversion of a 64-bit integral type to a smaller integral type (potential portability problem)

values.size() returns size_t, so static_cast to uint8_t should be OK.

Enviroment:
Ubuntu 18.04.2
icc (ICC) 19.0.3.199 20190206

\bin32, tool path is not existing!

$
0
0

I'm getting this error message when trying to open a solution in Visual Studio 2017 after installing Intel Parallel Studio XE 2019.  After clicking OK, Visual Studio closes.  This happens repeatedly regardless of which solution file I'm opening.  Please help.

Not able to install Intel Parallel StudioXE 2019 update3 cluster edition with floating license of two users

$
0
0

Hi Recently we've got Intel parallel studio with the floating license for two users.

We've successfully registered and downloaded the Intel parallel studioXE 2019 update3 as well as the license manager version 2.7.0.007 for linux. We didn't get any error while installing the Intel license manager and activating the license.

But when we are trying to install it on local server which uses Intel Xeon bronze 3106 series processor running with Ubuntu Server 16.04 LTS. Its showing license errors on trying different possibilities:

1. Without using the license manager and directly providing the key during the installation

Error- its says this serial number for floating license is not registered even though I have registered it online.

2. Using Intel license manager

error: "The license files provided is not valid for this product"

Attached are the screen shots and the license file for the reference. We've followed all the steps mentioned in the installation guides of Parallel StudioXE as well as Intel License manager. Please help us out. Thank you in advance.

 

__INTEL_COMPILER_UPDATE changed behviour in icc version 19

$
0
0
I think __INTEL_COMPILER_UPDATE changed behaviour in icc 19.
From https://software.intel.com/en-us/cpp-compiler-developer-guide-and-reference-additional-predefined-macros I expected the __INTEL_COMPILER_UPDATE for my compiler to be 3, but it is 0 instead.
See also https://gitlab.kitware.com/cmake/cmake/issues/19115

$ cat ver.cpp 
__INTEL_COMPILER
__INTEL_COMPILER_UPDATE
__INTEL_COMPILER_BUILD_DATE

$ icpc -v
icpc version 19.0.3.199 (gcc version 6.4.0 compatibility)
 $ icpc -E ver.cpp | tail -4
1900
0
20190206

 


Problem with Registration on some servers

$
0
0

We have 5 floating licenses for Intel C++ Compiler and have issues activating the product successfully using Floating license activation. We managed to get this to work on some other servers in the past. 

We get the message "License cannot be verified: license server is down or not responding."
We get the same error even when I try to activated with the same license file used on the license server.

The license server is working fine as we have other clients that checking out license for Intel builds.

When I ran the command below on the new client machine:

lmutil lmstat -a

or

lmutil lmdiag -c 27009@XX.XXX.XXX.XXX [feature]

I can see that the new client connects successfully to the our floating license server and I can see that 5 floating licenses are available for checkout.

When I do the product registration with this new client, I do not see any new log messages from the license server "IFLEXlLog.txt" or any debug messages from the client %INTEL_LMD_DEBUG%.

The client does have access to the internet and can connect to the server port via New-Object System.Net.Sockets.TcpClient or  and lmutil commands. The client machine doesn't appear to have firewall switched on.

However, the new client and the server are on different network domains but this shouldn't matter with the above proven connectivity. Note that the license server works fine on a few machines on the same domain as the server.

Please advise.

Regards

Wai

 

 

 

 

 

 

 

compiler version 19.0.3 crashing when building mpi libraries on macOS 10.14.4

$
0
0

I just upgraded to macOS 10.14.4 and installed the latest Intel C and Fortran compilers (19.0.3) and now I can no longer compile mpich nor openmpi.  Here are the errors I'm getting:

openmpi (4.0.1):

  CC       dfs_test.lo

": internal error: ** The compiler has encountered an unexpected problem.

** Segmentation violation signal raised. **

Access violation or stack overflow. Please contact Intel Support for assistance.

mpich (3.3):

  GEN      lib/libpmpi.la

ld: illegal thread local variable reference to regular symbol __tls___MPIR_Per_thread for architecture x86_64

make[2]: *** [lib/libpmpi.la] Error 1

Both of these complied fine with the 2018 intel compiler and macOS 10.13.  

Getting Intel C++ to work with Visual Studio 2019

$
0
0

I have been using the Intel C++ compiler with Visual Studio 2017 but just installed 2019. The first errors I got required retargeting to an older SDK. But then I get this:

1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Platforms\x64\PlatformToolsets\Intel C++ Compiler 18.0\Toolset.targets(150,5): error MSB4062: The "ICMessage" task could not be loaded from the assembly C:\Program Files %28x86%29\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Intel.Build.ICLTasks.v150.dll. Could not load file or assembly 'file:///C:\Program Files %28x86%29\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Intel.Build.ICLTasks.v150.dll' or one of its dependencies. The system cannot find the file specified. Confirm that the <UsingTask> declaration is correct, that the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask.
 

I tried repairing Intel Parallel studio. I haven't been through an update to visual studio with the intel compiler before.

Thanks.

Getting parallel studio / Intel C compiler to generate threaded code.

$
0
0

I have downloaded a trial of Parallel Studio 2019 to see if it can help parallelize a program.  I have run the compiler with the options to identify and report any loops that could be run in parallel and there were some loops identified.  I then built the program using the -parallel option for compile and link. When I run inspector to examine the software execution, I get an error that there was only a single thread running. I'm wondering how to determine why there was only a single thread executed.

 

Thanks for any input,

Mike

 

Missing support for returns_nonnull attribute

$
0
0

It looks like ICC is missing support for the retuns_nonnull attribute (tested up to 19.0.1), which has been present in GCC since 4.9.  Here is a quick test case:

#include <stdio.h>

static const char* foo = "bar\n";

#if defined(__GNUC__) && ((__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 9)))
__attribute__((__returns_nonnull__))
#endif
static const char* get_string(void) {
  return foo;
}

int main(void) {
  const char* s = get_string();
  if (s != NULL)
    fputs(s, stdout);
  else
    fputs("This shouldn't happen\n", stdout);

  return 0;
}
Viewing all 2797 articles
Browse latest View live