Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
S
SWE
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Gaurav Kukreja
SWE
Commits
7e8382e8
Commit
7e8382e8
authored
Feb 21, 2013
by
Sebastian Rettenberger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Loop unrolling (fixes vectorization issues on some platforms)
parent
23738b94
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
5 deletions
+26
-5
SWE_WavePropagationBlock.cpp
src/blocks/SWE_WavePropagationBlock.cpp
+26
-5
No files found.
src/blocks/SWE_WavePropagationBlock.cpp
View file @
7e8382e8
...
...
@@ -111,7 +111,7 @@ SWE_WavePropagationBlock::SWE_WavePropagationBlock(
* maximum allowed time step size
*/
void
SWE_WavePropagationBlock
::
computeNumericalFluxes
()
{
//
tools::Logger::logger.resetCpuClockToCurrentTime();
tools
::
Logger
::
logger
.
resetCpuClockToCurrentTime
();
//maximum (linearized) wave speed within one iteration
float
maxWaveSpeed
=
(
float
)
0.
;
...
...
@@ -177,7 +177,7 @@ void SWE_WavePropagationBlock::computeNumericalFluxes() {
#pragma simd
#endif // VECTORIZE
#endif // WAVE_PROPAGATION_SOLVER==4
for
(
int
j
=
1
;
j
<
ny
+
2
;
j
++
)
{
for
(
int
j
=
1
;
j
<
ny
+
1
;
j
++
)
{
float
maxEdgeSpeed
;
#if WAVE_PROPAGATION_SOLVER!=3
...
...
@@ -199,6 +199,27 @@ void SWE_WavePropagationBlock::computeNumericalFluxes() {
maxWaveSpeed
=
std
::
max
(
maxWaveSpeed
,
maxEdgeSpeed
);
#endif // LOOP_OPENMP
}
float
maxEdgeSpeed
;
#if WAVE_PROPAGATION_SOLVER!=3
wavePropagationSolver
.
computeNetUpdates
(
h
[
i
][
ny
],
h
[
i
][
ny
+
1
],
hv
[
i
][
ny
],
hv
[
i
][
ny
+
1
],
b
[
i
][
ny
],
b
[
i
][
ny
+
1
],
hNetUpdatesBelow
[
i
-
1
][
ny
],
hNetUpdatesAbove
[
i
-
1
][
ny
],
hvNetUpdatesBelow
[
i
-
1
][
ny
],
hvNetUpdatesAbove
[
i
-
1
][
ny
],
maxEdgeSpeed
);
#else // WAVE_PROPAGATION_SOLVER!=3
#error "Solver not implemented in SWE_WavePropagationBlock"
#endif // WAVE_PROPAGATION_SOLVER!=3
#ifdef LOOP_OPENMP
//update the thread-local maximum wave speed
l_maxWaveSpeed
=
std
::
max
(
l_maxWaveSpeed
,
maxEdgeSpeed
);
#else // LOOP_OPENMP
//update the maximum wave speed
maxWaveSpeed
=
std
::
max
(
maxWaveSpeed
,
maxEdgeSpeed
);
#endif // LOOP_OPENMP
}
#ifdef LOOP_OPENMP
...
...
@@ -210,7 +231,7 @@ void SWE_WavePropagationBlock::computeNumericalFluxes() {
}
// #pragma omp parallel
#endif
//
tools::Logger::logger.updateCpuTime();
tools
::
Logger
::
logger
.
updateCpuTime
();
if
(
maxWaveSpeed
>
0.00001
)
{
//TODO zeroTol
...
...
@@ -240,7 +261,7 @@ void SWE_WavePropagationBlock::computeNumericalFluxes() {
* @param dt time step width used in the update.
*/
void
SWE_WavePropagationBlock
::
updateUnknowns
(
float
dt
)
{
tools
::
Logger
::
logger
.
resetCpuClockToCurrentTime
();
//
tools::Logger::logger.resetCpuClockToCurrentTime();
//update cell averages with the net-updates
#ifdef LOOP_OPENMP
...
...
@@ -281,7 +302,7 @@ void SWE_WavePropagationBlock::updateUnknowns(float dt) {
}
}
tools
::
Logger
::
logger
.
updateCpuTime
();
//
tools::Logger::logger.updateCpuTime();
}
/**
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment