UCSF-CBI / c4

The C4 Website
https://ucsf-cbi.github.io/c4/
1 stars 2 forks source link

Examples: Don't redirect stdout to file #29

Closed HenrikBengtsson closed 3 years ago

HenrikBengtsson commented 3 years ago
$ cat myenv.bash 
#!/bin/bash 
#SBATCH --account=cbi
#SBATCH --partition=common
#SBATCH --mail-type=END,FAIL                         # Mail events (NONE, BEGIN, END, FAIL, ALL)
#SBATCH --mail-user=alice.bobson@ucsf.edu            # user to receive notification emails
#SBATCH --ntasks=1                                   # Run on a single CPU
#SBATCH --mem=80gb                                   # Job memory request
#SBATCH --time=1:00:00                               # Time limit hrs:min:sec
#SBATCH --output=$HOME/myenv_log_%A_%a.log           # Standard output and error log
mydate=$(date)
echo "Date is $mydate" > $HOME/myenv.out
echo "Host is $HOSTNAME" >> $HOME/myenv.out
echo "TMPDIR is $TMPDIR" >> $HOME/myenv.out
full_env=$(env|sort)
echo "Full Enviroment $full_env" >> $HOME/myenv.out
exit;

$ sbatch myenv.bash 
Submitted batch job 1484
HenrikBengtsson commented 3 years ago

Can't we just find the Slurm counterpart to the original SGE example, cf. https://wynton.ucsf.edu/hpc/scheduler/sge-envvars.html?

HenrikBengtsson commented 3 years ago

https://ucsf-wynton.github.io/stage-wynton-hpc/slurm/slurm-envvars.html

hgputnam commented 3 years ago

I just removed all the redirects for the existing page...

HenrikBengtsson commented 3 years ago

All done;

$ grep -E ' [>]+ ' -r --include="*.md" --exclude-dir="_site"
about/specs.md:      has_issue = (host_status.filter(function(d) { return d.queuename == row["Node"] }).length > 0);
scheduler/using-local-scratch.md:/path/to/my_pipeline --cores="$NSLOTS" reference.fa sample.fq > output.bam
howto/log-in-without-pwd.md:[alice@{{ site.login.name }} .ssh]$ cat laptop_to_c4.pub >> authorized_keys