Commit 9df86a0e authored by Marco Govoni's avatar Marco Govoni

Merge branch 'ci_update' into 'develop'

Ci update

See merge request west-devel/West!31
parents 89701646 93a67ae8
This diff is collapsed.
......@@ -157,11 +157,7 @@ html_logo = "images/logo.jpg"
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
html_context = {
'css_files': [
'_static/theme_overrides.css', # override wide tables in RTD theme
],
}
html_ccs_files = ['theme_overrides.css'] # override wide tables in RTD theme
# Add any extra paths that contain custom files (such as robots.txt or
# .htaccess) here, relative to this directory. These files are copied
......
# Makefile
#
testdirs:= test001 test002 test003 test004 test005
default: title all
all:
for d in $(testdirs); do cd $$d; $(MAKE); [[ $$? != 0 ]] && exit -1; echo 'done'; cd ..; done
for d in $(testdirs); do cd $$d; $(MAKE); cd ..; done
python3 check.py
clean:
for d in $(testdirs); do cd $$d; $(MAKE) clean; cd ..; done
......
import json
import os
import shutil
import sys
activeTests = [1,2,3,4,5]
tolerance = 0.0001
def check_pw(prefix):
# Check "JOB DONE"
fileName = prefix+'/pw.out'
if not os.path.isfile(fileName):
print(prefix+': pw.out not found')
return 1
ok = False
test = 0.0
with open(fileName,'r') as f:
for line in f:
if 'JOB DONE' in line:
ok = True
if '! total energy' in line:
test = float(line.split()[4])
if not ok:
print(prefix+': pwscf failed')
return 1
# Remove stderr (may exceed artifact size limit)
fileName = prefix+'/pw.err'
if os.path.isfile(fileName):
os.remove(fileName)
# Load reference
fileName = prefix+'/ref/pw.ref'
with open(fileName,'r') as f:
for line in f:
if '! total energy' in line:
ref = float(line.split()[4])
# Total energy error
absDiff = abs(ref-test)
if absDiff > tolerance:
print(prefix+': pwscf bad (diff '+"{:.2e}".format(absDiff)+')')
return 1
else:
print(prefix+': pwscf good (diff '+"{:.2e}".format(absDiff)+')')
return 0
def check_wstat(prefix):
# Check "JOB DONE"
fileName = prefix+'/wstat.out'
if not os.path.isfile(fileName):
print(prefix+': wstat.out not found')
return 1
ok = False
with open(fileName,'r') as f:
for line in f:
if 'JOB DONE' in line:
ok = True
break
if not ok:
print(prefix+': wstat failed')
return 1
# Remove stderr (may exceed artifact size limit)
fileName = prefix+'/wstat.err'
if os.path.isfile(fileName):
os.remove(fileName)
# Load reference
fileName = prefix+'/ref/summary.json'
with open(fileName,'r') as f:
jsonData = json.load(f)
# Load test
fileName = prefix+'/test.wstat.save/summary.json'
if not os.path.isfile(fileName):
print(prefix+': wstat output not found')
return 1
ok = True
maxDiff = 0.0
with open(fileName,'r') as f:
jsonData2 = json.load(f)
for ii in range(len(jsonData['dielectric_matrix']['pdep'])):
ref = jsonData['dielectric_matrix']['pdep'][ii]['eigenval']
test = jsonData2['dielectric_matrix']['pdep'][ii]['eigenval']
for jj in range(len(ref)):
absDiff = abs(ref[jj]-test[jj])
maxDiff = max(maxDiff,absDiff)
if absDiff > tolerance:
ok = False
if ok:
print(prefix+': wstat good (max diff '+"{:.2e}".format(maxDiff)+')')
return 0
else:
print(prefix+': wstat bad (max diff '+"{:.2e}".format(maxDiff)+')')
return 1
def check_wfreq(prefix):
# Check "JOB DONE"
fileName = prefix+'/wfreq.out'
if not os.path.isfile(fileName):
print(prefix+': wfreq.out not found')
return 1
ok = False
with open(fileName,'r') as f:
for line in f:
if 'JOB DONE' in line:
ok = True
break
if not ok:
print(prefix+': wfreq failed')
return 1
# Remove stderr (may exceed artifact size limit)
fileName = prefix+'/wfreq.err'
if os.path.isfile(fileName):
os.remove(fileName)
# Load reference
fileName = prefix+'/ref/wfreq.json'
with open(fileName,'r') as f:
jsonData = json.load(f)
# Load test
fileName = prefix+'/test.wfreq.save/wfreq.json'
if not os.path.isfile(fileName):
print(prefix+': wfreq output not found')
return 1
ok = True
maxDiff = 0.0
with open(fileName,'r') as f:
jsonData2 = json.load(f)
for ii in range(jsonData['system']['electron']['nkstot']):
ref = jsonData['output']['Q']['K'+str(ii+1).zfill(6)]['sigmax']
test = jsonData2['output']['Q']['K'+str(ii+1).zfill(6)]['sigmax']
for jj in range(len(ref)):
absDiff = abs(ref[jj]-test[jj])
maxDiff = max(maxDiff,absDiff)
if absDiff > tolerance:
ok = False
ref = jsonData['output']['Q']['K'+str(ii+1).zfill(6)]['sigmac_eqpSec']['re']
test = jsonData2['output']['Q']['K'+str(ii+1).zfill(6)]['sigmac_eqpSec']['re']
for jj in range(len(ref)):
absDiff = abs(ref[jj]-test[jj])
maxDiff = max(maxDiff,absDiff)
if absDiff > tolerance:
ok = False
ref = jsonData['output']['Q']['K'+str(ii+1).zfill(6)]['sigmac_eqpSec']['im']
test = jsonData2['output']['Q']['K'+str(ii+1).zfill(6)]['sigmac_eqpSec']['im']
for jj in range(len(ref)):
absDiff = abs(ref[jj]-test[jj])
maxDiff = max(maxDiff,absDiff)
if absDiff > tolerance:
ok = False
if ok:
print(prefix+': wfreq good (max diff '+"{:.2e}".format(maxDiff)+')')
return 0
else:
print(prefix+': wfreq bad (max diff '+"{:.2e}".format(maxDiff)+')')
return 1
if __name__ == "__main__":
ok = True
for ii in activeTests:
print()
prefix = 'test'+str(ii).zfill(3)
err = check_pw(prefix)
if err != 0:
ok = False
err = check_wstat(prefix)
if err != 0:
ok = False
err = check_wfreq(prefix)
if err != 0:
ok = False
if not ok:
sys.exit(1)
......@@ -2,25 +2,28 @@
# Parallel execution knobs
#
export NP=2 # Number of MPI processes
export NI=1 # NUmber of images
export NT=1 # Number of OPENMP threads
export NP=2 # Number of MPI processes
export NI=1 # Number of images
export NT=1 # Number of OpenMP threads
#
# Commands needed by the scripts
# Commands needed by the scripts
#
# Directory where the executables (*.x) are located
export BINDIR = ../../../bin
# Directory where the executables (*.x) are located
export BINDIR=../../../bin
# How to run in a parallel executable with MPI
export PARA_PREFIX = mpirun -np ${NP}
# How to run West parallel executables with MPI
export PARA_PREFIX=mpirun -np ${NP}
# How to run QE parallel executables with MPI
export PARA_PREFIX_QE=mpirun -np 2
# How to download files
export WGET=wget -N -q
###### DO NOT TOUCH BELOW ######
export NIMAGE = ${NI}
export OMP_NUM_THREADS = ${NT}
export NIMAGE=${NI}
export OMP_NUM_THREADS=${NT}
......@@ -4,25 +4,24 @@ include ../maketest.inc
default: title description all
all: prepare_inputs run
all: prepare_inputs run
prepare_inputs:
prepare_inputs:
bash prepare_inputs.sh
run: pw wstat wfreq
pw:
${PARA_PREFIX} ${BINDIR}/pw.x -i pw.in > pw.out
tail -5 pw.out
wstat:
${PARA_PREFIX} ${BINDIR}/wstat.x -nimage ${NIMAGE} -i wstat.in > wstat.out
tail -5 wstat.out
wfreq:
${PARA_PREFIX} ${BINDIR}/wfreq.x -nimage ${NIMAGE} -i wfreq.in > wfreq.out
tail -5 wfreq.out
${PARA_PREFIX_QE} ${BINDIR}/pw.x -i pw.in > pw.out 2> pw.err
wstat: pw
${PARA_PREFIX} ${BINDIR}/wstat.x -nimage ${NIMAGE} -i wstat.in > wstat.out 2> wstat.err
wfreq: wstat
${PARA_PREFIX} ${BINDIR}/wfreq.x -nimage ${NIMAGE} -i wfreq.in > wfreq.out 2> wfreq.err
clean:
- /bin/rm -rf *out *in *upf *tab *restart *save >& /dev/null
- /bin/rm -rf *out *err *in *xml *upf *tab *restart *save *wfc* CRASH > /dev/null 2>&1
title:
@echo " "
......
......@@ -10,7 +10,7 @@ restart_mode = 'from_scratch'
pseudo_dir = './'
outdir = './'
prefix = 'test'
wf_collect = .TRUE.
wf_collect = .true.
/
&system
ibrav = 1
......@@ -19,10 +19,10 @@ nat = 5
ntyp = 2
ecutwfc = 25.0
nbnd = 10
assume_isolated ='mp'
assume_isolated = 'mp'
/
&electrons
diago_full_acc = .TRUE.
diago_full_acc = .true.
/
ATOMIC_SPECIES
Si 28.0855 Si_ONCV_PBE-1.1.upf
......@@ -38,31 +38,31 @@ EOF
cat > wstat.in << EOF
input_west:
qe_prefix: test
west_prefix: test
outdir: ./
input_west:
qe_prefix: test
west_prefix: test
outdir: ./
wstat_control:
wstat_calculation: S
n_pdep_eigen: 50
wstat_control:
wstat_calculation: S
n_pdep_eigen: 50
EOF
cat > wfreq.in << EOF
cat > wfreq.in << EOF
input_west:
qe_prefix: test
west_prefix: test
outdir: ./
qe_prefix: test
west_prefix: test
outdir: ./
wstat_control:
wstat_calculation: S
n_pdep_eigen: 50
wstat_control:
wstat_calculation: S
n_pdep_eigen: 50
wfreq_control:
wfreq_calculation: XWGQ
n_pdep_eigen_to_use: 50
qp_bandrange: [1,5]
n_refreq: 300
ecut_refreq: 2.0
wfreq_control:
wfreq_calculation: XWGQ
n_pdep_eigen_to_use: 50
qp_bandrange: [1,5]
n_refreq: 300
ecut_refreq: 2.0
EOF
This diff is collapsed.
{
"dielectric_matrix": {
"domain": {
"a1": [
0.2E+2,
0.0E+0,
0.0E+0
],
"a2": [
0.0E+0,
0.2E+2,
0.0E+0
],
"a3": [
0.0E+0,
0.0E+0,
0.2E+2
],
"b1": [
0.31415926535897931E+0,
0.0E+0,
0.0E+0
],
"b2": [
0.0E+0,
0.31415926535897931E+0,
0.0E+0
],
"b3": [
0.0E+0,
0.0E+0,
0.31415926535897931E+0
]
},
"pdep": [
{
"iq": 1,
"q": [
0.0E+0,
0.0E+0,
0.0E+0
],
"eigenval": [
-0.12747803650096974E+1,
-0.11912713043263194E+1,
-0.11912019013531367E+1,
-0.11911727395590503E+1,
-0.82405878284143863E+0,
-0.82403636415460413E+0,
-0.82398142518337236E+0,
-0.63586047026228787E+0,
-0.62939264814966034E+0,
-0.62938941232055956E+0,
-0.50052040217007221E+0,
-0.500496137783912E+0,
-0.50047234285802966E+0,
-0.4299390197192417E+0,
-0.42992197342629707E+0,
-0.42991850776993223E+0,
-0.23238117457026031E+0,
-0.23237799711529444E+0,
-0.23237296911598918E+0,
-0.18322988866723214E+0,
-0.18321446697196192E+0,
-0.18320580246587176E+0,
-0.1783966024656746E+0,
-0.17750081014724625E+0,
-0.17749952269411284E+0,
-0.14592449985195577E+0,
-0.14591778926646304E+0,
-0.14591429285679491E+0,
-0.12258013545604536E+0,
-0.12012226015753971E+0,
-0.12011825625020993E+0,
-0.12011615613220855E+0,
-0.11634691374458821E+0,
-0.11634524261482102E+0,
-0.11528924266064652E+0,
-0.11528497308399693E+0,
-0.11528455464285779E+0,
-0.94082139413273314E-1,
-0.94080571163498619E-1,
-0.94080114641552193E-1,
-0.79953719937981671E-1,
-0.79951182740152199E-1,
-0.79950410987097084E-1,
-0.74773570789813809E-1,
-0.73100828973161489E-1,
-0.73099545357498727E-1,
-0.65778386722789892E-1,
-0.6577325275896212E-1,
-0.65768926473665223E-1,
-0.63134316058295115E-1
],
"eigenvec": [
"Q000000001E000000001.json",
"Q000000001E000000002.json",
"Q000000001E000000003.json",
"Q000000001E000000004.json",
"Q000000001E000000005.json",
"Q000000001E000000006.json",
"Q000000001E000000007.json",
"Q000000001E000000008.json",
"Q000000001E000000009.json",
"Q000000001E000000010.json",
"Q000000001E000000011.json",
"Q000000001E000000012.json",
"Q000000001E000000013.json",
"Q000000001E000000014.json",
"Q000000001E000000015.json",
"Q000000001E000000016.json",
"Q000000001E000000017.json",
"Q000000001E000000018.json",
"Q000000001E000000019.json",
"Q000000001E000000020.json",
"Q000000001E000000021.json",
"Q000000001E000000022.json",
"Q000000001E000000023.json",
"Q000000001E000000024.json",
"Q000000001E000000025.json",
"Q000000001E000000026.json",
"Q000000001E000000027.json",
"Q000000001E000000028.json",
"Q000000001E000000029.json",
"Q000000001E000000030.json",
"Q000000001E000000031.json",
"Q000000001E000000032.json",
"Q000000001E000000033.json",
"Q000000001E000000034.json",
"Q000000001E000000035.json",
"Q000000001E000000036.json",
"Q000000001E000000037.json",
"Q000000001E000000038.json",
"Q000000001E000000039.json",
"Q000000001E000000040.json",
"Q000000001E000000041.json",
"Q000000001E000000042.json",
"Q000000001E000000043.json",
"Q000000001E000000044.json",
"Q000000001E000000045.json",
"Q000000001E000000046.json",
"Q000000001E000000047.json",
"Q000000001E000000048.json",
"Q000000001E000000049.json",
"Q000000001E000000050.json"
]
}
]
}
}
This diff is collapsed.
......@@ -4,28 +4,24 @@ include ../maketest.inc
default: title description all
all: prepare_inputs run
all: prepare_inputs run
prepare_inputs:
prepare_inputs:
bash prepare_inputs.sh
run: pw wstat1 wstat2 wfreq
pw:
${PARA_PREFIX} ${BINDIR}/pw.x -i pw.in > pw.out
tail -5 pw.out
wstat1:
${PARA_PREFIX} ${BINDIR}/wstat.x -nimage ${NIMAGE} -i wstat1.in > wstat1.out
tail -5 wstat1.out
wstat2:
${PARA_PREFIX} ${BINDIR}/wstat.x -nimage ${NIMAGE} -i wstat2.in > wstat2.out
tail -5 wstat2.out
wfreq:
${PARA_PREFIX} ${BINDIR}/wfreq.x -nimage ${NIMAGE} -i wfreq.in > wfreq.out
tail -5 wfreq.out
run: pw wstat wfreq
pw:
${PARA_PREFIX_QE} ${BINDIR}/pw.x -i pw.in > pw.out 2> pw.err
wstat: pw
${PARA_PREFIX} ${BINDIR}/wstat.x -nimage ${NIMAGE} -i wstat.in > wstat.out 2> wstat.err
wfreq: wstat
${PARA_PREFIX} ${BINDIR}/wfreq.x -nimage ${NIMAGE} -i wfreq.in > wfreq.out 2> wfreq.err
clean:
- /bin/rm -rf *out *in *upf *tab *restart *save >& /dev/null
- /bin/rm -rf *out *err *in *xml *upf *tab *restart *save *wfc* CRASH > /dev/null 2>&1
title:
@echo " "
......
......@@ -10,7 +10,7 @@ restart_mode = 'from_scratch'
pseudo_dir = './'
outdir = './'
prefix = 'test'
wf_collect = .TRUE.
wf_collect = .true.
/
&system
ibrav = 1
......@@ -19,10 +19,10 @@ nat = 5
ntyp = 2
ecutwfc = 25.0
nbnd = 10
assume_isolated ='mp'
assume_isolated = 'mp'
/
&electrons
diago_full_acc = .TRUE.
diago_full_acc = .true.
/
ATOMIC_SPECIES
C 12.0107 C_ONCV_PBE-1.0.upf
......@@ -37,7 +37,7 @@ K_POINTS {gamma}
EOF
cat > wstat1.in << EOF
cat > wstat.in << EOF
{
"input_west": {
"qe_prefix": "test",
......@@ -46,38 +46,29 @@ cat > wstat1.in << EOF
},
"wstat_control": {
"wstat_calculation": "S",
"n_pdep_eigen": 10
"n_pdep_eigen": 50
}
}
EOF
cat > wstat2.in << EOF
input_west:
qe_prefix: test
west_prefix: test
outdir: ./
wstat_control:
wstat_calculation: S
n_pdep_eigen: 50
n_pdep_read_from_file: 5
EOF
cat > wfreq.in << EOF
input_west:
qe_prefix: test
west_prefix: test
outdir: ./
wstat_control:
wstat_calculation: S
n_pdep_eigen: 50
wfreq_control:
wfreq_calculation: XWGQ
n_pdep_eigen_to_use: 50
qp_bandrange: [1,5]
n_refreq: 300
ecut_refreq: 2.0
cat > wfreq.in << EOF
{
"input_west": {
"qe_prefix": "test",
"west_prefix": "test",
"outdir": "./"
},
"wstat_control": {
"wstat_calculation": "S",
"n_pdep_eigen": 50
},
"wfreq_control": {
"wfreq_calculation": "XWGQ",
"n_pdep_eigen_to_use": 50,
"qp_bandrange": [1,5],
"n_refreq": 300,
"ecut_refreq": 2.0
}
}
EOF
This diff is collapsed.
{
"dielectric_matrix": {
"domain": {
"a1": [
0.2E+2,
0.0E+0,
0.0E+0
],
"a2": [
0.0E+0,
0.2E+2,
0.0E+0
],
"a3": [
0.0E+0,
0.0E+0,
0.2E+2
],
"b1": [
0.31415926535897931E+0,
0.0E+0,
0.0E+0
],
"b2": [
0.0E+0,
0.31415926535897931E+0,
0.0E+0
],
"b3": [
0.0E+0,
0.0E+0,
0.31415926535897931E+0
]
},
"pdep": [
{
"iq": 1,
"q": [
0.0E+0,
0.0E+0,
0.0E+0
],
"eigenval": [
-0.17528651035016873E+1,
-0.9563878066098831E+0,
-0.95638129633549673E+0,
-0.95634507922874401E+0,