Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
765094a
first try for pbs compatibilaty
Apr 5, 2015
e4d4313
Merge remote-tracking branch 'upstream/master'
kbruegge Dec 16, 2015
2157c05
fix compilation error and add attribute to slots
kbruegge Dec 16, 2015
6bc25d5
Do not send -b flag to PBS
kbruegge Dec 16, 2015
8f02fb1
add commandline options to example
kbruegge Dec 16, 2015
3f0fe46
more checks for PBS compatability
kbruegge Dec 16, 2015
af8635a
Add more commandline arguments to the manual example.
kbruegge Dec 16, 2015
befb9ba
remove debug output
kbruegge Dec 16, 2015
e4d2e1f
use pbs_jobdir as logging path
kbruegge Dec 18, 2015
2d469e6
Add parameter to specify a port for the jobmonitor to listen on
Dec 28, 2015
9e0cdfc
Add cmd line parameter for port and log level
Dec 28, 2015
7db85f4
additional output in case libdrmaa cannot be found
Dec 28, 2015
9511c35
check return values for cokmpletion when they are not strings
kbruegge Dec 30, 2015
20cb975
remove debug output
kbruegge Dec 30, 2015
a1435d9
remove more stupid debug output
kbruegge Dec 30, 2015
d856f53
write log files on PBS
kbruegge Dec 30, 2015
62e02f6
try to get session id
kbruegge Jan 2, 2016
3911e0a
use one session instance instead of passing around ids
Jan 2, 2016
0767557
fix bug when setting port number
kbruegge Jan 2, 2016
73f6121
add more output
kbruegge Jan 5, 2016
da24fe6
add gitiginreo
kbruegge Jan 5, 2016
d8f28c2
new readme
kbruegge Jan 5, 2016
5f2e3ec
fix md syntax
kbruegge Jan 5, 2016
96c5b2d
delete old readme
kbruegge Jan 5, 2016
cfc559d
fix setup.py for new readme
kbruegge Jan 5, 2016
34398ce
more envs in readme
kbruegge Jan 5, 2016
f16df0d
fix unitiliaazed variable in completion mail
Jan 17, 2016
4e9440c
change version number to test installatino dependencies
kbruegge Jan 19, 2016
c6afa02
add more output on job retiurn and exit
kbruegge Feb 16, 2016
72d7812
make jobs in exampele run different durations
kbruegge Feb 16, 2016
d850bc7
use keyboard interupt to return intermediate ruslts. very hacky
kbruegge Feb 16, 2016
f067b68
added walltime for PBS jobs
jebuss Feb 16, 2016
81a4511
added walltime to list of slots
jebuss Feb 16, 2016
ac43f4b
Merge remote-tracking branch 'origin/dev' into jebuss/walltime
jebuss Feb 16, 2016
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 56 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,59 @@
*.pyc
*.pyo
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

*.egg
gridmap.egg-info/
dist/
# C extensions
*.so

# Distribution / packaging
.Python
env/
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
*.egg-info/
.installed.cfg
*.egg

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*,cover
.hypothesis/

# Translations
*.mo
*.pot

# Django stuff:
*.log

# Sphinx documentation
docs/_build/

# PyBuilder
target/
33 changes: 33 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#GridMap

This is a WIP fork of the original gridmap project. This was created to achieve compatability
with the TORQUE and PBS grid engine.

### Requirements
Jobs can only be submitted from nodes than are allowed to do that (i.e they can run 'qsub')

A couple of environment variables need to be set in order to work.

ERROR_MAIL_RECIPIENT = *your email address*

export DRMAA_LIBRARY_PATH = *like pbs_drmaa/libs/libdrmaa.so for pbs*

export DEFAULT_TEMP_DIR="/local/$USER/"

export USE_MEM_FREE=TRUE

export SMTP_SERVER="unimail.tu-dortmund.de"

export ERROR_MAIL_RECIPIENT="[email protected]"

export ERROR_MAIL_SENDER="[email protected]"

export SEND_ERROR_MAIL=TRUE

### Python Requirements


- drmaa <https://github.com/drmaa-python/drmaa-python>
- psutil <https://github.com/giampaolo/psutil>
- pyzmq <https://github.com/zeromq/pyzmq>
- Python 3.4+
58 changes: 0 additions & 58 deletions README.rst

This file was deleted.

55 changes: 39 additions & 16 deletions examples/manual.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,15 @@
from datetime import datetime

from gridmap import Job, process_jobs


import argparse

parser = argparse.ArgumentParser()
parser.add_argument('--engine', help='Name of the grid engine you are using.', choices=['TOURQUE','PBS','SGE'], default='SGE')
parser.add_argument('--queue', help='Name of the queue you want to send jobs to.', default='all.q')
parser.add_argument('--vmem', help='Amount of memory to use on a node.', default='200m')
parser.add_argument('--port', help='The port through which to communicate with the JobMonitor', default=None, type=int)
parser.add_argument('--local', help='Flag indicating whether the jobs should run locally instead of on the cluster', default=False, type=bool)
parser.add_argument("--logging", type=str, choices=['INFO', 'DEBUG', 'WARN'], help='increase output verbosity', default='INFO')
def sleep_walk(secs):
'''
Pass the time by adding numbers until the specified number of seconds has
Expand All @@ -46,18 +53,18 @@ def sleep_walk(secs):
num = num + 1


def compute_factorial(n):
def compute_factorial(n, sleep=10):
"""
computes factorial of n
"""
sleep_walk(10)
sleep_walk(sleep)
ret = 1
for i in range(n):
ret = ret * (i + 1)
return ret


def make_jobs():
def make_jobs(engine, queue, vmem):
"""
creates a list of Job objects,
which carry all information needed
Expand All @@ -68,7 +75,7 @@ def make_jobs():
"""

# set up list of arguments
inputvec = [[3], [5], [10], [20]]
inputvec = [[3, 10], [5, 20], [10, 10], [20, 20]]

# create empty job vector
jobs = []
Expand All @@ -77,7 +84,8 @@ def make_jobs():
for arg in inputvec:
# The default queue used by the Job class is all.q. You must specify
# the `queue` keyword argument if that is not the name of your queue.
job = Job(compute_factorial, arg, queue='all.q')
job = Job(compute_factorial, arg, queue=queue, engine=engine,
mem_free=vmem)
jobs.append(job)

return jobs
Expand All @@ -88,21 +96,37 @@ def main():
run a set of jobs on cluster
"""

args = parser.parse_args()
engine = args.engine
queue = args.queue
vmem = args.vmem
port = args.port
local =args.local
level = args.logging

if level is 'DEBUG':
level = logging.DEBUG
elif level is 'WARN':
level = logging.WARN
elif level is 'INFO':
level = logging.INFO

logging.captureWarnings(True)
logging.basicConfig(format=('%(asctime)s - %(name)s - %(levelname)s - ' +
'%(message)s'), level=logging.INFO)
logging.basicConfig(format=('%(asctime)s - %(name)s - %(levelname)s - ' + '%(message)s'), level=level)

print("=====================================")
print("======== Submit and Wait ========")
print("=====================================")
print("")
print("=====================================\n")


functionJobs = make_jobs()
functionJobs = make_jobs(engine, queue, vmem)
if local :
print('Running jobs locally')
else:
print("Sending function jobs to cluster engine: {}. Into queue: {} \n".format(engine, queue))

print("sending function jobs to cluster")
print("")

job_outputs = process_jobs(functionJobs, max_processes=4)
job_outputs = process_jobs(functionJobs, max_processes=4, port=port, local=local)

print("results from each job")
for (i, result) in enumerate(job_outputs):
Expand All @@ -111,4 +135,3 @@ def main():

if __name__ == "__main__":
main()

3 changes: 2 additions & 1 deletion gridmap/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,11 @@
try:
import drmaa
DRMAA_PRESENT = True
except (ImportError, OSError, RuntimeError):
except (ImportError, OSError, RuntimeError) as e:
logger = logging.getLogger(__name__)
logger.warning('Could not import drmaa. Only local multiprocessing ' +
'supported.')
logger.warning(str(e))
DRMAA_PRESENT = False

# plot cpu and mem usage and send via email
Expand Down
Loading