Skip to content

Commit 9650fae

Browse files
committed
new update (proper timeout function for os.system)
1 parent 3428d16 commit 9650fae

File tree

7 files changed

+40
-3
lines changed

7 files changed

+40
-3
lines changed

CHANGES

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
* Vnext
2+
3+
* V1.4.0909
24
* fixing a few typos
35
* adding system function with timeout possibility
46
(useful for research in computer engineering where
@@ -8,6 +10,7 @@
810
(suggested by Anton)
911
* making text to select UIDs less ambiguous (asked by Anton)
1012
* fixing bug in flatten_dict while working with CLSmith
13+
* changing COPYRIGHT to COPYRIGHT.txt and LICENSE to LICENSE.txt
1114

1215
* v1.3.0824
1316
* fixing bug with repository recaching (when pulling dependent repositories)

COPYRIGHT renamed to COPYRIGHT.txt

File renamed without changes.

LICENSE renamed to LICENSE.txt

File renamed without changes.

ck/kernel.py

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
"detect_cur_cid":"#",
4545
"detect_cur_cid1":"^",
4646

47-
"version":["1", "3", "0824"],
47+
"version":["1", "4", "0909"],
4848
"error":"CK error: ",
4949
"json_sep":"*** ### --- CK JSON SEPARATOR --- ### ***",
5050
"default_module":"data",
@@ -346,6 +346,22 @@ def err(r):
346346
out('Error: '+re)
347347
exit(rc)
348348

349+
##############################################################################
350+
# Support function for system_with_timeout
351+
352+
def system_with_timeout_kill(pid):
353+
import psutil
354+
355+
p=psutil.Process(pid)
356+
pc=p.get_children(recursive=True)
357+
358+
for px in pc:
359+
px.kill()
360+
361+
p.kill()
362+
363+
return
364+
349365
##############################################################################
350366
# Substituting os.system with possibility for time out
351367

@@ -392,7 +408,7 @@ def system_with_timeout(i):
392408
t=time.time()-t0
393409

394410
if t>=xto and p.poll()==None:
395-
p.kill()
411+
system_with_timeout_kill(p.pid)
396412

397413
return {'return':8, 'error':'process timed out and had been terminated'}
398414

debian/changelog

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,21 @@
1+
ck (1.4.0909) RELEASED; urgency=high
2+
3+
* fixing a few typos
4+
* adding system function with timeout possibility
5+
(useful for research in computer engineering where
6+
generated code may be buggy and result in infinite loops,
7+
i.e. during autotuning or compiler testing and bug detection)
8+
* ck where repo:<name> will print URL for remote repositories
9+
(suggested by Anton)
10+
* making text to select UIDs less ambiguous (asked by Anton)
11+
* fixing bug in flatten_dict while working with CLSmith
12+
* changing COPYRIGHT to COPYRIGHT.txt and LICENSE to LICENSE.txt
13+
14+
-- Grigori Fursin <[email protected]> 9 Sep 2015 11:12:13 +0100
15+
16+
117
ck (1.3.0824) RELEASED; urgency=high
18+
219
* fixing bug with repository recaching (when pulling dependent repositories)
320

421
-- Grigori Fursin <[email protected]> 24 Aug 2015 11:12:13 +0100

debian/control

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ Description: enabling collaborative and reproducible research and experimentatio
3838
(by combining autotuning, run-time adaptation, machine learning
3939
and public repository of knowledge) as described in the following
4040
paper:
41+
* [Interactive] http://cknowledge.org/repo
4142
* [PDF] https://hal.inria.fr/hal-01054763/document
4243
* [HTML] https://hal.inria.fr/hal-01054763
4344
* [BibTex] https://hal.inria.fr/hal-01054763v1/bibtex

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
setup(
1111
name='ck',
12-
version='1.3.0824',
12+
version='1.4.0909',
1313
url='https://github.com/ctuning/ck',
1414
license='BSD 3-clause',
1515
author='Grigori Fursin and non-profit cTuning foundation',

0 commit comments

Comments
 (0)