Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Start preventing unsupported reionisation flags / options for GPU version #88

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@ option(GDB "Drop into GDB with mpi_debug_here() calls" OFF)
option(ENABLE_PROFILING "Enable profiling of executable with gperftools." OFF)
option(USE_CUDA "Build with CUDA support for reionization calculations" OFF)

# Some build options clash with each other
if(USE_CUDA AND USE_MINI_HALOS)
message(FATAL_ERROR "The GPU reionization implementation does not currently support minihalos physics")
endif()

# Build type
set(default_build_type "RelWithDebInfo")
Expand Down
4 changes: 2 additions & 2 deletions src/core/BrightnessTemperature.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
* highlight the contribution of Pop III stars). By Manu Ventura.
*/

void ComputeBrightnessTemperatureBox(int snapshot) //
//
void ComputeBrightnessTemperatureBox(int snapshot) //
//
{

int ii, jj, kk, i_real, i_padded, iii;
Expand Down
4 changes: 2 additions & 2 deletions src/core/ComputeTs.c
Original file line number Diff line number Diff line change
Expand Up @@ -552,8 +552,8 @@ void _ComputeTs(int snapshot)

Luminosity_converstion_factor_GAL *= (SEC_PER_YEAR) / (PLANCK);

// Do the same for Pop III.
// Do the same for Pop III.

#if USE_MINI_HALOS
if (fabs(run_globals.params.physics.SpecIndexXrayIII - 1.0) < 0.000001) {
Luminosity_converstion_factor_III =
Expand Down
2 changes: 1 addition & 1 deletion src/core/dracarys.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#include "metal_evo.h"
#include "read_grids.h"
#include "stellar_feedback.h"
#include "virial_properties.h"
#include "virial_properties.h"
#endif
#include "save.h"
#include "tree_flags.h"
Expand Down
6 changes: 2 additions & 4 deletions src/core/metal_evo.c
Original file line number Diff line number Diff line change
Expand Up @@ -548,9 +548,7 @@ int map_galaxies_to_slabs_metals(int ngals)
return gal_counter;
}

void assign_probability_to_galaxies(int ngals_in_metal_slabs,
int snapshot,
int flag_property)
void assign_probability_to_galaxies(int ngals_in_metal_slabs, int snapshot, int flag_property)
{
// Same way in which we assing Mcrit due to Reio and LW feedback in reionization.c

Expand Down Expand Up @@ -844,7 +842,7 @@ void assign_probability_to_galaxies(int ngals_in_metal_slabs,

if (flag_property == 2) {
gal->Gas_IGM = (double)buffer_metals[grid_index(ix, iy, iz, MetalGridDim, INDEX_REAL)];
gal->Metallicity_IGM = calc_metallicity(gal->Gas_IGM, gal->Metals_IGM);
gal->Metallicity_IGM = calc_metallicity(gal->Gas_IGM, gal->Metals_IGM);
}

if (flag_property == 3)
Expand Down
3 changes: 1 addition & 2 deletions src/core/read_grids.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,7 @@ double calc_resample_factor(int n_cell[3])
}

#if USE_MINI_HALOS
void smooth_Densitygrid_real(
int snapshot) // Need this to put the overdensity in the metal grid.
void smooth_Densitygrid_real(int snapshot) // Need this to put the overdensity in the metal grid.
{
mlog("Smoothing the overdensity of the reionization grid into the metal grid...", MLOG_MESG);
reion_grids_t* reiogrids = &(run_globals.reion_grids);
Expand Down
20 changes: 10 additions & 10 deletions src/core/read_halos-velociraptor.c
Original file line number Diff line number Diff line change
Expand Up @@ -319,16 +319,16 @@ void read_trees__velociraptor(int snapshot,
// fof_group->Mvir = tree_entry.Mass_FOF;
// fof_group->Rvir = -1;
} else {
if ((tree_entry.Mass_200crit >= tree_entry.Mass_FOF) || (tree_entry.Mass_200crit < tree_entry.Mass_tot)) {
// Adding this since we found an issue in the N-body
fof_group->Mvir = tree_entry.Mass_FOF;
fof_group->Rvir = -1;
}
else {
fof_group->Mvir = tree_entry.Mass_200crit;
fof_group->Rvir = tree_entry.R_200crit;
}
if ((tree_entry.Mass_200crit >= tree_entry.Mass_FOF) || (tree_entry.Mass_200crit < tree_entry.Mass_tot)) {
// Adding this since we found an issue in the N-body
fof_group->Mvir = tree_entry.Mass_FOF;
fof_group->Rvir = -1;
}

else {
fof_group->Mvir = tree_entry.Mass_200crit;
fof_group->Rvir = tree_entry.R_200crit;
}
}
fof_group->Vvir = -1;
fof_group->FOFMvirModifier = 1.0;
Expand Down
2 changes: 1 addition & 1 deletion src/core/reionization.c
Original file line number Diff line number Diff line change
Expand Up @@ -1150,7 +1150,7 @@ int map_galaxies_to_slabs(int ngals)
return gal_counter;
}

void assign_Mvir_crit_to_galaxies(int ngals_in_slabs, int flag_feed)
void assign_Mvir_crit_to_galaxies(int ngals_in_slabs, int flag_feed)
// flag = 1 Reio feedback, flag = 2 LW feedback
{
// N.B. We are assuming here that the galaxy_to_slab mapping has been sorted
Expand Down
13 changes: 5 additions & 8 deletions src/core/stellar_feedback.c
Original file line number Diff line number Diff line change
Expand Up @@ -180,11 +180,10 @@ double get_total_SN_energy(void)
#if USE_MINI_HALOS
// Stuff for Pop. III feedback

double get_SN_energy_PopIII(
int i_burst,
int snapshot,
int SN_type) // SN_type = 0 -> CC, 1 -> PISN
// Pop. III have higher masses so we need to account also for PISN!
double get_SN_energy_PopIII(int i_burst,
int snapshot,
int SN_type) // SN_type = 0 -> CC, 1 -> PISN
// Pop. III have higher masses so we need to account also for PISN!
{
double NumberPISN = run_globals.NumberPISN;
double NumberSNII = run_globals.NumberSNII;
Expand All @@ -193,9 +192,7 @@ double get_SN_energy_PopIII(
if (SN_type == 0) {
Enova = ENOVA_CC;
double CC_Fraction = CCSN_PopIII_Fraction(i_burst, snapshot, 0);
return Enova * CC_Fraction * NumberSNII * 1e10 /
run_globals.params
.Hubble_h; // result in erg * (1e10 Msol / h)
return Enova * CC_Fraction * NumberSNII * 1e10 / run_globals.params.Hubble_h; // result in erg * (1e10 Msol / h)
}
// PISN (feedback here is contemporaneous).
else if (SN_type == 1) {
Expand Down