Quantcast
Channel: Intel® Fortran Compiler for Linux* and macOS*
Viewing all articles
Browse latest Browse all 2583

omp initializer not properly set

$
0
0

hi all

the following code is bugus.

v

 

 ifort -V
Intel(R) Fortran Intel(R) 64 Compiler XE for applications running on Intel(R) 64, Version 14.0.1.106 Build 20131008
Copyright (C) 1985-2013 Intel Corporation.  All rights reserved.
FOR NON-COMMERCIAL USE ONLY

cat intel_reduction.f90
program test
  use omp_lib
  implicit none
  integer :: i
  !i=0 !omp initializer wrongly set
  !$omp parallel reduction(+:i)
  i=1
  !$omp end parallel
  if(i.ne.omp_get_max_threads()) then
     write(*,*) i
     stop 'err1'
  endif
end program test
export OMP_NUM_THREADS=4; ifort -fopenmp intel_reduction.f90   ;  ./a.out
       32771
err1

 

 


Viewing all articles
Browse latest Browse all 2583

Trending Articles



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