CALYPSO_SaaS 快速上手
作者: 王振雨 wzy@calypso.cn 黄冠 695139851@qq.com
创建日期: 2023-04-30
最后一次修改: 黄冠 695139851@qq.com
最后一次修改时间: 2023-08
描述: 本教程不可以在 Bohrium Notebook 上直接运行,请在Bohrium节点控制台中,
创建新节点
-创建容器节点
,镜像选择calypso-bohrium:[tag]
及任何一款节点配置运行。如您遇到任何问题,请联系 bohrium@dp.tech 。
共享协议: 本作品采用知识共享署名-非商业性使用-相同方式共享 4.0 国际许可协议进行许可。
目标
上手使用CALYPSO_SaaS做结构预测
阅读该教程【最多】约需 15 分钟,让我们开始吧!
背景
寻找势能面上的极小值点结构是长期以来结构预测的重要目标。目前,常见的结构搜索软件包括AIRESS,Uspex,Optxcal等。
基于群体智能的CALYPSO材料结构预测方法和软件(详见 http://www.calypso.cn ),是我国自主创新发展的方法和软件,仅依据材料的化学组分即可开展材料微观原子结构的预测,已经广泛应用于晶体、表面(含二维单/多层材料)、界面、团簇和过渡态的创新性设计,并能开展功能导向(如能隙、硬度和电子密度等)的逆向材料设计。
本教程将B-N的变组分结构预测为例,介绍CALYPSO_SaaS的基本用法。
安装tree以便更好地查看文件目录分级
我们已经在CALYPSO-Example仓库为大家准备好了快速上手的案例,大家可以直接使用git命令来下载。
注意:该临时文件将在本案例末执行删除操作。
为了方便后续的可视化,我们首先需要将例子移动到/data目录下
/data
Cloning into 'CALYPSO-Example'... 数据已下载至 CALYPSO-Example 文件夹
/data/CALYPSO-Example
Archive: CALYPSO-Bohrium-example.zip creating: CALYPSO-Bohrium-example/ creating: CALYPSO-Bohrium-example/workshop230518/ inflating: CALYPSO-Bohrium-example/workshop230518/run.sh inflating: CALYPSO-Bohrium-example/workshop230518/del.sh inflating: CALYPSO-Bohrium-example/workshop230518/INCAR_2 inflating: CALYPSO-Bohrium-example/workshop230518/INCAR_3 inflating: CALYPSO-Bohrium-example/workshop230518/resources.json inflating: CALYPSO-Bohrium-example/workshop230518/machine.json inflating: CALYPSO-Bohrium-example/workshop230518/INCAR_1 inflating: CALYPSO-Bohrium-example/workshop230518/input.dat inflating: CALYPSO-Bohrium-example/workshop230518/back.sh inflating: CALYPSO-Bohrium-example/workshop230518/POTCAR creating: CALYPSO-Bohrium-example/templates/ creating: CALYPSO-Bohrium-example/templates/vasp_example/ inflating: CALYPSO-Bohrium-example/templates/vasp_example/run.sh inflating: CALYPSO-Bohrium-example/templates/vasp_example/del.sh inflating: CALYPSO-Bohrium-example/templates/vasp_example/INCAR_2 inflating: CALYPSO-Bohrium-example/templates/vasp_example/INCAR_3 inflating: CALYPSO-Bohrium-example/templates/vasp_example/resources.json inflating: CALYPSO-Bohrium-example/templates/vasp_example/machine.json inflating: CALYPSO-Bohrium-example/templates/vasp_example/INCAR_1 inflating: CALYPSO-Bohrium-example/templates/vasp_example/input.dat inflating: CALYPSO-Bohrium-example/templates/vasp_example/back.sh inflating: CALYPSO-Bohrium-example/templates/vasp_example/POTCAR creating: CALYPSO-Bohrium-example/templates/abacus_example/ inflating: CALYPSO-Bohrium-example/templates/abacus_example/INPUT_2 inflating: CALYPSO-Bohrium-example/templates/abacus_example/run.sh inflating: CALYPSO-Bohrium-example/templates/abacus_example/del.sh inflating: CALYPSO-Bohrium-example/templates/abacus_example/INPUT_1 inflating: CALYPSO-Bohrium-example/templates/abacus_example/INPUT_3 inflating: CALYPSO-Bohrium-example/templates/abacus_example/resources.json inflating: CALYPSO-Bohrium-example/templates/abacus_example/O_ONCV_PBE-1.0.upf inflating: CALYPSO-Bohrium-example/templates/abacus_example/pp inflating: CALYPSO-Bohrium-example/templates/abacus_example/machine.json inflating: CALYPSO-Bohrium-example/templates/abacus_example/Mg_ONCV_PBE-1.0.upf inflating: CALYPSO-Bohrium-example/templates/abacus_example/STRU creating: CALYPSO-Bohrium-example/templates/input.dat.example/ creating: CALYPSO-Bohrium-example/templates/input.dat.example/sabc/ inflating: CALYPSO-Bohrium-example/templates/input.dat.example/sabc/input.dat.2d.singlelayer inflating: CALYPSO-Bohrium-example/templates/input.dat.example/sabc/input.dat.2d.multilayer inflating: CALYPSO-Bohrium-example/templates/input.dat.example/sabc/input.dat.cluster inflating: CALYPSO-Bohrium-example/templates/input.dat.example/sabc/input.dat.vsc inflating: CALYPSO-Bohrium-example/templates/input.dat.example/sabc/input.dat.vary.formula creating: CALYPSO-Bohrium-example/templates/input.dat.example/pso/ inflating: CALYPSO-Bohrium-example/templates/input.dat.example/pso/input.dat.2d.singlelayer inflating: CALYPSO-Bohrium-example/templates/input.dat.example/pso/input.dat.2d.multilayer inflating: CALYPSO-Bohrium-example/templates/input.dat.example/pso/input.dat.cluster inflating: CALYPSO-Bohrium-example/templates/input.dat.example/pso/input.dat.vsc inflating: CALYPSO-Bohrium-example/templates/input.dat.example/pso/input.dat.vary.formula creating: CALYPSO-Bohrium-example/templates/vasp_HCNO_example/ inflating: CALYPSO-Bohrium-example/templates/vasp_HCNO_example/run.sh inflating: CALYPSO-Bohrium-example/templates/vasp_HCNO_example/del.sh inflating: CALYPSO-Bohrium-example/templates/vasp_HCNO_example/INCAR_2 inflating: CALYPSO-Bohrium-example/templates/vasp_HCNO_example/INCAR_3 inflating: CALYPSO-Bohrium-example/templates/vasp_HCNO_example/resources.json inflating: CALYPSO-Bohrium-example/templates/vasp_HCNO_example/INCAR_4 inflating: CALYPSO-Bohrium-example/templates/vasp_HCNO_example/machine.json inflating: CALYPSO-Bohrium-example/templates/vasp_HCNO_example/INCAR_1 inflating: CALYPSO-Bohrium-example/templates/vasp_HCNO_example/input.dat inflating: CALYPSO-Bohrium-example/templates/vasp_HCNO_example/back.sh inflating: CALYPSO-Bohrium-example/templates/vasp_HCNO_example/POTCAR creating: CALYPSO-Bohrium-example/templates/qe_example/ inflating: CALYPSO-Bohrium-example/templates/qe_example/run.sh inflating: CALYPSO-Bohrium-example/templates/qe_example/B-PBE.upf inflating: CALYPSO-Bohrium-example/templates/qe_example/del.sh inflating: CALYPSO-Bohrium-example/templates/qe_example/resources.json inflating: CALYPSO-Bohrium-example/templates/qe_example/pw_input_1 inflating: CALYPSO-Bohrium-example/templates/qe_example/pw_input_2 inflating: CALYPSO-Bohrium-example/templates/qe_example/machine.json inflating: CALYPSO-Bohrium-example/templates/qe_example/pw_input_3 inflating: CALYPSO-Bohrium-example/templates/qe_example/input.dat inflating: CALYPSO-Bohrium-example/templates/qe_example/N-PBE.upf
/data/CALYPSO-Example/CALYPSO-Bohrium-example
. ├── templates │ ├── abacus_example │ ├── input.dat.example │ ├── qe_example │ ├── vasp_HCNO_example │ └── vasp_example └── workshop230518 ├── INCAR_1 ├── INCAR_2 ├── INCAR_3 ├── POTCAR ├── back.sh ├── del.sh ├── input.dat ├── machine.json ├── resources.json └── run.sh 8 directories, 10 files
该目录下包含
input.dat.example
,进行晶体预测、层状结构预测、变组分结构预测(VSC)等的样例input.dat
abacus_example
,使用ABACUS作为第一性原理计算软件进行CALYPSO结构预测的所有需要的输入qe_example
,使用QE作为第一性原理计算软件进行CALYPSO结构预测的所有需要的输入vasp_example
,使用VASP作为第一性原理计算软件进行CALYPSO结构预测的所有需要的输入
下文将以vasp_example
为例进行说明。
/data/CALYPSO-Example/CALYPSO-Bohrium-example/templates/vasp_example
.
├── INCAR_1
├── INCAR_2
├── INCAR_3
├── POTCAR
├── back.sh
├── del.sh
├── input.dat
├── machine.json
├── resources.json
└── run.sh
1 directory, 10 files
该目录中包含
- CALYPSO及VASP的输入文件:
input.dat
,CALYPSO的控制文件,(详细的参数说明请参考文档说明)INCAR_*
,各结构逐次进行VASP优化的控制文件POTCAR
,VASP赝势
- 计算资源配置文件:
machine.json
,dpdispatcher的参数文件,控制镜像的使用resources.json
,dpdispatcher的参数文件,控制每个机器运行任务的个数
- 辅助控制文件:
run.sh
,CALYPSO-SaaS的任务提交脚本del.sh
,CALYPSO-Saas的目录清理脚本,用于在同一目录重新计算时对无用的文件进行批量删除
CALYPSO-SaaS的任务提交和回收全部由dpdispatcher完成,因此需要对dpdispatcher的配置文件 machine.json 进行修改,将其中的email,passwd,program_id进行相应修改
{ "batch_type": "Lebesgue", "context_type": "LebesgueContext", "local_root": "./", "remote_profile": { "email": "******", "password": "******", "program_id": 000000, "_keep_backup": true, "input_data": { "job_name": "calypso.Bohrium.test.1", "image_name": "******", "job_type": "indicate", "log_file": "log", "grouped": true, "disk_size": 200, "max_run_time": 40, "machine_type": "c16_m32_cpu", "platform": "ali", "on_demand": 0, "out_files": ["OUTCAR", "CONTCAR", "OSZICAR", "fp.log", "log", "err"] } } }
注意!我们需要将账号和密码更换成我们自己的Bohurium账号密码
由于我们想做convexhull的展示,我们使用vsc的例子
################################ The Basic Parameters of CALYPSO ################################ # A string of one or several words contain a descriptive name of the system (max. 40 characters). SystemName =BN # Number of different atomic species in the simulation. NumberOfSpecies = 2 # Element symbols of the different chemical species. NameOfAtoms = B N # Number of atoms for each chemical species in one formula unit. NumberOfAtoms = 1 1 # The range of formula unit per cell in your simulation. NumberOfFormula = 1 1 # The volume per formula unit. Unit is in angstrom^3. Volume=5 # Minimal distance between atoms of each chemical species. Unit is in angstrom. @DistanceOfIon 1.0 0.8 0.8 0.8 @End # It determines which algorithm should be adopted in the simulation. Ialgo = 2 # Ialgo = 1 for Global PSO # Ialgo = 2 for Local PSO (default value) # The proportion of the structures generated by PSO. PsoRatio = 0.6 # The popu2ation size. Normally, it has a larger number for larger systems. PopSize = 10 # It determines which local optimization method should be interfaced in the simulation. ICode= 1 # ICode= 1 interfaced with VASP # ICode= 2 interfaced with SIESTA # ICode= 3 interfaced with GULP # The number of lbest for local PSO NumberOfLbest=4 # The Number of local optimization for each structure. NumberOfLocalOptim= 3 # The command to perform local optimiztion calculation (e.g., VASP, SIESTA) on your computer. Command = sh submit.sh # The Max step for iteration MaxStep =5 # If True, a previous calculation will be continued. PickUp= F # At which step will the previous calculation be picked up. PickStep =5 # If True, the local optimizations performed by parallel Parallel= F # The number node for parallel NumberOfParallel=4 ######### The Parameters For 2D Structure Prediction ############# # If True, a 2D structure prediction is performed. 2D = F # The number of layers MultiLayer = 2 # The Area of 2D system Area = 10 # The distortion value along the C axis DeltaZ = 0 # The gap between two layers LayerGap=2.0 MaxTime= 1800 # The vacuum gap between the top surface of the slab and the top lattice, and between the bottom surface of the slab and the bottom lattice. VacuumGap=40 # The number atoms for each layer @LayerType 1 1 1 1 @End # Minimal distance between atoms of each chemical species. Unit is in angstrom. LAtom_Dis = 1.4 ########################END 2D Parameters ######################### # If True, Variational Stoichiometry structure prediction is performed VSC=T VSCEnergy= 9.68045866 1.00102117 # The Max Number of Atoms in unit cell MaxNumAtom=10 # The Variation Range for each type atom @CtrlRange 1 5 1 3 @end Split = T
{ "group_size": 1, "local_root":"./", "source_list": ["/opt/intel/oneapi/setvars.sh"] }
修改完成后,run.sh 为准备好的任务提交脚本,运行该脚本即可提交任务
'/data/CALYPSO-Example/CALYPSO-Bohrium-example/templates/vasp_example'
我们在镜像中提供了命令查看任务showjob,可直接在命令行运行即可
name PID work_path run_calypso 2649 /data/CALYPSO-Example/CALYPSO-Bohrium-example/templates/vasp_example run_calypso 2820 /data/CALYPSO-Example/CALYPSO-Bohrium-example/templates/vasp_example
或者可以实时的查看任务的日志文件
2023-07-31 11:08:24,453 - INFO : job: 081e2b43890b417a2cadc6b54ccc77c1d0fa9805 submit; job_id is 8072124:job_group_id:11014402 2023-07-31 11:08:24,992 - INFO : job: cb33c379c407608afe35ac32aa405dfbe8aa20e9 submit; job_id is 8072125:job_group_id:11014402 2023-07-31 11:08:25,500 - INFO : job: ab41be9c9e526bf76de7f694592f87a428330f15 submit; job_id is 8072126:job_group_id:11014402 2023-07-31 11:08:26,018 - INFO : job: a8dc84967d50a29a7a5012eb5ad3ca8abb7c49af submit; job_id is 8072127:job_group_id:11014402 2023-07-31 11:08:26,505 - INFO : job: d73c59827492fee20b9a2e5d05e310582be340f9 submit; job_id is 8072128:job_group_id:11014402 2023-07-31 11:08:27,006 - INFO : job: f5dda6108097b641687a4fdc221bd555f38b222a submit; job_id is 8072129:job_group_id:11014402 2023-07-31 11:08:27,498 - INFO : job: b11036530b64a01f322558e922e6086483afb13b submit; job_id is 8072130:job_group_id:11014402 2023-07-31 11:08:28,014 - INFO : job: 488cd426aa5de42aa29d6a18b9a30a48121c7a76 submit; job_id is 8072131:job_group_id:11014402 2023-07-31 11:08:28,749 - INFO : job: e5a10ad93f8c5f966e06ad3e010cb52731559b09 submit; job_id is 8072132:job_group_id:11014402 2023-07-31 11:08:29,281 - INFO : job: a4c8ed8bb65a349195b236640c14e7fe2ceefe05 submit; job_id is 8072133:job_group_id:11014402 ^C
/data/CALYPSO-Example/CALYPSO-Bohrium-example/templates/vasp_example/results
CALYPSO.log pso_ini_1 pso_opt_1 pso_sor_1 struct.dat Local_Structure_List.dat pso_ini_2 pso_opt_2 pso_sor_2
- struct.dat为保存的所有结构信息
- CALYPSO.log Local_Structure_List.dat为CALYPSO运行的日志文件与临时文件
5 dir_4_1/ 4 dir_4_3/ 2 dir_5_3/ 2 dir_1_1/ 8 dir_2_1/ 4
. ├── CALYPSO.log ├── Local_Structure_List.dat ├── convexhull.csv ├── dir_1_1 │ └── Analysis_Output.dat ├── dir_2_1 │ └── Analysis_Output.dat ├── dir_4_1 │ └── Analysis_Output.dat ├── dir_4_3 │ └── Analysis_Output.dat ├── dir_5_3 │ └── Analysis_Output.dat ├── pso_ini_1 ├── pso_ini_2 ├── pso_opt_1 ├── pso_opt_2 ├── pso_sor_1 ├── pso_sor_2 └── struct.dat 6 directories, 15 files
No. Enthalpy 0.1 1 ( 19) 1.09518 Fm-3m(225) 2 ( 6) 1.62299 P4/nmm(129) 3 ( 8) 1.79931 P6_422(181) 4 ( 14) 1.99834 P1(1) 5 ( 18) 2.20370 Cm(8) 6 ( 16) 2.63821 Cm(8) 7 ( 4) 2.74098 Pm-3m(221) 8 ( 9) 6.21152 P4/mmm(123)
5 dir_4_1/ 4 dir_4_3/ 2 dir_5_3/ 2 dir_1_1/ 8 dir_2_1/ 4
. ├── CALYPSO.log ├── Local_Structure_List.dat ├── convexhull.csv ├── dir_1_1 │ ├── Analysis_Output.dat │ ├── dir_0.1 │ │ ├── UCell_1_225.vasp │ │ ├── UCell_2_129.vasp │ │ ├── UCell_3_181.vasp │ │ ├── UCell_4_1.vasp │ │ ├── UCell_5_8.vasp │ │ ├── UCell_6_8.vasp │ │ ├── UCell_7_221.vasp │ │ └── UCell_8_123.vasp │ ├── dir_0.3 │ │ ├── UCell_1_225.vasp │ │ ├── UCell_2_129.vasp │ │ ├── UCell_3_181.vasp │ │ ├── UCell_4_1.vasp │ │ ├── UCell_5_8.vasp │ │ ├── UCell_6_8.vasp │ │ ├── UCell_7_221.vasp │ │ └── UCell_8_123.vasp │ └── dir_0.5 │ ├── UCell_1_225.vasp │ ├── UCell_2_129.vasp │ ├── UCell_3_181.vasp │ ├── UCell_4_1.vasp │ ├── UCell_5_8.vasp │ ├── UCell_6_8.vasp │ ├── UCell_7_221.vasp │ └── UCell_8_123.vasp ├── dir_2_1 │ ├── Analysis_Output.dat │ ├── dir_0.1 │ │ ├── UCell_1_1.vasp │ │ ├── UCell_2_123.vasp │ │ ├── UCell_3_139.vasp │ │ └── UCell_4_131.vasp │ ├── dir_0.3 │ │ ├── UCell_1_1.vasp │ │ ├── UCell_2_123.vasp │ │ ├── UCell_3_139.vasp │ │ └── UCell_4_131.vasp │ └── dir_0.5 │ ├── UCell_1_1.vasp │ ├── UCell_2_123.vasp │ ├── UCell_3_139.vasp │ └── UCell_4_131.vasp ├── dir_4_1 │ ├── Analysis_Output.dat │ ├── dir_0.1 │ │ ├── UCell_1_166.vasp │ │ ├── UCell_2_123.vasp │ │ ├── UCell_3_123.vasp │ │ └── UCell_4_47.vasp │ ├── dir_0.3 │ │ ├── UCell_1_166.vasp │ │ ├── UCell_2_123.vasp │ │ ├── UCell_3_123.vasp │ │ └── UCell_4_47.vasp │ └── dir_0.5 │ ├── UCell_1_166.vasp │ ├── UCell_2_123.vasp │ ├── UCell_3_123.vasp │ └── UCell_4_47.vasp ├── dir_4_3 │ ├── Analysis_Output.dat │ ├── dir_0.1 │ │ ├── UCell_1_221.vasp │ │ └── UCell_2_166.vasp │ ├── dir_0.3 │ │ ├── UCell_1_221.vasp │ │ └── UCell_2_166.vasp │ └── dir_0.5 │ ├── UCell_1_221.vasp │ └── UCell_2_221.vasp ├── dir_5_3 │ ├── Analysis_Output.dat │ ├── dir_0.1 │ │ ├── UCell_1_8.vasp │ │ └── UCell_2_35.vasp │ ├── dir_0.3 │ │ ├── UCell_1_8.vasp │ │ └── UCell_2_35.vasp │ └── dir_0.5 │ ├── UCell_1_8.vasp │ └── UCell_2_35.vasp ├── pso_ini_1 ├── pso_ini_2 ├── pso_opt_1 ├── pso_opt_2 ├── pso_sor_1 ├── pso_sor_2 └── struct.dat 21 directories, 75 files
CALYPSO.log dir_1_1/ dir_4_3/ pso_ini_1 pso_opt_2 struct.dat Local_Structure_List.dat dir_2_1/ dir_5_3/ pso_ini_2 pso_sor_1 convexhull.csv dir_4_1/ evo.png pso_opt_1 pso_sor_2
运行该命令需要在input.dat中提前给定每个单质元素每原子的能量
CALYPSO.log dir_2_1/ evo.png pso_sor_1 Local_Structure_List.dat dir_4_1/ pso_ini_1 pso_sor_2 convexhull.csv dir_4_3/ pso_ini_2 struct.dat convexhull.png dir_5_3/ pso_opt_1 dir_1_1/ e_above_hull_50meV.csv pso_opt_2
/data/CALYPSO-Example/CALYPSO-Bohrium-example/templates/vasp_example/results/dir_1_1/dir_0.3
./
├── UCell_1_225.vasp
├── UCell_2_129.vasp
├── UCell_3_181.vasp
├── UCell_4_1.vasp
├── UCell_5_8.vasp
├── UCell_6_8.vasp
├── UCell_7_221.vasp
└── UCell_8_123.vasp
1 directory, 8 files