Colombia 2024: Difference between revisions

From The Yambo Project
Jump to navigation Jump to search
(Created page with "=== General instructions to run tutorials === Please don't forget to '''run all tutorials in your scratch directory''': $ echo $CINECA_SCRATCH /m100_scratch/userexternal/username $ cd $CINECA_SCRATCH Computational resources are managed by the job scheduling system [https://slurm.schedmd.com/overview.html Slurm]. Most part of Yambo tutorials during this school can be run in serial, except some that need to be executed on multiple processors. Generally, Slurm batch jo...")
 
No edit summary
Line 1: Line 1:
=== General instructions to run tutorials ===
=== General instructions to run tutorials ===


Please don't forget to '''run all tutorials in your scratch directory''':
Computational resources are managed by the job scheduling system [https://slurm.schedmd.com/overview.html Slurm]. Most part of Yambo tutorials during this school can be run in serial, except some that need to be executed on multiple processors. Generally, Slurm batch jobs are submitted using a script, but the tutorials here are better understood if run interactively. The two procedures that we will use to submit interactive and non interactive jobs are explained below.
$ echo $CINECA_SCRATCH
/m100_scratch/userexternal/username
$ cd $CINECA_SCRATCH


Computational resources are managed by the job scheduling system [https://slurm.schedmd.com/overview.html Slurm]. Most part of Yambo tutorials during this school can be run in serial, except some that need to be executed on multiple processors. Generally, Slurm batch jobs are submitted using a script, but the tutorials here are better understood if run interactively. The two procedures that we will use to submit interactive and non interactive jobs are explained below.
== Run a job using a batch script ==


''' - Run a job using a batch script '''
This procedure is suggested for the tutorials and examples that need to be run in parallel. In these cases you need to submit the job using a batch script <code>job.sh</code>, whose generic structure is the following:
This procedure is suggested for the tutorials and examples that need to be run in parallel. In these cases you need to submit the job using a batch script <code>job.sh</code>, whose generic structure is the following:
  $ more job.sh
  $ more job.sh
  #!/bin/bash
  #!/bin/bash
  #SBATCH --account=tra23_Yambo          # Charge resources used by this job to specified account
  #SBATCH --account=tra24_ictpcolo        # Charge resources used by this job to specified account
  #SBATCH --time=00:10:00                # Set a limit on the total run time of the job allocation in hh:mm:ss
  #SBATCH --time=00:10:00                # Set a limit on the total run time of the job allocation in hh:mm:ss
  #SBATCH --job-name=JOB                  # Specify a name for the job allocation
  #SBATCH --job-name=JOB                  # Specify a name for the job allocation
  #SBATCH --partition= m100_sys_test     # Request a specific partition for the resource allocation
  #SBATCH --partition= dcgp_usr_prod     # Request a specific partition for the resource allocation
#SBATCH --qos=qos_test                  # qos = quality of service
#SBATCH --reservation=s_tra_yambo      # Reservation specific to this school
  #           
  #           
  #SBATCH --nodes=<N>                    # Number of nodes to be allocated for the job
  #SBATCH --nodes=<N>                    # Number of nodes to be allocated for the job
Line 25: Line 19:
   
   
  module purge
  module purge
  module load hpc-sdk/2022--binary
  module load profile/chem-phys
  module load spectrum_mpi/10.4.0--binary
  module load yambo/5.2.2--intel-oneapi-mpi--2021.10.0--oneapi--2023.2.0
export PATH=/m100_work/tra23_Yambo/softwares/YAMBO/5.2-mpi/bin:$PATH
   
   
  export OMP_NUM_THREADS=<nc>
  export OMP_NUM_THREADS=<nc>
  mpirun --rank-by core -np ${SLURM_NTASKS} yambo -F <input> -J <output>
  mpirun --rank-by core -np ${SLURM_NTASKS} yambo -F <input> -J <output>


Line 47: Line 39:
  $ scancel <JOBID>  
  $ scancel <JOBID>  


== Open an interactive session ==


''' - Open an interactive session '''
This procedure is suggested for most of the tutorials, since the majority of these is meant to be run in serial (relatively to MPI parallelization) from the command line. Use the command below to open an interactive session of 1:30 hour (complete documentation [https://slurm.schedmd.com/srun.html here]):
 
  $ srun --nodes=1 --ntasks-per-node=4 --cpus-per-task=8 --account=tra24_ictpcolo --partition=dcgp_usr_prod --time=1:30:00 --gres=tmpfs:10g --pty /bin/bash
This procedure is suggested for most of the tutorials, since the majority of these is meant to be run in serial (relatively to MPI parallelization) from the command line. Use the command below to open an interactive session of 1 hour (complete documentation [https://slurm.schedmd.com/salloc.html here]):
  srun: job 8338413 queued and waiting for resources
  $ salloc -A tra23_Yambo -p m100_sys_test -q qos_test --reservation=s_tra_yambo --nodes=1 --ntasks-per-node=1 --cpus-per-task=4 -t 01:00:00
  srun: job 8338413 has been allocated resources
  salloc: Granted job allocation 10164647
  [username@lrdn4735 ~]$
  salloc: Waiting for resource configuration
  salloc: Nodes r256n01 are ready for job


We ask for 4 cpus-per-task because we can exploit OpenMP parallelization with the available resources.
We ask for 4 cpus-per-task because we can exploit OpenMP parallelization with the available resources.


With <code>squeue</code> you can see that there is now a job running:
  username@'''lrdn4735'''$ cd $SCRATCH
$ squeue -u username
              JOBID PARTITION    NAME    USER ST      TIME  NODES NODELIST(REASON)
          10164647 m100_usr_ interact username  R      0:02      1 r256n01
 
To run the tutorial, <code>ssh</code> into the node specified by the job allocation and <code>cd</code> to your scratch directory:
username@'''login02'''$ ssh r256n01
...
  username@'''r256n01'''$ cd $CINECA_SCRATCH


Then, you need to manually load <code>yambo</code> as in the batch script above. Please note that the serial version of the code is in a different directory and does not need <code>spectrum_mpi</code>:
Then, you need to manually load <code>yambo</code> as in the batch script above. Please note that the serial version of the code is in a different directory and does not need <code>spectrum_mpi</code>:
  $ module purge
  $ module purge
  $ module load hpc-sdk/2022--binary spectrum_mpi/10.4.0--binary
  $ module load profile/chem-phys
$ export PATH=/m100_work/tra23_Yambo/softwares/YAMBO/5.2-cpu/bin:$PATH
$ module load yambo/5.2.2--intel-oneapi-mpi--2021.10.0--oneapi--2023.2.0
 


Finally, set the <code>OMP_NUM_THREADS</code> environment variable to 4 (as in the <code>--cpus-per-task</code> option):
Finally, set the <code>OMP_NUM_THREADS</code> environment variable to 4 (as in the <code>--cpus-per-task</code> option):
Line 78: Line 62:
To close the interactive session when you have finished, log out of the compute node with the <code>exit</code> command, and then cancel the job:
To close the interactive session when you have finished, log out of the compute node with the <code>exit</code> command, and then cancel the job:
  $ exit
  $ exit
$ scancel <JOBID>
''' - Plot results with gnuplot '''
During the tutorials you will often need to plot the results of the calculations. In order to do so '''open a new terminal window''' and connect enabling X11 forwarding with the <code>-X</code> option:
$ ssh -X m100
Please note that <code>gnuplot</code> can be used in this way only from the login nodes:
username@'''login01'''$ cd <directory_with_data>
username@'''login01'''$ gnuplot
...
Terminal type is now '...'
gnuplot> plot <...>


== Tutorials ==
== Tutorials ==

Revision as of 11:26, 15 October 2024

General instructions to run tutorials

Computational resources are managed by the job scheduling system Slurm. Most part of Yambo tutorials during this school can be run in serial, except some that need to be executed on multiple processors. Generally, Slurm batch jobs are submitted using a script, but the tutorials here are better understood if run interactively. The two procedures that we will use to submit interactive and non interactive jobs are explained below.

Run a job using a batch script

This procedure is suggested for the tutorials and examples that need to be run in parallel. In these cases you need to submit the job using a batch script job.sh, whose generic structure is the following:

$ more job.sh
#!/bin/bash
#SBATCH --account=tra24_ictpcolo        # Charge resources used by this job to specified account
#SBATCH --time=00:10:00                 # Set a limit on the total run time of the job allocation in hh:mm:ss
#SBATCH --job-name=JOB                  # Specify a name for the job allocation
#SBATCH --partition= dcgp_usr_prod      # Request a specific partition for the resource allocation
#          
#SBATCH --nodes=<N>                     # Number of nodes to be allocated for the job
#SBATCH --ntasks-per-node=<nt>          # Number of MPI tasks invoked per node
#SBATCH --ntasks-per-socket=<nt/2>      # Tasks invoked on each socket
#SBATCH --cpus-per-task=<nc>            # Number of OMP threads per task

module purge
module load profile/chem-phys
module load yambo/5.2.2--intel-oneapi-mpi--2021.10.0--oneapi--2023.2.0

export OMP_NUM_THREADS=<nc>
mpirun --rank-by core -np ${SLURM_NTASKS} yambo -F <input> -J <output>

This procedure is suggested for the tutorials and examples that need to be run in parallel. In these cases you need to submit the job using a batch script job.sh. The complete list of Slurm options can be found here. However you will find ready-to-use batch scripts in locations specified during the tutorials.

To submit the job, use the sbatch command:

$ sbatch job.sh
Submitted batch job <JOBID>

To check the job status, use the squeue command:

$ squeue -u <username>
             JOBID PARTITION     NAME     USER ST       TIME  NODES NODELIST(REASON)
             <...>  ...      JOB username  R       0:01    <N> <...>

If you need to cancel your job, do:

$ scancel <JOBID> 

Open an interactive session

This procedure is suggested for most of the tutorials, since the majority of these is meant to be run in serial (relatively to MPI parallelization) from the command line. Use the command below to open an interactive session of 1:30 hour (complete documentation here):

$ srun --nodes=1 --ntasks-per-node=4 --cpus-per-task=8 --account=tra24_ictpcolo --partition=dcgp_usr_prod --time=1:30:00 --gres=tmpfs:10g --pty /bin/bash
srun: job 8338413 queued and waiting for resources
srun: job 8338413 has been allocated resources
[username@lrdn4735 ~]$

We ask for 4 cpus-per-task because we can exploit OpenMP parallelization with the available resources.

username@lrdn4735$ cd $SCRATCH

Then, you need to manually load yambo as in the batch script above. Please note that the serial version of the code is in a different directory and does not need spectrum_mpi:

$ module purge
$ module load profile/chem-phys
$ module load yambo/5.2.2--intel-oneapi-mpi--2021.10.0--oneapi--2023.2.0


Finally, set the OMP_NUM_THREADS environment variable to 4 (as in the --cpus-per-task option):

$ export OMP_NUM_THREADS=4

To close the interactive session when you have finished, log out of the compute node with the exit command, and then cancel the job:

$ exit

Tutorials

You can download the needed files for the tutorial. After you can open the interactive session and login into the node

salloc -A tra23_Yambo -p m100_sys_test -q qos_test --reservation=s_tra_yambo --nodes=1 --ntasks-per-node=1 --cpus-per-task=4 -t 04:00:00
ssh PUT HERE THE ASSIGNED NODE NAME AFTER salloc COMMAND
module purge
module load hpc-sdk/2022--binary spectrum_mpi/10.4.0--binary
export PATH=/m100_work/tra23_Yambo/softwares/YAMBO/5.2-cpu/bin:$PATH
cd $CINECA_SCRATCH
cd YAMBO_TUTORIALS 

DAY 1 - Monday, October 18th

16:15 - 18:30 From the DFT ground state to the complete setup of a Many Body calculation using Yambo

To get the tutorial files needed for the following tutorials, follow these steps:

$ wget https://media.yambo-code.eu/educational/tutorials/files/hBN.tar.gz
$ wget https://media.yambo-code.eu/educational/tutorials/files/hBN-2D.tar.gz
$ ls
hBN-2D.tar.gz  hBN.tar.gz
$ tar -xvf hBN-2D.tar.gz
$ tar -xvf hBN.tar.gz
$ ls
hBN-2D hBN hBN-2D.tar.gz  hBN.tar.gz

Now that you have all the files, you may open the interactive job session with salloc as explained above and proceed with the tutorials.

DAY 2 - Tuesday, October 19th

14:00 - 16:30 A tour through GW simulation in a complex material (from the blackboard to numerical computation: convergence, algorithms, parallel usage)

To get all the tutorial files needed for the following tutorials, follow these steps:

wget https://media.yambo-code.eu/educational/tutorials/files/hBN.tar.gz
wget https://media.yambo-code.eu/educational/tutorials/files/MoS2_2Dquasiparticle_tutorial.tar.gz
tar -xvf hBN.tar.gz
tar -xvf MoS2_2Dquasiparticle_tutorial.tar.gz
cd hBN

Now you can start the first tutorial:

If you have gone through the first tutorial, pass now to the second one:

cd $CINECA_SCRATCH
cd YAMBO_TUTORIALS
cd MoS2_HPC_tutorial

Lectures

DAY 1 - Monday, 22 May

DAY 2 - Tuesday, 23 May

DAY 3 - Wednesday, 24 May

DAY 4 - Thursday, 25 May