<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Dexter Fichuk on Medium]]></title>
        <description><![CDATA[Stories by Dexter Fichuk on Medium]]></description>
        <link>https://medium.com/@dexterfichuk?source=rss-ac644b074cbb------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*sZ59e3O2hgLCXRdh6ZwCsw.jpeg</url>
            <title>Stories by Dexter Fichuk on Medium</title>
            <link>https://medium.com/@dexterfichuk?source=rss-ac644b074cbb------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 17 Nov 2026 17:04:41 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@dexterfichuk/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[A Practical Start to Machine Learning]]></title>
            <link>https://medium.com/data-science/a-practical-start-to-machine-learning-421b0e8d5b2a?source=rss-ac644b074cbb------2</link>
            <guid isPermaLink="false">https://medium.com/p/421b0e8d5b2a</guid>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[getting-started]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[Dexter Fichuk]]></dc:creator>
            <pubDate>Fri, 09 Mar 2018 14:24:50 GMT</pubDate>
            <atom:updated>2020-09-25T14:48:04.169Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ocoYDEjC9g5YEb9SzODN8w.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/photos/DYIitvTuoD0?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">João Silveira</a> on <a href="https://unsplash.com/search/photos/ship?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><h4><a href="https://towardsdatascience.com/tagged/getting-started">Getting Started</a></h4><p>Working in a corporate innovation lab has taught me many things, with one of the most notable being teaching new students every four months the basics of applied machine learning. On top of that is teaching students with no machine learning (ML) experience how they can apply this technology to various aspects of their work. While I won’t say I’ve perfected this skill, I’ve been part of this cycle for three terms now and I have a better an understanding of what does and doesn’t work for teaching students the principles of applied machine learning in 1–2 weeks.</p><p>Interestingly, I’ve found that many students who complete online courses or learn the mathematics of a neural net can still struggle with feature engineering, data mining, and even loading generic data. Through teaching a few cohorts of students in our space, I’ve found the following resources to be my top recommended that I feel are worth sharing.</p><h3>An End-to-End Example</h3><p>While machine learning is currently a hot topic, many developers have no idea how it can actually be used. I find it’s best to walk through a simple end-to-end machine learning example for students to gain basic understandings of pre-processing, feature engineering, training, and then evaluating.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*bWydmH0sXFyO5bWIbTu_0w.jpeg" /><figcaption>Painting by <a href="https://commons.wikimedia.org/wiki/File:St%C3%B6wer_Titanic.jpg">Willy Stöwer</a></figcaption></figure><p>My favourite “Hello World” tutorial for machine learning is the <a href="https://www.kaggle.com/c/titanic">Titanic Dataset</a> (although it’s slightly morbid). From this dataset, you learn to train a model that predicts whether or not a passenger will survive the Titanic’s accident. The file I use to walk students through can be found <a href="https://github.com/dexterfichuk/ML-Bootcamp/blob/master/Titanic/TitanicGuide.ipynb">here</a>. I find it’s best to get some practice using Jupyter Notebooks, Pandas, Scikit-Learn and Numpy.</p><p>The reason I like this dataset as an intro is because you learn important ML basics, such as reading in a CSV file, dropping rows with null entries and irrelevant columns, transforming a gender field from text to binary, and performing one-hot encoding of a categorical field. By going step-by-step through this example, you can cover many different feature engineering practices using a problem that is easy to grasp.</p><h3>Hitting the Books</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/288/1*qjCRKFuW4ciXbDL4d00u7Q.jpeg" /></figure><p>Once you’ve experienced what a simple machine learning pipeline looks like, I recommend reading a little and learning some of the fundamentals. <a href="https://twitter.com/aureliengeron?lang=en">Aurélien Géron’s</a> book, <a href="http://shop.oreilly.com/product/0636920052289.do"><em>Hands‑On Machine Learning with Scikit‑Learn and TensorFlow</em></a> is, in my opinion, the best way to start understanding applied machine learning. I typically have students read the first few chapters or until they reach the TensorFlow section. What is great about the book is that it has accompanying Jupyter Notebooks for all the examples, so you can tweak and play with their code as you go along. I also love that they dive right into an <a href="https://github.com/ageron/handson-ml/blob/master/02_end_to_end_machine_learning_project.ipynb">end-to-end solution</a> solution in Chapter 2, making it super easy for engineers to quickly pick things up.</p><h3>Playing with Some Code</h3><p>Now that you’ve learned some of the theory behind machine learning, it’s time to explore different types of implementations and use cases. However, some of us who focus solely on the readings might have a hard time jumping into code and implementing solutions with different data.</p><p>To find thousands of examples of different datasets, approaches, implementations and machine learning solutions, I turn to <a href="https://www.kaggle.com/">Kaggle</a>. It has a huge amount of priceless knowledge, including hundreds of high-quality datasets in various domains. Possibly the greatest part of Kaggle is the kernels. Kernels are other users’ end-to-end code for problems, including everything from reading in the datasets and cleaning, to feature engineering, training and optimizations. You can even fork other users’ kernels and run them on their cloud, giving you a chance to explore real solutions.</p><p>Kaggle is great because it gives you an opportunity to break away from toy problems and simple data. It allows you to work with more challenging and realistic datasets, including images, raw and unorganized text, and numerical features. Taking a break and exploring Kaggle (and maybe even entering a few competitions) gives you an opportunity to learn from other Kaggler’s applied solutions, expanding your understanding beyond the theory and mathematics behind machine learning solutions.</p><h3>Going Deeper</h3><p>After exploring some kernels on Kaggle, it’s vital to learn some deep learning fundamentals and applications. The reason I advise skipping the TensorFlow section in Géron’s book is because I find Keras much easier to quickly pick-up building neural nets. Keras is a high-level deep learning library that relies on <a href="https://www.tensorflow.org/">TensorFlow</a> or <a href="http://deeplearning.net/software/theano/">Theano</a> as a backend for performing its computations.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/318/1*ah4G9CpJFpbstkttqOSGtw.jpeg" /></figure><p>Luckily, the best book I’ve found for learning applied deep learning is also by the creator of Keras, <a href="https://twitter.com/fchollet">François Chollet</a>! In his amazing book, <a href="https://www.manning.com/books/deep-learning-with-python"><em>Deep Learning with Python</em></a><em>,</em> he covers deep learning concepts, computer vision, natural language processing, and more advanced neural network architectures for areas such as question-answering and much more. The other highlight of this book is that, since Chollet himself wrote it, it teaches the best practices, built-in APIs, and functions that you can use in Keras. This book contains many things I’ve never seen taught in online courses or in other books, and I would definitely consider it to be one of my top resources for looking up implementation tricks with Keras.</p><h3>Wrapping Things Up</h3><p>Taking these steps are just the beginning to having a deeper understanding of machine learning, and should give you the confidence and enough background to start working on different sources of data. By focusing on the implementation of different algorithms, resources, and libraries, it’s easier to get excited and learn and want to continue learning.</p><p>The alternative of focusing solely on mathematics can be hard to translate into a work environment. Some of the most useful things I’ve learned are the subtle functions built in to Keras, Scikit-Learn and Pandas that allow me to work faster. Some of the coolest pipelines I’ve learned for feature engineering have been inspired from solutions in competitions I’ve dabbled with through Kaggle.</p><p>With so many resources out there for machine learning, it can be overwhelming. I hope this list serves as a great starting point for you to dive into machine learning.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=421b0e8d5b2a" width="1" height="1" alt=""><hr><p><a href="https://medium.com/data-science/a-practical-start-to-machine-learning-421b0e8d5b2a">A Practical Start to Machine Learning</a> was originally published in <a href="https://medium.com/data-science">TDS Archive</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A Case for LightGBM]]></title>
            <link>https://medium.com/data-science/a-case-for-lightgbm-2d05a53c589c?source=rss-ac644b074cbb------2</link>
            <guid isPermaLink="false">https://medium.com/p/2d05a53c589c</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[gradient-boosting]]></category>
            <category><![CDATA[xgboost]]></category>
            <category><![CDATA[lightgbm]]></category>
            <category><![CDATA[microsoft]]></category>
            <dc:creator><![CDATA[Dexter Fichuk]]></dc:creator>
            <pubDate>Sun, 15 Oct 2017 01:30:00 GMT</pubDate>
            <atom:updated>2017-10-15T04:00:32.573Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*z7yaKUbhxBHQnCdpH08CDg.jpeg" /><figcaption>Microsoft’s Distributed Machine Learning Toolkit</figcaption></figure><p>As any active <a href="https://www.kaggle.com/">Kaggler</a> knows, Gradient Boosting algorithms, specifically XGBoost, dominates competition leaderboards. However, in October 2016, <a href="https://medium.com/u/940e606ec51a">Microsoft</a>’s DMTK team open-sourced its<a href="https://github.com/Microsoft/LightGBM"> <em>LightGBM</em></a> algorithm (with accompanying Python and R libraries), and it sure holds it ground. Thus, the community has started to compare the performance of the lesser-known LightGBM to XGBoost.</p><p>In this post, I thought it would be valuable to mention cases in which I would use LightGBM over XGBoost and some of the trade-offs I’ve experienced between them.</p><h3>Usage</h3><p>My usage of both algorithms is through their Python, Scikit-Learn wrappers. I typically opt for using the Scikit-Learn wrappers of algorithms because it then creates a standard for implementing and evaluating a variety of algorithms on the same data. It also allows the creation of a pre-processing pipeline through Scikit that can then be easily applied through multiple algorithms.</p><p>Otherwise, Implementation of both algorithms is nearly identical, other than the specific hyper-parameters for each platform. But, anyone familiar with the typical SKLearn flow will have no problem jumping into using LightGBM.</p><h3>Installation</h3><p>Installing the CPU version of LightGBM is a breeze, and can be installed via pip. I wish I could say that the GPU version was as much of a breeze, but sadly there are more additional steps to be taken. You must install Cuda, Boost, CMake, MS Build or Visual Studio, and MinGW. After adding some stuff to the PATH, I was then fortunate enough to be able to install the GPU implementation by running:</p><blockquote>pip install lightgbm — install-option= — gpu</blockquote><h3>Speed</h3><p>To me, this is the real area that LightGBM shines. With default parameters, I find that my baseline with XGBoost would typically outrank LightGBM, but the speed in which LightGBM takes to run is magic. It’s been optimized for running in max parallelization, meaning that on both CPUs and GPUs it truly flies.</p><p>Having this speedup allows faster hyperparameter searches when optimizing the model. To me, this is what makes LightGBM so powerful. It allows developers to random/grid search parameter ranges in a shorter amount of time, allowing more possible combinations to be tested than if using XGBoost in the same time period. The speed also allows for adding cross-validation testing to get more accurate metrics of how your model will generalize. I believe the trade-off in default performance is largely outweighed by the sheer ability of fast optimization.</p><p>If you’re interested in reading more about the performance of LightGBM, <a href="https://medium.com/u/1ff412f60adb">Laurae</a> has a great <a href="https://medium.com/implodinggradients/benchmarking-lightgbm-how-fast-is-lightgbm-vs-xgboost-15d224568031">in depth post</a> comparing it to XGBoost.</p><h3>Categorical Feature Support</h3><p>Another perk of using LightGBM is its support for categorical features by specifying columns instead of using one-hot-encoding (OHE). OHE can be heavy as it can increase the dimensionality of a dataset significantly, depending on the number of categories + options. In Microsoft’s results, they’ve seen up to 8x training speed increase. This feature makes it even more suited for GPU training as it leverages more efficient ways of handling categorical data. Possibly the coolest part of this support is it has an auto mode for detecting specified categorical columns in your Pandas dataframe, significantly reducing the amount of pre-processing you have to perform to transform your data.</p><h3>Wrapping Things Up</h3><p>With the popularity of gradient boosting algorithms growing (courtesy of the Kaggle community), I thought it would be valuable to share a few insights I have with the lesser-known library. I believe it has enormous potential for developers over other libraries in certain situations, and recommend every data scientist give it a try the next time they’re starting a ML project.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2d05a53c589c" width="1" height="1" alt=""><hr><p><a href="https://medium.com/data-science/a-case-for-lightgbm-2d05a53c589c">A Case for LightGBM</a> was originally published in <a href="https://medium.com/data-science">TDS Archive</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Baking Your First Cluster Pi]]></title>
            <link>https://medium.com/@dexterfichuk/baking-your-first-cluster-pi-b321881c210b?source=rss-ac644b074cbb------2</link>
            <guid isPermaLink="false">https://medium.com/p/b321881c210b</guid>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[cluster]]></category>
            <category><![CDATA[mpi]]></category>
            <category><![CDATA[hpc]]></category>
            <category><![CDATA[raspberry-pi]]></category>
            <dc:creator><![CDATA[Dexter Fichuk]]></dc:creator>
            <pubDate>Fri, 17 Feb 2017 20:40:59 GMT</pubDate>
            <atom:updated>2017-02-17T20:54:54.944Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NHUQZYgzNqFSfh4KJa_aiw.jpeg" /><figcaption>An Amateurs Supercomputer</figcaption></figure><h3>Overview</h3><p>The objective of this guide is to create an Ubuntu Server based MPI cluster made of Raspberry Pi’s. Traditionally, Pi clusters use Raspbian, the Debian-based OS optimized for the Raspberry Pi. However, by using the Ubuntu Server image, this guide is applicable to creating an MPI cluster out of any computer as long as it can run Ubuntu Server (which a very vast amount of hardware can). By taking a slightly different approach, this guide is also able to stand out from the hundreds of typical Pi cluster guides.</p><p>I had a great deal of fun creating the nodes, understanding how MPI works, and learning to pull multiple services together to create a cluster and I hope you do too!</p><h3>Hardware</h3><p>For this guide I tried to minimize hardware costs (being a student and all), so I used the following:</p><ul><li>1 Raspberry Pi 1 (as the master)</li><li>3 Raspberry Pi 2’s (borrowed from department, to be used as slaves)</li><li>Linksys WRT54G</li><li>As many tangled ethernet cables as possible</li><li>Lego to make a shoddy case</li><li>A single milk crate</li><li>A power bar</li></ul><h3>Software</h3><ul><li>The Raspbian Jessie Lite image (for the head) <a href="https://www.raspberrypi.org/downloads/raspbian/">https://www.raspberrypi.org/downloads/raspbian/</a></li><li>The Ubuntu Server Minimal 15.10.3 image (for the nodes) <a href="https://ubuntu-pi-flavour-maker.org/download/">https://ubuntu-pi-flavour-maker.org/download/</a></li><li>The correct DD-WRT version for your router (if using one)</li></ul><h3>Router</h3><p>This part only applies if you don’t have a LAN switch available.</p><h3>Firmware</h3><p>For this project, I used a Linksys WRT54G flashed with the custom firmware, DD-WRT v24-sp2 to add extra customization features, most notably being able to create static addresses for our head/nodes.</p><h3>Flashing</h3><p>The general guide for flashing DD-WRT can be found here (<a href="http://www.dd-wrt.com/wiki/index.php/Installation">http://www.dd-wrt.com/wiki/index.php/Installation</a>), although you will likely need a guide specifically for your router model (assuming it is compatible). The process is rather straightforward, and will lead into the next step of setting static IP’s.</p><h3>Basic Setup</h3><p>I recommend setting the routers IP to a different one than the standard 192.168.1.1 so it can easily be plugged into any other network connection without conflict. I personally choose 192.168.3.1. Then for the remaining settings, they can be configured just like a normal router with security and any other personal preferences.</p><h3>Static Leases</h3><p>This is the most important part of the router setup. When a Pi is connected to the router, its MAC Address and Hostname can be found under <strong>Status &gt;&gt; LAN </strong>or <strong>WAN </strong>depending on how you’ve connected your Pi’s.</p><p>Then they must be added to the Static Lease section under <strong>Services &gt;&gt; Services</strong>. You can then choose the static IP address for each Pi. You can see a preview of what they would look like below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/567/0*-C_UWCvxXJ-kouvu." /></figure><h3>Pi Cluster</h3><p>This guide will skip the process of burning the OS images to the raspberry Pi’s, but in case you need help, I recommend looking here: <a href="https://www.raspberrypi.org/documentation/installation/installing-images/">https://www.raspberrypi.org/documentation/installation/installing-images/</a></p><h3>Setting Up Cluster</h3><p>To start, you must determine one Pi to use as the head (master), and the others to use as nodes (slaves). For the first part of this guide, the slave operations can be performed on a single slave node, and then later cloned to cut down on the setup time, so each of these steps only need to be performed on the master and a single slave.</p><h3>Hosts File</h3><p>Each node will need it’s own hosts file that is located in /etc/hosts. The master must have a list of all the the slaves, whereas the slaves only need to include the master, and themselves. An example of the master host file can be seen below.</p><blockquote>127.0.0.1 localhost<br>#127.0.1.1 1944</blockquote><blockquote>#Cluster Nodes<br>192.168.3.100 master<br>192.168.3.101 slave1<br>192.168.3.102 slave2<br>192.168.3.103 slave3</blockquote><p>Therefore, the master’s hosts file should be similar to the one above, but using the static lease IP’s you’ve set in your router. The slave’s file should then be almost identical, but minus it’s sibling slaves.</p><h3>MPI User</h3><p>Instead of primarily using the root user for running MPI commands and programs, I recommend creating a user without sudoer privileges for general usage. Ensure to add the same named user to all nodes. To create the user from the terminal, run</p><blockquote>sudo adduser mpiuser</blockquote><h3>Setting Up SSH</h3><p>For this first step you will need the Pi’s connected to a monitor and keyboard. The next step is to open up the terminal as root (user:pi pass:raspberry for Raspbian and user &amp; pass:ubuntu for Ubuntu Server). The commands for installation can be found below:</p><blockquote>su ubuntu</blockquote><blockquote>sudo apt-get update</blockquote><blockquote>sudo apt-get install openssh-server</blockquote><p>After this, you must generate the DSA keys for each node (you will need to return to this step when creating the cloned slaves). To start, login to the user and generate the keys by running the following commands:</p><blockquote>su mpiuser</blockquote><blockquote>ssh-keygen -t dsa</blockquote><p>Now you must add the generated keys between the master and slaves. You can do so by running the following command and replace the word ‘target’ with the hostname of the desired node you placed in the hosts file. To reiterate, you should run this command from the master to each slave, and then from each slave to the master.</p><blockquote>ssh-copy-id target</blockquote><p>Next, on each node enable passwordless ssh on each Pi so the nodes can interact freely with MPI by using the following.</p><blockquote>eval `ssh-agent`</blockquote><blockquote>ssh-add ~/.ssh/id_dsa</blockquote><h3>File Structure</h3><p>For the file structure we will try to keep it simple. I place all my MPI programs in a folder in the home of the mpiuser called cloud, but realistically you could call it whatever you like as long as it is the same on each node. You can create the folder by running the following from your home directory in the terminal.</p><blockquote>mkdir cloud</blockquote><h3>Installing MPI</h3><p>Enjoy every step of this process because it is perhaps the easiest. On each of the head nodes and your first slave node you must install MPI, for this guide we will be using MPICH2. Now, all you have to do is run the following commands (where ubuntu is your root user) on the head and first slave node:</p><blockquote>su ubuntu</blockquote><blockquote>sudo apt-get update</blockquote><blockquote>sudo apt-get install mpich2</blockquote><blockquote>Commands:</blockquote><blockquote>mpirun -np 2 -hosts 192.168.3.101,192.168.3.100 ./prime</blockquote><blockquote>mpirun -np 5 — hostfile hostfile ./prime2</blockquote><h3>Configuring Hostnames</h3><p>Each Pi is simpler to ssh into if they have a unique hostname. A simple format is to name Node 1 “rpi1”. To do this you must edit a few files. The first one is to change the contents of <strong>/etc/hostname</strong> to be your desired hostname. The next place to change is under<strong> /etc/hosts</strong>, and the new desired hostname should be added next to 127.0.0.0. Unfortunately, this must be performed on each node to get it into shape for our MPI cluster setup.</p><h3>Adding Slaves</h3><p>Not that this guide is condoning cloning of slaves (jokes), this will significantly save you time if you are trying to scale your cluster fast. Also remember, you will have to set new static leases, generate unique DSA keys, and change the hostname for each added slave.</p><h3>Cloning</h3><p>By creating a clone of your slave’s SD Card, you will always be able to have a backup of your custom MPI’d image for use later on. This will allow cloning the node, or even upgrading to larger SD Cards. To clone your card, I recommend following the guide here</p><p><a href="http://lifehacker.com/how-to-clone-your-raspberry-pi-sd-card-for-super-easy-r-1261113524">http://lifehacker.com/how-to-clone-your-raspberry-pi-sd-card-for-super-easy-r-1261113524</a>.</p><h3>Writing</h3><p>Your slave image can now be written to your remaining slave nodes. Afterwards though, you must make sure to customize each node to be unique as mentioned before. To write the images (incase you somehow got this far without doing so) you can find instructions here <a href="https://www.raspberrypi.org/documentation/installation/installing-images/">https://www.raspberrypi.org/documentation/installation/installing-images/</a>.</p><p>I’d now recommend, as it is a cross platform, beautiful solution <a href="https://etcher.io/">https://etcher.io/</a>.</p><h3>MPI Programming</h3><p>Ideally, you would create an NFS folder on your master node, and then set it as an automount point on each of the slaves so you only have to compile the program once, but sadly I had trouble doing so, therefore adding a few extra annoying steps to executing your parallel code.</p><h3>Compiling</h3><p>Now, to compile each program you first must add your parallel code to the cloud folder created on each node. It should be a .c file. You then can compile the code by running the following from mpiuser’s home folder (where prime is instead the name of your c file):</p><p>cd cloud</p><p>mpicc -o prime prime.c</p><p>chmod u+x prime</p><h3>Executing</h3><p>You’ve made it this far, and all of your work to this point will finally pay off. To execute your program run</p><p>mpirun -np 3 -hosts slave1,slave2,slave3 ./prime</p><p>Where 3 is the number or processes, slave1..3 are your slave nodes, and ./prime is your program. This is meant to be run on the master node with the hosts file and SSH configured correctly. If they are, the program should execute properly!</p><h3>Processes</h3><p>Each time you run an MPI program you have the choice of defining how many processes the parallel code should be split into. While it may seem like having 1 process per node is the best technique, it can actually vary significantly depending on how your code is structured. For example, when using a program to find the sum of prime numbers up to n, I found my best time results were when I split the program into 47 processes. Why this is I have absolutely no clue, other than assuming it is specific to this task and the way the jobs are scheduled.</p><h3>Hosts</h3><p>The hosts part of the execution command is a very simple and useful for evaluating the performance of a parallel program on different numbers of nodes. Programs can either be run on a single slave, or all of them, simply by adding them to the command separated by a comma.</p><h3>Benchmarks</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/0*8oLKAqGxtSzPB-YB." /></figure><p>The chart above represents the speed of execution of finding prime numbers.</p><p>I had an extreme amount of fun benchmarking on the Pi Cluster. The program I chose to test was one to find and sum the number of prime numbers up to n. N in this case was ran for different max values, all that can be found on the right of the diagram.</p><p>My method of determining a problem size always varied at random. I was not sure the most efficient method, so I brute forced to find a few numbers that had the best runtimes, and then recorded them on a spreadsheet (that I’ll attach with this email).</p><p>From my findings, I discovered that splitting the program into 47 processes was my magic number and gave me significantly better results, as shown in the chart above. The time to complete the problem when <em>n=1048576</em> was only 221.65 seconds, whereas when executed with 9 and 63 processes, the runtime averaged around 417 seconds, which held as me second and third best number of processes. Another thing that surprised me was the time it took simply to execute it as 3 processes among my 3 node cluster. I first thought this would be the most efficient means of method, but I was appalled. When <em>n=262144</em>, the speed on 3 and 47 processors was 86.79 and 15.92 respectively. By simply increasing the number of processes from 3 to 47, the program runs over 5 times faster. The gap of improvement becomes even larger as n increases, I just simply did not have the time to continue benchmarking it on extremely large problems.</p><p>Overall I had an extreme amount of fun with this assignment. My next projects I would like to do is create a multi-node cloud super-computer on either Amazon Web Services or Digital Ocean, and the latest project I have thought of that has not been done on a large scale would be creating a massive cluster of Raspberry Pi Zeroes. The Pi Zeroes is a $5 computer that can run debian, and has a processor clocked at 1GHz. I think it would be impressive to create a 20 node cluster for a measly $100 (not including power supplies). My idea would be to create a network connection to the Pi Zeroes through their pin connectors, since they lack a standard USB port. I think this could be impressive because I could create my own sort of network topology with potentially faster speeds than ethernet. A huge obstacle of this is that Pi Zeroes have been constantly out-of-stock since their launch months ago, and when they are in stock there is a limit of 1 per customer, so I will be stuck waiting for their manufacturing to catch up. Despite the obstacles, I truly believe Pi Zeroes could be part of a future of supercomputing and look forward to doing further research on the topic.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b321881c210b" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>