French | English
Seminars at LRTS


Simulation launch

How to launch a remote Matlab simulation :

  • Log on to a UNIX workstation (or OS X)

      # ssh -l your_login workstation_name

  • Use the command “nohup” to inform the system that Matlab must not terminate once you log off.

  • Launch MATLAB with the option “-nojvm” to avoid launching the graphical interface.

  • Use “<” to redirect the keyboard input from a “.m” file in which are the Matlab commands for your simulation.

  • Use “>” to redirect the screen output to a file.

  • Use “&” to launch a simulation in the background so you can still use the prompt.

    The resulting command looks like this :

      # nohup matlab -nojvm < commands_file.m > output_file.txt &

    • Log off using “exit”.

Note : there is a chance that Matlab is not on the path. It must then be fully specified. For example, on OS X, the path is Applications/MATLAB6p5/bin/matlab

Hints :

  • When you type a repertory name in the prompt, use the TAB key to complete the name.

  • If your omitted the “&” to launch the simulation in the background, type Ctr-Z to pause the process (the simulation) and regain the prompt. Then type “bg” for background, or “bg process_id”.

  • The command “ps -aux” lists all the running processes (and their id) on the station.

  • The command “top” lists the ressources utilized by each process. Type “q” to quit.

  • The command “renice process_id” allows the use of mor resources by the other users.

!!! In your simulations, be sure to :

  • Save all your variables every 30 minutes or so. For example, place “save simu.mat” so that it is executed after a certain number of iterations. Thus, you will not lose all of your data if a problem occurs.

  • Save the iterations variables in a file in order to know how far the simulation has gone. Le fichier output_file.txt will not necessarily updated in real time. The command “save” will be. Don't abuse this command as the hard disk accesses slow the simulation.

    To know the progress of your simulation, log on to the station, launch another instance of Matlab and load the file of the iterations variables.