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
0985040d
Commit
0985040d
authored
8 years ago
by
Pietro Incardona
Browse files
Options
Downloads
Patches
Plain Diff
Ghost get and put example + small fixes for NO_POSITION
parent
d24117db
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
example/Vector/0_simple/main.cpp
+3
-2
3 additions, 2 deletions
example/Vector/0_simple/main.cpp
example/Vector/1_celllist/main.cpp
+3
-0
3 additions, 0 deletions
example/Vector/1_celllist/main.cpp
src/Vector/vector_dist_comm.hpp
+8
-11
8 additions, 11 deletions
src/Vector/vector_dist_comm.hpp
with
14 additions
and
13 deletions
example/Vector/0_simple/main.cpp
+
3
−
2
View file @
0985040d
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
*
*
* \subpage Vector_0_simple
* \subpage Vector_0_simple
* \subpage Vector_1_celllist
* \subpage Vector_1_celllist
* \subpage Vector_1_ghost_get
* \subpage Vector_2_expression
* \subpage Vector_2_expression
* \subpage Vector_3_md
* \subpage Vector_3_md
* \subpage Vector_4_reo_root
* \subpage Vector_4_reo_root
...
@@ -39,7 +40,7 @@
...
@@ -39,7 +40,7 @@
* </div>
* </div>
* \endhtmlonly
* \endhtmlonly
*
*
* ## inclusion ## {#inclusion}
* ## inclusion ## {#
e0_v_
inclusion}
*
*
* In order to use distributed vectors in our code we have to include the file Vector/vector_dist.hpp
* In order to use distributed vectors in our code we have to include the file Vector/vector_dist.hpp
*
*
...
@@ -62,7 +63,7 @@ int main(int argc, char* argv[])
...
@@ -62,7 +63,7 @@ int main(int argc, char* argv[])
* Here we
* Here we
* * Initialize the library
* * Initialize the library
* * we create a Box that define our domain
* * we create a Box that define our domain
* * An array that define ou
t
boundary conditions
* * An array that define ou
r
boundary conditions
* * A Ghost object that will define the extension of the ghost part in physical units
* * A Ghost object that will define the extension of the ghost part in physical units
*
*
*
*
...
...
This diff is collapsed.
Click to expand it.
example/Vector/1_celllist/main.cpp
+
3
−
0
View file @
0985040d
...
@@ -173,6 +173,9 @@ int main(int argc, char* argv[])
...
@@ -173,6 +173,9 @@ int main(int argc, char* argv[])
* no properties. If we want to synchronize also properties we have to specify which one.
* no properties. If we want to synchronize also properties we have to specify which one.
* For example with <0,1,2> here we synchronize the scalar property (0), the vector (1), and the rank 2 tensor (2)
* For example with <0,1,2> here we synchronize the scalar property (0), the vector (1), and the rank 2 tensor (2)
*
*
* \warning Every ghost_get by default reset the status of the ghost so the information are lost
*
* \see \ref e1_gg_options
*
*
* \htmlonly
* \htmlonly
* <a href="#" onclick="hide_show('vector-video-5')" >Video 1</a>
* <a href="#" onclick="hide_show('vector-video-5')" >Video 1</a>
...
...
This diff is collapsed.
Click to expand it.
src/Vector/vector_dist_comm.hpp
+
8
−
11
View file @
0985040d
...
@@ -366,12 +366,9 @@ class vector_dist_comm
...
@@ -366,12 +366,9 @@ class vector_dist_comm
// Create the shift boxes
// Create the shift boxes
createShiftBox
();
createShiftBox
();
if
(
opt
!=
SKIP_LABELLING
)
if
(
!
(
opt
&
SKIP_LABELLING
)
)
lg_m
=
v_prp
.
size
();
lg_m
=
v_prp
.
size
();
// v_pos.resize(lg_m);
// v_prp.resize(lg_m);
if
(
box_f
.
size
()
==
0
)
if
(
box_f
.
size
()
==
0
)
return
;
return
;
else
else
...
@@ -822,10 +819,11 @@ public:
...
@@ -822,10 +819,11 @@ public:
// send vector for each processor
// send vector for each processor
typedef
openfpm
::
vector
<
prp_object
>
send_vector
;
typedef
openfpm
::
vector
<
prp_object
>
send_vector
;
v_pos
.
resize
(
g_m
);
if
(
!
(
opt
&
NO_POSITION
))
v_pos
.
resize
(
g_m
);
// reset the ghost part
// reset the ghost part
if
(
opt
!=
SKIP_LABELLING
)
if
(
!
(
opt
&
SKIP_LABELLING
)
)
{
{
v_prp
.
resize
(
g_m
);
v_prp
.
resize
(
g_m
);
}
}
...
@@ -839,22 +837,21 @@ public:
...
@@ -839,22 +837,21 @@ public:
fill_send_ghost_prp_buf
<
send_vector
,
prp_object
,
prp
...
>
(
v_prp
,
g_send_prp
);
fill_send_ghost_prp_buf
<
send_vector
,
prp_object
,
prp
...
>
(
v_prp
,
g_send_prp
);
// Create and fill the send buffer for the particle position
// Create and fill the send buffer for the particle position
if
(
opt
!=
NO_POSITION
)
if
(
!
(
opt
&
NO_POSITION
)
)
fill_send_ghost_pos_buf
(
v_pos
,
g_pos_send
);
fill_send_ghost_pos_buf
(
v_pos
,
g_pos_send
);
prc_recv_get
.
clear
();
prc_recv_get
.
clear
();
recv_sz_get
.
clear
();
recv_sz_get
.
clear
();
if
(
opt
==
SKIP_LABELLING
)
if
(
opt
&
SKIP_LABELLING
)
{
{
op_ssend_gg_recv_merge
opm
(
g_m
);
op_ssend_gg_recv_merge
opm
(
g_m
);
// v_cl.SSendRecvP_op<op_ssend_recv_merge<op>
v_cl
.
SSendRecvP_op
<
op_ssend_gg_recv_merge
,
send_vector
,
decltype
(
v_prp
),
prp
...
>
(
g_send_prp
,
v_prp
,
prc_g_opart
,
opm
,
prc_recv_get
,
recv_sz_get
);
v_cl
.
SSendRecvP_op
<
op_ssend_gg_recv_merge
,
send_vector
,
decltype
(
v_prp
),
prp
...
>
(
g_send_prp
,
v_prp
,
prc_g_opart
,
opm
,
prc_recv_get
,
recv_sz_get
);
}
}
else
else
v_cl
.
SSendRecvP
<
send_vector
,
decltype
(
v_prp
),
prp
...
>
(
g_send_prp
,
v_prp
,
prc_g_opart
,
prc_recv_get
,
recv_sz_get
);
v_cl
.
SSendRecvP
<
send_vector
,
decltype
(
v_prp
),
prp
...
>
(
g_send_prp
,
v_prp
,
prc_g_opart
,
prc_recv_get
,
recv_sz_get
);
if
(
opt
!=
NO_POSITION
)
if
(
!
(
opt
&
NO_POSITION
)
)
{
{
prc_recv_get
.
clear
();
prc_recv_get
.
clear
();
recv_sz_get
.
clear
();
recv_sz_get
.
clear
();
...
@@ -1071,7 +1068,7 @@ public:
...
@@ -1071,7 +1068,7 @@ public:
if
(
v_prp
.
size
()
-
lg_m
!=
o_part_loc
.
size
())
if
(
v_prp
.
size
()
-
lg_m
!=
o_part_loc
.
size
())
{
{
std
::
cerr
<<
"Error: "
<<
__FILE__
<<
":"
<<
__LINE__
<<
" Local ghost particles = "
<<
v_prp
.
size
()
-
lg_m
<<
" != "
<<
o_part_loc
.
size
()
<<
std
::
endl
;
std
::
cerr
<<
"Error: "
<<
__FILE__
<<
":"
<<
__LINE__
<<
" Local ghost particles = "
<<
v_prp
.
size
()
-
lg_m
<<
" != "
<<
o_part_loc
.
size
()
<<
std
::
endl
;
std
::
cerr
<<
"Error: "
<<
__FILE__
<<
":"
<<
__LINE__
<<
"Check that you did a ghost_get before a ghost_put"
<<
std
::
endl
;
std
::
cerr
<<
"Error: "
<<
__FILE__
<<
":"
<<
__LINE__
<<
"
Check that you did a ghost_get before a ghost_put"
<<
std
::
endl
;
}
}
...
...
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