polychord.cpp
Go to the documentation of this file.
61 // An error is thrown if any of the following entries are not present in the inifile (none absolutely required for PolyChord). 64 // Tell cmake system to search known paths for these libraries; any not found must be specified in config/scanner_locations.yaml. 75 if (LogLike->getRank() == 0) std::cout << "Loading PolyChord nested sampling plugin for ScannerBit." << std::endl; 100 // Retrieve whether the scanned parameters should be added to the native output and determine nderived 113 std::vector<std::string> fast_params = get_inifile_value<std::vector<std::string>>("fast_params", {}); 118 // Compute the set difference between fast_params and all_params to check if there are any fast_params not included in all_params 119 std::set<std::string> set_fast_params(fast_params.begin(), fast_params.end()), set_params(all_params.begin(), all_params.end()), diff; 120 std::set_difference(set_fast_params.begin(), set_fast_params.end(), set_params.begin(), set_params.end(),std::inserter(diff,diff.begin())); 163 settings.num_repeats = get_inifile_value<int>("num_repeats", nslow*2); // length of slice sampling chain 164 settings.nprior = get_inifile_value<int>("nprior", settings.nlive*10); // number of prior samples to begin algorithm with 165 settings.do_clustering = get_inifile_value<bool>("do_clustering", true); // Whether or not to perform clustering 167 settings.precision_criterion = get_inifile_value<double>("tol", 0.5); // Stopping criterion (consistent with multinest) 169 settings.max_ndead = get_inifile_value<double>("maxiter", -1); // Max no. of iterations, a negative value means infinity (different in comparison with multinest). 170 settings.maximise = get_inifile_value<bool>("maximise", false); // Whether to run a maximisation algorithm once the run is finished 183 settings.compression_factor = get_inifile_value<double>("compression_factor",0.36787944117144233); 204 scan_error().raise(LOCAL_INFO,"Error from PolyChord ScannerBit plugin! Resume mode is activated, however " 219 // Options to desynchronise print streams from the main Gambit iterations. This allows for random access writing, or writing of global scan data. 235 run_polychord(Gambit::PolyChord::callback_loglike, Gambit::PolyChord::callback_dumper, settings); 373 scan_err <<"Error! ScannerBit PolyChord plugin attempted to run 'dumper' function on a worker process " 375 <<"process. Most likely this means that your PolyChord installation is not running in MPI mode " 420 // Reset the print streams. WARNING! This potentially deletes the old data (here we overwrite it on purpose) 448 live_stream->print( true, "LastLive", myrank, pointID); // Flag which points were the last live set
LogLikeWrapper * global_loglike_object Global pointer to loglikelihood wrapper object, for use in the PolyChord callback functions... Definition: polychord.cpp:47 void dumper(int, int, int, double *, double *, double *, double, double) Main interface to PolyChord dumper routine. Definition: polychord.cpp:366 printer_interface & boundPrinter Reference to a printer_interface object. Definition: polychord.hpp:98 Printers::BasePrinterManager printer_interface typedef printer_interface_temp printer_interface; Definition: printer_interface.hpp:31 double callback_loglike(double *, int, double *, int) C-functions to pass to PolyChord for the callbacks. Definition: polychord.cpp:255 void callback_dumper(int, int, int, double *, double *, double *, double, double) Definition: polychord.cpp:263 scanPtr boundLogLike Scanner pointer (points to the ScannerBit provided log-likelihood function) Definition: polychord.hpp:95 std::unordered_map< std::string, int > index_map Definition: polychord.hpp:114 Declarations for the YAML options class. General small utility functions. Class to connect PolyChord log-likelihood function and ScannerBit likelihood function. Definition: polychord.hpp:91 std::unordered_map< std::string, double > transform(const std::vector< double > &vec) Definition: factory_defs.hpp:323 #define reqd_inifile_entries(...) Tells ScannerBit that these tags are required. Definition: plugin_macros.hpp:55 #define scan_err Defined to macros to output errors in the form: scan_err << "error" << scan_end; scan_warn << "warnin... Definition: scanner_utils.hpp:54 #define plugin_main(...) Declaration of the main function which will be ran by the interface. Definition: plugin_macros.hpp:43 double LogLike(double *, int, double *, int) Main interface function from PolyChord to ScannerBit-supplied loglikelihood function. Definition: polychord.cpp:291 ScannerBit interface to PolyChord 1.17.1. virtual void reset(bool force=false)=0 Function to signal to the printer to write buffer contents to disk. void run_polychord(double(*loglikelihood)(double *, int, double *, int), void(*dumper)(int, int, int, double *, double *, double *, double, double), Settings) int printer_speed_threshold Disable printing for speeds greater and equal than Speeds start at 0 A value of -1 means that all eva... Definition: polychord.hpp:122 EXPORT_SYMBOLS const str & ensure_path_exists(const str &) Ensure that a path exists (and then return the path, for chaining purposes) Definition: util_functions.cpp:227 Gambit::Scanner::like_ptr scanPtr Typedef for the ScannerBit pointer to the external loglikelihood function. Definition: polychord.hpp:84 Definition: polychord.hpp:34 #define reqd_libraries(...) Tells ScannerBit that these libraries are requested. Definition: plugin_macros.hpp:57 scanner_plugin(polychord, version(1, 17, 1)) ================================================= Interface to ScannerBit Definition: polychord.cpp:59 declaration for scanner module void setValue(const KEYTYPE &key, const VALTYPE &val) Basic setter, for adding extra options. Definition: yaml_options.hpp:135 |