Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions examples/README
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,21 @@ use the interfaces between ABACUS and some extenal softwares.

The examples interface_XXXX show the using of interface of ABACUS and XXXX

Except for interface examples, a bash script `runall.sh` is required for each example
directory to be accessed by `dflow_run.py`. Each example directory may contains several
examples for different systems or input settings, where a bash script `run.sh` is
required to run the specific example. The `SETENV` is read by `run.sh` to get the
executable directory of abacus (`ABACUS_PATH`), number of processes (`ABACUS_NPROCS`) and
number of threads (`ABACUS_THREADS`).

How to run dflow_run.py:

- `python3 dflow_run.py --find 1`:
find all directories where `runall.sh` has been prepared.

- `python3 dflow_run.py --run 1`:
submmit dflow jobs.

- `python3 dflow_run.py --post 1`
checkout the status of jobs.

2 changes: 1 addition & 1 deletion examples/compensating_charge/Pt-slab/INPUT
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
INPUT_PARAMETERS
pseudo_dir ./
pseudo_dir ../../../tests/PP_ORB
ntype 1
dft_functional pbe
symmetry 0
Expand Down
7 changes: 7 additions & 0 deletions examples/compensating_charge/Pt-slab/run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash

ABACUS_PATH=$(awk -F "=" '$1=="ABACUS_PATH"{print $2}' ../../SETENV)
ABACUS_NPROCS=$(awk -F "=" '$1=="ABACUS_NPROCS"{print $2}' ../../SETENV)
ABACUS_THREADS=$(awk -F "=" '$1=="ABACUS_THREADS"{print $2}' ../../SETENV)

OMP_NUM_THREADS=${ABACUS_THREADS} mpirun -np ${ABACUS_NPROCS} ${ABACUS_PATH} | tee scf.output
11 changes: 11 additions & 0 deletions examples/compensating_charge/runall.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash

for ii in *
do
if [ -d $ii ];then
cd ${ii}
echo "RUN: ${ii}"
bash run.sh
cd ..
fi
done
18 changes: 18 additions & 0 deletions examples/deepks/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/*******************************************************************************/
/
/ These are the examples of ABACUS program.
/
/*******************************************************************************/

Here are two examples:

1. Generate projectors (a series of bessel functions) for DeePKS. \
A file named `jle.orb` will be generated which contains the projectors.

- see pw_H2O

2. A scf calculation with a trained DeePKS model loaded. A few .npy files will \
be generated which are for DeePKS training only. The total energy and \
force will be output in a way as a normal SCF job does.

- see lcao_H2O
7 changes: 7 additions & 0 deletions examples/deepks/lcao_H2O/run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash

ABACUS_PATH=$(awk -F "=" '$1=="ABACUS_PATH"{print $2}' ../../SETENV)
ABACUS_NPROCS=$(awk -F "=" '$1=="ABACUS_NPROCS"{print $2}' ../../SETENV)
ABACUS_THREADS=$(awk -F "=" '$1=="ABACUS_THREADS"{print $2}' ../../SETENV)

OMP_NUM_THREADS=${ABACUS_THREADS} mpirun -np ${ABACUS_NPROCS} ${ABACUS_PATH} | tee scf.output
7 changes: 7 additions & 0 deletions examples/deepks/pw_H2O/run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash

ABACUS_PATH=$(awk -F "=" '$1=="ABACUS_PATH"{print $2}' ../../SETENV)
ABACUS_NPROCS=$(awk -F "=" '$1=="ABACUS_NPROCS"{print $2}' ../../SETENV)
ABACUS_THREADS=$(awk -F "=" '$1=="ABACUS_THREADS"{print $2}' ../../SETENV)

OMP_NUM_THREADS=${ABACUS_THREADS} mpirun -np ${ABACUS_NPROCS} ${ABACUS_PATH} | tee scf.output
11 changes: 11 additions & 0 deletions examples/deepks/runall.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash

for ii in *
do
if [ -d $ii ];then
cd ${ii}
echo "RUN: ${ii}"
bash run.sh
cd ..
fi
done
3 changes: 3 additions & 0 deletions examples/dft_plus_u/INPUT → examples/dft_plus_u/NiO/INPUT
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ suffix NiO
ntype 2
nbands 40

pseudo_dir ../../../tests/PP_ORB
orbital_dir ../../../tests/PP_ORB

calculation scf
ecutwfc 100
scf_thr 1.0e-6
Expand Down
File renamed without changes.
12 changes: 6 additions & 6 deletions examples/dft_plus_u/STRU → examples/dft_plus_u/NiO/STRU
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
ATOMIC_SPECIES
Ni1 1.000 ../../tests/PP_ORB/Ni_ONCV_PBE-1.0.upf
Ni2 1.000 ../../tests/PP_ORB/Ni_ONCV_PBE-1.0.upf
O 1.000 ../../tests/PP_ORB/O_ONCV_PBE-1.0.upf
Ni1 58.693 Ni_ONCV_PBE-1.0.upf
Ni2 58.693 Ni_ONCV_PBE-1.0.upf
O 15.999 O_ONCV_PBE-1.0.upf

NUMERICAL_ORBITAL
../../tests/PP_ORB/Ni_gga_9au_100Ry_4s2p2d1f.orb
../../tests/PP_ORB/Ni_gga_9au_100Ry_4s2p2d1f.orb
../../tests/PP_ORB/O_gga_7au_100Ry_2s2p1d.orb
Ni_gga_9au_100Ry_4s2p2d1f.orb
Ni_gga_9au_100Ry_4s2p2d1f.orb
O_gga_7au_100Ry_2s2p1d.orb

LATTICE_CONSTANT
7.884
Expand Down
7 changes: 7 additions & 0 deletions examples/dft_plus_u/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/*******************************************************************************/
/
/ These are the examples of ABACUS program.
/
/*******************************************************************************/

These examples show how to run DFT+U calculations in ABACUS.
11 changes: 11 additions & 0 deletions examples/dft_plus_u/runall.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash

for ii in *
do
if [ -d $ii ];then
cd ${ii}
echo "RUN: ${ii}"
bash run.sh
cd ..
fi
done
2 changes: 1 addition & 1 deletion examples/dipole_correction/Pt-slab/INPUT1
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
INPUT_PARAMETERS
pseudo_dir ./
pseudo_dir ../../../tests/PP_ORB
ntype 1
dft_functional pbe
symmetry 0
Expand Down
2 changes: 1 addition & 1 deletion examples/dipole_correction/Pt-slab/INPUT2
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
INPUT_PARAMETERS
pseudo_dir ./
pseudo_dir ../../../tests/PP_ORB
ntype 1
dft_functional pbe
symmetry 0
Expand Down
Loading