Package gridmap

Source Code for Package gridmap

 1  # -*- coding: utf-8 -*- 
 2   
 3  # Written (W) 2008-2012 Christian Widmer 
 4  # Written (W) 2008-2010 Cheng Soon Ong 
 5  # Written (W) 2012-2013 Daniel Blanchard, dblanchard@ets.org 
 6  # Copyright (C) 2008-2012 Max-Planck-Society, 2012-2013 ETS 
 7   
 8  # This file is part of Grid Map. 
 9   
10  # Grid Map is free software: you can redistribute it and/or modify 
11  # it under the terms of the GNU General Public License as published by 
12  # the Free Software Foundation, either version 3 of the License, or 
13  # (at your option) any later version. 
14   
15  # Grid Map is distributed in the hope that it will be useful, 
16  # but WITHOUT ANY WARRANTY; without even the implied warranty of 
17  # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
18  # GNU General Public License for more details. 
19   
20  # You should have received a copy of the GNU General Public License 
21  # along with Grid Map.  If not, see <http://www.gnu.org/licenses/>. 
22  ''' 
23  Grid Map provides wrappers that simplify submission and collection of jobs, 
24  in a more 'pythonic' fashion. 
25   
26  @author: Christian Widmer 
27  @author: Cheng Soon Ong 
28  @author: Dan Blanchard (dblanchard@ets.org) 
29   
30  @var REDIS_DB: The index of the database to select on the Redis server; can be 
31                 overriden by setting the GRID_MAP_REDIS_DB environment variable. 
32  @var REDIS_PORT: The port of the Redis server to use; can be overriden by 
33                   setting the GRID_MAP_REDIS_PORT environment variable. 
34  @var USE_MEM_FREE: Does your cluster support specifying how much memory a job 
35                     will use via mem_free? Can be overriden by setting the 
36                     GRID_MAP_USE_MEM_FREE environment variable. 
37  @var DEFAULT_QUEUE: The default job scheduling queue to use; can be overriden 
38                      via the GRID_MAP_DEFAULT_QUEUE environment variable. 
39  @var MAX_TRIES: Maximum number of times to try to get the output of a job from 
40                  the Redis database before giving up and assuming the job died 
41                  before writing its output; can be overriden by setting the 
42                  GRID_MAP_MAX_TRIES environment variable. 
43  @var SLEEP_TIME: Number of seconds to sleep between attempts to retrieve job 
44                   output from the Redis database; can be overriden by setting the 
45                   GRID_MAP_SLEEP_TIME environment variable. 
46  ''' 
47   
48  from __future__ import absolute_import, print_function, unicode_literals 
49   
50  from gridmap.job import (Job, process_jobs, grid_map, pg_map, USE_MEM_FREE, 
51                           DEFAULT_QUEUE, REDIS_PORT, REDIS_DB) 
52  from gridmap.data import MAX_TRIES, SLEEP_TIME 
53   
54   
55  # Version info 
56  __version__ = '0.9.6' 
57  VERSION = tuple(int(x) for x in __version__.split('.')) 
58   
59  # For * imports 
60  __all__ = ['Job', 'process_jobs', 'grid_map', 'pg_map', 'USE_MEM_FREE', 
61             'DEFAULT_QUEUE', 'REDIS_DB', 'REDIS_PORT', 'MAX_TRIES', 'SLEEP_TIME'] 
62