Skip to content
Snippets Groups Projects
Commit 512e138f authored by Peter W. Draper's avatar Peter W. Draper
Browse files

Move velociraptor dummy functions into main file.

Is protected by HAVE_DUMMY_VELOCIRAPTOR macro so no issues doing this which makes things cleaner as we don't need to expose the local structs to the dummy file which is needed when doing ipo builds
parent 25063f67
Branches
Tags
2 merge requests!1887Updating . . .,!1878updating working branch
......@@ -176,7 +176,7 @@ AM_SOURCES += statistics.c profiler.c csds.c part_type.c
AM_SOURCES += gravity_properties.c gravity.c multipole.c
AM_SOURCES += collectgroup.c hydro_space.c equation_of_state.c io_compression.c
AM_SOURCES += chemistry.c cosmology.c velociraptor_interface.c
AM_SOURCES += output_list.c velociraptor_dummy.c csds_io.c memuse.c mpiuse.c memuse_rnodes.c
AM_SOURCES += output_list.c csds_io.c memuse.c mpiuse.c memuse_rnodes.c
AM_SOURCES += fof.c fof_catalogue_io.c
AM_SOURCES += hashmap.c
AM_SOURCES += mesh_gravity.c mesh_gravity_mpi.c mesh_gravity_patch.c mesh_gravity_sort.c
......
/*******************************************************************************
* This file is part of SWIFT.
* Copyright (c) 2018 James Willis (james.s.willis@durham.ac.uk)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published
* by the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
******************************************************************************/
/* Config parameters. */
#include <config.h>
/* Local includes. */
#include "error.h"
#include "swift_velociraptor_part.h"
#include "velociraptor_interface.h"
/* Dummy VELOCIraptor interface for testing compilation without linking the
* actual VELOCIraptor library. */
#ifdef HAVE_DUMMY_VELOCIRAPTOR
struct cosmoinfo {};
struct unitinfo {};
struct cell_loc {};
struct siminfo {};
/*
int InitVelociraptor(char *config_name, char *output_name,
struct cosmoinfo cosmo_info, struct unitinfo unit_info,
struct siminfo sim_info, const int numthreads) {
error("This is only a dummy. Call the real one!");
return 0;
}
int InvokeVelociraptor(const size_t num_gravity_parts,
const size_t num_hydro_parts, const int snapnum,
struct swift_vel_part *swift_parts,
const int *cell_node_ids, char *output_name,
const int numthreads) {
error("This is only a dummy. Call the real one!");
return 0;
}
*/
int InitVelociraptor(char *config_name, struct unitinfo unit_info,
struct siminfo sim_info, const int numthreads) {
error("This is only a dummy. Call the real one!");
return 0;
}
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, const size_t num_star_parts,
struct swift_vel_part *swift_parts, const int *cell_node_ids,
const int numthreads, const int return_group_flags,
int *const num_in_groups) {
error("This is only a dummy. Call the real one!");
return 0;
}
#endif /* HAVE_DUMMY_VELOCIRAPTOR */
......@@ -1106,3 +1106,28 @@ void velociraptor_invoke(struct engine *e, const int linked_with_snap) {
error("SWIFT not configured to run with VELOCIraptor.");
#endif /* HAVE_VELOCIRAPTOR */
}
/* Dummy VELOCIraptor interface for testing compilation without linking the
* actual VELOCIraptor library. Uses --enable-dummy-velociraptor configure
* option. */
#ifdef HAVE_DUMMY_VELOCIRAPTOR
int InitVelociraptor(char *config_name, struct unitinfo unit_info,
struct siminfo sim_info, const int numthreads) {
error("This is only a dummy. Call the real one!");
return 0;
}
struct vr_return_data 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, const size_t num_star_parts,
struct swift_vel_part *swift_parts, const int *cell_node_ids,
const int numthreads, const int return_group_flags,
const int return_most_bound) {
error("This is only a dummy. Call the real one!");
struct vr_return_data data = {0};
return data;
}
#endif /* HAVE_DUMMY_VELOCIRAPTOR */
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment