User:Carl Boettiger/Notebook/Stochastic Population Dynamics/2010/02/28

From OpenWetWare
Jump to: navigation, search
Owwnotebook icon.png Stochastic Population Dynamics Report.pngMain project page
Resultset previous.pngPrevious entry      Next entryResultset next.png

Parallelizing Code

A solution!

  • After a good bit more exploring permutations of openmp commands and experimenting with code (should have been done in a branch version so would be in the version management, instead done in my local experimental sandbox so will have to implement and merge into real code still!) was able to understand the root of my problem and pose a coherent question.
  • Posting that question on stack overflow solved my problem in under an hour. Two for two on fast and thorough solutions there, a fantastic resource.
  • As I understand it, the += strategy still risks collisions, perhaps these can be avoided by dynamically allocating the shared variable my_report in the same fashion (i.e. after it is declared shared), but not ideal..

To Do

  • Merge changes into actual code.
  • Add use of const (and possibly restrict) as often as possible, and start implementing these regularly when writing functions. Also more literate programming.
  • Illustrations of the ensemble variance vs time-averaged variance and it's expected deviations.

<html> <!-- begin htmlcommentbox.com -->

<div id="HCB_comment_box"><a href="http://www.htmlcommentbox.com">HTML Comment Box</a> is loading comments...</div>
<link rel="stylesheet" type="text/css" href="http://www.htmlcommentbox.com/static/skins/default/skin.css" />
<script type="text/javascript" language="javascript" id="hcb"> /*<!--*/ (function(){s=document.createElement("script");s.setAttribute("type","text/javascript");s.setAttribute("src", "http://www.htmlcommentbox.com/jread?page="+escape(window.location)+"&mod=%241%24wq1rdBcg%24JFqky5biAfo0o6wXtJUEB0"+"&opts=414&num=10");if (typeof s!="undefined") document.getElementsByTagName("head")[0].appendChild(s);})(); /*-->*/ </script>

<!-- end htmlcommentbox.com --> </html>