This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# setup local cluster for dask | |
# | |
# API documentation | |
# * dask.distributed.worker | |
# https://distributed.dask.org/en/latest/worker.html#distributed.worker.Worker | |
# * dask.distributed.LocalCluster | |
# https://distributed.dask.org/en/latest/api.html#distributed.LocalCluster | |
# * dask.distributed.Client | |
# https://distributed.dask.org/en/latest/api.html#distributed.Client |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from time import time | |
class Timer(object): | |
def __init__(self, description): | |
self.description = description | |
def __enter__(self): | |
self.start = time() | |
def __exit__(self, type, value, traceback): | |
self.end = time() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#SBATCH --job-name=installSE | |
#SBATCH -c 4 # Number of cores | |
#SBATCH -t 0-03 # Runtime in D-HH:MM, minimum of 10 minutes | |
#SBATCH -p short # Partition to submit to, whichever is faster | |
#SBATCH --mem-per-cpu=4G # Memory (see also --mem) | |
#SBATCH -o joboutput.out # job output | |
#SBATCH -e joberrors.err # job error log | |
# load modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Use case: | |
# You ran a job array in SLURM by something like `sbatch --array=1-300 run.sh` | |
# ...checked the error logs by `tail -n 1 *.err` and saw many got timed-out | |
# ...would like to re-run tasks with higher time quota but first need to know their task IDs | |
# ...instead of jotting down the IDs by scanning the terminal with your eyes, | |
# or writting yet-another Python script to parse the error logs, | |
# you can use this one-line command | |
sacct -j [JOB-ID] -s to --brief\ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ~/.tmux.conf | |
setw -g mode-keys vi | |
bind-key -T copy-mode-vi v send-keys -X begin-selection | |
bind-key -T copy-mode-vi V send -X select-line | |
bind-key -T copy-mode-vi y send-keys -X copy-selection | |
bind-key -T copy-mode-vi 'Home' send -X start-of-line | |
bind-key -T copy-mode-vi 'End' send -X end-of-line | |
setw -g history-limit 1000000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#SBATCH --job-name=newjob | |
#SBATCH -n 1 # Number of cores | |
#SBATCH -N 1 # Ensure that all cores are on one machine | |
#SBATCH -t 0-01:00 # Runtime in D-HH:MM, minimum of 10 minutes | |
#SBATCH -p shared,general # Partition to submit to, whichever is faster | |
#SBATCH --mem-per-cpu=4G # Memory (see also --mem) | |
#SBATCH -o joboutput_%j.out # File to which STDOUT will be written, %j inserts jobid | |
#SBATCH -e joberrors_%j.err # File to which STDERR will be written, %j inserts jobid | |
#SBATCH --mail-type=ALL # Type of email notification- BEGIN,END,FAIL,ALL |