Skip to content

Commit

Permalink
Defined Global_numTask and Global_myRank
Browse files Browse the repository at this point in the history
  • Loading branch information
stephaneguindon committed Jul 14, 2020
1 parent ac88949 commit 2ae8fb0
Show file tree
Hide file tree
Showing 7 changed files with 191 additions and 63 deletions.
225 changes: 173 additions & 52 deletions src/mcmc.c

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions src/mpi_boot.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ the GNU public licence. See http://www.opensource.org for details.

#include "mpi_boot.h"

int Global_numTask;
int Global_myRank;


/* #ifdef MPI */

/*********************************************************/
Expand Down
4 changes: 2 additions & 2 deletions src/mpi_boot.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ the GNU public licence. See http://www.opensource.org for details.
#define BootTreeTag 0
#define BootStatTag 1

extern int Global_numTask, Global_myRank;

extern int Global_numTask;
extern int Global_myRank;

void Bootstrap_MPI(t_tree *tree);
void Print_Fp_Out_Lines_MPI(t_tree *tree, option *io, int n_data_set, char *bootStr);
Expand Down
14 changes: 10 additions & 4 deletions src/phyrex.c
Original file line number Diff line number Diff line change
Expand Up @@ -359,14 +359,14 @@ void PHYREX_XML(char *xml_filename)


/* Initialize parameters of migrep model */
mixt_tree->mmod->lbda = 1.;
mixt_tree->mmod->mu = 0.8;
mixt_tree->mmod->lbda = 10.0;
mixt_tree->mmod->mu = 1.0;

if(mixt_tree->mmod->id == SLFV_GAUSSIAN || mixt_tree->mmod->id == SLFV_UNIFORM)
mixt_tree->mmod->rad = 0.05*((mixt_tree->mmod->lim_up->lonlat[0]-mixt_tree->mmod->lim_do->lonlat[0])+
(mixt_tree->mmod->lim_up->lonlat[1]-mixt_tree->mmod->lim_do->lonlat[1]));
else if(mixt_tree->mmod->id == RW || mixt_tree->mmod->id == RRW)
mixt_tree->mmod->rad = 2.0*((mixt_tree->mmod->lim_up->lonlat[0]-mixt_tree->mmod->lim_do->lonlat[0])+
mixt_tree->mmod->rad = 1.0*((mixt_tree->mmod->lim_up->lonlat[0]-mixt_tree->mmod->lim_do->lonlat[0])+
(mixt_tree->mmod->lim_up->lonlat[1]-mixt_tree->mmod->lim_do->lonlat[1]));
else assert(FALSE);

Expand All @@ -378,7 +378,7 @@ void PHYREX_XML(char *xml_filename)
{
case 0 : case 1 :
{
PHYREX_Simulate_Backward_Core(mixt_tree->young_disk,YES,mixt_tree);
PHYREX_Simulate_Backward_Core(mixt_tree->young_disk,NO,mixt_tree);
PHYREX_Ldsk_To_Tree(mixt_tree);
break;
}
Expand All @@ -391,6 +391,9 @@ void PHYREX_XML(char *xml_filename)

Update_Ancestors(mixt_tree->n_root,mixt_tree->n_root->v[2],mixt_tree);
Update_Ancestors(mixt_tree->n_root,mixt_tree->n_root->v[1],mixt_tree);

mixt_tree->mmod->rad = 0.1;


MIXT_Set_Ignore_Root(YES,mixt_tree);
MIXT_Set_Bl_From_Rt(YES,mixt_tree);
Expand Down Expand Up @@ -749,6 +752,7 @@ phydbl *PHYREX_MCMC(t_tree *tree)
PhyML_Fprintf(fp_stats,"%s\t","lnP");
PhyML_Fprintf(fp_stats,"%s\t","alnL");
PhyML_Fprintf(fp_stats,"%s\t","glnL");
PhyML_Fprintf(fp_stats,"%s\t","coalescent");
PhyML_Fprintf(fp_stats,"%s\t","clock");
PhyML_Fprintf(fp_stats,"%s\t","evolrate");
PhyML_Fprintf(fp_stats,"%s\t","lbda");
Expand Down Expand Up @@ -881,6 +885,7 @@ phydbl *PHYREX_MCMC(t_tree *tree)
PhyML_Fprintf(fp_stats,"%g\t",tree->c_lnL+tree->mmod->c_lnL+tree->rates->c_lnL_rates);
PhyML_Fprintf(fp_stats,"%g\t",tree->c_lnL);
PhyML_Fprintf(fp_stats,"%g\t",tree->mmod->c_lnL);
PhyML_Fprintf(fp_stats,"%g\t",tree->times->c_lnL_times);
PhyML_Fprintf(fp_stats,"%g\t",tree->rates->clock_r);
PhyML_Fprintf(fp_stats,"%g\t",RATES_Realized_Substitution_Rate(tree));
PhyML_Fprintf(fp_stats,"%g\t",tree->mmod->lbda);
Expand Down Expand Up @@ -975,6 +980,7 @@ phydbl *PHYREX_MCMC(t_tree *tree)
tree->mcmc->sample_num++;
}


if(!strcmp(tree->mcmc->move_name[move],"phyrex_lbda"))
MCMC_PHYREX_Lbda(tree);

Expand Down
5 changes: 1 addition & 4 deletions src/rrw.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,10 @@ phydbl RRW_Lk(t_tree *tree)
phydbl d_fwd,d_ic,d_coal,d_sigsq_scale;
phydbl t_dum;
int idx_dum;

assert(tree->mmod->id == RRW);

#ifdef PHYREX
/* PHYREX_Update_Lindisk_List(tree); */
/* PHYREX_Ldsk_To_Tree(tree); */
if(PHYREX_Total_Number_Of_Intervals(tree) > tree->mmod->max_num_of_intervals) return UNLIKELY;
#endif

Expand All @@ -41,7 +39,6 @@ phydbl RRW_Lk(t_tree *tree)
// Make sure node times are set back to their original values
assert(fabs(t_dum - tree->times->nd_t[idx_dum]) < 1.E-4);

tree->times->c_lnL_times = d_coal;
/* tree->mmod->c_lnL = d_fwd - d_ic + d_coal + d_sigsq_scale; */
tree->mmod->c_lnL = d_fwd + d_coal + d_sigsq_scale;

Expand Down
1 change: 0 additions & 1 deletion src/times.c
Original file line number Diff line number Diff line change
Expand Up @@ -864,7 +864,6 @@ phydbl TIMES_Wrap_Lk_Coalescent(t_edge *b, t_tree *tree, supert_tree *stree)
/*////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////*/


phydbl TIMES_Lk_Coalescent(t_tree *tree)
{
t_node *n;
Expand Down
1 change: 1 addition & 0 deletions src/utilities.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ the GNU public licence. See http://www.opensource.org for details.

#define _POSIX_C_SOURCE 200112L


#include <stdio.h>
#include <stdarg.h>
#include <stdlib.h>
Expand Down

0 comments on commit 2ae8fb0

Please sign in to comment.