Notes on how to set up an interactive GPU session for computation on the Leeds System.

Image for post
Image for post
Photo by Pascal Brändle on Unsplash

Start a session

Arc4

qrsh -l h_rt=2:0:0,coproc_v100=1,h_vmem=8G -pty y bash

A single V100 card, 10 CPU cores and 48GB system memory (one quarter of the available resource on a V100 node)

Arc3

qrsh -l h_rt=2:0:0,coproc_k80=1 -pty y bash

A single K80 card, 12 CPU cores and 64GB system memory (half the available resource on a K80 node)

or

qrsh -l h_rt=2:0:0,coproc_p_100=1 -pty y bash

A single P100 card, 6 CPU cores and 64GB system memory (one quarter of the available resource on a P100 node)

Check the Card you Have Been Allocated

module load cudanvidia-smi…

Sometimes we require multiple modules all of which communicate using the I2C channel. In this post, we discuss how to do exactly that using available GPIO pins.

Image for post
Image for post
Photo by Josh Spires on Unsplash

Setup

We begin with installing the required libraries,

sudo apt-get install -y python-smbus i2c-tools

followed by enabling I2C using the advanced tab within raspi config. I this does not make sense, have google ‘using I2C on Raspberry Pi’ and the device you are trying to connect. Make sure you can connect this successfully before continuing.

Conventional I2C ports

Generally, to set up we use pins 3 and 4 (see the diagram below) to connect a device. In my case, it is a simple ‘plug-and-play’ real-time clock (RTC). …


You have a suite you wish to run, but need to constrain it such that it can run on your allocated queues — this guide explains how to break it into segments which allow you to do so.

Image for post
Image for post
Photo by Djim Loic on Unsplash

Accessing the run initialisation panel through rose

The run I am using is u-ca218 . First, you need to open the rose editor and navigate to suite conf → run initialisation and cycling using the menu on the left.

Here you will have a set of options including an initialisation file, calendar and other information.


Various two-factor authentication sites now require the use of an RSA key. For me, it is needed to log into the MONSooN supercomputer. Although this is often on my desk, it is still difficult to read when flat. For this reason, I created a stand and will detail the process here.

Image for post
Image for post

Start by measuring your current key

We begin by measuring our key. This is done in mm and the use of calipers can produce much more accurate results than a simple rule.

The main dimensions of my RSA key are approximately 20mm x 10mm with the screen being 5mm from the top and bottom.

Since we are not creating a sleave for the entire key the length measurement is not that important. …


Say you have branches for different aspects of the same project and you want to merge only a single file (e.g. the configuration file). Short of copy-pasting all the changes by hand, how might you approach this problem?

Image for post
Image for post
Photo by The Nigmatic on Unsplash

The Problem

So we have a branch. This branch contains an update, bug-fix or enchantment and we wish to pass that on to all our other branches. This can be for reasons that you want to keep a testing copy or share information between code that no longer has the same function between different parts of the same repository.

Here merging the entire body of code is impractical and overwriting the chosen file (e.g. with git checkout <branchname> <file> ) is counter-productive. So how else can we achieve such a feat? Well, the answer is simple and comes in the form of a --patch within git’s checkout function. …


A guide to trigger a data transfer or other process when inserting a USB in Linux

computer with USB ports — cover image
computer with USB ports — cover image
Photo by Tobias Lystad on Unsplash.

In our latest Raspberry Pi sensor project, we wanted to have a no-network approach to getting data automatically off it. The solution for this came through the running of a Python script on insertion of an “authorised” USB storage device.

In this article, I will explain how such a feat may be achieved.

The USB Rules

The simplest part lies in providing a set of rules on what to do upon insertion. These consist of a script for when we insert a USB and one for when we remove it:

ACTION=="add", SUBSYSTEM=="usb", PROGRAM="<full_path_here>/on_usb_in.sh"
ACTION=="remove", SUBSYSTEM=="usb", PROGRAM="<full_path_here>/on_usb_out.sh"

These two lines go into the etc/udev/rules.d directory. …


Sometimes we just want to know what is going on, but avoid a plethora of print statements.

A warning sign
A warning sign
Photo by Markus Spiske on Unsplash

In most scripts, you as the author are interested in knowing the progress of the code. This is particularly true when something inevitably goes wrong — and it will, no matter how good of a coder you are. This is where the Logging Module comes into its own.

Why use logging

When debugging a script we have two available channels, the standard output ( stdout ) and the standard error ( stderr ). Conventionally user outputs should be given within sdout as per the printstatement — now inconveniently the print function — , and progress reports are ‘logged’ withinstderr.

Skip the prints

The reason we don’t use print everywhere is that if we do the end-user is then flooded with a large amount of irrelevant (for them) information about what the code is doing, and when. …


Doing what we want, how we want it, on user ‘drag’ interaction in THREEjs (or d3 or anything really).

A series of vertically stacked networks — drag rotated across the horizontal
A series of vertically stacked networks — drag rotated across the horizontal
The Master Chemical Mechanism — Daniel Ellis 2020

THREEjs is a cross-over JavaScript library that allows us to unleash the potential of GPU driven graphics within the web browser. Although it provides both a orbitalControls and dragControls functions for object or scene manipulation, but what if we want a more personalised response on drag events? — this is what we shall cover here.

The code discussed within the article can apply to any HTML element, although the emphasis, in this case, is placed upon THREEjs. The only difference falls upon what goes into the dragAction function at the end.

— If you are new to the THREE.js library, have a browse through the following materials…


Substituting data into a text template using Python and Jinja2. This can be used for document, report and script generation — as well as static HTML pages.

A strip of images from medium articles, created through the methods described in this article
A strip of images from medium articles, created through the methods described in this article
Source: wolfiex.github.io/medium (self)

Introduction and Aims

For the purpose of this article, I wish to create web page summarising all my Medium articles. I start with a list of Titles, Subtitles and URLs and convert them into a static HTML page for viewing on my personal GitHub.io site.

This can be done in one of three ways:

  • Manual Copy, Paste and Edit — too time-consuming
  • Python string formatting — excessively complex
  • Using the Jinja templating language for Python — the aim of this article

Side Note: It is possible to accomplish the same task using Flask, however render_template already uses Jinja2 under the hood and we do not want the additional requirement of needing a webserver — so we ignore this solution.


Providing an easy method for collaborators to upload files to a filestore without the need for them to understand any code whatsoever

Image for post
Image for post
Photo by Hello I'm Nik 🎞 on Unsplash

When building a webserver we often wish to present an idea or topic. In the case of a static website, this can be done by including the relevant information within the source files. In more dynamic examples, an API (application programming interface) can be used to pre-process information before returning it to the user.

In this example, we design a simple flask app which only requires a user key and a web browser to work. The idea behind this is that anyone can use it, and it is a device (and operating system), independent.

Creating the flask app

As usual, we start by installing the relevant libraries for the server. The simplest way to do this is through the use of pip (pythons package manager). …

About

Daniel Ellis

Research Software Engineer specialising in Data Visualisation with a touch of HPC. — PhD in Atmospheric Chemistry and Masters in Theoretical Physics.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store