Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
solverstack
ScalFMM
Commits
339cde25
Commit
339cde25
authored
Nov 07, 2014
by
BRAMAS Berenger
Browse files
Prepare the task in parallel
parent
a9bb0729
Changes
3
Hide whitespace changes
Inline
Side-by-side
Src/GroupTree/FGroupTaskAlgorithm.hpp
View file @
339cde25
...
...
@@ -63,9 +63,9 @@ public:
void
execute
(
const
unsigned
operationsToProceed
=
FFmmNearAndFarFields
){
FLOG
(
FLog
::
Controller
<<
"
\t
Start FGroupTaskAlgorithm
\n
"
);
//
#pragma omp parallel
#pragma omp parallel
{
//
#pragma omp single nowait
#pragma omp single nowait
{
// For now rebuild all external interaction
buildExternalInteractionVecs
();
...
...
@@ -119,15 +119,15 @@ protected:
{
// We create one big vector per block
typename
std
::
vector
<
std
::
vector
<
OutOfBlockInteraction
>
>
allOutsideInteractions
;
allOutsideInteractions
.
resize
(
tree
->
getNbParticleGroup
());
externalInteractionsLeafLevel
.
resize
(
tree
->
getNbParticleGroup
());
for
(
int
idxGroup
=
0
;
idxGroup
<
tree
->
getNbParticleGroup
()
;
++
idxGroup
){
// Create the vector
allOutsideInteractions
.
push_back
(
std
::
vector
<
OutOfBlockInteraction
>
()
);
typename
std
::
vector
<
OutOfBlockInteraction
>*
outsideInteractions
=
&
allOutsideInteractions
.
back
();
typename
std
::
vector
<
OutOfBlockInteraction
>*
outsideInteractions
=
&
allOutsideInteractions
[
idxGroup
];
ParticleGroupClass
*
containers
=
tree
->
getParticleGroup
(
idxGroup
);
externalInteractionsLeafLevel
.
emplace_back
();
std
::
vector
<
BlockInteractions
<
ParticleGroupClass
>>*
externalInteractions
=
&
externalInteractionsLeafLevel
.
back
();
std
::
vector
<
BlockInteractions
<
ParticleGroupClass
>>*
externalInteractions
=
&
externalInteractionsLeafLevel
[
idxGroup
];
#pragma omp task default(none) firstprivate(idxGroup, containers, outsideInteractions, externalInteractions)
{
// Can be a task(inout:iterCells, out:outsideInteractions)
...
...
@@ -195,17 +195,20 @@ protected:
FLOG
(
leafTimer
.
tac
();
);
FLOG
(
cellTimer
.
tic
();
);
{
std
::
vector
<
std
::
vector
<
std
::
vector
<
OutOfBlockInteraction
>
>
>
allOutsideInteractions
;
allOutsideInteractions
.
resize
(
tree
->
getHeight
());
for
(
int
idxLevel
=
tree
->
getHeight
()
-
1
;
idxLevel
>=
2
;
--
idxLevel
){
std
::
vector
<
std
::
vector
<
OutOfBlockInteraction
>
>
allOutsideInteractions
;
allOutsideInteractions
[
idxLevel
].
resize
(
tree
->
getNbCellGroupAtLevel
(
idxLevel
));
externalInteractionsAllLevel
[
idxLevel
].
resize
(
tree
->
getNbCellGroupAtLevel
(
idxLevel
));
for
(
int
idxGroup
=
0
;
idxGroup
<
tree
->
getNbCellGroupAtLevel
(
idxLevel
)
;
++
idxGroup
){
allOutsideInteractions
.
push_back
(
std
::
vector
<
OutOfBlockInteraction
>
());
std
::
vector
<
OutOfBlockInteraction
>*
outsideInteractions
=
&
allOutsideInteractions
.
back
();
std
::
vector
<
OutOfBlockInteraction
>*
outsideInteractions
=
&
allOutsideInteractions
[
idxLevel
][
idxGroup
];
const
CellContainerClass
*
currentCells
=
tree
->
getCellGroup
(
idxLevel
,
idxGroup
);
externalInteractionsAllLevel
[
idxLevel
].
emplace_back
();
std
::
vector
<
BlockInteractions
<
CellContainerClass
>>*
externalInteractions
=
&
externalInteractionsAllLevel
[
idxLevel
].
back
();
std
::
vector
<
BlockInteractions
<
CellContainerClass
>>*
externalInteractions
=
&
externalInteractionsAllLevel
[
idxLevel
][
idxGroup
];
#pragma omp task default(none) firstprivate(idxGroup, currentCells, outsideInteractions, idxLevel, externalInteractions)
{
...
...
Src/GroupTree/FGroupTaskDepAlgorithm.hpp
View file @
339cde25
...
...
@@ -64,9 +64,9 @@ public:
void
execute
(
const
unsigned
operationsToProceed
=
FFmmNearAndFarFields
){
FLOG
(
FLog
::
Controller
<<
"
\t
Start FGroupTaskDepAlgorithm
\n
"
);
//
#pragma omp parallel
#pragma omp parallel
{
//
#pragma omp single nowait
#pragma omp single nowait
{
// For now rebuild all external interaction
buildExternalInteractionVecs
();
...
...
@@ -111,15 +111,15 @@ protected:
{
// We create one big vector per block
typename
std
::
vector
<
std
::
vector
<
OutOfBlockInteraction
>
>
allOutsideInteractions
;
allOutsideInteractions
.
resize
(
tree
->
getNbParticleGroup
());
externalInteractionsLeafLevel
.
resize
(
tree
->
getNbParticleGroup
());
for
(
int
idxGroup
=
0
;
idxGroup
<
tree
->
getNbParticleGroup
()
;
++
idxGroup
){
// Create the vector
allOutsideInteractions
.
push_back
(
std
::
vector
<
OutOfBlockInteraction
>
()
);
typename
std
::
vector
<
OutOfBlockInteraction
>*
outsideInteractions
=
&
allOutsideInteractions
.
back
();
typename
std
::
vector
<
OutOfBlockInteraction
>*
outsideInteractions
=
&
allOutsideInteractions
[
idxGroup
];
ParticleGroupClass
*
containers
=
tree
->
getParticleGroup
(
idxGroup
);
externalInteractionsLeafLevel
.
emplace_back
();
std
::
vector
<
BlockInteractions
<
ParticleGroupClass
>>*
externalInteractions
=
&
externalInteractionsLeafLevel
.
back
();
std
::
vector
<
BlockInteractions
<
ParticleGroupClass
>>*
externalInteractions
=
&
externalInteractionsLeafLevel
[
idxGroup
];
#pragma omp task default(none) firstprivate(idxGroup, containers, outsideInteractions, externalInteractions)
{
// Can be a task(inout:iterCells, out:outsideInteractions)
...
...
@@ -187,17 +187,20 @@ protected:
FLOG
(
leafTimer
.
tac
();
);
FLOG
(
cellTimer
.
tic
();
);
{
std
::
vector
<
std
::
vector
<
std
::
vector
<
OutOfBlockInteraction
>
>
>
allOutsideInteractions
;
allOutsideInteractions
.
resize
(
tree
->
getHeight
());
for
(
int
idxLevel
=
tree
->
getHeight
()
-
1
;
idxLevel
>=
2
;
--
idxLevel
){
std
::
vector
<
std
::
vector
<
OutOfBlockInteraction
>
>
allOutsideInteractions
;
allOutsideInteractions
[
idxLevel
].
resize
(
tree
->
getNbCellGroupAtLevel
(
idxLevel
));
externalInteractionsAllLevel
[
idxLevel
].
resize
(
tree
->
getNbCellGroupAtLevel
(
idxLevel
));
for
(
int
idxGroup
=
0
;
idxGroup
<
tree
->
getNbCellGroupAtLevel
(
idxLevel
)
;
++
idxGroup
){
allOutsideInteractions
.
push_back
(
std
::
vector
<
OutOfBlockInteraction
>
());
std
::
vector
<
OutOfBlockInteraction
>*
outsideInteractions
=
&
allOutsideInteractions
.
back
();
std
::
vector
<
OutOfBlockInteraction
>*
outsideInteractions
=
&
allOutsideInteractions
[
idxLevel
][
idxGroup
];
const
CellContainerClass
*
currentCells
=
tree
->
getCellGroup
(
idxLevel
,
idxGroup
);
externalInteractionsAllLevel
[
idxLevel
].
emplace_back
();
std
::
vector
<
BlockInteractions
<
CellContainerClass
>>*
externalInteractions
=
&
externalInteractionsAllLevel
[
idxLevel
].
back
();
std
::
vector
<
BlockInteractions
<
CellContainerClass
>>*
externalInteractions
=
&
externalInteractionsAllLevel
[
idxLevel
][
idxGroup
];
#pragma omp task default(none) firstprivate(idxGroup, currentCells, outsideInteractions, idxLevel, externalInteractions)
{
...
...
Tests/noDist/testBlockedRotation.cpp
View file @
339cde25
...
...
@@ -38,7 +38,13 @@ int main(int argc, char* argv[]){
const
FParameterNames
LocalOptionNoValidate
{
{
"-no-validation"
},
"To avoid comparing with direct computation"
};
FHelpDescribeAndExit
(
argc
,
argv
,
"Test the blocked tree by counting the particles."
,
FParameterDefinitions
::
OctreeHeight
,
FParameterDefinitions
::
InputFile
,
FParameterDefinitions
::
NbThreads
,
FParameterDefinitions
::
NbParticles
,
LocalOptionBlocSize
,
LocalOptionNoValidate
);
// Set the number of threads
omp_set_num_threads
(
FParameters
::
getValue
(
argc
,
argv
,
FParameterDefinitions
::
NbThreads
.
options
,
omp_get_max_threads
()));
// Initialize the types
static
const
int
P
=
9
;
typedef
FRotationCell
<
P
>
GroupCellClass
;
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment