你已经派生过 gprMax
镜像自地址
https://gitee.com/sunhf/gprMax.git
已同步 2025-08-06 12:36:51 +08:00
Updated message printing for RAM.
这个提交包含在:
@@ -58,7 +58,7 @@ def process_singlecmds(singlecmds, G):
|
||||
if G.messages:
|
||||
print('Model title: {}'.format(G.title))
|
||||
|
||||
# Number of processors to run on (OpenMP)
|
||||
# Number of threads (OpenMP) to use
|
||||
cmd = '#num_threads'
|
||||
os.environ['OMP_WAIT_POLICY'] = 'ACTIVE' # What to do with threads when they are waiting
|
||||
os.environ['OMP_DYNAMIC'] = 'FALSE' #
|
||||
@@ -115,12 +115,13 @@ def process_singlecmds(singlecmds, G):
|
||||
print('Domain size: {:g} x {:g} x {:g}m ({:d} x {:d} x {:d} = {:g} cells)'.format(tmp[0], tmp[1], tmp[2], G.nx, G.ny, G.nz, (G.nx * G.ny * G.nz)))
|
||||
|
||||
# Estimate memory (RAM) usage
|
||||
if G.messages:
|
||||
# Currently this is a pretty loose estimate but seems to match reasonably with memory usage reported when model completes.
|
||||
memestimate = (((G.nx + 1) * (G.ny + 1) * (G.nz + 1) * 13 * np.dtype(floattype).itemsize + (G.nx + 1) * (G.ny + 1) * (G.nz + 1) * 18) * 1.1) + 30e6
|
||||
print('Memory (RAM) usage: ~{} required, {} available'.format(human_size(memestimate), human_size(psutil.virtual_memory().total)))
|
||||
# Currently this is a pretty loose estimate but seems to match reasonably with memory usage reported when model completes.
|
||||
memestimate = (((G.nx + 1) * (G.ny + 1) * (G.nz + 1) * 13 * np.dtype(floattype).itemsize + (G.nx + 1) * (G.ny + 1) * (G.nz + 1) * 18) * 1.1) + 30e6
|
||||
if memestimate > psutil.virtual_memory().total:
|
||||
raise GeneralError('Estimated memory (RAM) required ~{} exceeds {} available!\n'.format(human_size(memestimate), human_size(psutil.virtual_memory().total)))
|
||||
if G.messages:
|
||||
print('Memory (RAM) required: ~{} ({} detected)'.format(human_size(memestimate), human_size(psutil.virtual_memory().total)))
|
||||
|
||||
|
||||
# Time step CFL limit (use either 2D or 3D) and default PML thickness
|
||||
if G.nx == 1:
|
||||
|
在新工单中引用
屏蔽一个用户