Changeset 2460


Ignore:
Timestamp:
04/02/15 12:12:26 (9 years ago)
Author:
labetoulle
Message:
  • Use an INI config file
  • reaname "gencmip6" variables
Location:
TOOLS/ConsoGENCMIP6
Files:
1 added
9 edited
1 moved

Legend:

Unmodified
Added
Removed
  • TOOLS/ConsoGENCMIP6/bin

    • Property svn:ignore
      •  

        old new  
        1 gencmip6_path.py 
         1*.pyc 
  • TOOLS/ConsoGENCMIP6/bin/conso_gencmip6.py

    r2437 r2460  
    1515 
    1616# Application library imports 
    17 from gencmip6 import * 
    18 from gencmip6_path import * 
     17from libconso import * 
    1918 
    2019 
     
    5756 
    5857######################################## 
    59 def parse_myproject(filename): 
     58def parse_myproject(filename, project_name): 
    6059 
    6160  project = {} 
    62   project["project"] = "gencmip6" 
     61  project["name"] = project_name 
    6362  logins  = {} 
    6463 
     
    7675    # Then extract script date 
    7776    for ligne in filein: 
    78       if project["project"] in ligne: 
     77      if project["name"] in ligne: 
    7978        today = ligne.split()[-1] 
    8079        today = string_to_date(today) 
     80        project["machine"] = ligne.split()[5] 
     81        project["nodes"]   = ligne.split()[6] 
    8182 
    8283        break 
     
    137138 
    138139######################################## 
    139 def write_bilan(filename, today, total, ureal, utheo, run_mean, pen_mean, run_std, pen_std): 
     140def write_bilan(filename, today, total, ureal, utheo, 
     141                run_mean, pen_mean, run_std, pen_std): 
    140142  """ 
    141143  Conso totale par jour 
     
    145147  """ 
    146148 
    147   title_str  = "{:10s} {:12s} {:11s} {:11s} {:13s} {:13s} {:13s} {:13s}\n".format( 
    148                  "date", 
    149                  "conso(hours)", 
    150                  "real_use(%)", 
    151                  "theo_use(%)", 
    152                  "running(core)", 
    153                  "pending(core)", 
    154                  "run_std(core)", 
    155                  "pen_std(core)", 
    156                ) 
    157   str_fmt = "{:%Y-%m-%d} {:12.2f} {:11.2f} {:11.2f} {:13.2f} {:13.2f} {:13.2f} {:13.2f}\n" 
    158   result_str = str_fmt.format( 
    159                  today, 
    160                  total, 
    161                  ureal, 
    162                  utheo, 
    163                  run_mean, 
    164                  pen_mean, 
    165                  run_std, 
    166                  pen_std, 
    167                ) 
     149  fmt_str = "{:10s} {:12s} {:11s} {:11s} {:13s} {:13s} {:13s} {:13s}\n" 
     150 
     151  title_str  = fmt_str.format( 
     152    "date", 
     153    "conso(hours)", 
     154    "real_use(%)", 
     155    "theo_use(%)", 
     156    "running(core)", 
     157    "pending(core)", 
     158    "run_std(core)", 
     159    "pen_std(core)", 
     160  ) 
     161 
     162  fmt_str = ( 
     163    "{:%Y-%m-%d} {:12.2f} {:11.2f} {:11.2f} " 
     164    "{:13.2f} {:13.2f} {:13.2f} {:13.2f}\n" 
     165  ) 
     166 
     167  result_str = fmt_str.format( 
     168    today, 
     169    total, 
     170    ureal, 
     171    utheo, 
     172    run_mean, 
     173    pen_mean, 
     174    run_std, 
     175    pen_std, 
     176  ) 
    168177 
    169178  if args.dryrun: 
     
    337346    args.all = False 
    338347 
     348  project_name, DIR, OUT = parse_config("bin/config.ini") 
     349 
    339350  if args.verbose: 
    340351    print(DIR["DATA"]) 
    341352    print(DIR["SAVEDATA"]) 
    342353 
    343   (project, logins, today, total, utheo, ureal) = \ 
    344       parse_myproject(os.path.join(DIR["DATA"], OUT["CCCMP"])) 
     354  (project, logins, today, total, utheo, ureal) = parse_myproject( 
     355    os.path.join(DIR["DATA"], OUT["CCCMP"]), 
     356    project_name 
     357  ) 
    345358 
    346359  if args.verbose: 
     
    384397        converters={ 
    385398          0: string_to_datetime, 
    386           1: int, 
    387           2: int, 
     399          1: float, 
     400          2: float, 
    388401        }, 
    389402        missing_values="nan", 
  • TOOLS/ConsoGENCMIP6/bin/libconso.py

    r2440 r2460  
    1414import datetime as dt 
    1515import numpy as np 
     16import ConfigParser as cp 
    1617 
    1718# Application library imports 
    18 from gencmip6_path import * 
    19  
    20  
    21 ######################################## 
    22 def dods_cp(filein): 
     19 
     20 
     21######################################## 
     22def dods_cp(filein, DIR): 
    2323  """ 
    2424  """ 
     
    4444 
    4545  return 
     46 
     47 
     48######################################## 
     49def parse_config(filename): 
     50 
     51  DIR = {} 
     52  OUT = {} 
     53 
     54  config = cp.ConfigParser() 
     55  config.optionxform = str 
     56  config.read(filename) 
     57 
     58  for section in ("projet", "directories", "files"): 
     59    if not config.has_section(section): 
     60      print("Missing section {} in {}, we stop".format(section, filename)) 
     61      exit(1) 
     62 
     63  # .. Project name .. 
     64  # ------------------ 
     65  section = "projet" 
     66  option  = "name" 
     67  project_name = config.get(section, option) 
     68 
     69  # ..Common directories .. 
     70  # ----------------------- 
     71  section = "directories" 
     72  for option in config.options(section): 
     73    res = config.get(section, option) 
     74    if res != "None": 
     75      DIR[option] = res 
     76    else: 
     77      DIR[option] = None 
     78 
     79    if DIR[option] and not os.path.isdir(DIR[option]): 
     80      print("mkdir {}".format(DIR[option])) 
     81      try : 
     82        os.makedirs(DIR[option]) 
     83      except Exception as rc : 
     84        print("Could not create {}:\n{}".format(DIR[option], rc)) 
     85 
     86  # ..Common files .. 
     87  # ----------------- 
     88  section = "files" 
     89  for option in config.options(section): 
     90    OUT[option] = config.get(section, option) 
     91 
     92  return (project_name, DIR, OUT) 
    4693 
    4794 
     
    142189 
    143190######################################## 
    144 def plot_save(img_in, img_out, title): 
     191def plot_save(img_in, img_out, title, DIR): 
    145192  """ 
    146193  """ 
     
    184231    import json 
    185232    dico = json.load(open(filein, "r")) 
    186     self.project = dico["project"] 
     233    self.project = dico["name"] 
    187234    self.deadline = string_to_date(dico["deadline"]) + \ 
    188235                    dt.timedelta(days=-1) 
  • TOOLS/ConsoGENCMIP6/bin/plot_bilan.py

    r2448 r2460  
    1313 
    1414# Application library imports 
    15 from gencmip6 import * 
    16 from gencmip6_path import * 
     15from libconso import * 
    1716 
    1817 
     
    204203    line_width = 0.1 
    205204 
    206   ax_conso.bar(xcoord, consos, width=1, align="center", color="linen", 
    207                linewidth=line_width, label="conso (heures)") 
    208  
    209   ax_theo.plot(xcoord, theo_equs, "--", 
    210                color="firebrick", linewidth=0.5, 
    211                solid_capstyle="round", solid_joinstyle="round") 
    212   ax_theo.plot(xcoord, theo_uses, line_style, color="firebrick", 
    213                linewidth=1, markersize=8, 
    214                solid_capstyle="round", solid_joinstyle="round", 
    215                label="conso\nthéorique (%)") 
    216   ax_theo.plot(xcoord, real_uses, line_style, color="forestgreen", 
    217                linewidth=1, markersize=8, 
    218                solid_capstyle="round", solid_joinstyle="round", 
    219                label="conso\nréelle (%)") 
    220  
    221  
    222 ######################################## 
    223 def plot_config(fig, ax_conso, ax_theo, xcoord, dates, title, conso_per_day): 
     205  ax_conso.bar( 
     206    xcoord, consos, width=1, align="center", color="linen", 
     207    linewidth=line_width, label="conso (heures)" 
     208  ) 
     209 
     210  ax_theo.plot( 
     211    xcoord, theo_equs, "--", 
     212    color="firebrick", linewidth=0.5, 
     213    solid_capstyle="round", solid_joinstyle="round" 
     214  ) 
     215  ax_theo.plot( 
     216    xcoord, theo_uses, line_style, color="firebrick", 
     217    linewidth=1, markersize=8, 
     218    solid_capstyle="round", solid_joinstyle="round", 
     219    label="conso\nthéorique (%)" 
     220  ) 
     221  ax_theo.plot( 
     222    xcoord, real_uses, line_style, color="forestgreen", 
     223    linewidth=1, markersize=8, 
     224    solid_capstyle="round", solid_joinstyle="round", 
     225    label="conso\nréelle (%)" 
     226  ) 
     227 
     228 
     229######################################## 
     230def plot_config(fig, ax_conso, ax_theo, xcoord, dates, title, 
     231                conso_per_day): 
    224232  """ 
    225233  """ 
     
    273281  ax_conso.set_xticks(xcoord, minor=True) 
    274282  ax_conso.set_xticks(maj_xticks, minor=False) 
    275   ax_conso.set_xticklabels(maj_xlabs, rotation="vertical", size="x-small") 
     283  ax_conso.set_xticklabels( 
     284    maj_xlabs, rotation="vertical", size="x-small" 
     285  ) 
    276286 
    277287  yticks = list(ax_conso.get_yticks()) 
     
    365375  # ... Files and directories ... 
    366376  # ----------------------------- 
     377  project_name, DIR, OUT = parse_config("bin/config.ini") 
     378 
    367379  (file_param, file_utheo, file_data) = \ 
    368380      get_input_files(DIR["SAVEDATA"], 
     
    381393  # .. Get project info .. 
    382394  # ====================== 
    383   gencmip6 = Project() 
    384   gencmip6.fill_data(file_param) 
    385   gencmip6.get_date_init(file_utheo) 
     395  projet = Project() 
     396  projet.fill_data(file_param) 
     397  projet.get_date_init(file_utheo) 
    386398 
    387399  # .. Fill in data .. 
     
    390402  # ---------------------- 
    391403  bilan = DataDict() 
    392   bilan.init_range(gencmip6.date_init, gencmip6.deadline) 
     404  bilan.init_range(projet.date_init, projet.deadline) 
    393405  # ... Extract data from file ... 
    394406  # ------------------------------ 
     
    423435  consos    = np.array(consos, dtype=float) 
    424436 
    425   conso_per_day = gencmip6.alloc / gencmip6.days 
     437  conso_per_day = projet.alloc / projet.days 
    426438 
    427439  theo_uses = np.array([100.*item.theo_use for item in selected_items], 
     
    456468  # -------------------- 
    457469  title = "Consommation {}\n({:%d/%m/%Y} - {:%d/%m/%Y})".format( 
    458     gencmip6.project.upper(), 
    459     gencmip6.date_init, 
    460     gencmip6.deadline 
    461   ) 
    462  
    463   plot_config(fig, ax_conso, ax_theo, xcoord, dates, title, conso_per_day) 
     470    projet.project.upper(), 
     471    projet.date_init, 
     472    projet.deadline 
     473  ) 
     474 
     475  plot_config( 
     476    fig, ax_conso, ax_theo, xcoord, dates, title, conso_per_day 
     477  ) 
    464478 
    465479  # ... Save figure ... 
     
    469483                         "{}_{}.pdf".format(img_name, today)) 
    470484 
    471   plot_save(img_in, img_out, title) 
     485  plot_save(img_in, img_out, title, DIR) 
    472486 
    473487  # ... Publish figure on dods ... 
    474488  # ------------------------------ 
    475489  if args.dods: 
    476     dods_cp(img_in) 
     490    dods_cp(img_in, DIR) 
    477491 
    478492  if args.show: 
  • TOOLS/ConsoGENCMIP6/bin/plot_bilan_jobs.py

    r2449 r2460  
    1313 
    1414# Application library imports 
    15 from gencmip6 import * 
    16 from gencmip6_path import * 
     15from libconso import * 
    1716 
    1817 
     
    210209    line_width = 0.1 
    211210 
    212   ax_conso.bar(xcoord, consos, width=1, align="center", color="linen", 
    213                linewidth=line_width, label="conso (heures)") 
    214  
    215   ax_theo.plot(xcoord, theo_equs, "--", 
    216                color="firebrick", linewidth=0.5, 
    217                solid_capstyle="round", solid_joinstyle="round") 
    218   ax_theo.plot(xcoord, theo_uses, line_style, color="firebrick", 
    219                linewidth=1, markersize=8, 
    220                solid_capstyle="round", solid_joinstyle="round", 
    221                label="conso\nthéorique (%)") 
    222   ax_theo.plot(xcoord, real_uses, line_style, color="forestgreen", 
    223                linewidth=1, markersize=8, 
    224                solid_capstyle="round", solid_joinstyle="round", 
    225                label="conso\nréelle (%)") 
     211  ax_conso.bar( 
     212    xcoord, consos, width=1, align="center", color="linen", 
     213    linewidth=line_width, label="conso (heures)" 
     214  ) 
     215 
     216  ax_theo.plot( 
     217    xcoord, theo_equs, "--", 
     218    color="firebrick", linewidth=0.5, 
     219    solid_capstyle="round", solid_joinstyle="round" 
     220  ) 
     221  ax_theo.plot( 
     222    xcoord, theo_uses, line_style, color="firebrick", 
     223    linewidth=1, markersize=8, 
     224    solid_capstyle="round", solid_joinstyle="round", 
     225    label="conso\nthéorique (%)" 
     226  ) 
     227  ax_theo.plot( 
     228    xcoord, real_uses, line_style, color="forestgreen", 
     229    linewidth=1, markersize=8, 
     230    solid_capstyle="round", solid_joinstyle="round", 
     231    label="conso\nréelle (%)" 
     232  ) 
    226233 
    227234  line_width = 0. 
    228235  width = 1.05 
    229236 
    230   ax_jobs.bar(xcoord, run_mean, width=width, align="center", 
    231               # yerr=run_std/2, ecolor="green", 
    232               color="lightgreen", linewidth=line_width, antialiased=True, 
    233               label="jobs running") 
    234   ax_jobs.bar(xcoord, pen_mean, bottom=run_mean, width=width, align="center", 
    235               # yerr=pen_std/2, ecolor="darkred", 
    236               color="firebrick", linewidth=line_width, antialiased=True, 
    237               label="jobs pending") 
     237  ax_jobs.bar( 
     238    xcoord, run_mean, width=width, align="center", 
     239    # yerr=run_std/2, ecolor="green", 
     240    color="lightgreen", linewidth=line_width, 
     241    antialiased=True, label="jobs running" 
     242  ) 
     243  ax_jobs.bar( 
     244    xcoord, pen_mean, bottom=run_mean, width=width, align="center", 
     245    # yerr=pen_std/2, ecolor="darkred", 
     246    color="firebrick", linewidth=line_width, 
     247    antialiased=True, label="jobs pending" 
     248  ) 
    238249 
    239250 
    240251######################################## 
    241 def plot_config(fig, ax_conso, ax_theo, xcoord, dates, title, conso_per_day): 
     252def plot_config(fig, ax_conso, ax_theo, xcoord, dates, title, 
     253                conso_per_day): 
    242254  """ 
    243255  """ 
     
    292304  ax_jobs.set_xticks(xcoord, minor=True) 
    293305  ax_jobs.set_xticks(maj_xticks, minor=False) 
    294   ax_jobs.set_xticklabels(maj_xlabs, rotation="vertical", size="x-small") 
     306  ax_jobs.set_xticklabels( 
     307    maj_xlabs, rotation="vertical", size="x-small" 
     308  ) 
    295309 
    296310  for ax, y, label in ( 
     
    392406  # ... Files and directories ... 
    393407  # ----------------------------- 
     408  project_name, DIR, OUT = parse_config("bin/config.ini") 
     409 
    394410  (file_param, file_utheo, file_data) = \ 
    395411      get_input_files(DIR["SAVEDATA"], 
     
    408424  # .. Get project info .. 
    409425  # ====================== 
    410   gencmip6 = Project() 
    411   gencmip6.fill_data(file_param) 
    412   gencmip6.get_date_init(file_utheo) 
     426  projet = Project() 
     427  projet.fill_data(file_param) 
     428  projet.get_date_init(file_utheo) 
    413429 
    414430  # .. Fill in data .. 
     
    417433  # ---------------------- 
    418434  bilan = DataDict() 
    419   bilan.init_range(gencmip6.date_init, gencmip6.deadline) 
     435  bilan.init_range(projet.date_init, projet.deadline) 
    420436  # ... Extract data from file ... 
    421437  # ------------------------------ 
     
    450466  consos    = np.array(consos, dtype=float) 
    451467 
    452   conso_per_day = gencmip6.alloc / gencmip6.days 
     468  conso_per_day = projet.alloc / projet.days 
    453469 
    454470  theo_uses = np.array([100.*item.theo_use for item in selected_items], 
     
    484500  title = "{} : Conso globale et suivi des jobs " \ 
    485501          "(moyenne journaliÚre)\n({:%d/%m/%Y} - {:%d/%m/%Y})".format( 
    486             gencmip6.project.upper(), 
    487             gencmip6.date_init, 
    488             gencmip6.deadline 
     502            projet.project.upper(), 
     503            projet.date_init, 
     504            projet.deadline 
    489505          ) 
    490506 
    491   plot_config(fig, ax_conso, ax_theo, xcoord, dates, title, conso_per_day) 
     507  plot_config( 
     508    fig, ax_conso, ax_theo, xcoord, dates, title, conso_per_day 
     509  ) 
    492510 
    493511  # ... Save figure ... 
     
    497515                         "{}_{}.pdf".format(img_name, today)) 
    498516 
    499   plot_save(img_in, img_out, title) 
     517  plot_save(img_in, img_out, title, DIR) 
    500518 
    501519  # ... Publish figure on dods ... 
    502520  # ------------------------------ 
    503521  if args.dods: 
    504     dods_cp(img_in) 
     522    dods_cp(img_in, DIR) 
    505523 
    506524  if args.show: 
  • TOOLS/ConsoGENCMIP6/bin/plot_jobs.py

    r2450 r2460  
    1313 
    1414# Application library imports 
    15 from gencmip6 import * 
    16 from gencmip6_path import * 
     15from libconso import * 
    1716 
    1817 
     
    5049          converters={ 
    5150            0: string_to_datetime, 
    52             1: int, 
    53             2: int, 
     51            1: float, 
     52            2: float, 
    5453          }, 
    5554          missing_values="nan", 
     
    191190  width = 1.05 
    192191 
    193   ax.bar(xcoord, run_jobs, width=width, yerr=run_std/2., 
    194          linewidth=line_width, align="center", 
    195          color="lightgreen", ecolor="green", antialiased=True, 
    196          label="jobs running") 
    197   ax.bar(xcoord, pen_jobs, bottom=run_jobs, width=width, 
    198          linewidth=line_width, align="center", 
    199          color="firebrick", antialiased=True, 
    200          label="jobs pending") 
    201   # ax.step(xcoord, run_jobs, where="mid", linewidth=1, color="black", label="jobs running") 
    202   # ax.step(xcoord, pen_jobs+run_jobs, where="mid", linewidth=1, color="black", label="jobs running") 
     192  ax.bar( 
     193    xcoord, run_jobs, width=width, yerr=run_std/2., 
     194    linewidth=line_width, align="center", 
     195    color="lightgreen", ecolor="green", antialiased=True, 
     196    label="jobs running" 
     197  ) 
     198  ax.bar( 
     199    xcoord, pen_jobs, bottom=run_jobs, width=width, 
     200    linewidth=line_width, align="center", 
     201    color="firebrick", antialiased=True, 
     202    label="jobs pending" 
     203  ) 
     204  # ax.step( 
     205  #   xcoord, run_jobs, where="mid", 
     206  #   linewidth=1, color="black", label="jobs running" 
     207  # ) 
     208  # ax.step( 
     209  #   xcoord, pen_jobs+run_jobs, where="mid", 
     210  #   linewidth=1, color="black", label="jobs running" 
     211  # ) 
    203212 
    204213 
     
    310319  # ... Files and directories ... 
    311320  # ----------------------------- 
     321  project_name, DIR, OUT = parse_config("bin/config.ini") 
     322 
    312323  (file_param, file_utheo) = \ 
    313324      get_input_files(DIR["SAVEDATA"], [OUT["PARAM"], OUT["UTHEO"]]) 
     
    332343  # .. Get project info .. 
    333344  # ====================== 
    334   gencmip6 = Project() 
    335   gencmip6.fill_data(file_param) 
    336   gencmip6.get_date_init(file_utheo) 
     345  projet = Project() 
     346  projet.fill_data(file_param) 
     347  projet.get_date_init(file_utheo) 
    337348 
    338349  # .. Fill in data .. 
     
    341352  # ---------------------- 
    342353  bilan = DataDict() 
    343   bilan.init_range(gencmip6.date_init, gencmip6.deadline) 
     354  bilan.init_range(projet.date_init, projet.deadline) 
    344355 
    345356  # ... Extract data from file ... 
    346357  # ------------------------------ 
    347358  bilan.fill_data(file_list) 
    348  
    349   # # ... Compute theoratical use from known data  ... 
    350   # # ------------------------------------------------ 
    351   # bilan.theo_equation() 
    352359 
    353360  # .. Extract data depending on C.L. arguments .. 
     
    360367    ) 
    361368  else: 
    362     # selected_items = bilan.get_items(args.inc) 
    363369    range_end   = today 
    364     range_start = range_end + dt.timedelta(weeks=-WEEK_NB) - dt.timedelta(days=1) 
     370    range_start = ( 
     371      range_end + dt.timedelta(weeks=-WEEK_NB) - dt.timedelta(days=1) 
     372    ) 
    365373    selected_items = bilan.get_items_in_range( 
    366374      range_start, range_end, args.inc 
     
    402410        ) 
    403411 
    404   conso_per_day = gencmip6.alloc / (gencmip6.days * 24.) 
     412  conso_per_day = projet.alloc / (projet.days * 24.) 
    405413 
    406414  # .. Plot stuff .. 
     
    416424  # # ... Tweak figure ... 
    417425  # # -------------------- 
    418   # if args.max: 
    419   #   ymax = gencmip6.alloc 
    420   # else: 
    421   #   ymax = np.nanmax(consos) + np.nanmax(consos)*.1 
    422  
    423426  title = "Suivi des jobs {}\n({:%d/%m/%Y} - {:%d/%m/%Y})".format( 
    424     gencmip6.project.upper(), 
    425     gencmip6.date_init, 
    426     gencmip6.deadline 
     427    projet.project.upper(), 
     428    projet.date_init, 
     429    projet.deadline 
    427430  ) 
    428431 
     
    435438                         "{}_w{:02d}.pdf".format(img_name, weeknum)) 
    436439 
    437   plot_save(img_in, img_out, title) 
     440  plot_save(img_in, img_out, title, DIR) 
    438441 
    439442  # ... Publish figure on dods ... 
    440443  # ------------------------------ 
    441444  if args.dods: 
    442     dods_cp(img_in) 
     445    dods_cp(img_in, DIR) 
    443446 
    444447  if args.show: 
  • TOOLS/ConsoGENCMIP6/bin/plot_login.py

    r2433 r2460  
    1212 
    1313# Application library imports 
    14 from gencmip6 import * 
    15 from gencmip6_path import * 
     14from libconso import * 
    1615 
    1716 
     
    120119 
    121120 
    122 # ######################################## 
    123 # def plot_save(img_name): 
    124 #   """ 
    125 #   """ 
    126 #   dpi = 200. 
    127  
    128 #   img_in  = os.path.join(DIR["PLOT"], "{}.pdf".format(img_name)) 
    129  
    130 #   with PdfPages(img_in) as pdf: 
    131 #     pdf.savefig(dpi=dpi) 
    132  
    133 #     # pdf file's metadata 
    134 #     d = pdf.infodict() 
    135 #     d["Title"]   = "Conso GENCMIP6 par login" 
    136 #     d["Author"]  = "plot_bilan.py" 
    137 #     # d["Subject"] = "Time spent over specific commands during create_ts \ 
    138 #     #                 jobs at IDRIS and four configurations at TGCC" 
    139 #     # d["Keywords"] = "bench create_ts TGCC IDRIS ncrcat" 
    140 #     # d["CreationDate"] = dt.datetime(2009, 11, 13) 
    141 #     # d["ModDate"] = dt.datetime.today() 
    142  
    143 #   if os.path.isdir(DIR["SAVEPLOT"]): 
    144 #     img_out = os.path.join(DIR["SAVEPLOT"], 
    145 #                            "{}_{}.pdf".format(img_name, today)) 
    146 #     shutil.copy(img_in, img_out) 
    147  
    148  
    149121######################################## 
    150122def get_arguments(): 
     
    188160  # ... Files and directories ... 
    189161  # ----------------------------- 
     162  project_name, DIR, OUT = parse_config("bin/config.ini") 
     163 
    190164  (file_param, file_utheo, file_data) = \ 
    191165      get_input_files(DIR["SAVEDATA"], 
     
    204178  # .. Get project info .. 
    205179  # ====================== 
    206   gencmip6 = Project() 
    207   gencmip6.fill_data(file_param) 
    208   gencmip6.get_date_init(file_utheo) 
     180  projet = Project() 
     181  projet.fill_data(file_param) 
     182  projet.get_date_init(file_utheo) 
    209183 
    210184  # .. Fill in data dict .. 
     
    249223  # -------------------- 
    250224  title = "Consommation {} par login\n{:%d/%m/%Y}".format( 
    251     gencmip6.project.upper(), 
     225    projet.project.upper(), 
    252226    date 
    253227  ) 
     
    260234                         "{}_{}.pdf".format(img_name, today)) 
    261235 
    262   plot_save(img_in, img_out, title) 
     236  plot_save(img_in, img_out, title, DIR) 
    263237 
    264238  # ... Publish figure on dods ... 
    265239  # ------------------------------ 
    266240  if args.dods: 
    267     dods_cp(img_in) 
     241    dods_cp(img_in, DIR) 
    268242 
    269243  if args.show: 
  • TOOLS/ConsoGENCMIP6/bin/plot_store.py

    r2437 r2460  
    1414 
    1515# Application library imports 
    16 from gencmip6 import * 
    17 from gencmip6_path import * 
     16from libconso import * 
    1817 
    1918 
     
    213212  # ... Files and directories ... 
    214213  # ----------------------------- 
     214  project_name, DIR, OUT = parse_config("bin/config.ini") 
     215 
    215216  (file_param, file_utheo, file_data) = \ 
    216217      get_input_files(DIR["SAVEDATA"], 
     
    229230  # .. Get project info .. 
    230231  # ====================== 
    231   gencmip6 = Project() 
    232   gencmip6.fill_data(file_param) 
    233   gencmip6.get_date_init(file_utheo) 
     232  projet = Project() 
     233  projet.fill_data(file_param) 
     234  projet.get_date_init(file_utheo) 
    234235 
    235236  # .. Fill in data dict .. 
     
    282283  # -------------------- 
    283284  title = "Occupation {} de STORE par login\n{:%d/%m/%Y}".format( 
    284     gencmip6.project.upper(), 
     285    projet.project.upper(), 
    285286    date 
    286287  ) 
     
    294295                         "{}_{}.pdf".format(img_name, today)) 
    295296 
    296   plot_save(img_in, img_out, title) 
     297  plot_save(img_in, img_out, title, DIR) 
    297298 
    298299  # ... Publish figure on dods ... 
    299300  # ------------------------------ 
    300301  if args.dods: 
    301     dods_cp(img_in) 
     302    dods_cp(img_in, DIR) 
    302303 
    303304  if args.show: 
  • TOOLS/ConsoGENCMIP6/launch_conso.sh

    r2444 r2460  
    1111  . /etc/bashrc 
    1212fi 
     13 
    1314# Load python 
    1415# =========== 
     
    1920# Go to root directory 
    2021# ==================== 
    21 cd ${HOME}/ConsoGENCMIP6/ 
     22ROOT_DIR=$( dirname $0 ) 
     23cd ${ROOT_DIR} 
    2224 
    2325# Main script to get data 
     
    3941# -f : plot the whole period of the project 
    4042# -d : copy plot on dods 
     43# -v : verbose mode 
    4144script="plot_bilan" 
    4245printf "\n${script}\n" 
     
    5356printf "\n${script}\n" 
    5457echo "--------------------" 
    55 bin/${script}.py -fd 
     58bin/${script}.py -fv 
    5659rc=$? 
    5760if [ ${rc} -ne 0 ] ; then 
  • TOOLS/ConsoGENCMIP6/launch_jobs.sh

    r2437 r2460  
    4040printf "\n${script}\n" 
    4141echo "--------------------" 
    42 bin/${script}.py -d 
     42bin/${script}.py -v 
    4343rc=$? 
    4444if [ ${rc} -ne 0 ] ; then 
Note: See TracChangeset for help on using the changeset viewer.