Open Jim-Walk opened 5 years ago
Thanks for the bug report. I will try to figure this out.
I believe the boundary indices are valid. 171966467 printed is elm+4
(elm=171966463
), in the case of not commenting out 262 and 263, elm
will be reassigned at line 262 and end up being 171966464 after the loop exits. Since the print statement at 265 is out side the matrix
loop (249-264), elm
will never be used again, so there should be no out of bound errors. (If you run it with icc
where the solution validates, you will get the same output.)
But validation does fail when compiled with gcc
, and I think the source of the error is at line 285. temp
should be declared private as well to avoid race condition. I still need to run more cases and check if there are other problems, but I believe this is the one.
For some reason icc
is immune to this bug, I couldn't replicate this issue even with -check-pointers=rw
, quite curious.
What type of issue is this?
If this is a bug report, please use the following template. Otherwise, please delete the rest of the template.
Where does this bug appear?
Check all that apply:
Operating system
What is the output of
uname -a
? Linux l0 4.18.0-17-generic #18~18.04.1-Ubuntu SMP Fri Mar 15 15:27:12 UTC 2019 x86_64 x86_64 x86_64 GNU/LinuxCompiler
gcc What is the output of
${COMPILER} -v
or${COMPILER} --version
? gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0PRK build information
Please attach or inline
make.defs
.Output showing problem
When the sparse OpenMP benchmark is run with
./sparse 12 2 11 10
the program tries to write data to memory which has not been allocated. To find this error, please comment out line 262 and 263 of sparse.c, and then outside the for loop, on line 265 addprintf("nent: %llu elm: %llu \n", nent, elm+4);
. This will show that the length of col_index, nent, is 171966464, and the program tries to write to 171966467. Due to the parallel nature of this program, there is a strong chance that each thread is writing outside of it the boundaries of its own array. Furthermore, if the program is compiled withicc --check-pointers=rw
on linux, the solution fails to validate.If the output is short, please inline it here. Otherwise, please pipe it to a plain text file and attach that file. Note that you may need to use
$command 2>&1 $log
to capture the error messages.Please do not attach screenshots of your terminal.