forked from sunhwan/NAMD-REST
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrest2.patch
1046 lines (1003 loc) · 39.2 KB
/
rest2.patch
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
diff -rupN NAMD_2.10_Source/Make.depends NAMD_2.10_Source_REST/Make.depends
--- NAMD_2.10_Source/Make.depends 2015-07-10 10:56:41.000000000 -0500
+++ NAMD_2.10_Source_REST/Make.depends 2015-06-08 17:03:26.000000000 -0500
@@ -2549,6 +2549,52 @@ obj/ComputeNonbondedTI.o: \
src/ResizeArrayIter.h \
src/ComputeNonbondedBase2.h
$(CXX) $(CXXNOALIASFLAGS) $(COPTO)obj/ComputeNonbondedTI.o $(COPTC) src/ComputeNonbondedTI.C
+obj/ComputeNonbondedSPT.o: \
+ src/ComputeNonbondedSPT.C \
+ src/ComputeNonbondedInl.h \
+ src/ComputeNonbondedUtil.h \
+ src/NamdTypes.h \
+ src/common.h \
+ src/Vector.h \
+ src/ResizeArray.h \
+ src/ResizeArrayRaw.h \
+ src/ReductionMgr.h \
+ src/main.h \
+ src/BOCgroup.h \
+ src/ProcessorPrivate.h \
+ src/Molecule.h \
+ src/parm.h \
+ src/structures.h \
+ src/ConfigList.h \
+ src/UniqueSet.h \
+ src/UniqueSetRaw.h \
+ src/Hydrogen.h \
+ src/SortableResizeArray.h \
+ src/GromacsTopFile.h \
+ src/GridForceGrid.h \
+ src/Tensor.h \
+ src/SimParameters.h \
+ src/Lattice.h \
+ src/MGridforceParams.h \
+ src/strlib.h \
+ src/InfoStream.h \
+ src/MStream.h \
+ plugins/include/molfile_plugin.h \
+ plugins/include/vmdplugin.h \
+ src/Node.h \
+ inc/Node.decl.h \
+ src/LJTable.h \
+ src/ReserveArray.h \
+ src/PressureProfile.h \
+ src/Random.h \
+ src/ComputeNonbondedBase.h \
+ src/Parameters.h \
+ src/PatchMap.h \
+ src/HomePatchList.h \
+ src/SortedArray.h \
+ src/ResizeArrayIter.h \
+ src/ComputeNonbondedBase2.h
+ $(CXX) $(CXXNOALIASFLAGS) $(COPTO)obj/ComputeNonbondedSPT.o $(COPTC) src/ComputeNonbondedSPT.C
obj/ComputeNonbondedLES.o: \
src/ComputeNonbondedLES.C \
src/ComputeNonbondedInl.h \
diff -rupN NAMD_2.10_Source/Makefile NAMD_2.10_Source_REST/Makefile
--- NAMD_2.10_Source/Makefile 2015-07-10 10:56:47.000000000 -0500
+++ NAMD_2.10_Source_REST/Makefile 2015-06-08 17:10:18.000000000 -0500
@@ -157,6 +157,7 @@ OBJS = \
$(DSTDIR)/ComputeNonbondedFEP.o \
$(DSTDIR)/ComputeNonbondedGo.o \
$(DSTDIR)/ComputeNonbondedTI.o \
+ $(DSTDIR)/ComputeNonbondedSPT.o \
$(DSTDIR)/ComputeNonbondedLES.o \
$(DSTDIR)/ComputeNonbondedPProf.o \
$(DSTDIR)/ComputeNonbondedTabEnergies.o \
diff -rupN NAMD_2.10_Source/src/ComputeAngles.C NAMD_2.10_Source_REST/src/ComputeAngles.C
--- NAMD_2.10_Source/src/ComputeAngles.C 2009-12-18 17:16:02.000000000 -0600
+++ NAMD_2.10_Source_REST/src/ComputeAngles.C 2015-06-10 15:35:21.000000000 -0500
@@ -120,7 +120,7 @@ void AngleElem::computeForce(BigReal *re
if (normal != 1) {
NAMD_die("ERROR: Can't use cosAngles with Urey-Bradley angles");
}
- BigReal k_ub = value->k_ub;
+ BigReal k_ub = value->k_ub * scale;
BigReal r_ub = value->r_ub;
Vector r13 = r12 - r32;
BigReal d13 = r13.length();
diff -rupN NAMD_2.10_Source/src/ComputeHomeTuples.h NAMD_2.10_Source_REST/src/ComputeHomeTuples.h
--- NAMD_2.10_Source/src/ComputeHomeTuples.h 2013-11-07 16:54:23.000000000 -0600
+++ NAMD_2.10_Source_REST/src/ComputeHomeTuples.h 2015-06-10 15:23:13.000000000 -0500
@@ -141,6 +141,9 @@ template <class T, class S, class P> cla
Real invLesFactor = lesOn ?
1.0/node->simParameters->lesFactor :
1.0;
+ const int sptOn = node->simParameters->sptOn;
+ const Real sptScaleFactor = node->simParameters->sptScaleFactor;
+ const Bool sptScaleAll = node->simParameters->sptScaleAll;
// cycle through each patch and gather all tuples
TuplePatchListIter ai(tuplePatchList);
@@ -174,13 +177,16 @@ template <class T, class S, class P> cla
int homepatch = aid[0].pid;
int samepatch = 1;
int has_les = lesOn && node->molecule->get_fep_type(t.atomID[0]);
+ int has_spt = sptOn && node->molecule->get_spt_type(t.atomID[0]);
for (i=1; i < T::size; i++) {
aid[i] = atomMap->localID(t.atomID[i]);
samepatch = samepatch && ( homepatch == aid[i].pid );
has_les |= lesOn && node->molecule->get_fep_type(t.atomID[i]);
+ has_spt |= sptOn && node->molecule->get_spt_type(t.atomID[i]);
}
+ if (T::size < 4 && !sptScaleAll) has_spt = false;
if ( samepatch ) continue;
- t.scale = has_les ? invLesFactor : 1;
+ t.scale = (!has_les && !has_spt) ? 1.0 : ( has_les ? invLesFactor : sptScaleFactor );
for (i=1; i < T::size; i++) {
homepatch = patchMap->downstream(homepatch,aid[i].pid);
}
diff -rupN NAMD_2.10_Source/src/ComputeNonbondedBase.h NAMD_2.10_Source_REST/src/ComputeNonbondedBase.h
--- NAMD_2.10_Source/src/ComputeNonbondedBase.h 2013-11-08 08:58:55.000000000 -0600
+++ NAMD_2.10_Source_REST/src/ComputeNonbondedBase.h 2015-06-11 10:05:41.000000000 -0500
@@ -130,6 +130,7 @@
#undef FEPNAME
#undef FEP
#undef LES
+#undef SPT
#undef INT
#undef PPROF
#undef LAM
@@ -142,6 +143,7 @@
#define ALCHPAIR(X)
#define NOT_ALCHPAIR(X) X
#define LES(X)
+#define SPT(X)
#define INT(X)
#define PPROF(X)
#define LAM(X)
@@ -173,6 +175,14 @@
#define LES(X) X
#define LAM(X) X
#endif
+#ifdef SPTFLAG
+ #undef FEPNAME
+ #undef SPT
+ #undef LAM
+ #define FEPNAME(X) LAST( X ## _spt )
+ #define SPT(X) X
+ #define LAM(X) X
+#endif
#ifdef INTFLAG
#undef FEPNAME
#undef INT
@@ -204,6 +214,8 @@
SELF( PAIR( foo bar ) )
LES( FEP( foo bar ) )
LES( INT( foo bar ) )
+SPT( FEP( foo bar ) )
+SPT( INT( foo bar ) )
FEP( INT( foo bar ) )
LAM( INT( foo bar ) )
FEP( NOENERGY( foo bar ) )
@@ -233,6 +245,7 @@ void ComputeNonbondedUtil :: NAME
// speedup variables
BigReal *reduction = params->reduction;
SimParameters *simParams = Node::Object()->simParameters;
+ Node *node = Node::Object();
PPROF(
BigReal *pressureProfileReduction = params->pressureProfileReduction;
@@ -351,9 +364,9 @@ void ComputeNonbondedUtil :: NAME
)
)
BigReal scaling = ComputeNonbondedUtil:: scaling;
-#ifdef A2_QPX
- vector4double scalingv = vec_splats(scaling);
-#endif
+//#ifdef A2_QPX
+// vector4double scalingv = vec_splats(scaling);
+//#endif
const BigReal modf_mod = 1.0 - scale14;
FAST
(
@@ -1635,6 +1648,8 @@ void ComputeNonbondedUtil :: NAME
LES( BigReal *lambda_table_i =
lambda_table + (lesFactor+1) * p_i.partition; )
+ SPT( BigReal *lambda_table_i =
+ lambda_table + p_i.partition;)
INT(
const BigReal force_sign = (
@@ -1643,8 +1658,10 @@ void ComputeNonbondedUtil :: NAME
);
)
-
- const BigReal kq_i = COULOMB * p_i.charge * scaling * dielectric_1;
+ BigReal scaling_qi = scaling;
+ if (sptOn && node->molecule->get_spt_type(pExt_i.id) && sptScaleFactor2 == -1) {
+ scaling_qi = sqrt(sptScaleFactor) * scaling; }
+ const BigReal kq_i = COULOMB * p_i.charge * scaling_qi * dielectric_1;
const LJTable::TableEntry * const lj_row =
ljTable->table_row(p_i.vdwType);
diff -rupN NAMD_2.10_Source/src/ComputeNonbondedBase2.h NAMD_2.10_Source_REST/src/ComputeNonbondedBase2.h
--- NAMD_2.10_Source/src/ComputeNonbondedBase2.h 2013-11-20 15:50:14.000000000 -0600
+++ NAMD_2.10_Source_REST/src/ComputeNonbondedBase2.h 2015-06-11 10:05:31.000000000 -0500
@@ -75,7 +75,7 @@ MODIFIED(
#ifdef A2_QPX
register double *p_j_d = (double *) p_j;
#endif
- // const CompAtomExt *pExt_j = pExt_1 + j;
+ register const CompAtomExt *pExt_j = pExt_1 + j;
BigReal diffa = r2list[k] - r2_table[table_i];
#ifdef A2_QPX
@@ -156,7 +156,11 @@ MODIFIED(
}
*/
- BigReal kqq = kq_i * p_j->charge;
+ BigReal scaling_qj = 1.0;
+ if(sptOn && node->molecule->get_spt_type(pExt_j->id) && sptScaleFactor2 == -1){
+ scaling_qj = sqrt(sptScaleFactor);}
+
+ BigReal kqq = kq_i * p_j->charge * scaling_qj;
#ifdef A2_QPX
float * cg = (float *)&p_j->charge;
@@ -170,6 +174,7 @@ MODIFIED(
#endif
LES( BigReal lambda_pair = lambda_table_i[p_j->partition]; )
+ SPT( BigReal lambda_pair = lambda_table_i[p_j->partition]; )
#ifndef A2_QPX
register const BigReal p_ij_x = p_i_x - p_j->position.x;
@@ -177,7 +182,8 @@ MODIFIED(
register const BigReal p_ij_z = p_i_z - p_j->position.z;
#else
vector4double charge_v = vec_lds(0, cg);
- vector4double kqqv = vec_mul(kq_iv, charge_v );
+ vector4double scaling_qj_v = vec_splats(scaling_qj);
+ vector4double kqqv = vec_mul(scaling_qj_v, vec_mul(kq_iv, charge_v));
vector4double p_ij_v = vec_sub(p_i_v, vec_ld (0, p_j_d));
#define p_ij_x vec_extract(p_i_v, 0)
#define p_ij_y vec_extract(p_i_v, 1)
@@ -185,14 +191,23 @@ MODIFIED(
#endif
#if ( FAST(1+) 0 )
- const BigReal A = scaling * lj_pars->A;
- const BigReal B = scaling * lj_pars->B;
+ BigReal scaling_tmp = scaling;
+ if (sptOn && sptScaleFactor2 == -1) {
+ if(node->molecule->get_spt_type(pExt_i.id) && node->molecule->get_spt_type(pExt_j->id)){
+ scaling_tmp = sptScaleFactor * scaling;}
+ else if (node->molecule->get_spt_type(pExt_i.id) || node->molecule->get_spt_type(pExt_j->id)){
+ scaling_tmp = sqrt(sptScaleFactor) * scaling;}
+ else {scaling_tmp = scaling;}
+ }
+ const BigReal A = scaling_tmp * lj_pars->A;
+ const BigReal B = scaling_tmp * lj_pars->B;
#ifndef A2_QPX
BigReal vdw_d = A * table_four_i[0] - B * table_four_i[4];
BigReal vdw_c = A * table_four_i[1] - B * table_four_i[5];
BigReal vdw_b = A * table_four_i[2] - B * table_four_i[6];
BigReal vdw_a = A * table_four_i[3] - B * table_four_i[7];
#else
+ vector4double scalingv = vec_splats(scaling_tmp);
const vector4double Av = vec_mul(scalingv, vec_lds(0, lj_pars_d));
const vector4double Bv = vec_mul(scalingv, vec_lds(8, lj_pars_d));
vector4double vdw_v = vec_msub( Av, vec_ld(0, table_four_i), vec_mul(Bv, vec_ld(4*sizeof(BigReal), table_four_i)) );
@@ -402,7 +417,7 @@ MODIFIED(
BigReal goNative = 0;
BigReal goNonnative = 0;
BigReal goForce = 0;
- register const CompAtomExt *pExt_j = pExt_1 + j;
+ // register const CompAtomExt *pExt_j = pExt_1 + j;
if (ComputeNonbondedUtil::goMethod == 2) {
goForce = mol->get_go_force2(p_ij_x, p_ij_y, p_ij_z, pExt_i.id, pExt_j->id,&goNative,&goNonnative);
} else {
diff -rupN NAMD_2.10_Source/src/ComputeNonbondedSPT.C NAMD_2.10_Source_REST/src/ComputeNonbondedSPT.C
--- NAMD_2.10_Source/src/ComputeNonbondedSPT.C 1969-12-31 18:00:00.000000000 -0600
+++ NAMD_2.10_Source_REST/src/ComputeNonbondedSPT.C 2015-06-08 17:07:59.000000000 -0500
@@ -0,0 +1,66 @@
+/**
+*** Copyright (c) 1995, 1996, 1997, 1998, 1999, 2000 by
+*** The Board of Trustees of the University of Illinois.
+*** All rights reserved.
+**/
+
+/*
+ Common operations for ComputeNonbonded classes
+*/
+
+#include "ComputeNonbondedInl.h"
+
+#define SPTFLAG
+
+#define NBTYPE NBPAIR
+#include "ComputeNonbondedBase.h"
+#define CALCENERGY
+#include "ComputeNonbondedBase.h"
+#undef CALCENERGY
+#define FULLELECT
+#include "ComputeNonbondedBase.h"
+#define CALCENERGY
+#include "ComputeNonbondedBase.h"
+#undef CALCENERGY
+#define MERGEELECT
+#include "ComputeNonbondedBase.h"
+#define CALCENERGY
+#include "ComputeNonbondedBase.h"
+#undef CALCENERGY
+#undef MERGEELECT
+#define SLOWONLY
+#include "ComputeNonbondedBase.h"
+#define CALCENERGY
+#include "ComputeNonbondedBase.h"
+#undef CALCENERGY
+#undef SLOWONLY
+#undef FULLELECT
+#undef NBTYPE
+
+#define NBTYPE NBSELF
+#include "ComputeNonbondedBase.h"
+#define CALCENERGY
+#include "ComputeNonbondedBase.h"
+#undef CALCENERGY
+#define FULLELECT
+#include "ComputeNonbondedBase.h"
+#define CALCENERGY
+#include "ComputeNonbondedBase.h"
+#undef CALCENERGY
+#define MERGEELECT
+#include "ComputeNonbondedBase.h"
+#define CALCENERGY
+#include "ComputeNonbondedBase.h"
+#undef CALCENERGY
+#undef MERGEELECT
+#define SLOWONLY
+#include "ComputeNonbondedBase.h"
+#define CALCENERGY
+#include "ComputeNonbondedBase.h"
+#undef CALCENERGY
+#undef SLOWONLY
+#undef FULLELECT
+#undef NBTYPE
+
+#undef SPTFLAG
+
diff -rupN NAMD_2.10_Source/src/ComputeNonbondedUtil.C NAMD_2.10_Source_REST/src/ComputeNonbondedUtil.C
--- NAMD_2.10_Source/src/ComputeNonbondedUtil.C 2013-07-10 12:20:44.000000000 -0500
+++ NAMD_2.10_Source_REST/src/ComputeNonbondedUtil.C 2015-06-10 17:44:55.000000000 -0500
@@ -87,7 +87,8 @@ Bool ComputeNonbondedUtil::alchTher
Bool ComputeNonbondedUtil::Fep_WCA_repuOn;
Bool ComputeNonbondedUtil::Fep_WCA_dispOn;
Bool ComputeNonbondedUtil::Fep_ElecOn;
-Bool ComputeNonbondedUtil::Fep_Wham;
+Bool ComputeNonbondedUtil::Fep_Wham;
+Bool ComputeNonbondedUtil::sptOn;
BigReal ComputeNonbondedUtil::WCA_rcut1;
BigReal ComputeNonbondedUtil::WCA_rcut2;
BigReal ComputeNonbondedUtil::WCA_rcut3;
@@ -104,6 +105,8 @@ Bool ComputeNonbondedUtil::alchDeco
Bool ComputeNonbondedUtil::lesOn;
int ComputeNonbondedUtil::lesFactor;
BigReal ComputeNonbondedUtil::lesScaling;
+BigReal ComputeNonbondedUtil::sptScaleFactor;
+BigReal ComputeNonbondedUtil::sptScaleFactor2;
BigReal* ComputeNonbondedUtil::lambda_table = 0;
@@ -269,6 +272,9 @@ void ComputeNonbondedUtil::select(void)
alchThermIntOn = simParams->alchThermIntOn;
alchLambda = alchLambda2 = 0;
lesOn = simParams->lesOn;
+ sptOn = simParams->sptOn;
+ sptScaleFactor = simParams->sptScaleFactor;
+ sptScaleFactor2 = simParams->sptScaleFactor2;
lesScaling = lesFactor = 0;
Bool tabulatedEnergies = simParams->tabulatedEnergies;
alchVdwShiftCoeff = simParams->alchVdwShiftCoeff;
@@ -396,6 +402,32 @@ void ComputeNonbondedUtil::select(void)
ComputeNonbondedUtil::calcSlowPairEnergy = calc_pair_energy_slow_fullelect_les;
ComputeNonbondedUtil::calcSlowSelf = calc_self_slow_fullelect_les;
ComputeNonbondedUtil::calcSlowSelfEnergy = calc_self_energy_slow_fullelect_les;
+ } else if ( sptOn && sptScaleFactor2 != -1) {
+#ifdef NAMD_CUDA
+ NAMD_die("Selective parallel sampling is not supported in CUDA version");
+#endif
+ sptScaleFactor = simParams->sptScaleFactor;
+ sptScaleFactor2 = simParams->sptScaleFactor2;
+ lambda_table = new BigReal[3];
+ lambda_table[0] = 1.0;
+ lambda_table[1] = sptScaleFactor2;
+ lambda_table[2] = sptScaleFactor;
+ ComputeNonbondedUtil::calcPair = calc_pair_spt;
+ ComputeNonbondedUtil::calcPairEnergy = calc_pair_energy_spt;
+ ComputeNonbondedUtil::calcSelf = calc_self_spt;
+ ComputeNonbondedUtil::calcSelfEnergy = calc_self_energy_spt;
+ ComputeNonbondedUtil::calcFullPair = calc_pair_fullelect_spt;
+ ComputeNonbondedUtil::calcFullPairEnergy = calc_pair_energy_fullelect_spt;
+ ComputeNonbondedUtil::calcFullSelf = calc_self_fullelect_spt;
+ ComputeNonbondedUtil::calcFullSelfEnergy = calc_self_energy_fullelect_spt;
+ ComputeNonbondedUtil::calcMergePair = calc_pair_merge_fullelect_spt;
+ ComputeNonbondedUtil::calcMergePairEnergy = calc_pair_energy_merge_fullelect_spt;
+ ComputeNonbondedUtil::calcMergeSelf = calc_self_merge_fullelect_spt;
+ ComputeNonbondedUtil::calcMergeSelfEnergy = calc_self_energy_merge_fullelect_spt;
+ ComputeNonbondedUtil::calcSlowPair = calc_pair_slow_fullelect_spt;
+ ComputeNonbondedUtil::calcSlowPairEnergy = calc_pair_energy_slow_fullelect_spt;
+ ComputeNonbondedUtil::calcSlowSelf = calc_self_slow_fullelect_spt;
+ ComputeNonbondedUtil::calcSlowSelfEnergy = calc_self_energy_slow_fullelect_spt;
} else if ( pressureProfileOn) {
#ifdef NAMD_CUDA
NAMD_die("Pressure profile calculation is not supported in CUDA version");
diff -rupN NAMD_2.10_Source/src/ComputeNonbondedUtil.h NAMD_2.10_Source_REST/src/ComputeNonbondedUtil.h
--- NAMD_2.10_Source/src/ComputeNonbondedUtil.h 2013-09-12 17:31:16.000000000 -0500
+++ NAMD_2.10_Source_REST/src/ComputeNonbondedUtil.h 2015-06-08 14:40:30.000000000 -0500
@@ -323,6 +323,9 @@ public:
static int lesFactor;
static BigReal lesScaling;
+ static Bool sptOn;
+ static BigReal sptScaleFactor;
+ static BigReal sptScaleFactor2;
static BigReal *lambda_table;
static Bool pairInteractionOn;
@@ -421,6 +424,24 @@ public:
static void calc_self_slow_fullelect_les (nonbonded *);
static void calc_self_energy_slow_fullelect_les (nonbonded *);
+//selective parallel tempering calcualtion
+ static void calc_pair_spt(nonbonded *);
+ static void calc_pair_energy_spt(nonbonded *);
+ static void calc_pair_fullelect_spt (nonbonded *);
+ static void calc_pair_energy_fullelect_spt (nonbonded *);
+ static void calc_pair_merge_fullelect_spt (nonbonded *);
+ static void calc_pair_energy_merge_fullelect_spt (nonbonded *);
+ static void calc_pair_slow_fullelect_spt (nonbonded *);
+ static void calc_pair_energy_slow_fullelect_spt (nonbonded *);
+ static void calc_self_spt (nonbonded *);
+ static void calc_self_energy_spt (nonbonded *);
+ static void calc_self_fullelect_spt (nonbonded *);
+ static void calc_self_energy_fullelect_spt (nonbonded *);
+ static void calc_self_merge_fullelect_spt (nonbonded *);
+ static void calc_self_energy_merge_fullelect_spt (nonbonded *);
+ static void calc_self_slow_fullelect_spt (nonbonded *);
+ static void calc_self_energy_slow_fullelect_spt (nonbonded *);
+
//pair interaction calcualtion
static void calc_pair_energy_int(nonbonded *);
static void calc_pair_energy_fullelect_int(nonbonded *);
diff -rupN NAMD_2.10_Source/src/ComputePme.C NAMD_2.10_Source_REST/src/ComputePme.C
--- NAMD_2.10_Source/src/ComputePme.C 2014-12-02 16:30:50.000000000 -0600
+++ NAMD_2.10_Source_REST/src/ComputePme.C 2015-06-10 20:22:26.000000000 -0500
@@ -459,10 +459,11 @@ private:
#endif
int qsize, fsize, bsize;
- int alchFepOn, alchThermIntOn, lesOn, lesFactor, pairOn, selfOn, numGrids;
+ int alchFepOn, alchThermIntOn, lesOn, lesFactor, pairOn, selfOn, numGrids, sptOn;
int alchDecouple;
int offload;
BigReal alchElecLambdaStart;
+ BigReal sptScaleFactor, sptScaleFactor2;
float **q_arr;
// q_list and q_count not used for offload
@@ -793,7 +794,6 @@ void Pme_init()
void ComputePmeMgr::initialize(CkQdMsg *msg) {
delete msg;
-
localInfo = new LocalPmeInfo[CkNumPes()];
gridNodeInfo = new NodePmeInfo[CkNumNodes()];
transNodeInfo = new NodePmeInfo[CkNumNodes()];
@@ -842,6 +842,12 @@ void ComputePmeMgr::initialize(CkQdMsg *
lesFactor = simParams->lesFactor;
numGrids = lesFactor;
}
+ sptOn = simParams->sptOn;
+ if ( sptOn ) {
+ sptScaleFactor = simParams->sptScaleFactor;
+ sptScaleFactor2 = simParams->sptScaleFactor2;
+ if (sptScaleFactor2 != -1) numGrids = 3;
+ }
selfOn = 0;
pairOn = simParams->pairInteractionOn;
if ( pairOn ) {
@@ -2565,6 +2571,14 @@ ComputePme::ComputePme(ComputeID c, Patc
lesFactor = simParams->lesFactor;
numGrids = lesFactor;
}
+ sptOn = simParams->sptOn;
+ if ( sptOn ) {
+ sptScaleFactor = simParams->sptScaleFactor;
+ sptScaleFactor2 = simParams->sptScaleFactor2;
+ if (sptScaleFactor2 != -1) {
+ numGrids = 3;
+ }
+ }
selfOn = 0;
pairOn = simParams->pairInteractionOn;
if ( pairOn ) {
@@ -2918,6 +2932,12 @@ void ComputePmeMgr::recvRecipEvir(PmeEvi
void ComputePme::doWork()
{
+ SimParameters *simParams = Node::Object()->simParameters;
+ Node *node = Node::Object();
+ sptOn = simParams->sptOn;
+ sptScaleFactor = simParams->sptScaleFactor;
+ sptScaleFactor2 = simParams->sptScaleFactor2;
+
DebugM(4,"Entering ComputePme::doWork().\n");
if ( basePriority >= COMPUTE_HOME_PRIORITY ) {
@@ -2961,7 +2981,7 @@ void ComputePme::doWork()
{
CompAtom *x = positionBox->open();
- // CompAtomExt *xExt = patch->getCompAtomExtInfo();
+ CompAtomExt *xExt = patch->getCompAtomExtInfo();
if ( patch->flags.doMolly ) {
positionBox->close(&x);
x = avgPositionBox->open();
@@ -2973,7 +2993,10 @@ void ComputePme::doWork()
data_ptr->x = x[i].position.x;
data_ptr->y = x[i].position.y;
data_ptr->z = x[i].position.z;
- data_ptr->cg = coulomb_sqrt * x[i].charge;
+ if(sptOn && node->molecule->get_spt_type(xExt[i].id) && sptScaleFactor2 == -1) {
+ data_ptr->cg = sqrt(sptScaleFactor) * coulomb_sqrt * x[i].charge;
+ } else {
+ data_ptr->cg = coulomb_sqrt * x[i].charge;}
++data_ptr;
*part_ptr = x[i].partition;
++part_ptr;
@@ -2998,6 +3021,28 @@ void ComputePme::doWork()
}
numGridAtoms[g] = nga;
}
+ } else if ( sptOn && sptScaleFactor2 != -1 ) {
+ if (simParams->alchFepOn || simParams->alchThermIntOn) NAMD_bug("FEP/TI and SPT with sptScaleFactor2 option are incompatible!");
+ for ( g=0; g<2; ++g ) {
+ PmeParticle *lgd = localGridData[g];
+ int nga = 0;
+ for(int i=0; i<numLocalAtoms; ++i) {
+ if ( localPartition[i] == g ) {
+ lgd[nga++] = localData[i];
+ }
+ }
+ numGridAtoms[g] = nga;
+ }
+
+ g = 2;
+ PmeParticle *lgd = localGridData[g];
+ int nga = 0;
+ for(int i=0; i<numLocalAtoms; ++i) {
+ if ( localPartition[i] == 0 || localPartition[i] == 1 ) {
+ lgd[nga++] = localData[i];
+ }
+ }
+ numGridAtoms[g] = nga;
} else if ( (alchFepOn || alchThermIntOn) && alchDecouple) {
// alchemical decoupling: four grids
// g=0: partition 0 and partition 1
@@ -3682,7 +3727,7 @@ void ComputePme::ungridForces() {
localResults_alloc.resize(numLocalAtoms* ((numGrids>1 || selfOn)?2:1));
Vector *localResults = localResults_alloc.begin();
Vector *gridResults;
- if ( alchFepOn || alchThermIntOn || lesOn || selfOn || pairOn ) {
+ if ( alchFepOn || alchThermIntOn || lesOn || selfOn || pairOn || (sptOn && sptScaleFactor2 != -1)) {
for(int i=0; i<numLocalAtoms; ++i) { localResults[i] = 0.; }
gridResults = localResults + numLocalAtoms;
} else {
@@ -3795,6 +3840,27 @@ void ComputePme::ungridForces() {
localResults[i] += gridResults[nga++] * scale;
}
}
+ } else if ( sptOn && sptScaleFactor2 != -1) {
+ double scale = 1.;
+ if ( g == 0 ) scale = (1 - simParams->sptScaleFactor2);
+ else if ( g == 1 ) scale = (simParams->sptScaleFactor - simParams->sptScaleFactor2);
+ else if ( g == 2 ) scale = simParams->sptScaleFactor2;
+
+ if ( g < 2 ) {
+ int nga = 0;
+ for(int i=0; i<numLocalAtoms; ++i) {
+ if ( localPartition[i] == g ) {
+ localResults[i] += gridResults[nga++] * scale;
+ }
+ }
+ } else {
+ int nga = 0;
+ for(int i=0; i<numLocalAtoms; ++i) {
+ if ( localPartition[i] == 0 || localPartition[i] == 1 ) {
+ localResults[i] += gridResults[nga++] * scale;
+ }
+ }
+ }
} else if ( selfOn ) {
PmeParticle *lgd = localGridData[g];
int nga = 0;
@@ -3893,6 +3959,10 @@ void ComputePmeMgr::submitReductions() {
}
} else if ( lesOn ) {
scale = 1.0 / lesFactor;
+ } else if ( sptOn && sptScaleFactor2 != -1) {
+ if ( g == 0 ) scale = (1 - simParams->sptScaleFactor2);
+ else if ( g == 1 ) scale = (simParams->sptScaleFactor - simParams->sptScaleFactor2);
+ else if ( g == 2 ) scale = simParams->sptScaleFactor2;
} else if ( pairOn ) {
scale = ( g == 0 ? 1. : -1. );
}
diff -rupN NAMD_2.10_Source/src/ComputePme.h NAMD_2.10_Source_REST/src/ComputePme.h
--- NAMD_2.10_Source/src/ComputePme.h 2014-05-09 16:39:06.000000000 -0500
+++ NAMD_2.10_Source_REST/src/ComputePme.h 2015-06-08 16:54:48.000000000 -0500
@@ -47,11 +47,13 @@ public:
Box<Patch,Results> *forceBox;
PmeGrid myGrid;
- int alchFepOn, alchThermIntOn, lesOn, lesFactor, pairOn, selfOn, numGrids;
+ int alchFepOn, alchThermIntOn, lesOn, sptOn, lesFactor, pairOn, selfOn, numGrids;
int alchDecouple;
int offload;
BigReal alchElecLambdaStart;
-
+ BigReal sptScaleFactor;
+ BigReal sptScaleFactor2;
+
PmeRealSpace *myRealSpace[PME_MAX_EVALS];
int numLocalAtoms;
PmeParticle *localData;
diff -rupN NAMD_2.10_Source/src/ComputeSelfTuples.h NAMD_2.10_Source_REST/src/ComputeSelfTuples.h
--- NAMD_2.10_Source/src/ComputeSelfTuples.h 2012-05-18 02:33:47.000000000 -0500
+++ NAMD_2.10_Source_REST/src/ComputeSelfTuples.h 2015-06-10 15:28:52.000000000 -0500
@@ -45,7 +45,9 @@ template <class T, class S, class P> cla
Real invLesFactor = lesOn ?
1.0/node->simParameters->lesFactor :
1.0;
-
+ const int sptOn = node->simParameters->sptOn;
+ const Real sptScaleFactor = node->simParameters->sptScaleFactor;
+ const Bool sptScaleAll = node->simParameters->sptScaleAll;
// cycle through each patch and gather all tuples
// There should be only one!
TuplePatchListIter ai(this->tuplePatchList);
@@ -80,13 +82,16 @@ template <class T, class S, class P> cla
int homepatch = aid[0].pid;
int samepatch = 1;
int has_les = lesOn && node->molecule->get_fep_type(t.atomID[0]);
+ int has_spt = sptOn && node->molecule->get_spt_type(t.atomID[0]);
for (i=1; i < T::size; i++) {
aid[i] = this->atomMap->localID(t.atomID[i]);
samepatch = samepatch && ( homepatch == aid[i].pid );
has_les |= lesOn && node->molecule->get_fep_type(t.atomID[i]);
+ has_spt |= sptOn && node->molecule->get_spt_type(t.atomID[i]);
}
+ if (T::size < 4 && !sptScaleAll) has_spt = false;
if ( samepatch ) {
- t.scale = has_les ? invLesFactor : 1;
+ t.scale = (!has_les && !has_spt) ? 1.0 : ( has_les ? invLesFactor : sptScaleFactor );
TuplePatchElem *p;
p = this->tuplePatchList.find(TuplePatchElem(homepatch));
for(i=0; i < T::size; i++) {
diff -rupN NAMD_2.10_Source/src/Controller.h NAMD_2.10_Source_REST/src/Controller.h
--- NAMD_2.10_Source/src/Controller.h 2014-11-23 15:25:39.000000000 -0600
+++ NAMD_2.10_Source_REST/src/Controller.h 2015-06-08 13:46:52.000000000 -0500
@@ -205,6 +205,9 @@ protected:
void outputTiEnergy(int step);
void writeTiEnergyData(int step, ofstream_namd &file);
+// std::ofstream sptFile;
+// void writeSptEnergyData(int step, std::ofstream &file);
+
// for checkpoint/revert
int checkpoint_stored;
Lattice checkpoint_lattice;
diff -rupN NAMD_2.10_Source/src/Molecule.C NAMD_2.10_Source_REST/src/Molecule.C
--- NAMD_2.10_Source/src/Molecule.C 2014-08-29 16:03:06.000000000 -0500
+++ NAMD_2.10_Source_REST/src/Molecule.C 2015-06-08 13:46:58.000000000 -0500
@@ -314,7 +314,9 @@ void Molecule::initialize(SimParameters
//fepb
fepAtomFlags=NULL;
//fepe
-
+//spt
+ sptAtomFlags=NULL;
+//spt
nameArena = new ObjectArena<char>;
// nameArena->setAlignment(8);
// arena->setAlignment(32);
@@ -661,6 +663,10 @@ Molecule::~Molecule()
delete [] fepAtomFlags;
//fepe
+//spt
+ if (sptAtomFlags != NULL)
+ delete [] sptAtomFlags;
+//spt
#ifndef MEM_OPT_VERSION
delete arena;
@@ -5243,6 +5249,9 @@ void Molecule::send_Molecule(MOStream *m
}
//fepe
+ if (simParams->sptOn) {
+ msg->put(numAtoms*sizeof(char), (char*)sptAtomFlags);
+ }
#ifdef OPENATOM_VERSION
// needs to be refactored into its own openatom version
if (simParams->openatomOn ) {
@@ -5647,6 +5656,14 @@ void Molecule::receive_Molecule(MIStream
}
//fepe
+//spt
+ if (simParams->sptOn) {
+ delete [] sptAtomFlags;
+ sptAtomFlags = new unsigned char[numAtoms];
+ msg->get(numAtoms*sizeof(unsigned char), (char*)sptAtomFlags);
+ }
+//spt
+
#ifdef OPENATOM_VERSION
// This needs to be refactored into its own version
if (simParams->openatomOn) {
@@ -8355,7 +8372,122 @@ void Molecule::build_extra_bonds(Paramet
}
// End of function build_fep_flags
-
+
+ void Molecule::build_spt_flags(StringList *sptfile,
+ StringList *sptcol,
+ PDB *initial_pdb,
+ char *cwd, const char *simmethod)
+ {
+ PDB *bPDB; //Pointer to PDB object to use
+ int bcol = 4; //Column that the data is in
+ Real bval = 0; //flag from PDB file
+ int i; // loop counter
+ char filename[129]; // filename
+
+ if (sptfile == NULL) {
+ if ( ! initial_pdb ) NAMD_die("Initial PDB file unavailable, sptfile required.");
+ bPDB = initial_pdb;
+ strcpy(filename, "coordinate pdb file (default)");
+ }
+ else {
+ if (sptfile->next != NULL) {
+ char *new_err_msg = new char[24 + strlen(simmethod) + 26];
+ sprintf(new_err_msg,"Multiple definitions of %sFile in configuration file",simmethod);
+ NAMD_die(new_err_msg);
+ }
+
+ if ((cwd == NULL) || (sptfile->data[0] == '/')) {
+ strcpy(filename, sptfile->data);
+ }
+ else {
+ strcpy(filename, cwd);
+ strcat(filename, sptfile->data);
+ }
+
+ bPDB = new PDB(filename);
+ if (bPDB == NULL) {
+ NAMD_die("Memory allocation failed in Molecule:build_spt_flags");
+ }
+
+ if (bPDB->num_atoms() != numAtoms) {
+ char *new_err_msg = new char[19 + strlen(simmethod) + 38];
+ sprintf(new_err_msg,"Number of atoms in %sFile PDB does not match coordinate PDB",simmethod);
+ NAMD_die(new_err_msg);
+ }
+ }
+
+ if (sptcol == NULL) {
+ bcol = 4;
+ }
+ else {
+ if (sptcol->next != NULL) {
+ char *new_err_msg = new char[24 + strlen(simmethod) + 35];
+ sprintf(new_err_msg,"Multiple definitions of %s parameter column in config file",simmethod);
+ NAMD_die(new_err_msg);
+ }
+
+ if (strcasecmp(sptcol->data, "X") == 0) {
+ bcol = 1;
+ }
+ else if (strcasecmp(sptcol->data, "Y") == 0) {
+ bcol = 2;
+ }
+ else if (strcasecmp(sptcol->data, "Z") == 0) {
+ bcol = 3;
+ }
+ else if (strcasecmp(sptcol->data, "O") == 0) {
+ bcol = 4;
+ }
+ else if (strcasecmp(sptcol->data, "B") == 0) {
+ bcol = 5;
+ }
+ else {
+ NAMD_die("sptcol must have value of X, Y, Z, O or B");
+ }
+ }
+
+ iout << iINFO << "To read " << simmethod << "data from file: " << filename << "\n" << endi;
+ iout << iINFO << "To read " << simmethod << "flag data from column: " << bcol << "\n" << endi;
+
+ sptAtomFlags = new unsigned char[numAtoms];
+
+ if (sptAtomFlags == NULL) {
+ NAMD_die("Memory allocation failed in Molecule::build_spt_params()");
+ }
+
+ for (i = 0; i < numAtoms; i++) {
+ switch (bcol) {
+ case 1:
+ bval = (bPDB->atom(i))->xcoor();
+ break;
+ case 2:
+ bval = (bPDB->atom(i))->ycoor();
+ break;
+ case 3:
+ bval = (bPDB->atom(i))->zcoor();
+ break;
+ case 4:
+ bval = (bPDB->atom(i))->occupancy();
+ break;
+ case 5:
+ bval = (bPDB->atom(i))->temperaturefactor();
+ break;
+ }
+ if (simParams->sptOn) {
+ if (bval == 1.0) {
+ sptAtomFlags[i] = 1;
+ } else {
+ sptAtomFlags[i] = 0;
+ }
+ }
+ }
+
+ if (sptfile != NULL) {
+ delete bPDB;
+ }
+
+}
+ // End of function build_spt_flags
//
//
// FUNCTION delete_alch_bonded
diff -rupN NAMD_2.10_Source/src/Molecule.h NAMD_2.10_Source_REST/src/Molecule.h
--- NAMD_2.10_Source/src/Molecule.h 2013-11-20 15:50:16.000000000 -0600
+++ NAMD_2.10_Source_REST/src/Molecule.h 2015-06-08 13:47:03.000000000 -0500
@@ -326,6 +326,10 @@ private:
unsigned char *fepAtomFlags;
//fepe
+//spt
+ unsigned char *sptAtomFlags;
+//spt
+
//occupancy and bfactor data from plugin-based IO implementation of loading structures
float *occupancy;
float *bfactor;
@@ -715,6 +719,10 @@ public:
void delete_alch_bonded(void);
//fepe
+//spt
+ void build_spt_flags(StringList *, StringList *, PDB *, char *, const char *);
+//spt
+
void build_exPressure_atoms(StringList *, StringList *, PDB *, char *);
// Determine which atoms are excluded from
// pressure (if any)
@@ -1090,6 +1098,13 @@ public:
}
//fepe
+//spt
+ unsigned char get_spt_type(int anum) const
+ {
+ return(sptAtomFlags[anum]);
+ }
+//spt
+
#ifndef MEM_OPT_VERSION
Bool is_atom_fixed(int atomnum) const
{
diff -rupN NAMD_2.10_Source/src/NamdState.C NAMD_2.10_Source_REST/src/NamdState.C
--- NAMD_2.10_Source/src/NamdState.C 2014-08-29 16:03:06.000000000 -0500
+++ NAMD_2.10_Source_REST/src/NamdState.C 2015-06-10 20:16:10.000000000 -0500
@@ -111,6 +111,8 @@ void NamdState::checkMemOptCompatibility
NAMD_die("MEMOPT: alchThermIntOn could not be enabled in memory optimized version");
if(simParameters->lesOn)
NAMD_die("MEMOPT: lesOn could not be enabled in memory optimized version");
+ if(simParameters->sptOn)
+ NAMD_die("MEMOPT: sptOn could not be enabled in memory optimized version");
if(simParameters->lonepairs) {
NAMD_die("MEMOPT: lonepairs could not be enabled in memory optimized version");
}
@@ -479,6 +481,11 @@ int NamdState::configListInit(ConfigList
molecule->build_fep_flags(configList->find("lesfile"),
configList->find("lescol"), pdb, NULL, "les");
}
+ if (simParameters->sptOn) {
+ if (simParameters->sptScaleFactor2 != -1 and (simParameters->alchFepOn || simParameters->alchThermIntOn)) NAMD_bug("FEP/TI and SPT with sptScaleFactor2 option are incompatible!");
+ molecule->build_spt_flags(configList->find("sptfile"),
+ configList->find("sptcol"), pdb, NULL, "spt");
+ }
if (simParameters->pairInteractionOn) {
molecule->build_fep_flags(configList->find("pairInteractionFile"),
configList->find("pairInteractionCol"), pdb, NULL, "pairInteraction");
@@ -628,6 +635,10 @@ int NamdState::configListInit(ConfigList
iout << iINFO << molecule->numFepInitial <<
" LOCALLY ENHANCED ATOMS ENABLED\n";
}
+
+ if (simParameters->sptOn) {
+ iout << iINFO << " SELECTIVE PARALLEL TEMPERING ENABLED\n";
+ }
if (simParameters->pairInteractionOn) {
iout << iINFO << "PAIR INTERACTION GROUP 1 CONTAINS "
diff -rupN NAMD_2.10_Source/src/Sequencer.C NAMD_2.10_Source_REST/src/Sequencer.C
--- NAMD_2.10_Source/src/Sequencer.C 2014-01-22 13:52:57.000000000 -0600
+++ NAMD_2.10_Source_REST/src/Sequencer.C 2015-06-10 17:01:14.000000000 -0500
@@ -257,7 +257,6 @@ void Sequencer::integrate(int scriptTask
patch->atomMapper->registerIDsFullAtom(
patch->atom.begin(),patch->atom.end());
}
-
if ( !commOnly && ( reassignFreq>0 ) && ! (step%reassignFreq) ) {
reassignVelocities(timestep,step);
}
diff -rupN NAMD_2.10_Source/src/SimParameters.C NAMD_2.10_Source_REST/src/SimParameters.C
--- NAMD_2.10_Source/src/SimParameters.C 2014-12-04 15:08:50.000000000 -0600
+++ NAMD_2.10_Source_REST/src/SimParameters.C 2015-06-10 17:41:51.000000000 -0500
@@ -307,6 +307,18 @@ void SimParameters::scriptSet(const char
}
//fepe
+//Modifications for selective parallel tempering
+ if ( ! strncasecmp(param,"sptScaleFactor",MAX_SCRIPT_PARAM_SIZE) ) {
+ sptScaleFactor = atof(value);
+ ComputeNonbondedUtil::select();
+ return;
+ }
+ if ( ! strncasecmp(param,"sptScaleFactor2",MAX_SCRIPT_PARAM_SIZE) ) {
+ sptScaleFactor2 = atof(value);
+ ComputeNonbondedUtil::select();
+ return;
+ }
+
// REDUNDANT TI BEGINS
// if ( ! strncasecmp(param,"tiLambda",MAX_SCRIPT_PARAM_SIZE) ) {
// alchLambda = atof(value);
@@ -1092,6 +1104,18 @@ void SimParameters::config_parser_method
opts.optionalB("les", "lesReduceMass", "Reduce enhanced atom mass?",
&lesReduceMass, FALSE);
+ opts.optionalB("main", "spt", "Is selective parallel tempering enabled?",
+ &sptOn, FALSE);
+ opts.require("spt","sptScaleFactor", "Selective parallel tempering scaled factor", &sptScaleFactor);
+ opts.range("sptScaleFactor", NOT_NEGATIVE);
+ opts.optional("spt","sptScaleFactor2", "Selective parallel tempering scaled factor for solute-solvent explicitly", &sptScaleFactor2, -1);
+ opts.optional("spt", "sptFile", "PDB file with rescale flags "
+ "default is the input PDB file", PARSE_STRING);
+ opts.optional("spt", "sptCol", "Column in the sptFile with the "
+ "rescale flag", PARSE_STRING);
+ opts.optionalB("main", "sptScaleAll", "Scale bond and angle energy terms too?",
+ &sptScaleAll, TRUE);
+
// Drude oscillators
opts.optionalB("main", "drude", "Perform integration of Drude oscillators?",
&drudeOn, FALSE);
@@ -3192,7 +3216,7 @@ void SimParameters::check_config(ParseOp
strcpy(alchOutFile, outputFilename);
strcat(alchOutFile, ".fep");
}
-
+ iout << iINFO << "alchFepWhamOn is" << alchFepWhamOn << "\n" << endi ;
if( (!alchFepWhamOn) && ( (!opts.defined("alchLambda")) || (!opts.defined("alchLambda2"))) ) {
NAMD_die("alchFepOn is on, but alchLambda or alchLambda2 is not set.");
}
@@ -4518,6 +4542,18 @@ if ( openatomOn )
if ( lesReduceMass ) iout << iINFO
<< "SCALING ENHANCED ATOM MASS BY 1/" << lesFactor << "\n";
}
+
+ if ( sptOn ) {
+ iout << iINFO << "SELECTIVE PARALLEL TEMPERING IS ACTIVE\n";
+ iout << iINFO << "SELECTIVE PARALLEL TEMPERING RESCALE FACTOR 1 IS "
+ << sptScaleFactor << "\n";
+ if (sptScaleFactor2 != -1) {
+ iout << iINFO << "SELECTIVE PARALLEL TEMPERING RESCALE FACTOR 2 IS "
+ << sptScaleFactor2 << "\n";
+ } else {
+ iout << iINFO << "SELECTIVE PARALLEL TEMPERING RESCALE FACTOR 2 IS NOT SET (SQUARE ROOT OF SCALE FACTOR 1 WILL BE USED)" << "\n";
+ }
+ }