{"id":711,"date":"2024-07-26T14:02:33","date_gmt":"2024-07-26T14:02:33","guid":{"rendered":"https:\/\/doctor-dark.co.uk\/blog\/?p=711"},"modified":"2024-07-26T16:45:35","modified_gmt":"2024-07-26T16:45:35","slug":"raspberry-pi-cluster-test","status":"publish","type":"post","link":"https:\/\/doctor-dark.co.uk\/blog\/raspberry-pi-cluster-test\/","title":{"rendered":"Raspberry Pi Cluster test"},"content":{"rendered":"\n<p>I&#8217;m just testing my Raspberry Pi cluster, to see if I have sorted out the setup properly this time. Finding the primes up to 10,000 with one core, and then sixteen cores, followed by using 16 cores to find primes up to 100,000 gave these results&#8230;<\/p>\n\n\n\n<p>pi@oyster0:~ $ mpirun -hostfile myhostfile -np 1 python3 Programs\/prime.py 10000<br>Find all primes up to: 10000<br>Nodes: 1<br>Time elapsed: 4.34 seconds<br>pi@oyster0:~ $ mpirun -hostfile myhostfile -np 16 python3 Programs\/prime.py 10000<br>Find all primes up to: 10000<br>Nodes: 16<br>Time elapsed: 0.34 seconds<br>pi@oyster0:~ $ mpirun -hostfile myhostfile -np 16 python3 Programs\/prime.py 100000<br>Find all primes up to: 100000<br>Nodes: 16<br>Time elapsed: 23.78 seconds<\/p>\n\n\n\n<p>So, it is all working as it should now. Next step is to add blinkenlights on the supervising machine, Marvin, which has a <a href=\"https:\/\/thepihut.com\/products\/unicorn-hat-hd\">UnicornHD HAT<\/a>. After that, I want to get my GUI based supervisor working.<\/p>\n\n\n\n<p>This leaves far too little time to flog stuff on eBay! I shall have to write a program to do that&#8230;<\/p>\n\n\n\n<p>Update:<\/p>\n\n\n\n<p>I ran it for the primes under a million, and it was disturbingly slow. I&#8217;d hope for something less than ten times as long as for a hundred thousand, but no!<\/p>\n\n\n\n<p>pi@oyster0:~ $ mpirun -hostfile myhostfile -np 16 python3 Programs\/prime.py 1000000<br>Find all primes up to: 1000000<br>Nodes: 16<br>Time elapsed: 2279.37 seconds<\/p>\n\n\n\n<p>Almost ten minutes. I&#8217;m assuming things ended up swapping memory in and out, or <a href=\"https:\/\/peps.python.org\/pep-0237\/\">Python doesn&#8217;t handle big integers very well<\/a>. It&#8217;s not a problem, but it is one of the reasons I want blinkenlights&#8230;<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1920\" height=\"1112\" src=\"https:\/\/doctor-dark.co.uk\/blog\/wp-content\/uploads\/2024\/07\/Screenshot-from-2024-07-26-17-31-46.png\" alt=\"\" class=\"wp-image-717\" srcset=\"https:\/\/doctor-dark.co.uk\/blog\/wp-content\/uploads\/2024\/07\/Screenshot-from-2024-07-26-17-31-46.png 1920w, https:\/\/doctor-dark.co.uk\/blog\/wp-content\/uploads\/2024\/07\/Screenshot-from-2024-07-26-17-31-46-1000x579.png 1000w, https:\/\/doctor-dark.co.uk\/blog\/wp-content\/uploads\/2024\/07\/Screenshot-from-2024-07-26-17-31-46-768x445.png 768w, https:\/\/doctor-dark.co.uk\/blog\/wp-content\/uploads\/2024\/07\/Screenshot-from-2024-07-26-17-31-46-1536x890.png 1536w, https:\/\/doctor-dark.co.uk\/blog\/wp-content\/uploads\/2024\/07\/Screenshot-from-2024-07-26-17-31-46-1200x695.png 1200w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;m just testing my Raspberry Pi cluster, to see if I have sorted out the setup properly this time. Finding the primes up to 10,000 with one core, and then sixteen cores, followed by using 16 cores to find primes up to 100,000 gave these results&#8230; pi@oyster0:~ $ mpirun -hostfile myhostfile -np 1 python3 Programs\/prime.py &hellip; <a href=\"https:\/\/doctor-dark.co.uk\/blog\/raspberry-pi-cluster-test\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Raspberry Pi Cluster test&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[20,7],"tags":[13,28],"class_list":["post-711","post","type-post","status-publish","format-standard","hentry","category-computing","category-raspberry-pi","tag-raspberrypi","tag-python3"],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/doctor-dark.co.uk\/blog\/wp-json\/wp\/v2\/posts\/711","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/doctor-dark.co.uk\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/doctor-dark.co.uk\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/doctor-dark.co.uk\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/doctor-dark.co.uk\/blog\/wp-json\/wp\/v2\/comments?post=711"}],"version-history":[{"count":6,"href":"https:\/\/doctor-dark.co.uk\/blog\/wp-json\/wp\/v2\/posts\/711\/revisions"}],"predecessor-version":[{"id":721,"href":"https:\/\/doctor-dark.co.uk\/blog\/wp-json\/wp\/v2\/posts\/711\/revisions\/721"}],"wp:attachment":[{"href":"https:\/\/doctor-dark.co.uk\/blog\/wp-json\/wp\/v2\/media?parent=711"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/doctor-dark.co.uk\/blog\/wp-json\/wp\/v2\/categories?post=711"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/doctor-dark.co.uk\/blog\/wp-json\/wp\/v2\/tags?post=711"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}