Skip to content

Commit

Permalink
update ai2cat notebook
Browse files Browse the repository at this point in the history
  • Loading branch information
link89 committed Nov 3, 2023
1 parent 48a313e commit 55c2055
Showing 1 changed file with 10 additions and 13 deletions.
23 changes: 10 additions & 13 deletions notebook/ai2cat.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,12 @@
"LAMMPS_BATCH_TEMPLATE = f'{AI4EC_DIR}/slurm/ai2cat-lammps.sbatch'\n",
"AI2KIT_EXECUTOR_CONFIG = f'{AI4EC_DIR}/ai2-kit/executor.yml'\n",
"\n",
"CP2K_DEFAULTS = dict(\n",
" basic_set_file = os.path.join(CP2K_DATA, 'BASIS_MOLOPT'),\n",
" potential_file = os.path.join(CP2K_DATA, 'GTH_POTENTIALS'),\n",
" parameter_file = os.path.join(CP2K_DATA, 'dftd3.dat'),\n",
")\n",
"\n",
"ui_helper = ui.get_the_ui_helper()\n",
"print(\"Current Directory Is: \", os.getcwd())"
]
Expand Down Expand Up @@ -103,7 +109,7 @@
"outputs": [],
"source": [
"! mkdir -p ./00-aimd\n",
"ui_helper.gen_aimd_config(cp2k_search_path=CP2K_DATA, out_dir='./00-aimd')"
"ui_helper.gen_aimd_config(out_dir='./00-aimd', **CP2K_DEFAULTS)"
]
},
{
Expand Down Expand Up @@ -221,7 +227,7 @@
"source": [
"train_dir = os.path.abspath('./01-train/work_dir')\n",
"! mkdir -p {train_dir}\n",
"ui_helper.gen_training_config(cp2k_search_path=CP2K_DATA, out_dir='./01-train')\n",
"ui_helper.gen_training_config(out_dir='./01-train', **CP2K_DEFAULTS)\n",
"! ai2-kit tool yaml load {AI2KIT_EXECUTOR_CONFIG} - set_value \"executors.ikkem.work_dir\" {train_dir} - dump > ./01-train/executor.yml"
]
},
Expand Down Expand Up @@ -337,7 +343,6 @@
"生成模拟所需lammps以及plumed配置文件,依据反应坐标配置plumed输入文件\n",
"* `plumed.dat`, plumed 的配置, 需要由用户定义增强采样的反应坐标, 以及其它所需的命令\n",
" * 例如增加 `CV1: DISTANCE ATOMS=14,15`,根据具体的研究目标进行配置\n",
"* 命令中的 `--dp_models` 需指向模型对应的地址\n",
" \n",
"以下命令可以在 生成基本的作业模板,模板生成后可进入 `./02-simluation` 目录对其进行检查和编辑"
]
Expand All @@ -349,7 +354,7 @@
"metadata": {},
"outputs": [],
"source": [
"ui_helper.gen_lammps_config('./01-train/work_dir/', './02-simulation')"
"ui_helper.gen_lammps_config('./01-train/work_dir/', out_dir='./02-simulation')"
]
},
{
Expand Down Expand Up @@ -379,7 +384,7 @@
"outputs": [],
"source": [
"# 提交作业\n",
"! (cd ./00-aimd && sbatch lammps.sbatch)"
"! (cd ./02-simulation/ && sbatch lammps.sbatch)"
]
},
{
Expand Down Expand Up @@ -423,14 +428,6 @@
"ax.set_title(r'$Free \\ energy \\ curve$');"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "9e92ff49-b4c8-40d2-98f0-00bd3dd94ea0",
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
Expand Down

0 comments on commit 55c2055

Please sign in to comment.