pymatgen.apps.borg.queen module
This module defines the BorgQueen class, which manages drones to assimilate data using Python’s multiprocessing.
- class BorgQueen(drone, rootpath=None, number_of_drones=1)[source]
Bases:
object
The Borg Queen controls the drones to assimilate data in an entire directory tree. Uses multiprocessing to speed up things considerably. It also contains convenience methods to save and load data between sessions.
- Parameters:
drone (Drone) – An implementation of
pymatgen.apps.borg.hive.AbstractDrone
to use for assimilation.rootpath (str) – The root directory to start assimilation. Leave it as None if you want to do assimilation later, or is using the BorgQueen to load previously assimilated data.
ndrones (int) – Number of drones to parallelize over. Typical machines today have up to four processors. Note that you won’t see a 100% improvement with two drones over one, but you will definitely see a significant speedup of at least 50% or so. If you are running this over a server with far more processors, the speedup will be even greater.