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
21dc19cd
Commit
21dc19cd
authored
7 years ago
by
James Willis
Browse files
Options
Downloads
Patches
Plain Diff
Fixes for GCC errors.
parent
de06a276
No related branches found
No related tags found
1 merge request
!578
Swift velociraptor
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/velociraptor_interface.c
+9
-9
9 additions, 9 deletions
src/velociraptor_interface.c
with
9 additions
and
9 deletions
src/velociraptor_interface.c
+
9
−
9
View file @
21dc19cd
...
...
@@ -131,9 +131,9 @@ void velociraptor_init(struct engine *e) {
sim_info
.
cellloc
=
e
->
cellloc
;
char
configfilename
[
PARSER_MAX_LINE_SIZE
],
outputFileName
[
FILENAME_BUFFER_SIZE
];
char
configfilename
[
PARSER_MAX_LINE_SIZE
],
outputFileName
[
PARSER_MAX_LINE_SIZE
+
128
];
parser_get_param_string
(
e
->
parameter_file
,
"StructureFinding:config_file_name"
,
configfilename
);
snprintf
(
outputFileName
,
FILENAME_BUFFER_SIZE
,
"%s.VELOCIraptor"
,
e
->
stfBaseName
);
snprintf
(
outputFileName
,
PARSER_MAX_LINE_SIZE
+
128
,
"%s.VELOCIraptor"
,
e
->
stfBaseName
);
message
(
"Config file name: %s"
,
configfilename
);
message
(
"Period: %e"
,
sim_info
.
period
);
...
...
@@ -163,7 +163,7 @@ void velociraptor_invoke(struct engine *e) {
const
size_t
nr_gparts
=
s
->
nr_gparts
;
const
size_t
nr_hydro_parts
=
s
->
nr_parts
;
const
int
nr_cells
=
s
->
nr_cells
;
int
*
cell_node_ids
;
int
*
cell_node_ids
=
NULL
;
struct
unitinfo
*
conv_fac
=
e
->
stf_conv_fac
;
/* Allow thread to run on any core for the duration of the call to VELOCIraptor so that
...
...
@@ -188,21 +188,21 @@ void velociraptor_invoke(struct engine *e) {
for
(
int
i
=
0
;
i
<
nr_cells
;
i
++
)
cell_node_ids
[
i
]
=
s
->
cells_top
[
i
].
nodeID
;
message
(
"MPI rank %d sending %
lld
gparts to VELOCIraptor."
,
e
->
nodeID
,
nr_gparts
);
message
(
"MPI rank %d sending %
zu
gparts to VELOCIraptor."
,
e
ngine_rank
,
nr_gparts
);
/* Append base name with either the step number or time depending on what format is specified in the parameter file. */
char
outputFileName
[
FILENAME_BUFFER_SIZE
];
char
outputFileName
[
PARSER_MAX_LINE_SIZE
+
128
];
if
(
e
->
stf_output_freq_format
==
IO_STF_OUTPUT_FREQ_FORMAT_STEPS
)
{
snprintf
(
outputFileName
,
FILENAME_BUFFER_SIZE
,
"%s_%04i.VELOCIraptor"
,
e
->
stfBaseName
,
snprintf
(
outputFileName
,
PARSER_MAX_LINE_SIZE
+
128
,
"%s_%04i.VELOCIraptor"
,
e
->
stfBaseName
,
e
->
step
);
}
else
if
(
e
->
stf_output_freq_format
==
IO_STF_OUTPUT_FREQ_FORMAT_TIME
)
{
snprintf
(
outputFileName
,
FILENAME_BUFFER_SIZE
,
"%s_%04e.VELOCIraptor"
,
e
->
stfBaseName
,
snprintf
(
outputFileName
,
PARSER_MAX_LINE_SIZE
+
128
,
"%s_%04e.VELOCIraptor"
,
e
->
stfBaseName
,
e
->
time
);
}
/* Allocate and populate an array of swift_vel_parts to be passed to VELOCIraptor. */
struct
swift_vel_part
*
swift_parts
;
struct
swift_vel_part
*
swift_parts
=
NULL
;
if
(
posix_memalign
((
void
**
)
&
swift_parts
,
part_align
,
nr_gparts
*
sizeof
(
struct
swift_vel_part
))
!=
0
)
...
...
@@ -217,7 +217,7 @@ void velociraptor_invoke(struct engine *e) {
message
(
"a^2: %f"
,
a2
);
/* Convert particle properties into VELOCIraptor units */
for
(
in
t
i
=
0
;
i
<
nr_gparts
;
i
++
)
{
for
(
size_
t
i
=
0
;
i
<
nr_gparts
;
i
++
)
{
swift_parts
[
i
].
x
[
0
]
=
gparts
[
i
].
x
[
0
]
*
conv_fac
->
lengthtokpc
;
swift_parts
[
i
].
x
[
1
]
=
gparts
[
i
].
x
[
1
]
*
conv_fac
->
lengthtokpc
;
swift_parts
[
i
].
x
[
2
]
=
gparts
[
i
].
x
[
2
]
*
conv_fac
->
lengthtokpc
;
...
...
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