Skip to content
Snippets Groups Projects
Commit 8f405148 authored by Chichi Lalescu's avatar Chichi Lalescu
Browse files

use __restrict__ keyword for arrays

I think it helps...
parent 3693ed36
No related branches found
No related tags found
No related merge requests found
......@@ -83,19 +83,19 @@ class fluid_solver:public fluid_solver_base<rnumber>
~fluid_solver(void);
void compute_gradient_statistics(
rnumber (*vec)[2],
double *moments,
ptrdiff_t *histograms_1D,
ptrdiff_t *histogram_QR2D,
rnumber (*__restrict__ vec)[2],
double *__restrict__ moments,
ptrdiff_t *__restrict__ histograms_1D,
ptrdiff_t *__restrict__ histogram_QR2D,
double max_estimates[3],
int nbins_1D = 256,
int nbins_2D = 64);
void compute_vorticity(void);
void compute_velocity(rnumber (*vorticity)[2]);
void compute_pressure(rnumber (*pressure)[2]);
void compute_Eulerian_acceleration(rnumber *dst);
void compute_Lagrangian_acceleration(rnumber *dst);
void compute_velocity(rnumber (*__restrict__ vorticity)[2]);
void compute_pressure(rnumber (*__restrict__ pressure)[2]);
void compute_Eulerian_acceleration(rnumber *__restrict__ dst);
void compute_Lagrangian_acceleration(rnumber *__restrict__ dst);
void ift_velocity();
void dft_velocity();
void ift_vorticity();
......@@ -103,7 +103,7 @@ class fluid_solver:public fluid_solver_base<rnumber>
void omega_nonlin(int src);
void step(double dt);
void impose_zero_modes(void);
void add_forcing(rnumber (*acc_field)[2], rnumber (*vort_field)[2], rnumber factor);
void add_forcing(rnumber (*__restrict__ acc_field)[2], rnumber (*__restrict__ vort_field)[2], rnumber factor);
int read(char field, char representation);
int write(char field, char representation);
......
......@@ -82,20 +82,20 @@ class fluid_solver_base
unsigned FFTW_PLAN_RIGOR = FFTW_ESTIMATE);
~fluid_solver_base();
void low_pass_Fourier(cnumber *a, int howmany, double kmax);
void dealias(cnumber *a, int howmany);
void force_divfree(cnumber *a);
void symmetrize(cnumber *a, int howmany);
void clean_up_real_space(rnumber *a, int howmany);
void cospectrum(cnumber *a, cnumber *b, double *spec);
void cospectrum(cnumber *a, cnumber *b, double *spec, const double k2exponent);
double autocorrel(cnumber *a);
void compute_rspace_stats(rnumber *a,
double *moments,
ptrdiff_t *hist,
void low_pass_Fourier(cnumber *__restrict__ a, int howmany, double kmax);
void dealias(cnumber *__restrict__ a, int howmany);
void force_divfree(cnumber *__restrict__ a);
void symmetrize(cnumber *__restrict__ a, int howmany);
void clean_up_real_space(rnumber *__restrict__ a, int howmany);
void cospectrum(cnumber *__restrict__ a, cnumber *__restrict__ b, double *__restrict__ spec);
void cospectrum(cnumber *__restrict__ a, cnumber *__restrict__ b, double *__restrict__ spec, const double k2exponent);
double autocorrel(cnumber *__restrict__ a);
void compute_rspace_stats(rnumber *__restrict__ a,
double *__restrict__ moments,
ptrdiff_t *__restrict__ hist,
double max_estimate[4],
int nbins = 256);
void compute_vector_gradient(rnumber (*A)[2], rnumber(*source)[2]);
void compute_vector_gradient(rnumber (*__restrict__ A)[2], rnumber(*__restrict__ source)[2]);
void write_spectrum(const char *fname, cnumber *a, const double k2exponent = 0.0);
void fill_up_filename(const char *base_name, char *full_name);
int read_base(const char *fname, rnumber *data);
......
......@@ -11,11 +11,11 @@ commands =
cp -r {toxinidir}/tests {envtmpdir}
#python tests/test_plain.py -n 256 --run --initialize --ncpu 8 --niter_todo 8 --precision single --wd "data/single"
python tests/test_plain.py \
-n 64 --run --initialize --ncpu 4 \
--nparticles 1000 --niter_todo 96 \
-n 128 --run --initialize --ncpu 4 \
--nparticles 0 --niter_todo 24 \
--precision single --wd "data/single" \
--kMeta 3.0 #\
#--multiplejob
--kMeta 3.0 \
--multiplejob
#python tests/test_plain.py -n 32 --run --initialize --multiplejob --ncpu 2 --nparticles 16 --niter_todo 64 --precision single --wd "data/single"
#python tests/test_plain.py -n 32 --run --initialize --multiplejob --ncpu 2 --nparticles 16 --niter_todo 64 --precision double --wd "data/double"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment