Support Knowledge Base

Solution Number: 1001
Title: Running COMSOL in parallel mode
Platform: All Platforms
Applies to: All Products
Versions: 3.4
Created: November 21, 2006
Last Modified: August 15, 2008
Categories: Solver, Product Information, Mesh, Documentation
Keywords: solver memory parallel smp

Problem Description

This solution describes how you enable parallel use of the processors on a multicore or multiprocessor computer.

Solution

Introduction

COMSOL supports parallel computations on computers with multiple processors under the shared memory parallelization model (SMP).

Windows

On Windows platforms, the default number of processor cores used by COMSOL is the total number available cores. For example, if you have a 2 x dual core machine, 4 cores will be used in parallel by COMSOL Multiphysics by default.

Here is how to find out how many processor cores your Windows machine has:

  1. Right-click My Computer (on Vista: Computer), select Properties.
  2. Go to the Advanced tab (on Vista, first click click Advanced system settings).
  3. Click the Environment Variables button and look in the System variables list. Look for NUMBER_OF_PROCESSORS and check its value. This is actually the number of cores. If you have two processors with 2 cores each, this number will be 4.

If you want COMSOL to leave out one or more processor cores you can manually set the number of cores used:

  1. Create a shortcut on your Desktop to the COMSOL executable, for example
    C:\COMSOL34\bin\comsol.exe.
  2. Right click the shortcut and select Properties from the menu.
  3. Change the Target field to C:\COMSOL34\bin\comsol.exe -np # where you should replace # with the number of processors you wish to make available for the COMSOL application.

You can also change the default behavior of COMSOL by setting the environment variable COMSOL_NUM_THREADS to the desired number of cores. For details, see "Running COMSOL in Parallel" in the COMSOL Installation and Operations Guide.

Linux/Sun

You can find out how many processors you have with the command
more /proc/cpuinfo | grep proc (Linux) or /usr/sbin/psrinfo -v (Sun-Solaris).

On Linux/Sun the default settings will enable 1 processor for the COMSOL Multiphysics application. You can override the default behavior by using the command line switches. For example, start by the command comsol -np 2. Like in Windows, you can change the default behavior through the environment variable COMSOL_NUM_THREADS. Example: in C-shell, use the command setenv COMSOL_NUM_THREADS 2.

See also: "Running COMSOL in Parallel" in the COMSOL Installation and Operations Guide.

 

Feedback

Poor | Excellent
Document quality?




« Back to Support Knowledge Base

Disclaimer

COMSOL makes every reasonable effort to verify the information you view on this page. Resources and documents are provided for your information only, and COMSOL makes no explicit or implied claims to their validity. COMSOL does not assume any legal liability for the accuracy of the data disclosed. Any trademarks referenced in this document are the property of their respective owners. Consult your product manuals for complete trademark details.

COMSOL RSS
© 1997-2008 COMSOL AB.
COMSOL, COMSOL Multiphysics, COMSOL Reaction Engineering Lab, COMSOL Script and
FEMLAB are registered trademarks of COMSOL AB. Other product or brand names are
trademarks or registered trademarks of their respective holders. All Rights Reserved.