Using remote matlab on a cluster: Lost connection but job keeps calculating. How to reopen matlab gui?

조회 수: 5 (최근 30일)
Just lost connection while a script on matlab was running remotely on a linux cluster. I was running it from the remote matlab GUI just like I would do locally. Suddently I lost connection and that window closed, but reconnecting again to the cluster I can see the script keeps running with "top" command. Is there any way to reopen the matlab GUI just where I left it and keep seeing progress on the console?
  댓글 수: 3
Bjorn Gustavsson
Bjorn Gustavsson 2020년 6월 4일
For future work, I suggest you start running matlab either with vnc-server-viewer (for the full gui-experience) or simply through screen running in an x-term. Those methods work well for interuption-sensitive connections.
Good luck this time!
Jesús Gutiérrez
Jesús Gutiérrez 2020년 6월 4일
편집: Jesús Gutiérrez 2020년 6월 4일
Thanks for your responses!
Im running throuh a mobaxterm terminal. I introduce "module load matlab" and next "matlab", just after that a matlab window opens just like when you use regular matlab on a windows machine. There I can run my scripts.
The problem comes when I loose connection and therefore the matlab window closes. When I reconnect to the cluster I can see that the script keeps running with the resource manager but I don't know how can I reopen the Matlab window I had in order to keep seeing what the console promts.

댓글을 달려면 로그인하십시오.

채택된 답변

Jason Ross
Jason Ross 2020년 6월 4일
The short answer: you can't get it back. It sounds like it's using X forwarding to send the GUI from the remote machine to your local machine.
As Bjorn Gustavsson says, if you are on a connection that has a high chance of dropping out or being ended somehow, you need to keep the display at the remote end if you want to keep this workflow. For Linux that means VNC (or something very much like it) if you want the GUI, or something like screen (or tmux) if you just want it in the terminal session.
Other approaches that may work:
  • Use one of the support packages / add-ins for the different cluster types we integrate with, installed on your local machine. This assumes that your cluster admins have means of supporting this, and a bunch of other things. Most importantly it moves the network connection out of the "job" of updating display -- only the submit/status/data comes back over the wire. As I mentioned earlier, this assumes a number of things about your environment, setup, etc. So it may not be workable for you.
  • Instead of running an interactive job from the console, submit jobs using the batch command. This will submit a job to the cluster whose results you can retrieve later. If you lose connection to the cluster you can reconnect/restart and then find the job and check the results.
  댓글 수: 2
Jesús Gutiérrez
Jesús Gutiérrez 2020년 6월 4일
Thanks a lot, I will follow your recommendations next time. Just got installed on my university's cluster Matlab and everything is new.
Jason Ross
Jason Ross 2020년 6월 4일
You might ask the cluster admins what their recommended approaches are, I can imagine this is a relatively common question they get -- X forwarding has been around a long time (and I remember thinking how cool it was the first time I saw it) but it has a number of deficiencies like the one you saw. There are plenty of solutions that have been developed in the meantime, it's just a question of what your admins support/recommend.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Startup and Shutdown에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by