Index: /TOOLS/ConsoGENCMIP6/bin/config.ini
===================================================================
--- /TOOLS/ConsoGENCMIP6/bin/config.ini	(revision 2460)
+++ /TOOLS/ConsoGENCMIP6/bin/config.ini	(revision 2460)
@@ -0,0 +1,21 @@
+[projet]
+name: gencmip6
+
+[directories]
+ROOT_DIR: /ccc/cont003/home/dsm/p86ipsl/ConsoGENCMIP6
+DATA: %(ROOT_DIR)s/output
+PLOT: %(ROOT_DIR)s/plot
+SAVE: %(ROOT_DIR)s/save
+SAVEDATA: %(SAVE)s/data
+SAVEPLOT: %(SAVE)s/plot
+DODS: None
+
+[files]
+PARAM: OUT_CONSO_PARAM
+BILAN: OUT_CONSO_BILAN
+UTHEO: OUT_CONSO_UTHEO
+LOGIN: OUT_CONSO_LOGIN
+STORE: OUT_CONSO_STORE
+CCCMP: ccc_myproject.dat
+JOBS:  OUT_JOBS_PENDING
+
Index: /TOOLS/ConsoGENCMIP6/bin/conso_gencmip6.py
===================================================================
--- /TOOLS/ConsoGENCMIP6/bin/conso_gencmip6.py	(revision 2459)
+++ /TOOLS/ConsoGENCMIP6/bin/conso_gencmip6.py	(revision 2460)
@@ -15,6 +15,5 @@
 
 # Application library imports
-from gencmip6 import *
-from gencmip6_path import *
+from libconso import *
 
 
@@ -57,8 +56,8 @@
 
 ########################################
-def parse_myproject(filename):
+def parse_myproject(filename, project_name):
 
   project = {}
-  project["project"] = "gencmip6"
+  project["name"] = project_name
   logins  = {}
 
@@ -76,7 +75,9 @@
     # Then extract script date
     for ligne in filein:
-      if project["project"] in ligne:
+      if project["name"] in ligne:
         today = ligne.split()[-1]
         today = string_to_date(today)
+        project["machine"] = ligne.split()[5]
+        project["nodes"]   = ligne.split()[6]
 
         break
@@ -137,5 +138,6 @@
 
 ########################################
-def write_bilan(filename, today, total, ureal, utheo, run_mean, pen_mean, run_std, pen_std):
+def write_bilan(filename, today, total, ureal, utheo,
+                run_mean, pen_mean, run_std, pen_std):
   """
   Conso totale par jour
@@ -145,25 +147,32 @@
   """
 
-  title_str  = "{:10s} {:12s} {:11s} {:11s} {:13s} {:13s} {:13s} {:13s}\n".format(
-                 "date",
-                 "conso(hours)",
-                 "real_use(%)",
-                 "theo_use(%)",
-                 "running(core)",
-                 "pending(core)",
-                 "run_std(core)",
-                 "pen_std(core)",
-               )
-  str_fmt = "{:%Y-%m-%d} {:12.2f} {:11.2f} {:11.2f} {:13.2f} {:13.2f} {:13.2f} {:13.2f}\n"
-  result_str = str_fmt.format(
-                 today,
-                 total,
-                 ureal,
-                 utheo,
-                 run_mean,
-                 pen_mean,
-                 run_std,
-                 pen_std,
-               )
+  fmt_str = "{:10s} {:12s} {:11s} {:11s} {:13s} {:13s} {:13s} {:13s}\n"
+
+  title_str  = fmt_str.format(
+    "date",
+    "conso(hours)",
+    "real_use(%)",
+    "theo_use(%)",
+    "running(core)",
+    "pending(core)",
+    "run_std(core)",
+    "pen_std(core)",
+  )
+
+  fmt_str = (
+    "{:%Y-%m-%d} {:12.2f} {:11.2f} {:11.2f} "
+    "{:13.2f} {:13.2f} {:13.2f} {:13.2f}\n"
+  )
+
+  result_str = fmt_str.format(
+    today,
+    total,
+    ureal,
+    utheo,
+    run_mean,
+    pen_mean,
+    run_std,
+    pen_std,
+  )
 
   if args.dryrun:
@@ -337,10 +346,14 @@
     args.all = False
 
+  project_name, DIR, OUT = parse_config("bin/config.ini")
+
   if args.verbose:
     print(DIR["DATA"])
     print(DIR["SAVEDATA"])
 
-  (project, logins, today, total, utheo, ureal) = \
-      parse_myproject(os.path.join(DIR["DATA"], OUT["CCCMP"]))
+  (project, logins, today, total, utheo, ureal) = parse_myproject(
+    os.path.join(DIR["DATA"], OUT["CCCMP"]),
+    project_name
+  )
 
   if args.verbose:
@@ -384,6 +397,6 @@
         converters={
           0: string_to_datetime,
-          1: int,
-          2: int,
+          1: float,
+          2: float,
         },
         missing_values="nan",
Index: OLS/ConsoGENCMIP6/bin/gencmip6.py
===================================================================
--- /TOOLS/ConsoGENCMIP6/bin/gencmip6.py	(revision 2459)
+++ 	(revision )
@@ -1,259 +1,0 @@
-#!/usr/bin/env python
-# -*- coding: utf-8 -*-
-
-# this must come first
-from __future__ import print_function, unicode_literals, division
-
-# standard library imports
-import socket
-import os
-import os.path
-import glob
-import shutil
-import subprocess
-import datetime as dt
-import numpy as np
-
-# Application library imports
-from gencmip6_path import *
-
-
-########################################
-def dods_cp(filein):
-  """
-  """
-  if not DIR["DODS"]:
-    print("DODS directory not defined")
-    return
-
-  basefile = os.path.basename(filein)
-
-  fileout = os.path.join(DIR["DODS"], basefile)
-  filepng = os.path.join(DIR["DODS"], "img", basefile.split(".")[0] + ".png")
-
-  #Â Copy file
-  shutil.copy(filein, fileout)
-
-  # Convert it to png for web page
-  command = ["convert", "-density", "200", fileout, filepng]
-
-  try :
-    subprocess.call(command)
-  except Exception as rc :
-    print("Error in convert for {}:\n{}".format(fileout, rc))
-
-  return
-
-
-########################################
-def string_to_percent(x):
-  """
-  """
-  return float(x.strip("%"))/100.
-
-
-########################################
-def string_to_size_unit(x):
-  """
-  """
-  if unicode(x).isdecimal():
-    x = x + "o"
-
-  (size, unit) = (float(x[:-1]), x[-1])
-
-  return SizeUnit(size, unit)
-
-
-########################################
-def string_to_float(x):
-  """
-  """
-  return float(x.strip("h"))
-
-
-########################################
-def string_to_date(ssaammjj, fmt="%Y-%m-%d"):
-  """
-  """
-  return dt.datetime.strptime(ssaammjj, fmt)
-
-
-########################################
-def string_to_datetime(string, fmt="%Y-%m-%d-%H:%M"):
-  """
-  """
-  return dt.datetime.strptime(string, fmt)
-
-
-# ########################################
-# def date_to_string(dtdate, fmt="%Y-%m-%d"):
-#   """
-#   """
-#   return dt.datetime.strftime(dtdate, fmt)
-
-
-########################################
-def where_we_run():
-
-  res = ""
-  if "curie" in socket.getfqdn():
-    res = "curie"
-  elif "ipsl" in socket.getfqdn():
-    res = "ipsl"
-  else:
-    res = "default"
-
-  return res
-
-
-########################################
-def get_last_file(dir_data, pattern):
-  """
-  """
-  current_dir = os.getcwd()
-  os.chdir(dir_data)
-  filename = pattern + "*"
-  file_list = glob.glob(os.path.join(dir_data, filename))
-  if file_list:
-    res = sorted(file_list)[-1]
-  else:
-    res = None
-  os.chdir(current_dir)
-  return res
-
-
-########################################
-def get_input_files(dir_data, file_list):
-  """
-  """
-  res = []
-
-  for filename in file_list:
-    res.append(get_last_file(dir_data, filename))
-
-  if None in res:
-    print("\nMissing one or more input files, we stop.")
-    for f_in, f_out in zip(file_list, res):
-      print("=> {}: {}".format(f_in, f_out))
-    exit(1)
-
-  return res
-
-
-########################################
-def plot_save(img_in, img_out, title):
-  """
-  """
-  from matplotlib.backends.backend_pdf import PdfPages
-
-  dpi = 200.
-
-  # img_in  = os.path.join(DIR["PLOT"], "{}.pdf".format(img_name))
-
-  with PdfPages(img_in) as pdf:
-    pdf.savefig(dpi=dpi)
-
-    # pdf file's metadata
-    d = pdf.infodict()
-    d["Title"]   = title
-    d["Author"]  = os.path.basename(__file__)
-    # d["Subject"] = "Time spent over specific commands during create_ts \
-    #                 jobs at IDRIS and four configurations at TGCC"
-    # d["Keywords"] = "bench create_ts TGCC IDRIS ncrcat"
-    # d["CreationDate"] = dt.datetime(2009, 11, 13)
-    # d["ModDate"] = dt.datetime.today()
-
-  if os.path.isdir(DIR["SAVEPLOT"]):
-    # img_out = os.path.join(DIR["SAVEPLOT"],
-    #                        "{}_{}.pdf".format(img_name, suffix))
-    shutil.copy(img_in, img_out)
-
-
-########################################
-class Project(object):
-
-  #---------------------------------------
-  def __init__(self):
-    self.project   = ""
-    self.date_init = ""
-    self.deadline  = ""
-    self.alloc     = 0
-
-  #---------------------------------------
-  def fill_data(self, filein):
-    import json
-    dico = json.load(open(filein, "r"))
-    self.project = dico["project"]
-    self.deadline = string_to_date(dico["deadline"]) + \
-                    dt.timedelta(days=-1)
-    self.alloc = dico["alloc"]
-
-  #---------------------------------------
-  def get_date_init(self, filein):
-    data = np.genfromtxt(
-      filein,
-      skip_header=1,
-      converters={0: string_to_date,
-                  1: string_to_percent},
-      missing_values="nan",
-    )
-    dates, utheos = zip(*data)
-
-    (x1, x2) = (np.nanargmin(utheos), np.nanargmax(utheos))
-
-    m = np.array([[x1, 1.], [x2, 1.]])
-    n = np.array([utheos[x1], utheos[x2]])
-
-    try:
-      (a, b) = np.linalg.solve(m, n)
-    except np.linalg.linalg.LinAlgError:
-      (a, b) = (None, None)
-
-    if a and b:
-      delta = int(round((-b/a)-x1 + 1))
-
-      d1 = dates[x1]
-      self.date_init = d1 + dt.timedelta(days=delta)
-    else:
-      self.date_init = dt.datetime(self.deadline.year, 1, 1)
-
-    delta = self.deadline - self.date_init
-    self.days = delta.days + 1
-
-
-########################################
-class SizeUnit(object):
-  #---------------------------------------
-  def __init__(self, size, unit):
-    self.size = size
-    self.unit = unit
-
-  #---------------------------------------
-  def __repr__(self):
-    return "{:6.2f}{}o".format(self.size, self.unit)
-
-  #---------------------------------------
-  def convert_size(self, unit_out):
-    """
-    """
-    prefixes = ["o", "K", "M", "G", "T", "P", "H"]
-
-    if not self.size or \
-       self.unit == unit_out:
-      size_out = self.size
-    else:
-      idx_deb = prefixes.index(self.unit)
-      idx_fin = prefixes.index(unit_out)
-      size_out = self.size
-      for i in xrange(abs(idx_fin-idx_deb)):
-        if idx_fin > idx_deb:
-          size_out = size_out / 1024
-        else:
-          size_out = size_out * 1024
-
-    return SizeUnit(size_out, unit_out)
-
-
-########################################
-if __name__ == '__main__':
-  pass
Index: /TOOLS/ConsoGENCMIP6/bin/libconso.py
===================================================================
--- /TOOLS/ConsoGENCMIP6/bin/libconso.py	(revision 2460)
+++ /TOOLS/ConsoGENCMIP6/bin/libconso.py	(revision 2460)
@@ -0,0 +1,307 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+
+# this must come first
+from __future__ import print_function, unicode_literals, division
+
+# standard library imports
+import socket
+import os
+import os.path
+import glob
+import shutil
+import subprocess
+import datetime as dt
+import numpy as np
+import ConfigParser as cp
+
+# Application library imports
+
+
+########################################
+def dods_cp(filein, DIR):
+  """
+  """
+  if not DIR["DODS"]:
+    print("DODS directory not defined")
+    return
+
+  basefile = os.path.basename(filein)
+
+  fileout = os.path.join(DIR["DODS"], basefile)
+  filepng = os.path.join(DIR["DODS"], "img", basefile.split(".")[0] + ".png")
+
+  #Â Copy file
+  shutil.copy(filein, fileout)
+
+  # Convert it to png for web page
+  command = ["convert", "-density", "200", fileout, filepng]
+
+  try :
+    subprocess.call(command)
+  except Exception as rc :
+    print("Error in convert for {}:\n{}".format(fileout, rc))
+
+  return
+
+
+########################################
+def parse_config(filename):
+
+  DIR = {}
+  OUT = {}
+
+  config = cp.ConfigParser()
+  config.optionxform = str
+  config.read(filename)
+
+  for section in ("projet", "directories", "files"):
+    if not config.has_section(section):
+      print("Missing section {} in {}, we stop".format(section, filename))
+      exit(1)
+
+  # ..Â Project name ..
+  # ------------------
+  section = "projet"
+  option  = "name"
+  project_name = config.get(section, option)
+
+  # ..Common directories ..
+  # -----------------------
+  section = "directories"
+  for option in config.options(section):
+    res = config.get(section, option)
+    if res != "None":
+      DIR[option] = res
+    else:
+      DIR[option] = None
+
+    if DIR[option] and not os.path.isdir(DIR[option]):
+      print("mkdir {}".format(DIR[option]))
+      try :
+        os.makedirs(DIR[option])
+      except Exception as rc :
+        print("Could not create {}:\n{}".format(DIR[option], rc))
+
+  # ..Common files ..
+  # -----------------
+  section = "files"
+  for option in config.options(section):
+    OUT[option] = config.get(section, option)
+
+  return (project_name, DIR, OUT)
+
+
+########################################
+def string_to_percent(x):
+  """
+  """
+  return float(x.strip("%"))/100.
+
+
+########################################
+def string_to_size_unit(x):
+  """
+  """
+  if unicode(x).isdecimal():
+    x = x + "o"
+
+  (size, unit) = (float(x[:-1]), x[-1])
+
+  return SizeUnit(size, unit)
+
+
+########################################
+def string_to_float(x):
+  """
+  """
+  return float(x.strip("h"))
+
+
+########################################
+def string_to_date(ssaammjj, fmt="%Y-%m-%d"):
+  """
+  """
+  return dt.datetime.strptime(ssaammjj, fmt)
+
+
+########################################
+def string_to_datetime(string, fmt="%Y-%m-%d-%H:%M"):
+  """
+  """
+  return dt.datetime.strptime(string, fmt)
+
+
+# ########################################
+# def date_to_string(dtdate, fmt="%Y-%m-%d"):
+#   """
+#   """
+#   return dt.datetime.strftime(dtdate, fmt)
+
+
+########################################
+def where_we_run():
+
+  res = ""
+  if "curie" in socket.getfqdn():
+    res = "curie"
+  elif "ipsl" in socket.getfqdn():
+    res = "ipsl"
+  else:
+    res = "default"
+
+  return res
+
+
+########################################
+def get_last_file(dir_data, pattern):
+  """
+  """
+  current_dir = os.getcwd()
+  os.chdir(dir_data)
+  filename = pattern + "*"
+  file_list = glob.glob(os.path.join(dir_data, filename))
+  if file_list:
+    res = sorted(file_list)[-1]
+  else:
+    res = None
+  os.chdir(current_dir)
+  return res
+
+
+########################################
+def get_input_files(dir_data, file_list):
+  """
+  """
+  res = []
+
+  for filename in file_list:
+    res.append(get_last_file(dir_data, filename))
+
+  if None in res:
+    print("\nMissing one or more input files, we stop.")
+    for f_in, f_out in zip(file_list, res):
+      print("=> {}: {}".format(f_in, f_out))
+    exit(1)
+
+  return res
+
+
+########################################
+def plot_save(img_in, img_out, title, DIR):
+  """
+  """
+  from matplotlib.backends.backend_pdf import PdfPages
+
+  dpi = 200.
+
+  # img_in  = os.path.join(DIR["PLOT"], "{}.pdf".format(img_name))
+
+  with PdfPages(img_in) as pdf:
+    pdf.savefig(dpi=dpi)
+
+    # pdf file's metadata
+    d = pdf.infodict()
+    d["Title"]   = title
+    d["Author"]  = os.path.basename(__file__)
+    # d["Subject"] = "Time spent over specific commands during create_ts \
+    #                 jobs at IDRIS and four configurations at TGCC"
+    # d["Keywords"] = "bench create_ts TGCC IDRIS ncrcat"
+    # d["CreationDate"] = dt.datetime(2009, 11, 13)
+    # d["ModDate"] = dt.datetime.today()
+
+  if os.path.isdir(DIR["SAVEPLOT"]):
+    # img_out = os.path.join(DIR["SAVEPLOT"],
+    #                        "{}_{}.pdf".format(img_name, suffix))
+    shutil.copy(img_in, img_out)
+
+
+########################################
+class Project(object):
+
+  #---------------------------------------
+  def __init__(self):
+    self.project   = ""
+    self.date_init = ""
+    self.deadline  = ""
+    self.alloc     = 0
+
+  #---------------------------------------
+  def fill_data(self, filein):
+    import json
+    dico = json.load(open(filein, "r"))
+    self.project = dico["name"]
+    self.deadline = string_to_date(dico["deadline"]) + \
+                    dt.timedelta(days=-1)
+    self.alloc = dico["alloc"]
+
+  #---------------------------------------
+  def get_date_init(self, filein):
+    data = np.genfromtxt(
+      filein,
+      skip_header=1,
+      converters={0: string_to_date,
+                  1: string_to_percent},
+      missing_values="nan",
+    )
+    dates, utheos = zip(*data)
+
+    (x1, x2) = (np.nanargmin(utheos), np.nanargmax(utheos))
+
+    m = np.array([[x1, 1.], [x2, 1.]])
+    n = np.array([utheos[x1], utheos[x2]])
+
+    try:
+      (a, b) = np.linalg.solve(m, n)
+    except np.linalg.linalg.LinAlgError:
+      (a, b) = (None, None)
+
+    if a and b:
+      delta = int(round((-b/a)-x1 + 1))
+
+      d1 = dates[x1]
+      self.date_init = d1 + dt.timedelta(days=delta)
+    else:
+      self.date_init = dt.datetime(self.deadline.year, 1, 1)
+
+    delta = self.deadline - self.date_init
+    self.days = delta.days + 1
+
+
+########################################
+class SizeUnit(object):
+  #---------------------------------------
+  def __init__(self, size, unit):
+    self.size = size
+    self.unit = unit
+
+  #---------------------------------------
+  def __repr__(self):
+    return "{:6.2f}{}o".format(self.size, self.unit)
+
+  #---------------------------------------
+  def convert_size(self, unit_out):
+    """
+    """
+    prefixes = ["o", "K", "M", "G", "T", "P", "H"]
+
+    if not self.size or \
+       self.unit == unit_out:
+      size_out = self.size
+    else:
+      idx_deb = prefixes.index(self.unit)
+      idx_fin = prefixes.index(unit_out)
+      size_out = self.size
+      for i in xrange(abs(idx_fin-idx_deb)):
+        if idx_fin > idx_deb:
+          size_out = size_out / 1024
+        else:
+          size_out = size_out * 1024
+
+    return SizeUnit(size_out, unit_out)
+
+
+########################################
+if __name__ == '__main__':
+  pass
+
Index: /TOOLS/ConsoGENCMIP6/bin/plot_bilan.py
===================================================================
--- /TOOLS/ConsoGENCMIP6/bin/plot_bilan.py	(revision 2459)
+++ /TOOLS/ConsoGENCMIP6/bin/plot_bilan.py	(revision 2460)
@@ -13,6 +13,5 @@
 
 # Application library imports
-from gencmip6 import *
-from gencmip6_path import *
+from libconso import *
 
 
@@ -204,22 +203,31 @@
     line_width = 0.1
 
-  ax_conso.bar(xcoord, consos, width=1, align="center", color="linen",
-               linewidth=line_width, label="conso (heures)")
-
-  ax_theo.plot(xcoord, theo_equs, "--",
-               color="firebrick", linewidth=0.5,
-               solid_capstyle="round", solid_joinstyle="round")
-  ax_theo.plot(xcoord, theo_uses, line_style, color="firebrick",
-               linewidth=1, markersize=8,
-               solid_capstyle="round", solid_joinstyle="round",
-               label="conso\nthÃ©orique (%)")
-  ax_theo.plot(xcoord, real_uses, line_style, color="forestgreen",
-               linewidth=1, markersize=8,
-               solid_capstyle="round", solid_joinstyle="round",
-               label="conso\nrÃ©elle (%)")
-
-
-########################################
-def plot_config(fig, ax_conso, ax_theo, xcoord, dates, title, conso_per_day):
+  ax_conso.bar(
+    xcoord, consos, width=1, align="center", color="linen",
+    linewidth=line_width, label="conso (heures)"
+  )
+
+  ax_theo.plot(
+    xcoord, theo_equs, "--",
+    color="firebrick", linewidth=0.5,
+    solid_capstyle="round", solid_joinstyle="round"
+  )
+  ax_theo.plot(
+    xcoord, theo_uses, line_style, color="firebrick",
+    linewidth=1, markersize=8,
+    solid_capstyle="round", solid_joinstyle="round",
+    label="conso\nthÃ©orique (%)"
+  )
+  ax_theo.plot(
+    xcoord, real_uses, line_style, color="forestgreen",
+    linewidth=1, markersize=8,
+    solid_capstyle="round", solid_joinstyle="round",
+    label="conso\nrÃ©elle (%)"
+  )
+
+
+########################################
+def plot_config(fig, ax_conso, ax_theo, xcoord, dates, title,
+                conso_per_day):
   """
   """
@@ -273,5 +281,7 @@
   ax_conso.set_xticks(xcoord, minor=True)
   ax_conso.set_xticks(maj_xticks, minor=False)
-  ax_conso.set_xticklabels(maj_xlabs, rotation="vertical", size="x-small")
+  ax_conso.set_xticklabels(
+    maj_xlabs, rotation="vertical", size="x-small"
+  )
 
   yticks = list(ax_conso.get_yticks())
@@ -365,4 +375,6 @@
   # ... Files and directories ...
   # -----------------------------
+  project_name, DIR, OUT = parse_config("bin/config.ini")
+
   (file_param, file_utheo, file_data) = \
       get_input_files(DIR["SAVEDATA"],
@@ -381,7 +393,7 @@
   # .. Get project info ..
   # ======================
-  gencmip6 = Project()
-  gencmip6.fill_data(file_param)
-  gencmip6.get_date_init(file_utheo)
+  projet = Project()
+  projet.fill_data(file_param)
+  projet.get_date_init(file_utheo)
 
   # .. Fill in data ..
@@ -390,5 +402,5 @@
   # ----------------------
   bilan = DataDict()
-  bilan.init_range(gencmip6.date_init, gencmip6.deadline)
+  bilan.init_range(projet.date_init, projet.deadline)
   # ... Extract data from file ...
   # ------------------------------
@@ -423,5 +435,5 @@
   consos    = np.array(consos, dtype=float)
 
-  conso_per_day = gencmip6.alloc / gencmip6.days
+  conso_per_day = projet.alloc / projet.days
 
   theo_uses = np.array([100.*item.theo_use for item in selected_items],
@@ -456,10 +468,12 @@
   # --------------------
   title = "Consommation {}\n({:%d/%m/%Y} - {:%d/%m/%Y})".format(
-    gencmip6.project.upper(),
-    gencmip6.date_init,
-    gencmip6.deadline
-  )
-
-  plot_config(fig, ax_conso, ax_theo, xcoord, dates, title, conso_per_day)
+    projet.project.upper(),
+    projet.date_init,
+    projet.deadline
+  )
+
+  plot_config(
+    fig, ax_conso, ax_theo, xcoord, dates, title, conso_per_day
+  )
 
   # ... Save figure ...
@@ -469,10 +483,10 @@
                          "{}_{}.pdf".format(img_name, today))
 
-  plot_save(img_in, img_out, title)
+  plot_save(img_in, img_out, title, DIR)
 
   # ... Publish figure on dods ...
   # ------------------------------
   if args.dods:
-    dods_cp(img_in)
+    dods_cp(img_in, DIR)
 
   if args.show:
Index: /TOOLS/ConsoGENCMIP6/bin/plot_bilan_jobs.py
===================================================================
--- /TOOLS/ConsoGENCMIP6/bin/plot_bilan_jobs.py	(revision 2459)
+++ /TOOLS/ConsoGENCMIP6/bin/plot_bilan_jobs.py	(revision 2460)
@@ -13,6 +13,5 @@
 
 # Application library imports
-from gencmip6 import *
-from gencmip6_path import *
+from libconso import *
 
 
@@ -210,34 +209,47 @@
     line_width = 0.1
 
-  ax_conso.bar(xcoord, consos, width=1, align="center", color="linen",
-               linewidth=line_width, label="conso (heures)")
-
-  ax_theo.plot(xcoord, theo_equs, "--",
-               color="firebrick", linewidth=0.5,
-               solid_capstyle="round", solid_joinstyle="round")
-  ax_theo.plot(xcoord, theo_uses, line_style, color="firebrick",
-               linewidth=1, markersize=8,
-               solid_capstyle="round", solid_joinstyle="round",
-               label="conso\nthÃ©orique (%)")
-  ax_theo.plot(xcoord, real_uses, line_style, color="forestgreen",
-               linewidth=1, markersize=8,
-               solid_capstyle="round", solid_joinstyle="round",
-               label="conso\nrÃ©elle (%)")
+  ax_conso.bar(
+    xcoord, consos, width=1, align="center", color="linen",
+    linewidth=line_width, label="conso (heures)"
+  )
+
+  ax_theo.plot(
+    xcoord, theo_equs, "--",
+    color="firebrick", linewidth=0.5,
+    solid_capstyle="round", solid_joinstyle="round"
+  )
+  ax_theo.plot(
+    xcoord, theo_uses, line_style, color="firebrick",
+    linewidth=1, markersize=8,
+    solid_capstyle="round", solid_joinstyle="round",
+    label="conso\nthÃ©orique (%)"
+  )
+  ax_theo.plot(
+    xcoord, real_uses, line_style, color="forestgreen",
+    linewidth=1, markersize=8,
+    solid_capstyle="round", solid_joinstyle="round",
+    label="conso\nrÃ©elle (%)"
+  )
 
   line_width = 0.
   width = 1.05
 
-  ax_jobs.bar(xcoord, run_mean, width=width, align="center",
-              # yerr=run_std/2, ecolor="green",
-              color="lightgreen", linewidth=line_width, antialiased=True,
-              label="jobs running")
-  ax_jobs.bar(xcoord, pen_mean, bottom=run_mean, width=width, align="center",
-              # yerr=pen_std/2, ecolor="darkred",
-              color="firebrick", linewidth=line_width, antialiased=True,
-              label="jobs pending")
+  ax_jobs.bar(
+    xcoord, run_mean, width=width, align="center",
+    # yerr=run_std/2, ecolor="green",
+    color="lightgreen", linewidth=line_width,
+    antialiased=True, label="jobs running"
+  )
+  ax_jobs.bar(
+    xcoord, pen_mean, bottom=run_mean, width=width, align="center",
+    # yerr=pen_std/2, ecolor="darkred",
+    color="firebrick", linewidth=line_width,
+    antialiased=True, label="jobs pending"
+  )
 
 
 ########################################
-def plot_config(fig, ax_conso, ax_theo, xcoord, dates, title, conso_per_day):
+def plot_config(fig, ax_conso, ax_theo, xcoord, dates, title,
+                conso_per_day):
   """
   """
@@ -292,5 +304,7 @@
   ax_jobs.set_xticks(xcoord, minor=True)
   ax_jobs.set_xticks(maj_xticks, minor=False)
-  ax_jobs.set_xticklabels(maj_xlabs, rotation="vertical", size="x-small")
+  ax_jobs.set_xticklabels(
+    maj_xlabs, rotation="vertical", size="x-small"
+  )
 
   for ax, y, label in (
@@ -392,4 +406,6 @@
   # ... Files and directories ...
   # -----------------------------
+  project_name, DIR, OUT = parse_config("bin/config.ini")
+
   (file_param, file_utheo, file_data) = \
       get_input_files(DIR["SAVEDATA"],
@@ -408,7 +424,7 @@
   # .. Get project info ..
   # ======================
-  gencmip6 = Project()
-  gencmip6.fill_data(file_param)
-  gencmip6.get_date_init(file_utheo)
+  projet = Project()
+  projet.fill_data(file_param)
+  projet.get_date_init(file_utheo)
 
   # .. Fill in data ..
@@ -417,5 +433,5 @@
   # ----------------------
   bilan = DataDict()
-  bilan.init_range(gencmip6.date_init, gencmip6.deadline)
+  bilan.init_range(projet.date_init, projet.deadline)
   # ... Extract data from file ...
   # ------------------------------
@@ -450,5 +466,5 @@
   consos    = np.array(consos, dtype=float)
 
-  conso_per_day = gencmip6.alloc / gencmip6.days
+  conso_per_day = projet.alloc / projet.days
 
   theo_uses = np.array([100.*item.theo_use for item in selected_items],
@@ -484,10 +500,12 @@
   title = "{} : Conso globale et suivi des jobs " \
           "(moyenne journaliÃšre)\n({:%d/%m/%Y} - {:%d/%m/%Y})".format(
-            gencmip6.project.upper(),
-            gencmip6.date_init,
-            gencmip6.deadline
+            projet.project.upper(),
+            projet.date_init,
+            projet.deadline
           )
 
-  plot_config(fig, ax_conso, ax_theo, xcoord, dates, title, conso_per_day)
+  plot_config(
+    fig, ax_conso, ax_theo, xcoord, dates, title, conso_per_day
+  )
 
   # ... Save figure ...
@@ -497,10 +515,10 @@
                          "{}_{}.pdf".format(img_name, today))
 
-  plot_save(img_in, img_out, title)
+  plot_save(img_in, img_out, title, DIR)
 
   # ... Publish figure on dods ...
   # ------------------------------
   if args.dods:
-    dods_cp(img_in)
+    dods_cp(img_in, DIR)
 
   if args.show:
Index: /TOOLS/ConsoGENCMIP6/bin/plot_jobs.py
===================================================================
--- /TOOLS/ConsoGENCMIP6/bin/plot_jobs.py	(revision 2459)
+++ /TOOLS/ConsoGENCMIP6/bin/plot_jobs.py	(revision 2460)
@@ -13,6 +13,5 @@
 
 # Application library imports
-from gencmip6 import *
-from gencmip6_path import *
+from libconso import *
 
 
@@ -50,6 +49,6 @@
           converters={
             0: string_to_datetime,
-            1: int,
-            2: int,
+            1: float,
+            2: float,
           },
           missing_values="nan",
@@ -191,14 +190,24 @@
   width = 1.05
 
-  ax.bar(xcoord, run_jobs, width=width, yerr=run_std/2.,
-         linewidth=line_width, align="center",
-         color="lightgreen", ecolor="green", antialiased=True,
-         label="jobs running")
-  ax.bar(xcoord, pen_jobs, bottom=run_jobs, width=width,
-         linewidth=line_width, align="center",
-         color="firebrick", antialiased=True,
-         label="jobs pending")
-  # ax.step(xcoord, run_jobs, where="mid", linewidth=1, color="black", label="jobs running")
-  # ax.step(xcoord, pen_jobs+run_jobs, where="mid", linewidth=1, color="black", label="jobs running")
+  ax.bar(
+    xcoord, run_jobs, width=width, yerr=run_std/2.,
+    linewidth=line_width, align="center",
+    color="lightgreen", ecolor="green", antialiased=True,
+    label="jobs running"
+  )
+  ax.bar(
+    xcoord, pen_jobs, bottom=run_jobs, width=width,
+    linewidth=line_width, align="center",
+    color="firebrick", antialiased=True,
+    label="jobs pending"
+  )
+  # ax.step(
+  #   xcoord, run_jobs, where="mid",
+  #   linewidth=1, color="black", label="jobs running"
+  # )
+  # ax.step(
+  #   xcoord, pen_jobs+run_jobs, where="mid",
+  #   linewidth=1, color="black", label="jobs running"
+  # )
 
 
@@ -310,4 +319,6 @@
   # ... Files and directories ...
   # -----------------------------
+  project_name, DIR, OUT = parse_config("bin/config.ini")
+
   (file_param, file_utheo) = \
       get_input_files(DIR["SAVEDATA"], [OUT["PARAM"], OUT["UTHEO"]])
@@ -332,7 +343,7 @@
   # .. Get project info ..
   # ======================
-  gencmip6 = Project()
-  gencmip6.fill_data(file_param)
-  gencmip6.get_date_init(file_utheo)
+  projet = Project()
+  projet.fill_data(file_param)
+  projet.get_date_init(file_utheo)
 
   # .. Fill in data ..
@@ -341,13 +352,9 @@
   # ----------------------
   bilan = DataDict()
-  bilan.init_range(gencmip6.date_init, gencmip6.deadline)
+  bilan.init_range(projet.date_init, projet.deadline)
 
   # ... Extract data from file ...
   # ------------------------------
   bilan.fill_data(file_list)
-
-  # # ... Compute theoratical use from known data  ...
-  # # ------------------------------------------------
-  # bilan.theo_equation()
 
   # .. Extract data depending on C.L. arguments ..
@@ -360,7 +367,8 @@
     )
   else:
-    # selected_items = bilan.get_items(args.inc)
     range_end   = today
-    range_start = range_end + dt.timedelta(weeks=-WEEK_NB) - dt.timedelta(days=1)
+    range_start = (
+      range_end + dt.timedelta(weeks=-WEEK_NB) - dt.timedelta(days=1)
+    )
     selected_items = bilan.get_items_in_range(
       range_start, range_end, args.inc
@@ -402,5 +410,5 @@
         )
 
-  conso_per_day = gencmip6.alloc / (gencmip6.days * 24.)
+  conso_per_day = projet.alloc / (projet.days * 24.)
 
   # .. Plot stuff ..
@@ -416,13 +424,8 @@
   # # ... Tweak figure ...
   # # --------------------
-  # if args.max:
-  #   ymax = gencmip6.alloc
-  # else:
-  #   ymax = np.nanmax(consos) + np.nanmax(consos)*.1
-
   title = "Suivi des jobs {}\n({:%d/%m/%Y} - {:%d/%m/%Y})".format(
-    gencmip6.project.upper(),
-    gencmip6.date_init,
-    gencmip6.deadline
+    projet.project.upper(),
+    projet.date_init,
+    projet.deadline
   )
 
@@ -435,10 +438,10 @@
                          "{}_w{:02d}.pdf".format(img_name, weeknum))
 
-  plot_save(img_in, img_out, title)
+  plot_save(img_in, img_out, title, DIR)
 
   # ... Publish figure on dods ...
   # ------------------------------
   if args.dods:
-    dods_cp(img_in)
+    dods_cp(img_in, DIR)
 
   if args.show:
Index: /TOOLS/ConsoGENCMIP6/bin/plot_login.py
===================================================================
--- /TOOLS/ConsoGENCMIP6/bin/plot_login.py	(revision 2459)
+++ /TOOLS/ConsoGENCMIP6/bin/plot_login.py	(revision 2460)
@@ -12,6 +12,5 @@
 
 # Application library imports
-from gencmip6 import *
-from gencmip6_path import *
+from libconso import *
 
 
@@ -120,31 +119,4 @@
 
 
-# ########################################
-# def plot_save(img_name):
-#   """
-#   """
-#   dpi = 200.
-
-#   img_in  = os.path.join(DIR["PLOT"], "{}.pdf".format(img_name))
-
-#   with PdfPages(img_in) as pdf:
-#     pdf.savefig(dpi=dpi)
-
-#     # pdf file's metadata
-#     d = pdf.infodict()
-#     d["Title"]   = "Conso GENCMIP6 par login"
-#     d["Author"]  = "plot_bilan.py"
-#     # d["Subject"] = "Time spent over specific commands during create_ts \
-#     #                 jobs at IDRIS and four configurations at TGCC"
-#     # d["Keywords"] = "bench create_ts TGCC IDRIS ncrcat"
-#     # d["CreationDate"] = dt.datetime(2009, 11, 13)
-#     # d["ModDate"] = dt.datetime.today()
-
-#   if os.path.isdir(DIR["SAVEPLOT"]):
-#     img_out = os.path.join(DIR["SAVEPLOT"],
-#                            "{}_{}.pdf".format(img_name, today))
-#     shutil.copy(img_in, img_out)
-
-
 ########################################
 def get_arguments():
@@ -188,4 +160,6 @@
   # ... Files and directories ...
   # -----------------------------
+  project_name, DIR, OUT = parse_config("bin/config.ini")
+
   (file_param, file_utheo, file_data) = \
       get_input_files(DIR["SAVEDATA"],
@@ -204,7 +178,7 @@
   # .. Get project info ..
   # ======================
-  gencmip6 = Project()
-  gencmip6.fill_data(file_param)
-  gencmip6.get_date_init(file_utheo)
+  projet = Project()
+  projet.fill_data(file_param)
+  projet.get_date_init(file_utheo)
 
   # .. Fill in data dict ..
@@ -249,5 +223,5 @@
   # --------------------
   title = "Consommation {} par login\n{:%d/%m/%Y}".format(
-    gencmip6.project.upper(),
+    projet.project.upper(),
     date
   )
@@ -260,10 +234,10 @@
                          "{}_{}.pdf".format(img_name, today))
 
-  plot_save(img_in, img_out, title)
+  plot_save(img_in, img_out, title, DIR)
 
   # ... Publish figure on dods ...
   # ------------------------------
   if args.dods:
-    dods_cp(img_in)
+    dods_cp(img_in, DIR)
 
   if args.show:
Index: /TOOLS/ConsoGENCMIP6/bin/plot_store.py
===================================================================
--- /TOOLS/ConsoGENCMIP6/bin/plot_store.py	(revision 2459)
+++ /TOOLS/ConsoGENCMIP6/bin/plot_store.py	(revision 2460)
@@ -14,6 +14,5 @@
 
 # Application library imports
-from gencmip6 import *
-from gencmip6_path import *
+from libconso import *
 
 
@@ -213,4 +212,6 @@
   # ... Files and directories ...
   # -----------------------------
+  project_name, DIR, OUT = parse_config("bin/config.ini")
+
   (file_param, file_utheo, file_data) = \
       get_input_files(DIR["SAVEDATA"],
@@ -229,7 +230,7 @@
   # .. Get project info ..
   # ======================
-  gencmip6 = Project()
-  gencmip6.fill_data(file_param)
-  gencmip6.get_date_init(file_utheo)
+  projet = Project()
+  projet.fill_data(file_param)
+  projet.get_date_init(file_utheo)
 
   # .. Fill in data dict ..
@@ -282,5 +283,5 @@
   # --------------------
   title = "Occupation {} de STORE par login\n{:%d/%m/%Y}".format(
-    gencmip6.project.upper(),
+    projet.project.upper(),
     date
   )
@@ -294,10 +295,10 @@
                          "{}_{}.pdf".format(img_name, today))
 
-  plot_save(img_in, img_out, title)
+  plot_save(img_in, img_out, title, DIR)
 
   # ... Publish figure on dods ...
   # ------------------------------
   if args.dods:
-    dods_cp(img_in)
+    dods_cp(img_in, DIR)
 
   if args.show:
Index: /TOOLS/ConsoGENCMIP6/launch_conso.sh
===================================================================
--- /TOOLS/ConsoGENCMIP6/launch_conso.sh	(revision 2459)
+++ /TOOLS/ConsoGENCMIP6/launch_conso.sh	(revision 2460)
@@ -11,4 +11,5 @@
   . /etc/bashrc
 fi
+
 # Load python
 # ===========
@@ -19,5 +20,6 @@
 # Go to root directory
 # ====================
-cd ${HOME}/ConsoGENCMIP6/
+ROOT_DIR=$( dirname $0 )
+cd ${ROOT_DIR}
 
 # Main script to get data
@@ -39,4 +41,5 @@
 # -f : plot the whole period of the project
 # -d : copy plot on dods
+# -v : verbose mode
 script="plot_bilan"
 printf "\n${script}\n"
@@ -53,5 +56,5 @@
 printf "\n${script}\n"
 echo "--------------------"
-bin/${script}.py -fd
+bin/${script}.py -fv
 rc=$?
 if [ ${rc} -ne 0 ] ; then
Index: /TOOLS/ConsoGENCMIP6/launch_jobs.sh
===================================================================
--- /TOOLS/ConsoGENCMIP6/launch_jobs.sh	(revision 2459)
+++ /TOOLS/ConsoGENCMIP6/launch_jobs.sh	(revision 2460)
@@ -40,5 +40,5 @@
 printf "\n${script}\n"
 echo "--------------------"
-bin/${script}.py -d
+bin/${script}.py -v
 rc=$?
 if [ ${rc} -ne 0 ] ; then
