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
91ad1701
Commit
91ad1701
authored
6 years ago
by
Pascal Jahan Elahi
Browse files
Options
Downloads
Patches
Plain Diff
Update to consistent API for velociraptor, bug fixes
parent
a7e15839
No related branches found
No related tags found
2 merge requests
!721
Velociraptor outputs
,
!719
Velociraptor output strategy
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/velociraptor_interface.c
+27
-7
27 additions, 7 deletions
src/velociraptor_interface.c
with
27 additions
and
7 deletions
src/velociraptor_interface.c
+
27
−
7
View file @
91ad1701
...
...
@@ -112,7 +112,15 @@ struct siminfo {
/*! Inverse of the top-level cell width. */
double
icellwidth
[
3
];
/*! Holds the node ID of each top-level cell. */
int
*
cellnodeids
;
/// whether run is cosmological simulation
int
icosmologicalsim
;
/// running a zoom simulation
int
izoomsim
;
/// flags indicating what types of particles are present
int
idarkmatter
,
igas
,
istar
,
ibh
,
iother
;
};
/* Structure for group information back to swift */
...
...
@@ -125,9 +133,10 @@ int InitVelociraptor(char *config_name, struct unitinfo unit_info,
struct
siminfo
sim_info
,
const
int
numthreads
);
struct
groupinfo
*
InvokeVelociraptor
(
const
int
snapnum
,
char
*
output_name
,
struct
cosmoinfo
cosmo_info
,
struct
siminfo
sim_info
,
const
size_t
num_gravity_parts
,
const
size_t
num_hydro_parts
,
struct
swift_vel_part
*
swift_parts
,
const
int
snapnum
,
char
*
output_name
,
struct
cosmoinfo
cosmo_info
,
struct
siminfo
sim_info
,
const
size_t
num_gravity_parts
,
const
size_t
num_hydro_parts
,
struct
swift_vel_part
*
swift_parts
,
const
int
*
cell_node_ids
,
const
int
numthreads
,
const
int
return_group_flags
,
int
*
num_in_groups
);
...
...
@@ -178,6 +187,13 @@ void velociraptor_init(struct engine *e) {
}
else
{
sim_info
.
icosmologicalsim
=
0
;
}
sim_info
.
idarkmatter
=
(
e
->
total_nr_gparts
>
0
);
sim_info
.
igas
=
(
e
->
total_nr_parts
>
0
);
sim_info
.
istar
=
(
e
->
policy
&
engine_policy_stars
);
///\todo for black holes
//sim_info.ibh = (e->policy&engine_policy_bh);
sim_info
.
ibh
=
0
;
/* Be nice, talk! */
if
(
e
->
verbose
)
{
...
...
@@ -421,12 +437,15 @@ void velociraptor_invoke(struct engine *e, const int linked_with_snap) {
/* Call VELOCIraptor. */
group_info
=
(
struct
groupinfo
*
)
InvokeVelociraptor
(
snapnum
,
outputFileName
,
cosmo_info
,
sim_info
,
nr_gparts
,
nr_hydro_parts
,
swift_parts
,
cell_node_ids
,
e
->
nr_threads
,
linked_with_snap
,
snapnum
,
outputFileName
,
cosmo_info
,
sim_info
,
nr_gparts
,
nr_hydro_parts
,
swift_parts
,
cell_node_ids
,
e
->
nr_threads
,
linked_with_snap
,
&
num_gparts_in_groups
);
/* Check that the ouput is valid */
if
(
linked_with_snap
&&
group_info
==
NULL
)
{
if
(
linked_with_snap
&&
group_info
==
NULL
&&
num_gparts_in_groups
<
0
)
{
error
(
"Exiting. Call to VELOCIraptor failed on rank: %d."
,
e
->
nodeID
);
}
if
(
!
linked_with_snap
&&
group_info
!=
NULL
)
{
...
...
@@ -446,8 +465,9 @@ void velociraptor_invoke(struct engine *e, const int linked_with_snap) {
}
/* Free everything we allocated */
///\todo move to vr side
free
(
cell_node_ids
);
free
(
swift_parts
);
//
free(swift_parts);
free
(
sim_info
.
cell_loc
);
/* Reset the pthread affinity mask after VELOCIraptor returns. */
...
...
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