I'm trying to call a C function from Java. The C function parallel a for loop by using openmp. However, after the program finishes, the result shows only one thread is used. So, I'm wondering is it a feasible way to use the openmp with JNI.
Thanks
Below is my clang information and the content of makefile:
clang version 3.5.0
Target: x86_64-apple-darwin15.0.0
Thread model: posix
CC = gcc
CLANG = clang-omp
CFLAGS = -c -Wall -fPIC -std=c11
OMP = -fopenmp
LIBFLAG = -dynamiclib
INCPATH = -I/Library/Java/JavaVirtualMachines/jdk1.8.0_45.jdk/Contents/Home/include -I/usr/local/Cellar/libiomp/20150701/include/libiomp -I/Library/Java/JavaVirtualMachines/jdk1.8.0_45.jdk/Contents/Home/include/darwin -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/System/Library/Frameworks/JavaVM.framework/Versions/A/Headers
LIBPATH = -L./ -L/usr/local/Cellar/libiomp/20150701/lib -lepanet -liomp5
all: library
library: *.o
$(CC) $(LIBFLAG) $(OMP) -o libJNIFitness.jnilib *.o
*.o: *.c
$(CC) $(OMP) $(CFLAGS) $(INCPATH) *.c
clean:
rm *.o libJNIFitness.jnilib