Skip to content
GitLab
Menu
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
8f1cf0db
Commit
8f1cf0db
authored
Jun 23, 2014
by
BRAMAS Berenger
Browse files
update tree builder to debug
parent
5c3ac488
Changes
1
Hide whitespace changes
Inline
Side-by-side
Src/Files/FMpiTreeBuilder.hpp
View file @
8f1cf0db
...
...
@@ -311,13 +311,14 @@ private:
memset
(
numberOfLeavesPerProc
,
0
,
sizeof
(
FSize
)
*
nbProcs
);
FSize
intNbLeavesInIntervals
=
nbLeavesInIntervals
;
MPI_Allgather
(
&
intNbLeavesInIntervals
,
1
,
MPI_LONG_LONG_INT
,
numberOfLeavesPerProc
,
1
,
MPI_LONG_LONG_INT
,
communicator
.
getComm
());
//For debug, print the input datas for each proc
//printf("Proc : %d : Currently have %lld parts in %lld leaves \n", myRank, myCurrentsParts, myNumberOfLeaves);
//We need the max number of leafs over th procs
FSize
totalNumberOfLeaves
=
numberOfLeavesPerProc
[
0
];
for
(
int
idxProc
=
1
;
idxProc
<
nbProcs
;
++
idxProc
){
FSize
*
const
diffNumberOfLeavesPerProc
=
new
FSize
[
nbProcs
+
1
];
diffNumberOfLeavesPerProc
[
0
]
=
0
;
FSize
totalNumberOfLeaves
=
0
;
for
(
int
idxProc
=
0
;
idxProc
<
nbProcs
;
++
idxProc
){
totalNumberOfLeaves
+=
numberOfLeavesPerProc
[
idxProc
];
diffNumberOfLeavesPerProc
[
idxProc
+
1
]
=
diffNumberOfLeavesPerProc
[
idxProc
]
+
numberOfLeavesPerProc
[
idxProc
];
}
//Building of counter send buffer
...
...
@@ -335,12 +336,14 @@ private:
allObjectives
[
idxProc
].
second
=
balancer
->
getRight
(
totalNumberOfLeaves
,
NULL
,
0
,
0
,
nbProcs
,
idxProc
);
}
std
::
pair
<
size_t
,
size_t
>
myCurrentInter
=
allObjectives
[
myRank
]
;
std
::
pair
<
size_t
,
size_t
>
myCurrentInter
=
{
diffNumberOfLeavesPerProc
[
myRank
],
diffNumberOfLeavesPerProc
[
myRank
+
1
]}
;
const
std
::
vector
<
FEqualize
::
Package
>
packsToSend
=
FEqualize
::
GetPackToSend
(
myCurrentInter
,
allObjectives
);
for
(
const
FEqualize
::
Package
&
pack
:
packsToSend
){
printf
(
"%d] to %d from %llu to %llu
\n
"
,
myRank
,
pack
.
idProc
,
pack
.
elementFrom
,
pack
.
elementTo
);
idxToSend
[
pack
.
idProc
]
=
pack
.
elementFrom
;
toSend
[
pack
.
idProc
]
=
leavesIndices
[
pack
.
elementTo
]
-
leavesIndices
[
pack
.
elementFrom
];
toSend
[
pack
.
idProc
]
=
(
pack
.
elementTo
?
leavesIndices
[
pack
.
elementTo
-
1
]
:
0
)
-
(
pack
.
elementFrom
?
leavesIndices
[
pack
.
elementFrom
-
1
]
:
0
);
}
//Then, we exchange the datas to send
...
...
Write
Preview
Supports
Markdown
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