Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Sign in
Toggle navigation
O
openfpm_pdata
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Insights
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Security & Compliance
Security & Compliance
Dependency List
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
openfpm
openfpm_pdata
Commits
0985040d
Commit
0985040d
authored
Oct 19, 2016
by
incardon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ghost get and put example + small fixes for NO_POSITION
parent
d24117db
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
13 deletions
+14
-13
example/Vector/0_simple/main.cpp
example/Vector/0_simple/main.cpp
+3
-2
example/Vector/1_celllist/main.cpp
example/Vector/1_celllist/main.cpp
+3
-0
src/Vector/vector_dist_comm.hpp
src/Vector/vector_dist_comm.hpp
+8
-11
No files found.
example/Vector/0_simple/main.cpp
View file @
0985040d
...
...
@@ -2,6 +2,7 @@
*
* \subpage Vector_0_simple
* \subpage Vector_1_celllist
* \subpage Vector_1_ghost_get
* \subpage Vector_2_expression
* \subpage Vector_3_md
* \subpage Vector_4_reo_root
...
...
@@ -39,7 +40,7 @@
* </div>
* \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
*
...
...
@@ -62,7 +63,7 @@ int main(int argc, char* argv[])
* Here we
* * Initialize the library
* * 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
*
*
...
...
example/Vector/1_celllist/main.cpp
View file @
0985040d
...
...
@@ -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.
* 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
* <a href="#" onclick="hide_show('vector-video-5')" >Video 1</a>
...
...
src/Vector/vector_dist_comm.hpp
View file @
0985040d
...
...
@@ -366,12 +366,9 @@ class vector_dist_comm
// Create the shift boxes
createShiftBox
();
if
(
opt
!=
SKIP_LABELLING
)
if
(
!
(
opt
&
SKIP_LABELLING
)
)
lg_m
=
v_prp
.
size
();
// v_pos.resize(lg_m);
// v_prp.resize(lg_m);
if
(
box_f
.
size
()
==
0
)
return
;
else
...
...
@@ -822,10 +819,11 @@ public:
// send vector for each processor
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
if
(
opt
!=
SKIP_LABELLING
)
if
(
!
(
opt
&
SKIP_LABELLING
)
)
{
v_prp
.
resize
(
g_m
);
}
...
...
@@ -839,22 +837,21 @@ public:
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
if
(
opt
!=
NO_POSITION
)
if
(
!
(
opt
&
NO_POSITION
)
)
fill_send_ghost_pos_buf
(
v_pos
,
g_pos_send
);
prc_recv_get
.
clear
();
recv_sz_get
.
clear
();
if
(
opt
==
SKIP_LABELLING
)
if
(
opt
&
SKIP_LABELLING
)
{
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
);
}
else
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
();
recv_sz_get
.
clear
();
...
...
@@ -1071,7 +1068,7 @@ public:
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__
<<
"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
;
}
...
...
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