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
f7f3b388
Commit
f7f3b388
authored
2 years ago
by
Rafael Ravedutti
Browse files
Options
Downloads
Patches
Plain Diff
Fix setup with MPI initialization
Signed-off-by:
Rafael Ravedutti
<
rafaelravedutti@gmail.com
>
parent
4d868c1c
Branches
try-flynt
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/pairs/sim/read_from_file.py
+8
-4
8 additions, 4 deletions
src/pairs/sim/read_from_file.py
src/pairs/sim/simulation.py
+5
-12
5 additions, 12 deletions
src/pairs/sim/simulation.py
with
13 additions
and
16 deletions
src/pairs/sim/read_from_file.py
+
8
−
4
View file @
f7f3b388
from
pairs.ir.block
import
pairs_inline
from
pairs.ir.block
import
pairs_inline
from
pairs.ir.functions
import
Call_Int
from
pairs.ir.functions
import
Call_Int
,
Call_Void
from
pairs.ir.properties
import
PropertyList
from
pairs.ir.properties
import
PropertyList
from
pairs.ir.types
import
Types
from
pairs.ir.types
import
Types
from
pairs.sim.grid
import
MutableGrid
from
pairs.sim.grid
import
MutableGrid
...
@@ -16,9 +16,13 @@ class ReadFromFile(Lowerable):
...
@@ -16,9 +16,13 @@ class ReadFromFile(Lowerable):
@pairs_inline
@pairs_inline
def
lower
(
self
):
def
lower
(
self
):
self
.
sim
.
nlocal
.
set
(
Call_Int
(
self
.
sim
,
"
pairs::read_particle_data
"
,
Call_Void
(
self
.
sim
,
"
pairs::read_grid_data
"
,
[
self
.
filename
,
self
.
grid_buffer
])
[
self
.
filename
,
self
.
grid_buffer
,
self
.
props
,
self
.
props
.
length
()]))
for
d
in
range
(
self
.
sim
.
ndims
()):
for
d
in
range
(
self
.
sim
.
ndims
()):
self
.
grid
.
min
(
d
).
set
(
self
.
grid_buffer
[
d
*
2
+
0
])
self
.
grid
.
min
(
d
).
set
(
self
.
grid_buffer
[
d
*
2
+
0
])
self
.
grid
.
max
(
d
).
set
(
self
.
grid_buffer
[
d
*
2
+
1
])
self
.
grid
.
max
(
d
).
set
(
self
.
grid_buffer
[
d
*
2
+
1
])
dom_part
=
self
.
sim
.
domain_partitioning
()
grid_array
=
[[
self
.
grid
.
min
(
d
),
self
.
grid
.
max
(
d
)]
for
d
in
range
(
self
.
sim
.
ndims
())]
Call_Void
(
self
.
sim
,
"
pairs->initDomain
"
,
[
param
for
delim
in
grid_array
for
param
in
delim
]),
Call_Void
(
self
.
sim
,
"
pairs->fillCommunicationArrays
"
,
[
dom_part
.
neighbor_ranks
,
dom_part
.
pbc
,
dom_part
.
subdom
])
self
.
sim
.
nlocal
.
set
(
Call_Int
(
self
.
sim
,
"
pairs::read_particle_data
"
,
[
self
.
filename
,
self
.
props
,
self
.
props
.
length
()]))
This diff is collapsed.
Click to expand it.
src/pairs/sim/simulation.py
+
5
−
12
View file @
f7f3b388
...
@@ -62,6 +62,7 @@ class Simulation:
...
@@ -62,6 +62,7 @@ class Simulation:
self
.
iter_id
=
0
self
.
iter_id
=
0
self
.
vtk_file
=
None
self
.
vtk_file
=
None
self
.
_target
=
None
self
.
_target
=
None
self
.
_dom_part
=
DimensionRanges
(
self
)
self
.
nparticles
=
self
.
nlocal
+
self
.
nghost
self
.
nparticles
=
self
.
nlocal
+
self
.
nghost
self
.
properties
.
add_capacity
(
self
.
particle_capacity
)
self
.
properties
.
add_capacity
(
self
.
particle_capacity
)
...
@@ -236,20 +237,12 @@ class Simulation:
...
@@ -236,20 +237,12 @@ class Simulation:
def
cell_spacing
(
self
):
def
cell_spacing
(
self
):
return
self
.
cell_lists
.
cutoff_radius
return
self
.
cell_lists
.
cutoff_radius
def
domain_partitioning
(
self
):
return
self
.
_dom_part
def
generate
(
self
):
def
generate
(
self
):
assert
self
.
_target
is
not
None
,
"
Target not specified!
"
assert
self
.
_target
is
not
None
,
"
Target not specified!
"
comm
=
Comm
(
self
,
self
.
_dom_part
)
dom_part
=
DimensionRanges
(
self
)
comm
=
Comm
(
self
,
dom_part
)
self
.
capture_statements
(
False
)
grid_array
=
[[
self
.
grid
.
min
(
d
),
self
.
grid
.
max
(
d
)]
for
d
in
range
(
self
.
ndims
())]
self
.
setups
.
add_statement
([
Call_Void
(
self
,
"
pairs->initDomain
"
,
[
param
for
delim
in
grid_array
for
param
in
delim
]),
Call_Void
(
self
,
"
pairs->fillCommunicationArrays
"
,
[
dom_part
.
neighbor_ranks
,
dom_part
.
pbc
,
dom_part
.
subdom
])
])
self
.
capture_statements
()
# TODO: check if this is actually required
timestep
=
Timestep
(
self
,
self
.
ntimesteps
,
[
timestep
=
Timestep
(
self
,
self
.
ntimesteps
,
[
(
comm
.
exchange
(),
20
),
(
comm
.
exchange
(),
20
),
...
...
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