jeudi 26 février 2015

OpenMPI finding prime gaps, free(): invalid size



I'm currently taking a university course on parallel programming, and our recent assignment was to create a parallel program that would find the largest gap between prime numbers in a given range. The assignment included calculations on numbers as large as 10^9, however you could get bonus marks for finding the largest gap up to 10^12, 13 and 14. My program handles 10^9 without a problem, but there was a problem on 10^12. After a solid 56 hours of computing time all the processes finally checked in that they were finished their portion, but in a wonderful twist of fate my program frees it's memory before printing the result string, and aborted right before printing the answer. It did have something for a result but just didn't get a chance to tell me, which is nice.


So my program gets "free(): invalid size" error and aborts and I don't know why. It's not easy to troubleshoot since it does take three actual days to run. So there are links to the code and the memory dump below, and if somebody knows what's broken I would be really interested to know.


I don't claim that it is anywhere near properly optimized, especially since we were only using openmpi and gmp


Back Trace

Source Code




Aucun commentaire:

Enregistrer un commentaire