From 98f7c7acd8314360dfd69d880bd955a63d374a73 Mon Sep 17 00:00:00 2001
From: Andre Anjos <andre.anjos@idiap.ch>
Date: Thu, 6 Jul 2017 13:51:33 +0200
Subject: [PATCH] Add grid resources and explanation on how to run

---
 bob/bio/vein/configurations/gridio4g48.py | 46 +++++++++++++++++++++++
 doc/baselines.rst                         | 12 ++++++
 doc/resources.rst                         |  7 ++++
 setup.py                                  |  2 +
 4 files changed, 67 insertions(+)
 create mode 100644 bob/bio/vein/configurations/gridio4g48.py

diff --git a/bob/bio/vein/configurations/gridio4g48.py b/bob/bio/vein/configurations/gridio4g48.py
new file mode 100644
index 0000000..082adfd
--- /dev/null
+++ b/bob/bio/vein/configurations/gridio4g48.py
@@ -0,0 +1,46 @@
+#!/usr/bin/env python
+# vim: set fileencoding=utf-8 :
+
+
+'''Grid configurations for bob.bio.vein'''
+
+
+import bob.bio.base
+
+grid = bob.bio.base.grid.Grid(
+    number_of_preprocessing_jobs = 48,
+    number_of_extraction_jobs    = 48,
+    number_of_projection_jobs    = 48,
+    number_of_enrollment_jobs    = 48,
+    number_of_scoring_jobs       = 48,
+    training_queue               = '4G-io-big',
+    preprocessing_queue          = '4G-io-big',
+    extraction_queue             = '4G-io-big',
+    projection_queue             = '4G-io-big',
+    enrollment_queue             = '4G-io-big',
+    scoring_queue                = '4G-io-big'
+    )
+'''Defines an SGE grid configuration for running at Idiap
+
+This grid configuration will use 48 slots for each of the stages defined below.
+
+The queue ``4G-io-big`` corresponds to the following settings:
+
+  * ``queue``: ``q1d`` (in this queue you have a maximum of 48 slots according
+    to: https://secure.idiap.ch/intranet/system/computing/ComputationGrid
+  * ``memfree``: ``4G`` (this is the minimum amount of memory you can take -
+    the lower, the more probable your job will be allocated faster)
+  * ``io_big``: SET (this flag must be set so your job runs downstairs and not
+    on people's workstations
+
+Notice the queue names do not directly correspond SGE grid queue names. These
+are names only known to :py:mod:`bob.bio.base.grid` and are translated
+from there to settings which are finally passed to ``gridtk``.
+
+To use this configuration file, just add it to your ``verify.py`` commandline.
+
+For example::
+
+  $ verify.py <other-options> gridio4g48
+
+'''
diff --git a/doc/baselines.rst b/doc/baselines.rst
index dd001e4..d74e3d4 100644
--- a/doc/baselines.rst
+++ b/doc/baselines.rst
@@ -116,6 +116,18 @@ protocol, do the following:
 
       $ verify.py verafinger rlt parallel -vv
 
+   To run on the Idiap SGE grid using our stock
+   io-big-48-slots-4G-memory-enabled (see
+   :py:mod:`bob.bio.vein.configurations.gridio4g48`) configuration, use:
+
+   .. code-block:: sh
+
+      $ verify.py verafinger rlt grid -vv
+
+   You may also, optionally, use the configuration resource ``gridio4g48``,
+   which is just an alias of ``grid`` in this package.
+
+
 
 This command line selects and runs the following implementations for the
 toolchain:
diff --git a/doc/resources.rst b/doc/resources.rst
index 2972943..8e47300 100644
--- a/doc/resources.rst
+++ b/doc/resources.rst
@@ -100,3 +100,10 @@ Parallel Running
 .. automodule:: bob.bio.vein.configurations.parallel
    :members:
 
+
+Using SGE at Idiap
+==================
+
+.. automodule:: bob.bio.vein.configurations.gridio4g48
+   :members:
+
diff --git a/setup.py b/setup.py
index bd3ed22..7d32b8c 100644
--- a/setup.py
+++ b/setup.py
@@ -44,6 +44,8 @@ setup(
 
         # other
         'parallel = bob.bio.vein.configurations.parallel',
+        'gridio4g48 = bob.bio.vein.configurations.gridio4g48',
+        'grid = bob.bio.vein.configurations.gridio4g48',
         ],
 
       'console_scripts': [
-- 
GitLab