你已经派生过 gprMax
镜像自地址
https://gitee.com/sunhf/gprMax.git
已同步 2025-08-08 07:24:19 +08:00
#num_threads is now #cpu_threads
这个提交包含在:
@@ -200,14 +200,32 @@ def check_cmd_names(processedlines, checkessential=True):
|
||||
essentialcmds = ['#domain', '#dx_dy_dz', '#time_window']
|
||||
|
||||
# Commands that there should only be one instance of in a model
|
||||
singlecmds = dict.fromkeys(['#domain', '#dx_dy_dz', '#time_window', '#title', '#messages', '#num_threads', '#time_step_stability_factor', '#pml_formulation', '#pml_cells', '#excitation_file', '#src_steps', '#rx_steps', '#output_dir'], None)
|
||||
singlecmds = dict.fromkeys(['#domain', '#dx_dy_dz', '#time_window',
|
||||
'#title', '#cpu_threads',
|
||||
'#time_step_stability_factor',
|
||||
'#pml_formulation', '#pml_cells',
|
||||
'#excitation_file', '#src_steps', '#rx_steps',
|
||||
'#output_dir'], None)
|
||||
|
||||
# Commands that there can be multiple instances of in a model - these will be lists within the dictionary
|
||||
multiplecmds = {key: [] for key in ['#geometry_view', '#geometry_objects_write', '#material', '#soil_peplinski', '#add_dispersion_debye', '#add_dispersion_lorentz', '#add_dispersion_drude', '#waveform', '#voltage_source', '#hertzian_dipole', '#magnetic_dipole', '#transmission_line', '#rx', '#rx_array', '#snapshot', '#include_file']}
|
||||
# Commands that there can be multiple instances of in a model
|
||||
# - these will be lists within the dictionary
|
||||
multiplecmds = {key: [] for key in ['#geometry_view',
|
||||
'#geometry_objects_write', '#material',
|
||||
'#soil_peplinski',
|
||||
'#add_dispersion_debye',
|
||||
'#add_dispersion_lorentz',
|
||||
'#add_dispersion_drude',
|
||||
'#waveform', '#voltage_source',
|
||||
'#hertzian_dipole', '#magnetic_dipole',
|
||||
'#transmission_line', '#rx', '#rx_array',
|
||||
'#snapshot', '#include_file']}
|
||||
|
||||
# Geometry object building commands that there can be multiple instances
|
||||
# of in a model - these will be lists within the dictionary
|
||||
geometrycmds = ['#geometry_objects_read', '#edge', '#plate', '#triangle', '#box', '#sphere', '#cylinder', '#cylindrical_sector', '#fractal_box', '#add_surface_roughness', '#add_surface_water', '#add_grass']
|
||||
geometrycmds = ['#geometry_objects_read', '#edge', '#plate', '#triangle',
|
||||
'#box', '#sphere', '#cylinder', '#cylindrical_sector',
|
||||
'#fractal_box', '#add_surface_roughness',
|
||||
'#add_surface_water', '#add_grass']
|
||||
# List to store all geometry object commands in order from input file
|
||||
geometry = []
|
||||
|
||||
|
@@ -19,7 +19,7 @@
|
||||
import logging
|
||||
|
||||
from .cmds_singleuse import (Discretisation, Domain, ExcitationFile,
|
||||
NumThreads, OutputDir, PMLCells, RxSteps,
|
||||
OMPThreads, OutputDir, PMLCells, RxSteps,
|
||||
SrcSteps, TimeStepStabilityFactor, TimeWindow,
|
||||
Title)
|
||||
|
||||
@@ -52,15 +52,15 @@ def process_singlecmds(singlecmds):
|
||||
scene_objects.append(output_dir)
|
||||
|
||||
# Number of threads for CPU-based (OpenMP) parallelised parts of code
|
||||
cmd = '#num_threads'
|
||||
cmd = '#cpu_threads'
|
||||
if singlecmds[cmd] is not None:
|
||||
tmp = tuple(int(x) for x in singlecmds[cmd].split())
|
||||
if len(tmp) != 1:
|
||||
logger.exception(cmd + ' requires exactly one parameter to specify the number of threads to use')
|
||||
logger.exception(cmd + ' requires exactly one parameter to specify the number of CPU OpenMP threads to use')
|
||||
raise ValueError
|
||||
|
||||
num_thread = NumThreads(n=tmp[0])
|
||||
scene_objects.append(num_thread)
|
||||
omp_threads = OMPThreads(n=tmp[0])
|
||||
scene_objects.append(omp_threads)
|
||||
|
||||
cmd = '#dx_dy_dz'
|
||||
if singlecmds[cmd] is not None:
|
||||
|
在新工单中引用
屏蔽一个用户