Enabling the Affinity (or Binding, depending on which version of MPI you’re using) option can increase the speed of your FDTD simulations on some Windows computers. In most cases, the speed increase is small, but occasionally the increase can be significant, particularly on workstations with lots of cores. It is also important to understand that in some situations, the Affinity option can result in significantly slower speeds, which is why the option is not enabled by default.
Resource configuration settings
By default, when not using the Affinity option, the operating system determines which CPU core will be used to run each FDTD engine process. Typically, the processes are frequently shifted between cores as the operating system manages the numerous processes running on the computer at a given time. When the Affinity option is enabled, each FDTD engine process will be locked to a specific CPU core. In some cases, locking the processes to specific cores can result in faster simulations, since there is no time wasted shifting the processes between CPU cores.
As noted above, using the Affinity option can also make the simulation run much slower. This is most likely to occur when running FDTD simulations using all the cores of the CPU, as well as running other applications at the same time. In these situations, the operating system does not have sufficient flexibility to efficiently load balance the various processes.
The following screenshots show the Task Manager when running an FDTD simulation using 8 of 16 cores. Notice that in the first screenshot, without using the Affinity option, all 16 cores are occasionally in use. The second screenshot, when the Affinity option is enabled, the processes are locked to specific cores.
Default setting, without Affinity option
Affinity option enabled