Distributed-Memory Parallel COMSOL
The Linux® and Windows® versions of COMSOL Multiphysics support a distributed memory mode. The distributed mode starts a number of computational nodes set by the user. Each computational node is a separate process running a COMSOL instance. A computational node is not the same as a physical node (computer), but they can coincide. When running in distributed mode, COMSOL Multiphysics uses MPI for communicating between the processes in the distributed environment.
Figure 22-6: Schematic of a cluster with 3 hosts (physical nodes) with 4 processor cores each.
The distributed-memory mode can be combined with the ability of COMSOL Multiphysics to benefit from the shared-memory model. All modes that COMSOL Multiphysics can run in are able to use distributed-memory mode.
For the schematic in Figure 22-6, you can choose any number of computational nodes between 1 and 12. Each node, in turn, can use between 4 and 1 processor cores for shared memory. By default, COMSOL Multiphysics uses as many cores as are available on each physical node for shared-memory parallelism. This is suboptimal if the number of computational nodes is not the same as the number of physical nodes. It is recommended that you explicitly set the number of cores. For the schematic example, if you run 6 computational nodes, the optimal value for number of cores per compute node is 2. The total number of cores used is then 6·2 = 12.
For the same example, assuming you are the sole user of the system for the duration of the computation and that your problem requires a lot of memory, use 3 computational nodes with 4 shared-memory cores each.
You do not need a cluster to benefit from the ability to utilize the distributed-memory model. On a multiprocessor computer, you can use multiple computational nodes. This can be useful for small-sized parameter sweeps, for example. Make sure that the number of computational nodes times the number of cores does not exceed the number of available cores; otherwise performance deteriorates significantly.