NcmMPIJobMCMC

NcmMPIJobMCMC — MPI job object for running MCMC steps

Functions

Properties

NcmFit * fit Read / Write / Construct Only
NcmObjArray * function-array Read / Write / Construct Only

Types and Values

Object Hierarchy

    GObject
    ╰── NcmMPIJob
        ╰── NcmMPIJobMCMC

Description

This object is a subclass of NcmMPIJob, designed to implement an MPI job for evaluating the posterior at the proposal points during an MCMC run. It is utilized by NcmFitESMCMC to parallelize the evaluation of the posterior function. The job involves computing the posterior function and, if applicable, additional functions (e.g., derived quantities) at a specified point within the parameter space. Notably, the slave also receives the current point and the current value for the acceptance probability. Consequently, it decides whether to accept or reject the proposal point and only computes the additional functions if the proposal point is accepted.

The MPI job is implemented as a function that takes a vector consisting of the set parameters, the current value of the posterior function, the acceptance probability, and the jump probability as input. The function returns a vector with the first element being 1.0 if the proposal point is accepted and 0.0 otherwise. The next value is the value of the posterior function at the proposal point. The remaining values are the values of the additional functions at the proposal point.

Functions

ncm_mpi_job_mcmc_new ()

NcmMPIJobMCMC *
ncm_mpi_job_mcmc_new (NcmFit *fit,
                      NcmObjArray *func_oa);

Creates a new NcmMPIJobMCMC object.

Parameters

fit

a NcmFit

 

func_oa

a NcmObjArray.

[nullable]

Returns

a new NcmMPIJobMCMC.


ncm_mpi_job_mcmc_ref ()

NcmMPIJobMCMC *
ncm_mpi_job_mcmc_ref (NcmMPIJobMCMC *mjmcmc);

Increase the reference of mjmcmc by one.

Parameters

mjmcmc

a NcmMPIJobMCMC

 

Returns

mjmcmc .

[transfer full]


ncm_mpi_job_mcmc_free ()

void
ncm_mpi_job_mcmc_free (NcmMPIJobMCMC *mjmcmc);

Decrease the reference count of mjmcmc by one.

Parameters

mjmcmc

a NcmMPIJobMCMC

 

ncm_mpi_job_mcmc_clear ()

void
ncm_mpi_job_mcmc_clear (NcmMPIJobMCMC **mjmcmc);

Decrease the reference count of mjmcmc by one, and sets the pointer *mjmcmc to NULL.

Parameters

mjmcmc

a NcmMPIJobMCMC

 

Types and Values

NCM_TYPE_MPI_JOB_MCMC

#define NCM_TYPE_MPI_JOB_MCMC (ncm_mpi_job_mcmc_get_type ())

NcmMPIJobMCMC

typedef struct _NcmMPIJobMCMC NcmMPIJobMCMC;

Property Details

The “fit” property

  “fit”                      NcmFit *

Fit object.

Owner: NcmMPIJobMCMC

Flags: Read / Write / Construct Only


The “function-array” property

  “function-array”           NcmObjArray *

Functions array.

Owner: NcmMPIJobMCMC

Flags: Read / Write / Construct Only