8#ifndef IMPMPI_REPLICA_EXCHANGE_H
9#define IMPMPI_REPLICA_EXCHANGE_H
11#include <IMP/mpi/mpi_config.h>
15#include <cereal/access.hpp>
16#include <cereal/types/base_class.hpp>
19#ifndef MPICH_SKIP_MPICXX
20#define MPICH_SKIP_MPICXX
22#ifndef OMPI_SKIP_MPICXX
23#define OMPI_SKIP_MPICXX
36class IMPMPIEXPORT ReplicaExchange :
public Object {
46 std::map<std::string, Floats> parameters_;
48 friend class cereal::access;
50 template<
class Archive>
void serialize(Archive &ar) {
51 ar(cereal::base_class<Object>(
this), myrank_, nproc_, index_, exarray_,
57 Ints create_indexes();
60 Ints create_exarray();
62 bool get_acceptance(
double myscore,
double fscore);
64 int get_rank(
int index);
79 bool do_exchange(
double myscore0,
double myscore1,
int findex);
A shared base class to help in debugging and things.
Object(std::string name)
Construct an object with the given name.
Floats create_temperatures(double tmin, double tmax, int nrep)
Initialize array of temperatures.
int get_number_of_replicas() const
Get number of replicas.
int get_my_index() const
Get replica index.
bool do_exchange(double myscore0, double myscore1, int findex)
Try an exchange.
Floats get_friend_parameter(std::string key, int findex)
Get the value of my friend's parameter.
void set_my_parameter(std::string key, Floats values)
Set exchange parameter.
Floats get_my_parameter(std::string key)
Get the value of my exchange parameter.
int get_friend_index(int istep)
Get the index of friend with which trying an exchange.
Ints get_exchange_array()
Get the array with exchange acceptance.
Include all non-deprecated headers in IMP.mpi.
IMP::Vector< Int > Ints
Standard way to pass a bunch of Int values.
IMP::Vector< Float > Floats
Standard way to pass a bunch of Float values.
#define IMP_OBJECT_METHODS(Name)
Define the basic things needed by any Object.