UBC Home Page -
UBC Home Page -
UBC Home Page UBC Home Page -
-
-
News Events Directories Search UBC myUBC Login
-
- -
Matlab and Comsol Tips  

1. INTRODUCTION

This page explains the startup options and commands for the different versions of Matlab and Comsol (formerly Femlab) available in the IAM. With the exception of starting the nojvm (text) version of Matlab, it is recommended to execute these commands in the background by putting & at the end of the command line. After starting a computational task in Matlab/Comsol, its priority should be reduced, or its niceness increased, by using

renice new_niceness pid ,

where pid is the process id, and the new niceness level is set by default to 10 (see also manual pages for renice). pid is given by the shell upon issuing the Matlab startup command, and can also be retrieved by using the command

matlab_pid ,

which is an alias for

ps -eo pid,args | grep MATLAB | grep -v grep | awk '{print $1}' .

Similarly, the current niceness level of your Matlab job can be retrieved by using the command

matlab_ni .

If you want to renice your newly started Matlab process from 0 to 10, you can use the command

renice_matlab ,

which is an alias for

renice `ps -eo pid,args | grep MATLAB | grep -v grep | awk '{print $1}'` .

Alternatively to using renice from the shell, you can issue the top command, which will list the different processes running on the local machine, together with their id's and niceness levels. From top's internal command line, type r for renice, and then specify the pid corresponding to the Matlab/Comsol process.

Please note that the priority of any unreniced Matlab or Comsol jobs will be automatically changed to the lowest level, thus giving preference to those who have used nice or renice. Once the process is reniced, the user can only lower its priority; an attempt to increase the priority (reduce niceness) will produce a "Permission denied" message. Therefore, if you want to renice your Matlab job, do it immediately after starting it, before the system automatically renices it to an even lower priority.

TOP

2. MATLAB

The most recent Matlab release installed in the IAM is R2011a (version 7.12). Matlab R2008a (version 7.6) is also available.

  1. Startup Commands


  2. Note that the text version of Matlab has to run on the foreground, and so there is no & sign after the matlab-nojvm command.

    With graphical desktop interface (java support)
    Matlab R2011a: matlab &    or    matlab2011a &
    Matlab R2008a: matlab2008a &
    With text interface (no java support)
    Matlab R2011a: matlab-nojvm    or    matlab2011a-nojvm
    Matlab R2008a: matlab2008a-nojvm

    If you want to log off your desktop after starting a Matlab job, use the nohup command. Please note that nohup will not work with aliases (such as those listed above) and that the started job has to run in the foreground. Below is an example of using nohup with Matlab:

    Without java support, using source file file.m nohup matlab -nojvm file.m

  3. Startup Troubleshooting Hints


  4. Problem Solution
    Cannot load desktop Try deleting the file classpath.txt in your home directory
    Cannot start Matlab or a particular toolbox because the maximum number of users has been reached Wait for some time until the number of users drops below the limit determined by the license
    Cannot start Matlab with nohup Use a nohup startup example from Section 2a above. Make sure there is no & sign at the end of the command line.
    Certain functions/routines are not found when compiling Matlab code Make sure the locations of the functions/routines are known to Matlab; e.g. try using the addpath() command in your code
TOP

3. COMSOL

The current Comsol version installed in the IAM is 4.2a. (Note: Comsol used to be called Femlab prior to version 3.2.)

  1. Startup Commands


  2. Without Matlab interface comsol &     or     femlab &
    With Matlab R2011a desktop comsolmatlab &     or     femlabmatlab &

  3. Documentation


  4. NOTE: You must be a registered IAM Comsol user to access the documentation. Please contact the IAM administrator to register.

    Introduction to Comsol Multiphysics 4.2a [ HTML ] [ PDF ]
    COMSOL 4.2a Installation and Operations Guide [ HTML ] [ PDF ]
    COMSOL 4.2a Multiphysics User's Guide [ HTML ] [ PDF ]
    COMSOL 4.2a Multiphysics Reference Guide [ HTML ] [ PDF ]
    COMSOL 4.2a Java API Reference Guide [ HTML ] [ PDF ]
    COMSOL 4.2a Physics Interface Builder User's Guide [ HTML ] [ PDF ]
    COMSOL 4.2a LiveLink for Matlab Introduction [ HTML ] [ PDF ]
    COMSOL 4.2a LiveLink for Matlab User's Guide [ HTML ] [ PDF ]
    COMSOL 4.2a Release Notes [ HTML ] [ PDF ]

TOP
Last Update: 24 Nov 2011 UBC Institute of Applied Mathematics © 2011 All rights reserved.  
>