Skip to content

QEC-pages/programming-workshop

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A programming workshop

Learn how to run jobs on HPCC and related tools to boost programming efficiency, including git/github, emacs, tmux, Makefile, oh-my-zsh. There are also some optional topics like VS Code, Docker, auctex.

Content

Material

  • All material are saved or linked in this repo. To download it, run git clone https://github.com/QEC-pages/programming-workshop.git or git clone [email protected]:QEC-pages/programming-workshop.git with ssh
  • To synchronize the update, run git pull within the folder
    • If you have edited files locally, git pull may produce a conflict. Before learning git, a work-around is running git clone ... in a new empty folder.

Session 1: HPCC basics

  • HPCC
    • HPCC is the cluster computer at UCR. Before the workshop, try to finish the following two steps to make sure you can access it through ssh and run basic linux command
    • obtain an account
    • get started
    • a tip: ssh without pasword
    • job management
    • parallel computing with openmp
      • e.g. parfor in c++, gap, matlab, python, etc
    • nodes specification
    • Everything else in this workshop shall work in any unix-like environment. But usually we rely on the computing power of HPCC to do heavy calculations.

Session 2: Linux basics

  • Editor and Window management
    • emacs
      • emacs filename open file
      • C-x C-s save
      • C-x C-c exit
      • .emacs see sameple
      • emacs --daemon and emacsclient read more
    • tmux
      • module load tmux
      • tmux start a new seesion
      • tmux a attach to previous session
      • .tmux.conf see sample
      • tmux-resurrect save window layout
    • VS Code and rmate (not to be covered here, HPCC is not VS Code-friendly)
  • Makefile

session 3: Git-related and C++ coding style

  • Git/GitHub
    • git is a version control software, and github is one of the online hosts.
    • Git
    • basic commands
mkdir my-first-repo
cd my-first-repo
git init
echo "hello git" >> README.md
git add README.md
git commit -m "my first commit"
  • show info
git status
git log
git config --list
  • you might need to set up name and email
git config --global user.name "Some Name"
git config --global user.email "[email protected]"
  • GitHub We will create several repos in the QEC-pages to demonstrate how to collaborate through branches and pull requests.
git clone ...
git push
- Move your local repo to GitHub
  - This happen when the code or repo is already on your local machine
  - Create an empty repo on Github and then you will see the instruction there.
  • oh-my-zsh
    • homepage
    • oh-my-zsh is a version of zsh, an ultimate alternative to bash. It helps to work with git in terminal.
    • we will also make use of ~/.bashrc and similar files here.
  • C++
  • Homework
    • Send a pull request to this repo programming workshop, where you don't have write access. (e.g. fix some typo, add a link to a resource page, or improving the text format.) You should fork this repo to your own account, make changes and commit, then send the pull request.
    • Make some commit and create a new branch in this repo min weight decoder, where you should have been granted write access.
    • Optional: write a min weight decoder for the Hamming code, classical [7,4,3] first, and then quantum [[7,1,3]]. references: wiki, pdf, linear code

session 4: Try a real project.

Session 5: Some fancy trick (optional)

  • Docker
    • Debug the program, instead of the environment.
  • Gitpod
    • Bring docker online
  • GitHub Action
    • Automation with docker
    • Example: generate doxygen document for a C++ repo automatically
  • Github Page
    • A static website to present your repo