Versions: Toutes les versions

Problem Description

Are there any settings related to the Operating System that can improve COMSOL Multiphysics® performance?

Solution

The following settings can affect performance. They may already be at their optimal settings on your computer. These settings changes should be made with the approval of your IT department.

Energy and Power Settings

Most OS's provide settings to change the energy and power settings. For example, in Windows go to the Control Panel → System and Security → Power Options and select the highest performance power plan available.

Some hardware comes with preinstalled performance optimization software that can sometimes negatively affect performance. Test disabling, or uninstalling, this software to see if this affects performance.

Screensavers and Other Programs

COMSOL performance may be negatively affected if the screensaver is active, or if other applications are running in the foreground.

Number of Cores

Changing the number of processor cores used by COMSOL can lead to performance improvements. Within COMSOL, you can control the number of cores by going to Preferences → Computing → Multicore or by setting the -np <num_cores> command line option.

COMSOL will, by default, use all available cores but this can lead to a slowdown when solving smaller models. Only very large models, that require a lot of memory, will benefit from using many cores. Smaller models will often run fastest when using only a few cores, so it is worth experimenting with this setting for different models.

Some processors feature a mix of performance and efficiency cores, and for these it can be optimal to set the number of cores to be no more than the number of performance cores.

Memory Allocator

Test which memory allocator works best for your workload. This can be controlled with COMSOL from Preferences → Computing → Multicore or by setting the -alloc command line option to either native or scalable. The native allocator is the default on Linux and macOS, while scalable is the default on Windows.

BLAS

Changing the BLAS option can have a significant impact on performance. Run COMSOL with the -help argument to see which BLAS options are available for your system or consult the COMSOL documentation. Try all BLAS options and use the one which works best for your workload.

Simultaneous Multithreading

Most CPU's support Simultaneous Multithreading, such as Hyper-Threading. Ensure that this is enabled. Although COMSOL does not utilize this, it benefits other processes running in parallel.

Linux-Specific Settings

Use the performance scaling governor. Check the documentation for your distribution and Linux kernel version. For example, see this guide on Arch Linux for more details.

Run the lscpu command and observe the NUMA node(s) value. If it is greater than one, you can try setting the number of sockets to the number of NUMA nodes. This can be controlled from Preferences → Computing → Multicore or by setting the -numasets command line argument.

Disabling CPU mitigations can improve performance on some CPUs and Linux distributions. For more information, see this guide on Arch Linux. WARNING: This can pose a security risk for exposed systems. However, for isolated systems, the risk may be acceptable. Consult with your system administrator before making changes.

For ARM64 systems, using a 64k page size can improve performance. Some Linux distributions offer a mechanism to switch between 4k and 64k page size kernels. For example, see this guide from Ubuntu.