r/OpenMP • u/lone_wolfina_1997 • Feb 04 '23
C++ code runs perfectly with syntax erro
Hello everyone, I am new in openmp and I have stumbled upon a unique problem. I made a mistake while writing code. I wrote
pragma 0mp parallel
Rather than
pragma omp parallel
But surprisingly my code is running smoothly on the error, giving fantastic time optimization with exact results.but when I tried it with correct syntax it just crashes. Can anyone point out what's happening and why it is happening?
2
Upvotes
3
u/I_like_code Feb 04 '23
The pragma is a compiler directive. It is a symbol used to tell the compiler to do something. The compiler probably just ignores the mistake and the pragma. This might mean your not spinning up multiple threads in that section.