source: CIVL/examples/omp/dataracebench-1.3.2/micro-benchmarks-fortran/DRB111-linearmissing-orig-yes.f95

main
Last change on this file was ea777aa, checked in by Alex Wilton <awilton@…>, 3 years ago

Moved examples, include, build_default.properties, common.xml, and README out from dev.civl.com into the root of the repo.

git-svn-id: svn://vsl.cis.udel.edu/civl/trunk@5704 fb995dde-84ed-4084-dfe6-e5aef3e2452c

  • Property mode set to 100755
File size: 1.1 KB
Line 
1!!!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~!!!
2!!! Copyright (c) 2017-20, Lawrence Livermore National Security, LLC
3!!! and DataRaceBench project contributors. See the DataRaceBench/COPYRIGHT file for details.
4!!!
5!!! SPDX-License-Identifier: (BSD-3-Clause)
6!!!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~!!!
7
8! * loop missing the linear clause
9! * Data race pair: j@36 vs. j@37
10
11
12program DRB111_linearmissing_orig_yes
13 use omp_lib
14 implicit none
15
16 integer len, i, j
17 integer, parameter :: dp = kind(1.0d0)
18 real(dp), dimension(:), allocatable :: a,b,c
19
20 len = 100
21 i = 0
22 j = 0
23
24 allocate (a(len))
25 allocate (b(len))
26 allocate (c(len))
27
28 do i = 1, len
29 a(i) = (real(i,dp))/2.0
30 b(i) = (real(i,dp))/3.0
31 c(i) = (real(i,dp))/7.0
32 end do
33
34 !$omp parallel do
35 do i = 1, len
36 c(j) = c(j)+a(i)*b(i)
37 j = j+1
38 end do
39 !$omp end parallel do
40
41 print*,'c(50) =',c(50)
42
43 if(allocated(a))deallocate(a)
44 if(allocated(b))deallocate(b)
45
46end program
Note: See TracBrowser for help on using the repository browser.