-
Notifications
You must be signed in to change notification settings - Fork 49
Expand file tree
/
Copy pathread_input.l
More file actions
3860 lines (3668 loc) · 133 KB
/
read_input.l
File metadata and controls
3860 lines (3668 loc) · 133 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
/***********************************************************************
*
* Copyright (C) 2002,2003,2004,2005,2006,2007,2008,2021 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 set to be case insensitive!
*
* the c source file is automatically updated via `make`
* flex -Ptmlqcd -i -t read_input.l > read_input.c
*
* Autor: Carsten Urbach
* urbach@hiskp.uni-bonn.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]+
STRLIST [0-9,\-\._a-zA-Z\ \t]*
EQL {SPC}*={SPC}*
%{
#ifdef HAVE_CONFIG_H
# include<tmlqcd_config.h>
#endif
#include<stdlib.h>
#include<stdio.h>
#include<string.h>
#define INIT_GLOBALS
#include"global.h"
#include"read_input.h"
#include"default_input_values.h"
#include"monomial/monomial.h"
#include"solver/solver_types.h"
#include"meas/measurements.h"
#include"integrator.h"
#include"operator.h"
#include"phmc.h"
#include<io/params.h>
#include "qphix_types.h"
#include "quda_types.h"
#include "misc_types.h"
#include <ctype.h>
#define ERR_MSG_LEN 500
// some general parsing helpers
static 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';
}
/* tokenize the comma-delimited list 'input' of the form
'list = token1, token2, ...'
and return the first token, which is the name of the list
via the 'paramname' parameter
'input' is copied and the memory pointed to by 'input_copy' has to be
freed after all operations on this particular input string have completed.
the length of the array holding 'paramname' parameter must be passed */
static inline void strlist_tokenize(char const * const input,
char ** input_copy,
char * const paramname,
const int paramname_length)
{
char error_message[ERR_MSG_LEN];
char * token = (char*)NULL;
const int input_length = strlen(input) + 1;
if( input_length > 20000 ){
yy_fatal_error("Likely overflow bug in 'strlist_tokenize' of 'read_input.l'.\n"
"Encountered string of length exceeding 20k characters!\n");
}
(*input_copy) = malloc(input_length);
if( (*input_copy) == NULL ){
yy_fatal_error("Could not allocate memory for 'input_copy' in 'strlist_tokenize' of 'read_input.l'!\n");
}
strncpy((*input_copy), input, input_length);
// the first token is the parameter name, we will return it,
// note that we include space and tab as characters to be omitted
// but first check if tokenization was successful
token = strtok((*input_copy), "= \t");
if( (void*)token == NULL ){
snprintf(error_message, ERR_MSG_LEN, "Unable to parse '%s' in strlist_tokenize!\n", paramname);
yy_fatal_error(error_message);
} else {
// return what we parsed
snprintf(paramname, paramname_length, "%s", token);
}
}
/* obtain the next token in the list of comma-separated strings
'list_end' is a parameter which is set to 1 if the end of the list is reached
'token' will hold the value of the token
'token_length' is the length of the array to which the token should be written */
static inline void strlist_next_token(int * const list_end, char * const token_out, const int token_length){
char * token = (char*)NULL;
token = strtok(NULL,", \t=");
if( (void*)token == NULL ){
*list_end = 1;
} else {
*list_end = 0;
snprintf(token_out, token_length, "%s", token);
}
}
/* when the list of tokens is a list of doubles or integers, this function
can be used to obtain the next token in the list directly as a double
'list_end' is a parameter which is set to 1 if the end of the list
has been reached */
static inline double fltlist_next_token(int * const list_end){
double retval;
char * token = (char*)NULL;
token = strtok(NULL,", \t=");
if( (void*)token == NULL ){
*list_end = 1;
return(0.0);
} else {
*list_end = 0;
sscanf(token,"%lf",&retval);
return(retval);
}
}
/* 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 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;
double mixcg_innereps;
int mixcg_maxinnersolverit;
int propagator_comparison;
int nb_cores;
int omp_num_threads;
int nblocks_t;
int nblocks_x;
int nblocks_y;
int nblocks_z;
int dfl_field_iter;
int dfl_poly_iter;
double kappa_dflgen;
double mu_dflgen;
double kappa_dfl;
double mu_dfl;
double kappa_Msap;
double mu_Msap;
int use_preconditioning;
int g_barrier_monomials_convergence;
/* macro control over read_input.l is poor. In order to support compilation without
* a given external library, we need to have these declared here as a dummy.
* Note that no parameters will actually be passed, the input file reader will
* terminate the program if one attempts to set the parameters but tmLQCD has
* been compiled without the interface in question. */
#ifdef TM_USE_QUDA
extern tm_QudaParams_t quda_input;
#else
tm_QudaParams_t quda_input;
#endif
#ifdef TM_USE_QPHIX
extern tm_QPhiXParams_t qphix_input;
#else
tm_QPhiXParams_t qphix_input;
#endif
// specific parsing helpers
static inline void parse_quda_mg_blocksize(char const * const input, const int dim){
char paramname[100];
char error_message[ERR_MSG_LEN];
int list_end = 0;
int level = 0;
int blocksize = 0;
char * input_copy = (char*)NULL;
strlist_tokenize(input, &input_copy, paramname, 100);
blocksize = (int)fltlist_next_token(&list_end);
while( list_end != 1 ){
if( level >= QUDA_MAX_MG_LEVEL ){
snprintf(error_message, ERR_MSG_LEN, "Exceeded maximum number of levels (%d-1) parsing %s!\n", QUDA_MAX_MG_LEVEL, paramname);
yy_fatal_error(error_message);
}
quda_input.mg_blocksize[level][dim] = blocksize;
if(myverbose){
printf(" %s, level %d set to %d line %d\n", paramname,
level, quda_input.mg_blocksize[level][dim], line_of_file);
}
level++;
blocksize = (int)fltlist_next_token(&list_end);
}
free(input_copy);
}
static inline void parse_quda_mg_int_par_array(char const * const input, int * par_array){
char paramname[100];
char error_message[ERR_MSG_LEN];
int list_end = 0;
int level = 0;
char * input_copy = (char*)NULL;
strlist_tokenize(input, &input_copy, paramname, 100);
int parval = (int)fltlist_next_token(&list_end);
while( list_end != 1 ){
if( level >= QUDA_MAX_MG_LEVEL ){
snprintf(error_message, ERR_MSG_LEN, "Exceeded maximum number of levels (%d) parsing %s!\n", QUDA_MAX_MG_LEVEL, paramname);
yy_fatal_error(error_message);
}
par_array[level] = parval;
if(myverbose){
printf(" %s, level %d set to %d line %d\n", paramname,
level, par_array[level], line_of_file);
}
level++;
parval = (int)fltlist_next_token(&list_end);
}
free(input_copy);
}
static inline void parse_quda_mg_dbl_par_array(char const * const input, double * par_array){
char paramname[100];
char error_message[ERR_MSG_LEN];
int list_end = 0;
int level = 0;
char * input_copy = (char*)NULL;
strlist_tokenize(input, &input_copy, paramname, 100);
double parval = fltlist_next_token(&list_end);
while( list_end != 1 ){
if( level >= QUDA_MAX_MG_LEVEL ){
snprintf(error_message, ERR_MSG_LEN, "Exceeded maximum number of levels (%d) parsing %s!\n", QUDA_MAX_MG_LEVEL, paramname);
yy_fatal_error(error_message);
}
par_array[level] = parval;
if(myverbose){
printf(" %s, level %d set to %e line %d\n", paramname,
level, par_array[level], line_of_file);
}
level++;
parval = fltlist_next_token(&list_end);
}
free(input_copy);
}
static inline void parse_quda_mg_bool_par_array(char const * const input, int * par_array){
char paramname[100];
char token[100];
char error_message[ERR_MSG_LEN];
int list_end = 0;
int level = 0;
char * input_copy = (char*)NULL;
strlist_tokenize(input, &input_copy, paramname, 100);
strlist_next_token(&list_end, token, 100);
while( list_end != 1 ){
if( level >= QUDA_MAX_MG_LEVEL ){
snprintf(error_message, ERR_MSG_LEN, "Exceeded maximum number of levels (%d) parsing %s!\n", QUDA_MAX_MG_LEVEL, paramname);
yy_fatal_error(error_message);
}
for(int i = 0; token[i]; i++){
token[i] = tolower(token[i]);
}
if( strcmp(token, "yes") == 0 ){
par_array[level] = QUDA_BOOLEAN_YES;
}
else if( strcmp(token, "no") == 0 ){
par_array[level] = QUDA_BOOLEAN_NO;
}
else {
snprintf(error_message, ERR_MSG_LEN, "ERROR: Only 'yes' and 'no' are possible for %s!\n", paramname);
yy_fatal_error(error_message);
}
if(myverbose) printf(" %s on level %d set to '%s' line %d\n", paramname, level, token, line_of_file);
level++;
strlist_next_token(&list_end, token, 100);
}
free(input_copy);
}
static inline void parse_quda_mg_verbosity_par_array(char const * const input, QudaVerbosity * par_array){
char paramname[100];
char token[100];
char error_message[ERR_MSG_LEN];
int list_end = 0;
int level = 0;
char * input_copy = (char*)NULL;
strlist_tokenize(input, &input_copy, paramname, 100);
strlist_next_token(&list_end, token, 100);
while( list_end != 1 ){
if( level >= QUDA_MAX_MG_LEVEL ){
snprintf(error_message, ERR_MSG_LEN, "Exceeded maximum number of levels (%d) parsing %s!\n", QUDA_MAX_MG_LEVEL, paramname);
yy_fatal_error(error_message);
}
for(int i = 0; token[i]; i++){
token[i] = tolower(token[i]);
}
if( strcmp(token, "silent") == 0 ){
par_array[level] = QUDA_SILENT;
}
else if( strcmp(token, "summarize") == 0 ){
par_array[level] = QUDA_SUMMARIZE;
}
else if( strcmp(token, "verbose") == 0 ){
par_array[level] = QUDA_VERBOSE;
}
else if( strcmp(token, "debug_verbose") == 0 ){
par_array[level] = QUDA_DEBUG_VERBOSE;
}
else {
snprintf(error_message, ERR_MSG_LEN,
"ERROR: Unknown verbosity level '%s' for '%s'!"
" Only 'silent', 'summarize', 'verbose' and 'debug_verbose' supported!\n",
token, paramname);
yy_fatal_error(error_message);
}
if(myverbose) printf(" %s on level %d set to '%s' line %d\n", paramname, level, token, line_of_file);
level++;
strlist_next_token(&list_end, token, 100);
}
free(input_copy);
}
static inline void parse_quda_mg_polybasis_par_array(char const * const input, QudaPolynomialBasis * par_array){
char paramname[100];
char token[100];
char error_message[ERR_MSG_LEN];
int list_end = 0;
int level = 0;
char * input_copy = (char*)NULL;
strlist_tokenize(input, &input_copy, paramname, 100);
strlist_next_token(&list_end, token, 100);
while( list_end != 1 ){
if( level >= QUDA_MAX_MG_LEVEL ){
snprintf(error_message, ERR_MSG_LEN, "Exceeded maximum number of levels (%d) parsing %s!\n", QUDA_MAX_MG_LEVEL, paramname);
yy_fatal_error(error_message);
}
for(int i = 0; token[i]; i++){
token[i] = tolower(token[i]);
}
if( strcmp(token, "power") == 0 ){
par_array[level] = QUDA_POWER_BASIS;
}
else if( strcmp(token, "chebyshev") == 0 ){
par_array[level] = QUDA_CHEBYSHEV_BASIS;
}
else {
snprintf(error_message, ERR_MSG_LEN,
"ERROR: Unknown CA basis '%s' for '%s'!"
" Only 'power' and 'chebyshev' supported!\n",
token, paramname);
yy_fatal_error(error_message);
}
if(myverbose) printf(" %s on level %d set to '%s' line %d\n", paramname, level, token, line_of_file);
level++;
strlist_next_token(&list_end, token, 100);
}
free(input_copy);
}
%}
%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 DSBLSRCIOCHECK
%x PRECON
%x WRITECP
%x CPINT
%x NSTORE
%x TT
%x LL
%x LLX
%x LLY
%x LLZ
%x NPROCX
%x NPROCY
%x NPROCZ
%x IOPROC
%x IDX
%x BOUNDT
%x BOUNDX
%x BOUNDY
%x BOUNDZ
%X READSOURCE
%x SOURCEFORMAT
%x SOURCEFILE
%x PROPFILE
%x SOURCETS
%x SOURCETYPE
%x PROPSPLIT
%x NOSAMPLES
%x RELPREC
%x STRICTRESIDUALCHECK
%x REVCHECK
%x REVINT
%x DEBUG
%x GMRESM
%x GMRESDRNEV
%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 ORIENTEDPLAQUETTESMEAS
%x GRADIENTFLOWMEAS
%x REWEIGH
%x REWSAMPLES
%x INITINTEGRATOR
%x INTEGRATOR
%x DEFLATION
%x INITDEFLATION
%x MULTIGRID
%x INITMULTIGRID
%x INITOPERATOR
%x TMOP
%x DBTMOP
%x WILSONOP
%x OVERLAPOP
%x CLOVEROP
%x DBCLOVEROP
%x TMSOLVER
%x DBTMSOLVER
%x CSWSOLVER
%x OVSOLVER
%x INITMONOMIAL
%x DETMONOMIAL
%x CLDETMONOMIAL
%x CLDETRATMONOMIAL
%x CLDETRATRWMONOMIAL
%x GAUGEMONOMIAL
%x NDPOLYMONOMIAL
%x NDRATMONOMIAL
%x RATMONOMIAL
%x CLRATMONOMIAL
%x RATCORMONOMIAL
%x CLRATCORMONOMIAL
%x NDCLRATMONOMIAL
%x NDRATCORMONOMIAL
%x NDDETRATMONOMIAL
%x NDCLDETRATMONOMIAL
%x NDCLRATCORMONOMIAL
%x POLYMONOMIAL
%x CLPOLYMONOMIAL
%x MNAME
%x MCSTR
%x MSOLVER
%x RATMSOLVER
%x NDMSOLVER
%x GTYPE
%x COMMENT
%x ERROR
%x PCOMP
%x NBCORES
%x OMPNUMTHREADS
%x DFLNBLOCKT
%x DFLNBLOCKX
%x DFLNBLOCKY
%x DFLNBLOCKZ
%x DFLFIELDITER
%x DFLPOLYITER
%x PRECONDITIONING
%x QUDAINVERTER
%x QPHIXINVERTER
%x COMPRESSION
%x MIXCGEPS
%x MIXCGIT
%x LOWMEM
%x SUBPROCESS
%x INITEXTERNALINVERTER
%x BARRIER_MONOMIALS_CONVERGE
%%
^SourceFilename{EQL} BEGIN(SOURCEFILE);
^PropagatorFilename{EQL} BEGIN(PROPFILE);
^T{EQL} BEGIN(TT);
^L{EQL} BEGIN(LL);
^LX{EQL} BEGIN(LLX);
^LY{EQL} BEGIN(LLY);
^LZ{EQL} BEGIN(LLZ);
^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);
^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);
^StrictResidualCheck{EQL} BEGIN(STRICTRESIDUALCHECK);
^ReversibilityCheck{EQL} BEGIN(REVCHECK);
^ReversibilityCheckIntervall{EQL} BEGIN(REVINT);
^DebugLevel{EQL} BEGIN(DEBUG);
^GMRESMParameter{EQL} BEGIN(GMRESM);
^GMRESDRNrEv{EQL} BEGIN(GMRESDRNEV);
^GaugeConfigReadPrecision{EQL} BEGIN(GAUGERPREC);
^GaugeConfigWritePrecision{EQL} BEGIN(GAUGEWPREC);
^DisableIOChecks{EQL} BEGIN(DSBLIOCHECK);
^DisableGaugeIOChecks{EQL} BEGIN(DSBLIOCHECK);
^DisableSourceIOChecks{EQL} BEGIN(DSBLSRCIOCHECK);
^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);
^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);
^UseCompression{EQL} BEGIN(COMPRESSION);
^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);
^BeginExternalInverter{SPC}+ BEGIN(INITEXTERNALINVERTER);
^PropagatorComparison{EQL} BEGIN(PCOMP);
^NbCoresPerNode{EQL} BEGIN(NBCORES);
^OMPNumThreads{EQL} BEGIN(OMPNUMTHREADS);
^NoBlocksT{EQL} BEGIN(DFLNBLOCKT);
^NoBlocksX{EQL} BEGIN(DFLNBLOCKX);
^NoBlocksY{EQL} BEGIN(DFLNBLOCKY);
^NoBlocksZ{EQL} BEGIN(DFLNBLOCKZ);
^DflFieldIter{EQL} BEGIN(DFLFIELDITER);
^DflPolyIter{EQL} BEGIN(DFLPOLYITER);
^BeginDeflation BEGIN(INITDEFLATION);
^BeginDDalpha BEGIN(INITMULTIGRID);
^MixCGInnerEps{EQL} BEGIN(MIXCGEPS);
^MixCGMaxIter{EQL} BEGIN(MIXCGIT);
^EnableLowmem{EQL} BEGIN(LOWMEM);
^EnableSubprocess{EQL} BEGIN(SUBPROCESS);
^BarrierMonomialsConverge{EQL} BEGIN(BARRIER_MONOMIALS_CONVERGE);
<INITDEFLATION>Init{SPC}* {
if(myverbose) printf("Initialising DEFLATION line %d\n", line_of_file);
BEGIN(DEFLATION);
}
<DEFLATION>{
{SPC}*DeflationSubspaceDimension{EQL}{DIGIT}+ {
sscanf(yytext, " %[2a-zA-Z] = %d", name, &a);
g_N_s = a;
if(myverbose) printf("Number of global approximate eigenvectors (deflation subspace dimension) set to %d line %d\n", a, line_of_file);
}
{SPC}*NiterMsap{EQL}{DIGIT}+ {
sscanf(yytext, " %[2a-zA-Z] = %d", name, &a);
NiterMsap = a;
if(myverbose) printf("NiterMsap for solver preconditioner set to %d line %d\n", a, line_of_file);
}
{SPC}*NcycleMsap{EQL}{DIGIT}+ {
sscanf(yytext, " %[2a-zA-Z] = %d", name, &a);
NcycleMsap = a;
if(myverbose) printf("NcycleMsap for solver preconditioner set to %d line %d\n", a, line_of_file);
}
{SPC}*KappaMsap{EQL}{FLT}+ {
sscanf(yytext, " %[2a-zA-Z] = %lf", name, &c);
kappa_Msap = c;
if(myverbose) printf("kappa for Msap preconditioner set to %e line %d\n", c, line_of_file);
}
{SPC}*2KappaMuMsap{EQL}{FLT}+ {
sscanf(yytext, " %[2a-zA-Z] = %lf", name, &c);
mu_Msap = c;
if(myverbose) printf("2KappaMu for Msap preconditioner set to %e line %d\n", c, line_of_file);
}
{SPC}*NiterMsapSubspace{EQL}{DIGIT}+ {
sscanf(yytext, " %[2a-zA-Z] = %d", name, &a);
NiterMsap_dflgen = a;
if(myverbose) printf("NiterMsapDfl for subspace generation set to %d line %d\n", a, line_of_file);
}
{SPC}*NcycleMsapSubspace{EQL}{DIGIT}+ {
sscanf(yytext, " %[2a-zA-Z] = %d", name, &a);
NcycleMsap_dflgen = a;
if(myverbose) printf("NcycleMsapDfl for subspace generation set to %d line %d\n", a, line_of_file);
}
{SPC}*NsmoothSubspace{EQL}{DIGIT}+ {
sscanf(yytext, " %[2a-zA-Z] = %d", name, &a);
NsmoothMsap_dflgen = a;
if(myverbose) printf("NsmoothMsapDfl for subspace generation set to %d line %d\n", a, line_of_file);
}
{SPC}*LittleGMRESMParameter{EQL}{DIGIT}+ {
sscanf(yytext, " %[2a-zA-Z] = %d", name, &a);
little_gmres_m_parameter = a;
if(myverbose) printf("LittleGMRESMParameter set to %d line %d\n", a, line_of_file);
}
{SPC}*LittleSolverLowPrecision{EQL}{FLT} {
sscanf(yytext, " %[2a-zA-Z] = %lf", name, &c);
little_solver_low_prec = c;
if(myverbose) printf("Low precision for little Dirac solver set to %e line %d\n", c, line_of_file);
}
{SPC}*LittleSolverHighPrecision{EQL}{FLT} {
sscanf(yytext, " %[2a-zA-Z] = %lf", name, &c);
little_solver_high_prec = c;
if(myverbose) printf("High precision for little Dirac solver set to %e line %d\n", c, line_of_file);
}
{SPC}*LittleSolverMaxIter{EQL}{DIGIT}+ {
sscanf(yytext, " %[2a-zA-Z] = %d", name, &a);
little_solver_max_iter = a;
if(myverbose) printf("LittleSolverMaxIter set to %d line %d\n", a, line_of_file);
}
{SPC}*LittleSolver{EQL}(gcr|mcr|mr|fgmres) {
little_solver = 0;
if(myverbose) printf("Littlesolver set to gcr in line %d (currently no other solver available)\n", line_of_file);
}
{SPC}*useLittleLittleD{EQL}yes {
usePL = 1;
if(myverbose) printf("UsePL set to true line %d\n", line_of_file);
}
{SPC}*useLittleLittleD{EQL}no {
usePL = 0;
if(myverbose) printf("UsePL set to true line %d\n", line_of_file);
}
{SPC}*LittleEvenOdd{EQL}yes {
little_evenodd = 1;
if(myverbose) printf("LittleEvenOdd set to true line %d\n", line_of_file);
}
{SPC}*LittleEvenOdd{EQL}no {
little_evenodd = 0;
if(myverbose) printf("LittleEvenOdd set to true line %d\n", line_of_file);
}
{SPC}*KappaSubspace{EQL}{FLT} {
sscanf(yytext, " %[2a-zA-Z] = %lf", name, &c);
kappa_dflgen = c;
if(myverbose) printf("kappa for subspace generation set to %e line %d\n", c, line_of_file);
}
{SPC}*2KappaMuSubspace{EQL}{FLT} {
sscanf(yytext, " %[2a-zA-Z] = %lf", name, &c);
mu_dflgen = c;
if(myverbose) printf("2KappaMu for subspace generation set to %e line %d\n", c, line_of_file);
}
{SPC}*kappa{EQL}{FLT} {
sscanf(yytext, " %[2a-zA-Z] = %lf", name, &c);
kappa_dfl = c;
if(myverbose) printf("kappa for preconditioner set to %e line %d\n", c, line_of_file);
}
{SPC}*2KappaMu{EQL}{FLT} {
sscanf(yytext, " %[2a-zA-Z] = %lf", name, &c);
mu_dfl = c;
if(myverbose) printf("2KappaMu for preconditioner set to %e line %d\n", c, line_of_file);
}
EndDeflationInit{SPC}* {
if(myverbose) printf("DEFLATION parsed in line %d\n\n", line_of_file);
BEGIN(0);
}
}
<INITMULTIGRID>AMG{SPC}* {
#ifdef DDalphaAMG
if(myverbose) printf("Initialising DDalphaAMG line %d\n", line_of_file);
BEGIN(MULTIGRID);
#else
printf("ERROR line %d: DDalphaAMG library not included\n", line_of_file);
exit(1);
#endif
}
<MULTIGRID>{
{SPC}*MGSetupIter{EQL}{DIGIT}+ {
sscanf(yytext, " %[a-zA-Z] = %d", name, &a);
mg_setup_iter=a;
if(myverbose) printf(" MG_Setup_Iter set to %d line %d operator %d\n", mg_setup_iter, line_of_file, current_operator);
}
{SPC}*MGCoarseSetupIter{EQL}{DIGIT}+ {
sscanf(yytext, " %[a-zA-Z] = %d", name, &a);
mg_coarse_setup_iter=a;
if(myverbose) printf(" MG_Coarse_Setup_Iter set to %d line %d operator %d\n", mg_coarse_setup_iter, line_of_file, current_operator);
}
{SPC}*MGNumberOfVectors{EQL}{DIGIT}+ {
sscanf(yytext, " %[a-zA-Z] = %d", name, &a);
mg_Nvec=a;
if(myverbose) printf(" MGNumberOfVectors set to %d line %d operator %d\n", mg_Nvec, line_of_file, current_operator);
}
{SPC}*MGNumberOfLevels{EQL}{DIGIT}+ {
sscanf(yytext, " %[a-zA-Z] = %d", name, &a);
mg_lvl=a;
if(myverbose) printf(" MGNumberOfLevels set to %d line %d operator %d\n", mg_lvl, line_of_file, current_operator);
}
{SPC}*MGBlockX{EQL}{DIGIT}+ {
sscanf(yytext, " %[a-zA-Z] = %d", name, &a);
mg_blk[3]=a;
if(myverbose) printf(" MGBlockX set to %d line %d operator %d\n", mg_blk[3], line_of_file, current_operator);
}
{SPC}*MGBlockY{EQL}{DIGIT}+ {
sscanf(yytext, " %[a-zA-Z] = %d", name, &a);
mg_blk[2]=a;
if(myverbose) printf(" MGBlockY set to %d line %d operator %d\n", mg_blk[2], line_of_file, current_operator);
}
{SPC}*MGBlockZ{EQL}{DIGIT}+ {
sscanf(yytext, " %[a-zA-Z] = %d", name, &a);
mg_blk[1]=a;
if(myverbose) printf(" MGBlockZ set to %d line %d operator %d\n", mg_blk[1], line_of_file, current_operator);
}
{SPC}*MGBlockT{EQL}{DIGIT}+ {
sscanf(yytext, " %[a-zA-Z] = %d", name, &a);
mg_blk[0]=a;
if(myverbose) printf(" MGBlockT set to %d line %d operator %d\n", mg_blk[0], line_of_file, current_operator);
}
{SPC}*MGSetup2KappaMu{EQL}{FLT}+ {
sscanf(yytext, " %[2a-zA-Z] = %lf", name, &c);
mg_setup_mu=c;
mg_setup_mu_set=1;
if(myverbose) printf(" MGSetup2KappaMu set to %.16f line %d operator %d\n", mg_setup_mu, line_of_file, current_operator);
}
{SPC}*MGCoarseMuFactor{EQL}{FLT}+ {
sscanf(yytext, " %[a-zA-Z] = %lf", name, &c);
mg_cmu_factor=c;
if(myverbose) printf(" MGCoarseMuFactor set to %.16f line %d operator %d\n", mg_cmu_factor, line_of_file, current_operator);
}
{SPC}*MGMixedPrecision{EQL}yes {
mg_mixed_prec = 1;
if(myverbose) printf(" MGMixedPrecision set to YES line %d operator %d\n", line_of_file, current_operator);
}
{SPC}*MGMixedPrecision{EQL}no {
mg_mixed_prec = 0;
if(myverbose) printf(" MGMixedPrecision set to NO line %d operator %d\n", line_of_file, current_operator);
}
{SPC}*MGdtauUpdate{EQL}{FLT}+ {
sscanf(yytext, " %[a-zA-Z] = %lf", name, &c);
mg_dtau_update=c;
if(myverbose) printf(" MGdtauUpdate set to %.16f line %d operator %d\n", mg_dtau_update, line_of_file, current_operator);
}
{SPC}*MGrhoUpdate{EQL}{FLT}+ {
sscanf(yytext, " %[a-zA-Z] = %lf", name, &c);
mg_rho_update=c;
if(myverbose) printf(" MG_rho_Update set to %.16f line %d operator %d\n", mg_rho_update, line_of_file, current_operator);
}
{SPC}*MGUpdateSetupIter{EQL}{DIGIT}+ {
sscanf(yytext, " %[a-zA-Z] = %d", name, &a);
mg_update_setup_iter=a;
if(myverbose) printf(" MG_Update_Setup_Iter set to %d line %d operator %d\n", mg_update_setup_iter, line_of_file, current_operator);
}
{SPC}*MGOMPNumThreads{EQL}{DIGIT}+ {
sscanf(yytext, " %[a-zA-Z] = %d", name, &a);
mg_omp_num_threads=a;
if(myverbose) printf(" MG_omp_num_threads set to %d line %d operator %d\n", mg_omp_num_threads, line_of_file, current_operator);
}
{SPC}*MGNumberOfShifts{EQL}{DIGIT}+ {
sscanf(yytext, " %[a-zA-Z] = %d", name, &a);
mg_no_shifts=a;
// when the number of shifts is specified, mg_mss_mass must be set to zero!
mg_mms_mass=0;
if(myverbose) printf(" MG_Num_of_shifts set to %d line %d operator %d\n", mg_no_shifts, line_of_file, current_operator);
}
{SPC}*MGMMSMass{EQL}{FLT}+ {
sscanf(yytext, " %[a-zA-Z] = %lf", name, &c);
mg_mms_mass=c;
// when mg_mms_mass is specified, mg_no_shifts should be set to zero!
mg_no_shifts=0;
if(myverbose) printf(" MG_MMS_Mass set to %.16f line %d operator %d\n", mg_mms_mass, line_of_file, current_operator);
}
EndDDalphaAMG{SPC}* {
if(myverbose) printf("DDalphaAMG 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, "DBCLOVER")==0) {
optr->type = DBCLOVER;
}
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);