简体   繁体   English

在vscode中,如何在SGE集群的计算节点上调试?

[英]In vscode, how to debug on the computing node of a SGE cluster?

I am trying to do some debug with VSCode on the computing node of a SGE cluster via qrsh commands.我正在尝试通过 qrsh 命令在 SGE 集群的计算节点上使用 VSCode 进行一些调试。 However, every time I entered the debug mode, it always remained at the login node instead of the computing node.但是我每次进入debug模式,总是停留在登录节点,而不是计算节点。

Here's my dilemma:这是我的困境:

First, log in login-node via remote-ssh in vscode首先在vscode中通过remote-ssh登录login-node

Then apply a compute-node with gpu via qrsh command然后通过 qrsh 命令应用一个 gpu 的计算节点

Each time the hostname of the compute-node could change.每次计算节点的主机名都可能更改。

If I hit the debug button trying to do some debugging on the python programmes, it would go back to the login-node.如果我点击调试按钮尝试对 python 程序进行一些调试,它将 go 返回到登录节点。

I tried to google a solution, some people mentioned that can try with proxy jump in ~/.ssh/config.我试着用谷歌搜索一个解决方案,有人提到可以尝试在 ~/.ssh/config 中使用代理跳转。 But it seems not realistic since the applied compute-node's hostname is always different with the previous one.但这似乎不现实,因为应用的计算节点的主机名总是与前一个不同。

At the moment, I have to either print everything out or use pdb.set_trace().目前,我必须打印所有内容或使用 pdb.set_trace()。 Both of them are not convenient for me because some python programmes are very huge.这两个对我来说都不方便,因为有些 python 程序非常庞大。 Using the IDE debugging function is really helpful and efficient for understanding other people's coding.使用 IDE 调试 function 对理解别人的编码确实有帮助和高效。

Is there any solution to fix it?有解决办法吗?

I tried to google some solution, but most of them are for slurm cluster, rather than SGE cluster.我试着用谷歌搜索一些解决方案,但其中大部分是针对 slurm 集群的,而不是 SGE 集群。

You can use wildcards in ~/.ssh/config host definitions.您可以在~/.ssh/config主机定义中使用通配符。

For example, if the compute nodes in your HPC are named compute-1 , compute-2 , compute-3 , etc. then you can set up a single definition for all these hosts.例如,如果您的 HPC 中的计算节点被命名为compute-1compute-2compute-3等,那么您可以为所有这些主机设置一个单一的定义。

Host compute*

You don't give an example of how ProxyJump might be used here so I can't test this, but hopefully this gets you one step closer to a solution.您没有举例说明如何在此处使用ProxyJump ,因此我无法对此进行测试,但希望这能让您离解决方案更近一步。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM