Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
O
openfpm_pdata
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Environments
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
openfpm
openfpm_pdata
Commits
cfa6f9ba
Commit
cfa6f9ba
authored
Apr 11, 2017
by
incardon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixing Metis decomposition
parent
106625f9
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
53 additions
and
7 deletions
+53
-7
src/Decomposition/Distribution/Distribution_unit_tests.hpp
src/Decomposition/Distribution/Distribution_unit_tests.hpp
+10
-1
src/Decomposition/Distribution/MetisDistribution.hpp
src/Decomposition/Distribution/MetisDistribution.hpp
+14
-0
src/Decomposition/Distribution/metis_util.hpp
src/Decomposition/Distribution/metis_util.hpp
+29
-6
No files found.
src/Decomposition/Distribution/Distribution_unit_tests.hpp
View file @
cfa6f9ba
...
...
@@ -85,6 +85,8 @@ BOOST_AUTO_TEST_CASE( Metis_distribution_test)
met_dist
.
createCartGraph
(
info
,
box
);
met_dist
.
decompose
();
BOOST_REQUIRE_EQUAL
(
met_dist
.
get_ndec
(),
1ul
);
//! [Initialize a Metis Cartesian graph and decompose]
BOOST_REQUIRE
(
met_dist
.
getUnbalance
()
<
0.03
);
...
...
@@ -122,6 +124,8 @@ BOOST_AUTO_TEST_CASE( Metis_distribution_test)
met_dist
.
decompose
();
BOOST_REQUIRE_EQUAL
(
met_dist
.
get_ndec
(),
2ul
);
//! [Decomposition Metis with weights]
BOOST_REQUIRE
(
met_dist
.
getUnbalance
()
<
0.06
);
...
...
@@ -164,7 +168,7 @@ BOOST_AUTO_TEST_CASE( Metis_distribution_test)
// operator= functions
// operator== functions
BOOST_REQUIRE_EQUAL
(
sizeof
(
MetisDistribution
<
3
,
float
>
),
7
12
ul
);
BOOST_REQUIRE_EQUAL
(
sizeof
(
MetisDistribution
<
3
,
float
>
),
7
20
ul
);
}
BOOST_AUTO_TEST_CASE
(
Parmetis_distribution_test
)
...
...
@@ -197,6 +201,8 @@ BOOST_AUTO_TEST_CASE( Parmetis_distribution_test)
// first decomposition
pmet_dist
.
decompose
();
BOOST_REQUIRE_EQUAL
(
pmet_dist
.
get_ndec
(),
1ul
);
//! [Initialize a ParMetis Cartesian graph and decompose]
if
(
v_cl
.
getProcessUnitID
()
==
0
)
...
...
@@ -225,6 +231,7 @@ BOOST_AUTO_TEST_CASE( Parmetis_distribution_test)
Point
<
3
,
float
>
shift
(
{
tstep
,
tstep
,
tstep
});
size_t
iter
=
1
;
size_t
n_dec
=
1
;
for
(
float
t
=
stime
;
t
<
etime
;
t
=
t
+
tstep
,
iter
++
)
{
...
...
@@ -239,6 +246,8 @@ BOOST_AUTO_TEST_CASE( Parmetis_distribution_test)
if
((
size_t
)
iter
%
10
==
0
)
{
pmet_dist
.
refine
();
n_dec
++
;
BOOST_REQUIRE_EQUAL
(
pmet_dist
.
get_ndec
(),
n_dec
);
if
(
v_cl
.
getProcessUnitID
()
==
0
)
{
...
...
src/Decomposition/Distribution/MetisDistribution.hpp
View file @
cfa6f9ba
...
...
@@ -259,6 +259,10 @@ public:
}
}
}
else
{
metis_graph
.
inc_dec
();
}
recv_ass
.
resize
(
gp
.
getNVertex
());
...
...
@@ -652,6 +656,16 @@ public:
size_t
ids
=
fnd
->
second
;
return
owner_cost_sub
.
get
(
ids
).
w
;
}
/*! \brief Get the decomposition counter
*
* \return the decomposition counter
*
*/
size_t
get_ndec
()
{
return
metis_graph
.
get_ndec
();
}
};
#endif
/* SRC_DECOMPOSITION_METISDISTRIBUTION_HPP_ */
src/Decomposition/Distribution/metis_util.hpp
View file @
cfa6f9ba
...
...
@@ -78,8 +78,8 @@ class Metis
//! Original graph
Graph
&
g
;
//
Check if weights are available
// bool useWeights = false
;
//
! indicate how many time decompose/refine/re-decompose has been called
size_t
n_dec
;
//! Distribution tolerance
real_t
dist_tol
=
1.05
;
...
...
@@ -189,7 +189,7 @@ public:
*
*/
Metis
(
Graph
&
g
,
size_t
nc
,
bool
useWeights
)
:
g
(
g
)
:
g
(
g
)
,
n_dec
(
0
)
{
initMetisGraph
(
nc
,
useWeights
);
}
...
...
@@ -202,8 +202,8 @@ public:
* \param nc number of partitions
*
*/
Metis
(
Graph
&
g
,
size_t
nc
)
:
g
(
g
)
Metis
(
Graph
&
g
,
size_t
nc
)
:
g
(
g
),
n_dec
(
0
)
{
initMetisGraph
(
nc
,
false
);
}
...
...
@@ -217,7 +217,7 @@ public:
*
*/
Metis
(
Graph
&
g
)
:
g
(
g
)
:
g
(
g
)
,
n_dec
(
0
)
{
Mg
.
nvtxs
=
NULL
;
Mg
.
ncon
=
NULL
;
...
...
@@ -402,6 +402,8 @@ public:
++
it
;
}
}
n_dec
++
;
}
/*! \brief Decompose the graph
...
...
@@ -431,6 +433,8 @@ public:
++
id
;
++
it
;
}
n_dec
++
;
}
/*! \brief It set Metis on test
...
...
@@ -467,6 +471,25 @@ public:
{
dist_tol
=
tol
;
}
/*! \brief Get the decomposition counter
*
* \return the decomposition counter
*
*/
size_t
get_ndec
()
{
return
n_dec
;
}
/*! \brief Increment the decomposition counter
*
*
*/
void
inc_dec
()
{
n_dec
++
;
}
};
#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