关注:

1)对缺乏实验数据对比的、有争议的体系,有必要采用不同的预测方法预测,对比结果

2)USPEX工作流程

1. 参数准备:

建立需预测结构目录,拷贝USPEX脚步进入该目录,在USPEX文件夹下

(1) 进入Specific/   设定INCAR1-5

(2)  进入USPEX目录,编辑:INPUT,设定体系组成,包含的分子数(如6 18 for M6H18),体积(与M6H18对应的体积),键长(参考汉典元素周期表中的共价键),化合价(参考汉典元素周期表中的氧化态)等参数,无需特别指明VASP路径,程序会通过locate.m脚步定位可执行的VASP程序

(3)  进入USPEX/seeds/下,输入初始猜测的POSCAR,并命名为POSCARS,cp POSCARS seed

注意:各文件夹下的可执行文件,应chmod +x 变成实际可执行的文件

2. 提交:

matlab log &

/opt/matlab2013/bin/matlab   log &

或为保证程序周期性执行,修改并执行下述脚本,通过该脚本提交,  如,nohup ./run-uspex.sh,其中run-uspex.sh内容如下:

cat  uspex_Sc-H

#!/bin/sh

while true;do

date > log

/opt/matlab2013/bin/matlab  < USPEX.m >>log

sleep 60  【估计每个优化任务运行时间,可通过延长sleep时间如600s,来延缓队列中提交的任务数量的增加速度】

done

3. 看结果:

进入results文件夹/  vi goodstructures    找到对应的低焓结构  goodstructue_POSCAR

4. 重新提交及杀掉任务

(1) 每次重新提交,最好:

rm -rf results*    、

./clean_tough(清除CalcFold*文件夹)   、

cp Seeds/seed Seeds/POSCARS

(2) 改变VASP优化计算用CPU核的数目,需同时修改INPUT.TXT、submitJob_local.m、及SubmissionsubmitJob_local.m下的CPU数目

(3)如需 杀掉命令,则

ps aux |  grep uspex

yexq     23255  0.0  0.0 106092  1212 pts/1    S    04:51   0:00 /bin/sh ./uspex_Sc-H

yexq     31252  0.0  0.0 103244   876 pts/8    S+   05:15   0:00 grep uspex

kill 23255

对于在队列中已产生的大量任务,可通过脚本清除:

cat del-uspex.sh

#!/bin/sh

for((i=50747;i<50767;i++))

do

qdel $i

done

% i为Job ID.

5.   探索:

1) matlab log &   产生结构后,自动生成 提交 结构优化任务的vasp的脚本

vi results1/OUTPUT.txt

......

*  There are  5 local relaxation steps for each individual structures *

Step  Abinitio Code                  Execute Command            K-resolution

1      VASP                                       vasp         0.160

2      VASP                                       vasp         0.120

3      VASP                                       vasp         0.100

4      VASP                                       vasp         0.080

5      VASP                                       vasp         0.060

The script for job submission is prepared seperately in Submission/*_local.m

5 parallel calculations are performed simutaneously

2)解读  Submission/*_local.m

function doneOr = checkStatus_local(jobID)

%--------------------------------------------------------------------

%This routine is to check if the submitted job is done or not

%One needs to do a little edit based on your own case.

%1   : whichCluster (0: no-job-script,1: local submission, 2: remote submission)

【在INPUT.TXT文件中已经指定】

%--------------------------------------------------------------------

%Step1: the command to check job by ID.

[a,b] = unix(['qstat ' jobID ''])

%Step2: to find the keywords from screen message to determine if the job is done

%Below is just a sample:

%-------------------------------------------------------------------------------

%Job id                    Name             User            Time Use S Queue

%------------------------- ---------------- --------------- -------- - -----

%2455453.nano              USPEX            qzhu            02:28:42 R cfn_gen04

%-------------------------------------------------------------------------------

%If the job is still running, it will show as above.

%If there is no key words like 'R/Q Cfn_gen04', it indicates the job is done.

if isempty(findstr(b,'R low')) & isempty(findstr(b,'Q low'))

doneOr = 1

unix('rm USPEX*');    % to remove the log file

else

doneOr = 0;

end

function jobNumber = submitJob_local()

%-------------------------------------------------------------

%This routine is to check if the submitted job is done or not

%One needs to do a little edit based on your own case.

1   : whichCluster (default 0, 1: local submission, 2: remote submission)

%-------------------------------------------------------------

%Step 1: to prepare the job script which is required by your supercomputer

fp = fopen('run.sh', 'w');

fprintf(fp, '#!/bin/sh\n');

fprintf(fp, '#PBS -l nodes=1:ppn=6,walltime=2:00:00\n');

fprintf(fp, '#PBS -N USPEX\n');

fprintf(fp, '#PBS -j oe\n');

%fprintf(fp, '#PBS -V \n');

fprintf(fp, '#PBS -q dell\n');  【自己服务器上的队列名称】

%fprintf(fp, '#PBS -V \n');

fprintf(fp, '#PBS -S /bin/bash\n');

fprintf(fp, 'cd $PBS_O_WORKDIR\n');

fprintf(fp,'mpirun  -np 8 vasp  > vasp.out\n');

fclose(fp);

%Step 2: to submit the job with the command like qsub, bsub, llsubmit, .etc.

%It will output some message on the screen like '2350873.nano.cfn.bnl.local'

[a,b]=unix(['qsub run.sh'])

%Step 3: to get the jobID from the screen message

end_marker = findstr(b,'.');

jobNumber = b(1:end_marker(1)-1);

3) 解读:USPEX.m文件

cat   USPEX.m

try

unix('chmod +x getStuff');

unix('chmod +x getFromTo');

unix('chmod +x FunctionFolder/USPEX/getStuff');

unix('chmod +x FunctionFolder/USPEX/getFromTo');

unix('chmod +x Specific/getStuff');

unix('chmod +x Specific/getFromTo');

unix('chmod +x FunctionFolder/spacegroup_init/random_2d');

unix('chmod +x FunctionFolder/spacegroup_init/random_cell');

unix('chmod +x FunctionFolder/spacegroup_init/random_cell_mol');

unix('chmod +x FunctionFolder/spacegroup_stokes/findsym_new');

catch

end

[nothing, whichCode] = unix(['./getStuff INPUT.txt calculationMethod 1']);

if isempty(whichCode)

whichCode = 'USPEX';

else

whichCode(end) = [];

end

if strcmpi(whichCode, 'USPEX')

ev_alg();

elseif strcmpi(whichCode, 'VCNEB')

vcNEB();

elseif strcmpi(whichCode, 'META')

metasoft();

end

4)  解读./getStuff

#!/usr/bin/perl

$file   = shift;

$string = shift;

$column = shift;

unless(defined($column)) {

print "usage : \n";

exit;

}

open(FILE, $file) or die "Can't open $file : $!\n";

while() {

if(/$string/) {

@a = split /\s+/;

print $a[$column-1] . "\n";

}

}

5)解读INPUT.txt

PARAMETERS EVOLUTIONARY ALGORITHM

******************************************

******************************************

*      TYPE OF RUN AND SYSTEM            *

******************************************

******************************************

USPEX : calculationMethod (USPEX, VCNEB, META)

300   : calculationType(dimension: 0-3; molecule: 0/1; varcomp: 0/1)  【变胞取1,如取301后,接下来如何处理?】

1     : optType (1=enthalpy, 2=volume, 3=hardness, 4=struc_order, 5=aver_dist)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% What symmetry(s) have to be satisfied by the randomly created structures

% symmetries

2-230

% endSymmetries

% numbers of specices (ions/molecules/blocks) of each type

% numSpecices

6 18

% EndNumSpecices

%%%%%%%%%%%%%%%%%%%%

% Here come the atomic numbers of the atoms involved

% atomType

Sc H

% EndAtomType

%%%%%%%%%%%%%%%%%%%%

% valences【是赝势的价电子数目吗?No,指汉典元素周期表中对应的氧化态。如何改变氧化态?同时具有+2,+3价的元素如何处理?】3 1

% endValences

******************************************

*               POPULATION               *

******************************************

30    : populationSize (how many individuals per generation)

100   : initialPopSize

30    : numGenerations (how many generations shall be calculated)

25    : stopCrit

******************************************

%       FIRST VAR. COMP. GENERATION      *

******************************************

20    : firstGeneMax (how many different compositions for first generation)

8     : minAt (minimum amount of atoms/cell for first generation)

16    : maxAt (maximum amount of atoms/cell for first generation)  【可能需根据实际情况指定?】

【USPEX中如何实现变胞?8,16表达了什么含义?】

******************************************

*  SURVIVAL OF THE FITTEST AND SELECTION *

******************************************

0     : reoptOld

0.6   : bestFrac

******************************************

******************************************

*          VARIATION OPERATORS           *

******************************************

******************************************

0.50  : fracGene (fraction of generation produced by heredity)

0.20  : fracRand (fraction of generation produced randomly from space groups)

0.20  : fracAtomsMut (fraction of the generation produced by softmutation)

0.10  : fracTrans (fraction of the generation produced by transmutations)

****************************************

*             CONSTRAINTS              *

****************************************

1.5   : minVectorLength ( minimal length of any lattice vector)

%%%%%%%%%%%%%%%%

% IonDistances

1.44  088

0.0 0.32

% EndDistances

或参考

%%%%%%%%%%%%%%%%

*****************************************

*                 CELL                  *

*****************************************

% The following is what you know about the lattice. If you know the lattice

% vectors, type them in as 3x3 matrix. If not, type the estimated volume.

% For variable composition - type the estimated atomic volume for each element.

% Latticevalues (this word MUST stay here, type values below)

177

% Endvalues (this word MUST stay here)

找到对应物质的模型结构,下载cif 文件,通过VESTA看体积数据

*****************************************

*   DETAILS OF AB INITIO CALCULATIONS   *

*****************************************

% supported:  1-vasp, 2-siesta, 3-gulp, 4-LAMMPS, 5-NeuralNetworks

% 6-dmacrys, 7-cp2k, 8-QuantumEspresso, 9-ASE, 10-ATK, 11-CASTEP

abinitioCode (which code from CommandExecutable shall be used for calculation? )

1 1 1 1 1

ENDabinit

%Resolution for KPOINTS - one number per step or just one number in total)

% KresolStart

0.16 0.12 0.10 0.08 0.06

%  Kresolend

% commandExecutable

vasp

% mpiexec -n 8 -machinefile .nodelists vasp > out.vasp

mpiexec  -np 8 vasp >log

% EndExecutable

5     : numParallelCalcs (how many parallel calculations shall be performed)

1     : whichCluster (0: no-job-script, 1: local submission, 2: remote)

【matlab语法,‘:’的作用】

submission)

0.010 : toleranceFing (tolerance for identical structures)

*****************************************

*               RESTART                 *

*****************************************

0    : pickUpYN (if pickUpYN~=0 , then a previous calculation will be continued )

0    : pickUpGen (at which generation shall the previous calculation be picked up? If = 0 , then a new calculation is started)

0    : pickUpFolder (number of the results folder to be used. If = 0 , then the highest existing number is taken)

手册摘录解读:Specify the following varcomp-onlyoptions:

variablefirstGeneMax【变量  第一代产生的different compositions数量】

Meaning: How many different compositions 【怎样确保产生自己想要的组成?!】are sampled in the first generation. If 0, then the number is equal to initialPopSize/4. For binaries, we recommend firstGeneMax=11, for ternaries a higher value is needed, e.g. 30.

Default: 11

Format:

10 : firstGeneMax

variableminAt

Meaning: Minimum number of atoms (for calculationType=301/201/300) or molecules (for calculationType=311) in the unit cell for the first generation.

Default: No default

Format:

10 : minAt

variablemaxAt

Meaning: Maximum number of atoms (for calculationType=301/201/300 or in META calculations) or molecules (for calculationType=311) in the unit cell for the first generation.

Default: No default【没有默认值,需自己指定】

Format:

20 : maxAt

根据自己服务器提交VASP任务脚本修改的submitJob_local.m文件

function jobNumber = submitJob_local()

%-------------------------------------------------------------

%This routine is to check if the submitted job is complete or not

%One needs to do a little edit based on your own situation.

%1   : whichCluster (default 0, 1: local submission, 2: remote submission)

%-------------------------------------------------------------

%Step 1: to prepare the job script that is required by your supercomputer

fp = fopen('myrun', 'w');

fprintf(fp, '#!/bin/sh\n');

fprintf(fp, '#PBS -l nodes=1:ppn=8,walltime=1:30:00 -q cfn_short\n');

fprintf(fp, '#PBS -N USPEX\n');

fprintf(fp, '#PBS -j oe\n');

fprintf(fp, '#PBS -V \n');

fprintf(fp, '#PBS -q dell \n');

fprintf(fp,'#PBS -S /bin/bash \n');

fprintf(fp, 'cd ${PBS_O_WORKDIR}\n');

fprintf(fp, 'mpiexec -np 8 vasp > vasp.out\n');

fclose(fp);

%Step 2: to submit the job with a command like qsub, bsub, llsubmit, etc.

[a,b]=unix(['qsub myrun'])

%Step 3: to get the jobID from the screen message

%It will output some message on the screen like '2350873.nano.cfn.bnl.local'

end_marker = findstr(b,'.');

jobNumber = b(1:end_marker(1)-1);

为保证程序周期性执行,修改并执行下述脚本,nohup ./run-uspex.sh&  :

cat run-uspex.sh

#!/bin/sh

while true

do

date >> log

/opt/matlab2013/bin/matlab  < USPEX.m >>log

sleep 300

done

USPEX问答:

最近在使用USPEX遇到以下两个问题,期盼您的解答:

1) 怎样限制USPEX提交的任务数量,即始终保持只有五个任务在队列中排队或运算,而不是像下述情形一样,有上百个任务在队列中:

50375.mu01  yexq dell     vasp    12    --  7200: R 47:25

50443.mu01  yexq dell     USPEX    8    --  01:30 Q   --

50444.mu01  yexq dell     USPEX    8    --  01:30 Q   --

50445.mu01  yexq dell     USPEX    8    --  01:30 Q   --

50446.mu01  yexq dell     USPEX    8    --  01:30 Q   --

50447.mu01  yexq dell     USPEX    8    --  01:30 Q   --

50448.mu01  yexq dell     USPEX    8    --  01:30 Q   --

50449.mu01  yexq dell     USPEX    8    --  01:30 Q   --

50450.mu01  yexq dell     USPEX    8    --  01:30 Q   --

50451.mu01  yexq dell     USPEX    8    --  01:30 Q   --

50452.mu01  yexq dell     USPEX    8    --  01:30 Q   --

50453.mu01  yexq dell     USPEX    8    --  01:30 Q   --

......

2)  IonDistances离子之间距离,感觉应该是共价半径的加和,不知对否?

Answer  from  Lirong Han

(1)这个我还真不知到在哪里设置,我用的都是已经写好的脚本,您可以查一下手册,上面应该有写。

(2) 一般设置为离子半径的平均值,实际只要在差不多的范围内就没有关系

From  Xing Wang

#!/bin/sh

#PBS -l nodes=1:ppn=12

#PBS -N UZr2_phonon

#PBS -j oe

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/software/compiler/mkl/lib/em64t

cd $PBS_O_WORKDIR

NPROCS=`wc -l < $PBS_NODEFILE`

echo This job has allocated $NPROCS nodes

echo The root node is

uname -n

master=`hostname | cut -f 1 -d '.'`

node_list=`cat $PBS_NODEFILE`

##cat $PBS_NODEFILE | awk '{ print $1"-clust" }' > ./hostfile

cat $PBS_NODEFILE | awk '{ print $1" slots=12" }' > ./hostfile

/home/software/mpi/openmpi1.4.3-intel/bin/mpirun  -np $NPROCS -hostfile ./hostfile /home/software/vasp/vasp.5.2.2/vasp >&vasp.log

rm hostfile vasp.log  EIGENVAL DOSCAR  IBZKPT WAVECAR CHG CHGCAR XDATCAR PCDAT

Thanks to QiangZhu and XInyue CHen

1) 怎样限制USPEX提交的任务数量,即始终保持只有五个任务在队列中排队或运算,而不是像下述情形一样,有上百个任务在队列中:

关键就是你要修改 checkStatus_local.m, 里面把确定作业状态的关键词放进去 (Queue, Exit, Run)

你大概修改如下

%Step1: the command to check job by ID.     [a,b] = unix(['qstat ' jobID ''])

如果你用qstat查命令就不用修改

%Step2: to find the keywords from the screen message to determine if the job is complete%Below is just a sample:%-------------------------------------------------------------------------------%Job id                    Name             User            Time Use S Queue%------------------------- ---------------- --------------- -------- - ---------%2455453.nano              USPEX            qzhu            02:28:42 R cfn_gen04%-------------------------------------------------------------------------------

if isempty(findstr(b,'R cfn_')) & isempty(findstr(b,'Q cfn_'))

这里我找的是如果改作业状态不是在(Run)后者(Queue),就认为作业结束, 你需要对关键词修改即可50375.mu01  yexq dell     vasp    12    --  7200: R 47:25

50443.mu01  yexq dell     USPEX    8    --  01:30 Q   --

50444.mu01  yexq dell     USPEX    8    --  01:30 Q   --

50445.mu01  yexq dell     USPEX    8    --  01:30 Q   --

50446.mu01  yexq dell     USPEX    8    --  01:30 Q   --

50447.mu01  yexq dell     USPEX    8    --  01:30 Q   --

50448.mu01  yexq dell     USPEX    8    --  01:30 Q   --

50449.mu01  yexq dell     USPEX    8    --  01:30 Q   --

50450.mu01  yexq dell     USPEX    8    --  01:30 Q   --

50451.mu01  yexq dell     USPEX    8    --  01:30 Q   --

50452.mu01  yexq dell     USPEX    8    --  01:30 Q   --

50453.mu01  yexq dell     USPEX    8    --  01:30 Q   --

......

(程xy博士:这个好像要修改提交的脚本,具体哪个跟每个超级机有关...

你需要修改uspex根目录下的submission里面的相关文件

这个比较复杂,最好问问ZhuQ博士)

2)  IonDistances离子之间距离,感觉应该是共价半径的加和,不知对否?

(程xy博士:是共价半径的0.8倍,估计值)

0.6-0.8倍的区间都可以

USPEX目录下的文件及文件夹:

ls

AntiSeeds        Current_POP.mat  getStuff    multiple_runs  results1      Submission         USPEX.m

clean            ev_alg.m         INPUT.txt   nohup.out      run-uspex.sh  submitJob_local.m  uspex_MoSi2

clean_tough      FunctionFolder   log         out.uspex      Seeds         submit.sh

Current_ORG.mat  getFromTo        metasoft.m  out.uspex2     Specific      test

运行后产生Cal*等文件夹。

变胞方法: 参考uspex手册

转载本文请联系原作者获取授权,同时请注明本文来自叶小球科学网博客。

链接地址:http://wap.sciencenet.cn/blog-567091-837003.html

上一篇:bader电荷分析再谈

下一篇:声子谱虚频的另类情况及如何提高声子计算速度

nproc是什么意思_科学网—再谈USPEX - 叶小球的博文相关推荐

  1. python shell背景颜色改变_科学网—Python Shell Background Color - 李旭的博文

    ArcGIS在安装时就已经默认在本机安装了Python.可是,Python Shell的界面看起来太亮了,对眼睛不太好啊,如图1. 图1 在网上搜索一番,之前也有和我同样问题的帖子,不过,时间有点久了 ...

  2. library netcdf 路径_科学网—NetCDF安装记录 - 丁鹏基的博文

    1:  NetCDF编译过程 cd netcdf-4.1.3 ./configure --disable-dap --disable-netcdf-4 --prefix=/usr/local/netc ...

  3. 冯诺曼伊体系 计算机五大逻辑,科学网—再谈冯·诺伊曼结构 - 姜咏江的博文

    再谈冯·诺伊曼结构 姜咏江 为了说明问题简单,我引用一段百度百科当中的文字和图: 冯.诺依曼体系结构是现代计算机的基础,现在大多计算机仍是冯.诺依曼计算机的组织结构,只是作了一些改进而已,并没有从根本 ...

  4. python爬pdf的曲线_科学网—Python爬PDF - 胡鹏程的博文

    最近用Python爬了两本书,分享下代码,仅作为交流和分享. #下载# import requests #先导入库 import re #正则表达式 import os #创建路径 import ra ...

  5. rnss和rdss的应用_科学网-北斗RNSS和RDSS-陈超的博文

    1.RNSS与RDSS的集成概念 服务于用户位置确定的卫星无线电业务有两种.一种是卫星无线电导航业务,英文全称RadioNavigation SatelliteSystem,缩写RNSS,由用户接收卫 ...

  6. rnss和rdss的应用_科学网—北斗RNSS和RDSS - 陈超的博文

    1.RNSS与RDSS的集成概念 服务于用户位置确定的卫星无线电业务有两种.一种是卫星无线电导航业务,英文全称RadioNavigation SatelliteSystem,缩写RNSS,由用户接收卫 ...

  7. python提取句子_科学网—Python提取句子 - 吕波的博文

    将一段话中的句子分离出来不是一件容易的事.因为句子的开头和结尾并不是很规则,而且句子内部会出现句号.这使得通过单一的正则表达式分离句子是不可能的.有时你能成功,但大多数时候你会出错.这里我们用nltk ...

  8. python提取关键字所在句子_科学网-Python提取句子-吕波的博文

    将一段话中的句子分离出来不是一件容易的事.因为句子的开头和结尾并不是很规则,而且句子内部会出现句号.这使得通过单一的正则表达式分离句子是不可能的.有时你能成功,但大多数时候你会出错.这里我们用nltk ...

  9. python多线程并发数量控制简书_科学网—python多线程编程 - 郗强的博文

    Python是支持多线程的,主要通过thread和threading两个模块来实现,其中thread模块比较底层(或者说是轻量级的),而threading模块对thread做了一些包装,可以更加方便地 ...

最新文章

  1. Discuz验证码识别(编码篇)-写给程序员的TensorFlow教程
  2. 前端月趋势榜:5 月最热门的 20 个前端开源项目 - 2105
  3. Kalileo中DiagramGroup布局
  4. 小菜:Java异常处理的10个最佳实践
  5. malloc/free 和 new/delete
  6. 募捐:请帮助一名 Linux 程序员的女儿
  7. linux解析json指针,Linux下JSON通信协议的使用和解析
  8. mysql数据库子查询练习_子查询以及sql练习
  9. qzone.class.php,PHP QQ登录接口应用_PHP教程 - str_repeat
  10. 2021-06-24
  11. GPS经纬度差值对应地面距离多少米
  12. 当我们电脑上的Microsoft Office2003/2007/2010无法卸载时怎么处理?
  13. Tensorflow nmt的整体结构
  14. Network(无向图割点,tarjan)
  15. 【Python】bar柱状(条形)图(带均值和标准差)
  16. BMS 中的安规设计
  17. 只需3步把VSCode打造成Markdown编辑器
  18. Unity3D中在Game视图调整屏幕大小,回到Scen视图发现游戏界面被改变了(解决方案)
  19. ie浏览器开发比谷歌浏览器_跨浏览器开发:处理IE
  20. 开封抖音广告如何有效投放?

热门文章

  1. 【数组】- 如何求C++数组的中位数?
  2. C语言 strlen(int),C语言 - strlen函数及int,char转换问题
  3. 斯特林公式 ——Stirling公式(取N阶乘近似值)(转)
  4. 人脸识别4:Android InsightFace实现人脸识别Face Recognition(含源码)
  5. RxSwift + Moya + HandyJSON + 各种插件搭建响应式网络架构
  6. 强化学习3(策略学习)
  7. 汽车功能安全研究:主机厂和供应商的ISO26262布局
  8. 2020社招阿里、腾讯、蚂蚁金服「四面」Java面试真题分享
  9. RTOS中的可重入函数与不可重入函数
  10. Python生成gif动图