Commit fdd4ae50 authored by Alex Waite's avatar Alex Waite

Merge branch 'master' into 'master'

add ncal example

See merge request !2
parents 22d0b4fa b70310da
......@@ -9,4 +9,5 @@ If you see something that is missing or should be improved, please contribute!
| ---- | ----------- |
| [matlab](matlab/) | |
| [python](python/) | |
| [ncal](ncal/) | |
# ncal
The `ncal_submit_gen.sh` generates a submit file with a series of jobs. Each job
calls `ncal` --- which prints the calendar for that year.
To run:
```./ncal_submit_gen.sh | condor_submit```
## Prerequisites
This example assumes that it is located in `~/htcondor-templates/ncal`. If you
have cloned it elsewhere, adjust the `ncal_submit_gen.sh` script as necessary.
Otherwise, this example is entirely self contained.
#!/bin/bash
# v3.2
logs_dir=~/htcondor-templates/ncal/logs
# create the logs dir if it doesn't exist
[ ! -d "$logs_dir" ] && mkdir -p "$logs_dir"
# print the .submit header
printf "# The environment
universe = vanilla
getenv = True
request_cpus = 1
request_memory = 1G
# Execution
initial_dir = \$ENV(HOME)/htcondor-templates/ncal
executable = /usr/bin/ncal
\n"
# create a job for each year
for year in {1000..1999}; do
printf "arguments = ${year}\n"
printf "log = ${logs_dir}/\$(Cluster).\$(Process)_year${year}.log\n"
printf "output = ${logs_dir}/\$(Cluster).\$(Process)_year${year}.out\n"
printf "error = ${logs_dir}/\$(Cluster).\$(Process)_year${year}.err\n"
printf "Queue\n\n"
done
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment