Skip to content

Commit

Permalink
remove fopenmp-simd
Browse files Browse the repository at this point in the history
  • Loading branch information
lukeshingles committed Nov 20, 2024
1 parent d5a8d4f commit 6f3fd84
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 23 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ else
ifeq ($(COMPILER_NAME),NVHPC)
CXXFLAGS += -fast
else
CXXFLAGS += -ffast-math -funsafe-math-optimizations -fno-finite-math-only -fopenmp-simd
CXXFLAGS += -ffast-math -funsafe-math-optimizations -fno-finite-math-only
endif
endif
endif
Expand Down
4 changes: 2 additions & 2 deletions atomic.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ inline auto get_nlevels(const int element, const int ion) -> int {
}

// Return the energy of (element,ion,level).
#pragma omp declare simd

[[nodiscard]] inline auto epsilon(const int element, const int ion, const int level) -> double {
assert_testmodeonly(element < get_nelements());
assert_testmodeonly(ion < get_nions(element));
Expand Down Expand Up @@ -120,7 +120,7 @@ inline auto get_nphixstargets(const int element, const int ion, const int level)
}

// Return the statistical weight of (element,ion,level).
#pragma omp declare simd

[[nodiscard]] inline auto stat_weight(const int element, const int ion, const int level) -> double {
assert_testmodeonly(element < get_nelements());
assert_testmodeonly(ion < get_nions(element));
Expand Down
6 changes: 3 additions & 3 deletions ltepop.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
#include <vector>

[[nodiscard]] auto get_groundlevelpop(int nonemptymgi, int element, int ion) -> double;
#pragma omp declare simd

[[nodiscard]] auto calculate_levelpop(int nonemptymgi, int element, int ion, int level) -> double;
#pragma omp declare simd

[[nodiscard]] auto calculate_levelpop_lte(int nonemptymgi, int element, int ion, int level) -> double;
#pragma omp declare simd

[[nodiscard]] auto get_levelpop(int nonemptymgi, int element, int ion, int level) -> double;
[[nodiscard]] auto calculate_sahafact(int element, int ion, int level, int upperionlevel, double T, double E_threshold)
-> double;
Expand Down
14 changes: 7 additions & 7 deletions macroatom.cc
Original file line number Diff line number Diff line change
Expand Up @@ -646,7 +646,7 @@ void macroatom_close_file() {

// radiative deexcitation rate: paperII 3.5.2
// multiply by upper level population to get a rate per second
#pragma omp declare simd

auto rad_deexcitation_ratecoeff(const int nonemptymgi, const int element, const int ion, const int lower,
const double epsilon_trans, const float A_ul, const double upperstatweight,
const double nnlevelupper, const double t_current) -> double {
Expand Down Expand Up @@ -690,7 +690,7 @@ auto rad_deexcitation_ratecoeff(const int nonemptymgi, const int element, const

// radiative excitation rate: paperII 3.5.2
// multiply by lower level population to get a rate per second
#pragma omp declare simd

auto rad_excitation_ratecoeff(const int nonemptymgi, const int element, const int ion, const int lower,
const int uptransindex, const double epsilon_trans, const double nnlevel_lower,
const int lineindex, const double t_current) -> double {
Expand Down Expand Up @@ -732,7 +732,7 @@ auto rad_excitation_ratecoeff(const int nonemptymgi, const int element, const in

// radiative recombination rate: paperII 3.5.2
// multiply by upper level population to get a rate per second
#pragma omp declare simd

auto rad_recombination_ratecoeff(const float T_e, const float nne, const int element, const int upperion,
const int upperionlevel, const int lowerionlevel, const int nonemptymgi) -> double {
// it's probably faster to only check this condition outside this function
Expand Down Expand Up @@ -777,7 +777,7 @@ auto stim_recombination_ratecoeff(const float nne, const int element, const int
}

// multiply by upper level population to get a rate per second
#pragma omp declare simd

auto col_recombination_ratecoeff(const float T_e, const float nne, const int element, const int upperion,
const int upper, const int lower, const double epsilon_trans) -> double {
// it's probably faster to only check this condition outside this function
Expand Down Expand Up @@ -818,7 +818,7 @@ auto col_recombination_ratecoeff(const float T_e, const float nne, const int ele

// collisional ionization rate: paperII 3.5.1
// multiply by lower level population to get a rate per second
#pragma omp declare simd

auto col_ionization_ratecoeff(const float T_e, const float nne, const int element, const int ion, const int lower,
const int phixstargetindex, const double epsilon_trans) -> double {
assert_testmodeonly(phixstargetindex >= 0);
Expand Down Expand Up @@ -850,7 +850,7 @@ auto col_ionization_ratecoeff(const float T_e, const float nne, const int elemen
}

// multiply by upper level population to get a rate per second
#pragma omp declare simd

auto col_deexcitation_ratecoeff(const float T_e, const float nne, const double epsilon_trans, const int element,
const int ion, const int upper, const LevelTransition &downtransition) -> double {
const int lower = downtransition.targetlevelindex;
Expand Down Expand Up @@ -901,7 +901,7 @@ auto col_deexcitation_ratecoeff(const float T_e, const float nne, const double e
}

// multiply by lower level population to get a rate per second
#pragma omp declare simd

auto col_excitation_ratecoeff(const float T_e, const float nne, const int element, const int ion, const int lower,
const int uptransindex, const double epsilon_trans, const double lowerstatweight)
-> double {
Expand Down
12 changes: 4 additions & 8 deletions macroatom.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,33 +9,29 @@ void macroatom_close_file();

void do_macroatom(Packet &pkt, const MacroAtomState &pktmastate);

#pragma omp declare simd
[[nodiscard]] auto rad_deexcitation_ratecoeff(int nonemptymgi, int element, int ion, int lower, double epsilon_trans,
float A_ul, double upperstatweight, double nnlevelupper, double t_current)
-> double;

#pragma omp declare simd
[[nodiscard]] auto rad_excitation_ratecoeff(int nonemptymgi, int element, int ion, int lower, int uptransindex,
double epsilon_trans, double nnlevel_lower, int lineindex, double t_current)
-> double;

#pragma omp declare simd
[[nodiscard]] auto rad_recombination_ratecoeff(float T_e, float nne, int element, int upperion, int upperionlevel,
int lowerionlevel, int nonemptymgi) -> double;
#pragma omp declare simd

[[nodiscard]] auto stim_recombination_ratecoeff(float nne, int element, int upperion, int upper, int lower,
int nonemptymgi) -> double;

#pragma omp declare simd
[[nodiscard]] auto col_recombination_ratecoeff(float T_e, float nne, int element, int upperion, int upper, int lower,
double epsilon_trans) -> double;
#pragma omp declare simd

[[nodiscard]] auto col_ionization_ratecoeff(float T_e, float nne, int element, int ion, int lower, int phixstargetindex,
double epsilon_trans) -> double;
#pragma omp declare simd

[[nodiscard]] auto col_deexcitation_ratecoeff(float T_e, float nne, double epsilon_trans, int element, int ion,
int upper, const LevelTransition &downtransition) -> double;
#pragma omp declare simd

[[nodiscard]] auto col_excitation_ratecoeff(float T_e, float nne, int element, int ion, int lower, int uptransindex,
double epsilon_trans, double lowerstatweight) -> double;

Expand Down
2 changes: 1 addition & 1 deletion nonthermal.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ void solve_spencerfano(int nonemptymgi, int timestep, int iteration);
void calculate_deposition_rate_density(int nonemptymgi, int timestep, HeatingCoolingRates &heatingcoolingrates);
[[nodiscard]] auto get_deposition_rate_density(int nonemptymgi) -> double;
[[nodiscard]] auto get_nt_frac_heating(int modelgridindex) -> float;
#pragma omp declare simd

[[nodiscard]] auto nt_excitation_ratecoeff(int nonemptymgi, int element, int ion, int lowerlevel, int uptransindex,
int lineindex) -> double;
void do_ntalpha_deposit(Packet &pkt);
Expand Down
2 changes: 1 addition & 1 deletion radfield.cc
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ constexpr auto get_bin_nu_lower(const int binindex) -> double {
}

// find the left-closed bin [nu_lower, nu_upper) that nu belongs to
#pragma omp declare simd

constexpr auto select_bin(const double nu) -> int {
if (nu < nu_lower_first_initial) {
return -2; // out of range, nu lower than lowest bin's lower boundary
Expand Down

0 comments on commit 6f3fd84

Please sign in to comment.