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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SWIFT
SWIFTsim
Commits
1776ca03
Commit
1776ca03
authored
6 years ago
by
Matthieu Schaller
Browse files
Options
Downloads
Patches
Plain Diff
Some fixes to the new test
parent
d668907b
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!520
Select io
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
.gitignore
+1
-0
1 addition, 0 deletions
.gitignore
src/common_io.c
+4
-2
4 additions, 2 deletions
src/common_io.c
tests/testSelectOutput.c
+9
-4
9 additions, 4 deletions
tests/testSelectOutput.c
with
14 additions
and
6 deletions
.gitignore
+
1
−
0
View file @
1776ca03
...
...
@@ -80,6 +80,7 @@ tests/test_nonsym_force_1_vec.dat
tests/test_nonsym_force_2_vec.dat
tests/potential.dat
tests/testGreetings
tests/testSelectOutput
tests/testReading
tests/testSingle
tests/testTimeIntegration
...
...
This diff is collapsed.
Click to expand it.
src/common_io.c
+
4
−
2
View file @
1776ca03
...
...
@@ -890,8 +890,10 @@ void io_check_output_fields(const struct swift_params* params,
/* Check that we have a 0 or 1 */
if
(
retParam
!=
0
&&
retParam
!=
1
)
error
(
"Unexpected input for %s. Received %i but expect 0 or 1. "
,
field_name
,
retParam
);
message
(
"WARNING: Unexpected input for %s. Received %i but expect 0 or "
"1. "
,
field_name
,
retParam
);
/* Found it, so move to the next one. */
break
;
...
...
This diff is collapsed.
Click to expand it.
tests/testSelectOutput.c
+
9
−
4
View file @
1776ca03
...
...
@@ -42,8 +42,9 @@ void select_output_engine_init(struct engine *e, struct space *s,
/* set parameters */
e
->
verbose
=
1
;
e
->
time
=
0
;
e
->
snapshotOutputCount
=
0
;
e
->
snapshotCompression
=
0
;
e
->
snapshot_output_count
=
0
;
e
->
snapshot_compression
=
0
;
e
->
snapshot_label_delta
=
1
;
};
void
select_output_space_init
(
struct
space
*
s
,
double
*
dim
,
int
periodic
,
...
...
@@ -77,7 +78,11 @@ void select_output_engine_clean(struct engine *e) {
threadpool_clean
(
&
e
->
threadpool
);
}
int
main
()
{
int
main
(
int
argc
,
char
*
argv
[])
{
/* Initialize CPU frequency, this also starts time. */
unsigned
long
long
cpufreq
=
0
;
clocks_set_cpufreq
(
cpufreq
);
char
*
base_name
=
"testSelectOutput"
;
size_t
Ngas
=
0
,
Ngpart
=
0
,
Nspart
=
0
;
...
...
@@ -139,7 +144,7 @@ int main() {
/* check output selection */
message
(
"Checking output parameters."
);
long
long
N_total
[
swift_type_count
]
=
{
Ngas
,
Ngpart
,
0
,
0
,
Nspart
,
0
};
io_check_output_fields
(
&
param_file
,
&
e
,
N_total
);
io_check_output_fields
(
&
param_file
,
N_total
);
/* write output file */
message
(
"Writing output."
);
...
...
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
register
or
sign in
to comment