Quantcast
Channel: Intel® C++ Compiler
Viewing all articles
Browse latest Browse all 1616

openmp compilation errors

$
0
0

I try compiling my code as follows, using icc v 15.0.1.

icc  -std=gnu99 -openmp -c foo.c

but I get these errors

 error: "k" can only appear on one data scope attribute clause in an OpenMP pragma (except firstprivate and lastprivate)
  #pragma omp parallel for 
  ^

error: "X1" can only appear on one data scope attribute clause in an OpenMP pragma (except firstprivate and lastprivate)
  #pragma omp parallel for 
  ^

 

#pragma omp parallel for 
   for ( size_t k = 0; k < Nseg; ++k ) {
#pragma omp parallel for 
    for ( size_t X1 = 0; X1 < numDet; ++X1 ) {
#pragma omp parallel for 
      for ( size_t n = 0; n < intN[k][X1]; ++n ) {

        InputOutputInfo *io = &intInOut[k][X1][n];

        gsl_function integrand;
        integrand.params = (void*)&( io->par );

        int stat;
        double res, abserr;

        const double scale1 = GET_COORD_SCALE(io->par.coordSys, io->par.coord1);
        const double scale2 = GET_COORD_SCALE(io->par.coordSys, io->par.coord2);
        const double scale12 = scale1 * scale2;

        /* compute <phi_i phi_j> */
        integrand.function = &CW_am1_am2_Phi_i_Phi_j;
        stat = gsl_integration_qag (&integrand, io->ti, io->tf, epsabs, epsrel, limit, GSL_II
NTEG_GAUSS61, io->wksp, &res, &abserr);
        if ( stat != 0 ) {
          XLALPrintWarning ( "\n%s: GSL-integration 'gsl_integration_qag()' of <Phi_i Phi_j>>
 did not reach requested precision!\n", __func__ );
          XLALPrintWarning ( "xlalErrno=%i, seg=%zu, av_ij_n=%g, abserr=%g\n", io->par.errnuu
m, n, res, abserr );
          io->av_ij = GSL_NAN;
        } else {
          io->av_ij = scale12 * res;
          io->av_ij_err_sq = SQUARE( scale12 * abserr);
        }

        /* compute <phi_i> */
        integrand.function = &CW_Phi_i;

        io->par.coord = io->par.coord2;
        stat = gsl_integration_qag (&integrand, io->ti, io->tf, epsabs, epsrel, limit, GSL_II
NTEG_GAUSS61, io->wksp, &res, &abserr);
        if ( stat != 0 ) {
          XLALPrintWarning ( "\n%s: GSL-integration 'gsl_integration_qag()' of <Phi_j> did nn
ot reach requested precision!\n", __func__ );
          XLALPrintWarning ( "xlalErrno=%i, seg=%zu, av_j_n=%g, abserr=%g\n", io->par.errnumm
, n, res, abserr );
          io->av_j = GSL_NAN;
        } else {
          io->av_j = scale2 * res;
          io->av_j_err_sq = SQUARE( scale2 * abserr);
        }

      } /* for n < intN */
    } // for X1 < numDet
  } // for k < Nseg

 

 

I'd appreciate assistance on how to keep the code accepting -std=gnu99 on the build line, yet make the

source modifications necessary. Adding private and shared clauses has just led to different compilation errors.

thanks.


Viewing all articles
Browse latest Browse all 1616

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>