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
9cbbf9a2
Commit
9cbbf9a2
authored
11 years ago
by
Pedro Gonnet
Browse files
Options
Downloads
Patches
Plain Diff
small bug on proxies init.
Former-commit-id: cbee9e70b44163d624dd13a9e96ce587edc1b555
parent
f0b035e9
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/engine.c
+8
-5
8 additions, 5 deletions
src/engine.c
with
8 additions
and
5 deletions
src/engine.c
+
8
−
5
View file @
9cbbf9a2
...
...
@@ -1557,14 +1557,17 @@ void engine_makeproxies ( struct engine *e ) {
struct
proxy
*
proxies
=
e
->
proxies
;
/* Prepare the proxies and the proxy index. */
if
(
e
->
proxy_ind
!=
NULL
)
free
(
e
->
proxy_ind
);
if
(
(
e
->
proxy_ind
=
(
int
*
)
malloc
(
sizeof
(
int
)
*
e
->
nr_nodes
)
)
==
NULL
)
error
(
"Failed to allocate proxy index."
);
if
(
e
->
proxy_ind
==
NULL
)
if
(
(
e
->
proxy_ind
=
(
int
*
)
malloc
(
sizeof
(
int
)
*
e
->
nr_nodes
)
)
==
NULL
)
error
(
"Failed to allocate proxy index."
);
for
(
k
=
0
;
k
<
e
->
nr_nodes
;
k
++
)
e
->
proxy_ind
[
k
]
=
-
1
;
e
->
nr_proxies
=
0
;
/* The following loop is super-clunky, but it's necessary
to ensure that the order of the send and recv cells in
the proxies is identical for all nodes! */
/* Loop over each cell in the space. */
for
(
ind
[
0
]
=
0
;
ind
[
0
]
<
cdim
[
0
]
;
ind
[
0
]
++
)
for
(
ind
[
1
]
=
0
;
ind
[
1
]
<
cdim
[
1
]
;
ind
[
1
]
++
)
...
...
@@ -1750,7 +1753,7 @@ void engine_init ( struct engine *e , struct space *s , float dt , int nr_thread
e
->
policy
|=
engine_policy_mpi
;
if
(
(
e
->
proxies
=
(
struct
proxy
*
)
malloc
(
sizeof
(
struct
proxy
)
*
engine_maxproxies
)
)
==
NULL
)
error
(
"Failed to allocate memory for proxies."
);
bzero
(
e
->
proxies
,
sizeof
(
struct
proxy
)
*
26
);
bzero
(
e
->
proxies
,
sizeof
(
struct
proxy
)
*
engine_maxproxies
);
e
->
nr_proxies
=
0
;
#endif
}
...
...
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