Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Q
QuickSched
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SWIFT
QuickSched
Commits
523458a0
Commit
523458a0
authored
8 years ago
by
axc67-pxs02
Browse files
Options
Downloads
Patches
Plain Diff
fixed the example
parent
a3a6f11c
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
fortran_examples/build.sh
+3
-1
3 additions, 1 deletion
fortran_examples/build.sh
fortran_examples/test_n2.F90
+13
-7
13 additions, 7 deletions
fortran_examples/test_n2.F90
with
16 additions
and
8 deletions
fortran_examples/build.sh
+
3
−
1
View file @
523458a0
#!/bin/bash
#!/bin/bash
gfortran test.F90 ../src/.libs/libquicksched.a
-I
../src/
-fopenmp
#gfortran test.F90 ../src/.libs/libquicksched.a -I../src/ -fopenmp
ifort test_n2.F90
-g
../src/.libs/libquicksched.a
-I
../src/
-fopenmp
-o
test_n2
This diff is collapsed.
Click to expand it.
fortran_examples/test_n2.F90
+
13
−
7
View file @
523458a0
...
@@ -153,6 +153,8 @@ cells(cell_num)%dx = cells(cell_num)%dx * 10.0_dp
...
@@ -153,6 +153,8 @@ cells(cell_num)%dx = cells(cell_num)%dx * 10.0_dp
cells
(
cell_num
)
%
dy
=
cells
(
cell_num
)
%
dy
*
10.0_dp
cells
(
cell_num
)
%
dy
=
cells
(
cell_num
)
%
dy
*
10.0_dp
cells
(
cell_num
)
%
dz
=
cells
(
cell_num
)
%
dz
*
10.0_dp
cells
(
cell_num
)
%
dz
=
cells
(
cell_num
)
%
dz
*
10.0_dp
cells
(
cell_num
)
%
num_parts
=
count
End
Subroutine
cell_init
End
Subroutine
cell_init
Subroutine
runner
(
typ
,
data
)
BIND
(
C
)
Subroutine
runner
(
typ
,
data
)
BIND
(
C
)
...
@@ -194,29 +196,31 @@ Integer(Kind=C_INT) :: num_threads
...
@@ -194,29 +196,31 @@ Integer(Kind=C_INT) :: num_threads
!$omp parallel
!$omp parallel
!$omp single
!$omp single
num_threads
=
omp_get_thread
_num
(
)
num_threads
=
Int
(
omp_get_
num_
thread
s
(),
C_INT
)
!$omp end single
!$omp end single
!$omp end parallel
!$omp end parallel
print
*
,
num_threads
runner_func
=
C_FUNLOC
(
runner
)
runner_func
=
C_FUNLOC
(
runner
)
Allocate
(
cells
(
1
:
100
0
))
Allocate
(
cells
(
1
:
100
))
do
i
=
1
,
100
0
do
i
=
1
,
100
call
cell_init
(
i
,
10
00
)
call
cell_init
(
i
,
5
00
)
end
do
end
do
sched
=
f_qsched_create
()
sched
=
f_qsched_create
()
call
qsched_init
(
sched
,
num_threads
,
0
)
call
qsched_init
(
sched
,
num_threads
,
0
)
do
i
=
1
,
100
0
do
i
=
1
,
100
cell_res
(
i
)
=
qsched_addres
(
sched
,
qsched_owner_none
,
qsched_res_none
)
cell_res
(
i
)
=
qsched_addres
(
sched
,
qsched_owner_none
,
qsched_res_none
)
end
do
end
do
do
i
=
1
,
100
0
do
i
=
1
,
100
data
(
0
)
=
i
data
(
0
)
=
i
temp
=
qsched_addtask
(
sched
,
type_self
,
0
,
C_LOC
(
data
(
0
)),
int
(
c_sizeof
(
type_self
),
C_INT
),
1
)
temp
=
qsched_addtask
(
sched
,
type_self
,
0
,
C_LOC
(
data
(
0
)),
int
(
c_sizeof
(
type_self
),
C_INT
),
1
)
call
qsched_addlock
(
sched
,
temp
,
cell_res
(
i
))
call
qsched_addlock
(
sched
,
temp
,
cell_res
(
i
))
do
j
=
i
+1
,
100
0
do
j
=
i
+1
,
100
data
(
1
)
=
j
data
(
1
)
=
j
temp
=
qsched_addtask
(
sched
,
type_pair
,
0
,
C_LOC
(
data
(
0
)),
int
(
c_sizeof
(
type_self
)
*
2
,
C_INT
),
1
)
temp
=
qsched_addtask
(
sched
,
type_pair
,
0
,
C_LOC
(
data
(
0
)),
int
(
c_sizeof
(
type_self
)
*
2
,
C_INT
),
1
)
call
qsched_addlock
(
sched
,
temp
,
cell_res
(
i
))
call
qsched_addlock
(
sched
,
temp
,
cell_res
(
i
))
...
@@ -226,7 +230,9 @@ end do
...
@@ -226,7 +230,9 @@ end do
t_start
=
omp_get_wtime
()
t_start
=
omp_get_wtime
()
do
i
=
1
,
10
call
qsched_run
(
sched
,
num_threads
,
runner_func
)
call
qsched_run
(
sched
,
num_threads
,
runner_func
)
end
do
t_total
=
omp_get_wtime
()
-
t_start
t_total
=
omp_get_wtime
()
-
t_start
print
*
,
"Took"
,
t_total
print
*
,
"Took"
,
t_total
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment