Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Sbalzarini Lab
S
Software
P
Parallel Computing
OpenFPM
openfpm_pdata
Commits
cb130fcf
Commit
cb130fcf
authored
Apr 06, 2017
by
Pietro Incardona
Browse files
Small fix for emty processors
parent
bdb0f365
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/Decomposition/CartDecomposition.hpp
View file @
cb130fcf
...
...
@@ -268,12 +268,24 @@ public:
d_o
.
template
optimize
<
nm_v
::
sub_id
,
nm_v
::
proc_id
>(
dist
.
getGraph
(),
p_id
,
loc_box
,
box_nn_processor
,
ghe
,
bc
);
// Initialize
if
(
loc_box
.
size
()
>
=
0
)
if
(
loc_box
.
size
()
>
0
)
{
bbox
=
convertDecBoxIntoSubDomain
(
loc_box
.
get
(
0
));
proc_box
=
loc_box
.
get
(
0
);
sub_domains
.
add
(
bbox
);
}
else
{
// invalidate all the boxes
for
(
size_t
i
=
0
;
i
<
dim
;
i
++
)
{
proc_box
.
setLow
(
i
,
0.0
);
proc_box
.
setHigh
(
i
,(
size_t
)
-
1
);
bbox
.
setLow
(
i
,
0.0
);
bbox
.
setHigh
(
i
,(
size_t
)
-
1
);
}
}
// convert into sub-domain
for
(
size_t
s
=
1
;
s
<
loc_box
.
size
();
s
++
)
...
...
@@ -327,19 +339,23 @@ public:
{
// Get the processor bounding Box
::
Box
<
dim
,
T
>
bound
=
getProcessorBounds
();
// Not necessary, but I prefer
bound
.
enlarge
(
ghost
);
// calculate the sub-divisions
size_t
div
[
dim
];
for
(
size_t
i
=
0
;
i
<
dim
;
i
++
)
div
[
i
]
=
(
size_t
)
((
bound
.
getHigh
(
i
)
-
bound
.
getLow
(
i
))
/
cd
.
getCellBox
().
getP2
()[
i
]
);
if
(
bound
.
isValid
()
==
true
)
{
// Not necessary, but I prefer
bound
.
enlarge
(
ghost
);
// Initialize the geo_cell structure
ie_ghost
<
dim
,
T
>::
Initialize_geo_cell
(
bound
,
div
);
// calculate the sub-divisions
size_t
div
[
dim
];
for
(
size_t
i
=
0
;
i
<
dim
;
i
++
)
div
[
i
]
=
(
size_t
)
((
bound
.
getHigh
(
i
)
-
bound
.
getLow
(
i
))
/
cd
.
getCellBox
().
getP2
()[
i
]);
// Initialize shift vectors
ie_ghost
<
dim
,
T
>::
generateShiftVectors
(
domain
);
// Initialize the geo_cell structure
ie_ghost
<
dim
,
T
>::
Initialize_geo_cell
(
bound
,
div
);
// Initialize shift vectors
ie_ghost
<
dim
,
T
>::
generateShiftVectors
(
domain
);
}
}
/*! \brief Calculate communication and migration costs
...
...
src/Decomposition/Distribution/ParMetisDistribution.hpp
View file @
cb130fcf
...
...
@@ -471,7 +471,7 @@ public:
#ifdef SE_CLASS1
if
(
id
>=
gp
.
getNVertex
())
std
::
cerr
<<
<<
__FILE__
<<
":"
<<
__LINE__
<<
"Such vertex doesn't exist (id = "
<<
id
<<
", "
<<
"total size = "
<<
gp
.
getNVertex
()
<<
")
\n
"
;
std
::
cerr
<<
__FILE__
<<
":"
<<
__LINE__
<<
"Such vertex doesn't exist (id = "
<<
id
<<
", "
<<
"total size = "
<<
gp
.
getNVertex
()
<<
")
\n
"
;
#endif
// Update vertex in main graph
...
...
@@ -545,10 +545,10 @@ public:
*/
void
setCommunicationCost
(
size_t
v_id
,
size_t
e
,
size_t
communication
)
{
size_t
e_id
=
v_id
+
e
;
#ifdef SE_CLASS1
if
(
e_id
>=
gp
.
getNEdge
())
std
::
cerr
<<
"Such edge doesn't exist (id = "
<<
e_id
<<
", "
<<
"total size = "
<<
gp
.
getNEdge
()
<<
")
\n
"
;
#endif
gp
.
getChildEdge
(
v_id
,
e
).
template
get
<
nm_e
::
communication
>()
=
communication
;
}
...
...
src/Vector/vector_dist.hpp
View file @
cb130fcf
...
...
@@ -1488,6 +1488,14 @@ public:
*/
template
<
int
...
prp
>
inline
void
ghost_get
(
size_t
opt
=
WITH_POSITION
)
{
#ifdef SE_CLASS1
if
(
getDecomposition
().
getProcessorBounds
().
isValid
()
==
false
&&
vd
.
size_local
()
!=
0
)
{
std
::
cerr
<<
__FILE__
<<
":"
<<
__LINE__
<<
" Error the processor "
<<
v_cl
.
getProcessorUnitID
()
<<
" has particles, but is supposed to be unloaded"
<<
std
::
endl
;
ACTION_ON_ERROR
(
VECTOR_DIST_ERROR_OBJECT
);
}
#endif
#ifdef SE_CLASS3
se3
.
template
ghost_get_pre
<
prp
...>(
opt
);
#endif
...
...
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