Worker Module

libEnsemble worker class

worker.worker_main(comm, sim_specs, gen_specs, libE_specs, workerID=None, log_comm=True)

Evaluates calculations given to it by the manager.

Creates a worker object, receives work from manager, runs worker, and communicates results. This routine also creates and writes to the workers summary file.

Parameters
  • comm (communicator) – Comm object for manager communications

  • sim_specs (dict) – Parameters/information for simulation calculations

  • gen_specs (dict) – Parameters/information for generation calculations

  • libE_specs (dict) – Parameters/information for libE operations

  • workerID (int) – Manager assigned worker ID (if None, default is comm.rank)

  • log_comm (boolean) – Whether to send logging over comm

class worker.Worker(comm, dtypes, workerID, sim_specs, gen_specs, libE_specs)

The worker class provides methods for controlling sim and gen funcs

Object Attributes:

These are public object attributes.

Variables
  • communicator (comm) – Comm object for manager communications

  • dtypes (dict) – Dictionary containing type information for sim and gen inputs

  • workerID (int) – The libensemble Worker ID

  • sim_specs (dict) – Parameters/information for simulation calculations

  • calc_iter (dict) – Dictionary containing counts for each type of calc (e.g. sim or gen)

__init__(comm, dtypes, workerID, sim_specs, gen_specs, libE_specs)

Initializes new worker object

run()

Runs the main worker loop.