Changeset 2849


Ignore:
Timestamp:
05/12/16 16:43:10 (8 years ago)
Author:
labetoulle
Message:

[gencmip6] running/pending jobs:

  • Gather data for whole Curie in addition to that from gencmip6 project
  • Plot hourly data and daily mean
Location:
TOOLS/ConsoGENCMIP6
Files:
2 added
5 edited

Legend:

Unmodified
Added
Removed
  • TOOLS/ConsoGENCMIP6/bin/plot_bilan.py

    r2717 r2849  
    4646        skip_header=1, 
    4747        converters={ 
    48           0: string_to_date, 
    49           1: string_to_float, 
    50           2: string_to_percent, 
    51           3: string_to_percent, 
    52           4: string_to_float, 
    53           5: string_to_float, 
    54           6: string_to_float, 
    55           7: string_to_float, 
     48          0:  string_to_date, 
     49          1:  string_to_float, 
     50          2:  string_to_percent, 
     51          3:  string_to_percent, 
     52          4:  string_to_float, 
     53          5:  string_to_float, 
     54          6:  string_to_float, 
     55          7:  string_to_float, 
     56          8:  string_to_float, 
     57          9:  string_to_float, 
     58          10: string_to_float, 
     59          11: string_to_float, 
    5660        }, 
    5761        missing_values="nan", 
     
    6266 
    6367    for date, conso, real_use, theo_use, \ 
    64         run_mean, pen_mean, run_std, pen_std in data: 
     68        run_mean, pen_mean, run_std, pen_std, \ 
     69        _, _, _, _ in data: 
    6570      if date in self: 
    6671        self.add_item( 
  • TOOLS/ConsoGENCMIP6/bin/plot_bilan_jobs.py

    r2717 r2849  
    4646        skip_header=1, 
    4747        converters={ 
    48           0: string_to_date, 
    49           1: string_to_float, 
    50           2: string_to_percent, 
    51           3: string_to_percent, 
    52           4: string_to_float, 
    53           5: string_to_float, 
    54           6: string_to_float, 
    55           7: string_to_float, 
     48          0:  string_to_date, 
     49          1:  string_to_float, 
     50          2:  string_to_percent, 
     51          3:  string_to_percent, 
     52          4:  string_to_float, 
     53          5:  string_to_float, 
     54          6:  string_to_float, 
     55          7:  string_to_float, 
     56          8:  string_to_float, 
     57          9:  string_to_float, 
     58          10: string_to_float, 
     59          11: string_to_float, 
    5660        }, 
    5761        missing_values="nan", 
     
    6266 
    6367    for date, conso, real_use, theo_use, \ 
    64         run_mean, pen_mean, run_std, pen_std in data: 
     68        run_mean, pen_mean, run_std, pen_std, \ 
     69        _, _, _, _ in data: 
    6570      if date in self: 
    6671        self.add_item( 
  • TOOLS/ConsoGENCMIP6/bin/plot_jobs.py

    r2717 r2849  
    196196    label="jobs running" 
    197197  ) 
     198  if args.mode == "machine": 
     199    label = "jobs pending\n(Ressources & Priority)" 
     200  else: 
     201    label = "jobs pending" 
    198202  ax.bar( 
    199203    xcoord, pen_jobs, bottom=run_jobs, width=width, 
    200204    linewidth=line_width, align="center", 
    201205    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   # ) 
     206    label=label 
     207  ) 
    212208 
    213209 
     
    223219  # ---------------------------- 
    224220  multialloc = False 
    225   if conso_per_day_2: 
    226     date_inter = projet.date_init + dt.timedelta(days=projet.days//2) 
    227     if projet.date_init in dates: 
    228       xi = dates.index(projet.date_init) 
    229     else: 
    230       xi = 0 
    231  
    232     if projet.deadline in dates: 
    233       xf = dates.index(projet.deadline) 
    234     else: 
    235       xf = len(dates) 
    236  
    237     if date_inter in dates: 
    238       xn = dates.index(date_inter) 
    239       yi = conso_per_day 
    240       yf = conso_per_day_2 
    241       multialloc = True 
    242     else: 
    243       if dates[-1] < date_inter: 
    244         xn = xf 
     221 
     222  if args.mode == "machine": 
     223    xi = 0 
     224    xn = xi 
     225    xf = len(dates) 
     226    yi = 80000. 
     227    yf = yi 
     228  else: 
     229    if conso_per_day_2: 
     230      date_inter = projet.date_init + dt.timedelta(days=projet.days//2) 
     231      if projet.date_init in dates: 
     232        xi = dates.index(projet.date_init) 
     233      else: 
     234        xi = 0 
     235 
     236      if projet.deadline in dates: 
     237        xf = dates.index(projet.deadline) 
     238      else: 
     239        xf = len(dates) 
     240 
     241      if date_inter in dates: 
     242        xn = dates.index(date_inter) 
    245243        yi = conso_per_day 
    246         yf = conso_per_day 
    247       elif dates[0] > date_inter: 
    248         xn = xi 
    249         yi = conso_per_day_2 
    250244        yf = conso_per_day_2 
     245        multialloc = True 
     246      else: 
     247        if dates[-1] < date_inter: 
     248          xn = xf 
     249          yi = conso_per_day 
     250          yf = conso_per_day 
     251        elif dates[0] > date_inter: 
     252          xn = xi 
     253          yi = conso_per_day_2 
     254          yf = conso_per_day_2 
    251255 
    252256  # ... Config axes ... 
     
    294298 
    295299  yticks = list(ax.get_yticks()) 
    296   yticks.append(conso_per_day) 
    297   if multialloc: 
    298     yticks.append(conso_per_day_2) 
     300  if args.mode == "machine": 
     301    yticks.append(yi) 
     302  else: 
     303    yticks.append(conso_per_day) 
     304    if multialloc: 
     305      yticks.append(conso_per_day_2) 
    299306  ax.set_yticks(yticks) 
    300  
    301307 
    302308  for x, d in zip(xcoord, dates): 
     
    339345  parser.add_argument("-d", "--dods", action="store_true", 
    340346                      help="copy output on dods") 
     347  parser.add_argument("-m", "--mode", action="store", 
     348                      choices=["project", "machine"], 
     349                      default="project", 
     350                      help="copy output on dods") 
    341351 
    342352  return parser.parse_args() 
     
    375385      get_input_files(DIR["SAVEDATA"], [OUT["PARAM"], OUT["UTHEO"]]) 
    376386 
    377   file_list = glob.glob(os.path.join(DIR["SAVEDATA"], 
    378                                      "OUT_JOBS_PENDING_*")) 
    379  
    380   img_name = "jobs" 
     387  if args.mode == "project": 
     388    pattern = "OUT_JOBS_PENDING_" 
     389  else: 
     390    pattern = "OUT_JOBS_PEN_FULL_" 
     391  file_list = glob.glob( 
     392    os.path.join(DIR["SAVEDATA"], pattern + "*") 
     393  ) 
     394 
     395  img_name = "jobs_{}".format(args.mode) 
    381396 
    382397  today   = dt.datetime.today() 
  • TOOLS/ConsoGENCMIP6/launch_conso.sh

    r2845 r2849  
    6464fi 
    6565 
     66script="plot_jobs_daily" 
     67printf "\n${script}\n" 
     68echo "--------------------" 
     69bin/${script}.py -fv 
     70rc=$? 
     71if [ ${rc} -ne 0 ] ; then 
     72  echo "${script} terminated abnormally" 
     73else 
     74  echo "${script} OK" 
     75fi 
     76 
    6677script="plot_login" 
    6778printf "\n${script}\n" 
     
    109120rsync -var ${ROOT_DIR}/web/* igcmg@ciclad.ipsl.jussieu.fr:dods/ConsoGENCMIP6 
    110121 
     122 
    111123printf "\nEnd of script OK\n" 
    112124 
  • TOOLS/ConsoGENCMIP6/launch_jobs.sh

    r2845 r2849  
    2121cd ${ROOT_DIR} 
    2222 
    23 # Main script to get data 
    24 # ======================= 
     23# Main script to get data for gencmip6 
     24# ==================================== 
    2525script="run_pen_v2" 
     26printf "${script}\n" 
     27echo "--------------------" 
     28bin/${script}.sh 
     29rc=$? 
     30if [ ${rc} -ne 0 ] ; then 
     31  echo "${script} terminated abnormally" 
     32  exit 
     33else 
     34  echo "${script} OK" 
     35fi 
     36 
     37# Main script to get data for whole Curie 
     38# ======================================= 
     39script="run_pen_full" 
    2640printf "${script}\n" 
    2741echo "--------------------" 
     
    3852# ============================= 
    3953# -d : copy plot on dods 
     54# -m : mode, 'project' (=default) or 'machine' 
    4055script="plot_jobs" 
    4156printf "\n${script}\n" 
    4257echo "--------------------" 
    4358bin/${script}.py -v 
     59rc=$? 
     60if [ ${rc} -ne 0 ] ; then 
     61  echo "${script} terminated abnormally" 
     62else 
     63  echo "${script} OK" 
     64fi 
     65 
     66printf "\n${script}\n" 
     67echo "--------------------" 
     68bin/${script}.py -vm machine 
     69rc=$? 
     70if [ ${rc} -ne 0 ] ; then 
     71  echo "${script} terminated abnormally" 
     72else 
     73  echo "${script} OK" 
     74fi 
     75 
     76script="plot_jobs_hourly" 
     77printf "\n${script}\n" 
     78echo "--------------------" 
     79bin/${script}.py -vd 
    4480rc=$? 
    4581if [ ${rc} -ne 0 ] ; then 
Note: See TracChangeset for help on using the changeset viewer.