bondhugula / pluto

Pluto: An automatic polyhedral parallelizer and locality optimizer
http://pluto-compiler.sourceforge.net
MIT License
274 stars 66 forks source link

Error compiling fdtd-2d prog in the examples folder #37

Open ThinhinaneIhadadene opened 5 years ago

ThinhinaneIhadadene commented 5 years ago

I tried compiling the program fdtd-2d program which is in the examples folder, I only changed the sizes of matrices by setting the constants nx and ny 10240 and the compilation failed. This doesn't occur when the problem size is small.

Also, in my case running the command mpirun -np 16 -hostfile ../hosts ./dist result in 16 executions with one rank each.

The command I used :

../../polycc fdtd-2d.c --distmem --timereport --nocommopt --tile    --isldep --lastwriter --indent  -o fdtd-2d.dist.c

OMPI_CC=gcc mpicc -D__MPI -O3 -march=native -mtune=native -ftree-vectorize -fopenmp -DTIME fdtd-2d.dist.c pi_fdtd-2d.dist.c sigma_fdtd-2d.dist.c \
        ../../polyrt/polyrt.c -o dist -I ../../polyrt -lm

The error I got :

In file included from fdtd-2d.dist.c:4:0:
pi_defs.h:6:0: warning: "_UB_REPLACE_ME_DISTLOOG0t3" redefined [enabled by default]
 #define _UB_REPLACE_ME_DISTLOOG0t3 min(min(floord(tmax+ny-2,32),floord(32*t1+ny+30,64)),t1)
 ^
pi_defs.h:4:0: note: this is the location of the previous definition
 #define _UB_REPLACE_ME_DISTLOOG0t3 min(min(floord(tmax+ny-1,32),floord(32*t1+ny+31,64)),t1)
 ^
In file included from pi_fdtd-2d.dist.c:4:0:
pi_defs.h:6:0: warning: "_UB_REPLACE_ME_DISTLOOG0t3" redefined [enabled by default]
 #define _UB_REPLACE_ME_DISTLOOG0t3 min(min(floord(tmax+ny-2,32),floord(32*t1+ny+30,64)),t1)
 ^
pi_defs.h:4:0: note: this is the location of the previous definition
 #define _UB_REPLACE_ME_DISTLOOG0t3 min(min(floord(tmax+ny-1,32),floord(32*t1+ny+31,64)),t1)
 ^
/tmp/cc7wD9xO.o: In function `read_grid_size':
polyrt.c:(.text+0xa2): relocation truncated to fit: R_X86_64_32S against symbol `grid_size' defined in COMMON section in /tmp/cc7wD9xO.o
/tmp/cc7wD9xO.o: In function `polyrt_init_grid_size':
polyrt.c:(.text+0x459): relocation truncated to fit: R_X86_64_PC32 against symbol `grid_size' defined in COMMON section in /tmp/cc7wD9xO.o
polyrt.c:(.text+0x463): relocation truncated to fit: R_X86_64_PC32 against symbol `grid_size' defined in COMMON section in /tmp/cc7wD9xO.o
polyrt.c:(.text+0x46d): relocation truncated to fit: R_X86_64_PC32 against symbol `grid_size' defined in COMMON section in /tmp/cc7wD9xO.o
polyrt.c:(.text+0x477): relocation truncated to fit: R_X86_64_PC32 against symbol `grid_size' defined in COMMON section in /tmp/cc7wD9xO.o
polyrt.c:(.text+0x481): relocation truncated to fit: R_X86_64_PC32 against symbol `grid_size' defined in COMMON section in /tmp/cc7wD9xO.o
polyrt.c:(.text+0x48b): relocation truncated to fit: R_X86_64_PC32 against symbol `grid_size' defined in COMMON section in /tmp/cc7wD9xO.o
polyrt.c:(.text+0x495): relocation truncated to fit: R_X86_64_PC32 against symbol `grid_size' defined in COMMON section in /tmp/cc7wD9xO.o
polyrt.c:(.text+0x49f): relocation truncated to fit: R_X86_64_PC32 against symbol `grid_size' defined in COMMON section in /tmp/cc7wD9xO.o
polyrt.c:(.text+0x4a9): relocation truncated to fit: R_X86_64_PC32 against symbol `grid_size' defined in COMMON section in /tmp/cc7wD9xO.o
polyrt.c:(.text+0x4b3): additional relocation overflows omitted from the output
collect2: error: ld returned 1 exit status
make: *** [dist] Error 1
bondhugula commented 5 years ago

Sorry about the extreme delay in responding to this. The 'relocation truncated to fit' errors are due to excessive global variable storage sizes! You'll have to reduce the problem size or go with malloc'ed storage (array of pointers so that 2-d subscripted indexing is still used).