You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#This example requires cif2cell to be installed, and have it set in your PATH.
2
+
using DFControl
3
+
4
+
#This example goes through how one would create a job from scratch, using a .cif file for the Structure.
5
+
6
+
#First go to your favourite Crystal structure database and download the .cif you want to use.
7
+
#e.g. Si (F d -3 m :1) : http://www.crystallography.net/cod/9011998.cif
8
+
9
+
#We want to run an 'scf' and 'bands' calculation using QuantumEspresso.
10
+
11
+
12
+
#Variables that will be passed to the `DFJob` constructor.
13
+
14
+
name ="Si"#this name will also be given to the Structure inside the DFJob
15
+
local_dir ="/home/ponet/Documents/Si"
16
+
server_dir ="/home/ponet/Si"
17
+
run_command ="mpirun -np 24"
18
+
bin_dir ="/usr/local/bin"#this is defaulted to the users bin dir = "~/bin/", it is the directory where pw.x etc will be called from
19
+
20
+
pseudo_set =:pbesol#nonrelativistic calculation ( assumes you set up the pseudos, as demonstrated in the README)
21
+
pseudo_specifier ="paw"#this selects the correct pseudo if multiple belong to the pseudo_set. If you don't specify this, the first one in the set will be used.
22
+
23
+
#The header holds all the other information inside a job scriptfile that is not recognized as input and output.
# An additional kwarg is `server=get_default_server()`, which is set to the server you have defined while following the setup in README.
58
+
# This can ofcourse be changed to a different server.
59
+
60
+
#Now the job can be submitted to the server to run.
61
+
submit_job(job)
62
+
#this first saves the job and it's input files to the `job.local_dir` then pushes the `job.tt` file and the inputs to the `job.server_dir` on `job.server`, and runs the `qsub job.tt` command.
63
+
#You can check the job.local_dir to see the input files and `job.tt` script.
64
+
65
+
#you can observe the slurm qstat by doing
66
+
qstat()
67
+
#or watch it by
68
+
watch_qstat()
69
+
#these default to run the commands on the default server
70
+
71
+
#hopefully everything went according to plan and we can watch our outputs
#This example assumes that you ran through the first one.
2
+
# It will show how to load a job from a server, and change flags.
3
+
4
+
using DFControl
5
+
6
+
server_dir ="Si/"
7
+
local_dir ="/home/ponet/Documents/Si"
8
+
job =load_server_job(server_dir, local_dir)
9
+
#shorthand:
10
+
job =ldsj(server_dir, local_dir) #for other shorthands see DFControl/src/shorthands.jl
11
+
12
+
#change flags
13
+
change_flags!(job, :ecutwfc=>25.0) #more `Pair{Symbol, Any}`'s can be given as varargs.
14
+
#shorthand: chfls!
15
+
#change_flags! will only go through already set flags to change them,
16
+
#if you want to set new flags simply do (it can also be used to change already set flags):
17
+
18
+
set_flags!(job, :ecut_rho=>80.) #won't work, it goes through the QE documentation to find the allowed flags for the input files in the job, and also tries to convert the given value to what it should be.
#now we might not want to run all the calculations again.
24
+
#one can change the job "flow":
25
+
change_flow!(job, "scf"=>false) #again, more `Pair{String, Bool}`'s can be given as varargs
26
+
#This looks through all the calculations inside the job, if the `calculation.name` (derived from it's filename) contains a given `String`, it will set `calculation.run` to the corresponding `Bool`.
27
+
#If a job has calculations/inputs that don't need to run, their line will be commented out in `job.tt` script.
28
+
29
+
#now we can resubmit the job with the changed flags
Reads the specified `default_pseudo_dirs` on the `default_server` and sets up the `default_pseudos` variable, and also adds all the entries to the `user_defaults.jl` file.
0 commit comments