Commit 109d5042 authored by Ask Hjorth Larsen's avatar Ask Hjorth Larsen
Browse files

remove some parts so things are maybe less broken with the build system

parent b56ac6a3
......@@ -80,12 +80,12 @@ class OctopusParserContext(object):
def parse_infofile(metaInfoEnv, pew, fname):
with open('info-parser.log', 'w') as fd:
mainFunction(infoFileDescription,
metaInfoEnv,
parserInfo,
outF=fd,
cachingLevelForMetaName={},
superBackend=pew,
superContext=OctopusParserContext(),
mainFile=fname)
#with open('info-parser.log', 'w') as fd:
mainFunction(infoFileDescription,
metaInfoEnv,
parserInfo,
#outF=fd,
cachingLevelForMetaName={},
superBackend=pew,
superContext=OctopusParserContext(),
mainFile=fname)
......@@ -30,14 +30,14 @@ class OctopusLogFileParserContext(object):
def parse_logfile(metaInfoEnv, pew, fname):
with open('logfile-parse.log', 'w') as fd:
mainFunction(logFileDescription,
metaInfoEnv,
parserInfo,
outF=fd,
cachingLevelForMetaName={},
superBackend=pew,
superContext=OctopusLogFileParserContext(),
mainFile=fname)
#with open('logfile-parse.log', 'w') as fd:
mainFunction(logFileDescription,
metaInfoEnv,
parserInfo,
#outF=fd,
cachingLevelForMetaName={},
superBackend=pew,
superContext=OctopusLogFileParserContext(),
mainFile=fname)
#for key in metaInfoEnv:
# print('key', key)
......@@ -5,14 +5,15 @@ from glob import glob
from contextlib import contextmanager
import numpy as np
import aseoct
import setup_paths
from nomadcore.local_meta_info import loadJsonFile, InfoKindEl
from nomadcore.parser_backend import JsonParseEventsWriterBackend
from nomadcore.unit_conversion.unit_conversion import convert_unit, \
register_userdefined_quantity
from aseoct import Octopus, parse_input_file, kwargs2cell
from octopus_info_parser import parse_infofile
from octopus_logfile_parser import parse_logfile
......@@ -93,7 +94,7 @@ def read_parser_log(path):
def read_input_file(path):
with open(path) as fd:
names, values = aseoct.parse_input_file(fd)
names, values = parse_input_file(fd)
names = normalize_names(names)
kwargs = {}
......@@ -105,7 +106,7 @@ def read_input_file(path):
def is_octopus_logfile(fname):
fd = open(fname)
for lineno in range(20):
line = fd.next()
line = next(fd)
if '|0) ~ (0) |' in line: # Eyes from Octopus logo
return True
return False
......@@ -209,8 +210,8 @@ def register_octopus_keywords(pew, category, kwargs):
def parse(fname, fd):
# fname refers to the static/info file.
pew = JsonParseEventsWriterBackend(metaInfoEnv,
fileOut=open('json-writer.log', 'w'))
pew = JsonParseEventsWriterBackend(metaInfoEnv)
#fileOut=open('json-writer.log', 'w'))
# this context manager shamelessly copied from GPAW parser
# Where should Python code be put if it is used by multiple parsers?
......@@ -245,7 +246,7 @@ def parse(fname, fd):
register_units(kwargs, fd)
print('Read as ASE calculator', file=fd)
calc = aseoct.Octopus(dirname, check_keywords=False)
calc = Octopus(dirname, check_keywords=False)
atoms = calc.get_atoms()
#with open_section('section_basis_set_cell_dependent'):
......@@ -259,23 +260,23 @@ def parse(fname, fd):
nspins = calc.get_number_of_spins()
nkpts = len(calc.get_k_point_weights())
print('Parse info file using SimpleMatcher', file=fd)
parse_infofile(metaInfoEnv, pew, fname)
#print('Parse info file using SimpleMatcher', file=fd)
#parse_infofile(metaInfoEnv, pew, fname)
logfile = find_octopus_logfile(dirname)
if logfile is None:
print('No stdout logfile found', file=fd)
else:
print('Found stdout logfile %s' % logfile, file=fd)
print('Parse logfile using SimpleMatcher', file=fd)
parse_logfile(metaInfoEnv, pew, logfile)
#logfile = find_octopus_logfile(dirname)
#if logfile is None:
# print('No stdout logfile found', file=fd)
#else:
# print('Found stdout logfile %s' % logfile, file=fd)
# print('Parse logfile using SimpleMatcher', file=fd)
# parse_logfile(metaInfoEnv, pew, logfile)
print('Add parsed values', file=fd)
with open_section('section_system'):
if 0: # XXXXXXXXXXXXXXX with open_section('section_system'):
# The Atoms object will always have a cell, even if it was not
# used in the Octopus calculation! Thus, to be more honest,
# we re-extract the cell at a level where we can distinguish:
cell, _unused = aseoct.kwargs2cell(kwargs)
cell, _unused = kwargs2cell(kwargs)
if cell is not None:
pew.addArrayValues('simulation_cell', cell)
......@@ -286,7 +287,7 @@ def parse(fname, fd):
convert_unit(atoms.get_positions(), 'angstrom'))
pew.addArrayValues('configuration_periodic_dimensions',
np.array(atoms.pbc))
with open_section('section_single_configuration_calculation'):
if 0: #XXXXXXXXXXXXXXX with open_section('section_single_configuration_calculation'):
with open_section('section_method'):
pew.addValue('number_of_spin_channels', nspins)
pew.addValue('total_charge',
......@@ -313,14 +314,14 @@ def parse(fname, fd):
'lda_x + lda_c_pz_mod'][ndim - 1]
xcfunctional = kwargs.get('xcfunctional', default_xc)
xcfunctional = ''.join(xcfunctional.split()).upper()
with open_section('section_XC_functionals'):
pew.addValue('XC_functional_name', xcfunctional)
#with open_section('section_XC_functionals'):
# pew.addValue('XC_functional_name', xcfunctional)
# Convergence parameters?
with open_section('section_eigenvalues'):
if kwargs.get('theorylevel', 'dft') == 'dft':
pew.addValue('eigenvalues_kind', 'normal')
if 0:#XXXXXXXX with open_section('section_eigenvalues'):
#if kwargs.get('theorylevel', 'dft') == 'dft':
# pew.addValue('eigenvalues_kind', 'normal')
eig = np.zeros((nspins, nkpts, nbands))
occ = np.zeros((nspins, nkpts, nbands))
......@@ -330,9 +331,9 @@ def parse(fname, fd):
eig[s, k, :] = calc.get_eigenvalues(kpt=k, spin=s)
occ[s, k, :] = calc.get_occupation_numbers(kpt=k,
spin=s)
pew.addArrayValues('eigenvalues_values',
convert_unit(eig, 'eV'))
pew.addArrayValues('eigenvalues_occupations', occ)
#pew.addArrayValues('eigenvalues_values',
# convert_unit(eig, 'eV'))
#pew.addArrayValues('eigenvalues_occupations', occ)
if __name__ == '__main__':
......
......@@ -26,9 +26,10 @@ object OctopusParser extends SimpleExternalParserGenerator(
Simulation Box:
""".r,
cmd = Seq(DefaultPythonInterpreter.pythonExe(), "${envDir}/parsers/octopus/parser/parser-octopus/parser_octopus.py",
"--uri", "${mainFileUri}", "${mainFilePath}"),
"${mainFilePath}"),
resList = Seq(
"parser-octopus/parser_octopus.py",
"parser-octopus/aseoct.py",
"parser-octopus/octopus_logfile_parser.py",
"parser-octopus/generate-octopus-json.py",
"parser-octopus/util.py",
......
......@@ -5,10 +5,10 @@ import org.specs2.mutable.Specification
object OctopusParserSpec extends Specification {
"OctopusParserTest" >> {
"test with json-events" >> {
ParserRun.parse(OctopusParser, "parsers/octopus/test/examples/libvdwxc.quick.info", "json-events") must_== ParseResult.ParseSuccess
ParserRun.parse(OctopusParser, "parsers/octopus/test/examples/ink-gs/static/info", "json-events") must_== ParseResult.ParseSuccess
}
"test with json" >> {
ParserRun.parse(OctopusParser, "parsers/octopus/test/examples/libvdwxc.quick.info", "json") must_== ParseResult.ParseSuccess
ParserRun.parse(OctopusParser, "parsers/octopus/test/examples/ink-gs/static/info", "json") must_== ParseResult.ParseSuccess
}
}
}
# Octopus parser started
ExperimentalFeatures = 0 # default
Debug = 0 # default
ReportMemory = 0 # default
CalculationMode = 1
stdout = "stdout.log"
stderr = "-" # default
WorkDir = "." # default
FlushMessages = 0 # default
ProfilingMode = 0 # default
FFTOptimize = 1 # default
FFTPreparePlan = 0 # default
Units = 1
UnitsXYZFiles = 0 # default
DisableOpenCL = 1 # default
Dimensions = 3 # default
Opened block 'Coordinates'
Coordinates (0, 0) = "O"
Coordinates (0, 1) = -0.5
Coordinates (0, 2) = -0.5
Coordinates (0, 3) = -0.380738
Coordinates (1, 0) = "H"
Coordinates (1, 1) = -0.5
Coordinates (1, 2) = 0.263239
Coordinates (1, 3) = -0.977047
Coordinates (2, 0) = "H"
Coordinates (2, 1) = -0.5
Coordinates (2, 2) = -1.26324
Coordinates (2, 3) = -0.977047
Closed block 'Coordinates'
PseudopotentialSet = 1 # default
SpinComponents = 1 # default
SpeciesProjectorSphereThreshold = 0.001 # default
Splines = 1 # default
SpeciesProjectorSphereThreshold = 0.001 # default
SpeciesTimeDependent = 0 # default
PeriodicDimensions = 0
BoxShape = 3 # default
radius = -0.529177 # default
SymmetriesCompute = 1 # default
KPointsUseSymmetries = 0 # default
KPointsUseTimeReversal = 1 # default
SpinComponents = 1 # default
ExcessCharge = 0 # default
CalcEigenvalues = 1 # default
TotalStates = 0 # default
ExtraStates = 0 # default
StatesBlockSize = 4 # default
ComplexScaling = 0 # default
ComplexScalingRotateSpectrum = 0 # default
ComplexScalingPenalizationFactor = 2 # default
ComplexScalingLocalizedStates = 0 # default
ComplexScalingLocalizationThreshold = 1 # default
ComplexScalingAlpha = 0 # default
ComplexScalingAlphaLeft = 0 # default
ComplexScalingLocalizationRadius = 0 # default
OnlyUserDefinedInitialStates = 0 # default
RestartFixedOccupations = 0 # default
SmearingFunction = 1 # default
NParticleModelmb = 0 # default
SymmetrizeDensity = 0 # default
UseFineMesh = 0 # default
Spacing = -0.529177 # default
CurvMethod = 1 # default
DerivativesStencil = 1 # default
DerivativesOrder = 4 # default
ParallelizationOfDerivatives = 2 # default
DoubleGrid = 0 # default
DoubleGridOrder = 9 # default
ParDomains = -1 # default
ParStates = 0 # default
ParKPoints = 0 # default
ParOther = 0 # default
ScaLAPACKCompatible = 1 # default
MeshOrder = 1 # default
OperateDouble = 1 # default
OperateComplex = 1 # default
OperateSingle = 0 # default
OperateComplexSingle = 0 # default
NLOperatorCompactBoundaries = 0 # default
Output = 262146
OutputInterval = 50 # default
OutputDuringSCF = 0 # default
OutputIterDir = "output_iter" # default
RestartWriteInterval = 50 # default
OutputFormat = 1024
StatesPack = 0 # default
StatesOrthogonalization = 1 # default
StatesCLDeviceMemory = -512 # default
ELFWithCurrentTerm = 1 # default
ParallelizationPoissonAllNodes = 1 # default
PoissonSolver = 8 # default
PoissonSolverNodes = 0 # default
XCFunctional = 10001 # default
XCKernel = 10001 # default
XCKernelLRCAlpha = 0 # default
XCDensityCorrection = 0 # default
XCParallel = 0 # default
TheoryLevel = 4 # default
SICCorrection = 1 # default
CurrentDensity = 2 # default
VDWCorrection = 0 # default
ParticleMass = 1 # default
RashbaSpinOrbitCoupling = 0 # default
FilterPotentials = 2 # default
TDDeltaKickTime = 0 # default
TDDeltaStrength = 0 # default
GyromagneticRatio = 2.00232 # default
RelativisticCorrection = 0 # default
IgnoreExternalIons = 0 # default
ForceTotalEnforce = 0 # default
EwaldAlpha = 0.21 # default
CalculateSelfInducedMagneticField = 0 # default
AbsorbingBoundaries = 0 # default
StatesPack = 1 # default
PCMCalculation = 0 # default
scdm_EXX = 0 # default
TimeZero = 0 # default
FromScratch = 0 # default
ForceComplex = 0 # default
MaximumIter = 200 # default
ConvEnergy = 0 # default
ConvAbsDens = 0 # default
ConvRelDens = 1e-05 # default
ConvAbsEv = 0 # default
ConvRelEv = 0 # default
ConvForce = 0 # default
ConvEigenError = 0 # default
MixField = 1 # default
MixingScheme = 2 # default
MixingPreconditioner = 0 # default
Mixing = 0.3 # default
MixNumberSteps = 3 # default
MixInterval = 1 # default
Eigensolver = 5 # default
EigensolverTolerance = 1e-06 # default
EigensolverMaxIter = 25 # default
Preconditioner = 1 # default
PreconditionerFilterFactor = 0.5 # default
SubspaceDiagonalization = 1 # default
SCFinLCAO = 0 # default
SCFCalculateForces = 1 # default
SCFCalculateDipole = 1 # default
SCFCalculatePartialCharges = 0 # default
LocalMagneticMomentsSphereRadius = 0.484283 # default
RestartWrite = 1 # default
# Octopus parser ended
Units = ev_angstrom
%LSize
0.5 | 0.5 | 0.5
%
PeriodicDimensions = 0
Output = density + forces
OutputFormat = xcrysden
CalculationMode = gs
stdout = "stdout.log"
%Coordinates
'O' | -0.5 | -0.5 | -0.38073800000000002
'H' | -0.5 | 0.263239 | -0.977047
'H' | -0.5 | -1.263239 | -0.977047
%
#iter energy energy_diff abs_dens rel_dens abs_ev rel_ev
1 -4.63635936E+02 5.93218E-04 2.53617E-05 3.17021E-06 2.45880E-04 6.02785E-05
ATOMS
O 3.869930 4.559918 4.449184 0.734828 0.516578 0.398154
H 3.869930 5.323157 3.852875 0.026454 0.880572 -0.836636
H 3.869930 3.796679 3.852875 0.022576 -0.932267 -0.830668
******************************** Grid ********************************
Simulation Box:
Type = minimum
Species = O Radius = 4.000 A
Species = H Radius = 4.000 A
Octopus will run in 3 dimension(s).
Octopus will treat the system as periodic in 0 dimension(s).
Main mesh:
Spacing [A] = ( 0.230, 0.230, 0.230) volume/point [A^3] = 0.01217
# inner mesh = 29448
# total mesh = 48234
Grid Cutoff [eV] = 710.854928 Grid Cutoff [Ry] = 52.246878
**********************************************************************
**************************** Theory Level ****************************
Input: [TheoryLevel = dft]
Exchange-correlation:
Exchange
Slater exchange (LDA)
[1] PAM Dirac, Proceedings of the Cambridge Philosophical Society 26, 376 (1930)
[2] F Bloch, Zeitschrift fuer Physik 57, 545 (1929)
Correlation
Perdew & Zunger (Modified) (LDA)
[1] Perdew and Zunger, Phys. Rev. B 23, 5048 (1981)
[2] Modified to improve the matching between the low- and high-rs parts
Input: [SICCorrection = sic_none]
**********************************************************************
SCF converged in 1 iterations
Eigenvalues [eV]
#st Spin Eigenvalue Occupation
1 -- -25.539198 2.000000
2 -- -13.166270 2.000000
3 -- -9.471058 2.000000
4 -- -7.321899 2.000000
Energy [eV]:
Total = -463.63593586
Free = -463.63593586
-----------
Ion-ion = 187.83709874
Eigenvalues = -110.99684976
Hartree = 574.94896770
Int[n*v_xc] = -145.63804357
Exchange = -98.67381076
Correlation = -12.49144996
vanderWaals = 0.00000000
Delta XC = 0.00000000
Entropy = 0.00000000
-TS = -0.00000000
Kinetic = 325.71661163
External = -1440.97370055
Non-local = -117.70310497
Dipole: [A] [Debye]
<x> = -1.21100E-03 -5.81668E-03
<y> = -7.38976E-04 -3.54945E-03
<z> = -3.72137E-01 -1.78745E+00
Convergence:
abs_dens = 2.53616970E-05 ( 0.00000000E+00)
rel_dens = 3.17021212E-06 ( 1.00000000E-05)
abs_ev = 9.03590657E-06 ( 0.00000000E+00) [eV]
rel_ev = 2.21519370E-06 ( 0.00000000E+00)
Forces on the ions [eV/A]
Ion x y z
1 O 0.734828 0.516578 0.398154
2 H 0.026454 0.880572 -0.836636
3 H 0.022576 -0.932267 -0.830668
----------------------------------------------------------
Max abs force 0.734828 0.932267 0.836636
Total force 0.783858 0.464883 -1.269149
Total torque 0.776193 -0.962257 0.156528
<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
___
.-' `'.
/ \
| ;
| | ___.--,
_.._ |0) ~ (0) | _.---'`__.-( (_.
__.--'`_.. '.__.\ '--. \_.-' ,.--'` `""`
( ,.--'` ',__ /./; ;, '.__.'` __
_`) ) .---.__.' / | |\ \__..--"" """--.,_
`---' .'.''-._.-'`_./ /\ '. \ _.-~~~````~~~-._`-.__.'
| | .' _.-' | | \ \ '. `~---`
\ \/ .' \ \ '. '-._)
\/ / \ \ `=.__`~-.
jgs / /\ `) ) / / `"".`\
, _.-'.'\ \ / / ( ( / /
`--~` ) ) .-'.' '.'. | (
(/` ( (` ) ) '-;
` '-; (-'
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
Running octopus
Version : mimus
Revision : 15432
Build time : Fri Jun 24 18:04:44 CEST 2016
Configuration options : max-dim=3 mpi sse2
Optional libraries : metis mpi2 pfft scalapack
Architecture : x86_64
C compiler : mpicc -std=gnu99 (gcc)
C compiler flags : -g -O2
Fortran compiler : mpif90 (gfortran) (GCC version 4.9.2)
Fortran compiler flags : -g -fbounds-check -ffree-line-length-none -fbacktrace -Wall -Wl,-rpath=/home/askhl/install/fftw-3.3.4/lib -Wl,-rpath=/home/askhl/i
The octopus is swimming in jormungandr (Linux)
Calculation started on 2016/06/26 at 01:44:04
************************** Calculation Mode **************************
Input: [CalculationMode = gs]
**********************************************************************
Reading Coordinates from Coordinates block
Input: [PseudopotentialSet = standard]
****************************** Species *******************************
Reading pseudopotential from file:
'/home/askhl/install/octopus/share/octopus/pseudopotentials/PSF/O.psf'
Calculating atomic pseudo-eigenfunctions for species O ....
Info: l = 0 component used as local potential.
Info: l = 1 is maximum angular momentum considered.
Number of orbitals: total = 9, bound = 4
Reading pseudopotential from file:
'/home/askhl/install/octopus/share/octopus/pseudopotentials/PSF/H.psf'
Calculating atomic pseudo-eigenfunctions for species H ....
Info: l = 0 component used as local potential.
Info: l = 0 is maximum angular momentum considered.
Number of orbitals: total = 16, bound = 1
**********************************************************************
***************************** Symmetries *****************************
Symmetry elements : (C2) 2*(sigma)
Symmetry group : C2v
**********************************************************************
Input: [SpinComponents = unpolarized]
Input: [SmearingFunction = semiconducting]
Input: [SymmetrizeDensity = no]
******************************* States *******************************
Total electronic charge = 8.000
Number of states = 4
States block-size = 4
**********************************************************************
Info: Using default spacing(1) [A] = 0.230
Info: Using default spacing(2) [A] = 0.230
Info: Using default spacing(3) [A] = 0.230
Input: [CurvMethod = curv_uniform]
Input: [DerivativesStencil = stencil_star]
************************** Parallelization ***************************
Info: Octopus will run in *serial*
**********************************************************************
Info: Generating weights for finite-difference discretization of x-gradient
Info: Generating weights for finite-difference discretization of y-gradient
Info: Generating weights for finite-difference discretization of z-gradient
Info: Generating weights for finite-difference discretization of Laplacian
******************************** Grid ********************************
Simulation Box:
Type = minimum
Species = O Radius = 4.000 A
Species = H Radius = 4.000 A
Octopus will run in 3 dimension(s).
Octopus will treat the system as periodic in 0 dimension(s).
Main mesh:
Spacing [A] = ( 0.230, 0.230, 0.230) volume/point [A^3] = 0.01217
# inner mesh = 29448
# total mesh = 48234
Grid Cutoff [eV] = 710.854928 Grid Cutoff [Ry] = 52.246878
**********************************************************************
Info: states-block size = 1.5 MiB
Input: [StatesOrthogonalization = gram_schmidt]
****************************** Hartree *******************************
The chosen Poisson solver is 'interpolating scaling functions'
**********************************************************************
**************************** Theory Level ****************************
Input: [TheoryLevel = dft]
Exchange-correlation:
Exchange
Slater exchange (LDA)
[1] PAM Dirac, Proceedings of the Cambridge Philosophical Society 26, 376 (1930)
[2] F Bloch, Zeitschrift fuer Physik 57, 545 (1929)
Correlation
Perdew & Zunger (Modified) (LDA)
[1] Perdew and Zunger, Phys. Rev. B 23, 5048 (1981)
[2] Modified to improve the matching between the low- and high-rs parts
Input: [SICCorrection = sic_none]
**********************************************************************
Input: [FilterPotentials = filter_TS]
Info: Pseudopotential for O
Radii for localized parts:
local part = 1.2 A
non-local part = 1.0 A
orbitals = 3.8 A
Info: Pseudopotential for H
Radii for localized parts:
local part = 1.0 A
non-local part = 0.0 A
orbitals = 4.6 A
Input: [RelativisticCorrection = non_relativistic]
****************** Approximate memory requirements *******************
Mesh
global : 1.0 MiB
local : 1.1 MiB
total : 2.1 MiB
States
real : 1.5 MiB (par_kpoints + par_states + par_domains)
complex : 2.9 MiB (par_kpoints + par_states + par_domains)
**********************************************************************
Info: Generating external potential