MARQOVScheduler

Marqov provides a multithreading scheduler with optional support for MPI.

template<class Sim>
class MARQOV::CXX11Scheduler

The Marqov internal scheduler.

It encapsulates the creation of simulations, the parallel tempering and the distribution across nodes/cores.

Template Parameters
  • Sim: a fully specified Marqov type

Public Functions

template<typename ParamType, typename Callable = decltype(defaultfilter)>
void createSimfromParameter(ParamType &p, Callable filter = defaultfilter)

Create a full simulation from a parameter.

This gives us the parameters of a simulation and we are responsible for setting everything up. It has a template parameter, but of course all used parameters have to resolve to the same underlying MarqovType.

Parameters
  • p: The full set of parameters that are relevant for your problem.

  • filter: A filter that can be applied before the actual creation of MARQOV.

void enqueuesim(Sim &sim, bool warmup = true)

This registers an already allocated simulation with us.

DEPRECATED: Untested code path as of now.

Parameters
  • sim: A reference to the sim that already exists.

  • warmup: a boolean to select whether we require warmup.

void setloglevel(int l)

Set the log verbosity.

Parameters
  • l: the loglevel.

void start()

Start the simulations! GoGoGo…!

CXX11Scheduler(int maxptsteps = 1, uint nthreads = 0, int mid = 0)

Construct Scheduler.

Parameters
  • maxptsteps: How many parallel tempering steps do we do. Defaults to just a single PTstep and hence disables it.

  • nthreads: how many threads should be used. If not specified defaults to what is reported by the OS.

  • id: An integer id. This is used by MPI to pass down the rank.

~CXX11Scheduler()

Tidy up scheduler.

This frees all resources and waits until all threads have finished.

CXX11Scheduler(CXX11Scheduler &&rhs)

Move Constructor.

The other object over whose resources we take ownership. Mutexes are a bit odd here. We don’t reuse the other mutexes but use and create our own.

Parameters
  • rhs: the other object.

If MARQOV is compiled with support for MPI the MPI scheduler is utilized.

template<class Sim>
class MARQOV::MPIScheduler

Public Functions

template<typename ParamType, typename Callable = decltype(defaultfilter)>
void createSimfromParameter(ParamType &p, Callable filter = defaultfilter)

This gives us the parameters of a simulation and we are responsible for setting everything up.

It has a template parameter, but of course all used parameters have to resolve to the same underlying MarqovType. FIXME: It is expected that all MPI ranks execute the same code until here!!! That makes it easier to have valid data on every node…

Parameters
  • p: The full set of parameters that are relevant for your Problem

  • filter: A filter that can be applied before the actual creation of MARQOV

void start()

Start execution on all nodes.

MPIScheduler(int maxptsteps = 1, uint nthreads = 0)

Construct MPI Scheduler.

We expect MPI to be initialized beforehand. The user should feel that he is writing MPI code.

Parameters
  • maxptsteps: How many parallel tempering steps do we do

  • nthreads: how many threads should be used. If not specified defaults to what is reported by the OS.

MPIScheduler(MPIScheduler &&rhs)

Move Copy Constructor.

The other object over whose resources we take ownership.

Parameters
  • rhs: the other object