def _run_one(simu_id, result_path, paramtree, measuretree, verbose): """ This function need to be outisde Launcher class to allow multiprocessing module to work """ queue = _run_one.q queue.put({"id": simu_id, "state": "start"}) meta = Metaphase(verbose=False, paramtree=paramtree, measuretree=measuretree, reduce_p=True) meta.simul() meta.evaluate() # Build filename simu_path = os.path.join(result_path, "simu_%06d.zip" % simu_id) # Write simulation result io = SimuIO(meta) io.save(simufname=simu_path, verbose=False) queue.put({"id" : simu_id, "state" : "stop" }) del meta del io gc.collect() return True