Default Python launcher to fast GPU path
This commit is contained in:
@@ -58,31 +58,36 @@ File_directory = os.path.join(input_data.File_directory)
|
|||||||
|
|
||||||
## If the specified output directory exists, ask the user whether to continue
|
## If the specified output directory exists, ask the user whether to continue
|
||||||
if os.path.exists(File_directory):
|
if os.path.exists(File_directory):
|
||||||
print( " Output dictionary has been existed !!! " )
|
auto_overwrite = str(getattr(input_data, "Auto_Overwrite_Output", "yes")).strip().lower()
|
||||||
print( " If you want to overwrite the existing file directory, please input 'continue' in the terminal !! " )
|
if auto_overwrite in ("1", "yes", "y", "true", "on", "continue"):
|
||||||
print( " If you want to retain the existing file directory, please input 'stop' in the terminal to stop the " )
|
print( " Output dictionary has been existed; Auto_Overwrite_Output=yes, continue the calculation. " )
|
||||||
print( " simulation. Then you can reset the output dictionary in the input script file AMSS_NCKU_Input.py !!! " )
|
print( )
|
||||||
print( )
|
else:
|
||||||
## Prompt whether to overwrite the existing directory
|
print( " Output dictionary has been existed !!! " )
|
||||||
while True:
|
print( " If you want to overwrite the existing file directory, please input 'continue' in the terminal !! " )
|
||||||
try:
|
print( " If you want to retain the existing file directory, please input 'stop' in the terminal to stop the " )
|
||||||
inputvalue = input()
|
print( " simulation. Then you can reset the output dictionary in the input script file AMSS_NCKU_Input.py !!! " )
|
||||||
## If the user agrees to overwrite, proceed and remove the existing directory
|
print( )
|
||||||
if ( inputvalue == "continue" ):
|
## Prompt whether to overwrite the existing directory
|
||||||
print( " Continue the calculation !!! " )
|
while True:
|
||||||
print( )
|
try:
|
||||||
break
|
inputvalue = input()
|
||||||
## If the user chooses not to overwrite, exit and keep the existing directory
|
## If the user agrees to overwrite, proceed and remove the existing directory
|
||||||
elif ( inputvalue == "stop" ):
|
if ( inputvalue == "continue" ):
|
||||||
print( " Stop the calculation !!! " )
|
print( " Continue the calculation !!! " )
|
||||||
sys.exit()
|
print( )
|
||||||
## If the user input is invalid, prompt again
|
break
|
||||||
else:
|
## If the user chooses not to overwrite, exit and keep the existing directory
|
||||||
|
elif ( inputvalue == "stop" ):
|
||||||
|
print( " Stop the calculation !!! " )
|
||||||
|
sys.exit()
|
||||||
|
## If the user input is invalid, prompt again
|
||||||
|
else:
|
||||||
|
print( " Please input your choice !!! " )
|
||||||
|
print( " Input 'continue' or 'stop' in the terminal !!! " )
|
||||||
|
except ValueError:
|
||||||
print( " Please input your choice !!! " )
|
print( " Please input your choice !!! " )
|
||||||
print( " Input 'continue' or 'stop' in the terminal !!! " )
|
print( " Input 'continue' or 'stop' in the terminal !!! " )
|
||||||
except ValueError:
|
|
||||||
print( " Please input your choice !!! " )
|
|
||||||
print( " Input 'continue' or 'stop' in the terminal !!! " )
|
|
||||||
|
|
||||||
## Remove the existing output directory if present
|
## Remove the existing output directory if present
|
||||||
shutil.rmtree(File_directory, ignore_errors=True)
|
shutil.rmtree(File_directory, ignore_errors=True)
|
||||||
|
|||||||
@@ -141,8 +141,14 @@ def _gpu_runtime_env():
|
|||||||
|
|
||||||
defaults = {
|
defaults = {
|
||||||
"AMSS_INTERP_FAST": "1",
|
"AMSS_INTERP_FAST": "1",
|
||||||
|
"AMSS_INTERP_GPU": "1",
|
||||||
|
"AMSS_ANALYSIS_MAP_EVERY": "1000000",
|
||||||
|
"AMSS_CUDA_AWARE_MPI": "1",
|
||||||
"AMSS_CUDA_KEEP_RESIDENT_AFTER_STEP": "1",
|
"AMSS_CUDA_KEEP_RESIDENT_AFTER_STEP": "1",
|
||||||
"AMSS_CUDA_KEEP_ALL_LEVELS": "1",
|
"AMSS_CUDA_KEEP_ALL_LEVELS": "1",
|
||||||
|
"AMSS_CUDA_AMR_RESTRICT_DEVICE": "1",
|
||||||
|
"AMSS_CUDA_AMR_RESTRICT_BATCH": "0",
|
||||||
|
"AMSS_CUDA_DEVICE_SEGMENT_BATCH": "0",
|
||||||
}
|
}
|
||||||
for key, value in defaults.items():
|
for key, value in defaults.items():
|
||||||
runtime_env.setdefault(key, value)
|
runtime_env.setdefault(key, value)
|
||||||
@@ -266,8 +272,14 @@ def run_ABE():
|
|||||||
started_mps = _start_cuda_mps_if_requested(mpi_env)
|
started_mps = _start_cuda_mps_if_requested(mpi_env)
|
||||||
print(" GPU optimized runtime switches:")
|
print(" GPU optimized runtime switches:")
|
||||||
print(f" AMSS_INTERP_FAST={mpi_env.get('AMSS_INTERP_FAST', '')}")
|
print(f" AMSS_INTERP_FAST={mpi_env.get('AMSS_INTERP_FAST', '')}")
|
||||||
|
print(f" AMSS_INTERP_GPU={mpi_env.get('AMSS_INTERP_GPU', '')}")
|
||||||
|
print(f" AMSS_ANALYSIS_MAP_EVERY={mpi_env.get('AMSS_ANALYSIS_MAP_EVERY', '')}")
|
||||||
|
print(f" AMSS_CUDA_AWARE_MPI={mpi_env.get('AMSS_CUDA_AWARE_MPI', '')}")
|
||||||
print(f" AMSS_CUDA_KEEP_RESIDENT_AFTER_STEP={mpi_env.get('AMSS_CUDA_KEEP_RESIDENT_AFTER_STEP', '')}")
|
print(f" AMSS_CUDA_KEEP_RESIDENT_AFTER_STEP={mpi_env.get('AMSS_CUDA_KEEP_RESIDENT_AFTER_STEP', '')}")
|
||||||
print(f" AMSS_CUDA_KEEP_ALL_LEVELS={mpi_env.get('AMSS_CUDA_KEEP_ALL_LEVELS', '')}")
|
print(f" AMSS_CUDA_KEEP_ALL_LEVELS={mpi_env.get('AMSS_CUDA_KEEP_ALL_LEVELS', '')}")
|
||||||
|
print(f" AMSS_CUDA_AMR_RESTRICT_DEVICE={mpi_env.get('AMSS_CUDA_AMR_RESTRICT_DEVICE', '')}")
|
||||||
|
print(f" AMSS_CUDA_AMR_RESTRICT_BATCH={mpi_env.get('AMSS_CUDA_AMR_RESTRICT_BATCH', '')}")
|
||||||
|
print(f" AMSS_CUDA_DEVICE_SEGMENT_BATCH={mpi_env.get('AMSS_CUDA_DEVICE_SEGMENT_BATCH', '')}")
|
||||||
if "CUDA_MPS_PIPE_DIRECTORY" in mpi_env:
|
if "CUDA_MPS_PIPE_DIRECTORY" in mpi_env:
|
||||||
print(f" CUDA_MPS_PIPE_DIRECTORY={mpi_env['CUDA_MPS_PIPE_DIRECTORY']}")
|
print(f" CUDA_MPS_PIPE_DIRECTORY={mpi_env['CUDA_MPS_PIPE_DIRECTORY']}")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user