globalVariables.h
1 /* RAxML-VI-HPC (version 2.2) a program for sequential and parallel estimation of phylogenetic trees
2  * Copyright August 2006 by Alexandros Stamatakis
3  *
4  * Partially derived from
5  * fastDNAml, a program for estimation of phylogenetic trees from sequences by Gary J. Olsen
6  *
7  * and
8  *
9  * Programs of the PHYLIP package by Joe Felsenstein.
10  *
11  * This program is free software; you may redistribute it and/or modify its
12  * under the terms of the GNU General Public License as published by the Free
13  * Software Foundation; either version 2 of the License, or (at your option)
14  * any later version.
15  *
16  * This program is distributed in the hope that it will be useful, but
17  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
18  * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  * for more details.
20  *
21  *
22  * For any other enquiries send an Email to Alexandros Stamatakis
23  * Alexandros.Stamatakis@epfl.ch
24  *
25  * When publishing work that is based on the results from RAxML-VI-HPC please cite:
26  *
27  * Alexandros Stamatakis:"RAxML-VI-HPC: maximum likelihood-based phylogenetic analyses with thousands of taxa and mixed models".
28  * Bioinformatics 2006; doi: 10.1093/bioinformatics/btl446
29  */
30 
31 #ifdef GLOBAL_VARIABLES_DEFINITION
32 
33 double masterTime;
35 
36 char run_id[128] = "",
37  workdir[1024] = "",
38  seq_file[1024] = "",
39  tree_file[1024]="",
40  weightFileName[1024] = "",
41  resultFileName[1024] = "",
42  logFileName[1024] = "",
43  infoFileName[1024] = "",
44  randomFileName[1024] = "",
45  proteinModelFileName[1024] = "",
47  binaryCheckpointInputName[1024] = "",
48  byteFileName[1024] = "";
49 
50 const char *protModels[PLL_NUM_PROT_MODELS] = {"DAYHOFF", "DCMUT", "JTT", "MTREV", "WAG", "RTREV", "CPREV", "VT", "BLOSUM62", "MTMAM", "LG", "MTART", "MTZOA", "PMB",
51  "HIVB", "HIVW", "JTTDCMUT", "FLU", "AUTO", "LG4", "GTR"};
52 
53 const char dnaStateNames[4] = {'A', 'C', 'G', 'T'};
54 
55 const char protStateNames[20] = {'A','R', 'N', 'D', 'C', 'Q', 'E', 'G', 'H',
56  'I', 'L', 'K', 'M', 'F', 'P', 'S', 'T', 'W',
57  'Y', 'V'};
58 
59 const char inverseMeaningBINARY[4] = {'_', '0', '1', '-'};
60 const char inverseMeaningDNA[16] = {'_', 'A', 'C', 'M', 'G', 'R', 'S', 'V', 'T', 'W', 'Y', 'H', 'K', 'D', 'B', '-'};
61 const char inverseMeaningPROT[23] = {'A','R', 'N', 'D', 'C', 'Q', 'E', 'G', 'H', 'I', 'L', 'K', 'M', 'F', 'P', 'S',
62  'T', 'W', 'Y', 'V', 'B', 'Z', '-'};
63 const char inverseMeaningGeneric32[33] = {'0', '1', '2', '3', '4', '5', '6', '7',
64  '8', '9', 'A', 'B', 'C', 'D', 'E', 'F',
65  'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N',
66  'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V',
67  '-'};
68 const char inverseMeaningGeneric64[33] = {'0', '1', '2', '3', '4', '5', '6', '7',
69  '8', '9', 'A', 'B', 'C', 'D', 'E', 'F',
70  'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N',
71  'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V',
72  '-'};
73 
74 const unsigned int bitVectorIdentity[256] = {0 ,1 ,2 ,3 ,4 ,5 ,6 ,7 ,8 ,9 ,10 ,11 ,12 ,13 ,14 ,15 ,16 ,17 ,18 ,19 ,20 ,21 ,22 ,23 ,24 ,25 ,26 ,
75  27 ,28 ,29 ,30 ,31 ,32 ,33 ,34 ,35 ,36 ,37 ,38 ,39 ,40 ,41 ,42 ,43 ,44 ,45 ,46 ,47 ,48 ,49 ,50 ,51 ,
76  52 ,53 ,54 ,55 ,56 ,57 ,58 ,59 ,60 ,61 ,62 ,63 ,64 ,65 ,66 ,67 ,68 ,69 ,70 ,71 ,72 ,73 ,74 ,75 ,76 ,
77  77 ,78 ,79 ,80 ,81 ,82 ,83 ,84 ,85 ,86 ,87 ,88 ,89 ,90 ,91 ,92 ,93 ,94 ,95 ,96 ,97 ,98 ,99 ,100 ,101 ,
78  102 ,103 ,104 ,105 ,106 ,107 ,108 ,109 ,110 ,111 ,112 ,113 ,114 ,115 ,116 ,117 ,118 ,119 ,120 ,121 ,122 ,
79  123 ,124 ,125 ,126 ,127 ,128 ,129 ,130 ,131 ,132 ,133 ,134 ,135 ,136 ,137 ,138 ,139 ,140 ,141 ,142 ,143 ,
80  144 ,145 ,146 ,147 ,148 ,149 ,150 ,151 ,152 ,153 ,154 ,155 ,156 ,157 ,158 ,159 ,160 ,161 ,162 ,163 ,164 ,
81  165 ,166 ,167 ,168 ,169 ,170 ,171 ,172 ,173 ,174 ,175 ,176 ,177 ,178 ,179 ,180 ,181 ,182 ,183 ,184 ,185 ,
82  186 ,187 ,188 ,189 ,190 ,191 ,192 ,193 ,194 ,195 ,196 ,197 ,198 ,199 ,200 ,201 ,202 ,203 ,204 ,205 ,206 ,
83  207 ,208 ,209 ,210 ,211 ,212 ,213 ,214 ,215 ,216 ,217 ,218 ,219 ,220 ,221 ,222 ,223 ,224 ,225 ,226 ,227 ,
84  228 ,229 ,230 ,231 ,232 ,233 ,234 ,235 ,236 ,237 ,238 ,239 ,240 ,241 ,242 ,243 ,244 ,245 ,246 ,247 ,248 ,
85  249 ,250 ,251 ,252 ,253 ,254 ,255};
86 
87 
88 
89 const unsigned int bitVectorAA[23] = {1, 2, 4, 8, 16, 32, 64, 128,
90  256, 512, 1024, 2048, 4096,
91  8192, 16384, 32768, 65536, 131072, 262144,
92  524288, 12 /* N | D */, 96 /*Q | E*/, 1048575 /* - */};
93 
94 const unsigned int bitVectorSecondary[256] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
95  10, 11, 12, 13, 14, 15, 0, 16, 32, 48, 64, 80, 96, 112, 128, 144, 160, 176, 192,
96  208, 224, 240, 0, 17, 34, 51, 68, 85, 102, 119, 136, 153, 170, 187, 204, 221, 238,
97  255, 0, 256, 512, 768, 1024, 1280, 1536, 1792, 2048, 2304, 2560, 2816, 3072, 3328,
98  3584, 3840, 0, 257, 514, 771, 1028, 1285, 1542, 1799, 2056, 2313, 2570, 2827, 3084,
99  3341, 3598, 3855, 0, 272, 544, 816, 1088, 1360, 1632, 1904, 2176, 2448, 2720, 2992,
100  3264, 3536, 3808, 4080, 0, 273, 546, 819, 1092, 1365, 1638, 1911, 2184, 2457, 2730,
101  3003, 3276, 3549, 3822, 4095, 0, 4096, 8192, 12288, 16384, 20480, 24576, 28672, 32768,
102  36864, 40960, 45056, 49152, 53248, 57344, 61440, 0, 4097, 8194, 12291, 16388, 20485, 24582,
103  28679, 32776, 36873, 40970, 45067, 49164, 53261, 57358, 61455, 0, 4112, 8224, 12336, 16448,
104  20560, 24672, 28784, 32896, 37008, 41120, 45232, 49344, 53456, 57568, 61680, 0, 4113, 8226,
105  12339, 16452, 20565, 24678, 28791, 32904, 37017, 41130, 45243, 49356, 53469, 57582, 61695,
106  0, 4352, 8704, 13056, 17408, 21760, 26112, 30464, 34816, 39168, 43520, 47872, 52224, 56576,
107  60928, 65280, 0, 4353, 8706, 13059, 17412, 21765, 26118, 30471, 34824, 39177, 43530, 47883,
108  52236, 56589, 60942, 65295, 0, 4368, 8736, 13104, 17472, 21840, 26208, 30576, 34944, 39312,
109  43680, 48048, 52416, 56784, 61152, 65520, 0, 4369, 8738, 13107, 17476, 21845, 26214, 30583,
110  34952, 39321, 43690, 48059, 52428, 56797, 61166, 65535};
111 
112 const unsigned int bitVector32[33] = {1, 2, 4, 8, 16, 32, 64, 128,
113  256, 512, 1024, 2048, 4096, 8192, 16384, 32768,
114  65536, 131072, 262144, 524288, 1048576, 2097152, 4194304, 8388608,
115  16777216, 33554432, 67108864, 134217728, 268435456, 536870912, 1073741824, 2147483648u,
116  4294967295u};
117 
118 /*const unsigned int bitVector64[65] = {};*/
120 const unsigned int mask32[32] = {1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768, 65536, 131072,
121  262144, 524288, 1048576, 2097152, 4194304, 8388608, 16777216, 33554432, 67108864, 134217728,
122  268435456, 536870912, 1073741824, 2147483648U};
123 
124 const char *secondaryModelList[21] = { "S6A (GTR)", "S6B", "S6C", "S6D", "S6E", "S7A (GTR)", "S7B", "S7C", "S7D", "S7E", "S7F", "S16 (GTR)", "S16A", "S16B", "S16C",
125  "S16D", "S16E", "S16F", "S16I", "S16J", "S16K"};
126 
127 const partitionLengths pLengths[PLL_MAX_MODEL] = {
128 
129  /* BINARY */
130  {4, 4, 2, 4, 2, 1, 2, 8, 2, 2, PLL_FALSE, PLL_FALSE, 3, inverseMeaningBINARY, 2, PLL_FALSE, bitVectorIdentity},
131 
132  /* DNA */
133  {16, 16, 4, 16, 16, 6, 4, 64, 6, 4, PLL_FALSE, PLL_FALSE, 15, inverseMeaningDNA, 4, PLL_FALSE, bitVectorIdentity},
134 
135  /* AA */
136  {400, 400, 20, 400, 400, 190, 20, 460, 190, 20, PLL_FALSE, PLL_FALSE, 22, inverseMeaningPROT, 20, PLL_TRUE, bitVectorAA},
137 
138  /* SECONDARY_DATA */
139 
140  {256, 256, 16, 256, 256, 120, 16, 4096, 120, 16, PLL_FALSE, PLL_FALSE, 255, (char*)NULL, 16, PLL_TRUE, bitVectorSecondary},
141 
142 
143  /* SECONDARY_DATA_6 */
144  {36, 36, 6, 36, 36, 15, 6, 384, 15, 6, PLL_FALSE, PLL_FALSE, 63, (char*)NULL, 6, PLL_TRUE, bitVectorIdentity},
145 
146 
147  /* SECONDARY_DATA_7 */
148  {49, 49, 7, 49, 49, 21, 7, 896, 21, 7, PLL_FALSE, PLL_FALSE, 127, (char*)NULL, 7, PLL_TRUE, bitVectorIdentity},
149 
150  /* 32 states */
151  {1024, 1024, 32, 1024, 1024, 496, 32, 1056, 496, 32, PLL_FALSE, PLL_FALSE, 32, inverseMeaningGeneric32, 32, PLL_TRUE, bitVector32},
152 
153  /* 64 states */
154  {4096, 4096, 64, 4096, 4096, 2016, 64, 4160, 64, 2016, PLL_FALSE, PLL_FALSE, 64, (char*)NULL, 64, PLL_TRUE, (unsigned int*)NULL}
155 };
156 
157 
158 #if (defined(_USE_PTHREADS) || defined(_FINE_GRAIN_MPI))
159 double *globalResult;
160 boolean treeIsInitialized;
161 #ifdef MEASURE_TIME_PARALLEL
162 double masterTimePerPhase;
163 #endif
164 #endif
165 
166 #ifdef _USE_PTHREADS
167 volatile int jobCycle = 0;
168 volatile int threadJob = 0;
169 volatile char *barrierBuffer;
170 #endif
171 
172 #ifdef _FINE_GRAIN_MPI
173 int processes;
174 int processID;
175 MPI_Datatype TRAVERSAL_MPI;
176 #endif
177 
178 #else
179 extern char infoFileName[1024];
180 extern char resultFileName[1024];
181 extern const partitionLengths pLengths[PLL_MAX_MODEL];
182 extern const char * protModels[PLL_NUM_PROT_MODELS];
183 extern char * secondaryModelList[21];
184 extern double masterTime;
185 extern char logFileName[1024];
186 //extern const unsigned int * mask32;
187 
188 #endif
double masterTime
Definition: globalVariables.h:33
const char dnaStateNames[4]
Array that contains letters for the four DNA base-pairs, i.e. 0 = A, 1 = C, 2 = G, 3 = T.
Definition: globalVariables.h:53
const unsigned int mask32[32]
Array for setting bits 0 .. 31 in a bit vector, used in saveMemory technique for the gapVector...
Definition: globalVariables.h:120
double accumulatedTime
Definition: globalVariables.h:34
char seq_file[1024]
Definition: globalVariables.h:38
volatile int threadJob
Definition: globalVariables.h:168
const char protStateNames[20]
Array that contains letters for the 20 AA base-pairs.
Definition: globalVariables.h:55
char binaryCheckpointName[1024]
Definition: globalVariables.h:46
This is used to look up some hard-coded data for each data type.
Definition: pll.h:1403