Mentions légales du service
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
ScalFMM
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
solverstack
ScalFMM
Commits
1ca97c8c
Commit
1ca97c8c
authored
11 years ago
by
PIACIBELLO Cyrille
Browse files
Options
Downloads
Patches
Plain Diff
Changes for avoiding zero traited as null ptr
parent
42c991d5
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Src/Files/FMpiTreeBuilder.hpp
+15
-14
15 additions, 14 deletions
Src/Files/FMpiTreeBuilder.hpp
Src/Utils/FQuickSortMpi.hpp
+1
-1
1 addition, 1 deletion
Src/Utils/FQuickSortMpi.hpp
with
16 additions
and
15 deletions
Src/Files/FMpiTreeBuilder.hpp
+
15
−
14
View file @
1ca97c8c
...
@@ -45,6 +45,7 @@ public:
...
@@ -45,6 +45,7 @@ public:
* so this struct store a particle + its index
* so this struct store a particle + its index
*/
*/
struct
IndexedParticle
{
struct
IndexedParticle
{
public:
MortonIndex
index
;
MortonIndex
index
;
ParticleClass
particle
;
ParticleClass
particle
;
...
@@ -181,7 +182,7 @@ private:
...
@@ -181,7 +182,7 @@ private:
const
bool
needToRecvBeforeSend
=
(
rank
!=
0
&&
(((
*
workingSize
)
&&
otherFirstIndex
==
workingArray
[
0
].
index
)
||
!
(
*
workingSize
)));
const
bool
needToRecvBeforeSend
=
(
rank
!=
0
&&
(((
*
workingSize
)
&&
otherFirstIndex
==
workingArray
[
0
].
index
)
||
!
(
*
workingSize
)));
MPI_Request
requestSendLeaf
;
MPI_Request
requestSendLeaf
;
IndexedParticle
*
sendBuffer
=
0
;
IndexedParticle
*
sendBuffer
=
nullptr
;
if
(
rank
!=
nbProcs
-
1
&&
needToRecvBeforeSend
==
false
){
if
(
rank
!=
nbProcs
-
1
&&
needToRecvBeforeSend
==
false
){
FSize
idxPart
=
(
*
workingSize
)
-
1
;
FSize
idxPart
=
(
*
workingSize
)
-
1
;
while
(
idxPart
>=
0
&&
workingArray
[
idxPart
].
index
==
otherFirstIndex
){
while
(
idxPart
>=
0
&&
workingArray
[
idxPart
].
index
==
otherFirstIndex
){
...
@@ -197,7 +198,7 @@ private:
...
@@ -197,7 +198,7 @@ private:
rank
+
1
,
FMpi
::
TagSplittedLeaf
,
communicator
.
getComm
(),
&
requestSendLeaf
);
rank
+
1
,
FMpi
::
TagSplittedLeaf
,
communicator
.
getComm
(),
&
requestSendLeaf
);
}
}
else
{
else
{
MPI_Isend
(
0
,
0
,
MPI_BYTE
,
rank
+
1
,
FMpi
::
TagSplittedLeaf
,
communicator
.
getComm
(),
&
requestSendLeaf
);
MPI_Isend
(
nullptr
,
0
,
MPI_BYTE
,
rank
+
1
,
FMpi
::
TagSplittedLeaf
,
communicator
.
getComm
(),
&
requestSendLeaf
);
}
}
}
}
...
@@ -223,7 +224,7 @@ private:
...
@@ -223,7 +224,7 @@ private:
rank
-
1
,
FMpi
::
TagSplittedLeaf
,
communicator
.
getComm
(),
MPI_STATUS_IGNORE
);
rank
-
1
,
FMpi
::
TagSplittedLeaf
,
communicator
.
getComm
(),
MPI_STATUS_IGNORE
);
}
}
else
{
else
{
MPI_Recv
(
0
,
0
,
MPI_BYTE
,
rank
-
1
,
FMpi
::
TagSplittedLeaf
,
communicator
.
getComm
(),
MPI_STATUS_IGNORE
);
MPI_Recv
(
nullptr
,
0
,
MPI_BYTE
,
rank
-
1
,
FMpi
::
TagSplittedLeaf
,
communicator
.
getComm
(),
MPI_STATUS_IGNORE
);
}
}
}
}
...
@@ -231,21 +232,21 @@ private:
...
@@ -231,21 +232,21 @@ private:
MPI_Send
(
workingArray
,
int
((
*
workingSize
)
*
sizeof
(
IndexedParticle
)),
MPI_BYTE
,
MPI_Send
(
workingArray
,
int
((
*
workingSize
)
*
sizeof
(
IndexedParticle
)),
MPI_BYTE
,
rank
+
1
,
FMpi
::
TagSplittedLeaf
,
communicator
.
getComm
());
rank
+
1
,
FMpi
::
TagSplittedLeaf
,
communicator
.
getComm
());
delete
[]
workingArray
;
delete
[]
workingArray
;
workingArray
=
0
;
workingArray
=
nullptr
;
(
*
workingSize
)
=
0
;
(
*
workingSize
)
=
0
;
}
}
else
if
(
rank
!=
nbProcs
-
1
){
else
if
(
rank
!=
nbProcs
-
1
){
MPI_Wait
(
&
requestSendLeaf
,
MPI_STATUS_IGNORE
);
MPI_Wait
(
&
requestSendLeaf
,
MPI_STATUS_IGNORE
);
delete
[]
sendBuffer
;
delete
[]
sendBuffer
;
sendBuffer
=
0
;
sendBuffer
=
nullptr
;
}
}
}
}
}
}
{
//Filling the Array with leaves and parts //// COULD BE MOVED IN AN OTHER FUCTION
{
//Filling the Array with leaves and parts //// COULD BE MOVED IN AN OTHER FUCTION
(
*
leavesSize
)
=
0
;
//init ptr
(
*
leavesSize
)
=
0
;
//init ptr
(
*
leavesArray
)
=
0
;
//init ptr
(
*
leavesArray
)
=
nullptr
;
//init ptr
(
*
leavesIndices
)
=
0
;
//init ptr
(
*
leavesIndices
)
=
nullptr
;
//init ptr
if
((
*
workingSize
)){
if
((
*
workingSize
)){
...
@@ -275,7 +276,7 @@ private:
...
@@ -275,7 +276,7 @@ private:
delete
[]
workingArray
;
delete
[]
workingArray
;
workingArray
=
0
;
workingArray
=
nullptr
;
}
}
}
}
...
@@ -337,8 +338,8 @@ private:
...
@@ -337,8 +338,8 @@ private:
for
(
int
idxProc
=
0
;
idxProc
<
nbProcs
;
++
idxProc
){
for
(
int
idxProc
=
0
;
idxProc
<
nbProcs
;
++
idxProc
){
if
(
idxProc
!=
myRank
){
if
(
idxProc
!=
myRank
){
const
FSize
correctLeftLeafNumber
=
balancer
->
getLeft
(
totalNumberOfLeaves
,
NULL
,
0
,
0
,
nbProcs
,
idxProc
);
const
FSize
correctLeftLeafNumber
=
balancer
->
getLeft
(
totalNumberOfLeaves
,
nullptr
,
0
,
nullptr
,
nbProcs
,
idxProc
);
const
FSize
correctRightLeafNumber
=
balancer
->
getRight
(
totalNumberOfLeaves
,
NULL
,
0
,
0
,
nbProcs
,
idxProc
);
const
FSize
correctRightLeafNumber
=
balancer
->
getRight
(
totalNumberOfLeaves
,
nullptr
,
0
,
nullptr
,
nbProcs
,
idxProc
);
//5 cases : Refer to ParalleleDetails.pdf to know more
//5 cases : Refer to ParalleleDetails.pdf to know more
...
@@ -532,14 +533,14 @@ public:
...
@@ -532,14 +533,14 @@ public:
const
FPoint
&
boxCenter
,
const
FReal
boxWidth
,
const
int
treeHeight
,
const
FPoint
&
boxCenter
,
const
FReal
boxWidth
,
const
int
treeHeight
,
ContainerClass
*
particleSaver
,
FAbstractBalanceAlgorithm
*
balancer
,
const
SortingType
type
=
QuickSort
){
ContainerClass
*
particleSaver
,
FAbstractBalanceAlgorithm
*
balancer
,
const
SortingType
type
=
QuickSort
){
IndexedParticle
*
particlesArray
=
0
;
IndexedParticle
*
particlesArray
=
nullptr
;
FSize
particlesSize
=
0
;
FSize
particlesSize
=
0
;
SortParticlesFromArray
(
communicator
,
array
,
size
,
type
,
boxCenter
,
boxWidth
,
treeHeight
,
SortParticlesFromArray
(
communicator
,
array
,
size
,
type
,
boxCenter
,
boxWidth
,
treeHeight
,
&
particlesArray
,
&
particlesSize
);
&
particlesArray
,
&
particlesSize
);
ParticleClass
*
leavesArray
=
0
;
ParticleClass
*
leavesArray
=
nullptr
;
FSize
leavesSize
=
0
;
FSize
leavesSize
=
0
;
FSize
*
leavesIndices
=
0
;
FSize
*
leavesIndices
=
nullptr
;
MergeLeaves
(
communicator
,
particlesArray
,
&
particlesSize
,
&
leavesIndices
,
&
leavesArray
,
&
leavesSize
);
MergeLeaves
(
communicator
,
particlesArray
,
&
particlesSize
,
&
leavesIndices
,
&
leavesArray
,
&
leavesSize
);
...
@@ -547,7 +548,7 @@ public:
...
@@ -547,7 +548,7 @@ public:
/** To produce stats after the Equalize phase
/** To produce stats after the Equalize phase
*/
*/
int
*
nbPartsPerProc
=
{
0
}
;
int
*
nbPartsPerProc
;
int
myParts
=
particleSaver
->
getSize
();
int
myParts
=
particleSaver
->
getSize
();
int
nbProc
=
communicator
.
processCount
();
int
nbProc
=
communicator
.
processCount
();
...
...
This diff is collapsed.
Click to expand it.
Src/Utils/FQuickSortMpi.hpp
+
1
−
1
View file @
1ca97c8c
...
@@ -45,7 +45,7 @@ public:
...
@@ -45,7 +45,7 @@ public:
// receiving buffer
// receiving buffer
IndexType
bufferSize
=
0
;
IndexType
bufferSize
=
0
;
SortType
*
buffer
=
0
;
SortType
*
buffer
=
nullptr
;
// Create the first com
// Create the first com
FMpi
::
FComm
currentComm
(
originalComm
.
getComm
());
FMpi
::
FComm
currentComm
(
originalComm
.
getComm
());
...
...
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