Cluster computing 1
Get basic details
Write the script
Use the following script to test the cluster.
Distribute the script
The script need to be on all the nodes in the same place. Copy the script from the master to the nodes like this:
This process is tedious and would be even more so if there were more nodes in the cluster, so shortly I will demonstrate a way to code all of this.
Run the script
Run it by involking the MPI system
The "n" parameter is the number of processes to be spawned. Setting this to 4 in a four pi cluster will cause each machine to return one set of values.
Given that the pi's have four core processors we should make use of them.
Now that's parallel processing!
Sending data
To test the master nodes ability to send data to the other nodes we will use this code:
Make sure to copy the file to the other pi's before trying to execute the code. When we run it we get the following output. Note that we have to reduce the value of "n" in the execute line to 4.