From ernest.turro at ic.ac.uk  Wed Feb  3 21:49:42 2010
From: ernest.turro at ic.ac.uk (Ernest Turro)
Date: Wed, 3 Feb 2010 20:49:42 +0000
Subject: [Rd] ctrl-C aborts R when compiling package code with ICC+openMP
Message-ID: <3A083ED8-8635-48BD-879B-5D6E2BC05AD5@ic.ac.uk>

Hi all,

I have some C++ code that I call from my package. In my main C++ loop, I check for user interrupts and return to the R shell after ensuring I've deallocated memory appropriately. This works fine when the code is compiled with gcc+openmp and with icc without openmp, but when I compile with icc and use openmp, the entire R session is immediately terminated when I hit ctrl-C. This happens even if I only have one thread and even if I set an openmp barrier just before checking for user interrupts.

When the R session terminates unexpectedly, I usually just get "Aborted" before return to the bash prompt. Occasionally, though, I get this error:

OMP: Error #15: Initializing libguide.so, but found libguide.so already initialized.
OMP: Hint: This may cause performance degradation and correctness issues. Set environment variable KMP_DUPLICATE_LIB_OK=TRUE to ignore this problem and force the program to continue anyway. Please note that the use of KMP_DUPLICATE_LIB_OK is unsupported and using it may cause undefined behavior. For more information, please contact Intel(R) Premier Support.

But KMP_DUPLICATE_LIB_OK=TRUE changes nothing.

I had a look at:
http://software.intel.com/en-us/articles/opm-abort-initializing-libguide40dll/

which suggests there may be a conflict between libguide40 and libiomp5md, but I can't find any loaded R packages that link against libiomp5md...

Does anyone have any ideas?

Many thanks,

Ernest


[Rd] ctrl-C aborts R when compiling package code with ICC+openMP
Ernest Turro