Exemple #1
0
 def harvest_atoms(self):
     ls_atoms = os.listdir("%s/run"%(VAR_PATH) )
     self.harvested_atoms  = len(ls_atoms)
     for i_d in ls_atoms:
         pd = ParameterAtom(i_d)
         try:
             pd.load(src = 'run')
         except:
             utils.newline_msg("WRN", "could not pickle '%s'...skipping"%i_d, 2)
             continue
         a_db =self.result_dbs[pd.full_db_name]
         pd.dump_result_in_ensemble( a_db  )
Exemple #2
0
    def seed_atoms(self, queue_name):
        self.seeded_atoms =  self.max_atoms_to_seed - len(os.listdir("%s/queue/%s"%(VAR_PATH,queue_name) ) ) 
#      utils.newline_msg("INF", "initialise_infiles - %d"%to_run_processes )
#        print "inti"
        self.update_ensemble_list()
        for i_atom in range(self.seeded_atoms):
            sel_db = self.pick_ensemble( queue_name )
#            utils.newline_msg("INF", "  >> %s/%s"%(sel_db.path,sel_db.db_name) )
        #    sel_db.next()
            
            (self.current_counter, ) = self.execute_query_fetchone("SELECT last FROM infiles WHERE id = 1")
            self.current_counter += 1
            self.execute_query("UPDATE infiles SET last = ? WHERE id = 1", self.current_counter )
#            self.db_master.commit()
            in_name = "in_%.10d"%self.current_counter
            pd = ParameterAtom(in_name, sel_db.full_name)
            ret = pd.load_next_from_ensemble( sel_db )
            if ret == None:
                continue
            pd.dump(src = "queue/%s"%queue_name)