5 * Part of TREE-PUZZLE 5.0 (June 2000)
7 * (c) 1999-2000 by Heiko A. Schmidt, Korbinian Strimmer,
8 * M. Vingron, and Arndt von Haeseler
9 * (c) 1995-1999 by Korbinian Strimmer and Arndt von Haeseler
11 * All parts of the source except where indicated are distributed under
12 * the GNU public licence. See http://www.opensource.org for details.
24 extern int PP_IamSlave;
25 extern int PP_IamMaster;
47 /* PVERBOSE3 includes PVERBOSE2 includes PVERBOSE1 */
48 /* PVERBOSE1 is default (PVERBOSE) */
64 # define PP_DONE 0 /* Finished M->S */
65 # define PP_SIZES 1 /* Array sizes needed M->S */
66 # define PP_DATA 2 /* Data Arrays M->S */
68 # define PP_ALLQUARTS 3 /* All Quartets M->S */
70 # define PP_DOQUART 4 /* do 4Specs M->S */
71 # define PP_DOQUARTX2 5 /* do 4Specs + X^2 M->S */
72 # define PP_QUART 6 /* quartet back S->M */
73 # define PP_QUARTX2 7 /* quartet + X^2 back S->M */
75 # define PP_DOQUARTBLOCKSPECS 8 /* do block Specs M->S */
76 # define PP_DOQUARTBLOCK 9 /* do block of Quarts M->S */
77 # define PP_QUARTBLOCKSPECS 10 /* block Specs S->M */
78 # define PP_QUARTBLOCK 11 /* block of Quarts S->M */
80 # define PP_DOPUZZLE 12 /* do Puzzling step M->S */
81 # define PP_PUZZLE 13 /* Puzzling tree back S->M */
82 # define PP_DOPUZZLEBLOCK 14 /* do Puzzling block M->S */
83 # define PP_DOPUZZLEBLOCKSPECS 15 /* do Puzzling block M->S */
84 # define PP_PUZZLEBLOCK 16 /* Puzzling block S->M */
85 # define PP_PUZZLEBLOCKSPECS 17 /* Puzzling block S->M */
87 # define PP_STATS 18 /* Slave Statistics S->M */
89 # define PP_WAIT 18 /* waiting for work S->M */
90 # define PP_TEST 100 /* testing */
92 # define PERMUTQUEUESIZE 100
93 # define QUARTQUEUESIZE 100
95 extern int PP_IamMaster;
96 extern int PP_IamSlave;
98 extern int PP_MyMaster;
99 extern int PP_NumProcs;
100 extern MPI_Comm PP_Comm;
101 #endif /* PARALLEL */
103 extern int *permutsent,
119 extern double *walltimes,
121 extern double *fullwalltimes,
123 extern double *altwalltimes,
126 extern int PP_permutsent,
143 extern double PP_starttime,
153 void num2quart(uli qnum, int *a, int *b, int *c, int *d);
154 uli numquarts(int maxspc);
155 uli quart2num (int a, int b, int c, int d);
157 int slave_main(int argc, char *argv[]);
158 void PP_Init(int *argc, char **argv[]);
160 void PP_Printerror(FILE *of, int id, int err);
161 void PP_do_puzzling(ivector trueID);
163 void PP_RecvDoQuart(int *a,
168 void PP_SendDoQuart(int dest,
174 void PP_RecvQuart(int *a,
182 void PP_SendQuart(int a,
190 void PP_SendSizes(int mspc,
198 void PP_RecvSizes(int *mspc,
207 cmatrix Seqpat, /* cmatrix (Maxspc x Numptrn) */
208 ivector Alias, /* ivector (Maxsite) */
209 ivector Weight, /* ivector (Numptrn) */
211 dvector Rates, /* dvector (numcats) */
212 dvector Eval, /* dvector (tpmradix) */
214 dmatrix Evec, /* dmatrix (tpmradix x tpmradix) */
217 dmatrix Distanmat, /* dmatrix (Maxspc x Maxspc) */
218 dcube ltprobr); /* dcube (numcats x tpmradix x tpmradix) */
220 cmatrix Seqpat, /* cmatrix (Maxspc x Numptrn) */
221 ivector Alias, /* ivector (Maxsite) */
222 ivector Weight, /* ivector (Numptrn) */
224 dvector Rates, /* dvector (numcats) */
225 dvector Eval, /* dvector (tpmradix) */
227 dmatrix Evec, /* dmatrix (tpmradix x tpmradix) */
230 dmatrix Distanmat, /* dmatrix (Maxspc x Maxspc) */
231 dcube ltprobr); /* dcube (numcats x tpmradix x tpmradix) */
232 void PP_SendAllQuarts(unsigned long Numquartets,
233 unsigned char *quartetinfo);
234 void PP_RecvAllQuarts(int taxa,
235 unsigned long *Numquartets,
236 unsigned char *quartetinfo);
238 void PP_SendDoQuartBlock(int dest, uli firstq, uli amount, int approx);
239 void PP_RecvDoQuartBlock(uli *firstq, uli *amount, uli **bq, int *approx);
240 void PP_SendQuartBlock(uli startq,
242 unsigned char *quartetinfo,
246 void PP_RecvQuartBlock(int slave,
249 unsigned char *quartetinfo,
252 void PP_SendPermut(int dest,
255 void PP_RecvPermut(int taxa,
257 void PP_SendDoPermutBlock(uli puzzlings);
258 void PP_RecvDoPermutBlock(uli *taxa);
260 void PP_SendSplits(int taxa,
262 void PP_RecvSplits(int taxa,
268 void PP_putslave(int sl);
271 void PP_cmpd(int rank, double a, double b);
272 void PP_cmpi(int rank, int a, int b);
274 #endif /* _PPUZZLE_ */