ホーム > 計算化学 > ソフトウェア > Gaussian > 並列性能(Parallel Perf.)

並列性能(Parallel Perf.)

並列使用とパフォーマンスノート(Parallel Usage and Performance Notes)

共有メモリの並列処理(Shared-memory parallelism)

メモリ割り当て(Memory allocation)

より大きな分子や基底関数系を含む計算は、より大きいメモリ割り当てが有効です。50以上の原子数を含む計算や500以上の基底関数を用いる計算に対しては、プロセッサあたり4 GB以上が推奨されます。freqmemユーティリティは、基底状態の振動数計算に対する、スレッドごとに最適なメモリサイズを見積もります。励起状態の振動数計算に対しても同じ値を用いることが合理的で、基底および励起状態の構造最適化計算に対しては過剰です。

指定するメモリ量は、プロセッサ数だけ倍増させるべきです。4 GBが1個のプロセッサに対して妥当である場合、同じジョブで8個のCPUを使用する場合には32 GBで良好に計算できます。もちろん、特定のハードウェアでは、より小さなメモリー容量制限を受けることがありますが、CPUの数に応じてメモリ容量を直線的にスケーリングさせることを目標とするべきです。特に、メモリサイズを固定してCPUの数を増やしてしまうことは、多数のプロセッサを使用した際に良いパフォーマンスを引き出すことにつながりません。

大規模な振動数計算および大規模なCCSD及びEOM-CCSDのエネルギー計算については、使用される大きなディスクファイルをバッファするために十分な残メモリ容量を残すことも望ましいです。したがって、Gaussianジョブに対してはシステム上の総メモリの50〜70%だけを与えるべきです。たとえば、合計128 GBのマシンでは、すべてのCPUを使用するジョブに通常64〜80 GBを割り当て、残りのメモリはOSにディスクキャッシュとして使用させるべきです。

Calculations involving larger molecules and basis sets benefit from larger memory allocations. 4 GB or more per processor is recommended for calculations involving 50 or more atoms and/or 500 or more basis functions. The freqmem utility estimates the optimal memory size per thread for ground-state frequency calculations, and the same value is reasonable for excited-state frequencies and is more than sufficient for ground and excited state optimizations.

The amount of memory allowed should rise with the number of processors: if 4 GB is reasonable for one processor, then the same job using 8 CPUs would run well in 32 GB. Of course, there may be limitations to smaller values imposed by the particular hardware, but scaling memory linearly with number of CPUs should be the goal. In particular, increasing only the number of CPUs with fixed memory size is unlikely to lead to good performance when using large numbers of processors.

For large frequency calculations and for large CCSD and EOM-CCSD energies, it is also desirable to leave enough memory to buffer the large disk files involved. Therefore, a Gaussian job should only be given 50-70% of the total memory on the system. For example, on a machine with a total of 128 GB, one should typically give 64-80 GB to a job which was using all the CPUs, and leave the remaining memory for the operating system to use as disk cache.

スレッドをCPUに固定する[pinする](Pinning threads to CPUs.)

スレッドが1つのCPUから別のCPUに移動されると効率が落ちます。キャッシュが無効化されて、その他のオーバーヘッドが発生するためです。大半のマシンでは、Gaussianはスレッドを特定のCPUへ縛り付けることができます。これは、特に多数のプロセッサを使用する場合に推奨される操作モードです。%CPUというLink 0行は、使用したいCPUの番号を指定します。たとえば、1個の8コア搭載チップを搭載した計算機では、%NProc=8と指定するのではなく、%CPU=0-7と指定するべきです。なぜなら、前者の場合は最初のスレッドをCPU0に、次のスレッドをCPU1に、というように結びつけるためです。

いくつかの古いIntelプロセッサ(Nehalem以前)では、チップ上の全てのCPUをビジー状態に保つためのメモリ帯域幅が不十分で、CPUの半分だけを使用する(その際、本来指定すべき量の2倍のメモリサイズをそれぞれに指定する)ことが適する場合がしばしばあります。例えば、そのような4個の12コアチップと128 GBのメモリを搭載し、1番目のチップにCPU 0-11番、2番目のチップに12-23番と搭載している構成の計算機では、各々1.5 GBのメモリだけで48個のコア全てを使用するのではなく、24個のプロセッサ(各々のチップから6個ずつ)を使用して72GB/24プロセッサ=3GBをそれぞれ割り当てて実行する方が適します。必要な入力情報は次のようになるでしょう。

Efficiency is lost when threads are moved from one CPU to another, thereby invalidating the cache and causing other overhead. On most machines, Gaussian can tie threads to specific CPUs, and this is the recommended mode of operation, especially when using larger numbers of processors. The %CPU Link 0 line specifies the numbers of specific CPUs to be used. Thus, on a machine with one 8-core chip, one should use %CPU=0‑7 rather than %NProc=8 because the former ties the first thread to CPU 0, the next to CPU 1, etc.

On some older Intel processors (Nehalem and before), there is not enough memory bandwidth to keep all the CPUs on a chip busy, and it is often preferable to use half the CPUs, each with twice as much memory as if all were used. For example, on such a machine with four 12-core chips and 128 GB of memory, with CPUs 0-11 on the first chip, 12-23 on the second, and so on, it is better to run using 24 processors (6 on each chip) and give them 72 GB/24 procs = 3 GB memory each, rather than use all 48 with only 1.5 GB of memory each. The required input directives would be:

%Mem=72GB
%CPU=0-47/2

ここで、/2はひとつおきにコアを使用することを意味します(チップ0のコア0, 2, 4, 6, 8, 10番を使い、チップ1の12, 14, 16, 18, 20, 22番を使うというように)。

最新の世代のIntelプロセッサ(Haswell以降)では、メモリ帯域幅が向上し、各チップ上の全てのコアを使用すると良好に動作します。

十分なメモリが利用可能で、スレッドが特定のコアに結び付けられている限り、大きな分子での並列効率は、64コアまたはそれ以上まで良好です。

where the /2 means to use every other core: i.e., cores 0, 2, 4, 6, 8, and 10 (on chip 0), 12, 14, 16, 18, 20, and 22 (on chip 1), etc.

With the most recent generations of Intel processors (Haswell and later), the memory bandwidth is better and using all the cores on each chip works well.

As long as sufficient memory is available and threads are tied to specific cores, then parallel efficiency on large molecules is good up to 64 or more cores.

ハイパースレッディングを無効化(Disable hyperthreading)

ハイパースレッディングは、同じ物理CPU上の複数スレッド間で、メモリ帯域幅などのリソースを実効的に分割するため、Gaussianには有用ではありません。ハイパースレッディングをオフにできない場合、Gaussianジョブには各物理CPU上で1個のハイパースレッドだけを使用するべきです。Linuxでは、異なるプロセッサ上のハイパースレッドがグループ化されています。 つまり、マシンに8コア搭載の2チップがあって3wayのハイパースレッディング使う場合、仮想的なCPU0-7はチップ0上の8個のコアにまたがり、仮想的なCPU8-15はチップ1上の8個のコアにまたがり、 CPU16-23はチップ0上の8個のコア上の第2のハイパースレッドとなり、以下同様となります。そのため、この場合ジョブは%CPU=0-15で最適に動作します。

AIXでは、使用されているハイパースレッドの数が少なくてもハイパースレッディングは各CPUの最大8個のハイパースレッド番号にグループ化されます。従って、2個の8コアチップと4wayのハイパースレッディングの場合、仮想的なCPU0-3は全てチップ0上のコア0、CPU8-11はチップ0の上のコア1にあります。従って、それぞれ異なるコアを使用するCPU0, 8, 16, …を選択するために、%CPU=0-127/8を使おうとするでしょう。

Hyperthreading is not useful for Gaussian since it effectively divides resources such as memory bandwidth among threads on the same physical CPU. If hyperthreading cannot be turned off, Gaussian jobs should use only one hyperthread on each physical CPU. Under Linux, hyperthreads on different processors are grouped together. That is, if a machine has 2 chips each with 8 cores and 3-way hyperthreading, then “CPUs” 0-7 are across the 8 cores on chip 0, 8-15 are across the 8 cores on chip 1, and 16-23 are the second hyperthreads on the 8 cores of chip 0, and so on. So a job would run best with %CPU=0‑15.

Under AIX, hyperthreads are grouped together with up 8 hyperthread numbers for each CPU even if fewer hyperthreads are in use, so with two 8 core chips and 4-way hyperthreading, “CPUs” 0-3 are all on core 0 of chip 0, 8-11 are on core 1 of chip 0, etc. Thus, one would want to use %CPU=0‑127/8 to select “CPUs” 0, 8, 16, … which are each using a distinct core.

クラスタ [Linda] 並列性能(Cluster [Linda] parallelism)

利用可能性(Availability)

Hartree-Fock法と密度汎関数(DFT)法のエネルギー計算、勾配計算、振動数計算は、MP2法のエネルギー計算や勾配計算と同様に、クラスタにまたがって並列に実行されます。MP2法の振動数計算、CCSD法とEOM-CCSD法のエネルギー計算と構造最適化は、SMP並列(対称型マルチプロセッシング並列)に対応していますが、クラスタ並列には対応していません。DFT法の非調和振動数計算やCCSDの振動数計算などの数値微分は、各ノードで完全な勾配やヘシアンの計算を行い、クラスタ内のワーカー間で微分の方向を分割することによって、クラスタのノード間で並列実行されます。

Hartree-Fock and DFT energies, gradients and frequencies run in parallel across clusters, as do MP2 energies and gradients. MP2 frequencies, CCSD, and EOM-CCSD energies and optimizations are SMP parallel but not cluster parallel. Numerical derivatives, such as DFT anharmonic frequencies and CCSD frequencies, are parallelized across nodes of a cluster by doing a complete gradient or second derivative calculation on each node, splitting the directions of differentiation across workers in the cluster.

MP並列処理を組み合わせる(Combining with MP parallelism)

共有メモリ並列とクラスタ並列は組み合わせられます。一般に、クラスタの各ノード内で、全てのCPUにまたがった共有メモリ並列処理を使うことでしょう。%CPUと%Memはクラスタの各ノードに適用されることに注意してください。たとえば、3個のノード名(apple、banana、cherry)があり、各々に8個のCPUを有する2個のチップがある場合は、次のように指定することでしょう。

Shared-memory and cluster parallelism can be combined. Generally, one uses shared-memory parallelism across all CPUs in each node of the cluster. Note that %CPU and %Mem apply to each node of the cluster. Thus, if one has 3 nodes names apple, banana and cherry, each with two chips which have 8 CPUs each, then one might specify:

%Mem=64GB
%CPU=0-15
%LindaWorkers=apple,banana,cherry
# B3LYP/6-311+G(2d,p) Freq …

これにより、3個のノードのそれぞれでCPUに固定(pin)された16個のスレッドが実行され、48個のスレッドのそれぞれに4 GBが与えられます。

数値微分を行う上で特別な場合(例えば、Freq=AnharmやCCSD Freq等)については、結果を収集するために1個の余分なワーカーが使用されます。従って、こうしたジョブでは、Gaussian 16を起動したマスターノード上で2個のワーカーが実行されます。 上記の例では、ジョブが非調和振動数計算していた場合は、次のように使用します。

This would run 16 threads, each pinned to a CPU, on each of the 3 nodes, giving 4 GB to each of the 48 threads.

For the special case of numerical differentiation only—e.g., Freq=Anharm, CCSD Freq, etc.—one extra worker is used to collect the results. So these jobs should be run with two workers on the master node (where Gaussian 16 is started). For the above example if the job was computing anharmonic frequencies, then one would use:

%Mem=64GB
%CPU=0-15
%LindaWorkers=apple:2,banana,cherry
# B3LYP/6-311+G(2d,p) Freq=Anharm …

ここで、Gaussian 16はノードappleで開始されるものとします。この記述で、ノードapple上で2個のworkerが開始され、ひとつは結果を収集し、ノードapple上の他のワーカーとbananaとcherryのワーカーを使用して計算作業が行われます。

where Gaussian 16 is assumed to be started on node apple. This will start 2 workers on node apple, one of which just collects results, and will do the computational work using the other worker on apple and those on banana and cherry.

  • キャンペーン情報
    現在開催されているお得なキャンペーン情報はこちらから。
    詳細
  • ご購入前のお問合せ
    フォームにご入力いただければ後ほど営業よりご連絡させていただきます。
    詳細
  • 見積り依頼
    フォームにご入力いただければ後ほど営業よりご連絡させていただきます。
    詳細
CONTACT

お問い合わせ

お客様に最適な製品をご提案いたします。まずは気軽にお問い合わせ下さい。
075-353-0120

平日9:30~17:30 (土曜日、日曜日、祝祭日、年末年始、夏期休暇は、休日とさせていただきます。)