EDIT:只需确认您是否可以重现此内容就会很有用。只需一台计算机即可尝试此操作(无需远程连接)。
Update似乎其他人无法在 Mac 或 Win7 上重现此问题,因此它要么是 WinXP 特定的,要么是我的机器特定的。此时我要放弃了。
最好有一个关于前端和内核如何通信的教程,这样我们就可以调试远程内核问题。任何此类一般性答案(或其他地方教程的链接)都是非常受欢迎的。我已经知道了远程内核策略 http://library.wolfram.com/infocenter/Conferences/7250/作者:萨沙·克拉基。
现在是实际问题:当我以任何方式连接到远程计算机时(例如使用远程内核策略),前端迟早会冻结。我怎样才能防止这种情况发生?
以下是在单台计算机上重现问题的方法(无需远程连接):
-
创建新的内核配置(评估菜单 -> 内核配置选项...)
选择高级选项。
MLOpen 的参数:
-LinkName "8000@YOUR-IP-HERE,8001@YOUR-IP-HERE" -LinkMode Listen
-LinkProtocol TCPIP -LinkHost "YOUR-IP-HERE" -LinkOptions MLDontInteract
(代替YOUR-IP-HERE
与您计算机的 IP 地址。在 Windows 上,您可以通过输入以下命令来获取此信息ipconfig
在命令窗口中。)
启动内核的 Shell 命令:留空(我们将手动执行)
打开一个新笔记本,将笔记本的内核设置为您刚刚设置的内核,然后评估一些内容(1+1
).
-
现在我们需要在连接超时之前手动启动内核。所以启动一个新内核(math
)在命令行模式下,并评估以下内容:
link=LinkConnect["8000,8001",LinkProtocol->"TCPIP"] (* connect to front end link *)
$ParentLink = link; (* set the front end link as parent link *)
现在连接已建立,一切似乎都正常工作(除了前端粉红色消息窗口中的一条消息)
评价Manipulate[n, {n, 0, 100, 1}]
。首先,这似乎也有效。现在使用滑块。前端迟早会冻结并需要被杀死。对我来说,上下拖动滑块大约 10 秒而不释放它总是足够的。
为什么前端会冻结?如何在前端和内核之间创建 TCPIP 模式连接,以使一切正常工作?
一些注意事项:
- 我用的是Windows XP。
- 如果我使用,问题永远不会出现
LinkProtocol -> "SharedMemory"
.
- 使用评估 -> 中止评估中止计算确实可以正常工作。
- 我已经验证使用
Links[]
that MathLink`$PreemptiveLink
and MathLink`$ServiceLink
被创建并且LinkConnectedQ[]
回报True
在他们。
再次注意,只有在拖动Manipualate
连续按住滑块几秒钟而不松开。
链接到 MathGroup 上的同一问题。 https://groups.google.com/d/msg/comp.soft-sys.math.mathematica/TWmbmovDskc/0KPXGj7Ml6UJ
Related: Firewall settings for remote kernel to work (Mathematica) https://stackoverflow.com/questions/6226196/firewall-settings-for-remote-kernel-to-work-mathematica
(不是答案,但很难将其写为评论)
仅供参考,这里有一些关于前端如何与内核对话的信息http://reference.wolfram.com/mathematica/tutorial/AdvancedDynamicFunctionality.html http://reference.wolfram.com/mathematica/tutorial/AdvancedDynamicFunctionality.html
大约一半的地方,它说
The front end and kernel communicate with each other through several
MathLink connections, known as the main link, the preemptive link,
and the service link. The main and preemptive links are pathways by
which the front end can send evaluation requests to the kernel, and
the kernel can respond with results. The service link works in reverse,
with the kernel sending requests to the front end.
还有更多。也许会有帮助。此外,第 31 页的 PDF 文件中也包含相同的信息:
http://www.wolfram.com/learningcenter/tutorialcollection/DynamicInteractivity/ http://www.wolfram.com/learningcenter/tutorialcollection/DynamicInteractivity/
内核和前端之间的实际消息传递协议必须非常先进。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)