Skip to content

Commit

Permalink
Changed Version check functionality
Browse files Browse the repository at this point in the history
Pyrit won’t argue about different version modules anymore, only if they
are newer than the main module.
  • Loading branch information
John Mora committed Jun 7, 2016
1 parent 786a28c commit 87a8bb3
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions cpyrit/cpyrit.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,8 @@ def fast_address_string(self):

def version_check(mod):
ver = getattr(mod, "VERSION", "unknown")
if ver != _cpyrit_cpu.VERSION:
warnings.warn("WARNING: Version mismatch between %s ('%s') and %s " \
"('%s')\n" % (_cpyrit_cpu, _cpyrit_cpu.VERSION, mod, ver))
if ver >= _cpyrit_cpu.VERSION:
warnings.warn("WARNING: %s version ('%s') is greater than %s ('%s').\n" % (mod, ver, _cpyrit_cpu, _cpyrit_cpu.VERSION))


class Core(util.Thread):
Expand Down Expand Up @@ -438,13 +437,13 @@ def __init__(self):

# CUDA
if config.cfg['use_CUDA'] == 'true' and 'cpyrit._cpyrit_cuda' in sys.modules and config.cfg['use_OpenCL'] == 'false':

CUDA = cpyrit_cuda.listDevices()

for dev_idx, device in enumerate(CUDA):
self.CUDAs.append(CUDACore(queue=self, dev_idx=dev_idx))
CUDA -= 1

# OpenCL
if config.cfg['use_OpenCL'] == 'true' and 'cpyrit._cpyrit_opencl' in sys.modules:

Expand All @@ -459,13 +458,13 @@ def __init__(self):
if 'cpyrit._cpyrit_calpp' in sys.modules:
for dev_idx, device in enumerate(_cpyrit_calpp.listDevices()):
self.cores.append(CALCore(queue=self, dev_idx=dev_idx))


#CPUs
for i in xrange(util.ncpus):
self.cores.append(CPUCore(queue=self))



#Network
if config.cfg['rpc_server'] == 'true':
Expand All @@ -489,7 +488,7 @@ def __init__(self):
self.ncore_uuid = None
else:
self.ncore_uuid = None


for core in self.cores:
self.all.append(core)
Expand Down

0 comments on commit 87a8bb3

Please sign in to comment.