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

refac: restructuration

parent 872fa5d1
Branches
Tags
No related merge requests found
{ {
"description": "Prototype for session-annotated Batsim JSON (SABjson) format. See diagram https://app.diagrams.net/#G1tbo7oHahsgxTmhICucCGam5XNtshOUOb.", "description": "Prototype for session-annotated Batsim JSON (SABjson) format. See diagram https://app.diagrams.net/#G1tbo7oHahsgxTmhICucCGam5XNtshOUOb",
"command": "command used to generate the file. We can suppose that it's generated with arrival delimitation approach and threshold = 60mn = 3600s.", "command": "command used to generate the file. We can suppose that it's generated with arrival delimitation approach and threshold = 60mn = 3600s.",
"date": "data of generation of the file", "date": "data of generation of the file",
"nb_res": 4, "nb_res": 4,
......
...@@ -8,7 +8,7 @@ import json ...@@ -8,7 +8,7 @@ import json
import re import re
import networkx as nx import networkx as nx
from workload import SwfField from src.workload import SwfField
# Global dictionnary # Global dictionnary
users = {} users = {}
......
...@@ -9,7 +9,7 @@ import json ...@@ -9,7 +9,7 @@ import json
import re import re
from copy import deepcopy from copy import deepcopy
from workload import SwfField from src.workload import SwfField
# Global dictionnary # Global dictionnary
users = {} users = {}
......
File moved
...@@ -33,12 +33,12 @@ class Job: ...@@ -33,12 +33,12 @@ class Job:
"""Class representing a job in the workload.""" """Class representing a job in the workload."""
def __init__(self, def __init__(self,
job_id, job_id:int,
submit_time, submit_time:float,
finish_time, finish_time:float,
start_time=None, start_time:float=None,
nb_requested_resources=None, nb_requested_resources:int=None,
walltime=None): walltime:float=None):
self.id = job_id self.id = job_id
self.submit_time = submit_time self.submit_time = submit_time
self.start_time = start_time self.start_time = start_time
......
#!/usr/bin/env python3 #!/usr/bin/env python3
import argparse, json, re, os, sys import argparse, json, re, os, sys
from user_session_builder import User from src.user_session_builder import User
from workload import SwfField, Job from src.workload import SwfField, Job
def swf2sessions(input_swf, output_dir, delim_approach, delim_threshold, def swf2sessions(input_swf, output_dir, delim_approach, delim_threshold,
...@@ -29,7 +29,7 @@ def swf2sessions(input_swf, output_dir, delim_approach, delim_threshold, ...@@ -29,7 +29,7 @@ def swf2sessions(input_swf, output_dir, delim_approach, delim_threshold,
res = r.match(line) res = r.match(line)
if res: if res:
# Retreive values # Retreive values
job_id = str(res.group((SwfField.JOB_ID.value))) job_id = int(res.group((SwfField.JOB_ID.value)))
submit_time = max(0, float(res.group(SwfField.SUBMIT_TIME.value))) submit_time = max(0, float(res.group(SwfField.SUBMIT_TIME.value)))
wait_time = float(res.group(SwfField.WAIT_TIME.value)) wait_time = float(res.group(SwfField.WAIT_TIME.value))
run_time = float(res.group(SwfField.RUN_TIME.value)) run_time = float(res.group(SwfField.RUN_TIME.value))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment