Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
f7553bee
提交
f7553bee
authored
7月 16, 2011
作者:
Pascal Lamblin
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Pass logging levels to _rmtree, instead of function name as strings.
Also fix error that was causing compilation cache to fill up.
上级
061e875d
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
14 行增加
和
12 行删除
+14
-12
cmodule.py
theano/gof/cmodule.py
+14
-12
没有找到文件。
theano/gof/cmodule.py
浏览文件 @
f7553bee
...
@@ -28,7 +28,7 @@ def local_bitwidth():
...
@@ -28,7 +28,7 @@ def local_bitwidth():
return
len
(
'
%
x'
%
maxint
)
*
4
return
len
(
'
%
x'
%
maxint
)
*
4
_logger
=
logging
.
getLogger
(
"theano.gof.cmodule"
)
_logger
=
logging
.
getLogger
(
"theano.gof.cmodule"
)
_logger
.
setLevel
(
logging
.
WARN
)
_logger
.
setLevel
(
logging
.
WARN
ING
)
METH_VARARGS
=
"METH_VARARGS"
METH_VARARGS
=
"METH_VARARGS"
METH_NOARGS
=
"METH_NOARGS"
METH_NOARGS
=
"METH_NOARGS"
...
@@ -536,7 +536,7 @@ class ModuleCache(object):
...
@@ -536,7 +536,7 @@ class ModuleCache(object):
"without dll in cache, deleting it.
%
s"
,
"without dll in cache, deleting it.
%
s"
,
key_pkl
)
key_pkl
)
_rmtree
(
root
,
ignore_nocleanup
=
True
,
_rmtree
(
root
,
ignore_nocleanup
=
True
,
msg
=
"missing module file"
,
level
=
"info"
)
msg
=
"missing module file"
,
level
=
logging
.
INFO
)
continue
continue
if
(
time_now
-
last_access_time
(
entry
))
<
age_thresh_use
:
if
(
time_now
-
last_access_time
(
entry
))
<
age_thresh_use
:
_logger
.
debug
(
'refresh adding
%
s'
,
key_pkl
)
_logger
.
debug
(
'refresh adding
%
s'
,
key_pkl
)
...
@@ -551,14 +551,14 @@ class ModuleCache(object):
...
@@ -551,14 +551,14 @@ class ModuleCache(object):
unpickle_failure
()
unpickle_failure
()
_rmtree
(
root
,
ignore_nocleanup
=
True
,
_rmtree
(
root
,
ignore_nocleanup
=
True
,
msg
=
'broken cache directory [EOF]'
,
msg
=
'broken cache directory [EOF]'
,
level
=
'warning'
)
level
=
logging
.
WARNING
)
continue
continue
except
Exception
:
except
Exception
:
unpickle_failure
()
unpickle_failure
()
if
delete_if_problem
:
if
delete_if_problem
:
_rmtree
(
root
,
ignore_nocleanup
=
True
,
_rmtree
(
root
,
ignore_nocleanup
=
True
,
msg
=
'broken cache directory'
,
msg
=
'broken cache directory'
,
level
=
'info'
)
level
=
logging
.
INFO
)
else
:
else
:
# This exception is often triggered by keys
# This exception is often triggered by keys
# that contain references to classes that have
# that contain references to classes that have
...
@@ -597,7 +597,7 @@ class ModuleCache(object):
...
@@ -597,7 +597,7 @@ class ModuleCache(object):
# This is suspicious. Better get rid of it.
# This is suspicious. Better get rid of it.
_rmtree
(
root
,
ignore_nocleanup
=
True
,
_rmtree
(
root
,
ignore_nocleanup
=
True
,
msg
=
'module file path mismatch'
,
msg
=
'module file path mismatch'
,
level
=
'info'
)
level
=
logging
.
INFO
)
continue
continue
# Find unversioned keys from other processes.
# Find unversioned keys from other processes.
...
@@ -614,7 +614,7 @@ class ModuleCache(object):
...
@@ -614,7 +614,7 @@ class ModuleCache(object):
'module
%
s'
,
key_pkl
)
'module
%
s'
,
key_pkl
)
_rmtree
(
root
,
ignore_nocleanup
=
True
,
_rmtree
(
root
,
ignore_nocleanup
=
True
,
msg
=
"unversioned key(s) in cache"
,
msg
=
"unversioned key(s) in cache"
,
level
=
'info'
)
level
=
logging
.
INFO
)
continue
continue
mod_hash
=
key_data
.
module_hash
mod_hash
=
key_data
.
module_hash
...
@@ -631,7 +631,7 @@ class ModuleCache(object):
...
@@ -631,7 +631,7 @@ class ModuleCache(object):
if
delete_if_problem
or
age
>
self
.
age_thresh_del
:
if
delete_if_problem
or
age
>
self
.
age_thresh_del
:
_rmtree
(
root
,
ignore_nocleanup
=
True
,
_rmtree
(
root
,
ignore_nocleanup
=
True
,
msg
=
'duplicated module'
,
msg
=
'duplicated module'
,
level
=
'debug'
)
level
=
logging
.
DEBUG
)
else
:
else
:
_logger
.
debug
(
'Found duplicated module not '
_logger
.
debug
(
'Found duplicated module not '
'old enough yet to be deleted '
'old enough yet to be deleted '
...
@@ -1025,7 +1025,7 @@ class ModuleCache(object):
...
@@ -1025,7 +1025,7 @@ class ModuleCache(object):
assert
entry
not
in
self
.
module_from_name
assert
entry
not
in
self
.
module_from_name
parent
=
os
.
path
.
dirname
(
entry
)
parent
=
os
.
path
.
dirname
(
entry
)
assert
parent
.
startswith
(
os
.
path
.
join
(
self
.
dirname
,
'tmp'
))
assert
parent
.
startswith
(
os
.
path
.
join
(
self
.
dirname
,
'tmp'
))
_rmtree
(
parent
,
msg
=
'old cache directory'
,
level
=
'info'
,
_rmtree
(
parent
,
msg
=
'old cache directory'
,
level
=
logging
.
INFO
,
ignore_nocleanup
=
True
)
ignore_nocleanup
=
True
)
finally
:
finally
:
...
@@ -1131,7 +1131,7 @@ class ModuleCache(object):
...
@@ -1131,7 +1131,7 @@ class ModuleCache(object):
parent
=
os
.
path
.
dirname
(
entry
)
parent
=
os
.
path
.
dirname
(
entry
)
assert
parent
.
startswith
(
os
.
path
.
join
(
self
.
dirname
,
'tmp'
))
assert
parent
.
startswith
(
os
.
path
.
join
(
self
.
dirname
,
'tmp'
))
_rmtree
(
parent
,
msg
=
'unversioned'
,
level
=
'info'
,
_rmtree
(
parent
,
msg
=
'unversioned'
,
level
=
logging
.
INFO
,
ignore_nocleanup
=
True
)
ignore_nocleanup
=
True
)
# Sanity check: all unversioned keys should have been removed at
# Sanity check: all unversioned keys should have been removed at
...
@@ -1157,7 +1157,7 @@ class ModuleCache(object):
...
@@ -1157,7 +1157,7 @@ class ModuleCache(object):
# take care of the clean-up.
# take care of the clean-up.
if
age
>
min_age
:
if
age
>
min_age
:
_rmtree
(
os
.
path
.
join
(
self
.
dirname
,
filename
),
_rmtree
(
os
.
path
.
join
(
self
.
dirname
,
filename
),
msg
=
'old unversioned'
,
level
=
'info'
,
msg
=
'old unversioned'
,
level
=
logging
.
INFO
,
ignore_nocleanup
=
True
)
ignore_nocleanup
=
True
)
finally
:
finally
:
compilelock
.
release_lock
()
compilelock
.
release_lock
()
...
@@ -1173,7 +1173,7 @@ class ModuleCache(object):
...
@@ -1173,7 +1173,7 @@ class ModuleCache(object):
_logger
.
debug
(
'Time spent checking keys:
%
s'
,
_logger
.
debug
(
'Time spent checking keys:
%
s'
,
self
.
time_spent_in_check_key
)
self
.
time_spent_in_check_key
)
def
_rmtree
(
parent
,
ignore_nocleanup
=
False
,
msg
=
''
,
level
=
'debug'
,
def
_rmtree
(
parent
,
ignore_nocleanup
=
False
,
msg
=
''
,
level
=
logging
.
DEBUG
,
ignore_if_missing
=
False
):
ignore_if_missing
=
False
):
# On NFS filesystems, it is impossible to delete a directory with open
# On NFS filesystems, it is impossible to delete a directory with open
# files in it. So instead, some commands in this file will respond to a
# files in it. So instead, some commands in this file will respond to a
...
@@ -1186,10 +1186,12 @@ def _rmtree(parent, ignore_nocleanup=False, msg='', level='debug',
...
@@ -1186,10 +1186,12 @@ def _rmtree(parent, ignore_nocleanup=False, msg='', level='debug',
log_msg
=
'Deleting'
log_msg
=
'Deleting'
if
msg
:
if
msg
:
log_msg
+=
' (
%
s)'
%
msg
log_msg
+=
' (
%
s)'
%
msg
eval
(
level
)(
'
%
s:
%
s'
%
(
log_msg
,
parent
)
)
_logger
.
log
(
level
,
'
%
s:
%
s'
,
log_msg
,
parent
)
shutil
.
rmtree
(
parent
)
shutil
.
rmtree
(
parent
)
except
Exception
,
e
:
except
Exception
,
e
:
# If parent still exists, mark it for deletion by a future refresh()
# If parent still exists, mark it for deletion by a future refresh()
_logger
.
debug
(
'In _rmtree, encountered exception:
%
s(
%
s)'
,
type
(
e
),
e
)
if
os
.
path
.
exists
(
parent
):
if
os
.
path
.
exists
(
parent
):
try
:
try
:
_logger
.
info
(
'placing "delete.me" in
%
s'
,
parent
)
_logger
.
info
(
'placing "delete.me" in
%
s'
,
parent
)
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论