Skip to content

Instantly share code, notes, and snippets.

Lars Vilhuber larsvilhuber

Block or report user

Report or block larsvilhuber

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@larsvilhuber
larsvilhuber / myc.qsub
Created Mar 31, 2016
The following script forces the qsub script to run in alternate csh login shell
View myc.qsub
#!/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 Mar 31, 2016
An example SAS job requesting about 32GB and 4 CPUs might be
View mysas.qsub
#!/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 Mar 31, 2016
An example Stata-oriented qsub might be
View mystata.qsub
#!/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 Mar 31, 2016
A complete qsub for Matlab would look like this:
View mymatlab.qsub
#!/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 Mar 31, 2016
A R qsub script using MKL-compiled R
View myRmkl.qsub
#!/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 Mar 31, 2016
Minimal qsub should work for large-scale MPI runs
View myIntelMPI.qsub
#!/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
NBER recessions as generated, for quarterly files
View nber-recessions.do
* 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 Aug 4, 2016
Base script for a SDS script
View sds_sas_sample.sas
%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;
View sds_stata_sample.do
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>
View sds_R_sample.R
base <- "/rdcprojects/tr/tr00612"
version <- "2.0.2" # specify the version of the dataset
myid <- "specXXX"
prefix <- "synlbd"
# load packages - also see code snippet below for repos setup
library(foreign)
inputs = paste(base,"/data/synlbd/",version,sep="")
mydata = paste(base,"/programs/users/",myid,"/data",sep="")
analysis_file ...
save(analysis_file,file=paste(mydata,"/analysis_file.RData",sep=""))
You can’t perform that action at this time.