Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Occasional CClib parsing error in QM using Mopac #134

Closed
connie opened this issue Jul 31, 2013 · 4 comments · Fixed by #2091
Closed

Occasional CClib parsing error in QM using Mopac #134

connie opened this issue Jul 31, 2013 · 4 comments · Fixed by #2091

Comments

@connie
Copy link
Member

connie commented Jul 31, 2013

This error has popped up a few times in my jobs, but is not easily reproducible.

Using the cclib parser on the output file of interest it works correctly, and when I rerun the job keeping the original QM files it also seems to run fine the second time around. However, I have seen this error come up in other jobs.

The best fix may be to rerun MOPAC through a second attempt?


2 radicals on C1CC(CCC1(C)[O])[C](C)C exceeds limit of 0. Using HBI method.
Output file /home/connieg/QMfiles/CMLYGGFIXXLYQT-UHFFFAOYSA.out does not (yet) exist.
Trying MopacMolPM3 attempt 1 of 10 on molecule C1(CCC(C(C)C)CC1)(C)O.
Successful MOPAC quantum result found in /home/connieg/QMfiles/CMLYGGFIXXLYQT-UHFFFAOYSA.out
Traceback (most recent call last):
  File "/home/connieg/Code/RMG-Py/rmg.py", line 136, in <module>
    cProfile.runctx(command, global_vars, local_vars, stats_file)
  File "/usr/lib/python2.6/cProfile.py", line 49, in runctx
    prof = prof.runctx(statement, globals, locals)
  File "/usr/lib/python2.6/cProfile.py", line 140, in runctx
    exec cmd in globals, locals
  File "<string>", line 1, in <module>
  File "/home/connieg/Code/RMG-Py/rmgpy/rmg/main.py", line 329, in execute
    self.initialize(args)
  File "/home/connieg/Code/RMG-Py/rmgpy/rmg/main.py", line 317, in initialize
    self.reactionModel.enlarge([spec for spec in self.initialSpecies if spec.reactive])
  File "/home/connieg/Code/RMG-Py/rmgpy/rmg/model.py", line 693, in enlarge
    spec.generateThermoData(database, quantumMechanics=self.quantumMechanics)
  File "/home/connieg/Code/RMG-Py/rmgpy/rmg/model.py", line 124, in generateThermoData
    tdata = database.thermo.estimateRadicalThermoViaHBI(molecule, quantumMechanics.getThermoData)
  File "/home/connieg/Code/RMG-Py/rmgpy/data/thermo.py", line 788, in estimateRadicalThermoViaHBI
    thermoData = stableThermoEstimator(saturatedStruct)
  File "/home/connieg/Code/RMG-Py/rmgpy/qm/main.py", line 147, in getThermoData
    thermo0 = qm_molecule_calculator.generateThermoData()
  File "/home/connieg/Code/RMG-Py/rmgpy/qm/molecule.py", line 252, in generateThermoData
    self.qmData = self.generateQMData()
  File "/home/connieg/Code/RMG-Py/rmgpy/qm/mopac.py", line 205, in generateQMData
    result = self.parse() # parsed in cclib
  File "/home/connieg/Code/RMG-Py/rmgpy/qm/mopac.py", line 144, in parse
    qmData = CCLibData(cclibData, radicalNumber+1)
  File "/home/connieg/Code/RMG-Py/rmgpy/qm/qmdata.py", line 79, in __init__
    molecularMass = (cclib_data.molmass,'amu'),
AttributeError: 'ccData' object has no attribute 'molmass'
rwest added a commit that referenced this issue Jul 31, 2013
Trying to help issue #134.
This is unlikely to fix anything, but should help debugging.
@rwest
Copy link
Member

rwest commented Jul 31, 2013

f31693b may help with the debugging, but I can't quite see why it would be failing this way, unless it's an i/o problem, eg. the file has not finished being written yet when you start to parse it. Are you running this on a networked file share, eg. from your home user space on a cluster? I wonder if there's a way to wait until a file is no longer open by any other process, before parsing it.

@ghost
Copy link

ghost commented Jun 12, 2014

Seeing this also, when importing mechanims.

  File "/home/goktekin.e/Code/RMG-Py/importChemkin.py", line 2162, in <module>
    mm.main()
  File "/home/goktekin.e/Code/RMG-Py/importChemkin.py", line 1484, in main
    self.limitEnlarge(self.speciesDict_rmg[labelToProcess])
  File "/home/goktekin.e/Code/RMG-Py/importChemkin.py", line 1317, in limitEnlarge
    spec.generateThermoData(database, quantumMechanics=rm.quantumMechanics)
  File "/home/goktekin.e/Code/RMG-Py/rmgpy/rmg/model.py", line 149, in generateThermoData
    thermo0 = quantumMechanics.getThermoData(molecule) # returns None if it fails
  File "/home/goktekin.e/Code/RMG-Py/rmgpy/qm/main.py", line 147, in getThermoData
    thermo0 = qm_molecule_calculator.generateThermoData()
  File "/home/goktekin.e/Code/RMG-Py/rmgpy/qm/molecule.py", line 221, in generateThermoData
    self.qmData = self.generateQMData()
  File "/home/goktekin.e/Code/RMG-Py/rmgpy/qm/mopac.py", line 216, in generateQMData
    result = self.parse() # parsed in cclib
  File "/home/goktekin.e/Code/RMG-Py/rmgpy/qm/mopac.py", line 146, in parse
    qmData = CCLibData(cclibData, radicalNumber+1)
  File "/home/goktekin.e/Code/RMG-Py/rmgpy/qm/qmdata.py", line 87, in __init__
    raise e
AttributeError: 'ccData' object has no attribute 'rotcons'

and

  File "/home/goktekin.e/Code/RMG-Py/importChemkin.py", line 2162, in <module>
    mm.main()
  File "/home/goktekin.e/Code/RMG-Py/importChemkin.py", line 1484, in main
    self.limitEnlarge(self.speciesDict_rmg[labelToProcess])
  File "/home/goktekin.e/Code/RMG-Py/importChemkin.py", line 1317, in limitEnlarge
    spec.generateThermoData(database, quantumMechanics=rm.quantumMechanics)
  File "/home/goktekin.e/Code/RMG-Py/rmgpy/rmg/model.py", line 130, in generateThermoData
    tdata = database.thermo.estimateRadicalThermoViaHBI(molecule, quantumMechanics.getThermoData)
  File "/home/goktekin.e/Code/RMG-Py/rmgpy/data/thermo.py", line 803, in estimateRadicalThermoViaHBI
    thermoData = stableThermoEstimator(saturatedStruct)
  File "/home/goktekin.e/Code/RMG-Py/rmgpy/qm/main.py", line 147, in getThermoData
    thermo0 = qm_molecule_calculator.generateThermoData()
  File "/home/goktekin.e/Code/RMG-Py/rmgpy/qm/molecule.py", line 221, in generateThermoData
    self.qmData = self.generateQMData()
  File "/home/goktekin.e/Code/RMG-Py/rmgpy/qm/mopac.py", line 216, in generateQMData
    result = self.parse() # parsed in cclib
  File "/home/goktekin.e/Code/RMG-Py/rmgpy/qm/mopac.py", line 144, in parse
    cclibData = parser.parse()
  File "/home/goktekin.e/Code/RMG-Py/external/cclib/parser/logfileparser.py", line 221, in parse
    self.extract(inputfile, line)
  File "/home/goktekin.e/Code/RMG-Py/external/cclib/parser/mopacparser.py", line 142, in extract
    self.inputatoms.append(symbol2int(broken[1]))
  File "/home/goktekin.e/Code/RMG-Py/external/cclib/parser/mopacparser.py", line 20, in symbol2int
    return t.number[symbol]
KeyError: '143'

This is also somewhat random and only when running on a networked file system (on an HPC cluster).

@rwest
Copy link
Member

rwest commented Jun 12, 2014

I think this is easily (though not very beautifully) addressed by inserting a 1 second pause to wait for the file to be written to disk, as @keceli tried in 56ca670 (did it work, Murat?)

@keceli
Copy link

keceli commented Jun 12, 2014

It was working 6 months ago, I haven't checked it since then. While it is
as ugly as it gets, I don't know any other portable solution. There are two
related things I'd suggest: 1) Use a folder (to store thermo files) in a
scratch disk that no other RMG simulations access 2) Use thermoEstimator.py
(the one in scoop branch is parallel), after generating the species list
that you want to run QM calculations. I can try to update this branch with
the latest version of scoop and RMG next week.

Murat

rwest pushed a commit to rwest/RMG-Py that referenced this issue Jun 12, 2014
Temporary solution to avoid attribute errors from cclib during parsing.
See issue ReactionMechanismGenerator#134
pierrelb pushed a commit to pierrelb/RMG-Py that referenced this issue Jun 15, 2015
Temporary solution to avoid attribute errors from cclib during parsing.
See issue ReactionMechanismGenerator#134
rwest pushed a commit to rwest/RMG-Py that referenced this issue Jun 21, 2015
Temporary solution to avoid attribute errors from cclib during parsing.
See issue ReactionMechanismGenerator#134
rwest pushed a commit to rwest/RMG-Py that referenced this issue Jun 21, 2015
Temporary solution to avoid attribute errors from cclib during parsing.
See issue ReactionMechanismGenerator#134
rwest pushed a commit to rwest/RMG-Py that referenced this issue Jul 3, 2015
Temporary solution to avoid attribute errors from cclib during parsing.
See issue ReactionMechanismGenerator#134
pierrelb pushed a commit to pierrelb/RMG-Py that referenced this issue Jul 20, 2015
Temporary solution to avoid attribute errors from cclib during parsing.
See issue ReactionMechanismGenerator#134
rwest pushed a commit to rwest/RMG-Py that referenced this issue Aug 15, 2015
Temporary solution to avoid attribute errors from cclib during parsing.
See issue ReactionMechanismGenerator#134
rwest pushed a commit to rwest/RMG-Py that referenced this issue Aug 18, 2015
Temporary solution to avoid attribute errors from cclib during parsing.
See issue ReactionMechanismGenerator#134
rwest pushed a commit that referenced this issue Oct 17, 2019
Temporary solution to avoid attribute errors from cclib during parsing.
See issue #134
rwest pushed a commit that referenced this issue Oct 19, 2019
Temporary solution to avoid attribute errors from cclib during parsing.
See issue #134
rwest pushed a commit that referenced this issue Oct 19, 2019
Temporary solution to avoid attribute errors from cclib during parsing.
See issue #134
rwest pushed a commit to rwest/RMG-Py that referenced this issue Nov 21, 2019
Temporary solution to avoid attribute errors from cclib during parsing.
See issue ReactionMechanismGenerator#134
rwest pushed a commit to rwest/RMG-Py that referenced this issue Dec 1, 2019
Temporary solution to avoid attribute errors from cclib during parsing.
See issue ReactionMechanismGenerator#134
rwest pushed a commit to rwest/RMG-Py that referenced this issue Mar 6, 2020
Temporary solution to avoid attribute errors from cclib during parsing.
See issue ReactionMechanismGenerator#134
rwest pushed a commit to rwest/RMG-Py that referenced this issue Apr 16, 2020
Temporary solution to avoid attribute errors from cclib during parsing.
See issue ReactionMechanismGenerator#134
rwest pushed a commit to rwest/RMG-Py that referenced this issue Sep 27, 2020
Temporary solution to avoid attribute errors from cclib during parsing.
See issue ReactionMechanismGenerator#134
@amarkpayne amarkpayne linked a pull request Apr 15, 2021 that will close this issue
xiaoruiDong pushed a commit that referenced this issue Jul 27, 2021
Temporary solution to avoid attribute errors from cclib during parsing.
See issue #134
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants