99import uuid
1010import logging
1111import socket
12+ import time
1213from multiprocessing import Queue , Process , set_start_method
1314from .configobj import ConfigObj
1415from . import ipsLogging
@@ -40,7 +41,8 @@ class SimulationData:
4041 entry in the configurationManager class
4142 """
4243
43- def __init__ (self , sim_name ):
44+ def __init__ (self , sim_name , start_time = time .time ()):
45+ self .start_time = start_time
4446 self .sim_name = sim_name
4547 self .portal_sim_name = None
4648 self .sim_root = None
@@ -281,7 +283,7 @@ def initialize(self, data_mgr, resource_mgr, task_mgr):
281283 sim_name_list .append (sim_name )
282284 sim_root_list .append (sim_root )
283285 log_file_list .append (log_file )
284- new_sim = self .SimulationData (sim_name )
286+ new_sim = self .SimulationData (sim_name , self . fwk . start_time )
285287 conf ['__PORTAL_SIM_NAME' ] = sim_name
286288 new_sim .sim_conf = conf
287289 new_sim .config_file = conf_file
@@ -301,7 +303,7 @@ def initialize(self, data_mgr, resource_mgr, task_mgr):
301303 if not self .fwk_sim_name :
302304 fwk_sim_conf = conf .dict ()
303305 fwk_sim_conf ['SIM_NAME' ] = '_' .join ([conf ['SIM_NAME' ], 'FWK' ])
304- fwk_sim = self .SimulationData (fwk_sim_conf ['SIM_NAME' ])
306+ fwk_sim = self .SimulationData (fwk_sim_conf ['SIM_NAME' ], self . fwk . start_time )
305307 fwk_sim .sim_conf = fwk_sim_conf
306308 fwk_sim .sim_root = new_sim .sim_root
307309 fwk_sim .log_file = self .fwk .log_file # sys.stdout
@@ -502,7 +504,6 @@ def _create_component(self, comp_conf, sim_data):
502504
503505 # SIMYAN: removed else conditional, copying files in runspaceInit
504506 # component now
505-
506507 svc_response_q = Queue (0 )
507508 invocation_q = Queue (0 )
508509 component_id = ComponentID (class_name , sim_name )
@@ -512,7 +513,7 @@ def _create_component(self, comp_conf, sim_data):
512513 services_proxy = ServicesProxy (self .fwk , fwk_inq , svc_response_q ,
513514 sim_data .sim_conf , log_pipe_name )
514515 new_component = component_class (services_proxy , comp_conf )
515- new_component .__initialize__ (component_id , invocation_q , self . fwk .start_time )
516+ new_component .__initialize__ (component_id , invocation_q , sim_data .start_time )
516517 services_proxy .__initialize__ (new_component )
517518 self .comp_registry .addEntry (component_id , svc_response_q ,
518519 invocation_q , new_component ,
@@ -643,7 +644,7 @@ def create_simulation(self, sim_name, config_file, override, sub_workflow=False)
643644 self .sim_name_list .append (sim_name )
644645 self .sim_root_list .append (sim_root )
645646 self .log_file_list .append (log_file )
646- new_sim = self .SimulationData (sim_name )
647+ new_sim = self .SimulationData (sim_name , start_time = self . fwk . start_time if sub_workflow else time . time () )
647648 new_sim .sim_conf = conf
648649 new_sim .config_file = config_file
649650 new_sim .sim_root = sim_root
0 commit comments