Commit 28eaf07f authored by Johannes Spazier's avatar Johannes Spazier

Added support for OpenMP within the build system.

parent ffe10ed6
...@@ -37,4 +37,8 @@ AC_MSG_NOTICE($cuda) ...@@ -37,4 +37,8 @@ AC_MSG_NOTICE($cuda)
AC_PREFIX_DEFAULT([/usr/local/easywave]) AC_PREFIX_DEFAULT([/usr/local/easywave])
AC_OPENMP
AC_SUBST(AM_CXXFLAGS,"$AM_CXXFLAGS $OPENMP_CXXFLAGS")
AC_OUTPUT AC_OUTPUT
...@@ -35,8 +35,8 @@ easywave_SOURCES += ewCudaKernels.cu \ ...@@ -35,8 +35,8 @@ easywave_SOURCES += ewCudaKernels.cu \
ewGpuNode.cuh \ ewGpuNode.cuh \
EasyWaveGen.cu EasyWaveGen.cu
easywave_LINK = $(NVCC) -O2 -o easywave easywave_LINK = $(NVCC) -O2 -Xcompiler "$(OPENMP_CXXFLAGS)" -o easywave
else else
easywave_SOURCES += EasyWave.cpp easywave_SOURCES += EasyWave.cpp
easywave_LINK = $(CXX) $(CXXFLAGS) -o easywave easywave_LINK = $(CXX) $(CXXFLAGS) $(OPENMP_CXXFLAGS) -o easywave
endif endif
...@@ -210,7 +210,7 @@ int ewStepCor( void ) ...@@ -210,7 +210,7 @@ int ewStepCor( void )
CNode& Node = *gNode; CNode& Node = *gNode;
// sea floor topography (mass conservation) // sea floor topography (mass conservation)
#pragma omp parallel for default(shared) private(i,j,nod,absH) #pragma omp parallel for default(shared) private(i,j,absH)
for( i=Imin; i<=Imax; i++ ) { for( i=Imin; i<=Imax; i++ ) {
for( j=Jmin; j<=Jmax; j++ ) { for( j=Jmin; j<=Jmax; j++ ) {
...@@ -279,7 +279,7 @@ int ewStepCor( void ) ...@@ -279,7 +279,7 @@ int ewStepCor( void )
// moment conservation // moment conservation
// longitudial flux update // longitudial flux update
#pragma omp parallel for default(shared) private(i,j,nod,v1,v2) #pragma omp parallel for default(shared) private(i,j,v1,v2)
for( i=Imin; i<=Imax; i++ ) { for( i=Imin; i<=Imax; i++ ) {
for( j=Jmin; j<=Jmax; j++ ) { for( j=Jmin; j<=Jmax; j++ ) {
...@@ -313,7 +313,7 @@ int ewStepCor( void ) ...@@ -313,7 +313,7 @@ int ewStepCor( void )
} }
// lattitudial flux update // lattitudial flux update
#pragma omp parallel for default(shared) private(i,j,nod,v1,v2) #pragma omp parallel for default(shared) private(i,j,v1,v2)
for( i=Imin; i<=Imax; i++ ) { for( i=Imin; i<=Imax; i++ ) {
for( j=Jmin; j<=Jmax; j++ ) { for( j=Jmin; j<=Jmax; j++ ) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment