The Main libE Module

The libE module is the outer libEnsemble routine.

This module sets up the manager and the team of workers, configured according to the contents of the libE_specs dictionary. The manager/worker communications scheme used in libEnsemble is parsed from the comms key if present, with valid values being mpi, local (for multiprocessing), or tcp. MPI is the default; if a communicator is specified, each call to this module will initiate manager/worker communications on a duplicate of that communicator. Otherwise, a duplicate of COMM_WORLD will be used.

If an exception is encountered by the manager or workers, the history array is dumped to file, and MPI abort is called.

libE.libE(sim_specs, gen_specs, exit_criteria, persis_info=None, alloc_specs=None, libE_specs=None, H0=None)
  • sim_specs (dict) – Specifications for the simulation function (example)

  • gen_specs (dict) – Specifications for the generator function (example)

  • exit_criteria (dict) – Tell libEnsemble when to stop a run (example)

  • persis_info (dict, optional) – Persistent information to be passed between user functions (example)

  • alloc_specs (dict, optional) – Specifications for the allocation function (example)

  • libE_specs (dict, optional) – Specifications for libEnsemble (example)

  • H0 (NumPy structured array, optional) – A previous libEnsemble history to be prepended to the history in the current libEnsemble run (example)


  • H (NumPy structured array) – History array storing rows for each point. (example)

  • persis_info (dict) – Final state of persistent information (example)

  • exit_flag (int) – Flag containing final task status

    0 = No errors
    1 = Exception occured
    2 = Manager timed out and ended simulation
    3 = Current process is not in libEnsemble MPI communicator