Biowulf High Performance Computing at the NIH
Hail on Biowulf

Hail is an open-source, scalable framework for exploring and analyzing genomic data. See https://hail.is/docs/stable/getting_started.html for more information.

Documentation
Important Notes

Interactive job
Interactive jobs should be used for debugging, graphics, or applications that cannot be run as batch jobs.

Allocate an interactive session and run the program. Sample session:

[user@biowulf]$ sinteractive -c 16 --mem 40g
salloc.exe: Pending job allocation 46116226
salloc.exe: job 46116226 queued and waiting for resources
salloc.exe: job 46116226 has been allocated resources
salloc.exe: Granted job allocation 46116226
salloc.exe: Waiting for resource configuration
salloc.exe: Nodes cn3144 are ready for job

[user@cn3144 ~]$ module load hail
[+] Loading hail  0.2.3 on cn3344 
[+] Loading singularity  on cn3344 

[user@cn3144 ~]$ ipython
Python 3.6.7 (default, Oct 25 2018, 09:16:13) 
Type 'copyright', 'credits' or 'license' for more information
IPython 7.1.1 -- An enhanced Interactive Python. Type '?' for help.

In [1]: import hail as hl                                                                                    

In [2]: hl.init()                                                                                            
using hail jar at /usr/local/lib/python3.6/dist-packages/hail/hail-all-spark.jar
Using Spark's default log4j profile: org/apache/spark/log4j-defaults.properties
Setting default log level to "WARN".
To adjust logging level use sc.setLogLevel(newLevel). For SparkR, use setLogLevel(newLevel).
Running on Apache Spark version 2.2.2
SparkUI available at http://10.2.9.172:4040
Welcome to
     __  __     <>__
    / /_/ /__  __/ /
   / __  / _ `/ / /
  /_/ /_/\_,_/_/_/   version 0.2-a2eaf89baa0c
LOGGING: writing to /spin1/scratch/teacher/hail-20181129-1008-0.2-a2eaf89baa0c.log

In [4]: hl.import_vcf('/fdb/1000genomes/20100804/ALL.2of4intersection.20100804.sites.vcf.gz',force_bgz=True).
   ...: write('sample.vds')                                                                                  
[Stage 1:===============================>                          (7 + 6) / 13]2018-11-29 15:10:40 Hail: INFO: Coerced sorted dataset
[Stage 2:===========================================>             (10 + 3) / 13]2018-11-29 15:11:47 Hail: INFO: wrote 25488488 items in 13 partitions to sample.vds

[user@cn3144 ~]$ exit
salloc.exe: Relinquishing job allocation 46116226

[user@biowulf ~]$

Batch job
Most jobs should be run as batch jobs.

Create a python script (e.g. hail.py). For example:

from hail import *
hl.init()
hl.import_vcf('/fdb/1000genomes/20100804/ALL.2of4intersection.20100804.sites.vcf.gz',force_bgz=True).write('sample.vds')                       

Create a batch input file (e.g. hail.sh). For example:

#!/bin/bash
module load hail
python hail.py 

Submit this job using the Slurm sbatch command.

sbatch -c 16 --mem 40g hail.sh
Swarm of Jobs
A swarm of jobs is an easy way to submit a set of independent commands requiring identical resources.

Create a swarmfile (e.g. hail.swarm). For example:

python hail1.py
python hail2.py
python hail3.py

Submit this job using the swarm command.

swarm -f hail.swarm -g 30 -t 16 --module hail
where
-g # Number of Gigabytes of memory required for each process (1 line in the swarm command file)
-t # Number of threads/CPUs required for each process (1 line in the swarm command file).
--module hail Loads the hail module for each subjob in the swarm