Skip to content

Instantly share code, notes, and snippets.

View larsvilhuber's full-sized avatar

Lars Vilhuber larsvilhuber

View GitHub Profile
@larsvilhuber
larsvilhuber / my.qsub
Last active August 21, 2018 18:33
A template for QSUB on ECCO
#!/bin/bash -l
#PBS -N myjobname
#PBS -l ncpus=8
#PBS -l mem=32768mb
#PBS -j oe
#PBS -l walltime=00:10:00
#PBS -m ae
# The following line should ALWAYS be included
source /etc/profile.d/modules.sh
cd $PBS_O_WORKDIR
@larsvilhuber
larsvilhuber / myc.qsub
Created March 31, 2016 20:02
The following script forces the qsub script to run in alternate csh login shell
#!/bin/csh -l
#PBS -l ncpus=8
#PBS -l mem=32768mb
#PBS -N myjobname
#PBS -j oe
#PBS -l walltime=00:10:00
#PBS -m ae
source /etc/profile.d/modules.sh
module load sas
cd $PBS_O_WORKDIR
@larsvilhuber
larsvilhuber / mysas.qsub
Created March 31, 2016 20:04
An example SAS job requesting about 32GB and 4 CPUs might be
#!/bin/bash -l
#PBS -l mem=32768mb
#PBS -l ncpus=4
#PBS -l walltime=12:00:00
source /etc/profile.d/modules.sh
module load sas
cd $PBS_O_WORKDIR
sas -memsize 32000m -cpucount 4 myprog.sas
@larsvilhuber
larsvilhuber / mystata.qsub
Created March 31, 2016 20:05
An example Stata-oriented qsub might be
#!/bin/bash -l
#PBS -l mem=32768mb
#PBS -l ncpus=4
#PBS -l walltime=12:00:00
source /etc/profile.d/modules.sh
module load stata
cd $PBS_O_WORKDIR
stata -b myprog.do
@larsvilhuber
larsvilhuber / mymatlab.qsub
Created March 31, 2016 20:07
A complete qsub for Matlab would look like this:
#!/bin/bash -l
#PBS -N myMatlab
#PBS -l ncpus=8
#PBS -l mem=32768mb
#PBS -j oe
#PBS -l walltime=05:00:00
#PBS -m ae
# The following line should ALWAYS be included
source /etc/profile.d/modules.sh
module load matlab
@larsvilhuber
larsvilhuber / myRmkl.qsub
Created March 31, 2016 20:08
A R qsub script using MKL-compiled R
#!/bin/bash -l
#PBS -l ncpus=4
source /etc/profile.d/modules.sh
module load R/MKL/MP
export OMP_NUM_THREADS=4
cd $PBS_O_WORKDIR
R --vanilla < myprog.R > myprog.Rout
@larsvilhuber
larsvilhuber / myIntelMPI.qsub
Last active March 31, 2016 20:18
Minimal qsub should work for large-scale MPI runs
#!/bin/bash -l
# Output (log) and errors will go into the system-defined stdout file
#PBS -j oe
##############################################################################
# Based on http://csc.cnsi.ucsb.edu/docs/running-jobs-torque
# IMPORTANT: the next line determines how many nodes to run on
# nodes is number of nodes, ppn= processors (cores) per node
#
#PBS -l nodes=2:ppn=32
#
@larsvilhuber
larsvilhuber / nber-recessions.do
Created May 30, 2016 19:17
NBER recessions as generated, for quarterly files
* append your graph command to this file: e.g.
* tsline timeseriesvar, xlabel(,format(%tq)) legend(order(3 1 "Recession"))
twoway function y=1,range(164 167) recast(area) color(gs12) base(0) || ///
function y=1,range(191 197) recast(area) color(gs12) base(0) || ///
@larsvilhuber
larsvilhuber / sds_sas_sample.sas
Created August 4, 2016 20:20
Base script for a SDS script
%let base=/rdcprojects/tr/tr00612;
%let version=2.0.2;
%let myid=specXXX;
%let prefix=synlbd;
libname inputs "&base./data/synlbd/&version." access=readonly;
libname mydata "&base./programs/users/&myid./data";data mydata.analysis_file;
set inputs.&prefix.1992c;
global base /rdcprojects/tr/tr00612
global version 2.0.2
global myid specXXX
global prefix synlbd
global inputs $base/data/synlbd/$version
global mydata $base/programs/users/$myid/data"use ${inputs}/${prefix}1992c
...
save ${mydata}/analysis_file</code>