openmp

R package with C/C++ and openMP: how to make “Makevars” file under “mypackage/src/” folder?

匿名 (未验证) 提交于 2019-12-03 01:23:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am developing an R package on Mac OSX with some low level C/C++ code and openMP support. The C++ code is written using Rcpp package. My global ''Makevars'' file is placed under ~/.R/ folder. The file looks like following. CC=clang-omp CXX=clang-omp++ PKG_CFLAGS=Wall -pedantic PKG_CFLAGS= -fopenmp PKG_CXXFLAGS= -fopenmp PKG_LIBS= -fopenmp -lgomp Everything works great under this configuration! However, now I want to build package-specific Makevars file for its own compilation to make the package portable. What I tried was simply move the

OpenCV TBB IPP OpenMP functions

匿名 (未验证) 提交于 2019-12-03 01:20:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Is there a list of functions/methods of OpenCV that have been optimized with IPP and/or TBB and/or OpenMP? 回答1: Disclaimer: I have no experience in OpenCV usage. I found no such a list on the official opencv.org site. However, the ChangeLog says : switched all the remaining parallel loops from TBB-only tbb::parallel_for() to universal cv::parallel_for_() with many possible backends (MS Concurrency, Apple's GDC, OpenMP, Intel TBB etc.) Now, we know what to search and grep -IRl parallel_for_ applied on opencv directory gives us the following:

Cholesky decomposition with OpenMP

匿名 (未验证) 提交于 2019-12-03 01:18:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have a project where we solve the inverse of large (over 3000x3000) positive definite dense matrices using Cholesky Decomposition . The project is in Java and we use are using the CERN Colt BLAS library . Profiling the code shows that the Cholesky decomposition is the bottleneck. I decided to try and parallelize the Cholesky decomposition using OpenMP and use it as a DLL in Java (with JNA). I started with the Cholesky decomposition code in C from Rosetta Code . What I noticed is that the values in a column except for the diagonal element

openmp difference between num_threads vs. omp_set_num_threads vs OMP_NUM_THREADS

匿名 (未验证) 提交于 2019-12-03 01:14:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am quite confused about the ways to specify the number of threads in parallel part of a code. I know I can use: the enviromental variable OMP_NUM_THREADS function omp_set_num_threads(int) num_threads(int) in #pragma omp parallel for num_threads(NB_OF_THREADS) What I have gathered so far the first two are equivalent. But what about the third one? Can someone provide a more detailed exposition of the difference, I could not find any information in the internet regarding the difference between 1/2 and 3. 回答1: OMP_NUM_THREADS and omp_set_num

Error enabling openmp - “ld: library not found for -lgomp” and Clang errors

匿名 (未验证) 提交于 2019-12-03 01:12:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm trying to get openmp to run in my program on Mavericks, however when I try to compile using the flag -fopenmp I get the following error: ld: library not found for -lgomp clang: error: linker command failed with exit code 1 (use -v to see invocation) The command I am running is: gcc myProgram.cpp -fopenmp -o myProgram Also, when I run gcc I get Clang warnings which I find to be very strange. And looking into /usr/bin/gcc it does not appear to link to Clang. Any suggestions on how to fix my Clang errors and get openmp to compile? 回答1: The

Ignore OpenMP on machine that does not have it

百般思念 提交于 2019-12-03 01:11:31
I have a C++ program using OpenMP, which will run on several machines that may have or not have OpenMP installed. How could I make my program know if a machine has no OpenMP and ignore those #include <omp.h> , OpenMP directives (like #pragma omp parallel ... ) and/or library functions (like tid = omp_get_thread_num(); ) ? OpenMP is a compiler runtime thing and not a platform thing. ie. If you compile your app using Visual Studio 2005 or higher, then you always have OpenMP available as the runtime supports it. (and if the end-user doesn't have the Visual Studio C runtime installed, then your

gfortran can&#039;t find OpenMP library (omp_lib.mod) under MinGW

匿名 (未验证) 提交于 2019-12-03 01:07:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm trying to compile a Fortran code that someone has sent me. It compiles fine on my Linux box, now I'm trying to compile it under MinGW on Windows. But when I run the gfortran command to compile and link it, it fails with the following error: undumag_main_omp.f:8175:9: use omp_lib 1 Fatal Error: Can't open module file 'omp_lib.mod' for reading at (1): No such file or directory compilation terminated. I'm using the -fopenmp switch to use OpenMP. I've installed MinGW (5.3.0) using the Installation Manager, selecting the mingw32-base and

linking OpenMP statically with GCC

匿名 (未验证) 提交于 2019-12-03 01:03:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Given the following file print.cpp #include <stdio.h> int main() { printf("asdf\n"); } I can link this statically like this g++ -static print.cpp or like this g++ -static-libgcc -Wl,-Bstatic -lc print.cpp -o print But now let's add a little OpenMP and call the file print_omp.cpp #include <omp.h> #include <stdio.h> int main() { printf("%d\n", omp_get_num_threads()); } I can link this statically like this (I checked it with ldd ) g++ -fopenmp -static print_omp.cpp However, this does not work g++ -fopenmp -static-libgcc -Wl,-Bstatic -lc print

Is there a way that OpenMP can operate on Qt spanwed threads?

匿名 (未验证) 提交于 2019-12-03 00:56:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm trying to parallelize a number-crunching part of an application to make use of a quad-core architecture using OpenMP and GCC 4.2 on Mac OS 10.5. But what I think the problem is that this application uses Qt for the GUI and I'm trying to fork the worker threads on a secondary thread created by Qt which causes the program to crash - but of this I'm not sure. I'm seriously on the dark here since it's my first time working with either Qt or OpenMP, (or C++ for that matter). Any sort of guidance is greatly appreciated. 回答1: Does the part

Setting up “configure” for openMP in R

泄露秘密 提交于 2019-12-03 00:30:51
I have an R package which is easily sped up by using OpenMP. If your compiler supports it then you get the win, if it doesn't then the pragmas are ignored and you get one core. My problem is how to get the package build system to use the right compiler options and libraries. Currently I have: PKG_CPPFLAGS=-fopenmp PKG_LIBS=-fopenmp hardcoded into src/Makevars on my machine, and this builds it with OpenMP support. But it produces a warning about non-standard compiler flags on check, and will probably fail hard on a machine with no openMP capabilities. The solution seems to be to use configure