Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Initial commit
- Loading branch information
0 parents
commit 620a1d7
Showing
11 changed files
with
139 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
alias job-cpu 'sacct -o jobid,jobname,ncpus,elapsed,mincpu,cputime%12 -j' | ||
alias job-disk 'sacct -o jobid,jobname,elapsed,maxdiskread,maxdiskwrite -j' | ||
alias job-mem 'sacct -o jobid,jobname,maxvmsize,maxrss,averss,maxpages -j' |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
alias job-cpu='sacct -o jobid,jobname,ncpus,elapsed,mincpu,cputime%12 -j' | ||
alias job-disk='sacct -o jobid,jobname,elapsed,maxdiskread,maxdiskwrite -j' | ||
alias job-mem='sacct -o jobid,jobname,maxvmsize,maxrss,averss,maxpages -j' |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
#!/bin/csh | ||
|
||
# Validate input. | ||
if ($# < 1) then | ||
echo "Usage: $argv[0] SLURM_SUBMISSION_FILE" | ||
exit 1 | ||
else if (! -e $argv[1]) then | ||
echo "Usage: $argv[0] SLURM_SUBMISSION_FILE" | ||
exit 1 | ||
endif | ||
# Submit job using `sbatch`. | ||
set sbatch_out = `sbatch $argv[1]` | ||
# Exit if submission is unsuccessful. | ||
if (-z "$sbatch_out") then | ||
exit 1 | ||
endif | ||
echo $sbatch_out | ||
# Grab job metadata. | ||
set job_id = `echo $sbatch_out | awk '{ print $NF }'` | ||
set out_file = `scontrol -ao show job $job_id | sed -E 's#.* StdOut=([^ ]+).*#\1#'` | ||
# Wait for the job to start running or fail. | ||
set message = "Waiting for job $job_id" | ||
foreach i (`seq 1 120`) | ||
set state = `\sacct -PXnj $job_id -o state` | ||
if ("$state" == "PENDING") then | ||
if ("$message" != "") then | ||
echo "$message" | ||
set message = "" | ||
endif | ||
else if ("$state" == "RUNNING") then | ||
echo "Job $job_id is running. Showing output file $out_file (hit Ctrl + C to exit):\ | ||
" | ||
tail -f $out_file | ||
break | ||
else if ("$state" == "FAILED") then | ||
echo "Error: Job $job_id failed. Showing end of output file $out_file :\ | ||
" | ||
tail $out_file | ||
break | ||
else if ("$state" == "COMPLETED") then | ||
echo "Job $job_id completed. Showing end of output file $out_file :\ | ||
" | ||
tail $out_file | ||
break | ||
endif | ||
sleep 1 | ||
end |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
function stail() { | ||
# Validate input. | ||
if ! [[ -e "$1" ]]; then | ||
echo "Usage: ${FUNCNAME} SLURM_SUBMISSION_FILE" | ||
return 1 | ||
fi | ||
# Submit job using `sbatch`. | ||
sbatch_out=$(sbatch $1) | ||
# Exit if submission is unsuccessful. | ||
if [[ -z "$sbatch_out" ]]; then | ||
return 1 | ||
fi | ||
echo $sbatch_out | ||
# Grab job metadata. | ||
job_id=${sbatch_out##* } | ||
out_file=$(scontrol -ao show job $job_id | sed -E 's#.* StdOut=([^ ]+).*#\1#') | ||
# Wait for the job to start running or fail. | ||
message="Waiting for job $job_id" | ||
for i in {1..120}; do | ||
state=$(command sacct -PXnj $job_id -o state) | ||
if [[ "$state" == "PENDING" ]]; then | ||
if ! [[ -z "$message" ]]; then | ||
echo "$message" | ||
message= | ||
fi | ||
elif [[ "$state" == "RUNNING" ]]; then | ||
echo "Job $job_id is running. Showing output file $out_file (hit Ctrl + C to exit): | ||
" | ||
tail -f $out_file | ||
break | ||
elif [[ "$state" == "FAILED" ]]; then | ||
echo "Error: Job $job_id failed. Showing end of output file $out_file : | ||
" | ||
tail $out_file | ||
break | ||
elif [[ "$state" == "COMPLETED" ]]; then | ||
echo "Job $job_id completed. Showing end of output file $out_file : | ||
" | ||
tail $out_file | ||
break | ||
fi | ||
sleep 1 | ||
done | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# The usual `install.packages("rPython")` doesn't work because we also | ||
# need to interactively at least once tell R to use the user library | ||
# and to select a mirror. | ||
|
||
dir.create(Sys.getenv("R_LIBS_USER"), recursive = TRUE) | ||
.libPaths(Sys.getenv("R_LIBS_USER")) | ||
install.packages("rPython", repos = "http://cran.us.r-project.org") |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
source /etc/profile.d/modules.sh # Needed for bash | ||
module purge | ||
module load r/3.1.1 | ||
Rscript R-commands.R | ||
# Then we will setup the paths |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
source /etc/profile.d/modules.sh # Needed for bash | ||
module purge | ||
module load python/2.7.6 | ||
pip install --user cutadapt | ||
# Then we will setup the paths |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/bin/bash -x | ||
# Submit a 1 minute job. | ||
#SBATCH --partition=phi | ||
#SBATCH --time=1:00 | ||
|
||
scontrol show job $SLURM_JOB_ID | ||
hostname |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/bin /bash | ||
# Submit a 1 minute job. | ||
#SBATCH --partition=phi | ||
#SBATCH --time=1:00 | ||
|
||
hostname |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/bin/bash | ||
# Submit a 1 hour job. | ||
#SBATCH --partition=debug | ||
#SBATCH --time=1:00:00 | ||
|
||
hostname |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/bin/bash | ||
# Submit a 1 minute job. | ||
#SBATCH --partition=phi | ||
#SBATCH --time=1:00 | ||
|
||
hostname |