BerkeleyGW tutorial, Benasque 2022
NOTE: This tutorial page is set up for the Benasque TDDFT school 2022.
Your instructors: David Strubbe and Rafael Del Grande, Department of Physics, University of California, Merced.
Interacting with Cori
For this tutorial, since some of the calculations will be excessively time-consuming or taxing for a laptop, we will use the Cori supercomputer, at the National Energy Research Scientific Computing (NERSC) center in Berkeley, California, which has graciously provided us with temporary accounts and queue access. There are a few key things you need to know about how to interact with the machine:
- Get your training account here. Even if you have a NERSC account already, the training account is recommended since it has a known common environment in which we have tested the tutorial scripts. The instructors will supply you with a code for this training session. Be prepared to note the username and password resulting from claiming your training account. It may take a few minutes for your account to be ready to use to login. Just be patient or try several times until it works.
- Inconveniently, you may need to circumvent NERSC's request for a multi-factor authentication (MFA) one-time password at login. Proceed as follows: go here, select"Login", then select "National Eenergy Research Scientific Computing center" as the institution, and enter your training account username and password. In case you are asked for the one-time password, click "MFA not working?" at the bottom, to ask for an email to be sent to your address giving a one-time password which you can use to log in. If you would use this account further, you should set up MFA as described here. However, if you manage not to break the connection and remain logged in, you will need to do this only once.
- To read the README.md files, run examples, and study the results, we recommend using JupyterLab on Cori. Go to the Jupyter hub and if you are logged in already in another window, you should just get access without another login needed. Follow this tutorial to see how to use the Jupyter interface; note that the first slides about how to login in are a bit different (and were described above instead).
- When you have logged in to Jupyter, you may find a bunch of random files present from other tutorials (including maybe even a BerkeleyGW one) which were supposed to be deleted by NERSC but are still hanging around. You can just delete them to avoid confusion.
- Be aware that since this machine is far away, running X-Windows programs will be very slow.
For visualization with XCrySDen or other tools, installing and running those visualization codes on your laptop is recommended.
- We submit jobs using the SLURM queue manager, using a "reservation" for Oct 24 from 15:00 to 19:00, which provides dedicated queue access for us. If you want to run outside of these times, use the debug queue. The tutorials are designed to be run using an "interactive job", in which you have a node continually available for your use and then executables launched from the command line are run immediately. This will be handled for you by the benasque_interactive script, but in case you need to do it by hand, proceed as below.
- Start an interactive job like this (do not submit more than one): salloc -N 1 -q regular --reservation=benasque2022 -t 03:00:00 -C haswell
- If you are using the debug queue rather than a reservation, use this: salloc -N 1 -q debug -t 00:30:00 -C haswell
- To copy files from Cori to your local machine, in a terminal on your local machine, write scp trainXXX@cori.nersc.gov:FULL_PATH_TO_YOUR_FILE . (filling in the username and filename) and enter your password when prompted. For very small ASCII files, you may find cut and paste more convenient.
- To see if you have jobs running, do squeue -u trainXXX. You should not have more than one in the queue; if you do, cancel them with scancel JOBID, filling in the number for JOBID from the output of squeue.
- Accounts will expire on October 29. Feel free to copy the files off the machine before that to somewhere else for your future reference.
Documentation and resources
Environment setup: The first time you log in, execute these lines which will help you see color-coding for what is a link, executable, or directory:
echo 'alias ls="ls --color"' >> ~/.bashrc.ext
Then, log off and log in to Cori again.
Each time you log in, and in any new terminal window you open, you should do this:
module load /project/projectdirs/mp149/Benasque2022/benasque-tutorial
# Go to the scratch directory, where all runs should happen.
Please, run all your calculations in the scratch space in an interactive job. We have a limited reservation on Cori, so, please, do not start more than one interactive queue simultaneously with the benasque_interactive command!
To begin with the examples,
# List all examples available
# Copy 1-benzene example to your directory
cp -R /project/projectdirs/mp149/Benasque2022/1-benzene .
# Go to your local folder and follow instructions
Note that the example folders are large, so don't be surprised if the copying takes a little while. Click on each README.md file to read it, before proceeding. These files contain the required steps for the calculations and questions to make sure you understand the process to run a GW-BSE calculation.
Recommended order to do tutorials
- 1-benzene, GW and Bethe-Salpeter, starting from Octopus -- using version 9.2 due to some issues to be resolved with 12.1 for these calculations
- 2-silicon, Bethe-Salpeter, starting from Quantum ESPRESSO
- LiCl, exciton visualization with PlotXct (download here or from Cori, unpack the archive with tar xvzf xct_LiCl.xsf, and follow README)
Test your knowledge with a quiz! (Inspired by Kieron Burke's famous DFT quiz.)
For historical interest