Hi Chapel team, I just remembered an old homework about parallelizing a program in OpenMP and decided to re-implement it in Chapel. It is a simple iterative algorithm for calculating the number Pi [1]. In serial it needed around 18.7 seconds on my machine. Obviously my first thought was about simply parallelizing the for-loop. In every iteration the final result is updated so its' variable and the update are atomic now [2]. However this solution seemed not to be useful since it didn't even terminate after some minutes. Maybe all these uses of the atomic operations need too much time So I changed the program in a way that the atomic operation needed to be used only once in the whole program [3] - and it worked: On a PC with four cores it needed only 3.6 seconds of time. However I think this implementation looks quite long-winded to me. Can you suggest a shorter solution in Chapel or is this considered appropriate in certain cases like this?
bye Michael [1] https://www-user.tu-chemnitz.de/~michd/chpl_pi/eng/pi_serial.chpl [2] https://www-user.tu-chemnitz.de/~michd/chpl_pi/eng/pi_local1.chpl [3] https://www-user.tu-chemnitz.de/~michd/chpl_pi/eng/pi_local2.chpl ------------------------------------------------------------------------------ Don't Limit Your Business. Reach for the Cloud. GigeNET's Cloud Solutions provide you with the tools and support that you need to offload your IT needs and focus on growing your business. Configured For All Businesses. Start Your Cloud Today. https://www.gigenetcloud.com/ _______________________________________________ Chapel-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/chapel-users
