Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
openfpm_pdata
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
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
Sbalzarini Lab
Software
Parallel Computing
OpenFPM
openfpm_pdata
Commits
7137a3b0
Commit
7137a3b0
authored
8 years ago
by
Yaroslav
Browse files
Options
Downloads
Patches
Plain Diff
Finishing performance tests
parent
3431d87e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/Vector/vector_dist.hpp
+0
-35
0 additions, 35 deletions
src/Vector/vector_dist.hpp
src/Vector/vector_dist_unit_test.hpp
+13
-21
13 additions, 21 deletions
src/Vector/vector_dist_unit_test.hpp
with
13 additions
and
56 deletions
src/Vector/vector_dist.hpp
+
0
−
35
View file @
7137a3b0
...
@@ -1110,37 +1110,6 @@ public:
...
@@ -1110,37 +1110,6 @@ public:
}
}
}
}
/*template<typename CellL> void celllist_initialize(CellL & cell_list, St r_cut, const Ghost<dim, St> & enlarge)
{
// calculate the parameters of the cell list
// get the processor bounding box
Box<dim, St> pbox = dec.getProcessorBounds();
// extend by the ghost
pbox.enlarge(enlarge);
size_t div[dim];
// Calculate the division array and the cell box
for (size_t i = 0; i < dim; i++)
{
div[i] = static_cast<size_t>((pbox.getP2().get(i) - pbox.getP1().get(i)) / r_cut);
div[i]++;
pbox.setHigh(i,pbox.getLow(i) + div[i]*r_cut);
}
if(is_Hilbert<CellL>::type::value == true)
{
std::cout << "Case 1: " << demangle(typeid(CellL).name()) << std::endl;
cell_list.Initialize(pbox, div, g_m);
}
else
{
std::cout << "Case 2: " << demangle(typeid(CellL).name()) << std::endl;
cell_list.Initialize(pbox, div);
}
}*/
/*! \brief Construct a cell list starting from the stored particles
/*! \brief Construct a cell list starting from the stored particles
*
*
* It differ from the get getCellList for an additional parameter, in case the
* It differ from the get getCellList for an additional parameter, in case the
...
@@ -1168,10 +1137,6 @@ public:
...
@@ -1168,10 +1137,6 @@ public:
updateCellList
(
cell_list
);
updateCellList
(
cell_list
);
std
::
cout
<<
"V_pos size: "
<<
v_pos
.
size
()
<<
", V_prp size: "
<<
v_prp
.
size
()
<<
std
::
endl
;
//std::cout << "Number of padding cells: " << cell_list.getPadding(0)*cell_list.getPadding(1) << /*", Tot_n_cell: " << cell_list.return_n_cell() <<*/ std::endl;
return
cell_list
;
return
cell_list
;
}
}
...
...
This diff is collapsed.
Click to expand it.
src/Vector/vector_dist_unit_test.hpp
+
13
−
21
View file @
7137a3b0
...
@@ -1256,7 +1256,7 @@ BOOST_AUTO_TEST_CASE( vector_dist_cell_verlet_test )
...
@@ -1256,7 +1256,7 @@ BOOST_AUTO_TEST_CASE( vector_dist_cell_verlet_test )
}
}
}
}
BOOST_AUTO_TEST_CASE
(
vector_dist_
hilbert
_2d_benchmark_test
)
BOOST_AUTO_TEST_CASE
(
vector_dist_
reorder
_2d_benchmark_test
)
{
{
typedef
Point
<
2
,
float
>
s
;
typedef
Point
<
2
,
float
>
s
;
...
@@ -1280,8 +1280,6 @@ BOOST_AUTO_TEST_CASE( vector_dist_hilbert_2d_benchmark_test )
...
@@ -1280,8 +1280,6 @@ BOOST_AUTO_TEST_CASE( vector_dist_hilbert_2d_benchmark_test )
{
{
BOOST_TEST_CHECKPOINT
(
"Testing 2D vector with hilbert curve reordering k="
<<
k
);
BOOST_TEST_CHECKPOINT
(
"Testing 2D vector with hilbert curve reordering k="
<<
k
);
//! [Create a vector of random elements on each processor 2D]
Box
<
2
,
float
>
box
({
0.0
,
0.0
},{
1.0
,
1.0
});
Box
<
2
,
float
>
box
({
0.0
,
0.0
},{
1.0
,
1.0
});
// Boundary conditions
// Boundary conditions
...
@@ -1303,10 +1301,11 @@ BOOST_AUTO_TEST_CASE( vector_dist_hilbert_2d_benchmark_test )
...
@@ -1303,10 +1301,11 @@ BOOST_AUTO_TEST_CASE( vector_dist_hilbert_2d_benchmark_test )
vd
.
map
();
vd
.
map
();
//Start timer
timer
t
;
timer
t
;
t
.
start
();
t
.
start
();
//
! [
Create
a vector of random elements on each processor 2D]
//
Create
first cell list
auto
NN1
=
vd
.
getCellList
(
0.01
);
auto
NN1
=
vd
.
getCellList
(
0.01
);
...
@@ -1316,8 +1315,10 @@ BOOST_AUTO_TEST_CASE( vector_dist_hilbert_2d_benchmark_test )
...
@@ -1316,8 +1315,10 @@ BOOST_AUTO_TEST_CASE( vector_dist_hilbert_2d_benchmark_test )
//Reorder a vector
//Reorder a vector
vd
.
reorder
(
m
);
vd
.
reorder
(
m
);
// Create second cell list
auto
NN2
=
vd
.
getCellList
(
0.01
);
auto
NN2
=
vd
.
getCellList
(
0.01
);
//Check equality of cell sizes
for
(
size_t
i
=
0
;
i
<
NN1
.
getGrid
().
size
()
;
i
++
)
for
(
size_t
i
=
0
;
i
<
NN1
.
getGrid
().
size
()
;
i
++
)
{
{
size_t
n1
=
NN1
.
getNelements
(
i
);
size_t
n1
=
NN1
.
getNelements
(
i
);
...
@@ -1331,7 +1332,7 @@ BOOST_AUTO_TEST_CASE( vector_dist_hilbert_2d_benchmark_test )
...
@@ -1331,7 +1332,7 @@ BOOST_AUTO_TEST_CASE( vector_dist_hilbert_2d_benchmark_test )
}
}
}
}
BOOST_AUTO_TEST_CASE
(
vector_dist_cl_hilb_forces_test
)
BOOST_AUTO_TEST_CASE
(
vector_dist_cl_
random_vs_
hilb_forces_test
)
{
{
///////// INPUT DATA //////////
///////// INPUT DATA //////////
...
@@ -1432,11 +1433,8 @@ BOOST_AUTO_TEST_CASE( vector_dist_cl_hilb_forces_test )
...
@@ -1432,11 +1433,8 @@ BOOST_AUTO_TEST_CASE( vector_dist_cl_hilb_forces_test )
}
}
}
}
BOOST_AUTO_TEST_CASE
(
vector_dist_cl_
hilb
_forces_test
_2
)
BOOST_AUTO_TEST_CASE
(
vector_dist_cl_
random_vs_reorder
_forces_test
)
{
{
///////// INPUT DATA //////////
///////// INPUT DATA //////////
// Dimensionality of the space
// Dimensionality of the space
...
@@ -1492,27 +1490,20 @@ BOOST_AUTO_TEST_CASE( vector_dist_cl_hilb_forces_test_2 )
...
@@ -1492,27 +1490,20 @@ BOOST_AUTO_TEST_CASE( vector_dist_cl_hilb_forces_test_2 )
vector_dist
<
dim
,
float
,
aggregate
<
float
[
dim
],
float
[
dim
]
>
,
CartDecomposition
<
dim
,
float
>
>
vd
(
k_int
,
box
,
bc
,
Ghost
<
dim
,
float
>
(
ghost_part
));
vector_dist
<
dim
,
float
,
aggregate
<
float
[
dim
],
float
[
dim
]
>
,
CartDecomposition
<
dim
,
float
>
>
vd
(
k_int
,
box
,
bc
,
Ghost
<
dim
,
float
>
(
ghost_part
));
//vector_dist<dim,float, aggregate<float[dim]>, CartDecomposition<dim,float> > vd2(k_int,box,bc,Ghost<dim,float>(ghost_part));
// Initialize vd
// Initialize dist vectors
vd_initialize
<
dim
,
decltype
(
vd
)
>
(
vd
,
v_cl
,
k_int
);
vd_initialize
<
dim
,
decltype
(
vd
)
>
(
vd
,
v_cl
,
k_int
);
//Reorder a vd2
vd
.
template
ghost_get
<
0
>();
vd
.
template
ghost_get
<
0
>();
//vd2.template ghost_get<0>();
//Get a cell list
//Get a cell list
auto
NN1
=
vd
.
getCellList
(
r_cut
);
auto
NN1
=
vd
.
getCellList
(
r_cut
);
//Calculate forces
//Calculate forces
'0'
calc_forces_2
<
dim
,
0
>
(
NN1
,
vd
,
r_cut
);
calc_forces_2
<
dim
,
0
>
(
NN1
,
vd
,
r_cut
);
//Get a cell list
//Reorder and get a cell list again
//auto NN2 = vd2.getCellList(r_cut);
vd
.
reorder
(
4
);
vd
.
reorder
(
4
);
...
@@ -1520,9 +1511,10 @@ BOOST_AUTO_TEST_CASE( vector_dist_cl_hilb_forces_test_2 )
...
@@ -1520,9 +1511,10 @@ BOOST_AUTO_TEST_CASE( vector_dist_cl_hilb_forces_test_2 )
auto
NN2
=
vd
.
getCellList
(
r_cut
);
auto
NN2
=
vd
.
getCellList
(
r_cut
);
//Calculate forces
//Calculate forces
'1'
calc_forces_2
<
dim
,
1
>
(
NN2
,
vd
,
r_cut
);
calc_forces_2
<
dim
,
1
>
(
NN2
,
vd
,
r_cut
);
//Test for equality of forces
auto
it_v
=
vd
.
getDomainIterator
();
auto
it_v
=
vd
.
getDomainIterator
();
while
(
it_v
.
isNext
())
while
(
it_v
.
isNext
())
...
@@ -1534,7 +1526,7 @@ BOOST_AUTO_TEST_CASE( vector_dist_cl_hilb_forces_test_2 )
...
@@ -1534,7 +1526,7 @@ BOOST_AUTO_TEST_CASE( vector_dist_cl_hilb_forces_test_2 )
{
{
auto
a1
=
vd
.
template
getProp
<
0
>(
key
)[
i
];
auto
a1
=
vd
.
template
getProp
<
0
>(
key
)[
i
];
auto
a2
=
vd
.
template
getProp
<
1
>(
key
)[
i
];
auto
a2
=
vd
.
template
getProp
<
1
>(
key
)[
i
];
//Check that the forces are equal
//Check that the forces are
(almost)
equal
BOOST_REQUIRE_CLOSE
(
a1
,
a2
,
0.001
);
BOOST_REQUIRE_CLOSE
(
a1
,
a2
,
0.001
);
}
}
...
...
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