Repository for tutorials, examples and starter scripts for using the MTU HPC cluster

Overview

MTU-HPC-Starter

Repository for tutorials, examples and starter scripts for using the MTU HPC cluster

Connecting to the MTU HPC cluster

Within the college, access to the cluster is via SSH to the host:

com-gpu-cluster.cit.ie

On Windows the simplest way to get an SSH client is to use PuTTy. This is available on all lab PCs.

Linux machines usually have an SSH client on the terminal.

An account on the MTU HPC cluster is usually requested for you by your lecturer or supervisor.

Setup git

Get the Starter Repository using git:

This repository contains some useful sample code for running and submitting jobs on the MTU HPC cluster. This repo can be cloned into your home directory on the HPC cluster and used as a starting point for some your own work.

Once logged into the cluster, use the command at the root of your home directory:

git clone https://github.com/MTU-HPC/MTU-HPC-Starter.git

This will download some basic scripts for getting started with your own projects on thr MTU HPC. Git pull from this repo sometimes as it will be updated with new examples as needed.


Using Miniconda for Python.

THe MTU HPC cluster has a number of versions of Python, Tensorflow and other libraries needed for ML scripts. However, it is dificult to maintain Python libraries and versions systemwide that suit everyone.

To help with this and provide options for users, we have installed Miniconda systemwide. Miniconda allows users to install multiple Python versions and Python libraries in their own separate "environments". This can be done without needing administrator permissions.

Creating and activating conda environments for running python scripts

To use Miniconda, you should have a ".condarc" file at the root of your Home directory. At a minimum it should have the text listed below.

.condarc:

env_prompt: '({name})'
auto_activate_base: false
channels:
  - conda-forge
  - bioconda
  - defaults

The .condarc file tells Miniconda/conda to:

  • env_prompt --- put the name of your currently active conda environment at the front of your command prompt
  • auto_activate_base --- When you login to your cluster account, it will not automatically put you in the base conda environment.
  • channels --- The web repo/location conda install will install Python and Python packages from. "conda-forge" has many ML/AI/Data Analytics packages available.

To see if you already have the .condarc file, type at the commandline:

ls -la

to get a list of files in your home directory. If .condarc is not there, it can be created using the "nano" text editor:

nano .condarc

and copy and paste the text above into .condarc.

One-time only: Initialise conda in your account

To use conda, it must be "initialised" once before it can be used.

To initialise conda, run the following command:

conda init

You will need to exit your SSH session and reconnect for conda to be ready for use. This does not need to be done again.

Create a conda environement for running code

To create a conda environment type the following at the commandline:

conda create --name my_python3_env python=3.8

This create an environemnt called "my_python3_env" and it will install Python 3.8 into that environment. If you don't specify the version of Python, it will install the latest version it can find.

To see your environmensts type:

conda env list

This will should show you 2 environemts now:

  • the base environment
  • my_python3_env - the one we just created. The name is whatever you wish it to be.

At this stage, we have created an envrionment, but we are not using it yet.

Activating a conda environment

Before anything else, type:

 python --version 

This should show you Python 2.7 or some such old Python. This is because the "system" Python is version 2.7. Running a Python script from the commandline now would need the Python script to be compatible with that old version. We cannot upgrade the system python because the operating system itself relies on old Python scripts.

Activate your new conda environment with:

 conda activate my_python3_env

Now run python --version again. The version is now something like Python 3.8. After activating the conda environemnt, we are now using the version of Python you have installed. We are also using the Python packages that are inside this new environment.

Adding packages to a conda enironment

When you are in a "conda" environemt (i.e. the environemnt is "active") the start of your command propmt should show the name of the environment:

(my_python3_env) username@com-gpu-cluster ~]$

To install something like "matplotlib", use conda to install it:

 conda install matplotlib yaml 

That last command will try to install the 2 packages "matplotlib" and "yaml" into the current active conda environment.

Managing conda environments

If you have 5 programs that use matplotlib and Python 3.8, they can all use the same conda environment. There is no need to create a new environment for every program or script.

If, however, you need to run a library which only works on Python 3.6 or needs very different packages to your main environment, you could create a new conda environment for running those scripts:

conda create --name biology_python_env python=3.6
conda activate biology_python_env
conda install 
   

   

Deactivating conda environment

When you are finished, or you wish to use a different conda environment you can exit from the conda environemnt thus:

conda deactivate
You might also like...
Main repository for the Sphinx documentation builder

Sphinx Sphinx is a tool that makes it easy to create intelligent and beautiful documentation for Python projects (or other documents consisting of mul

Generate a single PDF file from MkDocs repository.

PDF Generate Plugin for MkDocs This plugin will generate a single PDF file from your MkDocs repository. This plugin is inspired by MkDocs PDF Export P

Canonical source repository for PyYAML

PyYAML - The next generation YAML parser and emitter for Python. To install, type 'python setup.py install'. By default, the setup.py script checks

This is a repository for "100 days of code challenge" projects. You can reach all projects from beginner to professional which are written in Python.

100 Days of Code It's a challenge that aims to gain code practice and enhance programming knowledge. Day #1 Create a Band Name Generator It's actually

Repository for learning Python (Python Tutorial)

Repository for learning Python (Python Tutorial) Languages and Tools 🧰 Overview 📑 Repository for learning Python (Python Tutorial) Languages and Too

Generate YARA rules for OOXML documents using ZIP local header metadata.

apooxml Generate YARA rules for OOXML documents using ZIP local header metadata. To learn more about this tool and the methodology behind it, check ou

This is a tool to make easier brawl stars modding using csv manipulation

Brawler Maker : Modding Tool for Brawl Stars This is a tool to make easier brawl stars modding using csv manipulation if you want to support me, just

A swagger tool for tornado, using python to write api doc!
A swagger tool for tornado, using python to write api doc!

SwaggerDoc About A swagger tool for tornado, using python to write api doc! Installation pip install swagger-doc Quick Start code import tornado.ioloo

A Python library for setting up projects using tabular data.

A Python library for setting up projects using tabular data. It can create project folders, standardize delimiters, and convert files to CSV from either individual files or a directory.

Owner
null
This is a template (starter kit) for writing Maturity Work with Sphinx / LaTeX at Collège du Sud

sphinx-tm-template Ce dépôt est un template de base utilisable pour écrire ton travail de maturité dans le séminaire d'informatique du Collège du Sud.

null 6 Dec 22, 2022
PythonCoding Tutorials - Small functions that would summarize what is needed for python coding

PythonCoding_Tutorials Small functions that would summarize what is needed for p

Hosna Hamdieh 2 Jan 3, 2022
CoderByte | Practice, Tutorials & Interview Preparation Solutions|

CoderByte | Practice, Tutorials & Interview Preparation Solutions This repository consists of solutions to CoderByte practice, tutorials, and intervie

Eda AYDIN 6 Aug 9, 2022
An introduction to hikari, complete with different examples for different command handlers.

An intro to hikari This repo provides some simple examples to get you started with hikari. Contained in this repo are bots designed with both the hika

Ethan Henderson 18 Nov 29, 2022
Automatic links from code examples to reference documentation

sphinx-codeautolink Automatic links from Python code examples to reference documentation at the flick of a switch! sphinx-codeautolink analyses the co

Felix Hildén 41 Dec 17, 2022
In this Github repository I will share my freqtrade files with you. I want to help people with this repository who don't know Freqtrade so much yet.

My Freqtrade stuff In this Github repository I will share my freqtrade files with you. I want to help people with this repository who don't know Freqt

Simon Kebekus 104 Dec 31, 2022
A collection of lecture notes, drawings, flash cards, mind maps, scripts

Neuroanatomy A collection of lecture notes, drawings, flash cards, mind maps, scripts and other helpful resources for the course "Functional Organizat

Georg Reich 3 Sep 21, 2022
Jupyter Notebooks as Markdown Documents, Julia, Python or R scripts

Have you always wished Jupyter notebooks were plain text documents? Wished you could edit them in your favorite IDE? And get clear and meaningful diff

Marc Wouts 5.7k Jan 4, 2023
This repository outlines deploying a local Kubeflow v1.3 instance on microk8s and deploying a simple MNIST classifier using KFServing.

Zero to Inference with Kubeflow Getting Started This repository houses all of the tools, utilities, and example pipeline implementations for exploring

Ed Henry 3 May 18, 2022
Main repository for the Sphinx documentation builder

Sphinx Sphinx is a tool that makes it easy to create intelligent and beautiful documentation for Python projects (or other documents consisting of mul

null 5.1k Jan 2, 2023