Commit 83ea625a authored by incardon's avatar incardon

Fixing Macro

parent 2d15eba1
...@@ -10,7 +10,7 @@ OBJ = main.o update_new.o ...@@ -10,7 +10,7 @@ OBJ = main.o update_new.o
mpif90 -ffree-line-length-none -fno-range-check -fno-second-underscore -fimplicit-none -mavx -O3 -c -g -o $@ $< mpif90 -ffree-line-length-none -fno-range-check -fno-second-underscore -fimplicit-none -mavx -O3 -c -g -o $@ $<
%.o: %.cpp %.o: %.cpp
$(CC) -O3 -mavx -g -c --std=c++11 -Wno-ignored-attributes -o $@ $< $(INCLUDE_PATH) -I/home/i-bird/VC/include $(CC) -O0 -mavx -g -c --std=c++11 -Wno-ignored-attributes -o $@ $< $(INCLUDE_PATH) -I/home/i-bird/VC/include
gray_scott: $(OBJ) gray_scott: $(OBJ)
$(CC) -o $@ $^ $(CFLAGS) $(LIBS_PATH) $(LIBS) -L/home/i-bird/VC/lib -lVc $(CC) -o $@ $^ $(CFLAGS) $(LIBS_PATH) $(LIBS) -L/home/i-bird/VC/lib -lVc
......
...@@ -290,33 +290,36 @@ class grid_dist_iterator_sub ...@@ -290,33 +290,36 @@ class grid_dist_iterator_sub
//////// MACRO in 3D //////// MACRO in 3D
#define WHILE_M(grid,stencil) auto & ginfo = grid.getLocalGridsInfo();\ #define WHILE_M(grid,stencil) auto & ginfo = grid.getLocalGridsInfo();\
for (size_t i = 0 ; i < grid.getN_loc_grid() ; i++)\ for (size_t s = 0 ; s < grid.getN_loc_grid() ; s++)\
{\ {\
auto it = grid.get_loc_grid_iterator_stencil(i,stencil);\ auto it = grid.get_loc_grid_iterator_stencil(s,stencil);\
\ \
int lo[3] = {(int)ginfo.get(i).Dbox.getLow(0),(int)ginfo.get(i).Dbox.getLow(1),(int)ginfo.get(i).Dbox.getLow(2)};\ int lo[3] = {(int)ginfo.get(s).Dbox.getLow(0),(int)ginfo.get(s).Dbox.getLow(1),(int)ginfo.get(s).Dbox.getLow(2)};\
int hi[3] = {(int)ginfo.get(i).Dbox.getHigh(0),(int)ginfo.get(i).Dbox.getHigh(1),(int)ginfo.get(i).Dbox.getHigh(2)};\ int hi[3] = {(int)ginfo.get(s).Dbox.getHigh(0),(int)ginfo.get(s).Dbox.getHigh(1),(int)ginfo.get(s).Dbox.getHigh(2)};\
\ \
int uhi[3] = {(int)ginfo.get(i).GDbox.getHigh(0),(int)ginfo.get(i).GDbox.getHigh(1),(int)ginfo.get(i).GDbox.getHigh(2)};\ int uhi[3] = {(int)ginfo.get(s).GDbox.getHigh(0),(int)ginfo.get(s).GDbox.getHigh(1),(int)ginfo.get(s).GDbox.getHigh(2)};\
\ \
int sx = uhi[0]+1;\ int sx = uhi[0]+1;\
int sxsy = (uhi[0]+1)*(uhi[1]+1); int sxsy = (uhi[0]+1)*(uhi[1]+1);
#define ITERATE_3D_M for (int i = lo[2] ; i <= hi[2] ; i+=1)\ #define ITERATE_3D_M int i = lo[2];\
for ( ; i <= hi[2] ; i+=1)\
{\ {\
for (int j = lo[1] ; j <= hi[1] ; j+=1)\ int j = lo[1];\
for ( ; j <= hi[1] ; j+=1)\
{\ {\
for (int k = lo[0] ; k <= hi[0] ; k+=4)\ int k = lo[0];\
for ( ; k <= hi[0] ; k+=Vc::double_v::Size)\
{ {
#define GET_GRID_M(grid) grid.get_loc_grid(i); #define GET_GRID_M(grid) grid.get_loc_grid(s);
#define END_LOOP_M it.private_sum<Vc::double_v::Size>();\ #define END_LOOP_M it.private_sum<Vc::double_v::Size>();\
}\ }\
it.private_adjust( - (hi[1] + 1) + sx + lo[0]);\ it.private_adjust( - k + sx + lo[0]);\
}\ }\
it.private_adjust(- (hi[2] + 1)*sx + sxsy + lo[1]*sx);\ it.private_adjust(- j*sx + sxsy + lo[1]*sx);\
}\ }\
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment