提交 2242be8a authored 作者: Olivier Delalleau's avatar Olivier Delalleau

Made directory creation more robust to parallel experiments

上级 2bc77c39
......@@ -48,9 +48,18 @@ initcutils_ext(void)
"""
import cmodule
import os
import os, time
loc=os.path.join(config.compiledir,'cutils_ext')
if not os.path.exists(loc):
try:
os.makedirs(loc)
except OSError:
# This may happen when running multiple jobs in parallel, if they
# attempt to create the same directory simultaneously.
time.sleep(5) # May not be needed, but who knows with NFS.
if not os.path.exists(loc):
# Looks like something else is not working.
raise
cmodule.gcc_module_compile_str('cutils_ext', code, location = loc)
from cutils_ext.cutils_ext import *
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论