Commit fc900710 authored by Martin Reinecke's avatar Martin Reinecke

coverage experiment

parent 0eb0d508
Pipeline #29037 failed with stages
in 6 minutes and 37 seconds
......@@ -33,8 +33,8 @@ test_python2_with_coverage:
stage: test
script:
- python setup.py install --user -f
- mpiexec -n 2 --bind-to none nosetests -q --with-coverage --cover-package=nifty4 --cover-branches --cover-erase 2> /dev/null
- nosetests -q --with-coverage --cover-package=nifty4 --cover-branches 2> /dev/null
- mpiexec -n 2 --bind-to none nosetests -q --with-coverage --cover-package=nifty4 --cover-erase 2> /dev/null
- nosetests -q --with-coverage --cover-package=nifty4 2> /dev/null
- >
coverage report --omit "*plotting*"
- >
......
......@@ -59,32 +59,32 @@ class data_object(object):
self._distaxis = distaxis
self._data = data
def _sanity_checks(self):
# check whether the distaxis is consistent
if self._distaxis < -1 or self._distaxis >= len(self._shape):
raise ValueError
itmp = np.array(self._distaxis)
otmp = np.empty(ntask, dtype=np.int)
_comm.Allgather(itmp, otmp)
if np.any(otmp != self._distaxis):
raise ValueError
# check whether the global shape is consistent
itmp = np.array(self._shape)
otmp = np.empty((ntask, len(self._shape)), dtype=np.int)
_comm.Allgather(itmp, otmp)
for i in range(ntask):
if np.any(otmp[i, :] != self._shape):
raise ValueError
# check shape of local data
if self._distaxis < 0:
if self._data.shape != self._shape:
raise ValueError
else:
itmp = np.array(self._shape)
itmp[self._distaxis] = _shareSize(self._shape[self._distaxis],
ntask, rank)
if np.any(self._data.shape != itmp):
raise ValueError
# def _sanity_checks(self):
# # check whether the distaxis is consistent
# if self._distaxis < -1 or self._distaxis >= len(self._shape):
# raise ValueError
# itmp = np.array(self._distaxis)
# otmp = np.empty(ntask, dtype=np.int)
# _comm.Allgather(itmp, otmp)
# if np.any(otmp != self._distaxis):
# raise ValueError
# # check whether the global shape is consistent
# itmp = np.array(self._shape)
# otmp = np.empty((ntask, len(self._shape)), dtype=np.int)
# _comm.Allgather(itmp, otmp)
# for i in range(ntask):
# if np.any(otmp[i, :] != self._shape):
# raise ValueError
# # check shape of local data
# if self._distaxis < 0:
# if self._data.shape != self._shape:
# raise ValueError
# else:
# itmp = np.array(self._shape)
# itmp[self._distaxis] = _shareSize(self._shape[self._distaxis],
# ntask, rank)
# if np.any(self._data.shape != itmp):
# raise ValueError
@property
def dtype(self):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment