Ejemplo n.º 1
0
    def _readout(self):
        timeout = 0
        not_found = False
        while True:
            timeout += 1
            time.sleep(config['wait_for_gamess_output'])
            if timeout % config['maximum_times_to_recheck'] == 0:
                not_found = True
                lg.warning('Final energy not found for file {}... '
                           'Do something!!'.format(self._inout_out_path))

            if not os.path.exists(self._inout_out_path): continue

            find = find_in_file(self._inout_out_path,
                                config['well_finished_strings'],
                                reverse=True)

            if find[1] and find[2] and find[3]:
                if not_found:
                    lg.warning('Final energy for file {} found!!'
                               .format(self._inout_out_path))
                if abs(float(find[1].split()[5])) < float(b'0.0E-8'):
                    msg = 'Energy in Gamess is almost zero: {:f}'.\
                        format(float(find[1].split()[5]))
                    lg.critical(msg)
                    raise(RuntimeError(msg))

                return (float(find[1].split()[5]),
                        float(find[2].split()[6]), float(find[3].split()[2]))
Ejemplo n.º 2
0
    def _readout(self):
        timeout = 0
        not_found = False
        while True:
            timeout += 1
            time.sleep(__class__._config['dormi'])
            if timeout % __class__._config['timeout_max'] == 0:
                not_found = True
                lg.warning('Final energy not found for file {}... Do something!!'
                           .format(self._inout_out_path))

            if not os.path.exists(self._inout_out_path): continue

            find = find_in_file(self._inout_out_path,
                                __class__._config['well_finished_strings'],
                                reverse=True)

            if find[1] and find[2] and find[3]:
                if not_found:
                    lg.warning('Final energy for file {} found!!'
                               .format(self._inout_out_path))
                if abs(float(find[1].split()[5])) < float(b'0.0E-8'):
                    print('Problem with energy in GAMESS',
                          float(find[1].split()[5]))
                    exit()
                return (float(find[1].split()[5]),
                        float(find[2].split()[6]), float(find[3].split()[2]))