-
Notifications
You must be signed in to change notification settings - Fork 2
/
turboclass.py
executable file
·706 lines (588 loc) · 22.6 KB
/
turboclass.py
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
#!/usr/bin/python
__author__= 'Nathan Gallup'
'''
==============================================================================
turboclass.py
For running Turbomole with frozen internal coordinate optimizations, but could
be generally used for Turbomole optimizations involving internal coordinates.
Attempts to automatically handle the problem of Turbomole sometimes producing
linearly dependent internal redundant coordinates during optimization by
switching between optimizing with the frozen cartesian atoms and frozen
internals. Also attempts to continue the optimization of currently running
internal coordinate calculations via autosubmission. This script is entirely
intended to be a single user-executed script that then runs a frozen internal
coordinate calculation to its completion, often days later.
March 2015, UCLA
==============================================================================
'''
import os, sys, optparse, subprocess
import freeze, unfreeze
# For easy submission, FINISH LATER. LONG TERM.
def createSubmission(options):
print options.submit
# Check options.submit for true/fals and change script accordingly
#parser = optparse.OptionParser(description='This is some random message')
parser = optparse.OptionParser()
parser.add_option('-t', action="store", type=int, default=24, dest="time",
help="Time in hours")
parser.add_option('-N', action="store", type=int, default=12, dest="cores",
help="Number of cores")
parser.add_option('--type', action="store", type=int, default=12, dest="type",
help="Type of node")
parser.add_option('--h_data', action="store", type=str, default=4, dest="mem",
help="Memory desired")
parser.add_option('-a', action="store", type=str, default="autointernal", dest="jobname",
help="Jobname as you want it to appear in the queue")
parser.add_option('--sub', action="store_true", default=False, dest="submit",
help="Inclusion of this command with submit the script")
options, args = parser.parse_args()
print options
print options.time
createSubmission(options)
print args
class Turboclass(object):
# Initialize and create a record of important files
def __init__(self, turboDir=None):
self.homeDir = os.getcwd()
if turboDir == None:
self.turboDir = os.getcwd()
else:
self.turboDir = os.path.realpath(turboDir)
self.energy = os.path.join(self.turboDir, 'energy')
self.gradient = os.path.join(self.turboDir, 'gradient')
# ERROR CHECK LATER TO MAKE SURE THIS EXISTS
self.control = os.path.join(self.turboDir, 'control')
self.coord = os.path.join(self.turboDir, 'coord')
# Create and open stream to log file
self.logPath = os.path.join(self.turboDir, 'turbohistory.log')
if os.path.exists(self.logPath) == False:
with open(self.logPath, 'w') as createLog:
pass
self.log = open(self.logPath, 'r+')
self.firstLog = True
self.logNum = None
# Use of len(turboclassinstance) will return the number of configurations
# in the current turbomole directory
def __len__(self):
with open(self.energy, 'r') as ener_file:
ener_file_lines = ener_file.readlines()
return len(ener_file_lines[1:-1]) # Doesn't read $end or $energy
# Comparisons made using the '==' operator will compare the current
# turbomole directory against the comparison. Good for making sure
# different instances aren't working in the same directory.
def __eq__(self, comparison):
if self.turboDir == comparison.turboDir:
return True
else:
return False
# generates machine file in current directory - necessary for trivial
# parallelization of NumForce
def genMfile(self, MFILE):
MFILE = os.path.realpath(MFILE)
if os.path.isfile(MFILE) == True:
os.remove(MFILE)
# on Hoffman, the pehostfile is stored as environmental variable PEHOSTFILE
# if this is not present, the user may be on a login node, qrsh session,
# or the environmental variable has been changed
try:
self.printLog('PEHOSTFILE found as ' + os.environ['PEHOSTFILE'])
except:
self.printLog('PEHOSTFILE not found! Continuing in serial mode...')
return 1 # return 1 if error
# Check to make sure file exists
if not os.path.isfile(os.environ['PEHOSTFILE']):
self.printLog('... but that file does not exist!')
return 1
self.printLog('PEHOSTFILE not found')
with open(MFILE, 'w') as mFile:
with open(os.environ['PEHOSTFILE']) as peHostFile:
for line in peHostFile:
if len(line) > 0: #nodeName is printed numCores times
numCores = int(line.split(' ')[1])
nodeName = line.split(' ')[0]
for x in range(numCores):
mFile.write(nodeName + '\n')
return 0 # returns 0 if paralellization is possible via MFILE
# Used to conveniently write messages to the log file
def writeLog(self, message):
# First check if this is the first log being written for this instance
# and write header if so
if self.firstLog == True:
self.firstLog = False
logLines = self.log.readlines()
entries = []
for line in logLines:
if '-- LOG --' in line:
entries.append(line.rstrip('\n'))
self.logNum = len(entries) + 1
self.log.write("\n-- LOG -- %s\n" % self.logNum)
# Finally write message to block
self.log.write(message + '\n')
# Helper function to send commands to the terminal
def sendToTerminal(self, command, message, dest='both'):
# Print and log message
if dest == 'both':
print message
self.writeLog(message)
elif dest == 'print':
print message
elif dest == 'log':
self.writeLog(message)
else:
print message
self.writeLog(message)
# Return a subprocess with the command
return subprocess.Popen(command, shell=True, cwd=self.turboDir,
stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
# Helper printer function. Sends text to stdout and/or log
# Kind of nice.
def printLog(self, message):
print message
self.writeLog(message)
# Helper function to send actual -r commands and record them
def sendActual(self, message):
print message
self.writeLog(message)
actual = subprocess.Popen("actual -r", shell=True, cwd=self.turboDir,
stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
actual_out = actual.stdout.read()
print actual_out
self.writeLog(actual_out.rstrip('\n'))
# Returns the latest energy from the energy file with the specified units
def getEnergy(self, units='hartree'):
with open(self.energy, 'r') as ener_file:
final_line = ener_file.readlines()[-2]
iter, ener, kin, pot = final_line.split()
conversion = {'hartree': 1, 'eV' : 27.2107, 'ev': 27.2107,
'wavenumbers': 219474.63, 'cm^-1': 219474.63, 'cm-1': 219474.63,
'kcal/mol': 627.503, 'kJ/mol': 2625.5, 'kj/mol': 2625.5}
try:
return float(ener) * conversion[units]
except:
print "Unit not recognized"
return
# Helper function for detecting if -ri flags should be used
def detect_ri(self):
with open(self.control, 'r') as controlFile:
control_lines = controlFile.read()
if "$rij" in control_lines:
return True
else:
return False
# Helper function for detecting -level <func>
# level = CC2, MP2, SCF, not a functional
# Fix some other time
def detect_level(self):
#with open(self.control, 'r') as controlFile:
# for line in controlFile:
# if "functional" in line:
# functional, level = line.split()
# return level
return 'scf'
# Helper function for detecting -frznuclei flag in numforce
def detect_frznuclei(self):
with open(self.coord, 'r') as coordFile:
for line in coordFile:
if line.split()[-1] == 'f':
return True
return False
# Helper function for parsing internal coordinates stretches, angles, and
# dihedrals. Returns three lists of lists in that order. *atoms can
# either take the place of a series of independent integers, or a list
# of integers subdivided into stretch series (2 integers, angle series
# (3 integers), and dihedral series (4 integers)
def parse_frozen_internals(self, *atoms):
# Create empty lists
stretches = []
angles = []
dihedrals = []
for set in atoms[0]:
if type(set) in [list,tuple]:
if len(set) == 2:
stretches.append(set)
elif len(set) == 3:
angles.append(set)
elif len(set) == 4:
dihedrals.append(set)
else:
print set # DELTE
print len(set)
self.printLog("Something is wrong with the designated set of " \
"frozen atoms. Please check that they're correct")
sys.exit(1)
elif type(set) not in [list, tuple]:
try:
int(set)
if len(atoms) == 2:
stretches.append(set)
elif len(atoms) == 3:
angles.append(set)
elif len(atoms) == 4:
dihedrals.append(set)
except Exception as e:
self.printLog("Non-integer value detected in set of frozen" \
" atoms. Double check list")
self.printLog(str(e))
sys.exit(1)
return stretches, angles, dihedrals
# For rolling back a calculation to a particular configuration. Method
# will truncate energy and gradient files and replace coord with
# appropriate geometry
# DOES NOT CURRENTLY SUPPORT INTERNAL COORDINATES
def rollback(self, geometry=None):
# No configuration specified so exit
if geometry == None:
return
# Configuration greater than number available
if geometry > len(self):
pass # Throw and error
# If cartesian coords do one thing, else if internal, do another
with open(self.control, 'r') as controlFile:
lines = controlFile.read()
if "$intdef" in lines: # Pick some other metric
pass # Do internal specific routine
else:
pass # Do normal routine
# Find coords and truncate gradient
with open(self.gradient, 'r') as gradFile:
gradLines = []
coordLines = []
isCycle = False
for line in gradFile:
if isCycle == True and 'cycle' in line:
break
if '$end' in line:
break
gradLines.append(line)
if isCycle == True and len(line.split()) > 3:
coordLines.append(line)
if 'cycle =%7s' % geometry in line:
isCycle = True
# Throw error if no coordinates found in gradient file
if coordLines == []:
message = "Warning! Rollback couldn't find coordinates "
message += "corresponding to configuration %s. " % geometry
message += "Make sure the gradient file exists, and there is"
message += " a coordinate entry for that configuration."
print message
self.writeLog(message)
sys.exit(1)
# Truncate energies
with open(self.energy, 'r') as enerFile:
ener_lines = enerFile.readlines()
ener_lines = ener_lines[:geometry+1]
with open(self.energy, 'w') as enerFile:
for line in ener_lines:
enerFile.write(line)
if "$end" not in ener_lines[-1]:
enerFile.write("$end")
# Write out truncated gradient and new coord file
with open(self.gradient, 'w') as gradFile:
for line in gradLines:
gradFile.write(line)
gradFile.write("$end")
with open(self.coord, 'w') as coordFile:
coordFile.write('$coord\n')
for line in coordLines:
coordFile.write(line)
coordFile.write('$end')
print "System has been rolled back to configuration %s" % geometry
self.writeLog("System has been rolled back to configuration %s" % geometry)
# For running a simple ridft. Rollback variable implemented for easy recall
# of an energy for a particular geometry. Rollback feature could be
# implemented here or in a dedicated rollback function
def ridft(self, rollback=None):
# Implement some other time
if rollback != None:
self.rollback(rollback)
print "Submitting ridft command"
self.writeLog('Submitting ridft command')
p = subprocess.Popen("ridft", shell=True, cwd=self.turboDir,
stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
out = p.stdout.read()
print out
# Error several times before terminating
tries = 1
numtries = 2
while "ridft ended abnormally" in out:
if tries > numtries:
print "ridft has failed for unknown reasons and could not be " \
"recovered. Check that the setup is alright"
self.writeLog("ridft has failed for unknown reasons and could not be " \
"recovered. Check that the setup is alright")
sys.exit(1)
self.sendActual("Abnormal termination detected. Attempting actual -r.")
print "Re-attempting ridft"
self.writeLog("Re-attempting ridft")
p = subprocess.Popen("ridft", shell=True, cwd=self.turboDir,
stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
out = p.stdout.read()
print out
tries += 1
print "ridft has successfully finished"
self.writeLog("ridft has successfully finished")
# For running a simple rdgrad. Rollback variable implemented for easy
# recall of a gradient for a particular geometry. Rollback feature could be
# implemented here or in a dedicated rollback function
def rdgrad(self, rollback=None):
# Implement some other time
if rollback != None:
self.rollback(rollback)
print "Submitting rdgrad command"
self.writeLog("Submitting rdgrad command")
p = subprocess.Popen("rdgrad", shell=True, cwd=self.turboDir,
stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
out = p.stdout.read()
print out
# Error several times and troubleshoot
tries = 1
numtries = 2
while "rdgrad ended abnormally" in out:
if tries > numtries:
print "rdgrad has failed for unknown reasons and could not be " \
"recovered. Check that the setup is alright."
self.writeLog("rdgrad has failed for unknown reasons and could not be " \
"recovered. Check that the setup is alright.")
sys.exit(1)
message = "Abnormal termination detected. Attempting actual -r"
self.sendActual(message)
print "Re-attempting rdgrad"
self.writeLog("Re-attempting rdgrad")
p = subprocess.Popen("rdgrad", shell=True, cwd=self.turboDir,
stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
out = p.stdout.read()
print out
# Try running ridft to fix the problem
if "rdgrad ended abnormally" in out:
print "actual -r didn't work. Trying new ridft."
self.writeLog("actual -r didn't work. Trying new ridft.")
self.ridft()
print "rdgrad has successfully finished"
self.writeLog("rdgrad has successfully finished")
# For running jobex. Rollback vairable implemented for easy recall of a
# particular geometry. Rollback feature could be implemented
# here or in a dedicated rollback function.
# Trans should be removed and rolled into a different method for a more
# readable method with more advanced error handling. Maybe.
# level should automatically detect its function from the control file
# -l, -ls, -md, -mdfile, -mdscript, -help will probably not be implemented
def jobex(self, rollback=None, energy=6, gcart=3, c=20, dscf=False,
grad=False, statpt=False, relax=False, trans=False, level='',
ri='', rijk=False, ex=False, keep=False):
# Record number of starting configurations
init_configs = len(self)
# Auto-detect certain flags
if ri == '':
ri = self.detect_ri()
if level == '':
level = self.detect_level()
# Organize True/False args into a dictionary of a dictonary for easy access
flags = {
'dscf' : {True : '-dscf ', False: ''},
'grad' : {True : '-grad ', False: ''},
'statpt' : {True : '-statpt ', False: ''},
'relax' : {True : '-relax ', False: ''},
'trans' : {True : '-trans ', False: ''},
'ri' : {True : '-ri ', False: ''},
'rijk' : {True : '-rijk ', False: ''},
'ex' : {True : '-ex ', False: ''},
'keep' : {True : '-keep ', False: ''} }
# Implement later
if rollback != None:
self.rollback(rollback)
comm = "jobex -energy %s -gcart %s -c %s -level %s " % \
(energy, gcart, c, level)
comm += flags['dscf'][dscf]
comm += flags['grad'][grad]
comm += flags['statpt'][statpt]
comm += flags['relax'][relax]
comm += flags['trans'][trans]
comm += flags['ri'][ri]
comm += flags['rijk'][rijk]
comm += flags['ex'][ex]
comm += flags['keep'][keep]
# Begin sending commands to the shell
print "Submitting command %s" % comm
self.writeLog("Submitting command %s" % comm)
opt = subprocess.Popen(comm, shell=True, cwd=self.turboDir,
stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
opt_out = opt.stdout.read()
print opt_out
# Super shitty troubleshooting. Needs refining.
tries = 1
numtries = 2
while "program stopped" in opt_out:
if tries > numtries:
print "jobex has failed for unknown reasons and could not be " \
"recovered. Check that the setup is alright."
self.writeLog("jobex has failed for unknown reasons and could not be " \
"recovered. Check that the setup is alright.")
sys.exit(1)
message = "Abnormal termination detected. Attempting actual -r"
self.sendActual(message)
print "Re-attempting %s command" % comm
self.writeLog("Re-attempting %s command" % comm)
new_opt = subprocess.Popen(comm, shell=True, cwd=self.turboDir,
stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
opt_out = new_opt.stdout.read()
print opt_out
# Try running ridft to fix the problem, if there was one
if "program stopped" in opt_out:
print "actual -r didn't work. Trying new ridft."
self.writeLog("actual -r didn't work. Trying new ridft.")
self.ridft()
tries += 1
# Find how many steps were taken
final_configs = len(self)
diff = final_configs - init_configs
self.printLog("Jobex command has successfully finished %s steps" % diff)
# For running numfore in either a serial or parallel environment. Rollback
# method not currently implemented and mfile implementation is probably
# rudimentary. Currently -scrpath, -l, and -ls is a little mysterious
# and I haven't tested how to use them
# Ideas to implement later:
# automatic detection of frznuclei
# automatic ri
# automatic level
# mfile generation
def numforce(self, rollback=None, ri='', rijk=False, level='',
ex='', d='', thrgrd='', central=False, polyedr=False,
ecnomic=False, diatmic=False, size='', mfile='', i=False,
c=False, prep=False, l='', ls='', scrpath='', override=False,
frznuclei='', cosmo=False):
# Auto-detect some flags
if ri == '':
ri = self.detect_ri()
if level == '':
level = self.detect_level()
if frznuclei == '':
frznuclei = self.detect_frznuclei()
if level != '':
level = " -level %s" % level
if d != '':
d = " -d %s" %d
if thrgrd != '':
thrgrd = " -thrgrd %s" % thrgrd
if ex != '':
ex = " -ex %s" % ex
if size != '':
size = " -%s" % size
if mfile != '':
# generate machine file for trivial parallelization:
self.genMfile(mfile)
mfile = " -mfile %s" % mfile
if l != '':
l = " -l %s" % l
if ls != '':
ls = " -ls %s" % ls
if scrpath != '':
scrpath = " -scrpath %s" % scrpath
flags = {
'ri' : {True : ' -ri', False : ''},
'rijk' : {True : ' -rijk', False : ''},
'central' : {True : ' -central', False : ''},
'polyedr' : {True : ' -polyedr', False : ''},
'ecnomic' : {True : ' -ecnomic', False : ''},
'diatmic' : {True : ' -diatmic', False : ''},
'i' : {True : ' -i', False : ''},
'c' : {True : ' -c', False : ''},
'prep' : {True : ' -prep', False : ''},
'override': {True : ' -override',False : ''},
'frznuclei':{True : ' -frznuclei',False: ''},
'cosmo' : {True : ' -cosmo',False : ''} }
# Assemble command and list of flags
comm = 'NumForce'
comm += level + d + thrgrd + ex + size + mfile + l + ls + scrpath
comm += flags['ri'][ri]
comm += flags['rijk'][rijk]
comm += flags['central'][central]
comm += flags['polyedr'][polyedr]
comm += flags['ecnomic'][ecnomic]
comm += flags['diatmic'][diatmic]
comm += flags['i'][i]
comm += flags['c'][c]
comm += flags['prep'][prep]
comm += flags['override'][override]
comm += flags['frznuclei'][frznuclei]
comm += flags['cosmo'][cosmo]
# Implement later
if rollback != None:
self.rollback(rollback)
text = "Submitting command %s" % comm
num_run = self.sendToTerminal(comm, text)
num_out = num_run.stdout.read()
print num_out
# Try to troubleshoot
tries = 1
numtries = 2
while "program stopped" in num_out:
# Terminal error
if tries > numtries:
text = "NumForce has failed for unknown reasons and could not be" \
" recovered. Check that the setup is alright."
print text
self.writeLog(text)
sys.exit(1)
# Try actual -r
actual_msg = 'Abnormal termination detected. Attempting actual -r.'
self.sendActual(actual_msg)
text = "Re-submitting command %s" % comm
num_run = self.sendToTerminal(comm, text)
num_out = num_run.stdout.read()
print num_out
# Try running ridft and rdgrad to fix the problem if there was one
if "program stopped" in num_out:
print "actual -r didn't work. Trying ridft -> rdgrad."
self.writeLog("actual -r didn't work. Trying ridft -> rdgrad.")
self.ridft()
print "...Now Trying rdgrad."
self.writeLog("...Now trying rdgrad.")
self.rdgrad()
tries += 1
# Check for missing gradient error
if "Can not find data group $grad" in num_out:
print "Gradient is missing. Running rdgrad."
self.writeLog("Gradient is missing. Running rdgrad.")
self.rdgrad()
message = "Re-submitting command %s" % comm
self.sendToTerminal(comm, message)
print "NumForce has successfully finished."
self.writeLog("Numforce has successfully finished.")
# For running constrained internal optimizations using internal coordinates
# within turbomole. Currently only tested with bond stretches. Angles
# and dihedrals are not being targetted yet.
def constrained_int_opt(self, *frozen, **kwargs):
# Auto-detect certain flags
try: ri = kwargs['ri']
except: kwargs['ri'] = self.detect_ri()
try: level = kwargs['level']
except: level = self.detect_level()
if 'rollback' in kwargs:
self.rollback(kwargs['rollback'])
energy = kwargs.pop('energy', 6)
gcart = kwargs.pop('gcart', 3)
c = kwargs.pop('c', 20)
# Organize True/False args into a dictionary of a dictonary for easy access
flags = {
'dscf' : {True : '-dscf ', False: ''},
'grad' : {True : '-grad ', False: ''},
'statpt' : {True : '-statpt ', False: ''},
'relax' : {True : '-relax ', False: ''},
'trans' : {True : '-trans ', False: ''},
'ri' : {True : '-ri ', False: ''},
'rijk' : {True : '-rijk ', False: ''},
'ex' : {True : '-ex ', False: ''},
'keep' : {True : '-keep ', False: ''} }
# Create command string to be sent to the shell
comm = "jobex -energy %s -gcart %s -c %s -level %s " % \
(energy, gcart, c, level)
for key, value in kwargs.iteritems():
comm += flags[key][value]
# Parse out frozen atoms
stretches, angles, dihedrals = self.parse_frozen_internals(frozen)
print comm # DELETE
print "Stretches: ", stretches # DELETE
print "Angles: ", angles # DELETE
print "Dihedrals: ", dihedrals # DELETE
def constrained_int_ts(self, rollback=None, otherflags=None):
pass