I’m try to parallelize a big program in Fortran90 using OpenMP.
I get segmentation fault errors all the time. I am wondering if there is any easy way to fix them. What do you do if you have a segmentation fault error?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
First roll your code back to its original, unparallelised, version. You do have this under version control don’t you ?
Check very carefully that your serial program does not cause any segmentation faults. Pay particular attention to the issues raised in this document from Intel. Read this even if you are not using the Intel Fortran compiler. Take the corrective actions it suggests.
Now, parallelise your first construct. Choose a simple, un-nested, loop if you can. Re-test your program. Think about what you have done and make sure that you understand what is going on. Choose another simple construct to parallelise. When you have finished the simple ones move on to the more complicated ones, all the while testing as you go and learning as you go.
So, to answer your question: the best way to fix such faults is to not make them in the first place. You report that you get segmentation faults all the time, this suggests to me that you have tried to run before you can walk.
And to answer another question: no, there is no easy way to fix them.