@@ -52,19 +52,16 @@ static struct option long_options[] = {
52
52
{"max-threads" , required_argument , 0 , 171 },
53
53
{"list-omitted-molecules" , no_argument , 0 , 172 },
54
54
{"extra-precise" , no_argument , 0 , 173 },
55
- {"de -pop-size" , required_argument , 0 , 180 },
55
+ {"om -pop-size" , required_argument , 0 , 180 },
56
56
{"de-f" , required_argument , 0 , 181 },
57
57
{"de-cr" , required_argument , 0 , 182 },
58
- {"de-iters-max" , required_argument , 0 , 183 },
59
- {"de-time-max" , required_argument , 0 , 184 },
58
+ {"om-iters-max" , required_argument , 0 , 183 },
60
59
{"de-dither" , no_argument , 0 , 186 },
61
- {"de-fix-kappa" ,required_argument , 0 , 188 },
62
- {"de-threads" ,required_argument , 0 , 189 },
63
- {"de-polish" , required_argument , 0 , 190 },
64
- {"gm-size" , required_argument , 0 , 191 },
60
+ {"om-fix-kappa" ,required_argument , 0 , 188 },
61
+ {"om-threads" ,required_argument , 0 , 189 },
62
+ {"om-polish" , required_argument , 0 , 190 },
65
63
{"gm-iterations-beg" , required_argument , 0 , 192 },
66
64
{"gm-iterations-end" , required_argument , 0 , 193 },
67
- {"gm-threads" , required_argument , 0 , 194 },
68
65
{NULL , 0 , 0 , 0 }
69
66
};
70
67
@@ -96,15 +93,13 @@ void s_init(void) {
96
93
s .mutation_constant = -1 ;
97
94
s .dither = 0 ;
98
95
s .fixed_kappa = -1 ;
99
- s .de_threads = 1 ;
100
- s .limit_de_iters = NO_LIMIT_ITERS ;
101
- s .limit_de_time = NO_LIMIT_TIME ;
96
+ s .om_threads = 1 ;
97
+ s .om_iters = NO_LIMIT_ITERS ;
98
+ s .om_time = NO_LIMIT_TIME ;
102
99
s .polish = -1 ; /* 0 off, 1 only result, 2 result + during evolve, 3 result, evolve and some structures in initial population */
103
- s .gm_size = 100 ;
104
- s .gm_iterations_beg = 1000 ;
105
- s .gm_iterations_end = 2000 ;
106
- s .gm_threads = 1 ;
107
- s .sort_by = SORT_R2 ;
100
+ s .gm_iterations_beg = 500 ;
101
+ s .gm_iterations_end = 500 ;
102
+ s .sort_by = SORT_NOT_SET ;
108
103
s .at_customization = AT_CUSTOM_ELEMENT_BOND ;
109
104
s .discard = DISCARD_OFF ;
110
105
s .tabu_size = 0.0f ;
@@ -149,20 +144,19 @@ static void print_help(void) {
149
144
printf (" --kappa VALUE use only one kappa VALUE for parameterization\n" );
150
145
printf (" --fs-precision VALUE resolution for the full scan (required)\n" );
151
146
printf (" --kappa-preset PRESET set kappa-max and fs-precision to safe values. Valid choices are: small, protein.\n" );
152
- printf ("Options specific to mode: params using differential evolution as calculation method\n" );
153
- printf (" --de-pop-size VALUE set population size for DE (optional).\n" );
154
- printf (" --de-iters-max COUNT set the maximum number of iterations for DE (optional).\n" );
155
- printf (" --de-time-max HH:MM:SS set the maximum time for DE in format hours:minutes:seconds (optional).\n" );
156
- printf (" --de-threads set number of threads for DE (optional).\n" );
147
+ printf ("Options specific to mode: params using optimization method (differential evolution, guided minimization)\n" );
148
+ printf (" --om-pop-size VALUE set population size for optimization method (optional).\n" );
149
+ printf (" --om-iters COUNT set the maximum number of iterations for optimization method (optional).\n" );
150
+ printf (" --om-threads set number of threads for optimization method (optional).\n" );
151
+ printf (" --om-polish VALUE apply local minimzation on parameters. Valid choices: 0 (off), 1 (result), 2 (during evolving), 3 (at the initial population). \n" );
152
+ printf ("Options specific to mode: params using differential evolution\n" );
157
153
printf (" --de-f VALUE set mutation constant for DE (optional).\n" );
158
154
printf (" --de-cr VALUE set crossover recombination constant for DE (optional).\n" );
159
155
printf (" --de-dither set the mutation constant to random value from [0.5;1] for ech iteration (optional).\n" );
160
- printf (" --de-polish VALUE apply polishing on parameters. Valid choices: 0 (off), 1 (result), 2 (during evolving), 3 (at the beginning). Strongly recommend to keep the default value.\n" );
161
156
printf (" --de-fix-kappa set kappa to one fixed value (optional).\n" );
162
- printf (" --gm-size set number of randomly generated vectors of parameters, those with reasonable stats will be minimized (optional). \n" );
157
+ printf ("Options specific to mode: params using guided minimization \n" );
163
158
printf (" --gm-iterations-beg set number of minimization iterations for each reasonable vector of parameters (optional).\n" );
164
159
printf (" --gm-iterations-end set number of minimization itertions for the best to polish the final result (optional).\n" );
165
- printf (" --gm-threads set number of threads used for parallel minimization (optional).\n" );
166
160
printf ("Other options:\n" );
167
161
printf (" --par-out-file FILE output the parameters to the FILE\n" );
168
162
printf (" -d, --discard METHOD perform discarding with METHOD. Valid choices are: iterative, simple and off. Default is off.\n" );
@@ -180,7 +174,7 @@ static void print_help(void) {
180
174
181
175
printf ("neemp -m params --sdf-file molecules.sdf --chg-file charges.chg --kappa-max 1.0 --fs-precision 0.2 --sort-by RMSD.\n\
182
176
Compute parameters for the given molecules in file molecules.sdf and ab-initio charges in charges.chg. Set maximum value for kappa to 1.0, step for the full scan to 0.2, no iterative refinement, sort results according to the relative mean square deviation.\n" );
183
- printf ("neemp -m params -p gm --sdf-file molecules.sdf --chg-file charges.chg --sort-by RMSD_avg --gm- size 250 -gm-iterations-beg 1000 -gm-iterations-end 500 --random-seed 1234 -vv.\n\
177
+ printf ("neemp -m params -p gm --sdf-file molecules.sdf --chg-file charges.chg --om-pop- size 50 -gm-iterations-beg 1000 -gm-iterations-end 500 --random-seed 1234 -vv.\n\
184
178
Compute parameters for the given molecules in file molecules.sdf and ab-initio charges in charges.chg. The chosen optimization method: guided minimization will create 250 vectors (each vector consists of all parameters) and minimized reasonably good ones for 1000 iterations. The best of them will be minimized again, for 500 iterations.\n" );
185
179
186
180
printf ("neemp -m charges --sdf-file molecules.sdf --par-file parameters --chg-out-file output.chg\n\
@@ -382,7 +376,7 @@ void parse_options(int argc, char **argv) {
382
376
s .recombination_constant = (float ) atof (optarg );
383
377
break ;
384
378
case 183 :
385
- s .limit_de_iters = atoi (optarg );
379
+ s .om_iters = atoi (optarg );
386
380
break ;
387
381
case 184 : {
388
382
char * part ;
@@ -400,7 +394,7 @@ void parse_options(int argc, char **argv) {
400
394
if (part != NULL )
401
395
secs = atoi (part );
402
396
403
- s .limit_de_time = 3600 * hours + 60 * mins + secs ;
397
+ s .om_time = 3600 * hours + 60 * mins + secs ;
404
398
break ;
405
399
}
406
400
case 186 :
@@ -410,24 +404,18 @@ void parse_options(int argc, char **argv) {
410
404
s .fixed_kappa = (float )atof (optarg );
411
405
break ;
412
406
case 189 :
413
- s .de_threads = atoi (optarg );
407
+ s .om_threads = atoi (optarg );
414
408
break ;
415
409
case 190 :
416
410
s .polish = atoi (optarg );
417
411
break ;
418
412
/* GM settings */
419
- case 191 :
420
- s .gm_size = atoi (optarg );
421
- break ;
422
413
case 192 :
423
414
s .gm_iterations_beg = atoi (optarg );
424
415
break ;
425
416
case 193 :
426
417
s .gm_iterations_end = atoi (optarg );
427
418
break ;
428
- case 194 :
429
- s .gm_threads = atoi (optarg );
430
- break ;
431
419
case '?' :
432
420
EXIT_ERROR (ARG_ERROR , "%s" , "Try -h/--help.\n" );
433
421
default :
@@ -449,11 +437,11 @@ void check_settings(void) {
449
437
if (s .max_threads < 1 )
450
438
EXIT_ERROR (ARG_ERROR , "%s" , "Maximum number of threads has to be at least 1 (default).\n" );
451
439
452
- if (s .de_threads < 1 )
453
- EXIT_ERROR (ARG_ERROR , "%s" , "Maximum number of DE threads has to be at least 1 (default).\n" );
440
+ if (s .om_threads < 1 )
441
+ EXIT_ERROR (ARG_ERROR , "%s" , "Maximum number of OM threads has to be at least 1 (default).\n" );
454
442
455
- if (s .max_threads < s .de_threads )
456
- EXIT_ERROR (ARG_ERROR , "%s" , "Maximum number of DE threads has to be smaller than maximum number of threads.\n" );
443
+ if (s .max_threads < s .om_threads )
444
+ EXIT_ERROR (ARG_ERROR , "%s" , "Maximum number of OM threads has to be smaller than maximum number of threads.\n" );
457
445
458
446
if (s .mode == MODE_PARAMS ) {
459
447
if (s .chg_file [0 ] == '\0' )
@@ -475,27 +463,28 @@ void check_settings(void) {
475
463
476
464
if (s .params_method == PARAMS_DE ) {
477
465
/* All settings are optional, so check for mistakes and set defaults */
478
- if (s .population_size == 0 )
479
- s .population_size = 500 ; /* 1.2 * (ts.atom_types_count * 2 + 1); */
480
- if (s .limit_de_iters == NO_LIMIT_ITERS && s .limit_de_time == NO_LIMIT_TIME )
481
- s .limit_de_iters = 1000 ;
466
+ if (s .population_size < 1 )
467
+ s .population_size = 100 ; /* 1.2 * (ts.atom_types_count * 2 + 1); */
468
+ if (s .om_iters == NO_LIMIT_ITERS && s .om_time == NO_LIMIT_TIME )
469
+ s .om_iters = 500 ;
482
470
if (s .mutation_constant < 0 ) /* If not set */
483
471
s .mutation_constant = 0.75 ;
484
472
if (s .recombination_constant < 0 )
485
473
s .recombination_constant = 0.7 ;
486
474
if (s .polish == -1 )
487
475
s .polish = 1 ;
488
-
476
+ if (s .sort_by == SORT_NOT_SET )
477
+ s .sort_by = SORT_RMSD_AVG ;
489
478
}
490
479
491
480
if (s .params_method == PARAMS_GM ) {
492
481
/* All settings are optional, so check for mistakes */
493
- if (s .gm_size < 1 )
494
- EXIT_ERROR ( ARG_ERROR , "%s" , "Size of GM set has to be positive.\n" );
482
+ if (s .population_size < 1 )
483
+ s . population_size = 100 ; /* 1.2 * (ts.atom_types_count * 2 + 1); */
495
484
if (s .gm_iterations_beg < 1 || s .gm_iterations_end < 1 )
496
485
EXIT_ERROR (ARG_ERROR , "%s" , "Number of minimization iterations for GM has to be positive.\n" );
497
- if (s .gm_threads < 1 || s . gm_threads > s . max_threads )
498
- EXIT_ERROR ( ARG_ERROR , "%s" , "Number of threads for minimization must be between 1 and maximum number of threads.\n" ) ;
486
+ if (s .sort_by == SORT_NOT_SET )
487
+ s . sort_by = SORT_RMSD_AVG ;
499
488
}
500
489
501
490
if (s .random_seed == -1 )
@@ -510,6 +499,9 @@ void check_settings(void) {
510
499
if (s .limit_time != NO_LIMIT_TIME && s .limit_time > 36000 * 1000 )
511
500
EXIT_ERROR (ARG_ERROR , "%s" , "Maximum time should not be higher than 1000 hours.\n" );
512
501
502
+ if ((s .params_method == PARAMS_LR_FULL || s .params_method == PARAMS_LR_FULL_BRENT ) && s .sort_by == SORT_NOT_SET )
503
+ s .sort_by = SORT_R2 ;
504
+
513
505
/* TODO verify with Tomas if this is the intended behavior */
514
506
if (s .params_method == PARAMS_LR_FULL_BRENT /*!s.full_scan_only*/ && (s .sort_by != SORT_R && s .sort_by != SORT_R2 && s .sort_by != SORT_SPEARMAN && s .sort_by != SORT_RW ))
515
507
EXIT_ERROR (ARG_ERROR , "%s" , "Full scan must be used for sort-by other than R, R2 or Spearman.\n" );
@@ -600,7 +592,7 @@ void print_settings(void) {
600
592
}
601
593
printf ("\nMaximum number of threads: %d\n" , s .max_threads );
602
594
if (s .mode == MODE_PARAMS && s .params_method == PARAMS_DE )
603
- printf ("Maximum number of threads used for DE: %d\n" , s .de_threads );
595
+ printf ("Maximum number of threads used for DE: %d\n" , s .om_threads );
604
596
printf ("\nVerbosity level: " );
605
597
switch (s .verbosity ) {
606
598
case VERBOSE_MINIMAL :
@@ -644,6 +636,9 @@ void print_settings(void) {
644
636
case SORT_D_MAX :
645
637
printf ("Max D" );
646
638
break ;
639
+ case SORT_NOT_SET :
640
+ printf ("not set" );
641
+ break ;
647
642
}
648
643
649
644
if (s .sort_by == SORT_R || s .sort_by == SORT_R2 || s .sort_by == SORT_RW || s .sort_by == SORT_SPEARMAN )
@@ -702,7 +697,7 @@ void print_settings(void) {
702
697
if (s .params_method == PARAMS_DE ) {
703
698
printf ("\n Differential evolution settings:\n" );
704
699
printf ("\t - population size %d\n" , s .population_size );
705
- printf ("\t - max iterations %d\n" , s .limit_de_iters );
700
+ printf ("\t - max iterations %d\n" , s .om_iters );
706
701
if (s .polish != 0 ) {
707
702
printf ("\t - polishing " );
708
703
if (s .polish >= 1 )
@@ -725,10 +720,10 @@ void print_settings(void) {
725
720
726
721
if (s .params_method == PARAMS_GM ) {
727
722
printf ("\nGuided minimization settings:\n" );
728
- printf ("\t - set size %d\n" , s .gm_size );
723
+ printf ("\t - set size %d\n" , s .population_size );
729
724
printf ("\t - iterations for set at the beginning %d\n" , s .gm_iterations_beg );
730
725
printf ("\t - iterations for the result at the end %d\n" , s .gm_iterations_end );
731
- printf ("\t - threads used for minimization %d\n" , s .gm_threads );
726
+ printf ("\t - threads used for minimization %d\n" , s .om_threads );
732
727
}
733
728
}
734
729
0 commit comments