Baking RDKit on a Pi. - Tips and gotchas. Jan Holst Jensen CEO, Biochemfusion

Similar documents
MASTERNODE SETUP GUIDE

CROWDCOIN MASTERNODE SETUP COLD WALLET ON WINDOWS WITH LINUX VPS

Masternode Guide #1. Single masternode on Linux VPS (Ubuntu)+ control wallet on local PC (Windows)

WHAT YOU WILL NEED FOR THIS GUIDE:

PYPL - A cartridge enabling RDKit in Oracle PL/SQL - The tiniest Oracle cartridge ever? Jan Holst Jensen Biochemfusion ApS

SCRIV NETWORK COLD WALLET MASTERNODE SETUP GUIDE DETAILED

TZC WALLET + HEADLESS WALLET ON LINUX. Local Wallet + PoS Headless Wallet on VPS (Ubuntu 16.04)

Setting up a Chaincoin Masternode

Masternode Setup Guide

Dixicoin (DXC) Masternode Guide for VPS

SUB1X Masternode Setup Guide: LINUX Version

MASTERNODE Setup Guide

Install Guides. Automated Compiler Cold Node (Linux VPS) Absolute. Proof of View

Rover Coin. Hot Cold Wallet Masternode VPS setup Guide

Beetle Coin Masternodes Guide

BitcoinMonster Masternode Linux VPS Tutorial - Vultr VPS Created By : Samshak Donet Mon: MKX8PFz1uvBkwNDTXtUuj6KinudhsKZh1K

Masternode Setup Guide Local Wallet with VPS Server

KINGSTON COIN VPS MASTERNODE SETUP GUIDE

Raspberry PI 'How-To' Series

Windows cold wallet managing Linux VPS connected Masternode

BitcoinGenX Masternode Setup Tutorial

Relarium (RLM) Masternode Guide for VPS

Wallet Installation Guide for Staking on Raspberry PI

From 0 to 6 GHz in 30 minutes bootstrap your SDR Experience!

INSTALLATION ecodms Version (krusty)

Manual to install experimental firmware on a TYTERA MD380

Zephyr Kernel Installation & Setup Manual

P6: Trial Build of a ROM Nikhil George. 1. Introduction. Overview of the build task. Cite the build/ wiki articles you read.

RETROPIE INSTALLATION GUIDE

Raspberry Pi Using Open CV which Has The Installing,making Programs And Performance

BUILDING TESTING DEBUGGING PACKAGING BUILDING OOREXX

SAROS MasterNode Guide V1.1

Complete Guide to Setting Up Linda on Ubuntu 16 For Staking

Cold Masternode Guide

This guide assumes that you are setting up a masternode for the first time. You will need:

TECHNOLOGY. Cold Masternode Guide

TUTORIAL: Quickstart with freediameter

Introduction to the Raspberry Pi AND LINUX FOR DUMMIES

F28HS Hardware-Software Interface: Systems Programming

Linux File System Study Guide

Adding a Real Time Clock to Raspberry Pi

Embedded Linux. A Tour inside ARM's Kernel

The distcc Utility for Remote Compiling

Raspberry Pi Kernel-o-Matic

Adafruit NFC/RFID on Raspberry Pi

Contents. Crave Masternode Setup Guides. Single / Multiple Local Masternode(s) Single Masternode using a VPS. Multiple Masternodes using a VPS

3X Linux System Administration (Level 1) Exam.

Neural Network Compiler BNN Scripts User Guide

Connect the GSM-DSA to a router where the network is configured to x with a mask

Raspberry Pi Network Boot

Lecture 2. Systems Programming with the Raspberry Pi

Metasploit. Installation Guide Release 4.4

molgears Documentation

Building MPI so we can run code on multiple nodes

Atmel 328-Processor for RaspberryPi

An NTP Time Server Using GPS as a Time Reference

Accessing Zen v13 from Python on Raspbian Using the Btrieve 2 Interface

Lab2 - Bootloader. Conventions. Department of Computer Science and Information Engineering National Taiwan University

Configuration the Raspberry Pi for the SmartPI. There are two ways to install the necessary software to use the SmartPi with your Raspberry Pi!

A Case Study in Optimizing GNU Radio s ATSC Flowgraph

TrinityCore Documentation

manifold Documentation

Experiments 1 How to set up Raspberry Pi B+ The little computer you can cook into DIY tech projects

COLD WALLET + MASTERNODE SETUP ON LINUX

How To Start Mysql Using Linux Command Line Client In Ubuntu

MASSACHUSETTS INSTITUTE OF TECHNOLOGY HAYSTACK OBSERVATORY WESTFORD, MASSACHUSETTS October, 2015

Online Backup Client User Manual

CHAPTER III PLANNING

Masternode&Sentinel Setup Guide

Basic Concepts & OS History

I2C Serial 2.6 LCD Module

Powerline Network. Utility Program User Guide. for. Instant Network for Internet Access and More! 200Mbps PLC-ETHERNET BRIDGE

Adafruit NFC/RFID on Raspberry Pi

Cubieboard4 Linux Sdk Guide TF BOOT & TF WRITE EMMC. Website: Support:

Contents in Detail. Acknowledgments

CazCoin VPS Masternode Setup May 2018

Kinto Documentation. Release Mozilla Services Da French Team

Development Environment Embedded Linux Primer Ch 1&2

DEVELOPMENT GUIDE VAB-630. Linux BSP v

Java Programming on the Raspberry Pi with Pi4J. Rob Ratcliff

Upgrade Cisco Interface Module for LoRaWAN IXM using the Console

Linux Installation. Prepared by: William Zereneh

Mesos on ARM. Feng Li( 李枫 ),

Building CircuitPython

I2C. I2C, sometimes IIC or I 2 C, stands for inter IC. 2-line bus, clock (SCL) and data (SDA) Devices individually addressable

FreeBSD and Beaglebone Black, a robotic application.

Linux Strace tool user guide

Mopidy-dLeyna Documentation

ECE 598 Advanced Operating Systems Lecture 5

Downloading and installing Db2 Developer Community Edition on Ubuntu Linux Roger E. Sanders Yujing Ke Published on October 24, 2018

Continuous Integration INRIA

KVM Guest Management With Virt-Manager On Ubuntu 8.10

Introduction to Pintos

How To Install Microsoft Windows 7 Games Run Faster And Smoother

CazCoin VPS Masternode Setup December 2018

Purpose. Target Audience. Install SNMP On The Remote Linux Machine. Nagios XI. Monitoring Linux Using SNMP

Embedded Systems Programming

Addonics T E C H N O L O G I E S. mini NAS. Model: NAS25HDU Key Features

BeagleBone Black: Installing Operating Systems

Installing Ubuntu 8.04 for use with ESP-r 8 May 2009 Jon W. Hand, ESRU, Glasgow, Scotland

Transcription:

Baking RDKit on a Pi - Tips and gotchas Jan Holst Jensen CEO, Biochemfusion jan@biochemfusion.com RDKit UGM 2012 1

Raspberry Pi Image from http://www.raspberrypi.org/faqs An ARM-based, networked, credit-card sized computer capable of running Linux. For $35! 2

RDKit on the Pi Really smooth sailing. Compiles almost out-of-the-box. We will look at The needed OS and HW configuration tweaks. (Minimal) source code corrections. What performance you can expect. 3

Setup Using the standard Debian Wheezy distro. Add RDKit build prerequisites: apt-get install the following packages cmake flex bison python-imaging libboost-dev libboost-regex-dev libboost-python-dev The python-numpy package is already installed in this Pi distro. 4

Configure and go... pi@pi-dev ~/RDKit_2012_06_1 $ export RDBASE=/home/pi/RDKit_2012_06_1 pi@pi-dev ~/RDKit_2012_06_1 $ export LD_LIBRARY_PATH=$RDBASE/lib pi@pi-dev ~/RDKit_2012_06_1 $ export PYTHONPATH=$RDBASE pi@pi-dev ~/RDKit_2012_06_1 $ mkdir build pi@pi-dev ~/RDKit_2012_06_1 $ cd build pi@pi-dev ~/RDKit_2012_06_1/build $ cmake.. -- The C compiler identification is GNU 4.6.3 -- The CXX compiler identification is GNU 4.6.3...... -- Generating done -- Build files have been written to: /home/pi/rdkit_2012_06_1/build pi@pi-dev ~/RDKit_2012_06_1/build $ make Scanning dependencies of target fastentropy [ 0%] Building CXX object External/cmim-1.0/CMakeFiles/fastentropy.dir/f [ 1%] Building CXX object External/cmim-1.0/CMakeFiles/fastentropy.dir/m... Now, get coffee, read a good book, rent a movie, clean the house... 5

Ouch! Compile crash...... [ 4%] Building CXX object Code/RDBoost/Wrap/CMakeFiles/rdBase.dir/RDBase.cpp.o c++: internal compiler error: Killed (program cc1plus) Please submit a full bug report, with preprocessed source if appropriate. See <file:///usr/share/doc/gcc-4.6/readme.bugs> for instructions. make[2]: *** [Code/RDBoost/Wrap/CMakeFiles/rdBase.dir/RDBase.cpp.o] Error 4 make[1]: *** [Code/RDBoost/Wrap/CMakeFiles/rdBase.dir/all] Error 2 make: *** [all] Error 2 pi@pi-dev ~/RDKit_2012_06_1/build $ Oops out of memory 6

Memory configuration 7

Low default swap space root@pi-dev ~ $ free... Swap: 102396 0 102396 root@pi-dev ~ $ Add 512 M more for the compile session... root@pi-dev:~# dd if=/dev/zero of=tmp-swapfile bs=1m count=512 512+0 records in 512+0 records out 536870912 bytes (537 MB) copied, 54.4397 s, 9.9 MB/s root@pi-dev:~# mkswap tmp-swapfile Setting up swapspace version 1, size = 524284 KiB no label, UUID=689fbed2-bb8b-41d0-a228-1eea71705f18 root@pi-dev:~# swapon tmp-swapfile root@pi-dev:~# free... Swap: 626680 15172 611508 root@pi-dev:~# 8

256 MB on-board RAM, but... pi@pi-dev ~ $ free total used free Mem: 188080 146852 41228 -/+ buffers/cache: 63568 124512 Swap: 626680 5480 621200 pi@pi-dev ~ $ Who stole my RAM? 9

Default configuration Running the raspi-config utility above 10

Console-only configuration OK then reboot 11

Much better pi@pi-dev ~ $ free total used free Mem: 220592 51020 169572 -/+ buffers/cache: 17720 202872 Swap: 626680 0 626680 pi@pi-dev ~ $ 12

Compile warnings [ 2%] Building CXX object Code/RDGeneral/CMakeFiles/RDGeneral.dir/Dict.cpp.o /tmp/ccgfzfb4.s: Assembler messages: /tmp/ccgfzfb4.s:1525: Warning: swp{b} use is deprecated for this architecture Boost 1.49 issue generating suboptimal code for smart_ptr. See https://svn.boost.org/trac/boost/ticket/7141 13

Fixing boost 1.49 In file /usr/include/boost/smart_ptr/detail/sp_has_sync.hpp #define BOOST_SP_HAS_SYNC + #if!defined( GCC_HAVE_SYNC_COMPARE_AND_SWAP_4) + #if defined( arm ) defined( armel ) #undef BOOST_SP_HAS_SYNC #endif + #endif // GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 + #if defined( hppa ) defined( hppa ) #undef BOOST_SP_HAS_SYNC #endif 14

Build completed (and tests too) Did you get that coffee?! time make reports (*) For comparison: Intel x86 Ubuntu VM running on a Core i5 2.4 GHz host time make reports The Pi is almost 50 times slower ouch. real user sys real user sys 679m19.796s 641m45.310s 12m36.180s 14m3.441s 13m24.326s 0m31.790s (*) If you only configure the Pi with 188 M RAM instead of 220 M the build time rises to 750 mins. 15

PostgreSQL cartridge - build PostgreSQL 9.1 packages needed postgresql-9.1 + postgresql-server-dev-9.1 rdkit cartridge building No issues at all. cd $RDBASE/Code/PgSQL/rdkit/ make sudo make install Done 16

PostgreSQL cartridge install Install into database postgres@pi-dev:~$ psql -c 'CREATE EXTENSION rdkit' CREATE EXTENSION postgres@pi-dev:~$ Edit /etc/postgresql/9.1/main/postgresql.conf #shared_preload_libraries = '' + shared_preload_libraries = 'rdkit' Restart database done. # (change requi 17

Performance in real life, not compiling 18

Simple CPU-bound test from rdkit import Chem from rdkit.chem import AllChem for t in range(1, 100): m = Chem.MolFromSmiles('OC(=O)C1CCC(CC(=O)O)CC1') AllChem.EmbedMultipleConfs(m, 10) for i in range(m.getnumconformers()): AllChem.UFFOptimizeMolecule(m, confid=i) m = None Pi Ubuntu x86 89 secs 3.3 secs 27 times slower 19

Database load molecules Load 50 000 random PubChem molecules postgres=# create table pubchem_mols (pubchem_no text, molecule mol); CREATE TABLE postgres=# create index molidx on pubchem_mols using gist(molecule); CREATE INDEX postgres=# \q time psql -f /home/postgres/pubchem-smiles.sql > /dev/null Intel x86 VM, postgres 9.1.6 3 mins 38 secs Raspberry Pi, postgres 9.1.5 6 hours 1 min (x 100) 20

Database search performance select count(*) from pubchem_mols where molecule @> <smiles>; <smiles> = Triazine: 'c1ncncn1 Intel x86 VM 0.6 secs Raspberry Pi 16.2 secs (x 27) Coumarine: 'O=C1OC2=CC=CC=C2C=C1 Intel x86 VM 0.35 secs Raspberry Pi 9.4 secs (x 27) 21

In conclusion Quite easy to get RDKit running on the Pi Once you know a couple of tweaks No speed daemon! But it is OK for non-heavy stuff e.g. departmental chemical database actually perfect for testing! If it runs well on the Pi... and it uses less than 3W! 22

Need more performance? http://arstechnica.com/informationtechnology/2012/09/university-builds-cheapsupercomputer-with-raspberry-pi-and-legos/ 23

Latest new Debian image Per 2012-09-18 there is a new Debian image New firmware allows easy (and safe!) overclocking Turbo mode 1 GHz clock on-demand Expect performance that is 50% to 100% better General performance up 50% + Build times almost halved g++ upgraded too 24