Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
SWIFTsim
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor 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
SWIFT
SWIFTsim
Commits
f0b035e9
Commit
f0b035e9
authored
11 years ago
by
Pedro Gonnet
Browse files
Options
Downloads
Patches
Plain Diff
allow more proxies, and fail if this number is exceeded.
Former-commit-id: 15ef95aecade7eae75efe24e882f4bc67d8c0222
parent
1687d3bb
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/cell.h
+1
-1
1 addition, 1 deletion
src/cell.h
src/engine.c
+14
-7
14 additions, 7 deletions
src/engine.c
src/engine.h
+1
-1
1 addition, 1 deletion
src/engine.h
with
16 additions
and
9 deletions
src/cell.h
+
1
−
1
View file @
f0b035e9
...
...
@@ -133,7 +133,7 @@ struct cell {
int
nodeID
;
/* Bit mask of the proxies this cell is registered with. */
unsigned
int
sendto
;
unsigned
long
long
int
sendto
;
/* Pointer to this cell's packed representation. */
struct
pcell
*
pcell
;
...
...
This diff is collapsed.
Click to expand it.
src/engine.c
+
14
−
7
View file @
f0b035e9
...
...
@@ -91,7 +91,7 @@ void engine_repartition ( struct engine *e ) {
idx_t
*
inds
;
idx_t
*
weights_v
,
*
weights_e
;
struct
space
*
s
=
e
->
s
;
int
nr_cells
=
s
->
nr_cells
;
int
nr_cells
=
s
->
nr_cells
,
my_cells
=
0
;
struct
cell
*
cells
=
s
->
cells
;
int
ind
[
3
],
*
cdim
=
s
->
cdim
;
struct
task
*
t
,
*
tasks
=
e
->
sched
.
tasks
;
...
...
@@ -254,8 +254,11 @@ void engine_repartition ( struct engine *e ) {
error
(
"Failed to bcast the node IDs."
);
/* Set the cell nodeIDs and clear any non-local parts. */
for
(
k
=
0
;
k
<
nr_cells
;
k
++
)
for
(
k
=
0
;
k
<
nr_cells
;
k
++
)
{
cells
[
k
].
nodeID
=
nodeIDs
[
k
];
if
(
nodeIDs
[
k
]
==
nodeID
)
my_cells
+=
1
;
}
/* Clean up. */
free
(
inds
);
...
...
@@ -349,7 +352,7 @@ void engine_repartition ( struct engine *e ) {
s
->
size_parts
=
2
*
nr_parts
;
/* Be verbose about what just happened. */
message
(
"node %i now has %i parts."
,
nodeID
,
nr_parts
);
message
(
"node %i now has %i parts
in %i cells
."
,
nodeID
,
nr_parts
,
my_cells
);
/* Clean up other stuff. */
free
(
reqs
);
...
...
@@ -553,7 +556,7 @@ void engine_exchange_cells ( struct engine *e ) {
}
/* Wait for all the sends to have finnished too. */
if
(
MPI_Waitall
(
nr_proxies
,
reqs_out
,
&
status
)
!=
MPI_SUCCESS
)
if
(
MPI_Waitall
(
nr_proxies
,
reqs_out
,
MPI_STATUSES_IGNORE
)
!=
MPI_SUCCESS
)
error
(
"MPI_Waitall on sends failed."
);
/* Count the number of particles we need to import and re-allocate
...
...
@@ -677,7 +680,7 @@ int engine_exchange_strays ( struct engine *e , struct part *parts , struct xpar
/* Wait for all the sends to have finnished too. */
if
(
nr_out
>
0
)
if
(
MPI_Waitall
(
e
->
nr_proxies
,
reqs_out
,
&
status
)
!=
MPI_SUCCESS
)
if
(
MPI_Waitall
(
e
->
nr_proxies
,
reqs_out
,
MPI_STATUSES_IGNORE
)
!=
MPI_SUCCESS
)
error
(
"MPI_Waitall on sends failed."
);
/* Return the number of harvested parts. */
...
...
@@ -1597,6 +1600,8 @@ void engine_makeproxies ( struct engine *e ) {
if
(
cells
[
cid
].
nodeID
==
e
->
nodeID
&&
cells
[
cjd
].
nodeID
!=
e
->
nodeID
)
{
pid
=
e
->
proxy_ind
[
cells
[
cjd
].
nodeID
];
if
(
pid
<
0
)
{
if
(
e
->
nr_proxies
==
engine_maxproxies
)
error
(
"Maximum number of proxies exceeded."
);
proxy_init
(
&
proxies
[
e
->
nr_proxies
]
,
e
->
nodeID
,
cells
[
cjd
].
nodeID
);
e
->
proxy_ind
[
cells
[
cjd
].
nodeID
]
=
e
->
nr_proxies
;
pid
=
e
->
nr_proxies
;
...
...
@@ -1604,12 +1609,14 @@ void engine_makeproxies ( struct engine *e ) {
}
proxy_addcell_in
(
&
proxies
[
pid
]
,
&
cells
[
cjd
]
);
proxy_addcell_out
(
&
proxies
[
pid
]
,
&
cells
[
cid
]
);
cells
[
cid
].
sendto
|=
(
1
<<
pid
);
cells
[
cid
].
sendto
|=
(
1
ULL
<<
pid
);
}
if
(
cells
[
cjd
].
nodeID
==
e
->
nodeID
&&
cells
[
cid
].
nodeID
!=
e
->
nodeID
)
{
pid
=
e
->
proxy_ind
[
cells
[
cid
].
nodeID
];
if
(
pid
<
0
)
{
if
(
e
->
nr_proxies
==
engine_maxproxies
)
error
(
"Maximum number of proxies exceeded."
);
proxy_init
(
&
proxies
[
e
->
nr_proxies
]
,
e
->
nodeID
,
cells
[
cid
].
nodeID
);
e
->
proxy_ind
[
cells
[
cid
].
nodeID
]
=
e
->
nr_proxies
;
pid
=
e
->
nr_proxies
;
...
...
@@ -1617,7 +1624,7 @@ void engine_makeproxies ( struct engine *e ) {
}
proxy_addcell_in
(
&
proxies
[
pid
]
,
&
cells
[
cid
]
);
proxy_addcell_out
(
&
proxies
[
pid
]
,
&
cells
[
cjd
]
);
cells
[
cjd
].
sendto
|=
(
1
<<
pid
);
cells
[
cjd
].
sendto
|=
(
1
ULL
<<
pid
);
}
}
}
...
...
This diff is collapsed.
Click to expand it.
src/engine.h
+
1
−
1
View file @
f0b035e9
...
...
@@ -33,7 +33,7 @@
#define engine_queue_scale 1.2
#define engine_maxtaskspercell 32
#define engine_maxproxies
3
6
#define engine_maxproxies 6
4
/* The rank of the engine as a global variable (for messages). */
...
...
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