Try changing:
double A[400000][4], b[400000], c[4] ;
to
static double A[400000][4], b[400000], c[4] ;
Your array A
declaration has an automatic storage duration, which probably means that your system is stored on the stack. Your overall stack for your process is likely to be below this, and you are faced with a stack overflow.
On Linux, you can run the ulimit
command:
$ ulimit -s 8192 $
to see the stack size in kB allocated for the process. For example, 8192 kB on my machine.
ouah source share