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
0
Issues
0
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
Packages & Registries
Packages & Registries
Package Registry
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
argupta
openfpm_pdata
Commits
d93e4a34
Commit
d93e4a34
authored
Apr 14, 2016
by
Pietro Incardona
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Changing vcluster initialization
parent
7e9feabe
Changes
27
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
27 changed files
with
132 additions
and
154 deletions
+132
-154
CHANGELOG.md
CHANGELOG.md
+13
-0
build_pdata.sh
build_pdata.sh
+10
-0
example/Grid/0_simple/main.cpp
example/Grid/0_simple/main.cpp
+1
-1
example/Grid/1_stencil/main.cpp
example/Grid/1_stencil/main.cpp
+1
-1
example/Vector/0_simple/main.cpp
example/Vector/0_simple/main.cpp
+1
-2
example/Vector/1_celllist/main.cpp
example/Vector/1_celllist/main.cpp
+1
-1
example/Vector/1_verlet/main.cpp
example/Vector/1_verlet/main.cpp
+1
-1
images/CartDecomposition_gen_vtk.cpp
images/CartDecomposition_gen_vtk.cpp
+4
-3
images/vector.cpp
images/vector.cpp
+3
-3
openfpm_io
openfpm_io
+1
-1
openfpm_numerics
openfpm_numerics
+1
-1
openfpm_vcluster
openfpm_vcluster
+1
-1
src/Decomposition/CartDecomposition_unit_test.hpp
src/Decomposition/CartDecomposition_unit_test.hpp
+3
-12
src/Decomposition/Distribution/Distribution_unit_tests.hpp
src/Decomposition/Distribution/Distribution_unit_tests.hpp
+4
-4
src/Decomposition/Distribution/metis_util_unit_test.hpp
src/Decomposition/Distribution/metis_util_unit_test.hpp
+1
-1
src/Decomposition/ORB.hpp
src/Decomposition/ORB.hpp
+1
-1
src/Decomposition/ORB_unit_test.hpp
src/Decomposition/ORB_unit_test.hpp
+1
-4
src/Graph/DistGraphFactory.hpp
src/Graph/DistGraphFactory.hpp
+2
-2
src/Graph/dist_map_graph.hpp
src/Graph/dist_map_graph.hpp
+3
-3
src/Graph/dist_map_graph_unit_test.hpp
src/Graph/dist_map_graph_unit_test.hpp
+4
-16
src/Grid/grid_dist_id.hpp
src/Grid/grid_dist_id.hpp
+9
-8
src/Grid/grid_dist_id_unit_test.hpp
src/Grid/grid_dist_id_unit_test.hpp
+36
-59
src/Grid/grid_dist_id_unit_test_ext_dom.hpp
src/Grid/grid_dist_id_unit_test_ext_dom.hpp
+2
-2
src/Vector/vector_dist.hpp
src/Vector/vector_dist.hpp
+3
-2
src/Vector/vector_dist_unit_test.hpp
src/Vector/vector_dist_unit_test.hpp
+22
-22
src/dec_optimizer_unit_test.hpp
src/dec_optimizer_unit_test.hpp
+1
-1
src/unit_test_init_cleanup.hpp
src/unit_test_init_cleanup.hpp
+2
-2
No files found.
CHANGELOG.md
View file @
d93e4a34
# Change Log
All notable changes to this project will be documented in this file.
## [0.3.0] -
### Added
-
Nothing to report
### Fixed
-
Nothing to report
### Changed
-
Eliminated global_v_cluster, init_global_v_cluster, delete_global_v_cluster,
substituted by
create_vcluster, openfpm_init, openfpm_delete
## [0.2.1] -
### Changed
...
...
build_pdata.sh
View file @
d93e4a34
...
...
@@ -66,6 +66,11 @@ then
module load gcc/4.9.2
./install
-s
-c
"--prefix=/home/jenkins/openfpm_install"
make
if
[
$?
-ne
0
]
;
then
curl
-X
POST
--data
"payload={
\"
icon_emoji
\"
:
\"
:jenkins:
\"
,
\"
username
\"
:
\"
jenkins
\"
,
\"
attachments
\"
:[{
\"
title
\"
:
\"
Error:
\"
,
\"
color
\"
:
\"
#FF0000
\"
,
\"
text
\"
:
\"
$2
failed to complete the openfpm_pdata test
\"
}] }"
https://hooks.slack.com/services/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
exit
1
;
fi
make
install
if
[
$?
-ne
0
]
;
then
...
...
@@ -261,6 +266,11 @@ else
echo
"Compiling general"
source
~/.bashrc
./install
-s
make
if
[
$?
-ne
0
]
;
then
curl
-X
POST
--data
"payload={
\"
icon_emoji
\"
:
\"
:jenkins:
\"
,
\"
username
\"
:
\"
jenkins
\"
,
\"
attachments
\"
:[{
\"
title
\"
:
\"
Error:
\"
,
\"
color
\"
:
\"
#FF0000
\"
,
\"
text
\"
:
\"
$2
failed to complete the openfpm_pdata test
\"
}] }"
https://hooks.slack.com/services/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
exit
1
;
fi
mpirun
-np
1 ./src/pdata
if
[
$?
-ne
0
]
;
then
...
...
example/Grid/0_simple/main.cpp
View file @
d93e4a34
...
...
@@ -54,7 +54,7 @@ int main(int argc, char* argv[])
// * domain: where the grid is defined
// * g: ghost extension
//
grid_dist_id
<
3
,
float
,
aggregate
<
float
[
3
]
>
,
CartDecomposition
<
3
,
float
>
>
g_dist
(
sz
,
domain
,
g
);
grid_dist_id
<
3
,
float
,
aggregate
<
float
[
3
]
>>
g_dist
(
sz
,
domain
,
g
);
// ### WIKI 5 ###
//
...
...
example/Grid/1_stencil/main.cpp
View file @
d93e4a34
...
...
@@ -70,7 +70,7 @@ int main(int argc, char* argv[])
// * domain: where the grid is defined
// * g: ghost extension
//
grid_dist_id
<
3
,
float
,
grid_point
,
CartDecomposition
<
3
,
float
>
>
g_dist
(
sz
,
domain
,
g
);
grid_dist_id
<
3
,
float
,
grid_point
>
g_dist
(
sz
,
domain
,
g
);
// ### WIKI 5 ###
//
...
...
example/Vector/0_simple/main.cpp
View file @
d93e4a34
...
...
@@ -68,7 +68,6 @@ int main(int argc, char* argv[])
// * Type of the space, float (2° template parameters)
// * Information stored by each object (3* template parameters), in this case a Point_test store 4 scalars
// 1 vector and an asymmetric tensor of rank 2
// * Strategy used to decompose the space
//
// Constructor instead require:
//
...
...
@@ -79,7 +78,7 @@ int main(int argc, char* argv[])
// objects with an undefined position in space. This non-space decomposition is also called data-driven
// decomposition
//
vector_dist
<
2
,
float
,
Particle
<
float
>
,
CartDecomposition
<
2
,
float
>
>
vd
(
4096
,
domain
,
bc
,
g
);
vector_dist
<
2
,
float
,
Particle
<
float
>
>
vd
(
4096
,
domain
,
bc
,
g
);
//
// ### WIKI 5 ###
...
...
example/Vector/1_celllist/main.cpp
View file @
d93e4a34
...
...
@@ -43,7 +43,7 @@ int main(int argc, char* argv[])
// scalar double, a vector double[3], and a tensor or rank 2 double[3][3].
// In this case the vector contain 0 particles in total
//
vector_dist
<
3
,
float
,
aggregate
<
double
,
double
[
3
],
double
[
3
][
3
]
>
,
CartDecomposition
<
3
,
float
>
>
vd
(
0
,
box
,
bc
,
ghost
);
vector_dist
<
3
,
float
,
aggregate
<
double
,
double
[
3
],
double
[
3
][
3
]
>
>
vd
(
0
,
box
,
bc
,
ghost
);
//
// ### WIKI 4 ###
...
...
example/Vector/1_verlet/main.cpp
View file @
d93e4a34
...
...
@@ -42,7 +42,7 @@ int main(int argc, char* argv[])
// scalar double, a vector double[3], and a tensor or rank 2 double[3][3].
// In this case the vector contain 0 particles in total
//
vector_dist
<
3
,
float
,
aggregate
<
double
,
double
[
3
],
double
[
3
][
3
]
>
,
CartDecomposition
<
3
,
float
>
>
vd
(
0
,
box
,
bc
,
ghost
);
vector_dist
<
3
,
float
,
aggregate
<
double
,
double
[
3
],
double
[
3
][
3
]
>
>
vd
(
0
,
box
,
bc
,
ghost
);
//
// ### WIKI 4 ###
...
...
images/CartDecomposition_gen_vtk.cpp
View file @
d93e4a34
...
...
@@ -10,10 +10,10 @@
int
main
(
int
argc
,
char
**
argv
)
{
// Initialize the global VCluster
init_global_v_cluster
(
&
argc
,
&
argv
);
openfpm_init
(
&
argc
,
&
argv
);
// Vcluster
Vcluster
&
vcl
=
*
global_v_cluster
;
Vcluster
&
vcl
=
create_vcluster
()
;
//! [Create CartDecomposition vtk gen]
CartDecomposition
<
2
,
float
>
dec
(
vcl
);
...
...
@@ -42,6 +42,7 @@ int main(int argc, char ** argv)
//! [Create CartDecomposition]
delete
&
vcl
;
// deinitialize the library
openfpm_finalize
();
}
images/vector.cpp
View file @
d93e4a34
...
...
@@ -24,8 +24,8 @@ int main(int argc, char* argv[])
// Here we Initialize the library, than we create a uniform random generator between 0 and 1 to to generate particles
// randomly in the domain, we create a Box that define our domain, boundary conditions, and ghost
//
init_global_v_cluster
(
&
argc
,
&
argv
);
Vcluster
&
v_cl
=
*
global_v_cluster
;
openfpm_init
(
&
argc
,
&
argv
);
Vcluster
&
v_cl
=
create_vcluster
()
;
typedef
Point
<
2
,
float
>
s
;
...
...
@@ -90,5 +90,5 @@ int main(int argc, char* argv[])
vd
.
write
(
"Vector/vector_move"
,
i
);
}
delete_global_v_cluster
();
openfpm_finalize
();
}
openfpm_io
@
d07c3c78
Subproject commit
b5dbab02939cabadaa8ffc398a672dd2d13f9ae4
Subproject commit
d07c3c7848e446437526d0bbda0843c18ab6a925
openfpm_numerics
@
f94c71e6
Subproject commit
48eca62b3223c084608e4ac031cc70a15d8ba977
Subproject commit
f94c71e644d0e7a36c86185174da186a2b352b3b
openfpm_vcluster
@
02c93554
Subproject commit
2eb8e4318e89a14d7891ee1af6723175fc856476
Subproject commit
02c935545524000d318f0b84578af704896eeee4
src/Decomposition/CartDecomposition_unit_test.hpp
View file @
d93e4a34
...
...
@@ -55,10 +55,7 @@ void setComputationCosts3D(CartDecomposition<3, float> &dec, size_t n_v, Point<3
BOOST_AUTO_TEST_CASE
(
CartDecomposition_non_periodic_test
)
{
// Vcluster
Vcluster
&
vcl
=
*
global_v_cluster
;
// Initialize the global VCluster
init_global_v_cluster
(
&
boost
::
unit_test
::
framework
::
master_test_suite
().
argc
,
&
boost
::
unit_test
::
framework
::
master_test_suite
().
argv
);
Vcluster
&
vcl
=
create_vcluster
();
//! [Create CartDecomposition]
CartDecomposition
<
3
,
float
>
dec
(
vcl
);
...
...
@@ -150,10 +147,7 @@ BOOST_AUTO_TEST_CASE( CartDecomposition_non_periodic_test)
BOOST_AUTO_TEST_CASE
(
CartDecomposition_periodic_test
)
{
// Vcluster
Vcluster
&
vcl
=
*
global_v_cluster
;
// Initialize the global VCluster
init_global_v_cluster
(
&
boost
::
unit_test
::
framework
::
master_test_suite
().
argc
,
&
boost
::
unit_test
::
framework
::
master_test_suite
().
argv
);
Vcluster
&
vcl
=
create_vcluster
();
//! [Create CartDecomposition]
CartDecomposition
<
3
,
float
>
dec
(
vcl
);
...
...
@@ -248,10 +242,7 @@ BOOST_AUTO_TEST_CASE( CartDecomposition_periodic_test)
BOOST_AUTO_TEST_CASE
(
CartDecomposition_ext_non_periodic_test
)
{
// Vcluster
Vcluster
&
vcl
=
*
global_v_cluster
;
// Initialize the global VCluster
init_global_v_cluster
(
&
boost
::
unit_test
::
framework
::
master_test_suite
().
argc
,
&
boost
::
unit_test
::
framework
::
master_test_suite
().
argv
);
Vcluster
&
vcl
=
create_vcluster
();
//! [Create CartDecomposition]
CartDecomposition
<
3
,
float
>
dec
(
vcl
);
...
...
src/Decomposition/Distribution/Distribution_unit_tests.hpp
View file @
d93e4a34
...
...
@@ -57,7 +57,7 @@ BOOST_AUTO_TEST_SUITE (Distribution_test)
BOOST_AUTO_TEST_CASE
(
Metis_distribution_test
)
{
Vcluster
&
v_cl
=
*
global_v_cluster
;
Vcluster
&
v_cl
=
create_vcluster
()
;
if
(
v_cl
.
getProcessingUnits
()
!=
3
)
return
;
...
...
@@ -166,7 +166,7 @@ BOOST_AUTO_TEST_CASE( Metis_distribution_test)
BOOST_AUTO_TEST_CASE
(
Parmetis_distribution_test
)
{
Vcluster
&
v_cl
=
*
global_v_cluster
;
Vcluster
&
v_cl
=
create_vcluster
()
;
if
(
v_cl
.
getProcessingUnits
()
!=
3
)
return
;
...
...
@@ -267,7 +267,7 @@ BOOST_AUTO_TEST_CASE( Parmetis_distribution_test)
BOOST_AUTO_TEST_CASE
(
DistParmetis_distribution_test
)
{
Vcluster
&
v_cl
=
*
global_v_cluster
;
Vcluster
&
v_cl
=
create_vcluster
()
;
if
(
v_cl
.
getProcessingUnits
()
!=
3
)
return
;
...
...
@@ -365,7 +365,7 @@ BOOST_AUTO_TEST_CASE( DistParmetis_distribution_test)
void
print_test_v
(
std
::
string
test
,
size_t
sz
)
{
if
(
global_v_cluster
->
getProcessUnitID
()
==
0
)
if
(
create_vcluster
().
getProcessUnitID
()
==
0
)
std
::
cout
<<
test
<<
" "
<<
sz
<<
"
\n
"
;
}
...
...
src/Decomposition/Distribution/metis_util_unit_test.hpp
View file @
d93e4a34
...
...
@@ -25,7 +25,7 @@ BOOST_AUTO_TEST_SUITE( Metis_test )
BOOST_AUTO_TEST_CASE
(
Metis_test_use
)
{
Vcluster
&
v_cl
=
*
global_v_cluster
;
Vcluster
&
v_cl
=
create_vcluster
()
;
if
(
v_cl
.
getProcessingUnits
()
!=
3
)
return
;
...
...
src/Decomposition/ORB.hpp
View file @
d93e4a34
...
...
@@ -264,7 +264,7 @@ public:
*
*/
ORB
(
Box
dom
,
size_t
n_sub
,
loc_pos
&
lp
)
:
v_cl
(
*
global_v_cluster
),
lp
(
lp
)
:
v_cl
(
create_vcluster
()
),
lp
(
lp
)
{
typedef
ORB
<
dim
,
T
,
loc_wg
,
loc_pos
,
Box
,
Tree
>
ORB_class
;
...
...
src/Decomposition/ORB_unit_test.hpp
View file @
d93e4a34
...
...
@@ -17,12 +17,9 @@ BOOST_AUTO_TEST_SUITE( ORB_test )
BOOST_AUTO_TEST_CASE
(
ORB_test_use
)
{
// Initialize the global VCluster
init_global_v_cluster
(
&
boost
::
unit_test
::
framework
::
master_test_suite
().
argc
,
&
boost
::
unit_test
::
framework
::
master_test_suite
().
argv
);
// set the seed
// create the random generator engine
std
::
srand
(
global_v_cluster
->
getProcessUnitID
());
std
::
srand
(
create_vcluster
().
getProcessUnitID
());
std
::
default_random_engine
eg
;
std
::
uniform_real_distribution
<
float
>
ud
(
0.0
f
,
1.0
f
);
...
...
src/Graph/DistGraphFactory.hpp
View file @
d93e4a34
...
...
@@ -240,7 +240,7 @@ public:
//! Construct Cartesian graph
static
Graph
construct
(
const
size_t
(
&
sz
)[
dim
],
Box
<
dim
,
T
>
dom
)
{
Vcluster
&
v_cl
=
*
global_v_cluster
;
Vcluster
&
v_cl
=
create_vcluster
()
;
// Calculate the size of the hyper-cubes on each dimension
T
szd
[
dim
];
...
...
@@ -394,7 +394,7 @@ public:
//! Construct Cartesian graph
static
Graph
construct
(
const
size_t
(
&
sz
)[
dim
],
Box
<
dim
,
T
>
dom
)
{
Vcluster
&
v_cl
=
*
global_v_cluster
;
Vcluster
&
v_cl
=
create_vcluster
()
;
// Calculate the size of the hyper-cubes on each dimension
...
...
src/Graph/dist_map_graph.hpp
View file @
d93e4a34
...
...
@@ -1015,7 +1015,7 @@ public:
*
*/
DistGraph_CSR
(
const
DistGraph_CSR
&
dg
)
:
vcl
(
*
global_v_cluster
)
vcl
(
create_vcluster
()
)
{
this
->
operator
=
(
dg
);
}
...
...
@@ -1026,7 +1026,7 @@ public:
*
*/
DistGraph_CSR
(
DistGraph_CSR
&&
dg
)
:
vcl
(
*
global_v_cluster
)
vcl
(
create_vcluster
()
)
{
this
->
operator
=
(
dg
);
}
...
...
@@ -1057,7 +1057,7 @@ public:
*
*/
DistGraph_CSR
(
size_t
n_vertex
,
size_t
n_slot
)
:
vcl
(
*
global_v_cluster
),
v_slot
(
n_slot
)
vcl
(
create_vcluster
()
),
v_slot
(
n_slot
)
{
// Creating n_vertex into the graph
v
.
resize
(
n_vertex
);
...
...
src/Graph/dist_map_graph_unit_test.hpp
View file @
d93e4a34
...
...
@@ -127,10 +127,7 @@ BOOST_AUTO_TEST_CASE( dist_map_graph_use)
{
//! Vcluster
Vcluster
&
vcl
=
*
global_v_cluster
;
//! Initialize the global VCluster
init_global_v_cluster
(
&
boost
::
unit_test
::
framework
::
master_test_suite
().
argc
,
&
boost
::
unit_test
::
framework
::
master_test_suite
().
argv
);
Vcluster
&
vcl
=
create_vcluster
();
if
(
vcl
.
getProcessingUnits
()
!=
4
)
return
;
...
...
@@ -244,14 +241,11 @@ BOOST_AUTO_TEST_CASE( dist_map_graph_use)
BOOST_AUTO_TEST_CASE
(
dist_map_graph_use_redistribution
)
{
//! Vcluster
Vcluster
&
vcl
=
*
global_v_cluster
;
Vcluster
&
vcl
=
create_vcluster
()
;
if
(
vcl
.
getProcessingUnits
()
!=
4
)
return
;
//! Initialize the global VCluster
init_global_v_cluster
(
&
boost
::
unit_test
::
framework
::
master_test_suite
().
argc
,
&
boost
::
unit_test
::
framework
::
master_test_suite
().
argv
);
//! Cartesian grid
size_t
sz
[
2
]
=
{
4
,
4
};
...
...
@@ -330,14 +324,11 @@ BOOST_AUTO_TEST_CASE( dist_map_graph_use_redistribution)
BOOST_AUTO_TEST_CASE
(
dist_map_graph_use_free_add
)
{
// Vcluster
Vcluster
&
vcl
=
*
global_v_cluster
;
Vcluster
&
vcl
=
create_vcluster
()
;
if
(
vcl
.
getProcessingUnits
()
!=
4
)
return
;
// Initialize the global VCluster
init_global_v_cluster
(
&
boost
::
unit_test
::
framework
::
master_test_suite
().
argc
,
&
boost
::
unit_test
::
framework
::
master_test_suite
().
argv
);
// [create graph adding freely the vertices and the edges ]
// Distributed graph
...
...
@@ -489,14 +480,11 @@ BOOST_AUTO_TEST_CASE( dist_map_graph_use_free_add)
BOOST_AUTO_TEST_CASE
(
dist_map_graph_use_multi_free_add
)
{
// Vcluster
Vcluster
&
vcl
=
*
global_v_cluster
;
Vcluster
&
vcl
=
create_vcluster
()
;
if
(
vcl
.
getProcessingUnits
()
!=
4
)
return
;
// Initialize the global VCluster
init_global_v_cluster
(
&
boost
::
unit_test
::
framework
::
master_test_suite
().
argc
,
&
boost
::
unit_test
::
framework
::
master_test_suite
().
argv
);
// Distributed graph
DistGraph_CSR
<
vx
,
ed
>
gd
;
...
...
src/Grid/grid_dist_id.hpp
View file @
d93e4a34
...
...
@@ -17,6 +17,7 @@
#include "VTKWriter/VTKWriter.hpp"
#include "Packer_Unpacker/Packer.hpp"
#include "Packer_Unpacker/Unpacker.hpp"
#include "Decomposition/CartDecomposition.hpp"
#define GRID_SUB_UNIT_FACTOR 64
...
...
@@ -47,7 +48,7 @@
* \snippet grid_dist_id_unit_test.hpp Construct two grid with the same decomposition
*
*/
template
<
unsigned
int
dim
,
typename
St
,
typename
T
,
typename
Decomposition
,
typename
Memory
=
HeapMemory
,
typename
device_grid
=
grid_cpu
<
dim
,
T
>
>
template
<
unsigned
int
dim
,
typename
St
,
typename
T
,
typename
Decomposition
=
CartDecomposition
<
dim
,
St
>
,
typename
Memory
=
HeapMemory
,
typename
device_grid
=
grid_cpu
<
dim
,
T
>
>
class
grid_dist_id
{
// Domain
...
...
@@ -629,7 +630,7 @@ public:
*
*/
template
<
typename
H
>
grid_dist_id
(
const
grid_dist_id
<
dim
,
St
,
H
,
typename
Decomposition
::
base_type
,
Memory
,
grid_cpu
<
dim
,
H
>>
&
g
,
const
Ghost
<
dim
,
long
int
>
&
gh
,
Box
<
dim
,
size_t
>
ext
)
:
dec
(
*
global_v_cluster
),
v_cl
(
*
global_v_cluster
)
:
dec
(
create_vcluster
()),
v_cl
(
create_vcluster
()
)
{
#ifdef SE_CLASS2
check_new
(
this
,
8
,
GRID_DIST_EVENT
,
4
);
...
...
@@ -672,7 +673,7 @@ public:
*
*/
grid_dist_id
(
const
Decomposition
&
dec
,
const
size_t
(
&
g_sz
)[
dim
],
const
Box
<
dim
,
St
>
&
domain
,
const
Ghost
<
dim
,
St
>
&
ghost
)
:
domain
(
domain
),
ghost
(
ghost
),
dec
(
dec
),
v_cl
(
*
global_v_cluster
),
ginfo
(
g_sz
),
ginfo_v
(
g_sz
)
:
domain
(
domain
),
ghost
(
ghost
),
dec
(
dec
),
v_cl
(
create_vcluster
()
),
ginfo
(
g_sz
),
ginfo_v
(
g_sz
)
{
// Increment the reference counter of the decomposition
this
->
dec
.
incRef
();
...
...
@@ -690,7 +691,7 @@ public:
*
*/
grid_dist_id
(
Decomposition
&&
dec
,
const
size_t
(
&
g_sz
)[
dim
],
const
Box
<
dim
,
St
>
&
domain
,
const
Ghost
<
dim
,
St
>
&
ghost
)
:
domain
(
domain
),
ghost
(
ghost
),
dec
(
dec
),
ginfo
(
g_sz
),
ginfo_v
(
g_sz
),
v_cl
(
*
global_v_cluster
)
:
domain
(
domain
),
ghost
(
ghost
),
dec
(
dec
),
ginfo
(
g_sz
),
ginfo_v
(
g_sz
),
v_cl
(
create_vcluster
()
)
{
#ifdef SE_CLASS2
check_new
(
this
,
8
,
GRID_DIST_EVENT
,
4
);
...
...
@@ -711,7 +712,7 @@ public:
*
*/
grid_dist_id
(
const
Decomposition
&
dec
,
const
size_t
(
&
g_sz
)[
dim
],
const
Box
<
dim
,
St
>
&
domain
,
const
Ghost
<
dim
,
long
int
>
&
g
)
:
domain
(
domain
),
dec
(
*
global_v_cluster
),
v_cl
(
*
global_v_cluster
),
ginfo
(
g_sz
),
ginfo_v
(
g_sz
)
:
domain
(
domain
),
dec
(
create_vcluster
()),
v_cl
(
create_vcluster
()
),
ginfo
(
g_sz
),
ginfo_v
(
g_sz
)
{
#ifdef SE_CLASS2
check_new
(
this
,
8
,
GRID_DIST_EVENT
,
4
);
...
...
@@ -737,7 +738,7 @@ public:
*
*/
grid_dist_id
(
Decomposition
&&
dec
,
const
size_t
(
&
g_sz
)[
dim
],
const
Box
<
dim
,
St
>
&
domain
,
const
Ghost
<
dim
,
long
int
>
&
g
)
:
domain
(
domain
),
dec
(
dec
),
v_cl
(
*
global_v_cluster
),
ginfo
(
g_sz
),
ginfo_v
(
g_sz
)
:
domain
(
domain
),
dec
(
dec
),
v_cl
(
create_vcluster
()
),
ginfo
(
g_sz
),
ginfo_v
(
g_sz
)
{
#ifdef SE_CLASS2
check_new
(
this
,
8
,
GRID_DIST_EVENT
,
4
);
...
...
@@ -760,7 +761,7 @@ public:
*
*/
grid_dist_id
(
const
size_t
(
&
g_sz
)[
dim
],
const
Box
<
dim
,
St
>
&
domain
,
const
Ghost
<
dim
,
St
>
&
g
)
:
domain
(
domain
),
ghost
(
g
),
dec
(
*
global_v_cluster
),
v_cl
(
*
global_v_cluster
),
ginfo
(
g_sz
),
ginfo_v
(
g_sz
)
:
domain
(
domain
),
ghost
(
g
),
dec
(
create_vcluster
()),
v_cl
(
create_vcluster
()
),
ginfo
(
g_sz
),
ginfo_v
(
g_sz
)
{
#ifdef SE_CLASS2
check_new
(
this
,
8
,
GRID_DIST_EVENT
,
4
);
...
...
@@ -784,7 +785,7 @@ public:
*
*/
grid_dist_id
(
const
size_t
(
&
g_sz
)[
dim
],
const
Box
<
dim
,
St
>
&
domain
,
const
Ghost
<
dim
,
long
int
>
&
g
)
:
domain
(
domain
),
dec
(
*
global_v_cluster
),
v_cl
(
*
global_v_cluster
),
ginfo
(
g_sz
),
ginfo_v
(
g_sz
)
:
domain
(
domain
),
dec
(
create_vcluster
()),
v_cl
(
create_vcluster
()
),
ginfo
(
g_sz
),
ginfo_v
(
g_sz
)
{
#ifdef SE_CLASS2
check_new
(
this
,
8
,
GRID_DIST_EVENT
,
4
);
...
...
src/Grid/grid_dist_id_unit_test.hpp
View file @
d93e4a34
This diff is collapsed.
Click to expand it.
src/Grid/grid_dist_id_unit_test_ext_dom.hpp
View file @
d93e4a34
...
...
@@ -18,7 +18,7 @@ void Test3D_extended_grid(const Box<3,float> & domain, long int k)
big_step
=
(
big_step
==
0
)
?
1
:
big_step
;
long
int
small_step
=
21
;
Vcluster
&
v_cl
=
*
global_v_cluster
;
Vcluster
&
v_cl
=
create_vcluster
()
;
if
(
v_cl
.
getProcessingUnits
()
>
32
)
return
;
...
...
@@ -26,7 +26,7 @@ void Test3D_extended_grid(const Box<3,float> & domain, long int k)
print_test
(
"Testing 3D extended grid k<="
,
k
);
// factor
float
factor
=
pow
(
global_v_cluster
->
getProcessingUnits
()
/
2.0
f
,
1.0
f
/
3.0
f
);
float
factor
=
pow
(
create_vcluster
().
getProcessingUnits
()
/
2.0
f
,
1.0
f
/
3.0
f
);
// This test in order to work must have at least one ghost
for
(
;
(
0.01
/
factor
)
>
(
domain
.
getHigh
(
0
)
-
domain
.
getLow
(
0
)
/
k
)
;
k
-=
(
k
>
2
*
big_step
)
?
big_step
:
small_step
)
...
...
src/Vector/vector_dist.hpp
View file @
d93e4a34
...
...
@@ -25,6 +25,7 @@
#include "Decomposition/common.hpp"
#include "Grid/grid_dist_id_iterator_dec.hpp"
#include "Vector/vector_dist_ofb.hpp"
#include "Decomposition/CartDecomposition.hpp"
#define V_SUB_UNIT_FACTOR 64
...
...
@@ -67,7 +68,7 @@
*
*/
template
<
unsigned
int
dim
,
typename
St
,
typename
prop
,
typename
Decomposition
,
typename
Memory
=
HeapMemory
>
template
<
unsigned
int
dim
,
typename
St
,
typename
prop
,
typename
Decomposition
=
CartDecomposition
<
dim
,
St
>
,
typename
Memory
=
HeapMemory
>
class
vector_dist
{
private:
...
...
@@ -654,7 +655,7 @@ public:
*
*/
vector_dist
(
size_t
np
,
Box
<
dim
,
St
>
box
,
const
size_t
(
&
bc
)[
dim
],
const
Ghost
<
dim
,
St
>
&
g
)
:
dec
(
*
global_v_cluster
),
v_cl
(
*
global_v_cluster
)
dec
(
create_vcluster
()),
v_cl
(
create_vcluster
()
)
{
#ifdef SE_CLASS2
check_new
(
this
,
8
,
VECTOR_DIST_EVENT
,
4
);
...
...
src/Vector/vector_dist_unit_test.hpp
View file @
d93e4a34
...
...
@@ -94,14 +94,14 @@ BOOST_AUTO_TEST_SUITE( vector_dist_test )
void
print_test
(
std
::
string
test
,
size_t
sz
)
{
if
(
global_v_cluster
->
getProcessUnitID
()
==
0
)
if
(
create_vcluster
().
getProcessUnitID
()
==
0
)
std
::
cout
<<
test
<<
" "
<<
sz
<<
"
\n
"
;
}
BOOST_AUTO_TEST_CASE
(
vector_dist_ghost
)
{
// Communication object
Vcluster
&
v_cl
=
*
global_v_cluster
;
Vcluster
&
v_cl
=
create_vcluster
()
;
typedef
Point_test
<
float
>
p
;
typedef
Point
<
2
,
float
>
s
;
...
...
@@ -149,7 +149,7 @@ BOOST_AUTO_TEST_CASE( vector_dist_ghost )
size_t
bc
[
2
]
=
{
NON_PERIODIC
,
NON_PERIODIC
};
// Vector of particles
vector_dist
<
2
,
float
,
Point_test
<
float
>
,
CartDecomposition
<
2
,
float
>
>
vd
(
g_info
.
size
(),
box
,
bc
,
g
);
vector_dist
<
2
,
float
,
Point_test
<
float
>
>
vd
(
g_info
.
size
(),
box
,
bc
,
g
);
// size_t
size_t
cobj
=
0
;
...
...
@@ -272,7 +272,7 @@ BOOST_AUTO_TEST_CASE( vector_dist_ghost )
void
print_test_v
(
std
::
string
test
,
size_t
sz
)
{
if
(
global_v_cluster
->
getProcessUnitID
()
==
0
)
if
(
create_vcluster
().
getProcessUnitID
()
==
0
)
std
::
cout
<<
test
<<
" "
<<
sz
<<
"
\n
"
;
}
...
...
@@ -294,7 +294,7 @@ BOOST_AUTO_TEST_CASE( vector_dist_iterator_test_use_2d )
{
typedef
Point
<
2
,
float
>
s
;
Vcluster
&
v_cl
=
*
global_v_cluster
;
Vcluster
&
v_cl
=
create_vcluster
()
;
// set the seed
// create the random generator engine
...
...
@@ -321,7 +321,7 @@ BOOST_AUTO_TEST_CASE( vector_dist_iterator_test_use_2d )
// Boundary conditions
size_t
bc
[
2
]
=
{
NON_PERIODIC
,
NON_PERIODIC
};
vector_dist
<
2
,
float
,
Point_test
<
float
>
,
CartDecomposition
<
2
,
float
>
>
vd
(
k
,
box
,
bc
,
Ghost
<
2
,
float
>
(
0.0
));
vector_dist
<
2
,
float
,
Point_test
<
float
>
>
vd
(
k
,
box
,
bc
,
Ghost
<
2
,
float
>
(
0.0
));
auto
it
=
vd
.
getIterator
();
...
...
@@ -367,7 +367,7 @@ BOOST_AUTO_TEST_CASE( vector_dist_iterator_test_use_3d )
{
typedef
Point
<
3
,
float
>
s
;
Vcluster
&
v_cl
=
*
global_v_cluster
;
Vcluster
&
v_cl
=
create_vcluster
()
;
// set the seed
// create the random generator engine
...
...
@@ -394,7 +394,7 @@ BOOST_AUTO_TEST_CASE( vector_dist_iterator_test_use_3d )
// Boundary conditions
size_t
bc
[
3
]
=
{
NON_PERIODIC
,
NON_PERIODIC
,
NON_PERIODIC
};
vector_dist
<
3
,
float
,
Point_test
<
float
>
,
CartDecomposition
<
3
,
float
>
>
vd
(
k
,
box
,
bc
,
Ghost
<
3
,
float
>
(
0.0
));
vector_dist
<
3
,
float
,
Point_test
<
float
>
>
vd
(
k
,
box
,
bc
,
Ghost
<
3
,
float
>
(
0.0
));
auto
it
=
vd
.
getIterator
();
...
...
@@ -441,7 +441,7 @@ BOOST_AUTO_TEST_CASE( vector_dist_periodic_test_use_2d )
{
typedef
Point
<
2
,
float
>
s
;
Vcluster
&
v_cl
=
*
global_v_cluster
;
Vcluster
&
v_cl
=
create_vcluster
()
;
// set the seed
// create the random generator engine
...
...
@@ -469,7 +469,7 @@ BOOST_AUTO_TEST_CASE( vector_dist_periodic_test_use_2d )
size_t
bc
[
2
]
=
{
PERIODIC
,
PERIODIC
};
// factor
float
factor
=
pow
(
global_v_cluster
->
getProcessingUnits
()
/
2.0
f
,
1.0
f
/
3.0
f
);
float
factor
=
pow
(
create_vcluster
().
getProcessingUnits
()
/
2.0
f
,
1.0
f
/
3.0
f
);
// ghost
Ghost
<
2
,
float
>
ghost
(
0.01
/
factor
);
...
...
@@ -551,7 +551,7 @@ BOOST_AUTO_TEST_CASE( vector_dist_periodic_test_use_3d )
{
typedef
Point
<
3
,
float
>
s
;
Vcluster
&
v_cl
=
*
global_v_cluster
;
Vcluster
&
v_cl
=
create_vcluster
()
;
// set the seed
// create the random generator engine
...
...
@@ -579,7 +579,7 @@ BOOST_AUTO_TEST_CASE( vector_dist_periodic_test_use_3d )
size_t
bc
[
3
]
=
{
PERIODIC
,
PERIODIC
,
PERIODIC
};
// factor
float
factor
=
pow
(
global_v_cluster
->
getProcessingUnits
()
/
2.0
f
,
1.0
f
/
3.0
f
);
float
factor
=
pow
(
create_vcluster
().
getProcessingUnits
()
/
2.0
f
,
1.0
f
/
3.0
f
);
// ghost
Ghost
<
3
,
float
>
ghost
(
0.05
/
factor
);
...
...
@@ -659,7 +659,7 @@ BOOST_AUTO_TEST_CASE( vector_dist_periodic_test_random_walk )
{
typedef
Point
<
3
,
float
>
s
;
Vcluster
&
v_cl
=
*
global_v_cluster
;
Vcluster
&
v_cl
=
create_vcluster
()
;
// set the seed
// create the random generator engine
...
...
@@ -685,7 +685,7 @@ BOOST_AUTO_TEST_CASE( vector_dist_periodic_test_random_walk )
size_t
bc
[
3
]
=
{
PERIODIC
,
PERIODIC
,
PERIODIC
};
// factor
float
factor
=
pow
(
global_v_cluster
->
getProcessingUnits
()
/
2.0
f
,
1.0
f
/
3.0
f
);
float
factor
=
pow
(
create_vcluster
().
getProcessingUnits
()
/
2.0
f
,
1.0
f
/
3.0
f
);
// ghost
Ghost
<
3
,
float
>
ghost
(
0.01
/
factor
);
...
...
@@ -747,7 +747,7 @@ BOOST_AUTO_TEST_CASE( vector_dist_periodic_map )
size_t
bc
[
3
]
=
{
PERIODIC
,
PERIODIC
,
PERIODIC
};
// factor
float
factor
=
pow
(
global_v_cluster
->
getProcessingUnits
()
/
2.0
f
,
1.0
f
/
3.0
f
);
float
factor
=
pow
(
create_vcluster
().
getProcessingUnits
()
/
2.0
f
,
1.0
f
/
3.0
f
);
// ghost
Ghost
<
3
,
float
>
ghost
(
0.05
/
factor
);
...
...
@@ -799,7 +799,7 @@ BOOST_AUTO_TEST_CASE( vector_dist_not_periodic_map )
size_t
bc
[
3
]
=
{
NON_PERIODIC
,
NON_PERIODIC
,
NON_PERIODIC
};
// factor
float
factor
=
pow
(
global_v_cluster
->
getProcessingUnits
()
/
2.0
f
,
1.0
f
/
3.0
f
);
float
factor
=
pow
(
create_vcluster
().
getProcessingUnits
()
/
2.0
f
,
1.0
f
/
3.0
f
);
// ghost
Ghost
<
3
,
float
>
ghost
(
0.05
/
factor
);
...
...
@@ -843,7 +843,7 @@ BOOST_AUTO_TEST_CASE( vector_dist_not_periodic_map )
BOOST_AUTO_TEST_CASE
(
vector_dist_out_of_bound_policy
)
{
Vcluster
&
v_cl
=
*
global_v_cluster
;
Vcluster
&
v_cl
=
create_vcluster
()
;
if
(
v_cl
.
getProcessingUnits
()
>
8
)
return
;
...
...
@@ -856,7 +856,7 @@ BOOST_AUTO_TEST_CASE( vector_dist_out_of_bound_policy )