Skip to content

Instantly share code, notes, and snippets.

View JordiCorbilla's full-sized avatar
:bowtie:
Writing about Quantitative Finance and Machine Learning

Jordi Corbilla JordiCorbilla

:bowtie:
Writing about Quantitative Finance and Machine Learning
View GitHub Profile
// Copyright (c) 2016, Jordi Corbilla
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// - Redistributions of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
// - Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// Copyright (c) 2016, Jordi Corbilla
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// - Redistributions of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
// - Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// Copyright (c) 2016, Jordi Corbilla
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// - Redistributions of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
// - Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// Copyright (c) 2016, Jordi Corbilla
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// - Redistributions of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
// - Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
# ******************************
# These steps will allow you to install MPICH3 to your Raspbian Jessie distro
# Jordi Corbilla
# ******************************
# update the system
sudo apt-get update
# update packages
sudo apt-get dist-upgrade
# ******************************
# These steps will allow you to install MPI4PY to your Raspbian Jessie distro
# Jordi Corbilla
# ******************************
# download mpi4py
wget https://bitbucket.org/mpi4py/mpi4py/downloads/mpi4py-2.0.0.tar.gz
#unzip the file
sudo tar -zxf mpi4py-2.0.0.tar.gz
# ******************************
# These steps will allow you to configure SSH on every device
# Run the commands below from PiController device
# Jordi Corbilla
# ******************************
# PiController (192.168.1.74)
ssh-keygen
cd ~
cd .ssh
# ******************************
# These steps will allow you to configure SSH on every device
# Jordi Corbilla
# ******************************
# run this from PiController using PuTTY
cd ~
cd .ssh
scp 192.168.1.71:/home/pi/.ssh/pi01 .
cat pi01 >> authorized_keys
#!/usr/bin/env python
"""
@Author: Jordi Corbilla
@Description: Parallel MPI Matrix Multiplication (NxN)
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
#!/bin/bash
# @Author: Jordi Corbilla
while true; do
(echo "%CPU %MEM ARGS $(date)" && ps -e -o pcpu,pmem,args --sort=pcpu | cut -d" " -f1-5 | tail) >> cpu.log; sleep 0.1;
done
#Example results;
#%CPU %MEM ARGS Fri 12 Aug 19:11:20 UTC 2016
#87.0 1.8 python /home/pi/mpi4py-2.0.0/demo/matrixmultiplication.py
#90.0 1.8 python /home/pi/mpi4py-2.0.0/demo/matrixmultiplication.py