Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
BornAgain
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
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
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mlz
BornAgain
Commits
0b737f3a
Commit
0b737f3a
authored
3 years ago
by
Wuttke, Joachim
Browse files
Options
Downloads
Patches
Plain Diff
rename local fcts
parent
bfb73dff
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!232
Cleanup in context of Simulation, Computation; *Element now inherits from IElement
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Core/Simulation/ISimulation.cpp
+6
-6
6 additions, 6 deletions
Core/Simulation/ISimulation.cpp
with
6 additions
and
6 deletions
Core/Simulation/ISimulation.cpp
+
6
−
6
View file @
0b737f3a
...
@@ -27,7 +27,7 @@
...
@@ -27,7 +27,7 @@
namespace
{
namespace
{
size_t
getI
ndexStep
(
size_t
total_size
,
size_t
n_handlers
)
size_t
i
ndexStep
(
size_t
total_size
,
size_t
n_handlers
)
{
{
ASSERT
(
total_size
>
0
);
ASSERT
(
total_size
>
0
);
ASSERT
(
n_handlers
>
0
);
ASSERT
(
n_handlers
>
0
);
...
@@ -35,9 +35,9 @@ size_t getIndexStep(size_t total_size, size_t n_handlers)
...
@@ -35,9 +35,9 @@ size_t getIndexStep(size_t total_size, size_t n_handlers)
return
total_size
%
n_handlers
?
++
result
:
result
;
return
total_size
%
n_handlers
?
++
result
:
result
;
}
}
size_t
getS
tartIndex
(
size_t
n_handlers
,
size_t
current_handler
,
size_t
n_elements
)
size_t
s
tartIndex
(
size_t
n_handlers
,
size_t
current_handler
,
size_t
n_elements
)
{
{
const
size_t
handler_size
=
getI
ndexStep
(
n_elements
,
n_handlers
);
const
size_t
handler_size
=
i
ndexStep
(
n_elements
,
n_handlers
);
const
size_t
start_index
=
current_handler
*
handler_size
;
const
size_t
start_index
=
current_handler
*
handler_size
;
if
(
start_index
>=
n_elements
)
if
(
start_index
>=
n_elements
)
return
n_elements
;
return
n_elements
;
...
@@ -46,7 +46,7 @@ size_t getStartIndex(size_t n_handlers, size_t current_handler, size_t n_element
...
@@ -46,7 +46,7 @@ size_t getStartIndex(size_t n_handlers, size_t current_handler, size_t n_element
size_t
batchSize
(
size_t
n_handlers
,
size_t
current_handler
,
size_t
n_elements
)
size_t
batchSize
(
size_t
n_handlers
,
size_t
current_handler
,
size_t
n_elements
)
{
{
const
size_t
handler_size
=
getI
ndexStep
(
n_elements
,
n_handlers
);
const
size_t
handler_size
=
i
ndexStep
(
n_elements
,
n_handlers
);
const
size_t
start_index
=
current_handler
*
handler_size
;
const
size_t
start_index
=
current_handler
*
handler_size
;
if
(
start_index
>=
n_elements
)
if
(
start_index
>=
n_elements
)
return
0
;
return
0
;
...
@@ -172,7 +172,7 @@ void ISimulation::runSimulation()
...
@@ -172,7 +172,7 @@ void ISimulation::runSimulation()
const
size_t
n_batches
=
m_options
.
getNumberOfBatches
();
const
size_t
n_batches
=
m_options
.
getNumberOfBatches
();
const
size_t
current_batch
=
m_options
.
getCurrentBatch
();
const
size_t
current_batch
=
m_options
.
getCurrentBatch
();
const
size_t
batch_start
=
getS
tartIndex
(
n_batches
,
current_batch
,
total_size
);
const
size_t
batch_start
=
s
tartIndex
(
n_batches
,
current_batch
,
total_size
);
const
size_t
batch_size
=
batchSize
(
n_batches
,
current_batch
,
total_size
);
const
size_t
batch_size
=
batchSize
(
n_batches
,
current_batch
,
total_size
);
if
(
batch_size
==
0
)
if
(
batch_size
==
0
)
return
;
return
;
...
@@ -299,7 +299,7 @@ void ISimulation::runSingleSimulation(const ProcessedSample& re_sample, size_t b
...
@@ -299,7 +299,7 @@ void ISimulation::runSingleSimulation(const ProcessedSample& re_sample, size_t b
for
(
size_t
i_thread
=
0
;
i_thread
<
n_threads
;
++
i_thread
)
{
for
(
size_t
i_thread
=
0
;
i_thread
<
n_threads
;
++
i_thread
)
{
const
size_t
thread_start
=
batch_start
+
getS
tartIndex
(
n_threads
,
i_thread
,
batch_size
);
const
size_t
thread_start
=
batch_start
+
s
tartIndex
(
n_threads
,
i_thread
,
batch_size
);
const
size_t
thread_size
=
batchSize
(
n_threads
,
i_thread
,
batch_size
);
const
size_t
thread_size
=
batchSize
(
n_threads
,
i_thread
,
batch_size
);
if
(
thread_size
==
0
)
if
(
thread_size
==
0
)
break
;
break
;
...
...
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