source: CIVL/examples/omp/dataracebench-1.3.2/micro-benchmarks-fortran/DRB036-truedepscalar-var-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.5 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 carried true dep between tmp =.. and ..= tmp.
9!Data race pair: tmp@48:16 vs. tmp@49:9
10
11program DRB036_truedepscalar_var_yes
12 use omp_lib
13 implicit none
14
15 integer i, tmp, len, argCount, allocStatus, rdErr, ix
16 character(len=80), dimension(:), allocatable :: args
17 integer, dimension(:), allocatable :: a
18
19 len = 100
20 tmp = 10
21
22 argCount = command_argument_count()
23 if (argCount == 0) then
24 write (*,'(a)') "No command line arguments provided."
25 end if
26
27 allocate(args(argCount), stat=allocStatus)
28 if (allocStatus > 0) then
29 write (*,'(a)') "Allocation error, program terminated."
30 stop
31 end if
32
33 do ix = 1, argCount
34 call get_command_argument(ix,args(ix))
35 end do
36
37 if (argCount >= 1) then
38 read (args(1), '(i10)', iostat=rdErr) len
39 if (rdErr /= 0 ) then
40 write (*,'(a)') "Error, invalid integer value."
41 end if
42 end if
43
44 allocate (a(len))
45
46 !$omp parallel do
47 do i = 1, len
48 a(i) = tmp
49 tmp = a(i) + i
50 end do
51 !$omp end parallel do
52
53 deallocate(args,a)
54end program
Note: See TracBrowser for help on using the repository browser.