Skip to content

Commit 7d9dc23

Browse files
dyzhengpxlxinglianghongriTianqi
authored
Docs: add the readme and running scripts for example (#207)
* Docs: add the readme and running scripts for example/matrix_hs * Docs: add the readme and running scripts for examples/md * Flow: dflow abacus examples (#1364) * example: dflow compensating_charge * example: dflow dipole_correction * example: update README * example: dflow electric_field * example: dflow implicit_solvation_model * example: dflow deepks example * example: dflow dft_plus_u example * example: dflow force example * example: dflow hse example * example: dflow vdw examples * example: dflow stress example * examples: dflow smearing example * example: dflow relax example * example: dflow sdft Co-authored-by: root <[email protected]> Co-authored-by: hongriTianqi <[email protected]>
1 parent de86fa5 commit 7d9dc23

File tree

66 files changed

+504
-11567
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+504
-11567
lines changed

examples/README

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,21 @@ use the interfaces between ABACUS and some extenal softwares.
99

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

12+
Except for interface examples, a bash script `runall.sh` is required for each example
13+
directory to be accessed by `dflow_run.py`. Each example directory may contains several
14+
examples for different systems or input settings, where a bash script `run.sh` is
15+
required to run the specific example. The `SETENV` is read by `run.sh` to get the
16+
executable directory of abacus (`ABACUS_PATH`), number of processes (`ABACUS_NPROCS`) and
17+
number of threads (`ABACUS_THREADS`).
18+
19+
How to run dflow_run.py:
20+
21+
- `python3 dflow_run.py --find 1`:
22+
find all directories where `runall.sh` has been prepared.
23+
24+
- `python3 dflow_run.py --run 1`:
25+
submmit dflow jobs.
26+
27+
- `python3 dflow_run.py --post 1`
28+
checkout the status of jobs.
29+

examples/compensating_charge/Pt-slab/INPUT

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
INPUT_PARAMETERS
2-
pseudo_dir ./
2+
pseudo_dir ../../../tests/PP_ORB
33
ntype 1
44
dft_functional pbe
55
symmetry 0
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/bash
2+
3+
ABACUS_PATH=$(awk -F "=" '$1=="ABACUS_PATH"{print $2}' ../../SETENV)
4+
ABACUS_NPROCS=$(awk -F "=" '$1=="ABACUS_NPROCS"{print $2}' ../../SETENV)
5+
ABACUS_THREADS=$(awk -F "=" '$1=="ABACUS_THREADS"{print $2}' ../../SETENV)
6+
7+
OMP_NUM_THREADS=${ABACUS_THREADS} mpirun -np ${ABACUS_NPROCS} ${ABACUS_PATH} | tee scf.output
File renamed without changes.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/bash
2+
3+
for ii in *
4+
do
5+
if [ -d $ii ];then
6+
cd ${ii}
7+
echo "RUN: ${ii}"
8+
bash run.sh
9+
cd ..
10+
fi
11+
done

examples/deepks/README

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/*******************************************************************************/
2+
/
3+
/ These are the examples of ABACUS program.
4+
/
5+
/*******************************************************************************/
6+
7+
Here are two examples:
8+
9+
1. Generate projectors (a series of bessel functions) for DeePKS. \
10+
A file named `jle.orb` will be generated which contains the projectors.
11+
12+
- see pw_H2O
13+
14+
2. A scf calculation with a trained DeePKS model loaded. A few .npy files will \
15+
be generated which are for DeePKS training only. The total energy and \
16+
force will be output in a way as a normal SCF job does.
17+
18+
- see lcao_H2O

examples/deepks/lcao_H2O/run.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/bash
2+
3+
ABACUS_PATH=$(awk -F "=" '$1=="ABACUS_PATH"{print $2}' ../../SETENV)
4+
ABACUS_NPROCS=$(awk -F "=" '$1=="ABACUS_NPROCS"{print $2}' ../../SETENV)
5+
ABACUS_THREADS=$(awk -F "=" '$1=="ABACUS_THREADS"{print $2}' ../../SETENV)
6+
7+
OMP_NUM_THREADS=${ABACUS_THREADS} mpirun -np ${ABACUS_NPROCS} ${ABACUS_PATH} | tee scf.output

examples/deepks/pw_H2O/run.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/bash
2+
3+
ABACUS_PATH=$(awk -F "=" '$1=="ABACUS_PATH"{print $2}' ../../SETENV)
4+
ABACUS_NPROCS=$(awk -F "=" '$1=="ABACUS_NPROCS"{print $2}' ../../SETENV)
5+
ABACUS_THREADS=$(awk -F "=" '$1=="ABACUS_THREADS"{print $2}' ../../SETENV)
6+
7+
OMP_NUM_THREADS=${ABACUS_THREADS} mpirun -np ${ABACUS_NPROCS} ${ABACUS_PATH} | tee scf.output

examples/deepks/runall.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/bash
2+
3+
for ii in *
4+
do
5+
if [ -d $ii ];then
6+
cd ${ii}
7+
echo "RUN: ${ii}"
8+
bash run.sh
9+
cd ..
10+
fi
11+
done

examples/dft_plus_u/INPUT renamed to examples/dft_plus_u/NiO/INPUT

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ suffix NiO
33
ntype 2
44
nbands 40
55

6+
pseudo_dir ../../../tests/PP_ORB
7+
orbital_dir ../../../tests/PP_ORB
8+
69
calculation scf
710
ecutwfc 100
811
scf_thr 1.0e-6

0 commit comments

Comments
 (0)