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
567607cf
Commit
567607cf
authored
Sep 11, 2015
by
Matthieu Schaller
Browse files
Apply formatting style to the new functions.
Former-commit-id: ffaabe8f08b824345c5c595bb5c8241ed6f36140
parent
9155673c
Changes
4
Hide whitespace changes
Inline
Side-by-side
src/debug.c
View file @
567607cf
...
...
@@ -23,10 +23,10 @@
#include
"const.h"
#include
"part.h"
/**
* @brief Looks for the particle with the given id and prints its information to the standard output.
*
* @brief Looks for the particle with the given id and prints its information to
*the standard output.
*
* @param parts The array of particles.
* @param id The id too look for.
* @param N The size of the array of particles.
...
...
src/engine.c
View file @
567607cf
...
...
@@ -951,24 +951,22 @@ int engine_exchange_strays(struct engine *e, int offset, int *ind, int N) {
count
+=
p
->
nr_parts_in
;
}
}
/* Wait for all the sends to have finnished too. */
if
(
nr_out
>
0
)
if
(
MPI_Waitall
(
2
*
e
->
nr_proxies
,
reqs_out
,
MPI_STATUSES_IGNORE
)
!=
MPI_SUCCESS
)
error
(
"MPI_Waitall on sends failed."
);
if
(
nr_out
>
0
)
if
(
MPI_Waitall
(
2
*
e
->
nr_proxies
,
reqs_out
,
MPI_STATUSES_IGNORE
)
!=
MPI_SUCCESS
)
error
(
"MPI_Waitall on sends failed."
);
/* Return the number of harvested parts. */
return
count
;
#else
error
(
"SWIFT was not compiled with MPI support."
);
error
(
"SWIFT was not compiled with MPI support."
);
return
0
;
#endif
}
/**
* @brief Fill the #space's task list.
*
...
...
src/space.c
View file @
567607cf
...
...
@@ -778,7 +778,6 @@ void space_map_clearsort(struct cell *c, void *data) {
}
}
/**
* @brief Map a function to all particles in a cell recursively.
*
...
...
@@ -787,23 +786,23 @@ void space_map_clearsort(struct cell *c, void *data) {
* @param data Data passed to the function fun.
*/
static
void
rec_map_parts
(
struct
cell
*
c
,
void
(
*
fun
)(
struct
part
*
p
,
struct
cell
*
c
,
void
*
data
),
void
*
data
)
{
static
void
rec_map_parts
(
struct
cell
*
c
,
void
(
*
fun
)(
struct
part
*
p
,
struct
cell
*
c
,
void
*
data
),
void
*
data
)
{
int
k
;
/* No progeny? */
if
(
!
c
->
split
)
for
(
k
=
0
;
k
<
c
->
count
;
k
++
)
fun
(
&
c
->
parts
[
k
],
c
,
data
);
/* Otherwise, recurse. */
else
for
(
k
=
0
;
k
<
8
;
k
++
)
if
(
c
->
progeny
[
k
]
!=
NULL
)
rec_map_parts
(
c
->
progeny
[
k
],
fun
,
data
);
}
/**
* @brief Map a function to all particles in a space.
*
...
...
@@ -819,10 +818,10 @@ void space_map_parts(struct space *s,
int
cid
=
0
;
/* Call the recursive function on all higher-level cells. */
for
(
cid
=
0
;
cid
<
s
->
nr_cells
;
cid
++
)
rec_map_parts
(
&
s
->
cells
[
cid
],
fun
,
data
);
for
(
cid
=
0
;
cid
<
s
->
nr_cells
;
cid
++
)
rec_map_parts
(
&
s
->
cells
[
cid
],
fun
,
data
);
}
/**
* @brief Map a function to all particles in a cell recursively.
*
...
...
@@ -832,22 +831,22 @@ void space_map_parts(struct space *s,
* @param data Data passed to the function fun.
*/
static
void
rec_map_cells_post
(
struct
cell
*
c
,
int
full
,
void
(
*
fun
)(
struct
cell
*
c
,
void
*
data
),
void
*
data
)
{
static
void
rec_map_cells_post
(
struct
cell
*
c
,
int
full
,
void
(
*
fun
)(
struct
cell
*
c
,
void
*
data
),
void
*
data
)
{
int
k
;
/* Recurse. */
if
(
c
->
split
)
for
(
k
=
0
;
k
<
8
;
k
++
)
if
(
c
->
progeny
[
k
]
!=
NULL
)
rec_map_cells_post
(
c
->
progeny
[
k
],
full
,
fun
,
data
);
if
(
c
->
progeny
[
k
]
!=
NULL
)
rec_map_cells_post
(
c
->
progeny
[
k
],
full
,
fun
,
data
);
/* No progeny? */
if
(
full
||
!
c
->
split
)
fun
(
c
,
data
);
}
/**
* @brief Map a function to all particles in a aspace.
*
...
...
@@ -858,45 +857,41 @@ static void rec_map_cells_post(struct cell * c, int full,
*/
void
space_map_cells_post
(
struct
space
*
s
,
int
full
,
void
(
*
fun
)(
struct
cell
*
c
,
void
*
data
),
void
*
data
)
{
void
(
*
fun
)(
struct
cell
*
c
,
void
*
data
),
void
*
data
)
{
int
cid
=
0
;
/* Call the recursive function on all higher-level cells. */
for
(
cid
=
0
;
cid
<
s
->
nr_cells
;
cid
++
)
rec_map_cells_post
(
&
s
->
cells
[
cid
],
full
,
fun
,
data
);
for
(
cid
=
0
;
cid
<
s
->
nr_cells
;
cid
++
)
rec_map_cells_post
(
&
s
->
cells
[
cid
],
full
,
fun
,
data
);
}
static
void
rec_map_cells_pre
(
struct
cell
*
c
,
int
full
,
void
(
*
fun
)(
struct
cell
*
c
,
void
*
data
),
void
*
data
)
{
static
void
rec_map_cells_pre
(
struct
cell
*
c
,
int
full
,
void
(
*
fun
)(
struct
cell
*
c
,
void
*
data
),
void
*
data
)
{
int
k
;
/* No progeny? */
if
(
full
||
!
c
->
split
)
fun
(
c
,
data
);
/* Recurse. */
if
(
c
->
split
)
for
(
k
=
0
;
k
<
8
;
k
++
)
if
(
c
->
progeny
[
k
]
!=
NULL
)
rec_map_cells_pre
(
c
->
progeny
[
k
],
full
,
fun
,
data
);
if
(
c
->
progeny
[
k
]
!=
NULL
)
rec_map_cells_pre
(
c
->
progeny
[
k
],
full
,
fun
,
data
);
}
void
space_map_cells_pre
(
struct
space
*
s
,
int
full
,
void
(
*
fun
)(
struct
cell
*
c
,
void
*
data
),
void
*
data
)
{
void
(
*
fun
)(
struct
cell
*
c
,
void
*
data
),
void
*
data
)
{
int
cid
=
0
;
/* Call the recursive function on all higher-level cells. */
for
(
cid
=
0
;
cid
<
s
->
nr_cells
;
cid
++
)
rec_map_cells_pre
(
&
s
->
cells
[
cid
],
full
,
fun
,
data
);
for
(
cid
=
0
;
cid
<
s
->
nr_cells
;
cid
++
)
rec_map_cells_pre
(
&
s
->
cells
[
cid
],
full
,
fun
,
data
);
}
/**
* @brief Split cells that contain too many particles.
*
...
...
src/version.c
View file @
567607cf
...
...
@@ -24,7 +24,6 @@
/* This object's header. */
#include
"version.h"
/**
* @brief Return the source code git revision
*
...
...
@@ -58,22 +57,21 @@ const char *package_description(void) {
return
buf
;
}
/**
* @brief Prints a greeting message to the standard output containing code version and revision number
* @brief Prints a greeting message to the standard output containing code
* version and revision number
*/
void
greetings
(
void
)
{
printf
(
" Welcome to the cosmological code
\n
"
);
printf
(
" ______ __________________
\n
"
);
printf
(
" / ___/ | / / _/ ____/_ __/
\n
"
);
printf
(
"
\\
__
\\
| | /| / // // /_ / /
\n
"
);
printf
(
" ___/ /| |/ |/ // // __/ / /
\n
"
);
printf
(
" /____/ |__/|__/___/_/ /_/
\n
"
);
printf
(
" SPH With Inter-dependent Fine-grained Tasking
\n\n
"
);
printf
(
" Version : %s
\n
"
,
package_version
()
);
printf
(
" Revision: %s
\n
"
,
git_revision
()
);
printf
(
" Webpage : www.swiftsim.com
\n\n
"
);
printf
(
" Welcome to the cosmological code
\n
"
);
printf
(
" ______ __________________
\n
"
);
printf
(
" / ___/ | / / _/ ____/_ __/
\n
"
);
printf
(
"
\\
__
\\
| | /| / // // /_ / /
\n
"
);
printf
(
" ___/ /| |/ |/ // // __/ / /
\n
"
);
printf
(
" /____/ |__/|__/___/_/ /_/
\n
"
);
printf
(
" SPH With Inter-dependent Fine-grained Tasking
\n\n
"
);
printf
(
" Version : %s
\n
"
,
package_version
());
printf
(
" Revision: %s
\n
"
,
git_revision
());
printf
(
" Webpage : www.swiftsim.com
\n\n
"
);
}
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