Skip to content
Snippets Groups Projects
Commit 91ad1701 authored by Pascal Jahan Elahi's avatar Pascal Jahan Elahi
Browse files

Update to consistent API for velociraptor, bug fixes

parent a7e15839
No related branches found
No related tags found
2 merge requests!721Velociraptor outputs,!719Velociraptor output strategy
......@@ -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. */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment