Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
pairs
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
software
pairs
Commits
dc3d0730
Commit
dc3d0730
authored
1 year ago
by
Rafael Ravedutti
Browse files
Options
Downloads
Patches
Plain Diff
Add PBC check when sending particles with BlockForest
Signed-off-by:
Rafael Ravedutti
<
rafaelravedutti@gmail.com
>
parent
f438d03f
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
runtime/domain/block_forest.cpp
+3
-3
3 additions, 3 deletions
runtime/domain/block_forest.cpp
src/pairs/sim/domain_partitioning.py
+10
-6
10 additions, 6 deletions
src/pairs/sim/domain_partitioning.py
with
13 additions
and
9 deletions
runtime/domain/block_forest.cpp
+
3
−
3
View file @
dc3d0730
...
@@ -22,11 +22,12 @@ namespace pairs {
...
@@ -22,11 +22,12 @@ namespace pairs {
void
BlockForest
::
updateNeighborhood
()
{
void
BlockForest
::
updateNeighborhood
()
{
auto
me
=
mpi
::
MPIManager
::
instance
()
->
rank
();
auto
me
=
mpi
::
MPIManager
::
instance
()
->
rank
();
this
->
nranks
=
0
;
this
->
total_aabbs
=
0
;
ranks
.
clear
();
ranks
.
clear
();
naabbs
.
clear
();
naabbs
.
clear
();
aabbs
.
clear
();
aabbs
.
clear
();
this
->
nranks
=
0
;
this
->
total_aabbs
=
0
;
for
(
auto
&
iblock
:
*
forest
)
{
for
(
auto
&
iblock
:
*
forest
)
{
auto
block
=
static_cast
<
blockforest
::
Block
*>
(
&
iblock
);
auto
block
=
static_cast
<
blockforest
::
Block
*>
(
&
iblock
);
...
@@ -80,7 +81,6 @@ void BlockForest::copyRuntimeArray(const std::string& name, void *dest, const in
...
@@ -80,7 +81,6 @@ void BlockForest::copyRuntimeArray(const std::string& name, void *dest, const in
void
*
src
=
name
.
compare
(
'
ranks
'
)
?
ranks
.
data
()
:
void
*
src
=
name
.
compare
(
'
ranks
'
)
?
ranks
.
data
()
:
name
.
compare
(
'
naabbs
'
)
?
vec_naabbs
.
data
()
:
name
.
compare
(
'
naabbs
'
)
?
vec_naabbs
.
data
()
:
name
.
compare
(
'
rank_offsets
'
)
?
offsets
:
name
.
compare
(
'
rank_offsets
'
)
?
offsets
:
name
.
compare
(
'
pbc
'
)
?
vec_pbc
.
data
()
:
name
.
compare
(
'
aabbs
'
)
?
vec_aabbs
.
data
()
:
name
.
compare
(
'
aabbs
'
)
?
vec_aabbs
.
data
()
:
name
.
compare
(
'
subdom
'
)
?
subdom
;
name
.
compare
(
'
subdom
'
)
?
subdom
;
...
...
This diff is collapsed.
Click to expand it.
src/pairs/sim/domain_partitioning.py
+
10
−
6
View file @
dc3d0730
...
@@ -83,7 +83,6 @@ class BlockForest:
...
@@ -83,7 +83,6 @@ class BlockForest:
self
.
ranks
=
sim
.
add_static_array
(
'
ranks
'
,
[
self
.
nranks_capacity
],
Types
.
Int32
)
self
.
ranks
=
sim
.
add_static_array
(
'
ranks
'
,
[
self
.
nranks_capacity
],
Types
.
Int32
)
self
.
naabbs
=
sim
.
add_static_array
(
'
naabbs
'
,
[
self
.
nranks_capacity
],
Types
.
Int32
)
self
.
naabbs
=
sim
.
add_static_array
(
'
naabbs
'
,
[
self
.
nranks_capacity
],
Types
.
Int32
)
self
.
offsets
=
sim
.
add_static_array
(
'
rank_offsets
'
,
[
self
.
nranks_capacity
],
Types
.
Int32
)
self
.
offsets
=
sim
.
add_static_array
(
'
rank_offsets
'
,
[
self
.
nranks_capacity
],
Types
.
Int32
)
self
.
pbc
=
sim
.
add_static_array
(
'
pbc
'
,
[
self
.
aabb_capacity
,
3
],
Types
.
Int32
)
self
.
aabbs
=
sim
.
add_static_array
(
'
aabbs
'
,
[
self
.
aabb_capacity
,
6
],
Types
.
Real
)
self
.
aabbs
=
sim
.
add_static_array
(
'
aabbs
'
,
[
self
.
aabb_capacity
,
6
],
Types
.
Real
)
self
.
subdom
=
sim
.
add_static_array
(
'
subdom
'
,
[
sim
.
ndims
()
*
2
],
Types
.
Real
)
self
.
subdom
=
sim
.
add_static_array
(
'
subdom
'
,
[
sim
.
ndims
()
*
2
],
Types
.
Real
)
...
@@ -135,15 +134,20 @@ class BlockForest:
...
@@ -135,15 +134,20 @@ class BlockForest:
for
r
in
For
(
self
.
sim
,
0
,
self
.
nranks
):
for
r
in
For
(
self
.
sim
,
0
,
self
.
nranks
):
for
aabb_id
in
For
(
self
.
sim
,
self
.
offsets
[
r
],
self
.
offsets
[
r
]
+
self
.
naabbs
[
r
]):
for
aabb_id
in
For
(
self
.
sim
,
self
.
offsets
[
r
],
self
.
offsets
[
r
]
+
self
.
naabbs
[
r
]):
full_cond
=
None
full_cond
=
None
pbc_shifts
=
[]
for
d
in
range
(
self
.
sim
.
ndims
()):
for
d
in
range
(
self
.
sim
.
ndims
()):
cond_pbc_neg
=
position
[
i
][
d
]
-
offset
<
self
.
sim
.
grid
.
min
(
d
)
cond_pbc_pos
=
position
[
i
][
d
]
+
offset
>
self
.
sim
.
grid
.
max
(
d
)
d_pbc
=
Select
(
self
.
sim
,
cond_pbc_neg
,
-
1
,
Select
(
self
.
sim
,
cond_pbc_pos
,
1
,
0
))
adj_pos
=
position
[
i
][
d
]
+
d_pbc
*
self
.
sim
.
grid
.
length
(
d
)
d_cond
=
ScalarOp
.
and_op
(
d_cond
=
ScalarOp
.
and_op
(
position
[
i
][
d
]
>
self
.
aabbs
[
aabb_id
][
d
*
2
+
0
]
+
offset
,
adj_pos
>
self
.
aabbs
[
aabb_id
][
d
*
2
+
0
]
+
offset
,
position
[
i
][
d
]
<
self
.
aabbs
[
aabb_id
][
d
*
2
+
1
]
-
offset
)
adj_pos
<
self
.
aabbs
[
aabb_id
][
d
*
2
+
1
]
-
offset
)
full_cond
=
d_cond
if
full_cond
is
None
else
\
full_cond
=
d_cond
if
full_cond
is
None
else
ScalarOp
.
and_op
(
full_cond
,
d_cond
)
ScalarOp
.
and_op
(
full_cond
,
d_cond
)
pbc_shifts
.
append
(
d_pbc
)
for
_
in
Filter
(
self
.
sim
,
full_cond
):
for
_
in
Filter
(
self
.
sim
,
full_cond
):
pbc_shifts
=
[
self
.
pbc
[
aabb_id
][
d
]
for
d
in
range
(
self
.
sim
.
ndims
())]
yield
i
,
r
,
self
.
ranks
[
r
],
pbc_shifts
yield
i
,
r
,
self
.
ranks
[
r
],
pbc_shifts
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