From 9b6c2c6622b56d3dc43bcfde50f1c40cc8c99d56 Mon Sep 17 00:00:00 2001 From: Matthieu Schaller <schaller@strw.leidenuniv.nl> Date: Mon, 14 Jan 2019 16:32:05 +0800 Subject: [PATCH] Removed support for the defunct option to run VELOCIraptor every fixed number of steps rather than at a fixed time. --- .../VELOCIraptorInterface/stfwithswift.rst | 20 +++++++++-------- examples/DwarfGalaxy/dwarf_galaxy.yml | 2 -- examples/EAGLE_25/eagle_25.yml | 2 -- examples/EAGLE_6/eagle_6.yml | 2 -- .../small_cosmo_volume_dm.yml | 1 - .../small_cosmo_volume.yml | 1 - examples/parameter_example.yml | 22 +++++++++---------- src/velociraptor_interface.c | 11 ++-------- src/velociraptor_interface.h | 8 ------- 9 files changed, 23 insertions(+), 46 deletions(-) diff --git a/doc/RTD/source/VELOCIraptorInterface/stfwithswift.rst b/doc/RTD/source/VELOCIraptorInterface/stfwithswift.rst index a663c37f93..ed261b76ab 100644 --- a/doc/RTD/source/VELOCIraptorInterface/stfwithswift.rst +++ b/doc/RTD/source/VELOCIraptorInterface/stfwithswift.rst @@ -50,8 +50,10 @@ HDF5 library, not a parallel build. Compiling SWIFT --------------- The next part is compiling SWIFT with VELOCIraptor and assumes you already -downloaded SWIFT from the GitLab_, this can be done by running:: +downloaded SWIFT from the GitLab_, this can be done by running +.. code:: bash + ./autogen.sh ./configure --with-velociraptor=/path/to/VELOCIraptor-STF/src make @@ -60,16 +62,16 @@ In which ``./autogen.sh`` only needs to be run once after the code is cloned from the GitLab_, and ``/path/to/`` is the path to the ``VELOCIraptor-STF`` directory on your machine. In general ``./configure`` can be run with other options as desired. After this we can run SWIFT with VELOCIraptor, but for this -we first need to add several lines to the yaml file of our simulation:: +we first need to add several lines to the yaml file of our simulation - #structure finding options - StructureFinding: - config_file_name: stf_input_6dfof_dmonly_sub.cfg - basename: ./stf - output_time_format: 1 - scale_factor_first: 0.02 - delta_time: 1.02 +.. code:: YAML + + StructureFinding: + config_file_name: stf_input_6dfof_dmonly_sub.cfg + basename: ./stf + scale_factor_first: 0.02 + delta_time: 1.02 In which we specify the ``.cfg`` file that is used by VELOCIraptor and the other parameters which SWIFT needs to use. In the case of diff --git a/examples/DwarfGalaxy/dwarf_galaxy.yml b/examples/DwarfGalaxy/dwarf_galaxy.yml index 0d815a99c4..4c5e2a82b0 100644 --- a/examples/DwarfGalaxy/dwarf_galaxy.yml +++ b/examples/DwarfGalaxy/dwarf_galaxy.yml @@ -10,10 +10,8 @@ InternalUnitSystem: StructureFinding: config_file_name: stf_input.cfg # Name of the STF config file. basename: ./stf # Common part of the name of output files. - output_time_format: 0 # Specifies the frequency format of structure finding. 0 for simulation steps (delta_step) and 1 for simulation time intervals (delta_time). scale_factor_first: 0.92 # Scale-factor of the first snaphot (cosmological run) time_first: 0.01 # Time of the first structure finding output (in internal units). - delta_step: 1000 # Time difference between consecutive structure finding outputs (in internal units) in simulation steps. delta_time: 1.10 # Time difference between consecutive structure finding outputs (in internal units) in simulation time intervals. # Cosmological parameters diff --git a/examples/EAGLE_25/eagle_25.yml b/examples/EAGLE_25/eagle_25.yml index 0aec970db4..cab0dbcd5e 100644 --- a/examples/EAGLE_25/eagle_25.yml +++ b/examples/EAGLE_25/eagle_25.yml @@ -10,10 +10,8 @@ InternalUnitSystem: StructureFinding: config_file_name: stf_input.cfg # Name of the STF config file. basename: ./stf # Common part of the name of output files. - output_time_format: 0 # Specifies the frequency format of structure finding. 0 for simulation steps (delta_step) and 1 for simulation time intervals (delta_time). scale_factor_first: 0.92 # Scale-factor of the first snaphot (cosmological run) time_first: 0.01 # Time of the first structure finding output (in internal units). - delta_step: 1000 # Time difference between consecutive structure finding outputs (in internal units) in simulation steps. delta_time: 1.10 # Time difference between consecutive structure finding outputs (in internal units) in simulation time intervals. # Cosmological parameters diff --git a/examples/EAGLE_6/eagle_6.yml b/examples/EAGLE_6/eagle_6.yml index 7c64c1cded..e80fac8167 100644 --- a/examples/EAGLE_6/eagle_6.yml +++ b/examples/EAGLE_6/eagle_6.yml @@ -10,10 +10,8 @@ InternalUnitSystem: StructureFinding: config_file_name: stf_input.cfg # Name of the STF config file. basename: ./stf # Common part of the name of output files. - output_time_format: 0 # Specifies the frequency format of structure finding. 0 for simulation steps (delta_step) and 1 for simulation time intervals (delta_time). scale_factor_first: 0.92 # Scale-factor of the first snaphot (cosmological run) time_first: 0.01 # Time of the first structure finding output (in internal units). - delta_step: 1000 # Time difference between consecutive structure finding outputs (in internal units) in simulation steps. delta_time: 1.10 # Time difference between consecutive structure finding outputs (in internal units) in simulation time intervals. # Cosmological parameters diff --git a/examples/SmallCosmoVolume_DM/small_cosmo_volume_dm.yml b/examples/SmallCosmoVolume_DM/small_cosmo_volume_dm.yml index 910137edc4..ebe3a78ee0 100644 --- a/examples/SmallCosmoVolume_DM/small_cosmo_volume_dm.yml +++ b/examples/SmallCosmoVolume_DM/small_cosmo_volume_dm.yml @@ -10,7 +10,6 @@ InternalUnitSystem: StructureFinding: config_file_name: stf_input_6dfof_dmonly_sub.cfg basename: ./stf - output_time_format: 1 scale_factor_first: 0.02 delta_time: 1.02 diff --git a/examples/SmallCosmoVolume_VELOCIraptor/small_cosmo_volume.yml b/examples/SmallCosmoVolume_VELOCIraptor/small_cosmo_volume.yml index c8157a7a0e..39425f3085 100644 --- a/examples/SmallCosmoVolume_VELOCIraptor/small_cosmo_volume.yml +++ b/examples/SmallCosmoVolume_VELOCIraptor/small_cosmo_volume.yml @@ -61,7 +61,6 @@ InitialConditions: StructureFinding: config_file_name: stfconfig_input.cfg basename: ./stf - output_time_format: 1 scale_factor_first: 0.02 delta_time: 1.02 diff --git a/examples/parameter_example.yml b/examples/parameter_example.yml index 9fdfc993c3..49fa279b64 100644 --- a/examples/parameter_example.yml +++ b/examples/parameter_example.yml @@ -156,6 +156,16 @@ DomainDecomposition: itr: 100 # When adaptive defines the ratio of inter node communication time to data redistribution time, in the range 0.00001 to 10000000.0. # Lower values give less data movement during redistributions, at the cost of global balance which may require more communication. +# Structure finding options (requires velociraptor) +StructureFinding: + config_file_name: stf_input.cfg # Name of the STF config file. + basename: ./stf # Common part of the name of output files. + scale_factor_first: 0.92 # Scale-factor of the first snaphot (cosmological run) + time_first: 0.01 # Time of the first structure finding output (in internal units). + delta_time: 1.10 # Time difference between consecutive structure finding outputs (in internal units) in simulation time intervals. + output_list_on: 0 # (Optional) Enable the output list + output_list: stflist.txt # (Optional) File containing the output times (see documentation in "Parameter File" section) + # Parameters related to the equation of state ------------------------------------------ EoS: @@ -286,15 +296,3 @@ EAGLEChemistry: init_abundance_Magnesium: 0.000 # Inital fraction of particle mass in Magnesium init_abundance_Silicon: 0.000 # Inital fraction of particle mass in Silicon init_abundance_Iron: 0.000 # Inital fraction of particle mass in Iron - -# Structure finding options (requires velociraptor) -StructureFinding: - config_file_name: stf_input.cfg # Name of the STF config file. - basename: ./stf # Common part of the name of output files. - output_time_format: 0 # Specifies the frequency format of structure finding. 0 for simulation steps (delta_step) and 1 for simulation time intervals (delta_time). - scale_factor_first: 0.92 # Scale-factor of the first snaphot (cosmological run) - time_first: 0.01 # Time of the first structure finding output (in internal units). - delta_step: 1000 # Time difference between consecutive structure finding outputs (in internal units) in simulation steps. - delta_time: 1.10 # Time difference between consecutive structure finding outputs (in internal units) in simulation time intervals. - output_list_on: 0 # (Optional) Enable the output list - output_list: stflist.txt # (Optional) File containing the output times (see documentation in "Parameter File" section) diff --git a/src/velociraptor_interface.c b/src/velociraptor_interface.c index f60a18d866..ccf1e95352 100644 --- a/src/velociraptor_interface.c +++ b/src/velociraptor_interface.c @@ -264,7 +264,6 @@ void velociraptor_invoke(struct engine *e) { const int nr_cells = s->nr_cells; int *cell_node_ids = NULL; static int stf_output_count = 0; - int active_stf_output_count; /* Allow thread to run on any core for the duration of the call to * VELOCIraptor so that @@ -294,15 +293,9 @@ void velociraptor_invoke(struct engine *e) { /* Append base name with either the step number or time depending on what * format is specified in the parameter file. */ char outputFileName[PARSER_MAX_LINE_SIZE + 128]; - if (e->stf_output_freq_format == io_stf_steps) - active_stf_output_count = e->step; - else if (e->stf_output_freq_format == io_stf_time) - active_stf_output_count = stf_output_count; - else - active_stf_output_count = 0; snprintf(outputFileName, PARSER_MAX_LINE_SIZE + 128, "%s_%04i.VELOCIraptor", - e->stfBaseName, active_stf_output_count); + e->stfBaseName, stf_output_count); /* Allocate and populate an array of swift_vel_parts to be passed to * VELOCIraptor. */ @@ -350,7 +343,7 @@ void velociraptor_invoke(struct engine *e) { } /* Call VELOCIraptor. */ - if (!InvokeVelociraptor(nr_gparts, nr_hydro_parts, active_stf_output_count, + if (!InvokeVelociraptor(nr_gparts, nr_hydro_parts, stf_output_count, swift_parts, cell_node_ids, outputFileName)) error("Exiting. Call to VELOCIraptor failed on rank: %d.", e->nodeID); diff --git a/src/velociraptor_interface.h b/src/velociraptor_interface.h index 1f29be11c9..67ca9153d3 100644 --- a/src/velociraptor_interface.h +++ b/src/velociraptor_interface.h @@ -22,14 +22,6 @@ /* Config parameters. */ #include "../config.h" -/** - * @brief The different formats for when to run structure finding. - */ -enum io_stf_output_format { - io_stf_steps = 0, /*!< Output every N steps */ - io_stf_time /*!< Output at fixed time intervals */ -}; - /* Forward declaration */ struct engine; -- GitLab