User Tools

Site Tools


wiki:documentation:computing

Computing resources

Lab github

All your code should be committed in a repository on our github. As per the lab manual, on Fridays your code should be pushed to the repository and up to date. Talk to me about how to organize your code.

Contributing to code

After getting access to github, here are the steps to follow to start developing:

Getting anaconda Most of our code is in python and to make development easier, it is tyically developed in a so-called anaconda environment. Install anaconda for your computer. The code you will work on either has a requirements.txt or environment.yml file in it. These files say which python packages need to be installed for the code to run.

Cloning a repository Read up online on how to clone a github repository and do so.

Anaconda environment

  • Create the suitable anaconda environment using the environment.yml or the requirements.txt file.
  • Learn how to create and activate environments here: conda environments
  • activate your new environment.

working with git So you have a copy of the code on your computer - what now? Let's say you want to play around and familiarize yourself with it. Do the following:

  • Create a git branch with an easy identifiable name eg monika_testing
  • go on your branch
  • Do some coding, exploration, plotting
  • Once you are happy with the state of your work, or it is Friday (as per lab manual): commit your changes to the code to your branch
  • push your changes to the online copy of the repository.

(the underlined terms are git commands. You will find a lot of literature about what they do. Git is very powerful, but also infinitely complex from the outside. Try focusing on the three commands here and you should be fine!)

Coding tips

general coding advice can be found under Coding Tips.

Lab email address

scholzlabcaesar@gmail.com Password is our standard lab password. Ask me if you don't know it.

remote computing on nif3004 or nif3011 via vnc

nif3004 is a decent work station loated in Monika's office. It can be used for behavior analysis and other simple tasks. it does not have a lot of storage so plan to move your data to soma after compression.

nif3011 is located in the behavior room. It is a server workstation with 256GB of RAM and 24 physical cores (AMD EPYC 7402P 24-Core Processor). We currently (May 2020) have only 3.2TB of space on there which should be used transiently. Please run your analyses in a timely manner and then move your data to soma.

  • Ask Monika for an account. Your account will be FirstInitialLastname
  • on windows: install tightvnc
  • you need to be on the caesar ethernet or vpn, otherwise this won't work.

Log in to nif3004/nif3011 using ssh

  • open the windows console
  • ssh username@nif3004
  • enter your password when prompted. You should see that your console changes and now says username@nif3004$
  • start a new vnc session by typing vncserver (if you have an old session, you can see a list of your old sessions by typing vncserver -list)
  • make a note of the display number eg. :4. Let's call it x
  • type exit to leave the ssh session

If you get an Error: X connection to :6 broken (explicit kill or server shutdown). that you need to save this script under /home/username/.vnc:

xstartup
#!/bin/sh
dbus-launch xfce4-session

create an ssh tunnel and start vnc on windows

  • in your windows console type ssh -L <5900+x>:localhost:<5900+x> username@nif3004
  • type your password and again, your console should change to username@nif3004$
  • open tightvnc Viewer
  • type 'localhost:x' in the text field and connect
  • type your vnc password (you will get prompted to set that password the first time you start vncserver)
  • you should see a GUI. Start computing!

Installing PharaGlow on nif3004 or nif4011 (Ask Monika for help)

  • type “conda” in the terminal. If the command isn't found open .bashrc and at the bottom of the file add:

#set conda command
export PATH=/opt/anaconda/bin:$PATH

  • log in to your nif3004 account via ssh/vnc and open a terminal (remote computing on nif3004 via vnc)
  • obtain the environment file for the correct pumping environment environmentpumping.yml:
  • in a terminal on nif3004 type: conda env create -f ~/environmentpumping.yml
  • activate the environment: source activate pumping. You should see (pumping) appear at the start of the terminals prompt. Your are now in a so-called python environment that is standardized for running pharaglow.
  • enter the directory of pharaglow e.g.: cd PharaGlow
  • type python setup.py install - -user (this is a double dash line and not a single dash line i.e. -/- without the / in between). Look at the text output. There shouldn't be any errors.
  • test your installation by opening a python prompt in the terminal: python
  • import pharaglow - if no error then pharaglow was installed properly
  • exit the prompt by typing exit()
  • To update PharaGlow:
    • activate the environment: source activate pumping. You should see (pumping) appear at the start of the terminals prompt. Your are now in a so-called python environment that is standardized for running pharaglow.
    • enter the directory of pharaglow e.g.: cd PharaGlow
    • pull pharaglow from the lab github:git pull https://github.com/scholz-lab/PharaGlow.git enter your github username and password when prompted.
    • type python setup.py install - -user (this is a double dash line and not a single dash line i.e. -/- without the / in between). Look at the text output. There shouldn't be any errors.
    • test your installation by opening a python prompt in the terminal: python
    • exit the prompt by typing exit()

Running PharaGlow on nif3004

If everything is installed as per the following section, follow these steps to open a jupyter notebook to analyze movies:

  • open a terminal and type source activate pumping to activate the environment
  • open a jupyter notebook server by typing jupyter notebook (1)
  • in the new browser window, navigate to your jupyter notebook and start analyzing!

(1) To open a jupyter notebook which is in an external drive, by example hd2, write in the terminal “cd /media/scholz_la/hd2” then “jupyter notebook”

Running jupyter notebooks on nif3004

If you only need to run a jupyter notebook, but don't need the full Desktop experience that you can get from vnc, follow these steps:

  • in your windows console type ssh -X username@nif3004
  • If you are logging in via vpn, you need to know the IP of the computer and use this code instead:ssh -X username@IP. Most of the time the correct IP will be 10.40.100.7
  • You will be prompted for a password and be logged into nif3004.
  • open a terminal and type source activate pumping to activate the environment
  • open a jupyter notebook server by typing jupyter notebook –no-browser –port=WXYZ. WXYZ should be a 4 digit number.
  • open a second console and type ssh -L localhost:ABCD:localhost:WXYZ username@10.40.100.7. ABCD should be a 4 digit number.
  • in your browser type localhost:ABCD. (e.g. I use ABCD = 5920 and WXYZ =1234. Please don't use the exact same ports or I will be unable to access my stuff :-) )
  • You should see the familiar jupyter home page show up or you will be prompted for a token/password. The password is generated when you open jupyter. Check the first console and you should find the correct token.

Getting access to Axon and Soma

Actions to get access to the servers Axon (computing server located @ the Max Planck Computing & Data Facility or MPCDF) and Soma (storage server @ caesar):

Under the preferred cluster option choose Axon. It will take a while until they generate the account. They will send you an email once this is done. Keep a record of your password, because they will not send it to you.

  • Once your account has been generated, contact Mario Wolf: mario.wolf@caesar.de to get an account at soma with the same user ID. This will be required to get the two servers communicating properly.

You will access soma using your regular caesar account. Underneath, both servers will communicate using the MPCDF account.

  • Finally, access Soma using the following procedure:

For Linux:

 mount -t cifs //soma.ad01.caesar.de/nif /mnt/ -o username=YOURUSERNAME,vers=2.0,rw 

Version 2.0 is so far the fastest.

For Windows: use the following link in explorer:

\\soma.ad01.caesar.de\nif 

or mount it as HD. Again, for both options, use the user and password from caesar, not the one from MPCDF

Computing on Axon

Axon is a computing cluster hosted by the MAX PLANCK COMPUTING AND DATA FACILITY (MPCDF) in Garching for caesar. The neat thing is that soma is directly accesible from axon, meaning we can move our data to soma (storage) and perform computations on axon (actual computer). The following protocol shows you

  1. How to log into axon
  2. Where soma is located on axon
  3. How to run pharaglow on axon

How to log into axon

(see also https://www.mpcdf.mpg.de/userspace/new-users) for reference and great documentation! They are also very helpful so feel free to ask the staff for help if you are very stuck.

  1. Login to a gateway node using your axon credentials (NOT caesar):
    config
    ssh <username>@gate.rzg.mpg.de
  1. Hop further onto an axon login node:
    ssh <username>@axon01.bc.rzg.mpg.de

wiki:documentation:axoncluster.png

Advanced: To make this a little easier, you can set up an ssh config file to directly jump through gateway: https://wiki.gentoo.org/wiki/SSH_jump_host.

This is what an ssh config file looks like for gateway/axon:

### First jumphost. Directly reachable
Host gateway
  HostName gate.rzg.mpg.de
  User mscholz
 
### Host to jump to via jumphost1.example.org
Host axon
  HostName axon01.bc.rzg.mpg.de
  User mscholz
  ProxyJump mscholz@gateway

After saving this file in your .ssh directory, you should be able to type just

 ssh axon

Where is soma located on axon?

soma can be found under

/soma/soma_fs/nif

How to run pharaglow on axon

Setting up your code (once)

1. On a server, you need to load the programs and software you will use. In the axon shell you can type

module load anaconda

2. Follow the PharaGlow README to git clone pharaglow and install the conda environment. This will take a few minutes.

3. activate the environment and install Pharaglow

Running code

1. You will always need to load anaconda

module load anaconda
conda activate pumping

2. To run a jupyter notebook, (similar instructions for nif3004/nif3011 are here)

 jupyter notebook --no-browser --port=WXYZ. 

On your computer open a second terminal/shell to enable port-forwarding:

ssh -L localhost:ABCD:localhost:WXYZ username@axon

and open the jupyter notebook in your browser by typing ''localhost:ABCD'' in the address bar.

wiki/documentation/computing.txt · Last modified: 2020/08/11 23:55 by mscholz

Bitnami