Skip to content
Snippets Groups Projects
Commit 2ce897a2 authored by Maël Madon's avatar Maël Madon
Browse files

better management of job grain

parent c52627f1
No related merge requests found
...@@ -11,6 +11,7 @@ import re ...@@ -11,6 +11,7 @@ import re
import sys import sys
import datetime import datetime
import os import os
from math import ceil
from swf import SwfField from swf import SwfField
...@@ -80,7 +81,7 @@ def generate_workload(input_swf, output_folder, ...@@ -80,7 +81,7 @@ def generate_workload(input_swf, output_folder,
if user_id not in users: if user_id not in users:
users[user_id] = [] users[user_id] = []
profile = int(((run_time // job_grain) + 1) * job_grain) profile = int(ceil(run_time / job_grain) * job_grain)
job = (job_id, nb_res, run_time, job = (job_id, nb_res, run_time,
submit_time, profile, walltime) submit_time, profile, walltime)
...@@ -169,17 +170,18 @@ def main(): ...@@ -169,17 +170,18 @@ def main():
action="store_true", action="store_true",
help="If set, only the given walltime in the trace " help="If set, only the given walltime in the trace "
"will be used") "will be used")
parser.add_argument('-jg', '--job_grain', parser.add_argument(
type=int, default=1, '-jg', '--job_grain', type=int, default=1,
help="Selects the level of detail we want for jobs. " help="Selects the level of detail we want for job profiles. "
"This parameter is used to group jobs that have " "This parameter is used to group jobs that have close running times. "
"close running time") "For example: a job grain of 10 will round up running times to the next ten.")
parser.add_argument('-i', '--indent', type=int, default=None, parser.add_argument(
help="If set to a non-negative integer, then JSON array " '-i', '--indent', type=int, default=None,
"elements and object members will be pretty-printed " help="If set to a non-negative integer, then JSON array "
"with that indent level. An indent level of 0, or " "elements and object members will be pretty-printed "
"negative, will only insert newlines. The default " "with that indent level. An indent level of 0, or "
"value (None) selects the most compact representation.") "negative, will only insert newlines. The default "
"value (None) selects the most compact representation.")
parser.add_argument("-q", "--quiet", action="store_true") parser.add_argument("-q", "--quiet", action="store_true")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment