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():
return
len
(
'
%
x'
%
maxint
)
*
4
_logger
=
logging
.
getLogger
(
"theano.gof.cmodule"
)
_logger
.
setLevel
(
logging
.
WARN
)
_logger
.
setLevel
(
logging
.
WARN
ING
)
METH_VARARGS
=
"METH_VARARGS"
METH_NOARGS
=
"METH_NOARGS"
...
...
@@ -536,7 +536,7 @@ class ModuleCache(object):
"without dll in cache, deleting it.
%
s"
,
key_pkl
)
_rmtree
(
root
,
ignore_nocleanup
=
True
,
msg
=
"missing module file"
,
level
=
"info"
)
msg
=
"missing module file"
,
level
=
logging
.
INFO
)
continue
if
(
time_now
-
last_access_time
(
entry
))
<
age_thresh_use
:
_logger
.
debug
(
'refresh adding
%
s'
,
key_pkl
)
...
...
@@ -551,14 +551,14 @@ class ModuleCache(object):
unpickle_failure
()
_rmtree
(
root
,
ignore_nocleanup
=
True
,
msg
=
'broken cache directory [EOF]'
,
level
=
'warning'
)
level
=
logging
.
WARNING
)
continue
except
Exception
:
unpickle_failure
()
if
delete_if_problem
:
_rmtree
(
root
,
ignore_nocleanup
=
True
,
msg
=
'broken cache directory'
,
level
=
'info'
)
level
=
logging
.
INFO
)
else
:
# This exception is often triggered by keys
# that contain references to classes that have
...
...
@@ -597,7 +597,7 @@ class ModuleCache(object):
# This is suspicious. Better get rid of it.
_rmtree
(
root
,
ignore_nocleanup
=
True
,
msg
=
'module file path mismatch'
,
level
=
'info'
)
level
=
logging
.
INFO
)
continue
# Find unversioned keys from other processes.
...
...
@@ -614,7 +614,7 @@ class ModuleCache(object):
'module
%
s'
,
key_pkl
)
_rmtree
(
root
,
ignore_nocleanup
=
True
,
msg
=
"unversioned key(s) in cache"
,
level
=
'info'
)
level
=
logging
.
INFO
)
continue
mod_hash
=
key_data
.
module_hash
...
...
@@ -631,7 +631,7 @@ class ModuleCache(object):
if
delete_if_problem
or
age
>
self
.
age_thresh_del
:
_rmtree
(
root
,
ignore_nocleanup
=
True
,
msg
=
'duplicated module'
,
level
=
'debug'
)
level
=
logging
.
DEBUG
)
else
:
_logger
.
debug
(
'Found duplicated module not '
'old enough yet to be deleted '
...
...
@@ -1025,7 +1025,7 @@ class ModuleCache(object):
assert
entry
not
in
self
.
module_from_name
parent
=
os
.
path
.
dirname
(
entry
)
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
)
finally
:
...
...
@@ -1131,7 +1131,7 @@ class ModuleCache(object):
parent
=
os
.
path
.
dirname
(
entry
)
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
)
# Sanity check: all unversioned keys should have been removed at
...
...
@@ -1157,7 +1157,7 @@ class ModuleCache(object):
# take care of the clean-up.
if
age
>
min_age
:
_rmtree
(
os
.
path
.
join
(
self
.
dirname
,
filename
),
msg
=
'old unversioned'
,
level
=
'info'
,
msg
=
'old unversioned'
,
level
=
logging
.
INFO
,
ignore_nocleanup
=
True
)
finally
:
compilelock
.
release_lock
()
...
...
@@ -1173,7 +1173,7 @@ class ModuleCache(object):
_logger
.
debug
(
'Time spent checking keys:
%
s'
,
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
):
# 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
...
...
@@ -1186,10 +1186,12 @@ def _rmtree(parent, ignore_nocleanup=False, msg='', level='debug',
log_msg
=
'Deleting'
if
msg
:
log_msg
+=
' (
%
s)'
%
msg
eval
(
level
)(
'
%
s:
%
s'
%
(
log_msg
,
parent
)
)
_logger
.
log
(
level
,
'
%
s:
%
s'
,
log_msg
,
parent
)
shutil
.
rmtree
(
parent
)
except
Exception
,
e
:
# 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
):
try
:
_logger
.
info
(
'placing "delete.me" in
%
s'
,
parent
)
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论