Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
SWIFT
SWIFTsim
Commits
1f3c79fa
Commit
1f3c79fa
authored
Aug 02, 2017
by
Matthieu Schaller
Browse files
Code formatting
parent
a6d77ac8
Changes
9
Hide whitespace changes
Inline
Side-by-side
examples/main.c
View file @
1f3c79fa
...
...
@@ -155,8 +155,7 @@ int main(int argc, char *argv[]) {
/* Let's pin the main thread */
#if defined(HAVE_SETAFFINITY) && defined(HAVE_LIBNUMA) && defined(_GNU_SOURCE)
if
(((
ENGINE_POLICY
)
&
engine_policy_setaffinity
)
==
engine_policy_setaffinity
)
if
(((
ENGINE_POLICY
)
&
engine_policy_setaffinity
)
==
engine_policy_setaffinity
)
engine_pin
();
#endif
...
...
src/cell.c
View file @
1f3c79fa
...
...
@@ -1283,7 +1283,7 @@ void cell_clean(struct cell *c) {
if
(
c
->
sort
[
i
]
!=
NULL
)
{
free
(
c
->
sort
[
i
]);
c
->
sort
[
i
]
=
NULL
;
}
}
/* Recurse */
for
(
int
k
=
0
;
k
<
8
;
k
++
)
...
...
src/engine.c
View file @
1f3c79fa
...
...
@@ -2610,8 +2610,8 @@ void engine_marktasks_mapper(void *map_data, int num_elements,
/* Only interested in density tasks as of here. */
if
(
t
->
subtype
==
task_subtype_density
)
{
/* Too much particle movement? */
if
(
cell_need_rebuild_for_pair
(
ci
,
cj
))
*
rebuild_space
=
1
;
/* Too much particle movement? */
if
(
cell_need_rebuild_for_pair
(
ci
,
cj
))
*
rebuild_space
=
1
;
#ifdef WITH_MPI
/* Activate the send/recv tasks. */
...
...
tests/test125cells.c
View file @
1f3c79fa
...
...
@@ -340,8 +340,7 @@ struct cell *make_cell(size_t n, const double offset[3], double size, double h,
// shuffle_particles(cell->parts, cell->count);
cell
->
sorted
=
0
;
for
(
int
k
=
0
;
k
<
13
;
k
++
)
cell
->
sort
[
k
]
=
NULL
;
for
(
int
k
=
0
;
k
<
13
;
k
++
)
cell
->
sort
[
k
]
=
NULL
;
return
cell
;
}
...
...
@@ -350,8 +349,7 @@ void clean_up(struct cell *ci) {
free
(
ci
->
parts
);
free
(
ci
->
xparts
);
for
(
int
k
=
0
;
k
<
13
;
k
++
)
if
(
ci
->
sort
[
k
]
!=
NULL
)
free
(
ci
->
sort
[
k
]);
if
(
ci
->
sort
[
k
]
!=
NULL
)
free
(
ci
->
sort
[
k
]);
free
(
ci
);
}
...
...
tests/test27cells.c
View file @
1f3c79fa
...
...
@@ -178,8 +178,7 @@ struct cell *make_cell(size_t n, double *offset, double size, double h,
shuffle_particles
(
cell
->
parts
,
cell
->
count
);
cell
->
sorted
=
0
;
for
(
int
k
=
0
;
k
<
13
;
k
++
)
cell
->
sort
[
k
]
=
NULL
;
for
(
int
k
=
0
;
k
<
13
;
k
++
)
cell
->
sort
[
k
]
=
NULL
;
return
cell
;
}
...
...
@@ -187,8 +186,7 @@ struct cell *make_cell(size_t n, double *offset, double size, double h,
void
clean_up
(
struct
cell
*
ci
)
{
free
(
ci
->
parts
);
for
(
int
k
=
0
;
k
<
13
;
k
++
)
if
(
ci
->
sort
[
k
]
!=
NULL
)
free
(
ci
->
sort
[
k
]);
if
(
ci
->
sort
[
k
]
!=
NULL
)
free
(
ci
->
sort
[
k
]);
free
(
ci
);
}
...
...
tests/testPair.c
View file @
1f3c79fa
...
...
@@ -121,8 +121,7 @@ struct cell *make_cell(size_t n, double *offset, double size, double h,
shuffle_particles
(
cell
->
parts
,
cell
->
count
);
cell
->
sorted
=
0
;
for
(
int
k
=
0
;
k
<
13
;
k
++
)
cell
->
sort
[
k
]
=
NULL
;
for
(
int
k
=
0
;
k
<
13
;
k
++
)
cell
->
sort
[
k
]
=
NULL
;
return
cell
;
}
...
...
@@ -130,8 +129,7 @@ struct cell *make_cell(size_t n, double *offset, double size, double h,
void
clean_up
(
struct
cell
*
ci
)
{
free
(
ci
->
parts
);
for
(
int
k
=
0
;
k
<
13
;
k
++
)
if
(
ci
->
sort
[
k
]
!=
NULL
)
free
(
ci
->
sort
[
k
]);
if
(
ci
->
sort
[
k
]
!=
NULL
)
free
(
ci
->
sort
[
k
]);
free
(
ci
);
}
...
...
tests/testPeriodicBC.c
View file @
1f3c79fa
...
...
@@ -177,8 +177,7 @@ struct cell *make_cell(size_t n, double *offset, double size, double h,
shuffle_particles
(
cell
->
parts
,
cell
->
count
);
cell
->
sorted
=
0
;
for
(
int
k
=
0
;
k
<
13
;
k
++
)
cell
->
sort
[
k
]
=
NULL
;
for
(
int
k
=
0
;
k
<
13
;
k
++
)
cell
->
sort
[
k
]
=
NULL
;
return
cell
;
}
...
...
@@ -186,8 +185,7 @@ struct cell *make_cell(size_t n, double *offset, double size, double h,
void
clean_up
(
struct
cell
*
ci
)
{
free
(
ci
->
parts
);
for
(
int
k
=
0
;
k
<
13
;
k
++
)
if
(
ci
->
sort
[
k
]
!=
NULL
)
free
(
ci
->
sort
[
k
]);
if
(
ci
->
sort
[
k
]
!=
NULL
)
free
(
ci
->
sort
[
k
]);
free
(
ci
);
}
...
...
tests/testSPHStep.c
View file @
1f3c79fa
...
...
@@ -81,8 +81,7 @@ struct cell *make_cell(size_t N, float cellSize, int offset[3], int id_offset) {
cell
->
ti_end_max
=
1
;
cell
->
sorted
=
0
;
for
(
int
k
=
0
;
k
<
13
;
k
++
)
cell
->
sort
[
k
]
=
NULL
;
for
(
int
k
=
0
;
k
<
13
;
k
++
)
cell
->
sort
[
k
]
=
NULL
;
return
cell
;
}
...
...
@@ -213,8 +212,7 @@ int main() {
free
(
cells
[
j
]
->
parts
);
free
(
cells
[
j
]
->
xparts
);
for
(
int
k
=
0
;
k
<
13
;
k
++
)
if
(
cells
[
j
]
->
sort
[
k
]
!=
NULL
)
free
(
cells
[
j
]
->
sort
[
k
]);
if
(
cells
[
j
]
->
sort
[
k
]
!=
NULL
)
free
(
cells
[
j
]
->
sort
[
k
]);
free
(
cells
[
j
]);
}
...
...
tests/testThreadpool.c
View file @
1f3c79fa
...
...
@@ -82,7 +82,7 @@ int main(int argc, char *argv[]) {
threadpool_map
(
&
tp
,
map_function_first
,
data
,
N
,
sizeof
(
int
),
2
,
NULL
);
}
/* If logging was enabled, dump the log. */
/* If logging was enabled, dump the log. */
#ifdef SWIFT_DEBUG_THREADPOOL
char
filename
[
80
];
sprintf
(
filename
,
"threadpool_log-%d.txt"
,
num_thread
);
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment