diff options
author | Joseph Hunkeler <jhunkeler@gmail.com> | 2014-10-24 18:16:03 -0400 |
---|---|---|
committer | Joseph Hunkeler <jhunkeler@gmail.com> | 2014-10-24 18:16:03 -0400 |
commit | 50278409aec8e611aef532eb7ce06328e2227811 (patch) | |
tree | a39a8bf5d57fea392ab6e1666a37c0503419508e | |
parent | dcd3f8f73ecad19507a0f922aa9a35d86c0056d7 (diff) | |
download | htc_utils-50278409aec8e611aef532eb7ce06328e2227811.tar.gz |
Fix README.md explosion
-rw-r--r-- | README.md | 118 |
1 files changed, 118 insertions, 0 deletions
diff --git a/README.md b/README.md new file mode 100644 index 0000000..0dd742f --- /dev/null +++ b/README.md @@ -0,0 +1,118 @@ +# Requirements + +The `htc_utils.bindings` require a working HTCondor installation in your `PATH` + +### Python 2.6.x: + +* `argparse` >= 1.2 +* `multiprocessing` >= 2.6 + +### Python 2.7.x ~ 3.x.x: + +All dependencies are satisfied by default. + + +# Installation + +### At the system level +``` +python setup.py install +``` + +### Or at the user level +``` +python setup.py install --user +``` + +# HTCondor Bindings + +## `Job` & `Submit` Classes + +This is an example of how to generate and submit simple jobs to a HTCondor cluster using htc_utils. + +``` +#!python +import random +from htc_utils.bindings import Job, Submit + +# Create job object (filename will be "my_neato_condor.job") +job = Job('my_neato_condor') + +# Populate initial job attributes +job.attr('getenv', True) +job.attr('executable', '/bin/sleep') +job.attr('arguments', 1) +job.logging('logs', create=True) +job.attr('queue') + +# Populate additional sub-attributes (i.e. re-execute job with +# a different set of arguments. +for fileno in range(5): + x = random.Random().randint(2, 5) + job.subattr('arguments', x) + job.subattr('queue') + +# Write job file to disk +job.commit() + +# Pass our job to the Submit class +submit = Submit(job) + +# Send our job to the cluster +submit.execute() +``` + +### Contents of `my_neato_condor.job` + +``` +universe = vanilla +getenv = true +executable = /bin/sleep +arguments = 1 +notification = Never +priority = 0 +transfer_executable = true +should_transfer_files = IF_NEEDED +when_to_transfer_output = ON_EXIT +hold = false +log = logs/condor_$(Cluster).log +output = logs/stdout_$(Cluster)_$(Process).log +error = logs/stderr_$(Cluster)_$(Process).log +queue + +arguments = 5 +queue + +arguments = 2 +queue + +arguments = 2 +queue + +arguments = 4 +queue + +arguments = 4 +queue + +``` + +## CLI Components + +`htc_utils` provides a wrapper to the `Job` class to aid job creation outside of Python. + +### Job example rewritten using `condor_batch` + +``` +#!bash +condor_batch -n my_neato_condor \ +--logging logs \ +--logging-create \ +--getenv true \ +--subarg 5 \ +--subarg 2 \ +--subarg 2 \ +--subarg 4 \ +--subarg 4 \ +/bin/sleep 1 +``` |