Commit 85071af5 authored by Christian Eder's avatar Christian Eder
Browse files

Merge branch 'omp-checks' into 'master'

simplifies openmp checks

See merge request eder/msolve!49
parents 813f419e e3189191
......@@ -34,12 +34,6 @@ AC_ARG_ENABLE([openmp],
if test x$openmp = xtrue ; then
AC_OPENMP
AX_OPENMP([
HAVE_OPENMP=yes
AC_DEFINE(HAVE_OPENMP, 1, [Enable OpenMP support])
],[
HAVE_OPENMP=no
])
fi
# Checks for header files.
......
......@@ -30,7 +30,7 @@
/* for timing functions */
#include "../neogb/tools.h"
#ifdef HAVE_OPENMP
#ifdef _OPENMP
#include<omp.h>
#endif
......
......@@ -32,7 +32,7 @@
#include <math.h>
/* check if OpenMP is available */
#ifdef HAVE_OPENMP
#ifdef _OPENMP
#include <omp.h>
#else
typedef int omp_int_t;
......
......@@ -25,7 +25,7 @@
#include <string.h>
#include <assert.h>
#include <math.h>
#ifdef HAVE_OPENMP
#ifdef _OPENMP
#include <omp.h>
#endif
#include <config.h>
......
......@@ -75,7 +75,7 @@ static void insert_and_update_spairs(
spair_t *ps = psl->p;
#ifdef HAVE_OPENMP
#ifdef _OPENMP
const int max_nthrds = 4 <= st->nthrds ? 4 : st->nthrds;
#endif
......
......@@ -55,7 +55,7 @@ static void taylorshift1_naive(mpz_t *upol, const unsigned long int deg){
static inline void mpz_poly_swap_th(mpz_t *res, mpz_t *pol,
const unsigned long int deg,
const unsigned int nthreads){
#ifdef HAVE_OPENMP
#ifdef _OPENMP
omp_set_num_threads(nthreads);
#endif
......@@ -74,7 +74,7 @@ static inline void mpz_poly_add_th(mpz_t *res, mpz_t *upol1,
return;
}
unsigned long int i;
#ifdef HAVE_OPENMP
#ifdef _OPENMP
omp_set_num_threads(nthreads);
#endif
#pragma omp parallel for num_threads(nthreads) //schedule(static)
......@@ -157,7 +157,7 @@ static void taylorshift1_dac(mpz_t *upol,
unsigned long int fdeg = deg - (nblocks - 1)*sz;
#ifdef HAVE_OPENMP
#ifdef _OPENMP
omp_set_num_threads(nthreads);
#endif
#pragma omp parallel for num_threads(nthreads) schedule(dynamic)
......@@ -345,7 +345,7 @@ static long taylorshift1_dac_wsgnvar(mpz_t *pol,
long nb;
taylorshift1_naive(pol+(nblocks-1)*(pwx), fdeg );
#ifdef HAVE_OPENMP
#ifdef _OPENMP
omp_set_num_threads(nthreads);
#endif
#pragma omp parallel for num_threads(nthreads) //schedule(static)
......
......@@ -24,7 +24,7 @@
#include<gmp.h>
#include<math.h>
#include<time.h>
#ifdef HAVE_OPENMP
#ifdef _OPENMP
#include<omp.h>
#endif
......
......@@ -20,7 +20,7 @@
#ifdef HAVE_OPENMP
#ifdef _OPENMP
#include<omp.h>
#endif
#define USEFLINT 1
......
......@@ -25,7 +25,7 @@
#include<stdio.h>
#include<stdlib.h>
#include<gmp.h>
#ifdef HAVE_OPENMP
#ifdef _OPENMP
#include<omp.h>
#endif
......
......@@ -158,7 +158,7 @@ static inline int USOLVEmpz_poly_rescale_normalize_2exp_th(mpz_t *upol, long int
long int i;
if (b > 0) {
// j = b;
#ifdef HAVE_OPENMP
#ifdef _OPENMP
omp_set_num_threads(nthreads);
#endif
#pragma omp parallel for num_threads(nthreads)
......@@ -167,7 +167,7 @@ static inline int USOLVEmpz_poly_rescale_normalize_2exp_th(mpz_t *upol, long int
}
}
else{
#ifdef HAVE_OPENMP
#ifdef _OPENMP
omp_set_num_threads(nthreads);
#endif
#pragma omp parallel for num_threads(nthreads)
......@@ -191,7 +191,7 @@ static inline int USOLVEmpz_poly_rescale_normalize_2exp_th_long(mpz_t *upol,
long int i;
mpz_t coef;mpz_init(coef);mpz_set_si(coef, c);
if (b > 0) {
#ifdef HAVE_OPENMP
#ifdef _OPENMP
omp_set_num_threads(nthreads);
#endif
#pragma omp parallel for num_threads(nthreads)
......@@ -202,7 +202,7 @@ static inline int USOLVEmpz_poly_rescale_normalize_2exp_th_long(mpz_t *upol,
}
}
else{
#ifdef HAVE_OPENMP
#ifdef _OPENMP
omp_set_num_threads(nthreads);
#endif
#pragma omp parallel for num_threads(nthreads)
......
Supports Markdown
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