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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SWIFT
SWIFTsim
Commits
f007bfc7
Commit
f007bfc7
authored
Mar 24, 2016
by
Matthieu Schaller
Browse files
Options
Downloads
Patches
Plain Diff
gpart-friendly version of engine_split()
parent
7c8389fd
Branches
Branches containing commit
Tags
Tags containing commit
2 merge requests
!136
Master
,
!130
Redistribute fixes
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/engine.c
+16
-2
16 additions, 2 deletions
src/engine.c
with
16 additions
and
2 deletions
src/engine.c
+
16
−
2
View file @
f007bfc7
...
...
@@ -2100,7 +2100,7 @@ void engine_split(struct engine *e, struct partition *initial_partition) {
engine_makeproxies
(
e
);
/* Re-allocate the local parts. */
if
(
e
->
nodeID
==
0
)
if
(
e
->
verbose
)
message
(
"Re-allocating parts array from %zi to %zi."
,
s
->
size_parts
,
(
size_t
)(
s
->
nr_parts
*
1
.
2
));
s
->
size_parts
=
s
->
nr_parts
*
1
.
2
;
...
...
@@ -2108,7 +2108,7 @@ void engine_split(struct engine *e, struct partition *initial_partition) {
struct
xpart
*
xparts_new
=
NULL
;
if
(
posix_memalign
((
void
**
)
&
parts_new
,
part_align
,
sizeof
(
struct
part
)
*
s
->
size_parts
)
!=
0
||
posix_memalign
((
void
**
)
&
xparts_new
,
part_align
,
posix_memalign
((
void
**
)
&
xparts_new
,
x
part_align
,
sizeof
(
struct
xpart
)
*
s
->
size_parts
)
!=
0
)
error
(
"Failed to allocate new part data."
);
memcpy
(
parts_new
,
s
->
parts
,
sizeof
(
struct
part
)
*
s
->
nr_parts
);
...
...
@@ -2117,6 +2117,20 @@ void engine_split(struct engine *e, struct partition *initial_partition) {
free
(
s
->
xparts
);
s
->
parts
=
parts_new
;
s
->
xparts
=
xparts_new
;
/* Same for the g-parts. */
if
(
e
->
verbose
)
message
(
"Re-allocating gparts array from %zi to %zi."
,
s
->
size_gparts
,
(
size_t
)(
s
->
nr_gparts
*
1
.
2
));
s
->
size_gparts
=
s
->
nr_gparts
*
1
.
2
;
struct
gpart
*
gparts_new
=
NULL
;
if
(
posix_memalign
((
void
**
)
&
gparts_new
,
gpart_align
,
sizeof
(
struct
part
)
*
s
->
size_gparts
)
!=
0
)
error
(
"Failed to allocate new gpart data."
);
memcpy
(
gparts_new
,
s
->
gparts
,
sizeof
(
struct
gpart
)
*
s
->
nr_gparts
);
free
(
s
->
gparts
);
s
->
gparts
=
gparts_new
;
#else
error
(
"SWIFT was not compiled with MPI support."
);
#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
sign in
to comment