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
d1254f74
Commit
d1254f74
authored
Sep 11, 2015
by
Peter W. Draper
Browse files
Merge branch 'cosmetics'
Former-commit-id: 55c81ed8d8243e8f353c31e11ea8fb6970059d99
parents
ea657f5e
1db7dfe7
Changes
7
Expand all
Hide whitespace changes
Inline
Side-by-side
README
View file @
d1254f74
This is SWIFT. See INSTALL.swift for instructions.
Welcome to the cosmological code
______ __________________
/ ___/ | / / _/ ____/_ __/
\__ \| | /| / // // /_ / /
___/ /| |/ |/ // // __/ / /
/____/ |__/|__/___/_/ /_/
SPH With Inter-dependent Fine-grained Tasking
www.swiftsim.com
See INSTALL.swift for instructions.
examples/test.c
View file @
d1254f74
This diff is collapsed.
Click to expand it.
src/debug.c
View file @
d1254f74
...
...
@@ -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 @
d1254f74
...
...
@@ -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 @
d1254f74
...
...
@@ -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 @
d1254f74
...
...
@@ -56,3 +56,22 @@ const char *package_description(void) {
}
return
buf
;
}
/**
* @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
"
);
}
src/version.h.in
View file @
d1254f74
...
...
@@ -31,5 +31,6 @@
const char* package_description( void );
const char* package_version(void);
const char* git_revision(void);
void greetings(void);
#endif /* SWIFT_VERSION_H */
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