Changeset 3132419 for fedd/federation


Ignore:
Timestamp:
Feb 15, 2010 8:51:04 AM (15 years ago)
Author:
Ted Faber <faber@…>
Branches:
axis_example, compt_changes, info-ops, master, version-3.01, version-3.02
Children:
c3a3fe3
Parents:
1899afd
Message:

Parallel starts now.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • fedd/federation/experiment_control.py

    r1899afd r3132419  
    986986        fail_soft = False
    987987
    988         slaves = [ k for k in allocated.keys() \
    989                 if k != master and not topo[k].get_attribute('transit')]
     988        non_transit = [ k for k in allocated.keys() \
     989                if not topo[k].get_attribute('transit')]
    990990        transit = [ k for k in allocated.keys() \
    991991                if topo[k].get_attribute('transit')]
     
    10521052
    10531053        if len(failed) == 0:
    1054             for tb in slaves:
     1054            for tb in non_transit:
    10551055                # Create and start a thread to start the segment, and save it
    10561056                # to get the return value later
     
    10751075                            caller=self.call_StartSegment,
    10761076                            log_collector=log_collector),
    1077                         args=(uri, aid, topo[tb], False, attrs, connInfo[tb],
    1078                             services),
     1077                        args=(uri, aid, topo[tb], tb == master,
     1078                            attrs, connInfo[tb], services),
    10791079                        name=tb,
    10801080                        pdata=thread_pool, trace_file=self.trace_file)
     
    10911091            thread_pool.clear()
    10921092
    1093         # If none failed, start the master
    10941093        failed = [ t.getName() for t in threads if not t.rv ]
    1095 
    1096         if len(failed) == 0:
    1097             uri = self.tbmap.get(master, None)
    1098             if not uri:
    1099                 raise service_error(service_error.internal,
    1100                         "Unknown testbed %s !?" % master)
    1101 
    1102             if tbparams[master].has_key('allocID') and \
    1103                     tbparams[master]['allocID'].has_key('fedid'):
    1104                 aid = tbparams[master]['allocID']['fedid']
    1105             else:
    1106                 raise service_error(service_error.internal,
    1107                     "No alloc id for testbed %s !?" % master)
    1108             t = self.pooled_thread(
    1109                     target=self.start_segment(log=log, debug=self.debug,
    1110                         testbed=master, cert_file=self.cert_file,
    1111                         cert_pwd=self.cert_pwd,
    1112                         trusted_certs=self.trusted_certs,
    1113                         caller=self.call_StartSegment,
    1114                         log_collector=log_collector),
    1115                     args =(uri, aid, topo[master], True, attrs,
    1116                         connInfo[master], services),
    1117                     name=master, pdata=thread_pool, trace_file=self.trace_file)
    1118             threads.append(t)
    1119             t.start()
    1120             # Wait until the master finishes (keep pinging the log, though)
    1121             mins = 0
    1122             while not thread_pool.wait_for_all_done(60.0):
    1123                 mins += 1
    1124                 alloc_log.info("Waiting for master (it has been %d mins)" \
    1125                         % mins)
    1126             # update failed to include the master, if it failed
    1127             failed = [ t.getName() for t in threads if not t.rv ]
    1128 
    11291094        succeeded = [tb for tb in allocated.keys() if tb not in failed]
     1095
    11301096        # If one failed clean up, unless fail_soft is set
    11311097        if failed:
Note: See TracChangeset for help on using the changeset viewer.