periodic2 root operator のセル単位 cache の読み書きと排他。前計算の数値部分(bem_coulomb_fmm_periodic_root_ops) からファイル I/O とロックを分けたもの。呼ぶのは MPI root だけで、collective は使わない。
欠けたセルを作って publish するまで保持する cache ロック。
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| logical, | public | :: | held | = | .false. | ||
| integer, | public | :: | fd | = | -1 |
required のセルを cache から読む。足りなければ cache ディレクトリを作ってロックを取り、待つ間に他の job が 足したセルを読み直す。それでも足りなければロックを保持したまま返し、呼び出し側が作ったセルを publish_cell_cache_and_unlock で書く。have は cache から得たセル。
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(fmm_plan_type), | intent(in) | :: | plan | |||
| integer(kind=i32), | intent(in) | :: | nanchor | |||
| logical, | intent(in) | :: | required(:) | |||
| integer(kind=i32), | intent(out), | allocatable | :: | cached_cells(:) | ||
| real(kind=dp), | intent(out), | allocatable | :: | cached_blocks(:,:,:) | ||
| logical, | intent(out) | :: | have(:) | |||
| type(periodic_cell_cache_lock_type), | intent(out) | :: | lock |
cache にあったセルと新しく作ったセルを合わせて書き、ロックを外す。
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(fmm_plan_type), | intent(in) | :: | plan | |||
| integer(kind=i32), | intent(in) | :: | nanchor | |||
| integer(kind=i32), | intent(in), | allocatable | :: | cached_cells(:) | ||
| real(kind=dp), | intent(in), | allocatable | :: | cached_blocks(:,:,:) | ||
| integer(kind=i32), | intent(in), | allocatable | :: | new_cells(:) | ||
| real(kind=dp), | intent(in), | allocatable | :: | new_blocks(:,:,:) | ||
| type(periodic_cell_cache_lock_type), | intent(inout) | :: | lock |