Skip to content
This repository
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 2118 lines (2000 sloc) 64.304 kb
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 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 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 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117
/***********************************************************************
 *
 * Copyright (C) 2002,2003,2004,2005,2006,2007,2008 Carsten Urbach
 *
 * Modified by Jenifer Gonzalez Lopez 2009/03/27
 *
 * This file is part of tmLQCD.
 *
 * tmLQCD is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * tmLQCD is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with tmLQCD. If not, see <http://www.gnu.org/licenses/>.
 * This is the parser. (Dec 2002)
 * The .c-file is generated from .l using flex.
 * Please edit read_input.l instead of read_input.c!
 * flex should be said to be case insensitive!
 *
 * After modifiing read_input.l please update read_input.c with
 * flex -Ptmlqcd -i -t read_input.l > read_input.c
 *
 * Autor: Carsten Urbach
 * urbach@physik.fu-berlin.de
 ***********************************************************************/

SPC [[:blank:]]+
CMD [:][[:space:]]+
RLN [1-9(10)(11)(12)(13)(14)(15)(16)][:]
DIGIT [[:digit:]]
ZT [0-9(10)(11)]
IDXEX ("-"{DIGIT}+)
SIGN ("+"|"-")
FLT {SIGN}?{DIGIT}+(".")?{DIGIT}*(e("-"|"+")?{DIGIT}+)?
FILENAME [a-zA-Z0-9_".""-""/"][a-zA-z0-9"."_"-""/"]+
NAME [a-zA-Z0-9_]+
CSTR \"[a-zA-Z0-9\-\._]+\"
TYPE [0-9A-Z]+
EQL {SPC}*={SPC}*

%{
#ifdef HAVE_CONFIG_H
# include<config.h>
#endif
#include<stdlib.h>
#include<stdio.h>
#include<string.h>
#include"global.h"
#include"read_input.h"
#include"default_input_values.h"
#include"monomial.h"
#include"measurements.h"
#include"integrator.h"
#include"operator.h"
#include"phmc.h"
#include<io/params.h>

inline void rmQuotes(char *str){
  char* strsave=str;

  while(*str== ' ' || *str == '\t') str++;

  if(*str=='\"') *(strsave++)=*( ++str );
  else fprintf(stderr,"Error in removing quotes from string:\n %s \n" , str);
  ++str;

  while( !( *str=='\0' || *str == '\"' || *str == '\n') ) *(strsave++)=*(str++);
  *strsave='\0';
}

  /* Name of the parsing routine */
#define YY_DECL int parse_config()
#define YY_NO_UNPUT
  /* helper vars */
  char *cstring_to_parse=NULL;
  int cstring_caller;
  int solver_caller;

  /* declaration of input parameters */
  int i=0;
  int line_of_file = 1;
  int current_monomial = -1;
  int current_measurement=-1;
  int current_operator = -1;
  extern int no_monomials;
  extern int no_measurements;
  monomial * mnl = NULL;
  measurement * meas = NULL;
  operator * optr = NULL;
  int comment_caller;
  int name_caller;
  int a,b;
  double c;
  float cs;
  int reread = 0;
  char name[100];
  char * type;

  int verbose = 0;
  int myverbose = 0;
  int startoption;
  int Ntherm;
  int Nmeas;
  int Nsave;
  int gmres_m_parameter, gmresdr_nr_ev;
  int write_cp_flag;
  int cp_interval;
  int nstore;
  int index_start, index_end;
  int random_seed;
  int rlxd_level;
  char rlxd_input_filename[500];
  char gauge_input_filename[500];
  int read_source_flag;
  int return_check_flag, return_check_interval;
  int gauge_precision_read_flag;
  int gauge_precision_write_flag;
  int g_disable_IO_checks;
  int gmres_m_parameter, gmresdr_nr_ev;
  int reproduce_randomnumber_flag;
  double stout_rho;
  int stout_no_iter;
  int use_stout_flag;
  int phmc_no_flavours;
  int phmc_heavy_timescale;
  int phmc_exact_poly;
  int compute_evs;
  int phmc_compute_evs;
  double stilde_max;
  double stilde_min;
  int degree_of_p;
  int source_location;
  int no_eigenvalues;
  double eigenvalue_precision;
  int sub_evs_cg_flag;
  int even_odd_flag;
  int bc_flag;
  int online_measurement_flag;
  int online_measurement_freq;
  int reweighting_flag;
  int reweighting_samples;
  int no_samples;
  int compute_modenumber;
  int compute_topsus;
  double mstarsq;
  int no_sources_z2;
  int usegpu_flag;
  int max_innersolver_it;
  int device_num;
  double innersolver_precision;

  double innersolver_precision_abs;
  double innersolver_precision_rel;
  int innersolver_precision_check_abs;
  int innersolver_precision_check_rel;

  int propagator_comparison;
  int nb_cores;

  int nblocks_t;
  int nblocks_x;
  int nblocks_y;
  int nblocks_z;

  int dfl_field_iter;
  int dfl_poly_iter;

  int use_preconditioning;
%}

%option never-interactive

%x STARTCOND
%x THERMSWEEPS
%x NMEAS
%x KAPPA
%x MUBAR
%x EPSBAR
%x MU
%x CSW
%x SEED
%x RLXDLEVEL
%x NSAVE
%x RLXDINPUTFILE
%x GAUGEINPUTFILE
%x GAUGERPREC
%x GAUGEWPREC
%x DSBLIOCHECK
%x DFLSP
%x PRECON
%x WRITECP
%x CPINT
%x NSTORE
%x TT
%x LL
%x LLX
%x LLY
%x LLZ
%x TTBSF
%x NPROCX
%x NPROCY
%x NPROCZ
%x IOPROC
%x IDX
%x CGMAX
%x BCGMAX
%x BOUNDT
%x BOUNDX
%x BOUNDY
%x BOUNDZ
%X READSOURCE
%x SOURCEFORMAT
%x SOURCEFILE
%x SOURCETS
%x SOURCETYPE
%x PROPSPLIT
%x NOSAMPLES
%x RELPREC
%x REVCHECK
%x REVINT
%x DEBUG
%x GMRESM
%x GMRESDRNEV
%x CGMMSNMS
%x REPRORND
%x SLOPPYPREC
%x USESTOUT
%x STOUTRHO
%x STOUTITER
%x COMPUTEEVS
%x SRCLOC
%x SUBEVCG
%x NOEV
%x PRECEV
%x EO
%x BC
%x WRPROPFLAG
%x PROPTYPE
%x COMPUTEMN
%x COMPUTETS
%x MSTARSQ
%x NOSOURCESZ2
%x INITMEASUREMENT
%x ONLINEMEAS
%x PIONNORMMEAS
%x PLOOP

%x REWEIGH
%x REWSAMPLES

%x INITINTEGRATOR
%x INTEGRATOR

%x GPU
%x INITGPU

%x INITOPERATOR
%x TMOP
%x DBTMOP
%x WILSONOP
%x OVERLAPOP
%x CLOVEROP
%x TMSOLVER
%x DBTMSOLVER
%x OVSOLVER

%x INITMONOMIAL
%x DETMONOMIAL
%x CLDETMONOMIAL
%x CLDETRATMONOMIAL
%x GAUGEMONOMIAL
%x SFGAUGEMONOMIAL
%x NDPOLYMONOMIAL
%x POLYMONOMIAL
%x MNAME
%x MCSTR
%x MSOLVER
%x GTYPE

%x COMMENT
%x ERROR

%x PCOMP
%x NBCORES

%x DFLNBLOCKT
%x DFLNBLOCKX
%x DFLNBLOCKY
%x DFLNBLOCKZ

%x DFLFIELDITER
%x DFLPOLYITER

%x PRECONDITIONING


%%
^SourceFilename{EQL} BEGIN(SOURCEFILE);
^T{EQL} BEGIN(TT);
^L{EQL} BEGIN(LL);
^LX{EQL} BEGIN(LLX);
^LY{EQL} BEGIN(LLY);
^LZ{EQL} BEGIN(LLZ);
^g_Tbsf{EQL} BEGIN(TTBSF);
^NRXProcs{EQL} BEGIN(NPROCX);
^NRYProcs{EQL} BEGIN(NPROCY);
^NRZProcs{EQL} BEGIN(NPROCZ);
^kappa{EQL} BEGIN(KAPPA);
^csw{EQL} BEGIN(CSW);
^2KappaMu{EQL} BEGIN(MU);
^2KappaMubar{EQL} BEGIN(MUBAR);
^2KappaEpsBar{EQL} BEGIN(EPSBAR);
^NoEigenvalues{EQL} BEGIN(NOEV);
^EigenvaluePrecision{EQL} BEGIN(PRECEV);
^seed{EQL} BEGIN(SEED);
^StartCondition{EQL} BEGIN(STARTCOND);
^ThermalisationSweeps{EQL} BEGIN(THERMSWEEPS);
^Measurements{EQL} BEGIN(NMEAS);
^NSave{EQL} BEGIN(NSAVE);
^GaugeFieldInFile{EQL} BEGIN(GAUGEINPUTFILE);
^RlxdStateInFile{EQL} BEGIN(RLXDINPUTFILE);
^SubtractEVForCG{EQL} BEGIN(SUBEVCG);
^WriteCheckpoints{EQL} BEGIN(WRITECP);
^CheckpointInterval{EQL} BEGIN(CPINT);
^GaugeConfigInputFile{EQL} BEGIN(GAUGEINPUTFILE);
^RlxdInputFile{EQL} BEGIN(RLXDINPUTFILE);
^InitialStoreCounter{EQL} BEGIN(NSTORE);
^StdIOProcessor{EQL} BEGIN(IOPROC);
^Indices{EQL} BEGIN(IDX);
^BCGstabMaxIter{EQL} BEGIN(BCGMAX);
^CGMaxIter{EQL} BEGIN(CGMAX);
^BCAngleT{EQL} BEGIN(BOUNDT);
^ThetaT{EQL} BEGIN(BOUNDT);
^ThetaX{EQL} BEGIN(BOUNDX);
^ThetaY{EQL} BEGIN(BOUNDY);
^ThetaZ{EQL} BEGIN(BOUNDZ);
^ReadSource{EQL} BEGIN(READSOURCE);
^UseRelativePrecision{EQL} BEGIN(RELPREC);
^ReversibilityCheck{EQL} BEGIN(REVCHECK);
^ReversibilityCheckIntervall{EQL} BEGIN(REVINT);
^DebugLevel{EQL} BEGIN(DEBUG);
^GMRESMParameter{EQL} BEGIN(GMRESM);
^GMRESDRNrEv{EQL} BEGIN(GMRESDRNEV);
^CGMMSNoExtraMasses{EQL} BEGIN(CGMMSNMS);
^GaugeConfigReadPrecision{EQL} BEGIN(GAUGERPREC);
^GaugeConfigWritePrecision{EQL} BEGIN(GAUGEWPREC);
^DisableIOChecks{EQL} BEGIN(DSBLIOCHECK);
^ReproduceRandomNumbers{EQL} BEGIN(REPRORND);
^UseSloppyPrecision{EQL} BEGIN(SLOPPYPREC);
^UseStoutSmearing{EQL} BEGIN(USESTOUT);
^StoutRho{EQL} BEGIN(STOUTRHO);
^StoutNoIterations{EQL} BEGIN(STOUTITER);
^ComputeEVs{EQL} BEGIN(COMPUTEEVS);
^SourceLocation{EQL} BEGIN(SRCLOC);
^UseEvenOdd{EQL} BEGIN(EO);
^Bc{EQL} BEGIN(BC);
^WritePropagatorFormat{EQL} BEGIN(WRPROPFLAG);
^PropagatorType{EQL} BEGIN(WRPROPFLAG);
^RanluxdLevel{EQL} BEGIN(RLXDLEVEL);
^DeflationSubspaceDimension{EQL} BEGIN(DFLSP);
^GCRPreconditioner{EQL} BEGIN(PRECON);
^ComputeReweightingFactor{EQL} BEGIN(REWEIGH);
^NoReweightingSamples{EQL} BEGIN(REWSAMPLES);
^SourceTimeSlice{EQL} BEGIN(SOURCETS);
^SourceType{EQL} BEGIN(SOURCETYPE);
^NoSamples{EQL} BEGIN(NOSAMPLES);
^SplittedPropagator{EQL} BEGIN(PROPSPLIT);
^UsePreconditioning{EQL} BEGIN(PRECONDITIONING);

^BeginMeasurement{SPC}+ BEGIN(INITMEASUREMENT);
^ComputeModeNumber{EQL} BEGIN(COMPUTEMN);
^ComputeTopSus{EQL} BEGIN(COMPUTETS);
^MStarSq{EQL} BEGIN(MSTARSQ);
^NoSourcesZ2{EQL} BEGIN(NOSOURCESZ2);
^BeginMonomial{SPC}+ BEGIN(INITMONOMIAL);
^BeginInt BEGIN(INITINTEGRATOR);
^BeginOperator{SPC}+ BEGIN(INITOPERATOR);

^PropagatorComparison{EQL} BEGIN(PCOMP);
^NbCoresPerNode{EQL} BEGIN(NBCORES);

^NoBlocksT{EQL} BEGIN(DFLNBLOCKT);
^NoBlocksX{EQL} BEGIN(DFLNBLOCKX);
^NoBlocksY{EQL} BEGIN(DFLNBLOCKY);
^NoBlocksZ{EQL} BEGIN(DFLNBLOCKZ);

^DflFieldIter{EQL} BEGIN(DFLFIELDITER);
^DflPolyIter{EQL} BEGIN(DFLPOLYITER);

^BeginGPU BEGIN(INITGPU);



<INITGPU>Init{SPC}* {
 if(myverbose) printf("Initialising GPU line %d\n", line_of_file);
 usegpu_flag = 1;
  if(myverbose!=0) printf(" Using help of GPU for inversions\n");
 BEGIN(GPU);
 }
<GPU>{
  {SPC}*InnersolverPrecision{SPC}*={SPC}*{FLT} {
    sscanf(yytext, " %[2a-zA-Z] = %lf", name, &c);
    innersolver_precision = c;
    if(myverbose) printf(" Inner solver precision set to %lf line %d\n", c, line_of_file);
  }
  {SPC}*MaxInnersolverIteration{SPC}*={SPC}*{DIGIT}+ {
    sscanf(yytext, " %[2a-zA-Z] = %d", name, &a);
    max_innersolver_it = a;
    if(myverbose) printf(" Inner solver iterations set to %d line %d\n", a, line_of_file);
  }
  {SPC}*DeviceNum{SPC}*={SPC}*{DIGIT}+ {
      sscanf(yytext, " %[2a-zA-Z] = %d", name, &a);
      device_num = a;
      if(myverbose) printf(" Device Number set to %d line %d\n", a, line_of_file);
  }
  {SPC}*InnersolverPrecisionAbs{SPC}*={SPC}*{FLT} {
    sscanf(yytext, " %[2a-zA-Z] = %lf", name, &c);
    innersolver_precision_abs = c;
    if(myverbose) printf(" innersolver_precision_abs set to %lf line %d\n", c, line_of_file);
  }
  {SPC}*InnersolverPrecisionRel{SPC}*={SPC}*{FLT} {
    sscanf(yytext, " %[2a-zA-Z] = %lf", name, &c);
    innersolver_precision_rel = c;
    if(myverbose) printf(" innersolver_precision_rel set to %lf line %d\n", c, line_of_file);
  }
  {SPC}*InnersolverPrecisionCheckAbs{SPC}*={SPC}*{DIGIT}+ {
      sscanf(yytext, " %[2a-zA-Z] = %d", name, &a);
      innersolver_precision_check_abs = a;
      if(myverbose) printf(" innersolver_precision_check_abs set to %d line %d\n", a, line_of_file);
  }
  {SPC}*InnersolverPrecisionCheckRel{SPC}*={SPC}*{DIGIT}+ {
      sscanf(yytext, " %[2a-zA-Z] = %d", name, &a);
      innersolver_precision_check_rel = a;
      if(myverbose) printf(" innersolver_precision_check_rel set to %d line %d\n", a, line_of_file);
  }
  EndGPUInit{SPC}* {
  if(myverbose) printf("GPU parsed in line %d\n\n", line_of_file);
  BEGIN(0);
  }
}


<INITOPERATOR>{TYPE} {
  current_operator++;
  optr = &operator_list[current_operator];
  optr->id = current_operator;
  optr->initialised = 0;
  if(strcmp(yytext, "WILSON")==0) {
    optr->type = WILSON;
  }
  else if(strcmp(yytext, "TMWILSON")==0) {
    optr->type = TMWILSON;
  }
  else if(strcmp(yytext, "CLOVER")==0) {
    optr->type = CLOVER;
  }
  else if(strcmp(yytext, "DBTMWILSON")==0) {
    optr->type = DBTMWILSON;
  }
  else if(strcmp(yytext, "OVERLAP")==0) {
    optr->type = OVERLAP;
  }
  else {
    fprintf(stderr, "Unknown operator type %s in line %d\n", yytext, line_of_file);
    exit(1);
  }
  if(!reread) {
    if(add_operator(optr->type) < 0) {
      fprintf(stderr, "Something went wrong in adding operators\nAborting...!\n");
      exit(1);
    }
  }
  if(myverbose) printf("initialising operator with type %s (%d) line %d\n", yytext, optr->type, line_of_file);
  if(myverbose) printf("operator has id %d\n", current_operator);

  if(optr->type == WILSON) BEGIN(WILSONOP);
  else if(optr->type == CLOVER) BEGIN(CLOVEROP);
  else if(optr->type == TMWILSON) BEGIN(TMOP);
  else if(optr->type == DBTMWILSON) BEGIN(DBTMOP);
  else BEGIN(OVERLAPOP);
}

<WILSONOP,TMOP,OVERLAPOP,DBTMOP,CLOVEROP>{
  {SPC}*kappa{EQL}{FLT} {
    sscanf(yytext, " %[2a-zA-Z] = %lf", name, &c);
    optr->kappa = c;
    if(myverbose) printf(" kappa set to %f line %d operator %d\n", c, line_of_file, current_operator);
  }
  {SPC}*MaxSolverIterations{EQL}{DIGIT}+ {
    sscanf(yytext, " %[a-zA-Z] = %d", name, &a);
    optr->maxiter = a;
    if(myverbose) printf(" MaxSolverIterations set to %d line %d operator %d\n", a, line_of_file, current_operator);
  }
  {SPC}*PropagatorPrecision{EQL}32 {
    optr->prop_precision = 32;
    PropInfo.precision = 32;
    if(myverbose) printf(" PropagatorPrecision set to 32 line %d operator %d\n", line_of_file, current_operator);
  }
  {SPC}*PropagatorPrecision{EQL}64 {
    optr->prop_precision = 64;
    PropInfo.precision = 64;
    if(myverbose) printf(" PropagatorPrecision set to 64 line %d operator %d\n", line_of_file, current_operator);
  }
  {SPC}*SolverPrecision{EQL}{FLT} {
    sscanf(yytext, " %[2a-zA-Z] = %lf", name, &c);
    optr->eps_sq = c;
    if(myverbose) printf(" SolverPrecision set to %f line %d operator %d\n", c, line_of_file, current_operator);
  }
  {SPC}*SolverRelativePrecision{EQL}yes {
    sscanf(yytext, " %[2a-zA-Z] = %lf", name, &c);
    optr->rel_prec = 1;
    if(myverbose) printf(" SolverRelativePrecision set to YES line %d operator %d\n", line_of_file, current_operator);
  }
  {SPC}*SolverRelativePrecision{EQL}no {
    sscanf(yytext, " %[2a-zA-Z] = %lf", name, &c);
    optr->rel_prec = 0;
    if(myverbose) printf(" SolverRelativePrecision set to NO line %d operator %d\n", line_of_file, current_operator);
  }
  ^EndOperator{SPC}* {
    if(myverbose) printf("operator %d parsed line %d\n\n", current_operator, line_of_file);
    BEGIN(0);
  }
}

<WILSONOP,TMOP>{
  {SPC}*Solver{EQL} {
    name_caller = YY_START;
    BEGIN(TMSOLVER);
  }
}

<WILSONOP,TMOP>{
  {SPC}*UseEvenOdd{EQL}yes {
    if(myverbose) printf(" Use even/odd preconditioning line %d operator %d\n", line_of_file, current_operator);
    optr->even_odd_flag = 1;
  }
  {SPC}*UseEvenOdd{EQL}no {
    if(myverbose) printf(" Do not use even/odd preconditioning line %d operator %d\n", line_of_file, current_operator);
    optr->even_odd_flag = 0;
  }
}

<DBTMOP>{
  {SPC}*2KappaMubar{EQL}{FLT} {
    sscanf(yytext, " %[2a-zA-Z] = %lf", name, &c);
    optr->mubar = c;
    if(myverbose) printf(" 2KappaMubar set to %f line %d operator %d\n", c, line_of_file, current_operator);
  }
  {SPC}*2KappaEpsbar{EQL}{FLT} {
    sscanf(yytext, " %[2a-zA-Z] = %lf", name, &c);
    optr->epsbar = c;
    if(myverbose) printf(" 2KappaEpsbar set to %f line %d operator %d\n", c, line_of_file, current_operator);
  }
  {SPC}*Solver{EQL} {
    name_caller = YY_START;
    BEGIN(DBTMSOLVER);
  }
}

<TMOP,CLOVEROP>{
  {SPC}*2KappaMu{EQL}{FLT} {
    sscanf(yytext, " %[2a-zA-Z] = %lf", name, &c);
    optr->mu = c;
    if(myverbose) printf(" 2KappaMu set to %f line %d operator %d\n", c, line_of_file, current_operator);
  }
  {SPC}*AddDownPropagator{EQL}yes {
    optr->DownProp = 1;
    if(myverbose) printf(" Invert for + and - mu set in line %d operator %d\n", line_of_file, current_operator);
  }
  {SPC}*AddDownPropagator{EQL}no {
    optr->DownProp = 0;
    if(myverbose) printf(" Don't invert for + and - mu set in line %d operator %d\n", line_of_file, current_operator);
  }
}

<CLOVEROP>{
  {SPC}*csw{EQL}{FLT} {
    sscanf(yytext, " %[2a-zA-Z] = %lf", name, &c);
    optr->c_sw = c;
    if(myverbose) printf(" Set c_sw set to %lf in line %d for operator %d\n", optr->c_sw, line_of_file, current_operator);
  }
}

<OVERLAPOP>{
  {SPC}*Solver{EQL} {
   BEGIN(OVSOLVER);
  }
  {SPC}*m{EQL}{FLT} {
    sscanf(yytext, " %[2a-zA-Z] = %lf", name, &c);
    optr->m = c;
    if(myverbose) printf(" m set to %f line %d operator %d\n", c, line_of_file, current_operator);
  }
  {SPC}*s{EQL}{FLT} {
    sscanf(yytext, " %[2a-zA-Z] = %lf", name, &c);
    optr->s = c;
    if(myverbose) printf(" s set to %f line %d operator %d\n", c, line_of_file, current_operator);
  }
  {SPC}*DegreeOfPolynomial{EQL}{DIGIT}+ {
    sscanf(yytext, " %[a-zA-Z] = %d", name, &a);
    optr->deg_poly = a;
    if(myverbose) printf(" DegreeOfPolynomial set to %d line %d operator %d\n", a, line_of_file, current_operator);
  }
  {SPC}*NoKernelEigenvalues{EQL}{DIGIT}+ {
    sscanf(yytext, " %[a-zA-Z] = %d", name, &a);
    optr->no_ev = a;
    if(myverbose) printf(" NoKernelEigenvalues set to %d line %d operator %d\n", a, line_of_file, current_operator);
  }
  {SPC}*KernelEigenvaluePrecision{EQL}{FLT} {
    sscanf(yytext, " %[2a-zA-Z] = %lf", name, &c);
    optr->ev_prec = c;
    if(myverbose) printf(" KernelEigenvaluePrecision set to %f line %d operator %d\n", c, line_of_file, current_operator);
  }
  {SPC}*KernelEigenvectorsReadWrite{EQL}yes {
    optr->ev_readwrite = 1;
    if(myverbose) printf(" KernelEigenvectorsReadWrite set to 1 line %d operator %d\n", line_of_file, current_operator);
  }
  {SPC}*KernelEigenvectorsReadWrite{EQL}no {
    optr->ev_readwrite = 0;
    if(myverbose) printf(" KernelEigenvectorsReadWrite set to 0 line %d operator %d\n", line_of_file, current_operator);
  }
}

<DBTMSOLVER,TMSOLVER>{
  cg {
    optr->solver=1;
    if(myverbose) printf(" Solver set to CG line %d operator %d\n", line_of_file, current_operator);
    BEGIN(name_caller);
  }
}

<TMSOLVER>{
  mixedcg {
    optr->solver=13;
    if(myverbose) printf(" Solver set to MixedCG line %d operator %d\n", line_of_file, current_operator);
    BEGIN(name_caller);
  }
  bicgstab {
    optr->solver=0;
    if(myverbose) printf(" Solver set to BiCGstab line %d operator %d\n", line_of_file, current_operator);
    BEGIN(name_caller);
  }
  pcg {
    optr->solver=9;
    if(myverbose) printf(" Solver set to PCG line %d operator %d\n", line_of_file, current_operator);
    BEGIN(name_caller);
  }
  gmres {
    optr->solver=2;
    if(myverbose) printf(" Solver set to GMRES line %d operator %d\n", line_of_file, current_operator);
    BEGIN(name_caller);
  }
  gcr {
    optr->solver=7;
    if(myverbose) printf(" Solver set to GCR line %d operator %d\n", line_of_file, current_operator);
    BEGIN(name_caller);
  }
  gmresdr {
    optr->solver=8;
    if(myverbose) printf(" Solver set to GMRES-DR line %d operator %d\n", line_of_file, current_operator);
    BEGIN(name_caller);
  }
  cgs {
    optr->solver=3;
    if(myverbose) printf(" Solver set to CGS line %d operator %d\n", line_of_file, current_operator);
    BEGIN(name_caller);
  }
  mr {
    optr->solver=4;
    if(myverbose) printf(" Solver set to MR line %d operator %d\n", line_of_file, current_operator);
    BEGIN(name_caller);
  }
  fgmres {
    optr->solver=6;
    if(myverbose) printf(" Solver set to FGMRES line %d operator %d\n", line_of_file, current_operator);
    BEGIN(name_caller);
  }
  dflgcr {
    optr->solver=10;
    g_dflgcr_flag = 1;
    if(myverbose) printf(" Solver set to DFL-GCR line %d operator %d\n", line_of_file, current_operator);
    BEGIN(name_caller);
  }
  dflfgmres {
    optr->solver=11;
    g_dflgcr_flag = 1;
    if(myverbose) printf(" Solver set to DFL-FGMRES line %d operator %d\n", line_of_file, current_operator);
    BEGIN(name_caller);
  }
  cgmms {
    optr->solver = 12;
    if(myverbose) printf(" Solver set to CGMMS line %d operator %d\n", line_of_file, current_operator);
    BEGIN(name_caller);
  }
}

<OVSOLVER>{
  sumr {
    optr->solver = 13;
    if(myverbose) printf(" Solver set to SUMR line %d operator %d\n", line_of_file, current_operator);
    BEGIN(OVERLAPOP);
  }
  cg {
    optr->solver = 1;
    if(myverbose) printf(" Solver set to SUMR line %d operator %d\n", line_of_file, current_operator);
    BEGIN(OVERLAPOP);
  }
}


<INITMONOMIAL>{TYPE} {
  current_monomial++;
  mnl = &monomial_list[current_monomial];
  mnl->id = current_monomial;
  if(strcmp(yytext, "DET")==0) {
    mnl->type = DET;
    strcpy((*mnl).name, "DET");
  }
  else if(strcmp(yytext, "CLOVERDET")==0) {
    mnl->type = CLOVERDET;
    strcpy((*mnl).name, "CLOVERDET");
    g_dbw2rand = 1;
  }
  else if(strcmp(yytext, "CLOVERDETRATIO")==0) {
    mnl->type = CLOVERDETRATIO;
    strcpy((*mnl).name, "CLOVERDETRATIO");
    g_dbw2rand = 1;
  }
  else if(strcmp(yytext, "DETRATIO")==0) {
    mnl->type = DETRATIO;
    strcpy((*mnl).name, "DETRATIO");
  }
  else if(strcmp(yytext, "NDDETRATIO")==0) {
    mnl->type = NDDETRATIO;
    strcpy((*mnl).name, "NDDETRATIO");
    g_running_phmc = 1;
  }
  else if(strcmp(yytext, "NDPOLY")==0) {
    mnl->type = NDPOLY;
    strcpy((*mnl).name, "NDPOLY");
    g_running_phmc = 1;
  }
  else if(strcmp(yytext, "POLY")==0) {
    mnl->type = POLY;
    strcpy((*mnl).name, "POLY");
  }
  else if(strcmp(yytext, "POLYDETRATIO")==0) {
    mnl->type = POLYDETRATIO;
    strcpy((*mnl).name, "POLYDETRATIO");
  }
  else if(strcmp(yytext, "GAUGE")==0) {
    mnl->type = GAUGE;
    mnl->gtype = 3;
    strcpy((*mnl).name, "GAUGE");
  }
  else if(strcmp(yytext, "SFGAUGE")==0) {
    mnl->type = SFGAUGE;
    mnl->gtype = 6;
    strcpy((*mnl).name, "SFGAUGE");
  }
  else {
    fprintf(stderr, "Unknown monomial type %s in line %d\n", yytext, line_of_file);
    exit(1);
  }
  if(!reread) {
    if(add_monomial(mnl->type) < 0) {
      fprintf(stderr, "Something went wrong in adding monomials\nAborting...!\n");
      exit(1);
    }
  }
  if(myverbose) printf("initialising monomial with type %s %d line %d\n", yytext, mnl->type, line_of_file);
  if(myverbose) printf("monomial has id %d\n", current_monomial);

  if(mnl->type == GAUGE) BEGIN(GAUGEMONOMIAL);
  else if(mnl->type == SFGAUGE) BEGIN(SFGAUGEMONOMIAL);
  else if(mnl->type == NDPOLY) BEGIN(NDPOLYMONOMIAL);
  else if(mnl->type == POLY || mnl->type == POLYDETRATIO) {
          fprintf(stderr,"starting to parse poly(detratio) monomial\n");
          BEGIN(POLYMONOMIAL);
  }
  else if(mnl->type == CLOVERDET) BEGIN(CLDETMONOMIAL);
  else if(mnl->type == CLOVERDETRATIO) BEGIN(CLDETRATMONOMIAL);
  else BEGIN(DETMONOMIAL);
}



<DETMONOMIAL,GAUGEMONOMIAL,SFGAUGEMONOMIAL,NDPOLYMONOMIAL,POLYMONOMIAL,CLDETMONOMIAL,CLDETRATMONOMIAL>{
  {SPC}*Timescale{EQL}{DIGIT}+ {
    if(mnl->type == NDDETRATIO) {
      mnl->timescale = -5;
      if(myverbose) printf(" timescales set to %d line %d monomial %d since NDDETRATIO is not for MD evolution\n", a, line_of_file, current_monomial);
    }
    else {
      sscanf(yytext, " %[a-zA-Z] = %d", name, &a);
      mnl->timescale = a;
      if(myverbose) printf(" timescales set to %d line %d monomial %d\n", a, line_of_file, current_monomial);
    }
  }
  {SPC}*Name{EQL} {
    name_caller = YY_START;
    BEGIN(MNAME);
  }
  ^EndMonomial{SPC}* {
    if(myverbose) printf("monomial %d parsed line %d\n\n", current_monomial, line_of_file);
    BEGIN(0);
  }
}

<CLDETMONOMIAL,CLDETRATMONOMIAL>{
  {SPC}*CSW{EQL}{FLT} {
    sscanf(yytext, " %[a-zA-Z] = %lf", name, &c);
    mnl->c_sw = c;
    if(myverbose) printf(" CSW set to %f line %d monomial %d\n", c, line_of_file, current_monomial);
  }
  {SPC}*rho{EQL}{FLT} {
    sscanf(yytext, " %[a-zA-Z] = %lf", name, &c);
    mnl->rho = c;
    if(myverbose) printf(" mass shift rho set to %f line %d monomial %d\n", c, line_of_file, current_monomial);
  }
}

<CLDETRATMONOMIAL>{
  {SPC}*rho2{EQL}{FLT} {
    sscanf(yytext, " %[a-zA-Z]2 = %lf", name, &c);
    mnl->rho2 = c;
    if(myverbose) printf(" mass shift rho2 set to %f line %d monomial %d\n", c, line_of_file, current_monomial);
  }
}


<DETMONOMIAL,POLYMONOMIAL>{
  {SPC}*2KappaMu2{EQL}{FLT} {
    sscanf(yytext, " %[2a-zA-Z] = %lf", name, &c);
    mnl->mu2 = c;
    if(myverbose) printf(" 2KappaMu2 set to %f line %d monomial %d\n", c, line_of_file, current_monomial);
  }
  {SPC}*Kappa2{EQL}{FLT} {
    sscanf(yytext, " %[2a-zA-Z] = %lf", name, &c);
    mnl->kappa2 = c;
    if(myverbose) printf(" kappa2 set to %f line %d monomial %d\n", c, line_of_file, current_monomial);
  }
  {SPC}*2KappaMubar{EQL}{FLT} {
    sscanf(yytext, " %[2a-zA-Z] = %lf", name, &c);
    mnl->mubar = c;
    if(myverbose) printf(" 2KappaMubar set to %f line %d monomial %d\n", c, line_of_file, current_monomial);
  }
  {SPC}*2KappaMubar2{EQL}{FLT} {
    sscanf(yytext, " %[2a-zA-Z] = %lf", name, &c);
    mnl->mubar2 = c;
    if(myverbose) printf(" 2KappaMubar2 set to %f line %d monomial %d\n", c, line_of_file, current_monomial);
  }
  {SPC}*2KappaEpsbar{EQL}{FLT} {
    sscanf(yytext, " %[2a-zA-Z] = %lf", name, &c);
    mnl->epsbar = c;
    if(myverbose) printf(" 2KappaEpsbar set to %f line %d monomial %d\n", c, line_of_file, current_monomial);
  }
  {SPC}*2KappaEpsbar2{EQL}{FLT} {
    sscanf(yytext, " %[2a-zA-Z] = %lf", name, &c);
    mnl->epsbar2 = c;
    if(myverbose) printf(" 2KappaEpsbar2 set to %f line %d monomial %d\n", c, line_of_file, current_monomial);
  }
}

<DETMONOMIAL,POLYMONOMIAL,CLDETMONOMIAL,CLDETRATMONOMIAL>{
  {SPC}*2KappaMu{EQL}{FLT} {
    sscanf(yytext, " %[2a-zA-Z] = %lf", name, &c);
    mnl->mu = c;
    if(myverbose) printf(" 2KappaMu set to %f line %d monomial %d\n", c, line_of_file, current_monomial);
  }
  {SPC}*Kappa{EQL}{FLT} {
    sscanf(yytext, " %[a-zA-Z] = %lf", name, &c);
    mnl->kappa = c;
    if(myverbose) printf(" Kappa set to %f line %d monomial %d\n", c, line_of_file, current_monomial);
  }
  {SPC}*CSGHistory{EQL}{DIGIT}+ {
    sscanf(yytext, " %[a-zA-Z] = %d", name, &a);
    mnl->csg_N = a;
    if(myverbose) printf(" csg history length set to %d line %d monomial %d\n", a, line_of_file, current_monomial);
  }
  {SPC}*CSGHistory2{EQL}{DIGIT}+ {
    sscanf(yytext, " %[a-zA-Z2] = %d", name , &a);
    mnl->csg_N2 = a;
    if(myverbose) printf(" csg history2 length (for bicgstab) set to %d line %d monomial %d\n",
                       a, line_of_file, current_monomial);
  }
  {SPC}*ForcePrecision{EQL}{FLT} {
    sscanf(yytext, " %[a-zA-Z] = %lf",name , &c);
    mnl->forceprec = c;
    if(myverbose) printf(" ForcePrecision set to %e line %d monomial %d\n", c, line_of_file, current_monomial);
  }
  {SPC}*AcceptancePrecision{EQL}{FLT} {
    sscanf(yytext, " %[a-zA-Z] = %lf",name , &c);
    mnl->accprec = c;
    if(myverbose) printf(" AcceptancePrecision set to %e line %d monomial %d\n", c, line_of_file, current_monomial);
  }
  {SPC}*MaxSolverIterations{EQL}{DIGIT}+ {
    sscanf(yytext, " %[a-zA-Z] = %d", name, &a);
    mnl->maxiter = a;
    if(myverbose) printf(" MaxSolverIterations set to %d line %d monomial %d\n", a, line_of_file, current_monomial);
  }
  {SPC}*Solver{EQL} {
   solver_caller=YY_START;
   BEGIN(MSOLVER);
  }
}

<GAUGEMONOMIAL>{
  {SPC}*Type{EQL} BEGIN(GTYPE);
  {SPC}*UseRectangleStaples{EQL}yes {
    mnl->use_rectangles = 1;
    g_dbw2rand = 1;
    if(myverbose) printf(" UseRectangleStaples set to true line %d monomial %d\n", line_of_file, current_monomial);
  }
  {SPC}*UseRectangleStaples{EQL}no {
    mnl->use_rectangles = 0;
    /* g_dbw2rand = 0; */
    mnl->c1 = 0.;
    g_rgi_C1 = 0.;
    if(myverbose) printf(" UseRectangleStaples set to false line %d monomial %d\n", line_of_file, current_monomial);
  }
  {SPC}*Beta{EQL}{FLT} {
    sscanf(yytext, " %[a-zA-Z] = %lf",name , &c);
    mnl->beta = c;
    g_beta = c;
    if(myverbose) printf(" beta set to %e line %d monomial %d\n", c, line_of_file, current_monomial);
  }
  {SPC}*RectangleCoefficient{EQL}{FLT} {
    sscanf(yytext, " %[a-zA-Z] = %lf",name , &c);
    mnl->c1 = c;
    g_rgi_C1 = c;
    if(myverbose) printf(" RectangleCoefficient c1 set to %e line %d monomial %d\n", c, line_of_file, current_monomial);
  }
  {SPC}*IncludeWrappedSquares{EQL}yes {
    g_sf_inc_wrap_sq = 1;
    if(myverbose) printf(" IncludeWrappedSquares set to true line %d monomial %d\n", line_of_file, current_monomial);
  }
  {SPC}*IncludeWrappedSquares{EQL}no {
    g_sf_inc_wrap_sq = 0;
    if(myverbose) printf(" IncludeWrappedSquares set to false line %d monomial %d\n", line_of_file, current_monomial);
  }
}

<SFGAUGEMONOMIAL>{
  {SPC}*Type{EQL} BEGIN(GTYPE);
  {SPC}*UseRectangleStaples{EQL}yes {
    mnl->use_rectangles = 1;
    g_dbw2rand = 1;
    if(myverbose) printf(" UseRectangleStaples set to true line %d monomial %d\n", line_of_file, current_monomial);
  }
  {SPC}*UseRectangleStaples{EQL}no {
    mnl->use_rectangles = 0;
    /* g_dbw2rand = 0; */
    mnl->c1 = 0.;
    g_rgi_C1 = 0.;
    if(myverbose) printf(" UseRectangleStaples set to false line %d monomial %d\n", line_of_file, current_monomial);
  }
  {SPC}*Beta{EQL}{FLT} {
    sscanf(yytext, " %[a-zA-Z] = %lf",name , &c);
    mnl->beta = c;
    g_beta = c;
    if(myverbose) printf(" beta set to %e line %d monomial %d\n", c, line_of_file, current_monomial);
  }
  {SPC}*RectangleCoefficient{EQL}{FLT} {
    sscanf(yytext, " %[a-zA-Z] = %lf",name , &c);
    mnl->c1 = c;
    g_rgi_C1 = c;
    if(myverbose) printf(" RectangleCoefficient c1 set to %e line %d monomial %d\n", c, line_of_file, current_monomial);
  }
  {SPC}*Eta{EQL}{FLT} {
    sscanf(yytext, " %[a-zA-Z] = %lf",name , &c);
    mnl->eta = c;
    g_eta = c;
    if(myverbose) printf(" eta set to %e line %d monomial %d\n", c, line_of_file, current_monomial);
  }
  {SPC}*PlaquetteCoefficientT{EQL}{FLT} {
    sscanf(yytext, " %[a-zA-Z] = %lf",name , &c);
    mnl->ct = c;
    g_Ct = c;
    if(myverbose) printf(" PlaquetteCoefficientT ct set to %e line %d monomial %d\n", c, line_of_file, current_monomial);
  }
  {SPC}*PlaquetteCoefficientS{EQL}{FLT} {
    sscanf(yytext, " %[a-zA-Z] = %lf",name , &c);
    mnl->cs = c;
    g_Cs = c;
    if(myverbose) printf(" PlaquetteCoefficientS cs set to %e line %d monomial %d\n", c, line_of_file, current_monomial);
  }
  {SPC}*RectangleCoefficientSS{EQL}{FLT} {
    sscanf(yytext, " %[a-zA-Z] = %lf",name , &c);
    mnl->c1ss = c;
    g_C1ss = c;
    if(myverbose) printf(" RectangleCoefficientSS c1ss set to %e line %d monomial %d\n", c, line_of_file, current_monomial);
  }
  {SPC}*RectangleCoefficientTSS{EQL}{FLT} {
    sscanf(yytext, " %[a-zA-Z] = %lf",name , &c);
    mnl->c1tss = c;
    g_C1tss = c;
    if(myverbose) printf(" RectangleCoefficientTSS c1tss set to %e line %d monomial %d\n", c, line_of_file, current_monomial);
  }
  {SPC}*RectangleCoefficientTTS{EQL}{FLT} {
    sscanf(yytext, " %[a-zA-Z] = %lf",name , &c);
    mnl->c1tts = c;
    g_C1tts = c;
    if(myverbose) printf(" RectangleCoefficientTTS c1tts set to %e line %d monomial %d\n", c, line_of_file, current_monomial);
  }
}


<NDPOLYMONOMIAL>{
  {SPC}*ExactPolynomial{EQL}yes {
    phmc_exact_poly = 1;
    if(myverbose!=0) printf(" phmc_exact_poly set to true line %d monomial %d\n", line_of_file, current_monomial);
  }
  {SPC}*ExactPolynomial{EQL}no {
    phmc_exact_poly = 0;
    if(myverbose!=0) printf(" phmc_exact_poly set to false line %d monomial %d\n", line_of_file, current_monomial);
  }
  {SPC}*StildeMax{EQL}{FLT} {
    sscanf(yytext, " %[a-zA-Z] = %lf",name , &c);
    stilde_max = c;
    mnl->StildeMax = c;
    if(myverbose!=0) printf(" Stilde max set to %e line %d monomial %d\n", c, line_of_file, current_monomial);
  }
  {SPC}*StildeMin{EQL}{FLT} {
    sscanf(yytext, " %[a-zA-Z] = %lf",name , &c);
    mnl->StildeMin = c;
    stilde_min = c;
    if(myverbose!=0) printf(" Stilde min set to %e line %d monomial %d\n", c, line_of_file, current_monomial);
  }
  {SPC}*MaxPtildeDegree{EQL}{DIGIT}+ {
    sscanf(yytext, " %[a-zA-Z] = %d", name, &a);
    mnl->MaxPtildeDegree = a;
    phmc_max_ptilde_degree = a;
    if(myverbose!=0) printf(" Maximal Degree of Ptilde set to %d line %d monomial %d\n", mnl->MaxPtildeDegree, line_of_file, current_monomial);
  }
  {SPC}*DegreeOfMDPolynomial{EQL}{DIGIT}+ {
    sscanf(yytext, " %[a-zA-Z] = %d", name, &a);
    mnl->MDPolyDegree = a;
    degree_of_p = a;
    if(myverbose!=0) printf(" Degree of MD polynomial set to %d line %d monomial %d\n", a, line_of_file, current_monomial);
  }
  {SPC}*PrecisionPtilde{EQL}{FLT} {
    sscanf(yytext, " %[a-zA-Z] = %lf",name , &c);
    g_acc_Ptilde = c;
    mnl->PrecisionPtilde = c;
    if(myverbose!=0) printf(" Precision for Ptilde set to %e line %d monomial %d\n", c, line_of_file, current_monomial);
  }
  {SPC}*PrecisionHfinal{EQL}{FLT} {
    sscanf(yytext, " %[a-zA-Z] = %lf",name , &c);
    mnl->PrecisionHfinal = c;
    g_acc_Hfin = c;
    if(myverbose!=0) printf(" Precision for final H set to %e line %d monomial %d\n", c, line_of_file, current_monomial);
  }
  {SPC}*ComputeEVFreq{EQL}{DIGIT}+ {
    sscanf(yytext, " %[a-zA-Z] = %d", name, &a);
    g_rec_ev = a;
    if(myverbose!=0) printf(" Frequency for computing EV's set to %d in line %d monomial %d\n", g_rec_ev, line_of_file, current_monomial);
  }
  {SPC}*ComputeOnlyEVs{EQL}yes {
    phmc_compute_evs=1;
    if(myverbose!=0) printf(" Compute only heavy EVs set to true line %d monomial %d\n", line_of_file, current_monomial);
  }
  {SPC}*ComputeOnlyEVs{EQL}no {
    phmc_compute_evs=0;
    if(myverbose!=0) printf(" Compute only heavy EVs set to false line %d monomial %d\n", line_of_file, current_monomial);
  }
}

<POLYMONOMIAL>{
  {SPC}*Degree{EQL}{DIGIT}+ {
    sscanf(yytext, " %[a-zA-Z] = %d", name, &a);
    mnl->MDPolyDegree = a;
    if(myverbose!=0) printf(" Degree of degenerate MD polynomial set to %d line %d monomial %d\n", mnl->MDPolyDegree, line_of_file, current_monomial);
  }
  {SPC}*Lmin{EQL}{FLT} {
    sscanf(yytext, " %[a-zA-Z] = %lf", name, &c);
    mnl->MDPolyLmin = c;
    if(myverbose!=0)
      printf(" lower bound of degenerate MD polynomial set to %f line %d monomial %d\n",
        mnl->MDPolyLmin, line_of_file, current_monomial);
  }
  {SPC}*Lmax{EQL}{FLT} {
    sscanf(yytext, " %[a-zA-Z] = %lf", name, &c);
    mnl->MDPolyLmax = c;
    if(myverbose!=0)
      printf(" upper bound of degenerate MD polynomial set to %f line %d monomial %d\n",
       mnl->MDPolyLmax, line_of_file, current_monomial);
  }
}


<POLYMONOMIAL,NDPOLYMONOMIAL>{
  {SPC}*LocNormConst{EQL}{FLT} {
    sscanf(yytext, " %[a-zA-Z] = %lf", name, &c);
    mnl->MDPolyLocNormConst = c;
    if(myverbose!=0)
      printf(" local normalisation constant MD polynomial set to %f line %d monomial %d\n",
       mnl->MDPolyLocNormConst, line_of_file, current_monomial);
  }
  {SPC}*RootsFile{EQL} {
    cstring_to_parse=mnl->MDPolyRootsFile;
    cstring_caller = YY_START;
    BEGIN(MCSTR);
  }
}


<MNAME>{NAME} {
  if(myverbose) printf(" monomial named \"%s\" line %d monomial %d\n", yytext, line_of_file, current_monomial);
  strcpy((*mnl).name, yytext);
  BEGIN(name_caller);
}

<MCSTR>{CSTR} {
  if(myverbose) printf(" monomial named \"%s\" line %d monomial %d\n", yytext, line_of_file, current_monomial);
  strcpy(cstring_to_parse, yytext);
  rmQuotes(cstring_to_parse);
  /* reset variable */
  cstring_to_parse=NULL;
  BEGIN(cstring_caller);
}


<MSOLVER>{
  CG {
    if(myverbose) printf(" Solver set to \"%s\" line %d monomial %d\n", yytext, line_of_file, current_monomial);
    mnl->solver = 1;
    BEGIN(solver_caller);
  }
  bicgstab {
    if(myverbose) printf(" Solver set to \"%s\" line %d monomial %d\n", yytext, line_of_file, current_monomial);
    mnl->solver = 0;
    BEGIN(solver_caller);
  }
}

<GTYPE>{
  Wilson {
    mnl->gtype = 0;
    mnl->c1 = 0.;
    mnl->use_rectangles = 0;
    g_rgi_C1 = 0.;
    /* g_dbw2rand = 0; */
    BEGIN(GAUGEMONOMIAL);
  }
  tlsym {
    mnl->gtype = 1;
    mnl->c1 = -0.083333333;
    g_rgi_C1 = -0.083333333;
    mnl->use_rectangles = 1;
    g_dbw2rand = 1;
    BEGIN(GAUGEMONOMIAL);
  }
  Iwasaki {
    mnl->gtype = 2;
    mnl->c1 = -0.331;
    g_rgi_C1 = -0.331;
    mnl->use_rectangles = 1;
    g_dbw2rand = 1;
    BEGIN(GAUGEMONOMIAL);
  }
  user {
    mnl->gtype = 3;
    BEGIN(GAUGEMONOMIAL);
  }
  DBW2 {
    mnl->gtype = 4;
    mnl->c1 = -1.4088;
    g_rgi_C1 = -1.4088;
    g_dbw2rand = 1;
    mnl->use_rectangles = 1;
    BEGIN(GAUGEMONOMIAL);
  }
  sf_Wilson {
    mnl->gtype = 5;
    mnl->c1 = 0.;
    mnl->use_rectangles = 0;
    g_rgi_C1 = 0.;
    /* g_dbw2rand = 0; */
    BEGIN(SFGAUGEMONOMIAL);
  }
  sf_user {
    mnl->gtype = 6;
    BEGIN(SFGAUGEMONOMIAL);
  }

}

<INITINTEGRATOR>egrator{SPC}* {
  Integrator.no_timescales = -1;
  Integrator.tau = 1.;
  for(i = 0; i < 10; i++) {
    Integrator.lambda[i] = _default_2mn_lambda;
    Integrator.type[i] = MN2;
  }
  if(myverbose) printf("initialising integrator line %d\n", line_of_file);
  BEGIN(INTEGRATOR);
}
<INTEGRATOR>{
  {SPC}*Type{DIGIT}{EQL}{TYPE} {
    type = (char*)malloc(100*sizeof(char));
    sscanf(yytext, " %[a-zA-Z]%d = %s", name, &a, type);
    if(strcmp(type, "LEAPFROG")==0) {
      Integrator.type[a] = LEAPFROG;
    }
    else if(strcmp(type, "2MN")==0) {
      Integrator.type[a] = MN2;
    }
    else if(strcmp(type, "2MNPOSITION")==0) {
      Integrator.type[a] = MN2p;
    }
    else {
      fprintf(stderr, "Unknown integrator type %s in line %d\n", yytext, line_of_file);
      exit(1);
    }

    if(myverbose) printf(" timescale %d type = %s line %d\n", a, type, line_of_file);
    free(type);
  }
  {SPC}*IntegrationSteps{DIGIT}{EQL}{DIGIT}+ {
    sscanf(yytext, " %[a-zA-Z]%d = %d", name, &a, &b);
    if(myverbose) printf(" timescale %d steps=%d line %d\n", a, b, line_of_file);
    Integrator.n_int[a] = b;
    BEGIN(INTEGRATOR);
  }
  {SPC}*Lambda{DIGIT}{EQL}{FLT} {
    sscanf(yytext, " %[a-zA-Z]%d = %lf", name, &a, &c);
    Integrator.lambda[a] = c;
    if(myverbose) printf(" timescale %d Lambda=%f line %d\n", a, c, line_of_file);
    BEGIN(INTEGRATOR);
  }
  {SPC}*NumberOfTimescales{EQL}{DIGIT}+ {
    sscanf(yytext, " %[a-zA-Z] = %d", name, &a);
    if(myverbose) printf(" Number of timescales set to %d line %d\n", a, line_of_file);
    if(a > 10) {
      if(g_proc_id == 0) fprintf(stderr, "maximal number of timescales is 10! Aborting...!\n");
      exit(-1);
    }
    Integrator.no_timescales = a;
    BEGIN(INTEGRATOR);
  }
  {SPC}*Tau{EQL}{FLT} {
    sscanf(yytext, " %[a-zA-Z] = %lf", name, &c);
    if(myverbose) printf(" tau set to %e line %d\n", c, line_of_file);
    Integrator.tau = c;
    BEGIN(INTEGRATOR);
  }
  EndIntegrator{SPC}* {
    if(Integrator.no_timescales == -1) {
      fprintf(stderr, "NumberOfTimescales must be specified!\n");
      exit(1);
    }
    if(myverbose) printf("Integrators parsed line %d\n\n", line_of_file);
    BEGIN(0);
  }
}

<SOURCETYPE>{
  Point {
    SourceInfo.type = 0;
    if(myverbose) printf("Using Point Sources\n");
  }
  Volume {
    SourceInfo.type = 1;
    if(myverbose) printf("Using Volume Sources\n");
  }
  TimeSlice {
    SourceInfo.type = 2;
    if(myverbose) printf("Using TimeSlice Sources\n");
  }
}
<PROPSPLIT>{
  yes {
    PropInfo.splitted = 1;
    if(myverbose) printf("Writing Propagators in seperate files\n");
  }
  no {
    PropInfo.splitted = 0;
    if(myverbose) printf("Writing all Propagators per gauge into one single files\n");
  }
}

<NOSAMPLES>{DIGIT}+ {
  no_samples = atoi(yytext);
  if(myverbose) printf("Inverting for %d samples\n", no_samples);
}

<INITMEASUREMENT>{TYPE} {
 if(myverbose) printf("initialising measurements line %d\n", line_of_file);
  current_measurement++;
  meas = &measurement_list[current_measurement];
  meas->id = current_measurement;
  meas->direction = 0;
  meas->max_iter = 15000;
  if(strcmp(yytext, "CORRELATORS")==0) {
    meas->type = ONLINE;
    strcpy((*meas).name, "CORRELATORS");
  }
  else if(strcmp(yytext, "PIONNORM")==0) {
    meas->type = PIONNORM;
    strcpy((*meas).name, "PIONNORM");
  }
  else if(strcmp(yytext, "POLYAKOVLOOP")==0) {
    meas->type = POLYAKOV;
    strcpy((*meas).name, "POLYAKOV");
  }
  else {
    fprintf(stderr, "Unknown measurement type %s in line %d\n", yytext, line_of_file);
    exit(1);
  }
  /*set default frequency here, in case it is not specified
    in the input file */
  meas->freq = _default_measurement_freq;
  if(!reread) {
    if(add_measurement(meas->type) < 0) {
      fprintf(stderr, "Something went wrong in adding measurements\nAborting...!\n");
      exit(1);
    }
  }
  if(myverbose) printf("initialising measurement with type %s %d line %d\n", yytext, meas->type, line_of_file);
  if(myverbose) printf("measurement has id %d\n", current_measurement);

  if(meas->type == ONLINE) BEGIN(ONLINEMEAS);
  else if(meas->type == PIONNORM) BEGIN(PIONNORMMEAS);
  else if(meas->type == POLYAKOV) BEGIN(PLOOP);
}

<ONLINEMEAS,PIONNORMMEAS,PLOOP>{
  ^EndMeasurement{SPC}* {
    if(myverbose) printf("Measurement with id %d parsed in line %d\n\n", meas->id, line_of_file);
    BEGIN(0);
  }
  {SPC}*Frequency{SPC}*={SPC}*{DIGIT}+ {
    sscanf(yytext, " %[a-zA-Z] = %d", name, &a);
    meas->freq = a;
    if(myverbose!=0) printf(" Frequency for measurement with id %d set to %d\n", meas->id, meas->freq);
  }
}

<ONLINEMEAS,PIONNORMMEAS>{
  {SPC}*MaxSolverIterations{EQL}{DIGIT}+ {
    sscanf(yytext, " %[a-zA-Z] = %d", name, &a);
    meas->max_iter = a;
    if(myverbose) printf(" MaxSolverIterations set to %d line %d measurement id=%d\n", a, line_of_file, meas->id);
  }
}

<PLOOP>{
  {SPC}*Direction{EQL}[03] {
    sscanf(yytext, " %[a-zA-Z] = %d", name, &a);
    meas->direction = a;
    if(myverbose!=0) fprintf(stderr, " Direction for polyakov loop set to %d\n", meas->direction);
  }
}

<TT>{DIGIT}+ {
#ifndef FIXEDVOLUME
  T_global = atoi(yytext);
  if(myverbose!=0) printf("T =%s\n", yytext);
#endif
}
<LL>{DIGIT}+ {
#ifndef FIXEDVOLUME
  L = atoi(yytext);
  if(myverbose!=0) printf("L =%s\n", yytext);
#endif
}
<LLX>{DIGIT}+ {
#ifndef FIXEDVOLUME
  LX = atoi(yytext);
  if(myverbose!=0) printf("LX =%s\n", yytext);
#endif
}
<LLY>{DIGIT}+ {
#ifndef FIXEDVOLUME
  LY = atoi(yytext);
  if(myverbose!=0) printf("LY =%s\n", yytext);
#endif
}
<LLZ>{DIGIT}+ {
#ifndef FIXEDVOLUME
  LZ = atoi(yytext);
  if(myverbose!=0) printf("LZ =%s\n", yytext);
#endif
}
<TTBSF>{DIGIT}+ {
  g_Tbsf = atoi(yytext);
  if(myverbose!=0) printf("g_Tbsf =%s\n", yytext);
}
<NPROCX>{DIGIT}+ {
#ifndef FIXEDVOLUME
  N_PROC_X = atoi(yytext);
  if(myverbose!=0) printf("Nr of processors in x direction = %s\n", yytext);
#endif
}
<NPROCY>{DIGIT}+ {
#ifndef FIXEDVOLUME
  N_PROC_Y = atoi(yytext);
  if(myverbose!=0) printf("Nr of processors in y direction = %s\n", yytext);
#endif
}
<NPROCZ>{DIGIT}+ {
#ifndef FIXEDVOLUME
  N_PROC_Z = atoi(yytext);
  if(myverbose!=0) printf("Nr of processors in z direction = %s\n", yytext);
#endif
}
<PCOMP>{DIGIT}+ {
  propagator_comparison=atoi(yytext);
  if(myverbose!=0) printf("propagator_comparison = %s \n", yytext);
}
<NBCORES>{DIGIT}+ {
  nb_cores=atoi(yytext);
  if(myverbose!=0) printf("nb_cores = %s \n", yytext);
}
<DFLNBLOCKT>{DIGIT}+ {
  nblocks_t=atoi(yytext);
  if(myverbose!=0) printf("nblocks_t = %s \n", yytext);
}
<DFLNBLOCKX>{DIGIT}+ {
  nblocks_x=atoi(yytext);
  if(myverbose!=0) printf("nblocks_x = %s \n", yytext);
}
<DFLNBLOCKY>{DIGIT}+ {
  nblocks_y=atoi(yytext);
  if(myverbose!=0) printf("nblocks_y = %s \n", yytext);
}
<DFLNBLOCKZ>{DIGIT}+ {
  nblocks_z=atoi(yytext);
  if(myverbose!=0) printf("nblocks_z = %s \n", yytext);
}
<DFLFIELDITER>{DIGIT}+ {
  dfl_field_iter=atoi(yytext);
  if(myverbose!=0) printf("dfl_fields_iter = %s \n", yytext);
}
<DFLPOLYITER>{DIGIT}+ {
  dfl_poly_iter=atoi(yytext);
  if(myverbose!=0) printf("dfl_poly_iter = %s \n", yytext);
}
<SEED>{DIGIT}+ {
  random_seed=atoi(yytext);
  if(myverbose!=0) printf("seed=%s \n", yytext);
}
<RLXDLEVEL>[12] {
  rlxd_level = atoi(yytext);
  if(myverbose!=0) printf("RanluxdLevel set to %d \n", rlxd_level);
}
<KAPPA>{FLT} {
  g_kappa=atof(yytext);
  if(myverbose!=0) printf("kappa=%s \n", yytext);
}
<MUBAR>{FLT} {
  g_mubar=atof(yytext);
  if(myverbose!=0) printf("2 kappa mubar=%s \n", yytext);
}
<EPSBAR>{FLT} {
  g_epsbar=atof(yytext);
  if(myverbose!=0) printf("2 kappa epsbar=%s \n", yytext);
}
<MU>{FLT} {
  g_mu1=atof(yytext);
  if(myverbose!=0) printf("2 kappa mu=%s \n", yytext);
}
<CSW>{FLT} {
  g_c_sw=atof(yytext);
  if(myverbose!=0) printf("c_sw=%lf \n", g_c_sw);
}
<STARTCOND>{
  cold {
    startoption=0;
    if(myverbose!=0) printf("Start Condition is %s \n",yytext);
  }
  hot {
    startoption=1;
    if(myverbose!=0) printf("Start Condition is %s \n",yytext);
  }
  restart {
    startoption=2;
    if(myverbose!=0) printf("Start Condition is %s \n",yytext);
  }
  continue {
    startoption=3;
    if(myverbose!=0) printf("Start Condition is %s \n",yytext);
  }
}
<THERMSWEEPS>{DIGIT}+ {
  Ntherm=atoi(yytext);
  if(myverbose!=0) printf("Nterm= %s \n",yytext);
}
<NMEAS>{DIGIT}+ {
  Nmeas=atoi(yytext);
  if(myverbose!=0) printf("Nmeas= %s \n",yytext);
}
<NSAVE>{DIGIT}+ {
  Nsave=atoi(yytext);
  if(myverbose!=0) printf("Nsave= %s \n",yytext);
}
<GMRESM>{DIGIT}+ {
  gmres_m_parameter = atoi(yytext);
  if(myverbose!=0) printf("Use Krylov Space of size %d in GMRES \n", gmres_m_parameter);
}
<GMRESDRNEV>{DIGIT}+ {
  gmresdr_nr_ev = atoi(yytext);
  if(myverbose!=0) printf("Deflate %d eigenvectors in GMRES-DR \n", gmresdr_nr_ev);
}
<CGMMSNMS>{DIGIT}+ {
  g_no_extra_masses = atoi(yytext);
  if(myverbose!=0) printf("Number of extra MMS masses set to %d\n", g_no_extra_masses);
}
<DFLSP>{DIGIT}+ {
  g_N_s = atoi(yytext);
  if(myverbose!=0) printf("Deflation subspace dimension set to %d \n", g_N_s);
}
<PRECON>{
  none {
    if(myverbose!=0) printf("Using no right preconditioner \n");
  }
  polynomial {
    if(myverbose!=0) printf("Using polynomial as right preconditioner \n");
  }
  cg {
    if(myverbose!=0) printf("Using cg as right preconditioner \n");
  }
}
<WRITECP>yes {
  write_cp_flag=1;
  if(myverbose!=0) printf("Write Checkpoints\n");
}
<WRITECP>no {
  write_cp_flag=0;
  if(myverbose!=0) printf("Don't write Checkpoints\n");
}
<DSBLIOCHECK>yes {
  g_disable_IO_checks = 1;
  if(myverbose!=0) printf("Disable IO checks (and readback in case of Lemon IO)\n");
}
<DSBLIOCHECK>no {
  g_disable_IO_checks = 0;
  if(myverbose!=0) printf("Enable IO checks (and readback in case of Lemon IO)\n");
}
<CPINT>{DIGIT}+ {
  cp_interval=atoi(yytext);
  if(myverbose!=0) printf("Write Checkpoint all %s measurements\n",yytext);
}
<GAUGEINPUTFILE>{FILENAME} {
  int length = strlen(yytext)+1;
  if(length >= sizeof(gauge_input_filename)/sizeof(char) )
    yy_fatal_error("Filename GaugeConfigInputFile too long! (see read_input.l)\n");

  strcpy(gauge_input_filename,yytext);
  if(myverbose!=0) printf("Gauge Configuration input filename set to %s\n",yytext);
}
<NSTORE>{DIGIT}+ {
  nstore=atoi(yytext);
  if(myverbose!=0) printf("Initial store counter set to %s\n",yytext);
}
<NSTORE>readin {
  nstore=-1;
  if(myverbose!=0) printf("Trying to read InitialStoreCounter from file .nstore_counter\n");
}
<IOPROC>all {
  g_stdio_proc = -1;
  if(myverbose!=0) printf("All processors will give output to stdout\n");
}
<IOPROC>no {
  g_stdio_proc = -2;
  if(myverbose!=0) printf("No processor will give output to stdout\n");
}
<IOPROC>{DIGIT}+ {
  g_stdio_proc = atoi(yytext);
  if(myverbose!=0) printf("processor %s will give output to stdout\n", yytext);
}
<IDX>{DIGIT}+ {
  index_start = atoi(yytext);
  index_end = index_start+1;
  if((index_start < 0)||(index_start > 11)){
    printf("Error in line %d! index_start must be in [0,11]! Exiting...!\n", line_of_file);
    exit(1);
  }
  if(myverbose!=0) printf("inverting for index %s\n", yytext);
}
<IDX>{IDXEX} {
  sscanf(yytext, "-%d", &index_end);
  if((index_end < 0)||(index_end > 11)){
    printf("Error in line %d! index_end must be in [0,11]! Exiting...!\n", line_of_file);
    exit(1);
  }
  if(myverbose!=0) printf("inverting up to spin-color index %d\n", index_end);
  index_end+=1;
}
<BCGMAX>{DIGIT}+ {
  ITER_MAX_BCG = atoi(yytext);
  if(myverbose != 0) printf("Maximal number of iterations for BCGstab set ro %d\n", ITER_MAX_BCG);
}
<CGMAX>{DIGIT}+ {
  ITER_MAX_CG = atoi(yytext);
  if(myverbose != 0) printf("Maximal number of iterations for CG set ro %d\n", ITER_MAX_CG);
}
<BOUNDT>{FLT} {
  X0 = atof(yytext);
  if(myverbose != 0) printf("X0 for boundary cond. in time set to %e\n", X0);
}
<BOUNDX>{FLT} {
  X1 = atof(yytext);
  if(myverbose != 0) printf("X1 for boundary cond. in time set to %e\n", X0);
}
<BOUNDY>{FLT} {
  X2 = atof(yytext);
  if(myverbose != 0) printf("X2 for boundary cond. in time set to %e\n", X0);
}
<BOUNDZ>{FLT} {
  X3 = atof(yytext);
  if(myverbose != 0) printf("X3 for boundary cond. in time set to %e\n", X0);
}
<READSOURCE>yes {
  read_source_flag=1;
  if(myverbose!=0) printf("Read inversion source from file\n");
}
<READSOURCE>no {
  read_source_flag=0;
  if(myverbose!=0) printf("Don't read inversion source from file\n");
}
<READSOURCE>nobutsave {
  read_source_flag=2;
  if(myverbose!=0) printf("Don't read inversion source from file, but save the one generated\n");
}
<SOURCEFILE>{FILENAME} {
  if(SourceInfo.basename == NULL) free(SourceInfo.basename);
  SourceInfo.basename = (char*)malloc((strlen(yytext)+1)*sizeof(char));
  strcpy(SourceInfo.basename, yytext);
  if(PropInfo.basename == NULL) free(PropInfo.basename);
  PropInfo.basename = (char*)malloc((strlen(yytext)+1)*sizeof(char));
  strcpy(PropInfo.basename, yytext);
  if(myverbose!=0) printf("source input filename set to %s\n",yytext);
}
<SOURCEFORMAT>etmc {
  SourceInfo.format = 0;
  if(myverbose!=0) printf("Using standard ETMC binary format for source input file\n");
}
<SOURCEFORMAT>cmi {
  SourceInfo.format = 11;
  if(myverbose!=0) printf("Using CM format for source input file\n");
}
<SOURCEFORMAT>gwc {
  SourceInfo.format = 10;
  if(myverbose!=0) printf("Using GWC format for source input file\n");
}
<SOURCETS>{DIGIT}+ {
  SourceInfo.t = atoi(yytext);
  SourceInfo.automaticTS = 0;
  if(myverbose!=0) printf("Using only timeslice %s of the source, padding the rest with zeros\n", yytext);
}
<SOURCETS>detect {
  SourceInfo.automaticTS = 1;
  if(myverbose!=0) printf("Try to detect source timeslice automatically\n");
}
<RELPREC>yes {
  g_relative_precision_flag = 1;
  if(myverbose!=0) printf("Using relative precision\n");
}
<RELPREC>no {
  g_relative_precision_flag = 0;
  if(myverbose!=0) printf("Using absolute precision\n");
}
<REVCHECK>yes {
  return_check_flag = 1;
  if(myverbose!=0) printf("Perform checks of Reversibility\n");
}
<REVCHECK>no {
  return_check_flag = 0;
  if(myverbose!=0) printf("Don't perform checks of Reversibility\n");
}
<REVINT>{DIGIT}+ {
  return_check_interval = atoi(yytext);
  if(myverbose!=0) printf("Check reversibility all %d trajectories\n", return_check_interval);
}
<DEBUG>{DIGIT}+ {
  g_debug_level = atoi(yytext);
  if(myverbose!=0) printf("Debug level = %d\n", g_debug_level);
}
<GAUGERPREC>32 {
  gauge_precision_read_flag = 32;
  if(myverbose!=0) printf("Read gauges in 32 Bit precision!\n");
}
<GAUGERPREC>64 {
  gauge_precision_read_flag = 64;
  if(myverbose!=0) printf("Read gauges in 64 Bit precision!\n");
}
<GAUGEWPREC>32 {
  gauge_precision_write_flag = 32;
  if(myverbose!=0) printf("Save gauges in 32 Bit precision!\n");
}
<GAUGEWPREC>64 {
  gauge_precision_write_flag = 64;
  if(myverbose!=0) printf("Save gauges in 64 Bit precision!\n");
}
<REPRORND>yes {
  reproduce_randomnumber_flag = 1;
  if(myverbose!=0) printf("Use reproducable randomnumbers!\n");
}
<REPRORND>no {
  reproduce_randomnumber_flag = 0;
  if(myverbose!=0) printf("Use a different seed for each process in ranlxd!\n");
}
<SLOPPYPREC>yes {
  g_sloppy_precision_flag = 1;
  if(myverbose!=0) printf("Use sloppy precision if available!\n");
}
<SLOPPYPREC>no {
  g_sloppy_precision_flag = 0;
  if(myverbose!=0) printf("Don't use sloppy precision!\n");
}
<USESTOUT>yes {
  use_stout_flag = 1;
  if(myverbose!=0) printf("Use stout smearing for invert!\n");
}
<USESTOUT>no {
  use_stout_flag = 0;
  if(myverbose!=0) printf("Don't use stout smearing for invert!\n");
}
<PRECONDITIONING>yes {
  use_preconditioning = 1;
  if(myverbose) printf("Using project \"QCD-Preconditioning\"\n");
}
<PRECONDITIONING>no {
  use_preconditioning = 0;
  if(myverbose) printf("not using project \"QCD-Preconditioning\"\n");
}
<STOUTRHO>{FLT} {
  stout_rho=atof(yytext);
  if(myverbose!=0) printf("use stout rho=%e!\n", stout_rho);
}
<STOUTITER>{DIGIT}+ {
  stout_no_iter=atoi(yytext);
  if(myverbose!=0) printf("make %d stout iterations!\n", stout_no_iter);
}
<COMPUTEEVS>yes {
  compute_evs=1;
  if(myverbose!=0) printf("Compute Eigenvalues in invert.");
}
<COMPUTEEVS>no {
  compute_evs=0;
  if(myverbose!=0) printf("Do not compute Eigenvalues in invert.");
}
<COMPUTEEVS>readin {
  compute_evs=2;
  if(myverbose!=0) printf("Try to only read in eigenvalues and vectors in invert.");
}
<COMPUTEMN>yes {
  compute_modenumber=1;
  if(myverbose!=0) printf("Compute Mode Number using Spectral Projectors in invert.\n");
}
<COMPUTEMN>no {
  compute_modenumber=0;
  if(myverbose!=0) printf("Do not compute Mode Number using Spectral Projectors in invert.\n");
}
<COMPUTETS>yes {
  compute_topsus=1;
  if(myverbose!=0) printf("Compute Topological Susceptibility using Spectral Projectors in invert.\n");
}
<COMPUTETS>no {
  compute_topsus=0;
  if(myverbose!=0) printf("Do not compute Topological Susceptibility using Spectral Projectors in invert.\n");
}
<MSTARSQ>{FLT} {
  mstarsq = atof(yytext);
  if(myverbose!=0) printf("Mstar^2 = %f \n", mstarsq);
}
<NOSOURCESZ2>{DIGIT}+ {
  no_sources_z2 = atoi(yytext);
  if(myverbose!=0) printf("no of Z2 random sources used for the spectral projectors method = %d\n", no_sources_z2);
}
<SRCLOC>{DIGIT}+ {
  source_location=atoi(yytext);
  if(myverbose!=0) printf("source_location = %s\n",yytext);
}
<PRECEV>{FLT} {
  eigenvalue_precision = atof(yytext);
  if(myverbose!=0) printf("precision for eigenvalues = %e\n", eigenvalue_precision);
}
<NOEV>{DIGIT}+ {
  no_eigenvalues = atoi(yytext);
  if(myverbose!=0) printf("no of eigenvalues = %d\n", no_eigenvalues);
}
<SUBEVCG>yes {
  sub_evs_cg_flag = 1;
  if(myverbose!=0) printf("project out eigenvector subspace\n");
}
<SUBEVCG>no {
  sub_evs_cg_flag = 0;
  if(myverbose!=0) printf("Do no project out eigenvector subspace\n");
}
<EO>yes {
  even_odd_flag = 1;
  if(myverbose) printf("Use even/odd preconditioning\n");
}
<EO>no {
  even_odd_flag = 0;
  if(myverbose) printf("Do not use even/odd preconditioning\n");
}
<BC>yes {
  bc_flag = 1;
  if(verbose) printf("Schroedinger Functional bc\n");
}
<BC>no {
  bc_flag = 0;
  if(verbose) printf("Periodic bc\n");
}
<WRPROPFLAG>gwc {
  PropInfo.format = 10;
  if(myverbose!=0) fprintf(stderr, "GWC format no longer supported for writing propagators\n");
}
<WRPROPFLAG>cmi {
  PropInfo.format = 11;
  if(myverbose!=0) fprintf(stderr, "CM format no longer supported for writing propagators\n");
}
<WRPROPFLAG>DiracFermion_Sink {
  PropInfo.format = 0;
  if(myverbose!=0) printf("Propagator type: DiracFermion_Sinks\n");
}
<WRPROPFLAG>DiracFermion_Source_Sink_Pairs {
  PropInfo.format = 1;
  if(myverbose!=0) printf("Propagator type: DiracFermion_Source_Sink_Pairs\n");
}
<WRPROPFLAG>DiracFermion_ScalarSource_TwelveSink {
  PropInfo.format = 1;
  fprintf(stderr, "Propagator type: DiracFermion_ScalarSource_TwelveSink, not yet supported\n");
}
<WRPROPFLAG>DiracFermion_ScalarSource_FourSink {
  PropInfo.format = 1;
  fprintf(stderr, "Propagator type: DiracFermion_ScalarSource_FourSink, not yet supported\n");
}
<REWEIGH>yes {
  reweighting_flag = 1;
  if(myverbose!=0) fprintf(stderr, "Compute reweighting factor\n");
}
<REWEIGH>no {
  reweighting_flag = 0;
  if(myverbose!=0) fprintf(stderr, "Do not compute reweighting factor\n");
}
<REWSAMPLES>{DIGIT}+ {
  reweighting_samples = atoi(yytext);
  if(myverbose!=0) fprintf(stderr, "Number of reweighting samples set to %d\n", reweighting_samples);
}

<*>^# {
   comment_caller = YY_START;
   BEGIN(COMMENT);
}
<*>{SPC}*# {
   comment_caller = YY_START;
   BEGIN(COMMENT);
}
<COMMENT>[^\n]* {
  BEGIN(comment_caller);
}


<INITMONOMIAL,DETMONOMIAL,CLDETMONOMIAL,CLDETRATMONOMIAL,NDPOLYMONOMIAL,GAUGEMONOMIAL,SFGAUGEMONOMIAL,INTEGRATOR,INITINTEGRATOR,INITMEASUREMENT,PIONNORMMEAS,ONLINEMEAS,INITOPERATOR,TMOP,DBTMOP,OVERLAPOP,WILSONOP,CLOVEROP,POLYMONOMIAL,PLOOP,INITGPU,GPU>\n {
  line_of_file++;
}
<*>\n {
  line_of_file++;
  BEGIN(0);
}

<*>. {
  BEGIN(ERROR);
}
<ERROR>[^\t\n]* {
  fprintf(stderr, "Parsing error in line %d\nAborting...!\n", line_of_file);
  fprintf(stderr, "Could not make sense out off: %s\n", yytext);
  exit(1);
}


%%

/*
 * Dummy (but not dumb) routine - well, function
 */

int yywrap()
{
  return(1);
}

/*
 * This is the function to parse the input file.
 * default values for all paramters will be set
 * correspondig to settings in
 * default_input_values.h
 *
 * read_input expects the filename of the input file
 * as an input parameter.
 *
 * read_input returns 2 if the input file did not exist
 */

int read_input(char * conf_file){

  /********************************************
   * Setting default values!
   ********************************************/
  reread = 0;
#ifndef FIXEDVOLUME
  T_global = _default_T_global;
  L = _default_L;
  LX = _default_LX;
  LY = _default_LY;
  LZ = _default_LZ;
  g_Tbsf = _default_g_Tbsf;
  N_PROC_X = _default_N_PROC_X;
  N_PROC_Y = _default_N_PROC_Y;
  N_PROC_Z = _default_N_PROC_Z;
#endif
  propagator_comparison = 0;
  nb_cores = 1;

  nblocks_t = 1;
  nblocks_x = 1;
  nblocks_y = 1;
  nblocks_z = 1;

  dfl_field_iter = 80;
  dfl_poly_iter = 20;

  g_kappa = _default_g_kappa;
  g_acc_Ptilde = _default_g_acc_Ptilde;
  g_acc_Hfin = _default_g_acc_Hfin;
  g_rec_ev = _default_g_rec_ev;
  g_mubar = _default_g_mubar;
  g_epsbar = _default_g_epsbar;
  g_mu = _default_g_mu;
  g_c_sw = _default_c_sw;
  g_mu1 = _default_g_mu1;
  g_mu2 = _default_g_mu2;
  g_mu3 = _default_g_mu3;
  g_dbw2rand = 0;
  g_running_phmc = 0;
  g_beta = _default_g_beta;
  g_eta = _default_g_eta;
  g_N_s = _default_g_N_s;
  g_dflgcr_flag = _default_g_dflgcr_flag;
  random_seed = _default_random_seed;
  rlxd_level = _default_rlxd_level;
  startoption = _default_startoption;
  Ntherm = _default_Ntherm;
  Nmeas = _default_Nmeas;
  Nsave = _default_Nsave;
  write_cp_flag = _default_write_cp_flag;
  cp_interval = _default_cp_interval;
  nstore = _default_nstore;
  strcpy(rlxd_input_filename, _default_rlxd_input_filename);
  strcpy(gauge_input_filename, _default_gauge_input_filename);
  g_stdio_proc = _default_g_stdio_proc;
  index_start = _default_index_start;
  index_end = _default_index_end;
  ITER_MAX_CG = _default_ITER_MAX_CG;
  ITER_MAX_BCG = _default_ITER_MAX_BCG;
  X0 = _default_X0;
  X1 = _default_X1;
  X2 = _default_X2;
  X3 = _default_X3;
  g_rgi_C1 = _default_g_rgi_C1;
  g_Ct = _default_g_Ct;
  g_Cs = _default_g_Cs;
  g_C1ss = _default_g_C1ss;
  g_C1tss = _default_g_C1tss;
  g_C1tts = _default_g_C1tts;
  read_source_flag= _default_read_source_flag;
  if(SourceInfo.basename == NULL) SourceInfo.basename = (char*)malloc(100*sizeof(char));
  strcpy(SourceInfo.basename, _default_source_filename);
  if(PropInfo.basename == NULL) PropInfo.basename = (char*)malloc(100*sizeof(char));
  strcpy(PropInfo.basename, _default_source_filename);
  PropInfo.splitted = _default_propagator_splitted;
  SourceInfo.splitted = _default_source_splitted;
  g_relative_precision_flag = _default_g_relative_precision_flag;
  return_check_flag = _default_return_check_flag;
  return_check_interval = _default_return_check_interval;
  g_debug_level = _default_g_debug_level;
  SourceInfo.t = _default_source_time_slice;
  SourceInfo.automaticTS = _default_automaticTS;
  gmres_m_parameter = _default_gmres_m_parameter;
  gmresdr_nr_ev = _default_gmresdr_nr_ev;
  g_no_extra_masses = _default_g_no_extra_masses;
  gauge_precision_read_flag = _default_gauge_precision_read_flag;
  gauge_precision_write_flag = _default_gauge_precision_write_flag;
  g_disable_IO_checks = _default_g_disable_IO_checks;
  reproduce_randomnumber_flag = _default_reproduce_randomnumber_flag;
  g_sloppy_precision_flag = _default_g_sloppy_precision_flag;
  use_stout_flag = _default_use_stout_flag;
  use_preconditioning = _default_use_preconditioning;
  stout_rho = _default_stout_rho;
  stout_no_iter = _default_stout_no_iter;
  /* check for reread ! */
  phmc_compute_evs = _default_phmc_compute_evs;
  compute_evs = _default_compute_evs;
  stilde_min = _default_stilde_min;
  stilde_max = _default_stilde_max;
  degree_of_p = _default_degree_of_p;
  source_location = _default_source_location;
  eigenvalue_precision = _default_eigenvalue_precision;
  no_eigenvalues = _default_no_eigenvalues;
  sub_evs_cg_flag = _default_sub_evs_cg_flag;
  phmc_exact_poly = _default_phmc_exact_poly;
  even_odd_flag = _default_even_odd_flag;
  bc_flag = _default_bc_flag;
  SourceInfo.type = _default_source_type_flag;
  no_samples = _default_no_samples;
  compute_modenumber = _default_compute_modenumber;
  compute_topsus = _default_compute_topsus;
  mstarsq = _default_mstarsq;
  no_sources_z2 = _default_no_sources_z2;
  device_num = _default_device_num;
  /* Put -1 in PropInfo.format to see if parse_config() will
  change the value. If not then set it to source_format_flag */
  PropInfo.format = -1;
  /********************************************/

  if(verbose && g_proc_id == 0) {
    myverbose = 1;
  }
  if ((yyin = fopen(conf_file, "rt")) == NULL){
    return(2);
  }
  yyout = fopen("/dev/null", "w");

  parse_config();
#ifndef FIXEDVOLUME
  if(LX == 0) {
    LX = L;
  }
  if(LY == 0) {
    LY = L;
  }
  if(LZ == 0) {
    LZ = L;
  }
#endif

  if(PropInfo.format == -1) PropInfo.format = SourceInfo.format;
  g_rgi_C0 = 1. - 8.*g_rgi_C1;


  fclose(yyout);
  fclose(yyin);
  return(0);
}


/*
 * This is the function to parse the input file
 * again. Only parameters are changed, that
 * are specified in the input file.
 * default values for paramters will not be set.
 *
 * reread_input expects the filename of the input file
 * as an input parameter.
 *
 * reread_input returns 2 if the input file did not exist
 */

int reread_input(char * conf_file){
#ifndef FIXEDVOLUME
  int tt=T, ll=L, lx = LX, ly = LY, lz = LZ,
      np=N_PROC_X, npy = N_PROC_Y;
#endif
  int nst=nstore;

  if(verbose && g_proc_id == 0) {
    myverbose = 1;
  }
  current_monomial = -1;
  reread = 1;

  /********************************************
   * Setting default values!
   ********************************************/

  /********************************************/

  if ((yyin = fopen(conf_file, "rt")) == NULL){
    return(2);
  }
  yyout = fopen("/dev/null", "w");

  parse_config();

#ifndef FIXEDVOLUME
  T = tt;
  L = ll;
  LX = lx;
  LY = ly;
  LZ = lz;
  N_PROC_X = np;
  N_PROC_Y = npy;
#endif


  if(g_dbw2rand == 0) {
    g_rgi_C1 = 0.;
  }
  nstore = nst;

  g_rgi_C0 = 1. - 8.*g_rgi_C1;
  g_mu = g_mu1;

  fclose(yyout);
  fclose(yyin);
  return(0);
}
Something went wrong with that request. Please try again.