Commit 09455578 authored by Tyson Littenberg's avatar Tyson Littenberg

Merge branch 'post_after_checkpoint' into 'master'

explicitly flush file buffers when checkpointing

See merge request !64
parents b2d86844 3fb049a5
Pipeline #47501 passed with stages
in 2 minutes and 8 seconds
......@@ -698,6 +698,14 @@ static void save_sampler(struct Data *data, struct Chain *chain, struct Model **
FILE *fptr = NULL;
/****************************************************/
/* */
/* FLUSH CHAIN FILES */
/* */
/****************************************************/
flush_chain_files(data,chain,0);
/****************************************************/
/* */
/* STATE VECTOR */
......@@ -1143,7 +1151,8 @@ void RJMCMC(struct Data *data, struct Model **model, struct BayesLineParams ***b
//After so many iterations recompute the residuals and likelihood (prevent accumulation of roundoff error)
recompute_residual(data, model, chain);
if(burnFlag==0 && chain->mc%1000==0 && data->signalFlag) TFprop_signal(data, prior->range, tf, model[chain->index[0]]->projection);
if(burnFlag==0 && data->signalFlag)
TFprop_signal(data, prior->range, tf, model[chain->index[0]]->projection);
//Parallel tempering
if(NC>1 && chain->mc>1)
......
......@@ -1136,7 +1136,7 @@ void TFprop_setup(struct Data *data, struct Model *model, double **range, struct
for(n=0; n<nbin; n++)
{
ii = nbin*i + ioff + n;
tsnr += (AC[ii]*AC[ii]+AF[ii]*AF[ii])/(fsnr);
if(ii>=0 && ii<tf->N) tsnr += (AC[ii]*AC[ii]+AF[ii]*AF[ii])/(fsnr);
}
tfsnr[m][j][i] = tsnr;
......@@ -1340,7 +1340,7 @@ void TFprop_signal(struct Data *data, double **range, struct TimeFrequencyMap *t
for(i = 0; i < nt; i++)
{
ii = i - ioff;
if(ii < 0 || ii > nt)
if(ii < 0 || ii >= nt)
{
tsnr = tfsnr[0][m][j][i]; // leave out second detector if mapped out of time window (small edge effect)
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment