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

Fenix new #225

Open
wants to merge 14 commits into
base: main
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
5 changes: 2 additions & 3 deletions FENIX/AMR/Makefile
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
include ../../common/FENIX.defs
COMOBJS += random_draw.o get_BG_data.o
COMOBJS += random_draw.o
COMOBJS += timestep.o

##### User configurable options #####
#uncomment any of the following flags (and change values) to change defaults

#OPTFLAGS = $(DEFAULT_OPT_FLAGS)
OPTFLAGS = -std=c99 -O3
OPTFLAGS = $(DEFAULT_OPT_FLAGS)
#description: change above into something that is a decent optimization on you system

USERFLAGS =
Expand Down
52 changes: 0 additions & 52 deletions FENIX/AMR/amr.c
Original file line number Diff line number Diff line change
Expand Up @@ -173,58 +173,6 @@ void time_step(int Num_procs,
MPI_Comm comm_bg,
int first_through);

/* before interpolating from the background grid, we need to gather that BG data
from wherever it resides and copy it to the right locations of the refinement */
void get_BG_data(int load_balance, DTYPE *in_bg, DTYPE *ing_r, int my_ID, long expand,
int Num_procs, long L_width_bg,
long L_istart_bg, long L_iend_bg, long L_jstart_bg, long L_jend_bg,
long L_istart_r, long L_iend_r, long L_jstart_r, long L_jend_r,
long G_istart_r, long G_jstart_r, MPI_Comm comm_bg, MPI_Comm comm_r,
long L_istart_r_gross, long L_iend_r_gross,
long L_jstart_r_gross, long L_jend_r_gross,
long L_width_r_true_gross, long L_istart_r_true_gross, long L_iend_r_true_gross,
long L_jstart_r_true_gross, long L_jend_r_true_gross, int g);

/* use two-stage, bi-linear interpolation of BG values to refinement. BG values
have already been copied to the refinement */
void interpolate(DTYPE *ing_r, long L_width_r_true_gross,
long L_istart_r_true_gross, long L_iend_r_true_gross,
long L_jstart_r_true_gross, long L_jend_r_true_gross,
long L_istart_r_true, long L_iend_r_true,
long L_jstart_r_true, long L_jend_r_true,
long expand, DTYPE h_r, int g, int Num_procs, int my_ID) {

long ir, jr, ib, jrb, jrb1, jb;
DTYPE xr, xb, yr, yb;

if (expand==1) return; /* nothing to do anymore */

/* First, interpolate in x-direction */
for (jr=L_jstart_r_true_gross; jr<=L_jend_r_true_gross; jr+=expand) {
for (ir=L_istart_r_true_gross; ir<L_iend_r_true_gross; ir++) {
xr = h_r*(DTYPE)ir;
ib = (long)xr;
xb = (DTYPE)ib;
ING_R(ir,jr) = ING_R((ib+1)*expand,jr)*(xr-xb) +
ING_R(ib*expand,jr)*(xb+(DTYPE)1.0-xr);
}
}

/* Next, interpolate in y-direction */
for (jr=L_jstart_r_true; jr<=L_jend_r_true; jr++) {
yr = h_r*(DTYPE)jr;
jb = (long)yr;
jrb = jb*expand;
jrb1 = (jb+1)*expand;
yb = (DTYPE)jb;
for (ir=L_istart_r_true; ir<=L_iend_r_true; ir++) {
ING_R(ir,jr) = ING_R(ir,jrb1)*(yr-yb) + ING_R(ir,jrb)*(yb+(DTYPE)1.0-yr);
}
/* note that (yr-yb) and (yb+(DTYPE)1.0-yr) can be hoisted out of the loop,
so in the performance computation we assign 3 flops per point */
}
}

int main(int argc, char ** argv) {

int Num_procs; /* number of ranks */
Expand Down
234 changes: 0 additions & 234 deletions FENIX/AMR/get_BG_data.c

This file was deleted.

Loading