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
78251d0b
Commit
78251d0b
authored
Oct 20, 2015
by
Matthieu Schaller
Browse files
Compiles without MPI
parent
ceaeaad8
Changes
4
Hide whitespace changes
Inline
Side-by-side
examples/test.c
View file @
78251d0b
...
...
@@ -802,7 +802,7 @@ int main(int argc, char *argv[]) {
tic
=
getticks
();
if
(
myrank
==
0
)
message
(
"nr_nodes is %i."
,
nr_nodes
);
engine_init
(
&
e
,
&
s
,
dt_max
,
nr_threads
,
nr_queues
,
nr_nodes
,
myrank
,
ENGINE_POLICY
|
engine_policy_steal
);
ENGINE_POLICY
|
engine_policy_steal
,
0
,
1
.
);
if
(
myrank
==
0
)
message
(
"engine_init took %.3f ms."
,
((
double
)(
getticks
()
-
tic
))
/
CPU_TPS
*
1000
);
...
...
@@ -903,7 +903,7 @@ int main(int argc, char *argv[]) {
/* fflush(stdout); */
/* } */
if
(
myrank
==
0
)
{
printf
(
"%i %e
%.3e
"
,
j
,
e
.
time
,
e
.
dt
);
printf
(
"%i %e"
,
j
,
e
.
time
);
printf
(
" %.3f"
,
((
double
)
timers
[
timer_count
-
1
])
/
CPU_TPS
*
1000
);
printf
(
"
\n
"
);
fflush
(
stdout
);
...
...
src/debug.c
View file @
78251d0b
...
...
@@ -68,11 +68,11 @@ void printgParticle(struct gpart *parts, long long int id, int N) {
if
(
parts
[
i
].
id
==
-
id
||
(
parts
[
i
].
id
>
0
&&
parts
[
i
].
part
->
id
==
id
))
{
printf
(
"## gParticle[%d]: id=%lld, x=[%.16e,%.16e,%.16e], "
"v=[%.3e,%.3e,%.3e], a=[%.3e,%.3e,%.3e], m=%.3e,
d
t=%.3e
\n
"
,
"v=[%.3e,%.3e,%.3e], a=[%.3e,%.3e,%.3e], m=%.3e, t
_begin=%.3e, t_end
=%.3e
\n
"
,
i
,
(
parts
[
i
].
id
<
0
)
?
-
parts
[
i
].
id
:
parts
[
i
].
part
->
id
,
parts
[
i
].
x
[
0
],
parts
[
i
].
x
[
1
],
parts
[
i
].
x
[
2
],
parts
[
i
].
v
[
0
],
parts
[
i
].
v
[
1
],
parts
[
i
].
v
[
2
],
parts
[
i
].
a
[
0
],
parts
[
i
].
a
[
1
],
parts
[
i
].
a
[
2
],
parts
[
i
].
mass
,
parts
[
i
].
d
t
);
parts
[
i
].
a
[
2
],
parts
[
i
].
mass
,
parts
[
i
].
t
_begin
,
parts
[
i
].
t_end
);
found
=
1
;
}
...
...
@@ -92,9 +92,9 @@ void printParticle_single(struct part *p) {
"## Particle: id=%lld, x=[%e,%e,%e], v=[%.3e,%.3e,%.3e], "
"a=[%.3e,%.3e,%.3e], h=%.3e, h_dt=%.3e, wcount=%.3e, m=%.3e, rho=%.3e, "
"rho_dh=%.3e, div_v=%.3e, u=%.3e, dudt=%.3e, bals=%.3e, POrho2=%.3e, "
"v_sig=%.3e,
d
t=%.3e
\n
"
,
"v_sig=%.3e, t
_begin=%.3e, t_end
=%.3e
\n
"
,
p
->
id
,
p
->
x
[
0
],
p
->
x
[
1
],
p
->
x
[
2
],
p
->
v
[
0
],
p
->
v
[
1
],
p
->
v
[
2
],
p
->
a
[
0
],
p
->
a
[
1
],
p
->
a
[
2
],
p
->
h
,
p
->
force
.
h_dt
,
p
->
density
.
wcount
,
p
->
mass
,
p
->
rho
,
p
->
rho_dh
,
p
->
density
.
div_v
,
p
->
u
,
p
->
force
.
u_dt
,
p
->
force
.
balsara
,
p
->
force
.
POrho2
,
p
->
force
.
v_sig
,
p
->
d
t
);
p
->
force
.
POrho2
,
p
->
force
.
v_sig
,
p
->
t
_begin
,
p
->
t_end
);
}
src/scheduler.c
View file @
78251d0b
...
...
@@ -137,7 +137,23 @@ void scheduler_splittasks(struct scheduler *s) {
}
/* Non-local kick task? */
if
((
t
->
type
==
task_type_kick1
||
t
->
type
==
task_type_kick2
)
&&
if
((
t
->
type
==
task_type_kick
)
&&
t
->
ci
->
nodeID
!=
s
->
nodeID
)
{
t
->
type
=
task_type_none
;
t
->
skip
=
1
;
continue
;
}
/* Non-local drift task? */
if
((
t
->
type
==
task_type_drift
)
&&
t
->
ci
->
nodeID
!=
s
->
nodeID
)
{
t
->
type
=
task_type_none
;
t
->
skip
=
1
;
continue
;
}
/* Non-local init task? */
if
((
t
->
type
==
task_type_init
)
&&
t
->
ci
->
nodeID
!=
s
->
nodeID
)
{
t
->
type
=
task_type_none
;
t
->
skip
=
1
;
...
...
@@ -849,8 +865,13 @@ void scheduler_reweight(struct scheduler *s) {
case
task_type_ghost
:
if
(
t
->
ci
==
t
->
ci
->
super
)
t
->
weight
+=
wscale
*
t
->
ci
->
count
;
break
;
case
task_type_kick1
:
case
task_type_kick2
:
case
task_type_kick
:
t
->
weight
+=
wscale
*
t
->
ci
->
count
;
break
;
case
task_type_drift
:
t
->
weight
+=
wscale
*
t
->
ci
->
count
;
break
;
case
task_type_init
:
t
->
weight
+=
wscale
*
t
->
ci
->
count
;
break
;
default:
...
...
@@ -950,7 +971,9 @@ void scheduler_enqueue(struct scheduler *s, struct task *t) {
case
task_type_self
:
case
task_type_sort
:
case
task_type_ghost
:
case
task_type_kick2
:
case
task_type_kick
:
case
task_type_drift
:
case
task_type_init
:
qid
=
t
->
ci
->
super
->
owner
;
break
;
case
task_type_pair
:
...
...
src/single_io.c
View file @
78251d0b
...
...
@@ -230,7 +230,7 @@ void read_ic_single(char* fileName, double dim[3], struct part** parts, int* N,
readArray
(
h_grp
,
"SmoothingLength"
,
FLOAT
,
*
N
,
1
,
*
parts
,
h
,
COMPULSORY
);
readArray
(
h_grp
,
"InternalEnergy"
,
FLOAT
,
*
N
,
1
,
*
parts
,
u
,
COMPULSORY
);
readArray
(
h_grp
,
"ParticleIDs"
,
ULONGLONG
,
*
N
,
1
,
*
parts
,
id
,
COMPULSORY
);
readArray
(
h_grp
,
"TimeStep"
,
FLOAT
,
*
N
,
1
,
*
parts
,
dt
,
OPTIONAL
);
//
readArray(h_grp, "TimeStep", FLOAT, *N, 1, *parts, dt, OPTIONAL);
readArray
(
h_grp
,
"Acceleration"
,
FLOAT
,
*
N
,
3
,
*
parts
,
a
,
OPTIONAL
);
readArray
(
h_grp
,
"Density"
,
FLOAT
,
*
N
,
1
,
*
parts
,
rho
,
OPTIONAL
);
...
...
@@ -473,8 +473,8 @@ void write_output_single(struct engine* e, struct UnitSystem* us) {
us
,
UNIT_CONV_ENERGY_PER_UNIT_MASS
);
writeArray
(
h_grp
,
fileName
,
xmfFile
,
"ParticleIDs"
,
ULONGLONG
,
N
,
1
,
parts
,
id
,
us
,
UNIT_CONV_NO_UNITS
);
writeArray
(
h_grp
,
fileName
,
xmfFile
,
"TimeStep"
,
FLOAT
,
N
,
1
,
parts
,
dt
,
us
,
UNIT_CONV_TIME
);
/*
writeArray(h_grp, fileName, xmfFile, "TimeStep", FLOAT, N, 1, parts, dt, us,
*/
/*
UNIT_CONV_TIME);
*/
writeArray
(
h_grp
,
fileName
,
xmfFile
,
"Acceleration"
,
FLOAT
,
N
,
3
,
parts
,
a
,
us
,
UNIT_CONV_ACCELERATION
);
writeArray
(
h_grp
,
fileName
,
xmfFile
,
"Density"
,
FLOAT
,
N
,
1
,
parts
,
rho
,
us
,
...
...
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