Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
TurTLE
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TurTLE
TurTLE
Commits
8d1ccf1e
Commit
8d1ccf1e
authored
Feb 13, 2017
by
Berenger Bramas
Browse files
Options
Downloads
Patches
Plain Diff
update the parallel loops to split the second dimension
parent
54c34e5f
No related branches found
No related tags found
2 merge requests
!21
Bugfix/nansampling
,
!3
Bugfix/event manager show html
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
bfps/cpp/field.hpp
+4
-4
4 additions, 4 deletions
bfps/cpp/field.hpp
bfps/cpp/fluid_solver_base.hpp
+30
-26
30 additions, 26 deletions
bfps/cpp/fluid_solver_base.hpp
bfps/cpp/kspace.hpp
+20
-23
20 additions, 23 deletions
bfps/cpp/kspace.hpp
with
54 additions
and
53 deletions
bfps/cpp/field.hpp
+
4
−
4
View file @
8d1ccf1e
...
...
@@ -204,11 +204,11 @@ class field
case
FFTW
:
#pragma omp parallel
{
const
hsize_t
start
=
OmpUtils
::
ForIntervalStart
(
this
->
rlayout
->
subsizes
[
0
]);
const
hsize_t
end
=
OmpUtils
::
ForIntervalEnd
(
this
->
rlayout
->
subsizes
[
0
]);
const
hsize_t
start
=
OmpUtils
::
ForIntervalStart
(
this
->
rlayout
->
subsizes
[
1
]);
const
hsize_t
end
=
OmpUtils
::
ForIntervalEnd
(
this
->
rlayout
->
subsizes
[
1
]);
for
(
hsize_t
zindex
=
start
;
zindex
<
end
;
zindex
++
)
for
(
hsize_t
yindex
=
0
;
yindex
<
this
->
rlayout
->
subsizes
[
1
]
;
yindex
++
)
for
(
hsize_t
zindex
=
0
;
zindex
<
this
->
rlayout
->
subsizes
[
0
]
;
zindex
++
)
for
(
hsize_t
yindex
=
start
;
yindex
<
end
;
yindex
++
)
{
ptrdiff_t
rindex
=
(
zindex
*
this
->
rlayout
->
subsizes
[
1
]
+
yindex
)
*
(
...
...
This diff is collapsed.
Click to expand it.
bfps/cpp/fluid_solver_base.hpp
+
30
−
26
View file @
8d1ccf1e
...
...
@@ -163,12 +163,13 @@ void CLOOP_NXMODES(ObjectType* obj, FuncType expression)
TIMEZONE
(
"CLOOP_NXMODES"
);
#pragma omp parallel
{
const
hsize_t
start
=
OmpUtils
::
ForIntervalStart
(
obj
->
cd
->
subsizes
[
0
]);
const
hsize_t
end
=
OmpUtils
::
ForIntervalEnd
(
obj
->
cd
->
subsizes
[
0
]);
for
(
ptrdiff_t
yindex
=
start
;
yindex
<
end
;
yindex
++
){
ptrdiff_t
cindex
=
yindex
*
obj
->
cd
->
subsizes
[
1
]
*
obj
->
cd
->
subsizes
[
2
];
for
(
ptrdiff_t
zindex
=
0
;
zindex
<
obj
->
cd
->
subsizes
[
1
];
zindex
++
)
const
hsize_t
start
=
OmpUtils
::
ForIntervalStart
(
obj
->
cd
->
subsizes
[
1
]);
const
hsize_t
end
=
OmpUtils
::
ForIntervalEnd
(
obj
->
cd
->
subsizes
[
1
]);
for
(
ptrdiff_t
yindex
=
0
;
yindex
<
obj
->
cd
->
subsizes
[
0
];
yindex
++
){
for
(
ptrdiff_t
zindex
=
start
;
zindex
<
end
;
zindex
++
)
{
ptrdiff_t
cindex
=
yindex
*
obj
->
cd
->
subsizes
[
1
]
*
obj
->
cd
->
subsizes
[
2
]
+
zindex
*
obj
->
cd
->
subsizes
[
2
];
int
nxmodes
=
1
;
ptrdiff_t
xindex
=
0
;
expression
();
...
...
@@ -191,11 +192,12 @@ void CLOOP_K2(ObjectType* obj, FuncType expression)
TIMEZONE
(
"CLOOP_K2"
);
#pragma omp parallel
{
const
hsize_t
start
=
OmpUtils
::
ForIntervalStart
(
obj
->
cd
->
subsizes
[
0
]);
const
hsize_t
end
=
OmpUtils
::
ForIntervalEnd
(
obj
->
cd
->
subsizes
[
0
]);
for
(
ptrdiff_t
yindex
=
start
;
yindex
<
end
;
yindex
++
){
ptrdiff_t
cindex
=
yindex
*
obj
->
cd
->
subsizes
[
1
]
*
obj
->
cd
->
subsizes
[
2
];
for
(
ptrdiff_t
zindex
=
0
;
zindex
<
obj
->
cd
->
subsizes
[
1
];
zindex
++
)
const
hsize_t
start
=
OmpUtils
::
ForIntervalStart
(
obj
->
cd
->
subsizes
[
1
]);
const
hsize_t
end
=
OmpUtils
::
ForIntervalEnd
(
obj
->
cd
->
subsizes
[
1
]);
for
(
ptrdiff_t
yindex
=
0
;
yindex
<
obj
->
cd
->
subsizes
[
0
];
yindex
++
){
for
(
ptrdiff_t
zindex
=
start
;
zindex
<
end
;
zindex
++
){
ptrdiff_t
cindex
=
yindex
*
obj
->
cd
->
subsizes
[
1
]
*
obj
->
cd
->
subsizes
[
2
]
+
zindex
*
obj
->
cd
->
subsizes
[
2
];
for
(
ptrdiff_t
xindex
=
0
;
xindex
<
obj
->
cd
->
subsizes
[
2
];
xindex
++
)
{
double
k2
=
(
obj
->
kx
[
xindex
]
*
obj
->
kx
[
xindex
]
+
...
...
@@ -207,6 +209,7 @@ void CLOOP_K2(ObjectType* obj, FuncType expression)
}
}
}
}
template
<
class
ObjectType
,
class
FuncType
>
...
...
@@ -214,12 +217,13 @@ void CLOOP_K2_NXMODES(ObjectType* obj, FuncType expression)
{
#pragma omp parallel
{
const
hsize_t
start
=
OmpUtils
::
ForIntervalStart
(
obj
->
cd
->
subsizes
[
0
]);
const
hsize_t
end
=
OmpUtils
::
ForIntervalEnd
(
obj
->
cd
->
subsizes
[
0
]);
for
(
ptrdiff_t
yindex
=
start
;
yindex
<
end
;
yindex
++
){
ptrdiff_t
cindex
=
yindex
*
obj
->
cd
->
subsizes
[
1
]
*
obj
->
cd
->
subsizes
[
2
];
for
(
ptrdiff_t
zindex
=
0
;
zindex
<
obj
->
cd
->
subsizes
[
1
];
zindex
++
)
const
hsize_t
start
=
OmpUtils
::
ForIntervalStart
(
obj
->
cd
->
subsizes
[
1
]);
const
hsize_t
end
=
OmpUtils
::
ForIntervalEnd
(
obj
->
cd
->
subsizes
[
1
]);
for
(
ptrdiff_t
yindex
=
0
;
yindex
<
obj
->
cd
->
subsizes
[
0
];
yindex
++
){
for
(
ptrdiff_t
zindex
=
start
;
zindex
<
end
;
zindex
++
)
{
ptrdiff_t
cindex
=
yindex
*
obj
->
cd
->
subsizes
[
1
]
*
obj
->
cd
->
subsizes
[
2
]
+
zindex
*
obj
->
cd
->
subsizes
[
2
];
int
nxmodes
=
1
;
ptrdiff_t
xindex
=
0
;
double
k2
=
(
obj
->
kx
[
xindex
]
*
obj
->
kx
[
xindex
]
+
...
...
@@ -247,10 +251,10 @@ void RLOOP(ObjectType* obj, FuncType expression)
{
#pragma omp parallel
{
const
hsize_t
start
=
OmpUtils
::
ForIntervalStart
(
obj
->
rd
->
subsizes
[
0
]);
const
hsize_t
end
=
OmpUtils
::
ForIntervalEnd
(
obj
->
rd
->
subsizes
[
0
]);
for
(
int
zindex
=
start
;
zindex
<
end
;
zindex
++
)
for
(
int
yindex
=
0
;
yindex
<
obj
->
rd
->
subsizes
[
1
]
;
yindex
++
)
const
hsize_t
start
=
OmpUtils
::
ForIntervalStart
(
obj
->
rd
->
subsizes
[
1
]);
const
hsize_t
end
=
OmpUtils
::
ForIntervalEnd
(
obj
->
rd
->
subsizes
[
1
]);
for
(
int
zindex
=
0
;
zindex
<
obj
->
rd
->
subsizes
[
0
]
;
zindex
++
)
for
(
int
yindex
=
start
;
yindex
<
end
;
yindex
++
)
{
ptrdiff_t
rindex
=
(
zindex
*
obj
->
rd
->
subsizes
[
1
]
+
yindex
)
*
(
obj
->
rd
->
subsizes
[
2
]
+
2
);
for
(
int
xindex
=
0
;
xindex
<
obj
->
rd
->
subsizes
[
2
];
xindex
++
)
...
...
This diff is collapsed.
Click to expand it.
bfps/cpp/kspace.hpp
+
20
−
23
View file @
8d1ccf1e
...
...
@@ -91,12 +91,13 @@ class kspace
{
#pragma omp parallel
{
const
hsize_t
start
=
OmpUtils
::
ForIntervalStart
(
this
->
layout
->
subsizes
[
0
]);
const
hsize_t
end
=
OmpUtils
::
ForIntervalEnd
(
this
->
layout
->
subsizes
[
0
]);
const
hsize_t
start
=
OmpUtils
::
ForIntervalStart
(
this
->
layout
->
subsizes
[
1
]);
const
hsize_t
end
=
OmpUtils
::
ForIntervalEnd
(
this
->
layout
->
subsizes
[
1
]);
for
(
hsize_t
yindex
=
start
;
yindex
<
end
;
yindex
++
){
ptrdiff_t
cindex
=
yindex
*
this
->
layout
->
subsizes
[
1
]
*
this
->
layout
->
subsizes
[
2
];
for
(
hsize_t
zindex
=
0
;
zindex
<
this
->
layout
->
subsizes
[
1
];
zindex
++
){
for
(
hsize_t
yindex
=
0
;
yindex
<
this
->
layout
->
subsizes
[
0
];
yindex
++
){
for
(
hsize_t
zindex
=
start
;
zindex
<
end
;
zindex
++
){
ptrdiff_t
cindex
=
yindex
*
this
->
layout
->
subsizes
[
1
]
*
this
->
layout
->
subsizes
[
2
]
+
zindex
*
this
->
layout
->
subsizes
[
2
];
for
(
hsize_t
xindex
=
0
;
xindex
<
this
->
layout
->
subsizes
[
2
];
xindex
++
)
{
expression
(
cindex
,
xindex
,
yindex
,
zindex
);
...
...
@@ -111,15 +112,13 @@ class kspace
{
#pragma omp parallel
{
const
double
chunk
=
double
(
this
->
layout
->
subsizes
[
0
])
/
double
(
omp_get_num_threads
());
const
hsize_t
start
=
hsize_t
(
chunk
*
double
(
omp_get_thread_num
()));
const
hsize_t
end
=
(
omp_get_thread_num
()
==
omp_get_num_threads
()
-
1
)
?
this
->
layout
->
subsizes
[
0
]
:
hsize_t
(
chunk
*
double
(
omp_get_thread_num
()
+
1
));
for
(
hsize_t
yindex
=
start
;
yindex
<
end
;
yindex
++
){
ptrdiff_t
cindex
=
yindex
*
this
->
layout
->
subsizes
[
1
]
*
this
->
layout
->
subsizes
[
2
];
for
(
hsize_t
zindex
=
0
;
zindex
<
this
->
layout
->
subsizes
[
1
];
zindex
++
){
const
hsize_t
start
=
OmpUtils
::
ForIntervalStart
(
this
->
layout
->
subsizes
[
1
]);
const
hsize_t
end
=
OmpUtils
::
ForIntervalEnd
(
this
->
layout
->
subsizes
[
1
]);
for
(
hsize_t
yindex
=
0
;
yindex
<
this
->
layout
->
subsizes
[
0
];
yindex
++
){
for
(
hsize_t
zindex
=
start
;
zindex
<
end
;
zindex
++
){
ptrdiff_t
cindex
=
yindex
*
this
->
layout
->
subsizes
[
1
]
*
this
->
layout
->
subsizes
[
2
]
+
zindex
*
this
->
layout
->
subsizes
[
2
];
for
(
hsize_t
xindex
=
0
;
xindex
<
this
->
layout
->
subsizes
[
2
];
xindex
++
)
{
double
k2
=
(
this
->
kx
[
xindex
]
*
this
->
kx
[
xindex
]
+
...
...
@@ -137,15 +136,13 @@ class kspace
{
#pragma omp parallel
{
const
double
chunk
=
double
(
this
->
layout
->
subsizes
[
0
])
/
double
(
omp_get_num_threads
());
const
hsize_t
start
=
hsize_t
(
chunk
*
double
(
omp_get_thread_num
()));
const
hsize_t
end
=
(
omp_get_thread_num
()
==
omp_get_num_threads
()
-
1
)
?
this
->
layout
->
subsizes
[
0
]
:
hsize_t
(
chunk
*
double
(
omp_get_thread_num
()
+
1
));
for
(
hsize_t
yindex
=
start
;
yindex
<
end
;
yindex
++
){
ptrdiff_t
cindex
=
yindex
*
this
->
layout
->
subsizes
[
1
]
*
this
->
layout
->
subsizes
[
2
];
for
(
hsize_t
zindex
=
0
;
zindex
<
this
->
layout
->
subsizes
[
1
];
zindex
++
){
const
hsize_t
start
=
OmpUtils
::
ForIntervalStart
(
this
->
layout
->
subsizes
[
1
]);
const
hsize_t
end
=
OmpUtils
::
ForIntervalEnd
(
this
->
layout
->
subsizes
[
1
]);
for
(
hsize_t
yindex
=
0
;
yindex
<
this
->
layout
->
subsizes
[
0
];
yindex
++
){
for
(
hsize_t
zindex
=
start
;
zindex
<
end
;
zindex
++
){
ptrdiff_t
cindex
=
yindex
*
this
->
layout
->
subsizes
[
1
]
*
this
->
layout
->
subsizes
[
2
]
+
zindex
*
this
->
layout
->
subsizes
[
2
];
hsize_t
xindex
=
0
;
double
k2
=
(
this
->
kx
[
xindex
]
*
this
->
kx
[
xindex
]
+
...
...
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