change NUM_CORES

This commit is contained in:
root
2024-01-10 18:18:31 +08:00
parent a937bd0334
commit 660f741274
2 changed files with 10 additions and 3 deletions

View File

@@ -108,7 +108,7 @@ class SimulationRunner:
result = None
# 保留1个核心不使用
num_cores = max(1, multiprocessing.cpu_count() - 1) # 避免核心数小于 1
os.environ['OMP_NUM_THREADS'] = str(num_cores)
os.environ['NUM_CORES'] = str(num_cores)
try:
env_vars = {
"NAME": self.pdb_file.stem,
@@ -196,9 +196,9 @@ def main(simulation_steps, time_step, pdb_folder_path, bash_script_path, gmxrc_p
pool.join()
if __name__ == "__main__":
NSTEPS = 50000000 # Example: 50000000 steps
NSTEPS = 50000 # Example: 50000000 steps
DT = 0.002 # Example: 2 fs time step
PDB_FOLDER_PATH = Path("./pdb_test") # Assuming the PDB files are in a folder named 'pdb_files' in the current directory
PDB_FOLDER_PATH = Path("./pdb_gjm") # Assuming the PDB files are in a folder named 'pdb_files' in the current directory
# 传入自定义的bash脚本路径
CUSTOM_BASH_SCRIPT_PATH = Path('md_gromacs.sh')
# 传入 GMXRC 文件的路径