Fix memory corruption, python package installability

Former-commit-id: d9d89ff20b67132e8d88d55b206a8856a395f1f2
This commit is contained in:
Marek Nečada 2018-05-15 14:37:05 +03:00
parent 65e8271feb
commit 1cc1793f57
6 changed files with 9 additions and 6 deletions

View File

@ -3,5 +3,5 @@ __version__ = get_distribution('qpms').version
from qpms_c import * from qpms_c import *
from .qpms_p import * from .qpms_p import *
from .lattices import * from .lattices2d import *
from .hexpoints import * from .hexpoints import *

View File

@ -437,7 +437,7 @@ def hexlattice_get_AB(lMax, k_hexside, maxlayer, circular=True, return_points =
from scipy.constants import c from scipy.constants import c
from .timetrack import _time_b, _time_e from .timetrack import _time_b, _time_e
from .qpms_p import symz_indexarrays from .tmatrices import symz_indexarrays
def hexlattice_zsym_getSVD(lMax, TMatrices_om, epsilon_b, hexside, maxlayer, omega, klist, gaussianSigma=False, onlyNmin=0, verbose=False): def hexlattice_zsym_getSVD(lMax, TMatrices_om, epsilon_b, hexside, maxlayer, omega, klist, gaussianSigma=False, onlyNmin=0, verbose=False):
btime = _time_b(verbose) btime = _time_b(verbose)

View File

@ -7,7 +7,7 @@ cdef double _s3 = math.sqrt(3)
from scipy.constants import c from scipy.constants import c
from .timetrack import _time_b, _time_e from .timetrack import _time_b, _time_e
from .qpms_p import symz_indexarrays from .tmatrices import symz_indexarrays
from .hexpoints import hexlattice_get_AB from .hexpoints import hexlattice_get_AB
cpdef hexlattice_zsym_getSVD(int lMax, TMatrices_om, double epsilon_b, double hexside, size_t maxlayer, double omega, klist, gaussianSigma=False, int onlyNmin=0, verbose=False): cpdef hexlattice_zsym_getSVD(int lMax, TMatrices_om, double epsilon_b, double hexside, size_t maxlayer, double omega, klist, gaussianSigma=False, int onlyNmin=0, verbose=False):

View File

@ -185,6 +185,7 @@ class Scattering(object):
class LatticeScattering(Scattering): class LatticeScattering(Scattering):
def __init__(self, lattice_spec, k_0, zSym = False): def __init__(self, lattice_spec, k_0, zSym = False):
pass
""" """

View File

@ -1574,7 +1574,9 @@ int qpms_cython_trans_calculator_get_AB_arrays_loop(
while(local_indices[ax] == innerloop_shape[ax] && ax >= 0) { while(local_indices[ax] == innerloop_shape[ax] && ax >= 0) {
// overflow to the next digit but stop when reached below the last one // overflow to the next digit but stop when reached below the last one
local_indices[ax] = 0; local_indices[ax] = 0;
local_indices[--ax]++; //local_indices[--ax]++; // dekrementace indexu pod nulu a následná inkrementace poruší paměť FIXME
ax--;
if (ax >= 0) local_indices[ax]++;
} }
if (ax >= 0) // did not overflow, get back to the lowest index if (ax >= 0) // did not overflow, get back to the lowest index
ax = resnd - 1; ax = resnd - 1;

View File

@ -22,7 +22,7 @@ qpms_c = Extension('qpms_c',
'qpms/gaunt.c',#'qpms/gaunt.h','qpms/vectors.h','qpms/translations.h', 'qpms/gaunt.c',#'qpms/gaunt.h','qpms/vectors.h','qpms/translations.h',
# FIXME http://stackoverflow.com/questions/4259170/python-setup-script-extensions-how-do-you-include-a-h-file # FIXME http://stackoverflow.com/questions/4259170/python-setup-script-extensions-how-do-you-include-a-h-file
'qpms/translations.c'], 'qpms/translations.c'],
extra_compile_args=['-std=c99','-ggdb','-O3', extra_compile_args=['-std=c99','-ggdb', '-O0',
'-DQPMS_COMPILE_PYTHON_EXTENSIONS', # this is required '-DQPMS_COMPILE_PYTHON_EXTENSIONS', # this is required
#'-DQPMS_USE_OMP', #'-DQPMS_USE_OMP',
'-DDISABLE_NDEBUG', # uncomment to enable assertions in the modules '-DDISABLE_NDEBUG', # uncomment to enable assertions in the modules
@ -35,7 +35,7 @@ qpms_c = Extension('qpms_c',
) )
setup(name='qpms', setup(name='qpms',
version = "0.2.15", version = "0.2.99",
packages=['qpms'], packages=['qpms'],
# setup_requires=['setuptools_cython'], # setup_requires=['setuptools_cython'],
install_requires=['cython>=0.21','quaternion','spherical_functions','py_gmm'], install_requires=['cython>=0.21','quaternion','spherical_functions','py_gmm'],