I want to execute "a bunch of code" if I compiled the source file with the -g
flag (g++ compiler), I was thinking in something like this:
int main()
{
// do some calculations...
#if DEBUG
fputs("MATRIX:\n", stdout);
Print_Matrix(A, M, N);
fputs("VECTOR:\n", stdout);
Print_Vector(x, N);
fputs("PARALLEL RESULT\n", stdout);
Print_Vector(y, M);
fputs("SERIAL RESULT\n", stdout);
Print_Vector(y_serial, M);
#else
fprintf(stdout, "SIZE: %d x %d AND %d THREADS\n", M, N, NUM_OF_THREADS);
fprintf(stdout, "TIEMPO CONC.:%d mseg\n", (int)final_par);
fprintf(stdout, "TIEMPO SERIAL:%d mseg\n", (int)final_serial);
#endif
}
The purpose is that I will run in DEBUG
mode when the size of the matrix is small, if not, then I will print the execution times (for bigger matrices).
The problem is: if I compile it with or without the -g
flag, it never prints the info about the matrix or the vector.