diff --git a/dev/Manifest.toml b/dev/Manifest.toml index 93f3a9a4..f0555aa0 100644 --- a/dev/Manifest.toml +++ b/dev/Manifest.toml @@ -87,11 +87,11 @@ version = "4.1.1" [[deps.DFControl]] deps = ["ANSIColoredPrinters", "BinDeps", "CodeTracking", "Colors", "Crayons", "Dates", "DelimitedFiles", "Distributed", "HTTP", "JLD2", "JSON3", "LinearAlgebra", "LoggingExtras", "Media", "Parameters", "Pkg", "PrecompileTools", "ProgressMeter", "REPL", "Reexport", "RemoteHPC", "Requires", "Sockets", "StaticArrays", "StructTypes", "ThreadPools", "UUIDs", "UnitfulAtomic", "fzf_jll", "spglib_jll"] -git-tree-sha1 = "0b8abf037c4f9c7c403e3a47d20ea86b632377b4" -repo-rev = "bbf9a8c7f90f3b4bbe86d5defe3a443707b30ee9" +git-tree-sha1 = "b007db898b4a0a9ff80ceca26cbadc5eaf3b7c17" +repo-rev = "fe2fd6fb9129a8f3569920fa828fb336f547ca6f" repo-url = "https://github.com/louisponet/DFControl.jl.git" uuid = "1e31e15d-4957-550d-a244-318eced754ae" -version = "0.5.32" +version = "0.6.1" [[deps.DataStructures]] deps = ["Compat", "InteractiveUtils", "OrderedCollections"] diff --git a/dev/api/index.html b/dev/api/index.html index fe38fddf..e8d8b269 100644 --- a/dev/api/index.html +++ b/dev/api/index.html @@ -1,2 +1,2 @@ -API reference · DFControl.jl

API reference

This page provides a plain list of all inline documention associated with functions, structs and macros in DFControl. Note that this list is neither structured, complete nor particularly clean, so it only provides rough orientation at the moment. The best reference is the code itself.

+API reference · DFControl.jl

API reference

This page provides a plain list of all inline documention associated with functions, structs and macros in DFControl. Note that this list is neither structured, complete nor particularly clean, so it only provides rough orientation at the moment. The best reference is the code itself.

diff --git a/dev/guide/advanced_tutorial.ipynb b/dev/guide/advanced_tutorial.ipynb index 543c5231..2a7b60ee 100644 --- a/dev/guide/advanced_tutorial.ipynb +++ b/dev/guide/advanced_tutorial.ipynb @@ -22,7 +22,7 @@ { "output_type": "execute_result", "data": { - "text/plain": "+----------------------------JOB----------------------------+\n| name: Si |\n| dir: /home/runner/work/DFControl.jl/DFControl.jl/job |\n| version: 0 |\n| server: fv-az404-815, alive |\n| versions: |\n| state: Unknown |\n+-----------------------------------------------------------+\n(scheduled, not scheduled)\n\tscf\n\tbands\n" + "text/plain": "+----------------------------JOB----------------------------+\n| name: Si |\n| dir: /home/runner/work/DFControl.jl/DFControl.jl/job |\n| version: 0 |\n| server: fv-az1259-401, alive |\n| versions: |\n| state: Unknown |\n+-----------------------------------------------------------+\n(scheduled, not scheduled)\n\tscf\n\tbands\n" }, "metadata": {}, "execution_count": 1 @@ -65,7 +65,7 @@ { "output_type": "execute_result", "data": { - "text/plain": "+--------------------------------------------JOB--------------------------------------------+\n| name: Si |\n| dir: /home/runner/work/DFControl.jl/DFControl.jl/src/../docs/src/assets/Job2 |\n| version: 0 |\n| server: fv-az404-815, alive |\n| versions: |\n| last submission: 2023-09-12T13:05:04 |\n| state: Unknown |\n+-------------------------------------------------------------------------------------------+\n(scheduled, not scheduled)\n\tscf\n\tbands\n" + "text/plain": "+--------------------------------------------JOB--------------------------------------------+\n| name: Si |\n| dir: /home/runner/work/DFControl.jl/DFControl.jl/src/../docs/src/assets/Job2 |\n| version: 0 |\n| server: fv-az1259-401, alive |\n| versions: |\n| last submission: 2023-09-12T13:33:40 |\n| state: Unknown |\n+-------------------------------------------------------------------------------------------+\n(scheduled, not scheduled)\n\tscf\n\tbands\n" }, "metadata": {}, "execution_count": 2 @@ -206,7 +206,7 @@ { "output_type": "execute_result", "data": { - "text/plain": "+--------------------------------------------JOB--------------------------------------------+\n| name: Si |\n| dir: /home/runner/work/DFControl.jl/DFControl.jl/src/../docs/src/assets/Job2 |\n| version: 0 |\n| server: fv-az404-815, alive |\n| versions: |\n| last submission: 2023-09-12T13:05:04 |\n| state: Unknown |\n+-------------------------------------------------------------------------------------------+\n(scheduled, not scheduled)\n\tscf\n\tbands\n\tnscf\n\tprojwfc\n" + "text/plain": "+--------------------------------------------JOB--------------------------------------------+\n| name: Si |\n| dir: /home/runner/work/DFControl.jl/DFControl.jl/src/../docs/src/assets/Job2 |\n| version: 0 |\n| server: fv-az1259-401, alive |\n| versions: |\n| last submission: 2023-09-12T13:33:40 |\n| state: Unknown |\n+-------------------------------------------------------------------------------------------+\n(scheduled, not scheduled)\n\tscf\n\tbands\n\tnscf\n\tprojwfc\n" }, "metadata": {}, "execution_count": 6 @@ -242,9 +242,9 @@ " [1] error(s::String)\n", " @ Base ./error.jl:33\n", " [2] qe_parse_projwfc(filename::IOBuffer)\n", - " @ DFControl.FileIO ~/work/DFControl.jl/DFControl.jl/src/FileIO/qe.jl:791\n", + " @ DFControl.FileIO ~/work/DFControl.jl/DFControl.jl/src/FileIO/qe.jl:793\n", " [3] qe_parse_projwfc_output(::IOBuffer, ::Vararg{Any})\n", - " @ DFControl.FileIO ~/work/DFControl.jl/DFControl.jl/src/FileIO/qe.jl:709\n", + " @ DFControl.FileIO ~/work/DFControl.jl/DFControl.jl/src/FileIO/qe.jl:711\n", " [4] qe_parse_output(::Calculation{QE}, ::IOBuffer, ::Vararg{Any}; kwargs::Base.Pairs{Symbol, Vector{Pair{String}}, Tuple{Symbol}, NamedTuple{(:parse_funcs,), Tuple{Vector{Pair{String}}}}})\n", " @ DFControl.FileIO ~/work/DFControl.jl/DFControl.jl/src/FileIO/qe.jl:40\n", " [5] readoutput(::Calculation{QE}, ::IOBuffer, ::Vararg{Any}; kwargs::Base.Pairs{Symbol, Vector{Pair{String}}, Tuple{Symbol}, NamedTuple{(:parse_funcs,), Tuple{Vector{Pair{String}}}}})\n", @@ -319,148 +319,148 @@ "\n", "\n", "\n", - " \n", + " \n", " \n", " \n", "\n", - "\n", + "\n", "\n", - " \n", + " \n", " \n", " \n", "\n", - "\n", + "\n", "\n", - " \n", + " \n", " \n", " \n", "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", "\n" ], "image/svg+xml": [ "\n", "\n", "\n", - " \n", + " \n", " \n", " \n", "\n", - "\n", + "\n", "\n", - " \n", + " \n", " \n", " \n", "\n", - "\n", + "\n", "\n", - " \n", + " \n", " \n", " \n", "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", "\n" ] }, @@ -513,7 +513,7 @@ "└ 20.0 set to: 40.0\n", "┌ Warning: ecutwfc could not be found in allowed flags,\n", "│ please set it manually using .flags[ecutwfc] = 40.0\n", - "└ @ DFControl.Calculations ~/work/DFControl.jl/DFControl.jl/src/Calculations/calculation.jl:311\n" + "└ @ DFControl.Calculations ~/work/DFControl.jl/DFControl.jl/src/Calculations/calculation.jl:316\n" ] }, { @@ -586,7 +586,7 @@ { "output_type": "execute_result", "data": { - "text/plain": "+--------------------------------------------JOB--------------------------------------------+\n| name: Si |\n| dir: /home/runner/work/DFControl.jl/DFControl.jl/src/../docs/src/assets/Job2 |\n| version: 0 |\n| server: fv-az404-815, alive |\n| versions: |\n| last submission: 2023-09-12T13:05:04 |\n| state: Unknown |\n+-------------------------------------------------------------------------------------------+\n(scheduled, not scheduled)\n\tscf\n\tbands\n\tnscf\n\tprojwfc\n" + "text/plain": "+--------------------------------------------JOB--------------------------------------------+\n| name: Si |\n| dir: /home/runner/work/DFControl.jl/DFControl.jl/src/../docs/src/assets/Job2 |\n| version: 0 |\n| server: fv-az1259-401, alive |\n| versions: |\n| last submission: 2023-09-12T13:33:40 |\n| state: Unknown |\n+-------------------------------------------------------------------------------------------+\n(scheduled, not scheduled)\n\tscf\n\tbands\n\tnscf\n\tprojwfc\n" }, "metadata": {}, "execution_count": 10 diff --git a/dev/guide/advanced_tutorial/index.html b/dev/guide/advanced_tutorial/index.html index 7a7e027c..d03e4036 100644 --- a/dev/guide/advanced_tutorial/index.html +++ b/dev/guide/advanced_tutorial/index.html @@ -5,7 +5,7 @@ | name: Si | | dir: /home/runner/work/DFControl.jl/DFControl.jl/job | | version: 0 | -| server: fv-az404-815, alive | +| server: fv-az1259-401, alive | | versions: | | state: Unknown | +-----------------------------------------------------------+ @@ -16,9 +16,9 @@ | name: Si | | dir: /home/runner/work/DFControl.jl/DFControl.jl/src/../docs/src/assets/Job2 | | version: 0 | -| server: fv-az404-815, alive | +| server: fv-az1259-401, alive | | versions: | -| last submission: 2023-09-12T13:05:04 | +| last submission: 2023-09-12T13:33:40 | | state: Unknown | +-------------------------------------------------------------------------------------------+ (scheduled, not scheduled) @@ -44,9 +44,9 @@ | name: Si | | dir: /home/runner/work/DFControl.jl/DFControl.jl/src/../docs/src/assets/Job2 | | version: 0 | -| server: fv-az404-815, alive | +| server: fv-az1259-401, alive | | versions: | -| last submission: 2023-09-12T13:05:04 | +| last submission: 2023-09-12T13:33:40 | | state: Unknown | +-------------------------------------------------------------------------------------------+ (scheduled, not scheduled) @@ -58,82 +58,82 @@ plot(job, -10, 1) - + - + - + - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

As we can see, again DFControl identifies the additional information that is now present in the job, and uses it to display in the plot.

In the demonstrated case we see that everything went according to plan, however, often things need to be changed in a trial and error way until the desired results are found.

On common occurence is that calculation flags have to be set, or changed. This can be done in two ways

job[:ecutwfc] = 40.0
40.0

will go through all the calculations of the job and set the flag if it is allowed, i.e. the flag will not be set in the projwfc calculation since it makes no sense.

job["bands"][:nbnd] = 30
30

This will set a flag for one specific calculation, again checking whether the flag is valid, and the type will be converted to the correct one.

In order to quickly specify what calculations to schedule and which not, one can use

Jobs.set_flow!(job, "" => false, "scf" => true)
+--------------------------------------------JOB--------------------------------------------+
 | name:            Si                                                                       |
 | dir:             /home/runner/work/DFControl.jl/DFControl.jl/src/../docs/src/assets/Job2  |
 | version:         0                                                                        |
-| server:          fv-az404-815, alive                                                      |
+| server:          fv-az1259-401, alive                                                     |
 | versions:                                                                                 |
-| last submission: 2023-09-12T13:05:04                                                      |
+| last submission: 2023-09-12T13:33:40                                                      |
 | state:           Unknown                                                                  |
 +-------------------------------------------------------------------------------------------+
 (scheduled, not scheduled)
@@ -141,4 +141,4 @@
 	bands
 	nscf
 	projwfc
-

As we can see, only the scf and nscf calculations are scheduled to run now, this is because for each of the pairs in the arguments of set_flow!, every calculation inside the job for which the string occurs in the name will be set to run or not depending on the Bool.

+

As we can see, only the scf and nscf calculations are scheduled to run now, this is because for each of the pairs in the arguments of set_flow!, every calculation inside the job for which the string occurs in the name will be set to run or not depending on the Bool.

diff --git a/dev/guide/basic_tutorial.ipynb b/dev/guide/basic_tutorial.ipynb index 87631dd9..4efcfa4a 100644 --- a/dev/guide/basic_tutorial.ipynb +++ b/dev/guide/basic_tutorial.ipynb @@ -249,7 +249,7 @@ { "output_type": "execute_result", "data": { - "text/plain": "Dict{Symbol, Any} with 14 entries:\n :converged => true\n :scf_iteration => [1, 2, 3, 4, 5, 6]\n :highest_occupied => 6.0183\n :timing => DFControl.TimingData[TimingData(\"init_run\", 75 millisec…\n :total_energy => [-90.6902, -90.6986, -90.7021, -90.7024, -90.7024, -90.…\n :n_KS_states => 16\n :accuracy => [0.210495, 0.00940295, 0.00048403, 6.398e-5, 1.21e-6, 2…\n :bands => DFControl.Band[Band(SVector{3}[[0.0964102, 0.0964102, 0…\n :scf_steps => 1\n :fermi => 6.0183\n :initial_structure => Structure(volume: 160.1866745508759 Å^3, atoms: 8 Si)\n :n_scf => 0\n :finished => true\n :n_electrons => 32" + "text/plain": "Dict{Symbol, Any} with 14 entries:\n :converged => true\n :scf_iteration => [1, 2, 3, 4, 5, 6]\n :highest_occupied => 6.0183\n :timing => DFControl.TimingData[TimingData(\"init_run\", 75 millisec…\n :total_energy => [-90.6902, -90.6986, -90.7021, -90.7024, -90.7024, -90.…\n :n_KS_states => 16\n :accuracy => [0.210495, 0.00940295, 0.00048403, 6.398e-5, 1.21e-6, 2…\n :bands => DFControl.Band[Band(10 k_points, eigvals: -5.7383 eV -…\n :scf_steps => 1\n :fermi => 6.0183\n :initial_structure => Structure(volume: 160.1866745508759 Å^3, atoms: 8 Si)\n :n_scf => 0\n :finished => true\n :n_electrons => 32" }, "metadata": {}, "execution_count": 9 @@ -371,7 +371,7 @@ { "output_type": "execute_result", "data": { - "text/plain": "+-------------------------------------------JOB-------------------------------------------+\n| name: Si |\n| dir: /home/runner/work/DFControl.jl/DFControl.jl/src/../docs/src/assets/job |\n| version: 0 |\n| server: fv-az404-815, alive |\n| versions: |\n| last submission: 2023-09-12T13:05:04 |\n| state: Unknown |\n+-----------------------------------------------------------------------------------------+\n(scheduled, not scheduled)\n\tscf\n\tbands\n" + "text/plain": "+-------------------------------------------JOB-------------------------------------------+\n| name: Si |\n| dir: /home/runner/work/DFControl.jl/DFControl.jl/src/../docs/src/assets/job |\n| version: 0 |\n| server: fv-az1259-401, alive |\n| versions: |\n| last submission: 2023-09-12T13:33:40 |\n| state: Unknown |\n+-----------------------------------------------------------------------------------------+\n(scheduled, not scheduled)\n\tscf\n\tbands\n" }, "metadata": {}, "execution_count": 13 @@ -396,7 +396,7 @@ { "output_type": "execute_result", "data": { - "text/plain": "+-------------------------------------------JOB-------------------------------------------+\n| name: Si |\n| dir: /home/runner/work/DFControl.jl/DFControl.jl/src/../docs/src/assets/job |\n| version: 0 |\n| server: fv-az404-815, alive |\n| versions: |\n| last submission: 2023-09-12T13:05:04 |\n| state: Unknown |\n+-----------------------------------------------------------------------------------------+\n(scheduled, not scheduled)\n\tscf\n\tbands\n" + "text/plain": "+-------------------------------------------JOB-------------------------------------------+\n| name: Si |\n| dir: /home/runner/work/DFControl.jl/DFControl.jl/src/../docs/src/assets/job |\n| version: 0 |\n| server: fv-az1259-401, alive |\n| versions: |\n| last submission: 2023-09-12T13:33:40 |\n| state: Unknown |\n+-----------------------------------------------------------------------------------------+\n(scheduled, not scheduled)\n\tscf\n\tbands\n" }, "metadata": {}, "execution_count": 14 @@ -464,120 +464,120 @@ "\n", "\n", "\n", - " \n", + " \n", " \n", " \n", "\n", - "\n", + "\n", "\n", - " \n", + " \n", " \n", " \n", "\n", - "\n", + "\n", "\n", - " \n", + " \n", " \n", " \n", "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", "\n" ], "image/svg+xml": [ "\n", "\n", "\n", - " \n", + " \n", " \n", " \n", "\n", - "\n", + "\n", "\n", - " \n", + " \n", " \n", " \n", "\n", - "\n", + "\n", "\n", - " \n", + " \n", " \n", " \n", "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", "\n" ] }, @@ -620,148 +620,148 @@ "\n", "\n", "\n", - " \n", + " \n", " \n", " \n", "\n", - "\n", + "\n", "\n", - " \n", + " \n", " \n", " \n", "\n", - "\n", + "\n", "\n", - " \n", + " \n", " \n", " \n", "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", "\n" ], "image/svg+xml": [ "\n", "\n", "\n", - " \n", + " \n", " \n", " \n", "\n", - "\n", + "\n", "\n", - " \n", + " \n", " \n", " \n", "\n", - "\n", + "\n", "\n", - " \n", + " \n", " \n", " \n", "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", "\n" ] }, diff --git a/dev/guide/basic_tutorial/index.html b/dev/guide/basic_tutorial/index.html index 5146b929..1c718a41 100644 --- a/dev/guide/basic_tutorial/index.html +++ b/dev/guide/basic_tutorial/index.html @@ -58,7 +58,7 @@ :total_energy => [-90.6902, -90.6986, -90.7021, -90.7024, -90.7024, -90.… :n_KS_states => 16 :accuracy => [0.210495, 0.00940295, 0.00048403, 6.398e-5, 1.21e-6, 2… - :bands => DFControl.Band[Band(SVector{3}[[0.0964102, 0.0964102, 0… + :bands => DFControl.Band[Band(10 k_points, eigvals: -5.7383 eV -… :scf_steps => 1 :fermi => 6.0183 :initial_structure => Structure(volume: 160.1866745508759 Å^3, atoms: 8 Si) @@ -86,9 +86,9 @@ | name: Si | | dir: /home/runner/work/DFControl.jl/DFControl.jl/src/../docs/src/assets/job | | version: 0 | -| server: fv-az404-815, alive | +| server: fv-az1259-401, alive | | versions: | -| last submission: 2023-09-12T13:05:04 | +| last submission: 2023-09-12T13:33:40 | | state: Unknown | +-----------------------------------------------------------------------------------------+ (scheduled, not scheduled) @@ -98,9 +98,9 @@ | name: Si | | dir: /home/runner/work/DFControl.jl/DFControl.jl/src/../docs/src/assets/job | | version: 0 | -| server: fv-az404-815, alive | +| server: fv-az1259-401, alive | | versions: | -| last submission: 2023-09-12T13:05:04 | +| last submission: 2023-09-12T13:33:40 | | state: Unknown | +-----------------------------------------------------------------------------------------+ (scheduled, not scheduled) @@ -111,131 +111,131 @@ plot(bands; fermi = fermi) - + - + - + - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Since more info (such as the structure) is available in the job, plotting the job leads to a richer plot

plot(job, -10, 1)
- + - + - + - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -

As can be seen in the Advanced Usage, additional information generated by additional calculations will be picked up by DFControl in order to create richer plots.

+

As can be seen in the Advanced Usage, additional information generated by additional calculations will be picked up by DFControl in order to create richer plots.

diff --git a/dev/guide/calculations/index.html b/dev/guide/calculations/index.html index 728e58ac..333676b4 100644 --- a/dev/guide/calculations/index.html +++ b/dev/guide/calculations/index.html @@ -5,10 +5,10 @@ exec ::Exec, run ::Bool = true, infile ::String = P == Wannier90 ? name * ".win" : name * ".in", - outfile ::String = name * ".out")

The representation of a DFT calculation of package P, holding the flags that will be written to the infile, the executable exec and the output written by the calculation to the outfile. It essentially represents a line in a job script similar to exec < infile.in > outfile.out. outdata stores the parsed calculation output after it was read at least once. The run field indicates whether the calculation should be actually performed, e.g. if run=false the corresponding line will be commented out in the job script.

Calculation{P<:Package}(name::AbstractString, flags::Pair{Symbol, Any}...; kwargs...)

Create a Calculation from name and flags, other kwargs... will be passed to the constructor.

Calculation(template::Calculation, name::AbstractString, flags::Pair{Symbol, Any}...; excs=deepcopy(template.exec), run=true, data=nothing)

Creates a new Calculation from the template, setting the flags of the newly created one to the specified ones.

source
DFControl.Calculations.InputDataType
InputData(name::Symbol, option::Symbol, data::Any)

Represents a more structured block of input data. e.g. InputData(:k_points, :automatic, (6,6,6,1,1,1)) would be translated for a QE calculation into

K_POINTS(automatic)
-6 6 6 1 1 1
source

Basic interaction

DFControl.Calculations.set_name!Function
set_name!(c::Calculation, name::AbstractString)

Sets calculation.name, and calculation.infile and calculation.outfile to conform with the new name.

source
DFControl.Calculations.dataFunction
data(calculation::Calculation, n::Symbol)

The former returns calculation.data, the later – the InputData with name n.

source
DFControl.Calculations.set_kpoints!Function
set_kpoints!(calculation::Calculation{QE}, k_grid::NTuple{3, Int}; print=true)
+                        outfile ::String = name * ".out")

The representation of a DFT calculation of package P, holding the flags that will be written to the infile, the executable exec and the output written by the calculation to the outfile. It essentially represents a line in a job script similar to exec < infile.in > outfile.out. outdata stores the parsed calculation output after it was read at least once. The run field indicates whether the calculation should be actually performed, e.g. if run=false the corresponding line will be commented out in the job script.

Calculation{P<:Package}(name::AbstractString, flags::Pair{Symbol, Any}...; kwargs...)

Create a Calculation from name and flags, other kwargs... will be passed to the constructor.

Calculation(template::Calculation, name::AbstractString, flags::Pair{Symbol, Any}...; excs=deepcopy(template.exec), run=true, data=nothing)

Creates a new Calculation from the template, setting the flags of the newly created one to the specified ones.

source
DFControl.Calculations.InputDataType
InputData(name::Symbol, option::Symbol, data::Any)

Represents a more structured block of input data. e.g. InputData(:k_points, :automatic, (6,6,6,1,1,1)) would be translated for a QE calculation into

K_POINTS(automatic)
+6 6 6 1 1 1
source

Basic interaction

DFControl.Calculations.set_name!Function
set_name!(c::Calculation, name::AbstractString)

Sets calculation.name, and calculation.infile and calculation.outfile to conform with the new name.

source
DFControl.Calculations.dataFunction
data(calculation::Calculation, n::Symbol)

The former returns calculation.data, the later – the InputData with name n.

source
DFControl.Calculations.set_kpoints!Function
set_kpoints!(calculation::Calculation{QE}, k_grid::NTuple{3, Int}; print=true)
 set_kpoints!(calculation::Calculation{QE}, k_grid::NTuple{6, Int}; print=true)
-set_kpoints!(calculation::Calculation{QE}, k_grid::Vector{<:NTuple{4}}; print=true, k_option=:crystal_b)

Convenience function to set the :k_points data block of calculation. The three different methods are targeted at nscf, scf or vcrelax, and bands calculations, respectively. For the nscf version an explicit list of k_points will be generated.

set_kpoints!(calculation::Calculation{Wannier90}, k_grid::NTuple{3, Int})

Similar to the nscf targeted function in the sense that it will generate an explicit list of k_points, adhering to the same rules as for the nscf. The mp_grid flag will also automatically be set.

source

Flags

A big part of working with DFT calculations is specifying the various calculation flags. Remembering all the names of the flags, where they belong, and what types they are expected to be, is quite complicated and can lead to easily made mistakes like typos. DFControl tries to catch these as it knows which flags are allowed for which calculations. It will report when a flag can not be found for a given Calculation, and it will also try to convert a flag value to the expected type.

A Calculation behaves a lot as a normal Dict to interact with the stored flags. This means that the usual Dict operations such as haskey, get, and pop! work on a Calculation.

Base.getindexMethod
getindex(c::Calculation, n::Symbol)

Returns the flag with given symbol.

getindex(job::Job, flag::Symbol)

Searches through the job's calculations for the requested flag. A Dict will be returned with calculation names as the keys and the flags as values.

source
Base.setindex!Method
setindex!(c::Calculation, value, flag::Symbol)

Sets flags.

setindex!(job::Job, value, flag::Symbol)

Set flag in all the appropriate calculations to the value.

source
DFControl.Calculations.set_flags!Function
set_flags!(c::Calculation, flags::Pair{Symbol, Any}...; print=true, force=false)

Sets multiple flags in one go. Flag validity and type are verified.

set_flags!(job::Job, calculations::Vector{<:Calculation}, flags::Pair{Symbol,<:Any}...; print=true)
-set_flags!(job::Job, flags::Pair{Symbol,<:Any}...; print=true)

Sets the flags in the names to the flags specified. This only happens if the specified flags are valid for the names.

source

Execs

Missing docstring.

Missing docstring for Exec. Check Documenter's build log for details.

Generating new calculations

DFControl.Calculations.gencalc_vcrelaxMethod
gencalc_vcrelax(template::Calculation{QE}, kpoints::NTuple{6, Int}, newflags...; name="scf")

Uses the information from the template and supplied kpoints to generate a vcrelax calculation. Extra flags can be supplied which will be set for the generated calculation.

source
DFControl.Calculations.gencalc_scfMethod
gencalc_scf(template::Calculation{QE}, kpoints::NTuple{6, Int}, newflags...; name="scf")

Uses the information from the template and supplied kpoints to generate an scf calculation. Extra flags can be supplied which will be set for the generated calculation.

source
DFControl.Calculations.gencalc_bandsMethod
gencalc_bands(template::Calculation{QE}, kpoints::Vector{NTuple{4}}, newflags...; name="bands")

Uses the information from the template and supplied kpoints to generate a bands calculation. Extra flags can be supplied which will be set for the generated calculation.

source
DFControl.Calculations.gencalc_nscfMethod
gencalc_nscf(template::Calculation{QE}, kpoints::NTuple{3, Int}, newflags...; name="nscf")

Uses the information from the template and supplied kpoints to generate an nscf calculation. Extra flags can be supplied which will be set for the generated calculation.

source
DFControl.Calculations.gencalc_projwfcMethod
gencalc_projwfc(template::Calculation{QE}, Emin, Emax, DeltaE, newflags...; name="projwfc")

Uses the information from the template and supplied kpoints to generate a projwfc.x calculation. Extra flags can be supplied which will be set for the generated calculation.

source
DFControl.Calculations.gencalc_wanFunction
gencalc_wan(nscf::Calculation{QE}, structure::Structure, Emin, wanflags...;
+set_kpoints!(calculation::Calculation{QE}, k_grid::Vector{<:NTuple{4}}; print=true, k_option=:crystal_b)

Convenience function to set the :k_points data block of calculation. The three different methods are targeted at nscf, scf or vcrelax, and bands calculations, respectively. For the nscf version an explicit list of k_points will be generated.

set_kpoints!(calculation::Calculation{Wannier90}, k_grid::NTuple{3, Int})

Similar to the nscf targeted function in the sense that it will generate an explicit list of k_points, adhering to the same rules as for the nscf. The mp_grid flag will also automatically be set.

source

Flags

A big part of working with DFT calculations is specifying the various calculation flags. Remembering all the names of the flags, where they belong, and what types they are expected to be, is quite complicated and can lead to easily made mistakes like typos. DFControl tries to catch these as it knows which flags are allowed for which calculations. It will report when a flag can not be found for a given Calculation, and it will also try to convert a flag value to the expected type.

A Calculation behaves a lot as a normal Dict to interact with the stored flags. This means that the usual Dict operations such as haskey, get, and pop! work on a Calculation.

Base.getindexMethod
getindex(c::Calculation, n::Symbol)

Returns the flag with given symbol.

getindex(job::Job, flag::Symbol)

Searches through the job's calculations for the requested flag. A Dict will be returned with calculation names as the keys and the flags as values.

source
Base.setindex!Method
setindex!(c::Calculation, value, flag::Symbol)

Sets flags.

setindex!(job::Job, value, flag::Symbol)

Set flag in all the appropriate calculations to the value.

source
DFControl.Calculations.set_flags!Function
set_flags!(c::Calculation, flags::Pair{Symbol, Any}...; print=true, force=false)

Sets multiple flags in one go. Flag validity and type are verified.

set_flags!(job::Job, calculations::Vector{<:Calculation}, flags::Pair{Symbol,<:Any}...; print=true)
+set_flags!(job::Job, flags::Pair{Symbol,<:Any}...; print=true)

Sets the flags in the names to the flags specified. This only happens if the specified flags are valid for the names.

source

Execs

Missing docstring.

Missing docstring for Exec. Check Documenter's build log for details.

Generating new calculations

DFControl.Calculations.gencalc_vcrelaxMethod
gencalc_vcrelax(template::Calculation{<:AbstractQE}, kpoints::NTuple{6, Int}, newflags...; name="scf")

Uses the information from the template and supplied kpoints to generate a vcrelax calculation. Extra flags can be supplied which will be set for the generated calculation.

source
DFControl.Calculations.gencalc_scfMethod
gencalc_scf(template::Calculation{<:AbstractQE}, kpoints::NTuple{6, Int}, newflags...; name="scf")

Uses the information from the template and supplied kpoints to generate an scf calculation. Extra flags can be supplied which will be set for the generated calculation.

source
DFControl.Calculations.gencalc_bandsMethod
gencalc_bands(template::Calculation{<:AbstractQE}, kpoints::Vector{NTuple{4}}, newflags...; name="bands")

Uses the information from the template and supplied kpoints to generate a bands calculation. Extra flags can be supplied which will be set for the generated calculation.

source
DFControl.Calculations.gencalc_nscfMethod
gencalc_nscf(template::Calculation{<:AbstractQE}, kpoints::NTuple{3, Int}, newflags...; name="nscf")

Uses the information from the template and supplied kpoints to generate an nscf calculation. Extra flags can be supplied which will be set for the generated calculation.

source
DFControl.Calculations.gencalc_projwfcMethod
gencalc_projwfc(template::Calculation{<:AbstractQE}, Emin, Emax, DeltaE, newflags...; name="projwfc")

Uses the information from the template and supplied kpoints to generate a projwfc.x calculation. Extra flags can be supplied which will be set for the generated calculation.

source
DFControl.Calculations.gencalc_wanFunction
gencalc_wan(job::Job, min_window_determinator::Real, extra_wan_flags...; kwargs...)

Automates the generation of wannier calculations based on the job. When a projwfc calculation is present in the job, min_window_determinator will be used to determine the threshold value for including a band in the window based on the projections, otherwise it will be used as the Emin value from which to start counting the number of bands needed for all projections. extra_wan_flags can be any extra flags for the Wannier90 calculation such as write_hr etc.

source
gencalc_wan(nscf::Calculation{QE}, structure::Structure, Emin, wanflags...;
             Epad     = 5.0,
-            wanexec  = Exec(path="wannier90.x"))

Generates a Wannier90 calculation to follow on the supplied nscf calculation. It uses the projections defined in the structure, and starts counting the required amount of bands from Emin. The nscf needs to have a valid output since it will be used in conjunction with Emin to find the required amount of bands and energy window for the Wannier90 calculation.

source
gencalc_wan(job::Job, min_window_determinator::Real, extra_wan_flags...; kwargs...)

Automates the generation of wannier calculations based on the job. When a projwfc calculation is present in the job, min_window_determinator will be used to determine the threshold value for including a band in the window based on the projections, otherwise it will be used as the Emin value from which to start counting the number of bands needed for all projections. extra_wan_flags can be any extra flags for the Wannier90 calculation such as write_hr etc.

source
+ wanexec = Exec(path="wannier90.x"))

Generates a Wannier90 calculation to follow on the supplied nscf calculation. It uses the projections defined in the structure, and starts counting the required amount of bands from Emin. The nscf needs to have a valid output since it will be used in conjunction with Emin to find the required amount of bands and energy window for the Wannier90 calculation.

source diff --git a/dev/guide/configuration/index.html b/dev/guide/configuration/index.html index bb17012c..4416dd1a 100644 --- a/dev/guide/configuration/index.html +++ b/dev/guide/configuration/index.html @@ -1,6 +1,6 @@ Configuration · DFControl.jl

Configuration

Servers

Since DFControl utilizes a client-server rest-api model, each server will have its own local deamon running, which stores certain server-side items such as pseudopotentials, Environments and Execs.

Make sure that both julia and DFControl are installed on the target remote server before trying to create a connection to it. Also, it is necessary that your ssh keys are registered on the remote so that no passwords are required for ssh connections.

To up a new Server, in this case with name = "daint" an interactive menu can be called like:

Server("daint")

This will set up all the required information and store it for later use. To start a Server simply call start(server), which will launch the daemon externally. Make sure that the host address points to a persistent server, i.e. if a cluster has multiple frontend nodes, find the ip address of one particular one, and set that one as the host address. During the setup of an external server, it may ask whether a local_tunnel should be created. If enabled, a persistent ssh tunnel will be created from the local machine to the target host through which the http requests will be sent. This is useful when the remote is behind an authentication firewall.

To reconfigure a Server you can always do:

s = Server("daint")
 s.root_jobdir = "<where you want jobs to be saved>"
-save(s)

If a Server was running first stop it using kill(server).

Pseudopotentials

Pseudopotentials are grouped in sets, which are stored for later ease of use. They can be set up using the configure_pseudoset function.

configure_pseudoset(local_server(), "set_name", "/dir/to/pseudos")

This will go through the specified directories and find files that follow the naming convention element.x_y_z.xyz e.g. Si.pbesol-n-kjpaw_psl.0.1.UPF or si.pbesol-n-kjpaw_psl.0.1.UPF. If multiple are found, all will be stored and the required one can be later specified.

The pseudos will remain on the server where they are stored, and can be listed using list_pseudosets. See Pseudo Potentials for further usage details.

Missing docstring.

Missing docstring for list_pseudosets. Check Documenter's build log for details.

Missing docstring.

Missing docstring for rm_pseudoset!. Check Documenter's build log for details.

Environments

Environments specify the skeleton of the job script, i.e. which environment variables need to be set, which scheduler flags, etc. Here we will set up an environment and save it on the local Server. Change the information according to your own setup.

e = Environment(name="default", parallel_exec=Exec(exec="mpirun", flags=Dict("-np"=> 4), directives=Dict("N" => 1, "partition" => "parallel"), exports=Dict("OMP_NUM_THREADS"=>1)))
+save(s)

If a Server was running first stop it using kill(server).

Pseudopotentials

Pseudopotentials are grouped in sets, which are stored for later ease of use. They can be set up using the configure_pseudoset function.

configure_pseudoset(local_server(), "set_name", "/dir/to/pseudos")

This will go through the specified directories and find files that follow the naming convention element.x_y_z.xyz e.g. Si.pbesol-n-kjpaw_psl.0.1.UPF or si.pbesol-n-kjpaw_psl.0.1.UPF. If multiple are found, all will be stored and the required one can be later specified.

The pseudos will remain on the server where they are stored, and can be listed using list_pseudosets. See Pseudo Potentials for further usage details.

Missing docstring.

Missing docstring for list_pseudosets. Check Documenter's build log for details.

Missing docstring.

Missing docstring for rm_pseudoset!. Check Documenter's build log for details.

Environments

Environments specify the skeleton of the job script, i.e. which environment variables need to be set, which scheduler flags, etc. Here we will set up an environment and save it on the local Server. Change the information according to your own setup.

e = Environment(name="default", parallel_exec=Exec(exec="mpirun", flags=Dict("-np"=> 4), directives=Dict("N" => 1, "partition" => "parallel"), exports=Dict("OMP_NUM_THREADS"=>1)))
 save(local_server(), e)

Execs

An Exec embodies an executable as the name suggests. They hold both the executable, directory and modules required to run the executable. Similar to Environments, they are stored on the server for later use. When storing it is verified that they are able to run.

e = Exec(name="pw", exec="pw.x", dir="/home/user/Softare/qe/bin", modules = ["intel", "intel-mpi", "intel-mkl"])
-save(local_server(), e)

Loading/Saving

As shown above there are three main methods related to storing and retrieving data i.e.:

RemoteHPC.loadFunction
load(server::Server, j::Job)

Tries to load the Job from server at directory j.dir. If no exact matching directory is found, a list of job directories that comprise j.dir will be returned.

source
RemoteHPC.saveFunction
save(job::Job)

Saves the job's calculations and job.sh submission script in job.dir. Some sanity checks will be performed on the validity of flags, execs, pseudopotentials, etc. The job will also be registered for easy retrieval at a later stage.

If a previous job is present in the job directory (indicated by a valid job script), it will be copied to the .versions sub directory as the previous version of job, and the version of job will be incremented.

source

After completing this configuration, it is suggested to look at the (Basic Usage)[@ref] for an introduction to the basic usage of DFControl.

+save(local_server(), e)

Loading/Saving

As shown above there are three main methods related to storing and retrieving data i.e.:

RemoteHPC.loadFunction
load(server::Server, j::Job)

Tries to load the Job from server at directory j.dir. If no exact matching directory is found, a list of job directories that comprise j.dir will be returned.

source
RemoteHPC.saveFunction
save(job::Job)

Saves the job's calculations and job.sh submission script in job.dir. Some sanity checks will be performed on the validity of flags, execs, pseudopotentials, etc. The job will also be registered for easy retrieval at a later stage.

If a previous job is present in the job directory (indicated by a valid job script), it will be copied to the .versions sub directory as the previous version of job, and the version of job will be incremented.

source

After completing this configuration, it is suggested to look at the (Basic Usage)[@ref] for an introduction to the basic usage of DFControl.

diff --git a/dev/guide/flags/index.html b/dev/guide/flags/index.html index 83671041..20f42061 100644 --- a/dev/guide/flags/index.html +++ b/dev/guide/flags/index.html @@ -1,2 +1,2 @@ -Flags · DFControl.jl
+Flags · DFControl.jl
diff --git a/dev/guide/installation/index.html b/dev/guide/installation/index.html index 9a785307..baefb065 100644 --- a/dev/guide/installation/index.html +++ b/dev/guide/installation/index.html @@ -1,4 +1,4 @@ Installation · DFControl.jl

Installation

In case you don't have a working Julia installation yet, first download the Julia binaries and follow the Julia installation instructions.

Note

DFControl requires Julia 1.6 or newer, the server side functionality will not work with older versions.

Afterwards you can install DFControl like any other package in Julia. For example run in your Julia REPL terminal:

import Pkg
 Pkg.add("DFControl")

which will install the latest DFControl release. Alternatively (if you like to be fully up to date) install the master branch:

import Pkg
-Pkg.add(name="DFControl", rev="master")

DFControl is continuously tested on Debian, Ubuntu, mac OS and Windows and should work on these operating systems out of the box.

After these steps it is highly recommended to go through some additional Configuration.

+Pkg.add(name="DFControl", rev="master")

DFControl is continuously tested on Debian, Ubuntu, mac OS and Windows and should work on these operating systems out of the box.

After these steps it is highly recommended to go through some additional Configuration.

diff --git a/dev/guide/jobs/index.html b/dev/guide/jobs/index.html index 753db2e3..452de906 100644 --- a/dev/guide/jobs/index.html +++ b/dev/guide/jobs/index.html @@ -5,13 +5,13 @@ version ::Int = last_job_version(dir), copy_temp_folders ::Bool = false, server ::String = getdefault_server(), - environment::String ="")

A Job embodies a set of Calculations to be ran in directory dir, with the Structure as the subject.

Keywords/further attributes

Job(job_name::String, structure::Structure, calculations::Vector{<:Calculation}, common_flags::Pair{Symbol, <:Any}...; kwargs...)

Creates a new job. The common flags will be attempted to be set in each of the calculations. The kwargs... are passed to the Job constructor.

Job(job_dir::String, job_script="job.sh"; version=nothing, kwargs...)

Loads the job in the dir. If job_dir is not a valid job path, the previously saved jobs will be scanned for a job with a dir that partly includes job_dir. If version is specified the corresponding job version will be returned if it exists. The kwargs... will be passed to the Job constructor.

source
RemoteHPC.loadMethod
load(server::Server, j::Job)

Tries to load the Job from server at directory j.dir. If no exact matching directory is found, a list of job directories that comprise j.dir will be returned.

source

Interacting with calculations

Base.getindexMethod
getindex(job::Job, name::String)

Returns the Calculation with the specified name.

getindex(job::Job, i::Integer)

Returns the i'th Calculation in the job.

source

Example:

julia> job["scf"]
+      environment::String ="")

A Job embodies a set of Calculations to be ran in directory dir, with the Structure as the subject.

Keywords/further attributes

Job(job_name::String, structure::Structure, calculations::Vector{<:Calculation}, common_flags::Pair{Symbol, <:Any}...; kwargs...)

Creates a new job. The common flags will be attempted to be set in each of the calculations. The kwargs... are passed to the Job constructor.

Job(job_dir::String, job_script="job.sh"; version=nothing, kwargs...)

Loads the job in the dir. If job_dir is not a valid job path, the previously saved jobs will be scanned for a job with a dir that partly includes job_dir. If version is specified the corresponding job version will be returned if it exists. The kwargs... will be passed to the Job constructor.

source
RemoteHPC.loadMethod
load(server::Server, j::Job)

Tries to load the Job from server at directory j.dir. If no exact matching directory is found, a list of job directories that comprise j.dir will be returned.

source

Interacting with calculations

Base.getindexMethod
getindex(job::Job, name::String)

Returns the Calculation with the specified name.

getindex(job::Job, i::Integer)

Returns the i'th Calculation in the job.

source

Example:

julia> job["scf"]
 ERROR: UndefVarError: job not defined
 
 julia> job[2]
-ERROR: UndefVarError: job not defined
Base.push!Method
push!(job::Job, calculation::Calculation) = push!(job.calculations, calculation)
source
Base.append!Method
append!(job::Job, args...) = append!(job.calculations, args...)
source
Base.pop!Method
pop!(job::Job) = pop!(job.calculations)
source
Base.insert!Method
insert!(job::Job, i::Int, calculation::Calculation) = insert!(job.calculations, i, calculation)
source

Scheduling, submission and monitoring

DFControl.Jobs.set_flow!Function
set_flow!(job::Job, should_runs::Pair{String, Bool}...)

Sets whether or not calculations should be scheduled to run. The name of each calculation in the job will be checked against the string in each pair of should_runs, and the calculation.run will be set accordingly.

Example:

set_flow!(job, "" => false, "scf" => true)

would un-schedule all calculations in the job, and schedule the "scf" and "nscf" calculations to run.

source
RemoteHPC.saveMethod
save(job::Job)

Saves the job's calculations and job.sh submission script in job.dir. Some sanity checks will be performed on the validity of flags, execs, pseudopotentials, etc. The job will also be registered for easy retrieval at a later stage.

If a previous job is present in the job directory (indicated by a valid job script), it will be copied to the .versions sub directory as the previous version of job, and the version of job will be incremented.

source
RemoteHPC.submitFunction
submit(job::Job)

Saves and launches job.

source
DFControl.Client.isrunningFunction
isrunning(job::Job)
-isrunning(s::Server, jobdir::String)

Returns whether a job is running or not. If the job was submitted using slurm, a QUEUED status also counts as running.

source
RemoteHPC.abortFunction
abort(job::Job)

Will try to remove the job from the scheduler's queue. If the last running calculation happened to be a Calculation{QE}, the correct abort file will be written. For other codes the process is not smooth, and restarting is not guaranteed.

source

Directories

Base.Filesystem.joinpathMethod
joinpath(job::Job, args...)

If the job is local this is joinpath(job.dir, args...), otherwise it will resolve the path using the Server rootdir.

source
Base.Filesystem.abspathMethod
abspath(job::Job, args...)

If the job is local this is abspath(job.dir), otherwise it will resolve the abspath using the Server rootdir.

source
Missing docstring.

Missing docstring for cleanup(::Job). Check Documenter's build log for details.

Registry

All Jobs are stored in an internal registry the first time save(job) is called. This means that finding all previously worked on Jobs is as straightforward as calling load(server, Job(fuzzy)) where fuzzy is a part of the previously saved Job dir. This will then return a list of Jobs with similar directories.

Versioning

As previously mentioned, a rudimentary implementation of a Job versioning system is implemented. Upon calling save on a Job, if there is already a valid job script present in job.dir, it is assumed that this was a previous version of the job and the script together with all other files in job.local_dir will be copied to a subdirectory of the .versions directory bearing the name of the respective previous job version. After this, job.version will be incremented by 1 signalling the new version of the current Job.

The virtue of this system is that it is possible to roll back to a previous version after possibly making breaking changes, or to pull out previous results after further experimentation was performed.

Note

If job.copy_temp_folders=true all possible intermediate files inside the temporary calculation directory (i.e. "job_dir/outputs") will be copied every time the job is saved. These can be quite large and can quickly create very large job directories. Handle with care!

DFControl.Client.versionsFunction
versions(job::Job)
-versions(server::Server, jobdir::String)

Returs the valid versions of job.

source
versions(job::Job)

Returs the valid versions of job.

source
DFControl.Client.last_versionFunction
last_version(job::Job)
-last_version(s::Server, jobdir::String)

Returns the last version number of job.

source
DFControl.Client.switch_version!Function
switch_version!(job::Job[, version::Int])

Switches the version of job to one of the previously stored ones. It will save also the current version for future reference.

source
DFControl.Client.rm_version!Function
rm_version!(job::Job, version::Int)
-rm_versions!(job::Job, versions::Int...)

Removes the specified versions from the job if they exist.

source

Archiving

After a Job is completed, or an interesting result is achieved, it makes sense to store it for future reference. This can be achieved through the archive function. This will take the current job, and copy it to a subdirectory (specified by the second argument to archive) of the jobs/archived directory inside the DFControl config directory. The third argument is a description of this job's result.

Note

In order to not cause huge file transfers, all the temporary directories will first be removed before archiving.

Example:

archive(job, "test_archived_job", "This is a test archived job")

To query previously archived jobs one can use load(Server("localhost"), Job("archived")).

Missing docstring.

Missing docstring for archive. Check Documenter's build log for details.

Output

DFControl.Client.outputdataFunction
outputdata(job::Job; server = job.server, calcs::Vector{String}=String[])

Finds the output files for each of the calculations of a Job, and groups all the parsed data into a dictionary.

source
DFControl.Client.readfermiFunction
readfermi(job::Job, outdat=outputdata(job))

Tries to read the fermi level from a valid Calculation inside job.

source
DFControl.Client.readbandsFunction
readbands(job::Job, outdat=outputdata(job))

Tries to read the bands from a bands calculation that is present in job.

source
DFControl.bandgapFunction
bandgap(bands::AbstractVector{Band}, n_electrons::Int)
-bandgap(bands::AbstractVector{Band}, fermi::Float64)

Calculates the bandgap (possibly indirect) around the fermi level.

source
bandgap(job::Job, nelec=nothing)

Calculates the bandgap (possibly indirect) around the fermi level. Uses the first found bands calculation, if there is none it uses the first found nscf calculation.

source

Environments

Environments specify the skeleton of the job script, i.e. which environment variables need to be set, which scheduler flags, etc.

Missing docstring.

Missing docstring for Environment. Check Documenter's build log for details.

+ERROR: UndefVarError: job not defined
Base.push!Method
push!(job::Job, calculation::Calculation) = push!(job.calculations, calculation)
source
Base.append!Method
append!(job::Job, args...) = append!(job.calculations, args...)
source
Base.pop!Method
pop!(job::Job) = pop!(job.calculations)
source
Base.insert!Method
insert!(job::Job, i::Int, calculation::Calculation) = insert!(job.calculations, i, calculation)
source

Scheduling, submission and monitoring

DFControl.Jobs.set_flow!Function
set_flow!(job::Job, should_runs::Pair{String, Bool}...)

Sets whether or not calculations should be scheduled to run. The name of each calculation in the job will be checked against the string in each pair of should_runs, and the calculation.run will be set accordingly.

Example:

set_flow!(job, "" => false, "scf" => true)

would un-schedule all calculations in the job, and schedule the "scf" and "nscf" calculations to run.

source
RemoteHPC.saveMethod
save(job::Job)

Saves the job's calculations and job.sh submission script in job.dir. Some sanity checks will be performed on the validity of flags, execs, pseudopotentials, etc. The job will also be registered for easy retrieval at a later stage.

If a previous job is present in the job directory (indicated by a valid job script), it will be copied to the .versions sub directory as the previous version of job, and the version of job will be incremented.

source
RemoteHPC.submitFunction
submit(job::Job)

Saves and launches job.

source
DFControl.Client.isrunningFunction
isrunning(job::Job)
+isrunning(s::Server, jobdir::String)

Returns whether a job is running or not. If the job was submitted using slurm, a QUEUED status also counts as running.

source
RemoteHPC.abortFunction
abort(job::Job)

Will try to remove the job from the scheduler's queue. If the last running calculation happened to be a Calculation{QE}, the correct abort file will be written. For other codes the process is not smooth, and restarting is not guaranteed.

source

Directories

Base.Filesystem.joinpathMethod
joinpath(job::Job, args...)

If the job is local this is joinpath(job.dir, args...), otherwise it will resolve the path using the Server rootdir.

source
Base.Filesystem.abspathMethod
abspath(job::Job, args...)

If the job is local this is abspath(job.dir), otherwise it will resolve the abspath using the Server rootdir.

source
Missing docstring.

Missing docstring for cleanup(::Job). Check Documenter's build log for details.

Registry

All Jobs are stored in an internal registry the first time save(job) is called. This means that finding all previously worked on Jobs is as straightforward as calling load(server, Job(fuzzy)) where fuzzy is a part of the previously saved Job dir. This will then return a list of Jobs with similar directories.

Versioning

As previously mentioned, a rudimentary implementation of a Job versioning system is implemented. Upon calling save on a Job, if there is already a valid job script present in job.dir, it is assumed that this was a previous version of the job and the script together with all other files in job.local_dir will be copied to a subdirectory of the .versions directory bearing the name of the respective previous job version. After this, job.version will be incremented by 1 signalling the new version of the current Job.

The virtue of this system is that it is possible to roll back to a previous version after possibly making breaking changes, or to pull out previous results after further experimentation was performed.

Note

If job.copy_temp_folders=true all possible intermediate files inside the temporary calculation directory (i.e. "job_dir/outputs") will be copied every time the job is saved. These can be quite large and can quickly create very large job directories. Handle with care!

DFControl.Client.versionsFunction
versions(job::Job)
+versions(server::Server, jobdir::String)

Returs the valid versions of job.

source
versions(job::Job)

Returs the valid versions of job.

source
DFControl.Client.last_versionFunction
last_version(job::Job)
+last_version(s::Server, jobdir::String)

Returns the last version number of job.

source
DFControl.Client.switch_version!Function
switch_version!(job::Job[, version::Int])

Switches the version of job to one of the previously stored ones. It will save also the current version for future reference.

source
DFControl.Client.rm_version!Function
rm_version!(job::Job, version::Int)
+rm_versions!(job::Job, versions::Int...)

Removes the specified versions from the job if they exist.

source

Archiving

After a Job is completed, or an interesting result is achieved, it makes sense to store it for future reference. This can be achieved through the archive function. This will take the current job, and copy it to a subdirectory (specified by the second argument to archive) of the jobs/archived directory inside the DFControl config directory. The third argument is a description of this job's result.

Note

In order to not cause huge file transfers, all the temporary directories will first be removed before archiving.

Example:

archive(job, "test_archived_job", "This is a test archived job")

To query previously archived jobs one can use load(Server("localhost"), Job("archived")).

Missing docstring.

Missing docstring for archive. Check Documenter's build log for details.

Output

DFControl.Client.outputdataFunction
outputdata(job::Job; server = job.server, calcs::Vector{String}=String[])

Finds the output files for each of the calculations of a Job, and groups all the parsed data into a dictionary.

source
DFControl.Client.readfermiFunction
readfermi(job::Job, outdat=outputdata(job))

Tries to read the fermi level from a valid Calculation inside job.

source
DFControl.Client.readbandsFunction
readbands(job::Job, outdat=outputdata(job))

Tries to read the bands from a bands calculation that is present in job.

source
DFControl.bandgapFunction
bandgap(bands::AbstractVector{Band}, n_electrons::Int)
+bandgap(bands::AbstractVector{Band}, fermi::Float64)

Calculates the bandgap (possibly indirect) around the fermi level.

source
bandgap(job::Job, nelec=nothing)

Calculates the bandgap (possibly indirect) around the fermi level. Uses the first found bands calculation, if there is none it uses the first found nscf calculation.

source

Environments

Environments specify the skeleton of the job script, i.e. which environment variables need to be set, which scheduler flags, etc.

Missing docstring.

Missing docstring for Environment. Check Documenter's build log for details.

diff --git a/dev/guide/servers/index.html b/dev/guide/servers/index.html index 11d6c504..af714a28 100644 --- a/dev/guide/servers/index.html +++ b/dev/guide/servers/index.html @@ -1,2 +1,2 @@ -Servers · DFControl.jl

Servers

DFControl is structure as a client-server architecture where the communication happens through a rest-API. This means that on the server-side a small daemon will run that the client will communicate with in order to load, save and submit Jobs. There are three ways to set up a server. To setup a local server, simply call Servers.configure_local and follow the prompt. A Server can also be setup by calling the constructor with a String that signifies the name of the Server, e.g. "localhost", or an ssh string such as "user@domain", which will prompt an interactive setup menu.

Alternatively, for full customization, a Server can be set up by filling out the constructor, and saving it as save(server). A previously saved Server can be loaded again through e.g. Server("localhost") which will retrieve the previously saved configuration.

Missing docstring.

Missing docstring for Server. Check Documenter's build log for details.

Missing docstring.

Missing docstring for Servers.configure_local. Check Documenter's build log for details.

Missing docstring.

Missing docstring for start. Check Documenter's build log for details.

Missing docstring.

Missing docstring for save(::Server). Check Documenter's build log for details.

+Servers · DFControl.jl

Servers

DFControl is structure as a client-server architecture where the communication happens through a rest-API. This means that on the server-side a small daemon will run that the client will communicate with in order to load, save and submit Jobs. There are three ways to set up a server. To setup a local server, simply call Servers.configure_local and follow the prompt. A Server can also be setup by calling the constructor with a String that signifies the name of the Server, e.g. "localhost", or an ssh string such as "user@domain", which will prompt an interactive setup menu.

Alternatively, for full customization, a Server can be set up by filling out the constructor, and saving it as save(server). A previously saved Server can be loaded again through e.g. Server("localhost") which will retrieve the previously saved configuration.

Missing docstring.

Missing docstring for Server. Check Documenter's build log for details.

Missing docstring.

Missing docstring for Servers.configure_local. Check Documenter's build log for details.

Missing docstring.

Missing docstring for start. Check Documenter's build log for details.

Missing docstring.

Missing docstring for save(::Server). Check Documenter's build log for details.

diff --git a/dev/guide/structure/index.html b/dev/guide/structure/index.html index fe25b798..03e82995 100644 --- a/dev/guide/structure/index.html +++ b/dev/guide/structure/index.html @@ -1,17 +1,17 @@ -Structure · DFControl.jl

Structure

Contents

Index

Base.getindexMethod
getindex(structure::Structure, i::Int)
+Structure · DFControl.jl

Structure

Contents

Index

Base.getindexMethod
getindex(structure::Structure, i::Int)
 getindex(structure::Structure, name::Symbol)
-getindex(structure::Structure, el::Element)

Returns the ith atom in structure, or all atoms with name or are of element el.

source
DFControl.Structures.polyhedronFunction
polyhedron(at::Atom, atoms::Vector{Atom}, order::Int)
-polyhedron(at::Atom, str::Structure, order::Int)

Returns a polyhedron around the atom, i.e. the order closest atoms. The returned atoms will be ordered according to their distance to the first one. In the case of a structure rather than a set of atoms, the search will be performed over all atoms in the structure.

source

Symmetries

This functionality relies on spglib to find the symmetries of the Structure and supply various related quantities.

DFControl.Structures.high_symmetry_kpathFunction
high_symmetry_kpath(s::Structure, npoints_per_segment::Int; package=QE, kwargs...)

Generates a QE bands calculation compliant high symmetry kpath, to be used with e.g. set_kpoints!(bands_calculation, kpoints).

source
DFControl.Structures.high_symmetry_kpointsFunction
high_symmetry_kpoints(s::Structure; tolerance = 1e-5)

Returns (kpoints, path) where kpoints are the high-symmetry k-points, and path are the sections of the high symmetry path through the first Brillouin Zone.

source

Cell

Note

The lattice vectors are stored as the columns of the cell.

DFControl.Structures.create_supercellFunction
create_supercell(structure::Structure, na::Int, nb::Int, nc::Int; make_afm=false)
-create_supercell(structure::Structure, na::UnitRange, nb::UnitRange, nc::UnitRange; make_afm=false)

Takes a structure and creates a supercell from it with: the given amount of additional cells if (na::Int, nb::Int, nc::Int) along the a, b, c direction, or amount of cells specified by the ranges i.e. -1:1, -1:1, -1:1 would create a 3x3x3 supercell. If make_afm is set to true all the labels and magnetizations of the magnetic atoms will be reversed in a checkerboard fashion.

source

Atom

DFControl.Structures.AtomType
Atom(name::Symbol, element::Element, position_cart::Point3{Length}, position_cryst::Point3;
+getindex(structure::Structure, el::Element)

Returns the ith atom in structure, or all atoms with name or are of element el.

source
DFControl.Structures.polyhedronFunction
polyhedron(at::Atom, atoms::Vector{Atom}, order::Int)
+polyhedron(at::Atom, str::Structure, order::Int)

Returns a polyhedron around the atom, i.e. the order closest atoms. The returned atoms will be ordered according to their distance to the first one. In the case of a structure rather than a set of atoms, the search will be performed over all atoms in the structure.

source

Symmetries

This functionality relies on spglib to find the symmetries of the Structure and supply various related quantities.

DFControl.Structures.high_symmetry_kpathFunction
high_symmetry_kpath(s::Structure, npoints_per_segment::Int; package=QE, kwargs...)

Generates a QE bands calculation compliant high symmetry kpath, to be used with e.g. set_kpoints!(bands_calculation, kpoints).

source
DFControl.Structures.high_symmetry_kpointsFunction
high_symmetry_kpoints(s::Structure; tolerance = 1e-5)

Returns (kpoints, path) where kpoints are the high-symmetry k-points, and path are the sections of the high symmetry path through the first Brillouin Zone.

source

Cell

Note

The lattice vectors are stored as the columns of the cell.

DFControl.Structures.create_supercellFunction
create_supercell(structure::Structure, na::Int, nb::Int, nc::Int; make_afm=false)
+create_supercell(structure::Structure, na::UnitRange, nb::UnitRange, nc::UnitRange; make_afm=false)

Takes a structure and creates a supercell from it with: the given amount of additional cells if (na::Int, nb::Int, nc::Int) along the a, b, c direction, or amount of cells specified by the ranges i.e. -1:1, -1:1, -1:1 would create a 3x3x3 supercell. If make_afm is set to true all the labels and magnetizations of the magnetic atoms will be reversed in a checkerboard fashion.

source

Atom

DFControl.Structures.AtomType
Atom(name::Symbol, element::Element, position_cart::Point3{Length}, position_cryst::Point3;
      pseudo::String = "",
      projections::Vector{Projection} = Projection[],
      magnetization::Vec3 = Vec3(0.0, 0.0, 0.0),
-     dftu::DFTU = DFTU())

Representation of an atom.

The name of the atom is used as an identifier for the atom type, in the sense that atoms with the same pseudo, projections, magnetization and dftu attributes should belong to the same type. This also means that during sanity checks atoms that are not of the same type will be given different names. This is done in this way because it often makes sense to change these parameters on all atoms of the same kind at the same time, but still allow the flexibility to change them for individual atoms as well.

position_cart should have a valid Unitful.Length type such as Ang.

See documentation for Element for further information on this attribute.

source
DFControl.Structures.set_position!Function
set_position!(at::Atom, pos::AbstractVector{T}, unit_cell::Mat3) where {T<:Real}

Updates the position of the atom to this. The unit cell is used to make sure both position_cryst and position_cart are correct.

source

Element

DFControl.Structures.ElementType
Element(symbol::Symbol, Z::Int, name::String, atomic_weight::Float64, color::NTuple{3, Float64})

Represents an element. Most conveniently used trough the function element.

source

Pseudo Potentials

Missing docstring.

Missing docstring for set_pseudos!. Check Documenter's build log for details.

Missing docstring.

Missing docstring for configure_pseudoset. Check Documenter's build log for details.

Missing docstring.

Missing docstring for list_pseudosets. Check Documenter's build log for details.

See the section on Configuration for a demonstration on how to set up pseudopotential sets.

Magnetization

Magnetization can be set on a per Atom basis. It will partially determine the unique Atom types and also what calculation flags should be set in order to allow for the magnetic calculation (either colinear or non-colinear).

Projections

These projections will mainly be used for generating Wannier90 inputs, and to distinguish which indices in the Wannier90 output matrices correspond to the various atoms/orbitals.

Orbitals

DFT + U

DFControl.Structures.DFTUType
DFTU(;l ::Int = -1,
+     dftu::DFTU = DFTU())

Representation of an atom.

The name of the atom is used as an identifier for the atom type, in the sense that atoms with the same pseudo, projections, magnetization and dftu attributes should belong to the same type. This also means that during sanity checks atoms that are not of the same type will be given different names. This is done in this way because it often makes sense to change these parameters on all atoms of the same kind at the same time, but still allow the flexibility to change them for individual atoms as well.

position_cart should have a valid Unitful.Length type such as Ang.

See documentation for Element for further information on this attribute.

source
DFControl.Structures.set_position!Function
set_position!(at::Atom, pos::AbstractVector{T}, unit_cell::Mat3) where {T<:Real}

Updates the position of the atom to this. The unit cell is used to make sure both position_cryst and position_cart are correct.

source

Element

DFControl.Structures.ElementType
Element(symbol::Symbol, Z::Int, name::String, atomic_weight::Float64, color::NTuple{3, Float64})

Represents an element. Most conveniently used trough the function element.

source

Pseudo Potentials

Missing docstring.

Missing docstring for set_pseudos!. Check Documenter's build log for details.

Missing docstring.

Missing docstring for configure_pseudoset. Check Documenter's build log for details.

Missing docstring.

Missing docstring for list_pseudosets. Check Documenter's build log for details.

See the section on Configuration for a demonstration on how to set up pseudopotential sets.

Magnetization

Magnetization can be set on a per Atom basis. It will partially determine the unique Atom types and also what calculation flags should be set in order to allow for the magnetic calculation (either colinear or non-colinear).

Projections

These projections will mainly be used for generating Wannier90 inputs, and to distinguish which indices in the Wannier90 output matrices correspond to the various atoms/orbitals.

Orbitals

DFT + U

DFControl.Structures.DFTUType
DFTU(;l ::Int = -1,
       U ::T   = zero(T),
       J0::T  = zero(T),
       α ::T   = zero(T),
       β ::T   = zero(T),
-      J ::Vector{T} = T[zero(T)])

DFT+U parameters for a given Atom.

source
+ J ::Vector{T} = T[zero(T)])

DFT+U parameters for a given Atom.

source
diff --git a/dev/index.html b/dev/index.html index 5d3aa25d..84651f8f 100644 --- a/dev/index.html +++ b/dev/index.html @@ -1,2 +1,2 @@ -Home · DFControl.jl

DFControl

Introduction

The goal of DFControl is to alleviate some of the tedious day to day busy-work that material's scientists using DFT codes encounter. It aids in the creation, execution, monitoring, management, and post-processing of DFT jobs. The core framework is code-agnostic, however, most of the convenience features are so far only implemented for Quantum-Espresso and Wannier90. ABINIT and ELK support is highly experimental and incomplete.

Philosophy

DFControl is aimed to be user friendly first and foremost, with features being added as time progresses without changing this core value. On the other hand, a core requirement has always been that power users that know all the ins and outs of the codes that they run should be able to have all the control they want without incurring friction from the library. DFControl therefore should never be a barrier to DFT code functionality, just a tool to increase efficiency of its users.

In light of this DFControl is structured to mimic the often adopted strategy of a linear submission script that specifies which input files are ran with which DFT codes producing which outputs. Everything revolves around the Job that holds a collection of Calculations which will be ran sequentially in the job's directory, on the job's crystal Structure. A Job is therefore identified with a specific directory. Using the script that is created upon saving or submitting a job, a Job can be easily reloaded at a later stage to continue the investigation where left off.

Highlighted features

+Home · DFControl.jl

DFControl

Introduction

The goal of DFControl is to alleviate some of the tedious day to day busy-work that material's scientists using DFT codes encounter. It aids in the creation, execution, monitoring, management, and post-processing of DFT jobs. The core framework is code-agnostic, however, most of the convenience features are so far only implemented for Quantum-Espresso and Wannier90. ABINIT and ELK support is highly experimental and incomplete.

Philosophy

DFControl is aimed to be user friendly first and foremost, with features being added as time progresses without changing this core value. On the other hand, a core requirement has always been that power users that know all the ins and outs of the codes that they run should be able to have all the control they want without incurring friction from the library. DFControl therefore should never be a barrier to DFT code functionality, just a tool to increase efficiency of its users.

In light of this DFControl is structured to mimic the often adopted strategy of a linear submission script that specifies which input files are ran with which DFT codes producing which outputs. Everything revolves around the Job that holds a collection of Calculations which will be ran sequentially in the job's directory, on the job's crystal Structure. A Job is therefore identified with a specific directory. Using the script that is created upon saving or submitting a job, a Job can be easily reloaded at a later stage to continue the investigation where left off.

Highlighted features

diff --git a/dev/search/index.html b/dev/search/index.html index 79a44867..5c27d6d6 100644 --- a/dev/search/index.html +++ b/dev/search/index.html @@ -1,2 +1,2 @@ -Search · DFControl.jl

Loading search...

    +Search · DFControl.jl

    Loading search...

      diff --git a/dev/search_index.js b/dev/search_index.js index dda82ab0..2f3bde13 100644 --- a/dev/search_index.js +++ b/dev/search_index.js @@ -1,3 +1,3 @@ var documenterSearchIndex = {"docs": -[{"location":"guide/flags/#Flags","page":"Flags","title":"Flags","text":"","category":"section"},{"location":"guide/structure/#Structure","page":"Structure","title":"Structure","text":"","category":"section"},{"location":"guide/structure/#Contents","page":"Structure","title":"Contents","text":"","category":"section"},{"location":"guide/structure/","page":"Structure","title":"Structure","text":"Pages=[\"structure.md\"]","category":"page"},{"location":"guide/structure/#Index","page":"Structure","title":"Index","text":"","category":"section"},{"location":"guide/structure/","page":"Structure","title":"Structure","text":"Pages=[\"structure.md\"]","category":"page"},{"location":"guide/structure/","page":"Structure","title":"Structure","text":"Structure\nBase.getindex(::Structure, ::Int)\nStructures.update_geometry!\nStructures.polyhedron","category":"page"},{"location":"guide/structure/#DFControl.Structures.Structure","page":"Structure","title":"DFControl.Structures.Structure","text":"Structure(cell::Mat3, atoms::Vector{Atom})\n\nThe structure on which the Calculations will be performed.\n\nStructure(cif_file::String)\n\nCreates a Structure from the supplied cif file.\n\n\n\n\n\n","category":"type"},{"location":"guide/structure/#Base.getindex-Tuple{Structure, Int64}","page":"Structure","title":"Base.getindex","text":"getindex(structure::Structure, i::Int)\ngetindex(structure::Structure, name::Symbol)\ngetindex(structure::Structure, el::Element)\n\nReturns the ith atom in structure, or all atoms with name or are of element el.\n\n\n\n\n\n","category":"method"},{"location":"guide/structure/#DFControl.Structures.update_geometry!","page":"Structure","title":"DFControl.Structures.update_geometry!","text":"update_geometry!(str1::Structure, str2::Structure)\n\nUpdates the spatial parameters of the atoms and cell of the first structure to those found in the second.\n\n\n\n\n\n","category":"function"},{"location":"guide/structure/#DFControl.Structures.polyhedron","page":"Structure","title":"DFControl.Structures.polyhedron","text":"polyhedron(at::Atom, atoms::Vector{Atom}, order::Int)\npolyhedron(at::Atom, str::Structure, order::Int)\n\nReturns a polyhedron around the atom, i.e. the order closest atoms. The returned atoms will be ordered according to their distance to the first one. In the case of a structure rather than a set of atoms, the search will be performed over all atoms in the structure.\n\n\n\n\n\n","category":"function"},{"location":"guide/structure/#Symmetries","page":"Structure","title":"Symmetries","text":"","category":"section"},{"location":"guide/structure/","page":"Structure","title":"Structure","text":"This functionality relies on spglib to find the symmetries of the Structure and supply various related quantities.","category":"page"},{"location":"guide/structure/","page":"Structure","title":"Structure","text":"Structures.high_symmetry_kpath\nStructures.high_symmetry_kpoints\nStructures.international\nStructures.niggli_reduce\nStructures.symmetry_operators","category":"page"},{"location":"guide/structure/#DFControl.Structures.high_symmetry_kpath","page":"Structure","title":"DFControl.Structures.high_symmetry_kpath","text":"high_symmetry_kpath(s::Structure, npoints_per_segment::Int; package=QE, kwargs...)\n\nGenerates a QE bands calculation compliant high symmetry kpath, to be used with e.g. set_kpoints!(bands_calculation, kpoints). \n\n\n\n\n\n","category":"function"},{"location":"guide/structure/#DFControl.Structures.high_symmetry_kpoints","page":"Structure","title":"DFControl.Structures.high_symmetry_kpoints","text":"high_symmetry_kpoints(s::Structure; tolerance = 1e-5)\n\nReturns (kpoints, path) where kpoints are the high-symmetry k-points, and path are the sections of the high symmetry path through the first Brillouin Zone.\n\n\n\n\n\n","category":"function"},{"location":"guide/structure/#DFControl.Structures.international","page":"Structure","title":"DFControl.Structures.international","text":"international(s::Structure; tolerance=1.0e-5)\n\nReturns the international symbol of the space group of the structure.\n\n\n\n\n\n","category":"function"},{"location":"guide/structure/#DFControl.Structures.niggli_reduce","page":"Structure","title":"DFControl.Structures.niggli_reduce","text":"niggli_reduce(s::Structure; tolerance=1.0e-5)\n\nReturns the niggli reduced Structure.\n\n\n\n\n\n","category":"function"},{"location":"guide/structure/#DFControl.Structures.symmetry_operators","page":"Structure","title":"DFControl.Structures.symmetry_operators","text":"symmetry_operators(s::Structure; maxsize=52, tolerance=1.0e-5)\n\nFinds and returns all the rotations and translations that are symmetry operators of the structure.\n\n\n\n\n\n","category":"function"},{"location":"guide/structure/#Cell","page":"Structure","title":"Cell","text":"","category":"section"},{"location":"guide/structure/","page":"Structure","title":"Structure","text":"note: Note\nThe lattice vectors are stored as the columns of the cell.","category":"page"},{"location":"guide/structure/","page":"Structure","title":"Structure","text":"Structures.a\nStructures.b\nStructures.c\nStructures.cell_parameters\nStructures.volume\nStructures.create_supercell\nStructures.scale_cell!","category":"page"},{"location":"guide/structure/#DFControl.Structures.a","page":"Structure","title":"DFControl.Structures.a","text":"a(str::Structure)\n\nFirst lattice vector.\n\n\n\n\n\n","category":"function"},{"location":"guide/structure/#DFControl.Structures.b","page":"Structure","title":"DFControl.Structures.b","text":"b(str::Structure)\n\nSecond lattice vector.\n\n\n\n\n\n","category":"function"},{"location":"guide/structure/#DFControl.Structures.c","page":"Structure","title":"DFControl.Structures.c","text":"c(str::Structure)\n\nThird lattice vector.\n\n\n\n\n\n","category":"function"},{"location":"guide/structure/#DFControl.Structures.cell_parameters","page":"Structure","title":"DFControl.Structures.cell_parameters","text":"cell_parameters(cell::Mat3)\ncell_parameters(str::Structure)\n\nParameters (a, b, c, α, β, γ)of the calculation cell returned in a NamedTuple.\n\n\n\n\n\n","category":"function"},{"location":"guide/structure/#DFControl.Structures.volume","page":"Structure","title":"DFControl.Structures.volume","text":"volume(cell::Mat3)\nvolume(str::Structure)\n\nCalculates the volume for the unit cell.\n\n\n\n\n\n","category":"function"},{"location":"guide/structure/#DFControl.Structures.create_supercell","page":"Structure","title":"DFControl.Structures.create_supercell","text":"create_supercell(structure::Structure, na::Int, nb::Int, nc::Int; make_afm=false)\ncreate_supercell(structure::Structure, na::UnitRange, nb::UnitRange, nc::UnitRange; make_afm=false)\n\nTakes a structure and creates a supercell from it with: the given amount of additional cells if (na::Int, nb::Int, nc::Int) along the a, b, c direction, or amount of cells specified by the ranges i.e. -1:1, -1:1, -1:1 would create a 3x3x3 supercell. If make_afm is set to true all the labels and magnetizations of the magnetic atoms will be reversed in a checkerboard fashion.\n\n\n\n\n\n","category":"function"},{"location":"guide/structure/#DFControl.Structures.scale_cell!","page":"Structure","title":"DFControl.Structures.scale_cell!","text":"scale_cell!(structure::Structure, scalemat::Matrix)\n\nRescales the cell of the structure.\n\n\n\n\n\n","category":"function"},{"location":"guide/structure/#Atom","page":"Structure","title":"Atom","text":"","category":"section"},{"location":"guide/structure/","page":"Structure","title":"Structure","text":"Atom\nStructures.set_position!","category":"page"},{"location":"guide/structure/#DFControl.Structures.Atom","page":"Structure","title":"DFControl.Structures.Atom","text":"Atom(name::Symbol, element::Element, position_cart::Point3{Length}, position_cryst::Point3;\n pseudo::String = \"\",\n projections::Vector{Projection} = Projection[],\n magnetization::Vec3 = Vec3(0.0, 0.0, 0.0),\n dftu::DFTU = DFTU())\n\nRepresentation of an atom.\n\nThe name of the atom is used as an identifier for the atom type, in the sense that atoms with the same pseudo, projections, magnetization and dftu attributes should belong to the same type. This also means that during sanity checks atoms that are not of the same type will be given different names. This is done in this way because it often makes sense to change these parameters on all atoms of the same kind at the same time, but still allow the flexibility to change them for individual atoms as well.\n\nposition_cart should have a valid Unitful.Length type such as Ang.\n\nSee documentation for Element for further information on this attribute.\n\n\n\n\n\n","category":"type"},{"location":"guide/structure/#DFControl.Structures.set_position!","page":"Structure","title":"DFControl.Structures.set_position!","text":"set_position!(at::Atom, pos::AbstractVector{T}, unit_cell::Mat3) where {T<:Real}\n\nUpdates the position of the atom to this. The unit cell is used to make sure both position_cryst and position_cart are correct.\n\n\n\n\n\n","category":"function"},{"location":"guide/structure/#Element","page":"Structure","title":"Element","text":"","category":"section"},{"location":"guide/structure/","page":"Structure","title":"Structure","text":"Structures.Element\nelement","category":"page"},{"location":"guide/structure/#DFControl.Structures.Element","page":"Structure","title":"DFControl.Structures.Element","text":"Element(symbol::Symbol, Z::Int, name::String, atomic_weight::Float64, color::NTuple{3, Float64})\n\nRepresents an element. Most conveniently used trough the function element.\n\n\n\n\n\n","category":"type"},{"location":"guide/structure/#DFControl.Structures.element","page":"Structure","title":"DFControl.Structures.element","text":"element(sym::Symbol)\n\nReturns the predefined Element with symbol sym, i.e. element(:Si) will return the pregenerated Silicon Element.\n\n\n\n\n\n","category":"function"},{"location":"guide/structure/#pseudo_header","page":"Structure","title":"Pseudo Potentials","text":"","category":"section"},{"location":"guide/structure/","page":"Structure","title":"Structure","text":"set_pseudos!\nconfigure_pseudoset\nlist_pseudosets","category":"page"},{"location":"guide/structure/","page":"Structure","title":"Structure","text":"See the section on Configuration for a demonstration on how to set up pseudopotential sets.","category":"page"},{"location":"guide/structure/#Magnetization","page":"Structure","title":"Magnetization","text":"","category":"section"},{"location":"guide/structure/","page":"Structure","title":"Structure","text":"Magnetization can be set on a per Atom basis. It will partially determine the unique Atom types and also what calculation flags should be set in order to allow for the magnetic calculation (either colinear or non-colinear).","category":"page"},{"location":"guide/structure/#Projections","page":"Structure","title":"Projections","text":"","category":"section"},{"location":"guide/structure/","page":"Structure","title":"Structure","text":"These projections will mainly be used for generating Wannier90 inputs, and to distinguish which indices in the Wannier90 output matrices correspond to the various atoms/orbitals.","category":"page"},{"location":"guide/structure/","page":"Structure","title":"Structure","text":"Projection","category":"page"},{"location":"guide/structure/#DFControl.Structures.Projection","page":"Structure","title":"DFControl.Structures.Projection","text":"Projection(orbital::Orbital, start::Int, last::Int)\n\nA Wannier90 Projection, representing an Orbital with indices from start to last.\n\n\n\n\n\n","category":"type"},{"location":"guide/structure/#Orbitals","page":"Structure","title":"Orbitals","text":"","category":"section"},{"location":"guide/structure/","page":"Structure","title":"Structure","text":"Structures.Orbital","category":"page"},{"location":"guide/structure/#DFControl.Structures.Orbital","page":"Structure","title":"DFControl.Structures.Orbital","text":"Orbital(name::String, size::Int, l::Int, mr::Int)\n\nWannier90 orbital as defined in the Wannier90 User Guide. The name will be written in the projections block of the Wannier90 input.\n\n\n\n\n\n","category":"type"},{"location":"guide/structure/#DFT-U","page":"Structure","title":"DFT + U","text":"","category":"section"},{"location":"guide/structure/","page":"Structure","title":"Structure","text":"DFTU","category":"page"},{"location":"guide/structure/#DFControl.Structures.DFTU","page":"Structure","title":"DFControl.Structures.DFTU","text":"DFTU(;l ::Int = -1,\n U ::T = zero(T),\n J0::T = zero(T),\n α ::T = zero(T),\n β ::T = zero(T),\n J ::Vector{T} = T[zero(T)])\n\nDFT+U parameters for a given Atom.\n\n\n\n\n\n","category":"type"},{"location":"guide/servers/#servers_header","page":"Servers","title":"Servers","text":"","category":"section"},{"location":"guide/servers/","page":"Servers","title":"Servers","text":"DFControl is structure as a client-server architecture where the communication happens through a rest-API. This means that on the server-side a small daemon will run that the client will communicate with in order to load, save and submit Jobs. There are three ways to set up a server. To setup a local server, simply call Servers.configure_local and follow the prompt. A Server can also be setup by calling the constructor with a String that signifies the name of the Server, e.g. \"localhost\", or an ssh string such as \"user@domain\", which will prompt an interactive setup menu. ","category":"page"},{"location":"guide/servers/","page":"Servers","title":"Servers","text":"Alternatively, for full customization, a Server can be set up by filling out the constructor, and saving it as save(server). A previously saved Server can be loaded again through e.g. Server(\"localhost\") which will retrieve the previously saved configuration.","category":"page"},{"location":"guide/servers/","page":"Servers","title":"Servers","text":"Server\nServers.configure_local\nstart\nsave(::Server)","category":"page"},{"location":"guide/jobs/#Jobs","page":"Jobs","title":"Jobs","text":"","category":"section"},{"location":"guide/jobs/#Contents","page":"Jobs","title":"Contents","text":"","category":"section"},{"location":"guide/jobs/","page":"Jobs","title":"Jobs","text":"Pages=[\"jobs.md\"]","category":"page"},{"location":"guide/jobs/#Index","page":"Jobs","title":"Index","text":"","category":"section"},{"location":"guide/jobs/","page":"Jobs","title":"Jobs","text":"Pages=[\"jobs.md\"]","category":"page"},{"location":"guide/jobs/#Job","page":"Jobs","title":"Job","text":"","category":"section"},{"location":"guide/jobs/","page":"Jobs","title":"Jobs","text":"Job\nload(::Server, ::Job)","category":"page"},{"location":"guide/jobs/#DFControl.Jobs.Job","page":"Jobs","title":"DFControl.Jobs.Job","text":"Job(name::String, structure::Structure;\n calculations ::Vector{Calculation} = Calculation[],\n dir ::String = pwd(),\n version ::Int = last_job_version(dir),\n copy_temp_folders ::Bool = false, \n server ::String = getdefault_server(),\n environment::String =\"\")\n\nA Job embodies a set of Calculations to be ran in directory dir, with the Structure as the subject.\n\nKeywords/further attributes\n\ncalculations: calculations to calculations that will be run sequentially.\ndir: the directory where the calculations will be run.\nversion: the current version of the job.\ncopy_temp_folders: whether or not the temporary directory associated with intermediate calculation results should be copied when storing a job version. CAUTION These can be quite large.\nserver: Server where to run the Job.\nenvironment: Environment to be used for running the Job.\n\nJob(job_name::String, structure::Structure, calculations::Vector{<:Calculation}, common_flags::Pair{Symbol, <:Any}...; kwargs...)\n\nCreates a new job. The common flags will be attempted to be set in each of the calculations. The kwargs... are passed to the Job constructor. \n\nJob(job_dir::String, job_script=\"job.sh\"; version=nothing, kwargs...)\n\nLoads the job in the dir. If job_dir is not a valid job path, the previously saved jobs will be scanned for a job with a dir that partly includes job_dir. If version is specified the corresponding job version will be returned if it exists. The kwargs... will be passed to the Job constructor.\n\n\n\n\n\n","category":"type"},{"location":"guide/jobs/#RemoteHPC.load-Tuple{Server, Job}","page":"Jobs","title":"RemoteHPC.load","text":"load(server::Server, j::Job)\n\nTries to load the Job from server at directory j.dir. If no exact matching directory is found, a list of job directories that comprise j.dir will be returned.\n\n\n\n\n\n","category":"method"},{"location":"guide/jobs/#Interacting-with-calculations","page":"Jobs","title":"Interacting with calculations","text":"","category":"section"},{"location":"guide/jobs/","page":"Jobs","title":"Jobs","text":"Base.getindex(::Job, ::String)","category":"page"},{"location":"guide/jobs/#Base.getindex-Tuple{Job, String}","page":"Jobs","title":"Base.getindex","text":"getindex(job::Job, name::String)\n\nReturns the Calculation with the specified name.\n\ngetindex(job::Job, i::Integer)\n\nReturns the i'th Calculation in the job.\n\n\n\n\n\n","category":"method"},{"location":"guide/jobs/","page":"Jobs","title":"Jobs","text":"using DFControl\njob = load(Job(joinpath(@__DIR__, \"..\", \"assets\", \"job\")))","category":"page"},{"location":"guide/jobs/","page":"Jobs","title":"Jobs","text":"Example: ","category":"page"},{"location":"guide/jobs/","page":"Jobs","title":"Jobs","text":"job[\"scf\"]\njob[2]","category":"page"},{"location":"guide/jobs/","page":"Jobs","title":"Jobs","text":"Base.push!(::Job, ::Calculation)\nBase.append!(::Job, ::Any...)\nBase.pop!(::Job)\nBase.insert!(::Job, ::Int, ::Calculation)","category":"page"},{"location":"guide/jobs/#Base.push!-Tuple{Job, Calculation}","page":"Jobs","title":"Base.push!","text":"push!(job::Job, calculation::Calculation) = push!(job.calculations, calculation)\n\n\n\n\n\n","category":"method"},{"location":"guide/jobs/#Base.append!-Tuple{Job, Vararg{Any}}","page":"Jobs","title":"Base.append!","text":"append!(job::Job, args...) = append!(job.calculations, args...)\n\n\n\n\n\n","category":"method"},{"location":"guide/jobs/#Base.pop!-Tuple{Job}","page":"Jobs","title":"Base.pop!","text":"pop!(job::Job) = pop!(job.calculations)\n\n\n\n\n\n","category":"method"},{"location":"guide/jobs/#Base.insert!-Tuple{Job, Int64, Calculation}","page":"Jobs","title":"Base.insert!","text":"insert!(job::Job, i::Int, calculation::Calculation) = insert!(job.calculations, i, calculation)\n\n\n\n\n\n","category":"method"},{"location":"guide/jobs/#Scheduling,-submission-and-monitoring","page":"Jobs","title":"Scheduling, submission and monitoring","text":"","category":"section"},{"location":"guide/jobs/","page":"Jobs","title":"Jobs","text":"set_flow!\nsave(::Job)\nsubmit\nisrunning\nabort","category":"page"},{"location":"guide/jobs/#DFControl.Jobs.set_flow!","page":"Jobs","title":"DFControl.Jobs.set_flow!","text":"set_flow!(job::Job, should_runs::Pair{String, Bool}...)\n\nSets whether or not calculations should be scheduled to run. The name of each calculation in the job will be checked against the string in each pair of should_runs, and the calculation.run will be set accordingly.\n\nExample:\n\nset_flow!(job, \"\" => false, \"scf\" => true)\n\nwould un-schedule all calculations in the job, and schedule the \"scf\" and \"nscf\" calculations to run.\n\n\n\n\n\n","category":"function"},{"location":"guide/jobs/#RemoteHPC.save-Tuple{Job}","page":"Jobs","title":"RemoteHPC.save","text":"save(job::Job)\n\nSaves the job's calculations and job.sh submission script in job.dir. Some sanity checks will be performed on the validity of flags, execs, pseudopotentials, etc. The job will also be registered for easy retrieval at a later stage.\n\nIf a previous job is present in the job directory (indicated by a valid job script), it will be copied to the .versions sub directory as the previous version of job, and the version of job will be incremented. \n\n\n\n\n\n","category":"method"},{"location":"guide/jobs/#RemoteHPC.submit","page":"Jobs","title":"RemoteHPC.submit","text":"submit(job::Job)\n\nSaves and launches job. \n\n\n\n\n\n","category":"function"},{"location":"guide/jobs/#DFControl.Client.isrunning","page":"Jobs","title":"DFControl.Client.isrunning","text":"isrunning(job::Job)\nisrunning(s::Server, jobdir::String)\n\nReturns whether a job is running or not. If the job was submitted using slurm, a QUEUED status also counts as running.\n\n\n\n\n\n","category":"function"},{"location":"guide/jobs/#RemoteHPC.abort","page":"Jobs","title":"RemoteHPC.abort","text":"abort(job::Job)\n\nWill try to remove the job from the scheduler's queue. If the last running calculation happened to be a Calculation{QE}, the correct abort file will be written. For other codes the process is not smooth, and restarting is not guaranteed.\n\n\n\n\n\n","category":"function"},{"location":"guide/jobs/#Directories","page":"Jobs","title":"Directories","text":"","category":"section"},{"location":"guide/jobs/","page":"Jobs","title":"Jobs","text":"joinpath(::Job, ::Any...)\nabspath(::Job)\ncleanup(::Job)","category":"page"},{"location":"guide/jobs/#Base.Filesystem.joinpath-Tuple{Job, Vararg{Any}}","page":"Jobs","title":"Base.Filesystem.joinpath","text":"joinpath(job::Job, args...)\n\nIf the job is local this is joinpath(job.dir, args...), otherwise it will resolve the path using the Server rootdir.\n\n\n\n\n\n","category":"method"},{"location":"guide/jobs/#Base.Filesystem.abspath-Tuple{Job}","page":"Jobs","title":"Base.Filesystem.abspath","text":"abspath(job::Job, args...)\n\nIf the job is local this is abspath(job.dir), otherwise it will resolve the abspath using the Server rootdir.\n\n\n\n\n\n","category":"method"},{"location":"guide/jobs/#Registry","page":"Jobs","title":"Registry","text":"","category":"section"},{"location":"guide/jobs/","page":"Jobs","title":"Jobs","text":"All Jobs are stored in an internal registry the first time save(job) is called. This means that finding all previously worked on Jobs is as straightforward as calling load(server, Job(fuzzy)) where fuzzy is a part of the previously saved Job dir. This will then return a list of Jobs with similar directories. ","category":"page"},{"location":"guide/jobs/#Versioning","page":"Jobs","title":"Versioning","text":"","category":"section"},{"location":"guide/jobs/","page":"Jobs","title":"Jobs","text":"As previously mentioned, a rudimentary implementation of a Job versioning system is implemented. Upon calling save on a Job, if there is already a valid job script present in job.dir, it is assumed that this was a previous version of the job and the script together with all other files in job.local_dir will be copied to a subdirectory of the .versions directory bearing the name of the respective previous job version. After this, job.version will be incremented by 1 signalling the new version of the current Job. ","category":"page"},{"location":"guide/jobs/","page":"Jobs","title":"Jobs","text":"The virtue of this system is that it is possible to roll back to a previous version after possibly making breaking changes, or to pull out previous results after further experimentation was performed.","category":"page"},{"location":"guide/jobs/","page":"Jobs","title":"Jobs","text":"note: Note\nIf job.copy_temp_folders=true all possible intermediate files inside the temporary calculation directory (i.e. \"job_dir/outputs\") will be copied every time the job is saved. These can be quite large and can quickly create very large job directories. Handle with care!","category":"page"},{"location":"guide/jobs/","page":"Jobs","title":"Jobs","text":"versions\nlast_version\nswitch_version!\nrm_version!","category":"page"},{"location":"guide/jobs/#DFControl.Client.versions","page":"Jobs","title":"DFControl.Client.versions","text":"versions(job::Job)\nversions(server::Server, jobdir::String)\n\nReturs the valid versions of job.\n\n\n\n\n\nversions(job::Job)\n\nReturs the valid versions of job.\n\n\n\n\n\n","category":"function"},{"location":"guide/jobs/#DFControl.Client.last_version","page":"Jobs","title":"DFControl.Client.last_version","text":"last_version(job::Job)\nlast_version(s::Server, jobdir::String)\n\nReturns the last version number of job.\n\n\n\n\n\n","category":"function"},{"location":"guide/jobs/#DFControl.Client.switch_version!","page":"Jobs","title":"DFControl.Client.switch_version!","text":"switch_version!(job::Job[, version::Int])\n\nSwitches the version of job to one of the previously stored ones. It will save also the current version for future reference.\n\n\n\n\n\n","category":"function"},{"location":"guide/jobs/#DFControl.Client.rm_version!","page":"Jobs","title":"DFControl.Client.rm_version!","text":"rm_version!(job::Job, version::Int)\nrm_versions!(job::Job, versions::Int...)\n\nRemoves the specified versions from the job if they exist.\n\n\n\n\n\n","category":"function"},{"location":"guide/jobs/#Archiving","page":"Jobs","title":"Archiving","text":"","category":"section"},{"location":"guide/jobs/","page":"Jobs","title":"Jobs","text":"After a Job is completed, or an interesting result is achieved, it makes sense to store it for future reference. This can be achieved through the archive function. This will take the current job, and copy it to a subdirectory (specified by the second argument to archive) of the jobs/archived directory inside the DFControl config directory. The third argument is a description of this job's result.","category":"page"},{"location":"guide/jobs/","page":"Jobs","title":"Jobs","text":"note: Note\nIn order to not cause huge file transfers, all the temporary directories will first be removed before archiving.","category":"page"},{"location":"guide/jobs/","page":"Jobs","title":"Jobs","text":"Example:","category":"page"},{"location":"guide/jobs/","page":"Jobs","title":"Jobs","text":"archive(job, \"test_archived_job\", \"This is a test archived job\")","category":"page"},{"location":"guide/jobs/","page":"Jobs","title":"Jobs","text":"To query previously archived jobs one can use load(Server(\"localhost\"), Job(\"archived\")).","category":"page"},{"location":"guide/jobs/","page":"Jobs","title":"Jobs","text":"archive","category":"page"},{"location":"guide/jobs/#Output","page":"Jobs","title":"Output","text":"","category":"section"},{"location":"guide/jobs/","page":"Jobs","title":"Jobs","text":"outputdata\nreadfermi\nreadbands\nbandgap","category":"page"},{"location":"guide/jobs/#DFControl.Client.outputdata","page":"Jobs","title":"DFControl.Client.outputdata","text":"outputdata(job::Job; server = job.server, calcs::Vector{String}=String[])\n\nFinds the output files for each of the calculations of a Job, and groups all the parsed data into a dictionary.\n\n\n\n\n\n","category":"function"},{"location":"guide/jobs/#DFControl.Client.readfermi","page":"Jobs","title":"DFControl.Client.readfermi","text":"readfermi(job::Job, outdat=outputdata(job))\n\nTries to read the fermi level from a valid Calculation inside job. \n\n\n\n\n\n","category":"function"},{"location":"guide/jobs/#DFControl.Client.readbands","page":"Jobs","title":"DFControl.Client.readbands","text":"readbands(job::Job, outdat=outputdata(job))\n\nTries to read the bands from a bands calculation that is present in job.\n\n\n\n\n\n","category":"function"},{"location":"guide/jobs/#DFControl.bandgap","page":"Jobs","title":"DFControl.bandgap","text":"bandgap(bands::AbstractVector{Band}, n_electrons::Int)\nbandgap(bands::AbstractVector{Band}, fermi::Float64)\n\nCalculates the bandgap (possibly indirect) around the fermi level.\n\n\n\n\n\nbandgap(job::Job, nelec=nothing)\n\nCalculates the bandgap (possibly indirect) around the fermi level. Uses the first found bands calculation, if there is none it uses the first found nscf calculation.\n\n\n\n\n\n","category":"function"},{"location":"guide/jobs/#environments_header","page":"Jobs","title":"Environments","text":"","category":"section"},{"location":"guide/jobs/","page":"Jobs","title":"Jobs","text":"Environments specify the skeleton of the job script, i.e. which environment variables need to be set, which scheduler flags, etc.","category":"page"},{"location":"guide/jobs/","page":"Jobs","title":"Jobs","text":"Environment","category":"page"},{"location":"guide/basic_tutorial/","page":"Basic Tutorial","title":"Basic Tutorial","text":"EditURL = \"basic_tutorial.jl\"","category":"page"},{"location":"guide/basic_tutorial/#Basic-Tutorial","page":"Basic Tutorial","title":"Basic Tutorial","text":"","category":"section"},{"location":"guide/basic_tutorial/","page":"Basic Tutorial","title":"Basic Tutorial","text":"note: Note\nMake sure to first go through the Configuration steps.","category":"page"},{"location":"guide/basic_tutorial/","page":"Basic Tutorial","title":"Basic Tutorial","text":"Since DFControl is aimed at improving the day to day quality of life of a material's scientist/anyone running DFT codes, we will look at a simple demonstration of how by creating and submitting some Quantum-Espresso calculations on Si starting from a cif file specifying the structure.","category":"page"},{"location":"guide/basic_tutorial/","page":"Basic Tutorial","title":"Basic Tutorial","text":"using DFControl","category":"page"},{"location":"guide/basic_tutorial/","page":"Basic Tutorial","title":"Basic Tutorial","text":"First we download the cif file, extract the Structure and assign the right pseudos to it. In this case Si (F d -3 m :1) from http://www.crystallography.net/cod/9011998.cif","category":"page"},{"location":"guide/basic_tutorial/","page":"Basic Tutorial","title":"Basic Tutorial","text":"using Downloads\ncif_file = Downloads.download(\"http://www.crystallography.net/cod/9011998.cif\", \"Si.cif\")\n\nstructure = Structure(cif_file)\nif false#hide\nset_pseudos!(structure, load(local_server(), PseudoSet(\"pbesol\")))\nend#hide","category":"page"},{"location":"guide/basic_tutorial/","page":"Basic Tutorial","title":"Basic Tutorial","text":"This assumes that the \"pbesol\" pseudopotential set was installed during the configuration step.","category":"page"},{"location":"guide/basic_tutorial/","page":"Basic Tutorial","title":"Basic Tutorial","text":"Next we specify the executables with which to run the QE calculations. We assume here that mpirun is installed and in the user's PATH, and that QE is installed, and to be found in the /opt/qe/bin, change this according to your own setup. The first argument to the constructor can be used as a label to later retrieve the executable after it was saved.","category":"page"},{"location":"guide/basic_tutorial/","page":"Basic Tutorial","title":"Basic Tutorial","text":"pw_exec = Exec(name=\"pw\", path=\"/opt/qe/bin/pw.x\",flags=Dict(\"-nk\" => 4))","category":"page"},{"location":"guide/basic_tutorial/","page":"Basic Tutorial","title":"Basic Tutorial","text":"Then we create the first calculation for our job, we name it scf, which will be used to reference it later. We also pass the executables to be used and additional flags to be set to the constructor. Afterwards we set the kpoints to be used in the scf calculation.","category":"page"},{"location":"guide/basic_tutorial/","page":"Basic Tutorial","title":"Basic Tutorial","text":"scf_calculation = Calculation(\"scf\", :calculation => \"scf\"; exec = pw_exec)\nset_kpoints!(scf_calculation, (6, 6, 6, 1, 1, 1))","category":"page"},{"location":"guide/basic_tutorial/","page":"Basic Tutorial","title":"Basic Tutorial","text":"The code recognizes internally that this 6-Tuple corresponds to a K_POINTS (automatic) block in QE. Alternatively (leading to an identical final result):","category":"page"},{"location":"guide/basic_tutorial/","page":"Basic Tutorial","title":"Basic Tutorial","text":"scf_calculation = Calculation(\"scf\", :calculation => \"scf\"; exec = pw_exec,\n data = [InputData(:k_points, :automatic,\n (6, 6, 6, 1, 1, 1))])","category":"page"},{"location":"guide/basic_tutorial/","page":"Basic Tutorial","title":"Basic Tutorial","text":"We can now define our job: job = Job(\"Si\", structure, [scfcalculation], :ecutwfc => 20, :convthr => 1e-6; dir=\"job\") Additional calculations would be be added to the list [scf_calculation]. The flag => value pairs will set the specified flags to that value for all calculations in the job that allow recognize that flag, so it's ideal for things like cutoffs and smearing etc.","category":"page"},{"location":"guide/basic_tutorial/","page":"Basic Tutorial","title":"Basic Tutorial","text":"if false#hide\njob = Job(\"Si\", structure, [scf_calculation], :ecutwfc => 40.0, :occupations => \"smearing\", :degauss=>0.01, :conv_thr => 1e-6, :nbnd => 18;\n dir = dir, server=gethostname(), environment=\"default\")\nend#hide","category":"page"},{"location":"guide/basic_tutorial/","page":"Basic Tutorial","title":"Basic Tutorial","text":"We are now ready to submit the job, which will run in the current working directory","category":"page"},{"location":"guide/basic_tutorial/","page":"Basic Tutorial","title":"Basic Tutorial","text":"if false #hide\nsubmit(job)\nelse #hide\n global job = load(local_server(), Job(joinpath(splitdir(pathof(DFControl))[1], \"..\", \"docs\",\"src\",\"assets\", \"job\")))#hide\n pop!(job) #hide\nend #hide","category":"page"},{"location":"guide/basic_tutorial/","page":"Basic Tutorial","title":"Basic Tutorial","text":"This will generate and save all calculation files, and the corresponding job script (job.sh), to the server specified in job.server, and then the job will be submitted on the server.","category":"page"},{"location":"guide/basic_tutorial/","page":"Basic Tutorial","title":"Basic Tutorial","text":"After the job finishes the outputs can be parsed through","category":"page"},{"location":"guide/basic_tutorial/","page":"Basic Tutorial","title":"Basic Tutorial","text":"outputdata(job)","category":"page"},{"location":"guide/basic_tutorial/","page":"Basic Tutorial","title":"Basic Tutorial","text":"this returns a dictionary with the input names as keys and a Dict with parsed outputs as values. i.e.","category":"page"},{"location":"guide/basic_tutorial/","page":"Basic Tutorial","title":"Basic Tutorial","text":"outputdata(job)[\"scf\"]","category":"page"},{"location":"guide/basic_tutorial/","page":"Basic Tutorial","title":"Basic Tutorial","text":"takes the outputdata of the input that we previously named \"scf\" when creating it.","category":"page"},{"location":"guide/basic_tutorial/","page":"Basic Tutorial","title":"Basic Tutorial","text":"Now that the scf calculation finished succesfully, the next step is usually to have a look at the bandstructure. For this we generate a bands calculation, using the scf calculation as a template and a generated high symmetry k-point path with 20 kpoints per segment.","category":"page"},{"location":"guide/basic_tutorial/","page":"Basic Tutorial","title":"Basic Tutorial","text":"bands_calc = Calculations.gencalc_bands(job[\"scf\"], Structures.high_symmetry_kpath(job.structure, 20))","category":"page"},{"location":"guide/basic_tutorial/","page":"Basic Tutorial","title":"Basic Tutorial","text":"Observe the :calculation => \"bands\", and automatic setting of the :verbosity => \"high\" flags. We now push! this calculation to the job queue.","category":"page"},{"location":"guide/basic_tutorial/","page":"Basic Tutorial","title":"Basic Tutorial","text":"push!(job, bands_calc)","category":"page"},{"location":"guide/basic_tutorial/","page":"Basic Tutorial","title":"Basic Tutorial","text":"However, since we know the scf succeeded there is no need to rerun it. To un-schedule it we do","category":"page"},{"location":"guide/basic_tutorial/","page":"Basic Tutorial","title":"Basic Tutorial","text":"job[\"scf\"].run = false","category":"page"},{"location":"guide/basic_tutorial/","page":"Basic Tutorial","title":"Basic Tutorial","text":"Printing the job will now highlight the scheduled calculations differently from the non-scheduled ones","category":"page"},{"location":"guide/basic_tutorial/","page":"Basic Tutorial","title":"Basic Tutorial","text":"job","category":"page"},{"location":"guide/basic_tutorial/","page":"Basic Tutorial","title":"Basic Tutorial","text":"Seeing that all is right we submit the job again","category":"page"},{"location":"guide/basic_tutorial/","page":"Basic Tutorial","title":"Basic Tutorial","text":"job.dir = \"job\"; #hide\nif false #hide\nsubmit(job)\nelse #hide\n global job = load(local_server(),Job(joinpath(splitdir(pathof(DFControl))[1], \"..\", \"docs\",\"src\",\"assets\", \"job\")));#hide\nend #hide","category":"page"},{"location":"guide/basic_tutorial/","page":"Basic Tutorial","title":"Basic Tutorial","text":"We can access the bands through","category":"page"},{"location":"guide/basic_tutorial/","page":"Basic Tutorial","title":"Basic Tutorial","text":"bands = readbands(job);\nnothing #hide","category":"page"},{"location":"guide/basic_tutorial/","page":"Basic Tutorial","title":"Basic Tutorial","text":"or","category":"page"},{"location":"guide/basic_tutorial/","page":"Basic Tutorial","title":"Basic Tutorial","text":"bands = outputdata(job)[\"bands\"][:bands];\nnothing #hide","category":"page"},{"location":"guide/basic_tutorial/","page":"Basic Tutorial","title":"Basic Tutorial","text":"They can be plotted too","category":"page"},{"location":"guide/basic_tutorial/","page":"Basic Tutorial","title":"Basic Tutorial","text":"fermi = readfermi(job) # = outputdata(job)[\"scf\"][:fermi]\nusing Plots\nplot(bands; fermi = fermi)","category":"page"},{"location":"guide/basic_tutorial/","page":"Basic Tutorial","title":"Basic Tutorial","text":"Since more info (such as the structure) is available in the job, plotting the job leads to a richer plot","category":"page"},{"location":"guide/basic_tutorial/","page":"Basic Tutorial","title":"Basic Tutorial","text":"plot(job, -10, 1)","category":"page"},{"location":"guide/basic_tutorial/","page":"Basic Tutorial","title":"Basic Tutorial","text":"As can be seen in the Advanced Usage, additional information generated by additional calculations will be picked up by DFControl in order to create richer plots.","category":"page"},{"location":"guide/installation/#Installation","page":"Installation","title":"Installation","text":"","category":"section"},{"location":"guide/installation/","page":"Installation","title":"Installation","text":"In case you don't have a working Julia installation yet, first download the Julia binaries and follow the Julia installation instructions.","category":"page"},{"location":"guide/installation/","page":"Installation","title":"Installation","text":"note: Note\nDFControl requires Julia 1.6 or newer, the server side functionality will not work with older versions.","category":"page"},{"location":"guide/installation/","page":"Installation","title":"Installation","text":"Afterwards you can install DFControl like any other package in Julia. For example run in your Julia REPL terminal:","category":"page"},{"location":"guide/installation/","page":"Installation","title":"Installation","text":"import Pkg\nPkg.add(\"DFControl\")","category":"page"},{"location":"guide/installation/","page":"Installation","title":"Installation","text":"which will install the latest DFControl release. Alternatively (if you like to be fully up to date) install the master branch:","category":"page"},{"location":"guide/installation/","page":"Installation","title":"Installation","text":"import Pkg\nPkg.add(name=\"DFControl\", rev=\"master\")","category":"page"},{"location":"guide/installation/","page":"Installation","title":"Installation","text":"DFControl is continuously tested on Debian, Ubuntu, mac OS and Windows and should work on these operating systems out of the box.","category":"page"},{"location":"guide/installation/","page":"Installation","title":"Installation","text":"After these steps it is highly recommended to go through some additional Configuration.","category":"page"},{"location":"guide/configuration/#Configuration","page":"Configuration","title":"Configuration","text":"","category":"section"},{"location":"guide/configuration/#[Servers](@ref-servers_header)","page":"Configuration","title":"Servers","text":"","category":"section"},{"location":"guide/configuration/","page":"Configuration","title":"Configuration","text":"Since DFControl utilizes a client-server rest-api model, each server will have its own local deamon running, which stores certain server-side items such as pseudopotentials, Environments and Execs.","category":"page"},{"location":"guide/configuration/","page":"Configuration","title":"Configuration","text":"Make sure that both julia and DFControl are installed on the target remote server before trying to create a connection to it. Also, it is necessary that your ssh keys are registered on the remote so that no passwords are required for ssh connections.","category":"page"},{"location":"guide/configuration/","page":"Configuration","title":"Configuration","text":"To up a new Server, in this case with name = \"daint\" an interactive menu can be called like:","category":"page"},{"location":"guide/configuration/","page":"Configuration","title":"Configuration","text":"Server(\"daint\")","category":"page"},{"location":"guide/configuration/","page":"Configuration","title":"Configuration","text":"This will set up all the required information and store it for later use. To start a Server simply call start(server), which will launch the daemon externally. Make sure that the host address points to a persistent server, i.e. if a cluster has multiple frontend nodes, find the ip address of one particular one, and set that one as the host address. During the setup of an external server, it may ask whether a local_tunnel should be created. If enabled, a persistent ssh tunnel will be created from the local machine to the target host through which the http requests will be sent. This is useful when the remote is behind an authentication firewall.","category":"page"},{"location":"guide/configuration/","page":"Configuration","title":"Configuration","text":"To reconfigure a Server you can always do:","category":"page"},{"location":"guide/configuration/","page":"Configuration","title":"Configuration","text":"s = Server(\"daint\")\ns.root_jobdir = \"\"\nsave(s)","category":"page"},{"location":"guide/configuration/","page":"Configuration","title":"Configuration","text":"If a Server was running first stop it using kill(server).","category":"page"},{"location":"guide/configuration/#Pseudopotentials","page":"Configuration","title":"Pseudopotentials","text":"","category":"section"},{"location":"guide/configuration/","page":"Configuration","title":"Configuration","text":"Pseudopotentials are grouped in sets, which are stored for later ease of use. They can be set up using the configure_pseudoset function.","category":"page"},{"location":"guide/configuration/","page":"Configuration","title":"Configuration","text":"configure_pseudoset(local_server(), \"set_name\", \"/dir/to/pseudos\")","category":"page"},{"location":"guide/configuration/","page":"Configuration","title":"Configuration","text":"This will go through the specified directories and find files that follow the naming convention element.x_y_z.xyz e.g. Si.pbesol-n-kjpaw_psl.0.1.UPF or si.pbesol-n-kjpaw_psl.0.1.UPF. If multiple are found, all will be stored and the required one can be later specified.","category":"page"},{"location":"guide/configuration/","page":"Configuration","title":"Configuration","text":"The pseudos will remain on the server where they are stored, and can be listed using list_pseudosets. See Pseudo Potentials for further usage details.","category":"page"},{"location":"guide/configuration/","page":"Configuration","title":"Configuration","text":"configure_pseudoset\nlist_pseudosets\nrm_pseudoset!","category":"page"},{"location":"guide/configuration/#DFControl.Client.configure_pseudoset","page":"Configuration","title":"DFControl.Client.configure_pseudoset","text":"configure_pseudoset(set_name::String, dir::String)\n\nReads the specified dir and sets up the pseudos for set.\n\n\n\n\n\n","category":"function"},{"location":"guide/configuration/#[Environments](@ref-environments_header)","page":"Configuration","title":"Environments","text":"","category":"section"},{"location":"guide/configuration/","page":"Configuration","title":"Configuration","text":"Environments specify the skeleton of the job script, i.e. which environment variables need to be set, which scheduler flags, etc. Here we will set up an environment and save it on the local Server. Change the information according to your own setup.","category":"page"},{"location":"guide/configuration/","page":"Configuration","title":"Configuration","text":"e = Environment(name=\"default\", parallel_exec=Exec(exec=\"mpirun\", flags=Dict(\"-np\"=> 4), directives=Dict(\"N\" => 1, \"partition\" => \"parallel\"), exports=Dict(\"OMP_NUM_THREADS\"=>1)))\nsave(local_server(), e)","category":"page"},{"location":"guide/configuration/#[Execs](@ref-execs_header)","page":"Configuration","title":"Execs","text":"","category":"section"},{"location":"guide/configuration/","page":"Configuration","title":"Configuration","text":"An Exec embodies an executable as the name suggests. They hold both the executable, directory and modules required to run the executable. Similar to Environments, they are stored on the server for later use. When storing it is verified that they are able to run.","category":"page"},{"location":"guide/configuration/","page":"Configuration","title":"Configuration","text":"e = Exec(name=\"pw\", exec=\"pw.x\", dir=\"/home/user/Softare/qe/bin\", modules = [\"intel\", \"intel-mpi\", \"intel-mkl\"])\nsave(local_server(), e)","category":"page"},{"location":"guide/configuration/#Loading/Saving","page":"Configuration","title":"Loading/Saving","text":"","category":"section"},{"location":"guide/configuration/","page":"Configuration","title":"Configuration","text":"As shown above there are three main methods related to storing and retrieving data i.e.:","category":"page"},{"location":"guide/configuration/","page":"Configuration","title":"Configuration","text":"DFControl.Client.RemoteHPC.load\nDFControl.Client.RemoteHPC.save","category":"page"},{"location":"guide/configuration/#RemoteHPC.load","page":"Configuration","title":"RemoteHPC.load","text":"load(server::Server, j::Job)\n\nTries to load the Job from server at directory j.dir. If no exact matching directory is found, a list of job directories that comprise j.dir will be returned.\n\n\n\n\n\n","category":"function"},{"location":"guide/configuration/#RemoteHPC.save","page":"Configuration","title":"RemoteHPC.save","text":"save(job::Job)\n\nSaves the job's calculations and job.sh submission script in job.dir. Some sanity checks will be performed on the validity of flags, execs, pseudopotentials, etc. The job will also be registered for easy retrieval at a later stage.\n\nIf a previous job is present in the job directory (indicated by a valid job script), it will be copied to the .versions sub directory as the previous version of job, and the version of job will be incremented. \n\n\n\n\n\n","category":"function"},{"location":"guide/configuration/","page":"Configuration","title":"Configuration","text":"After completing this configuration, it is suggested to look at the (Basic Usage)[@ref] for an introduction to the basic usage of DFControl.","category":"page"},{"location":"api/#API-reference","page":"API reference","title":"API reference","text":"","category":"section"},{"location":"api/","page":"API reference","title":"API reference","text":"This page provides a plain list of all inline documention associated with functions, structs and macros in DFControl. Note that this list is neither structured, complete nor particularly clean, so it only provides rough orientation at the moment. The best reference is the code itself.","category":"page"},{"location":"guide/advanced_tutorial/","page":"Advanced Tutorial","title":"Advanced Tutorial","text":"EditURL = \"advanced_tutorial.jl\"","category":"page"},{"location":"guide/advanced_tutorial/#Advanced-Usage","page":"Advanced Tutorial","title":"Advanced Usage","text":"","category":"section"},{"location":"guide/advanced_tutorial/","page":"Advanced Tutorial","title":"Advanced Tutorial","text":"In this tutorial we will continue from the job created in the Basic Tutorial, and demonstrate some more advanced functionality that DFControl offers.","category":"page"},{"location":"guide/advanced_tutorial/","page":"Advanced Tutorial","title":"Advanced Tutorial","text":"To load a previously saved job we here provide a valid job directory with a job.sh script in it.","category":"page"},{"location":"guide/advanced_tutorial/","page":"Advanced Tutorial","title":"Advanced Tutorial","text":"using DFControl\n\ntjob = load(local_server(),Job(joinpath(splitdir(pathof(DFControl))[1], \"..\", \"docs\",\"src\",\"assets\", \"job\")))#hide\ntjob2 = load(local_server(),Job(joinpath(splitdir(pathof(DFControl))[1], \"..\", \"docs\",\"src\",\"assets\", \"Job2\")))#hide\nif false#hide\njob = load(local_server(), Job(\"job\"))\nelse#hide\n global job = deepcopy(tjob)#hide\n job.dir= \"job\" #hide\n job#hide\nend#hide","category":"page"},{"location":"guide/advanced_tutorial/","page":"Advanced Tutorial","title":"Advanced Tutorial","text":"Since the job created in the Basic Tutorial was saved in the \"job\" directory this will work, see the section on Jobs for further details and options on how to load previously saved jobs.","category":"page"},{"location":"guide/advanced_tutorial/","page":"Advanced Tutorial","title":"Advanced Tutorial","text":"The next thing we may want to do is to change the directory where the job is running.","category":"page"},{"location":"guide/advanced_tutorial/","page":"Advanced Tutorial","title":"Advanced Tutorial","text":"if false#hide\njob.dir = \"Job2\"\nelse#hide\n global job = deepcopy(tjob2)#hide\n pop!(job)#hide\n pop!(job)#hide\n job#hide\nend#hide","category":"page"},{"location":"guide/advanced_tutorial/","page":"Advanced Tutorial","title":"Advanced Tutorial","text":"With the copy=true flag we let DFControl know that not only to create and set the new directory, but also to copy the previous results and temporary files to the new directory so we don't have to rerun the scf calculation.","category":"page"},{"location":"guide/advanced_tutorial/","page":"Advanced Tutorial","title":"Advanced Tutorial","text":"Next we would like to plot the projected density of states. For that we create both an nscf calculation to get a uniform k-grid, and projwfc calculation.","category":"page"},{"location":"guide/advanced_tutorial/","page":"Advanced Tutorial","title":"Advanced Tutorial","text":"push!(job, Calculations.gencalc_nscf(job[\"scf\"], (6, 6, 6)))","category":"page"},{"location":"guide/advanced_tutorial/","page":"Advanced Tutorial","title":"Advanced Tutorial","text":"The second argument of gencalc_nscf is the kgrid. When passing a 3-Tuple, the code will assume that an explicit k-grid is requested, which can be verified by","category":"page"},{"location":"guide/advanced_tutorial/","page":"Advanced Tutorial","title":"Advanced Tutorial","text":"data(job[\"nscf\"], :k_points)","category":"page"},{"location":"guide/advanced_tutorial/","page":"Advanced Tutorial","title":"Advanced Tutorial","text":"Next we generate a projwfc calculation using the fermi level as a guide for the energy window. The arguments are structured as (template, Emin, Emax, deltaE) respectively.","category":"page"},{"location":"guide/advanced_tutorial/","page":"Advanced Tutorial","title":"Advanced Tutorial","text":"fermi = readfermi(job)\npush!(job, Calculations.gencalc_projwfc(job[\"nscf\"], fermi - 10, fermi + 1, 0.1))","category":"page"},{"location":"guide/advanced_tutorial/","page":"Advanced Tutorial","title":"Advanced Tutorial","text":"Next we disable the bands calculation and run the new ones.","category":"page"},{"location":"guide/advanced_tutorial/","page":"Advanced Tutorial","title":"Advanced Tutorial","text":"job[\"bands\"].run = false\nif false#hide\n submit(job)\nelse#hide\n global job = deepcopy(tjob2)#hide\nend#hide","category":"page"},{"location":"guide/advanced_tutorial/#results_plotting","page":"Advanced Tutorial","title":"Plot Results","text":"","category":"section"},{"location":"guide/advanced_tutorial/","page":"Advanced Tutorial","title":"Advanced Tutorial","text":"using Plots\nplot(job, -10, 1)","category":"page"},{"location":"guide/advanced_tutorial/","page":"Advanced Tutorial","title":"Advanced Tutorial","text":"As we can see, again DFControl identifies the additional information that is now present in the job, and uses it to display in the plot.","category":"page"},{"location":"guide/advanced_tutorial/","page":"Advanced Tutorial","title":"Advanced Tutorial","text":"In the demonstrated case we see that everything went according to plan, however, often things need to be changed in a trial and error way until the desired results are found.","category":"page"},{"location":"guide/advanced_tutorial/","page":"Advanced Tutorial","title":"Advanced Tutorial","text":"On common occurence is that calculation flags have to be set, or changed. This can be done in two ways","category":"page"},{"location":"guide/advanced_tutorial/","page":"Advanced Tutorial","title":"Advanced Tutorial","text":"job[:ecutwfc] = 40.0","category":"page"},{"location":"guide/advanced_tutorial/","page":"Advanced Tutorial","title":"Advanced Tutorial","text":"will go through all the calculations of the job and set the flag if it is allowed, i.e. the flag will not be set in the projwfc calculation since it makes no sense.","category":"page"},{"location":"guide/advanced_tutorial/","page":"Advanced Tutorial","title":"Advanced Tutorial","text":"job[\"bands\"][:nbnd] = 30","category":"page"},{"location":"guide/advanced_tutorial/","page":"Advanced Tutorial","title":"Advanced Tutorial","text":"This will set a flag for one specific calculation, again checking whether the flag is valid, and the type will be converted to the correct one.","category":"page"},{"location":"guide/advanced_tutorial/","page":"Advanced Tutorial","title":"Advanced Tutorial","text":"In order to quickly specify what calculations to schedule and which not, one can use","category":"page"},{"location":"guide/advanced_tutorial/","page":"Advanced Tutorial","title":"Advanced Tutorial","text":"Jobs.set_flow!(job, \"\" => false, \"scf\" => true)","category":"page"},{"location":"guide/advanced_tutorial/","page":"Advanced Tutorial","title":"Advanced Tutorial","text":"As we can see, only the scf and nscf calculations are scheduled to run now, this is because for each of the pairs in the arguments of set_flow!, every calculation inside the job for which the string occurs in the name will be set to run or not depending on the Bool.","category":"page"},{"location":"guide/calculations/#Calculations","page":"Calculations","title":"Calculations","text":"","category":"section"},{"location":"guide/calculations/#Contents","page":"Calculations","title":"Contents","text":"","category":"section"},{"location":"guide/calculations/","page":"Calculations","title":"Calculations","text":"Pages=[\"calculations.md\"]","category":"page"},{"location":"guide/calculations/#Index","page":"Calculations","title":"Index","text":"","category":"section"},{"location":"guide/calculations/","page":"Calculations","title":"Calculations","text":"Pages=[\"calculations.md\"]","category":"page"},{"location":"guide/calculations/","page":"Calculations","title":"Calculations","text":"Calculation\nInputData","category":"page"},{"location":"guide/calculations/#DFControl.Calculations.Calculation","page":"Calculations","title":"DFControl.Calculations.Calculation","text":"Calculation{P<:Package}(name ::String;\n flags ::AbstractDict = Dict{Symbol, Any}(),\n data ::Vector{InputData} = InputData[],\n exec ::Exec,\n run ::Bool = true,\n infile ::String = P == Wannier90 ? name * \".win\" : name * \".in\",\n outfile ::String = name * \".out\")\n\nThe representation of a DFT calculation of package P, holding the flags that will be written to the infile, the executable exec and the output written by the calculation to the outfile. It essentially represents a line in a job script similar to exec < infile.in > outfile.out. outdata stores the parsed calculation output after it was read at least once. The run field indicates whether the calculation should be actually performed, e.g. if run=false the corresponding line will be commented out in the job script.\n\nCalculation{P<:Package}(name::AbstractString, flags::Pair{Symbol, Any}...; kwargs...)\n\nCreate a Calculation from name and flags, other kwargs... will be passed to the constructor.\n\nCalculation(template::Calculation, name::AbstractString, flags::Pair{Symbol, Any}...; excs=deepcopy(template.exec), run=true, data=nothing)\n\nCreates a new Calculation from the template, setting the flags of the newly created one to the specified ones.\n\n\n\n\n\n","category":"type"},{"location":"guide/calculations/#DFControl.Calculations.InputData","page":"Calculations","title":"DFControl.Calculations.InputData","text":"InputData(name::Symbol, option::Symbol, data::Any)\n\nRepresents a more structured block of input data. e.g. InputData(:k_points, :automatic, (6,6,6,1,1,1)) would be translated for a QE calculation into\n\nK_POINTS(automatic)\n6 6 6 1 1 1\n\n\n\n\n\n","category":"type"},{"location":"guide/calculations/#Basic-interaction","page":"Calculations","title":"Basic interaction","text":"","category":"section"},{"location":"guide/calculations/","page":"Calculations","title":"Calculations","text":"Calculations.set_name!\nCalculations.data\nCalculations.set_kpoints!","category":"page"},{"location":"guide/calculations/#DFControl.Calculations.set_name!","page":"Calculations","title":"DFControl.Calculations.set_name!","text":"set_name!(c::Calculation, name::AbstractString)\n\nSets calculation.name, and calculation.infile and calculation.outfile to conform with the new name.\n\n\n\n\n\n","category":"function"},{"location":"guide/calculations/#DFControl.Calculations.data","page":"Calculations","title":"DFControl.Calculations.data","text":"data(calculation::Calculation, n::Symbol)\n\nThe former returns calculation.data, the later – the InputData with name n.\n\n\n\n\n\n","category":"function"},{"location":"guide/calculations/#DFControl.Calculations.set_kpoints!","page":"Calculations","title":"DFControl.Calculations.set_kpoints!","text":"set_kpoints!(calculation::Calculation{QE}, k_grid::NTuple{3, Int}; print=true)\nset_kpoints!(calculation::Calculation{QE}, k_grid::NTuple{6, Int}; print=true)\nset_kpoints!(calculation::Calculation{QE}, k_grid::Vector{<:NTuple{4}}; print=true, k_option=:crystal_b)\n\nConvenience function to set the :k_points data block of calculation. The three different methods are targeted at nscf, scf or vcrelax, and bands calculations, respectively. For the nscf version an explicit list of k_points will be generated.\n\nset_kpoints!(calculation::Calculation{Wannier90}, k_grid::NTuple{3, Int})\n\nSimilar to the nscf targeted function in the sense that it will generate an explicit list of k_points, adhering to the same rules as for the nscf. The mp_grid flag will also automatically be set.\n\n\n\n\n\n","category":"function"},{"location":"guide/calculations/#Flags","page":"Calculations","title":"Flags","text":"","category":"section"},{"location":"guide/calculations/","page":"Calculations","title":"Calculations","text":"A big part of working with DFT calculations is specifying the various calculation flags. Remembering all the names of the flags, where they belong, and what types they are expected to be, is quite complicated and can lead to easily made mistakes like typos. DFControl tries to catch these as it knows which flags are allowed for which calculations. It will report when a flag can not be found for a given Calculation, and it will also try to convert a flag value to the expected type.","category":"page"},{"location":"guide/calculations/","page":"Calculations","title":"Calculations","text":"A Calculation behaves a lot as a normal Dict to interact with the stored flags. This means that the usual Dict operations such as haskey, get, and pop! work on a Calculation.","category":"page"},{"location":"guide/calculations/","page":"Calculations","title":"Calculations","text":"Base.getindex(::Calculation, ::Symbol)\nBase.setindex!(::Calculation, ::Symbol, ::Any)\nCalculations.set_flags!","category":"page"},{"location":"guide/calculations/#Base.getindex-Tuple{Calculation, Symbol}","page":"Calculations","title":"Base.getindex","text":"getindex(c::Calculation, n::Symbol)\n\nReturns the flag with given symbol.\n\ngetindex(job::Job, flag::Symbol)\n\nSearches through the job's calculations for the requested flag. A Dict will be returned with calculation names as the keys and the flags as values.\n\n\n\n\n\n","category":"method"},{"location":"guide/calculations/#Base.setindex!-Tuple{Calculation, Symbol, Any}","page":"Calculations","title":"Base.setindex!","text":"setindex!(c::Calculation, value, flag::Symbol)\n\nSets flags.\n\nsetindex!(job::Job, value, flag::Symbol)\n\nSet flag in all the appropriate calculations to the value.\n\n\n\n\n\n","category":"method"},{"location":"guide/calculations/#DFControl.Calculations.set_flags!","page":"Calculations","title":"DFControl.Calculations.set_flags!","text":"set_flags!(c::Calculation, flags::Pair{Symbol, Any}...; print=true, force=false)\n\nSets multiple flags in one go. Flag validity and type are verified.\n\nset_flags!(job::Job, calculations::Vector{<:Calculation}, flags::Pair{Symbol,<:Any}...; print=true)\nset_flags!(job::Job, flags::Pair{Symbol,<:Any}...; print=true)\n\nSets the flags in the names to the flags specified. This only happens if the specified flags are valid for the names.\n\n\n\n\n\n","category":"function"},{"location":"guide/calculations/#execs_header","page":"Calculations","title":"Execs","text":"","category":"section"},{"location":"guide/calculations/","page":"Calculations","title":"Calculations","text":"Exec","category":"page"},{"location":"guide/calculations/#calculation_generation","page":"Calculations","title":"Generating new calculations","text":"","category":"section"},{"location":"guide/calculations/","page":"Calculations","title":"Calculations","text":"Calculations.gencalc_vcrelax(::Calculation{QE}, ::NTuple{6, Int}, ::Any...)\nCalculations.gencalc_scf(::Calculation{QE}, ::NTuple{6, Int}, ::Any...)\nCalculations.gencalc_bands(::Calculation{QE}, ::Vector{<:NTuple{4}}, ::Any...)\nCalculations.gencalc_nscf(::Calculation{QE}, kpoints::NTuple{3, Int}, ::Any...)\nCalculations.gencalc_projwfc(::Calculation{QE}, ::Real, ::Real, ::Real)\nCalculations.gencalc_wan","category":"page"},{"location":"guide/calculations/#DFControl.Calculations.gencalc_vcrelax-Tuple{Calculation{QE}, NTuple{6, Int64}, Vararg{Any}}","page":"Calculations","title":"DFControl.Calculations.gencalc_vcrelax","text":"gencalc_vcrelax(template::Calculation{QE}, kpoints::NTuple{6, Int}, newflags...; name=\"scf\")\n\nUses the information from the template and supplied kpoints to generate a vcrelax calculation. Extra flags can be supplied which will be set for the generated calculation.\n\n\n\n\n\n","category":"method"},{"location":"guide/calculations/#DFControl.Calculations.gencalc_scf-Tuple{Calculation{QE}, NTuple{6, Int64}, Vararg{Any}}","page":"Calculations","title":"DFControl.Calculations.gencalc_scf","text":"gencalc_scf(template::Calculation{QE}, kpoints::NTuple{6, Int}, newflags...; name=\"scf\")\n\nUses the information from the template and supplied kpoints to generate an scf calculation. Extra flags can be supplied which will be set for the generated calculation.\n\n\n\n\n\n","category":"method"},{"location":"guide/calculations/#DFControl.Calculations.gencalc_bands-Tuple{Calculation{QE}, Vector{<:NTuple{4, T} where T}, Vararg{Any}}","page":"Calculations","title":"DFControl.Calculations.gencalc_bands","text":"gencalc_bands(template::Calculation{QE}, kpoints::Vector{NTuple{4}}, newflags...; name=\"bands\")\n\nUses the information from the template and supplied kpoints to generate a bands calculation. Extra flags can be supplied which will be set for the generated calculation.\n\n\n\n\n\n","category":"method"},{"location":"guide/calculations/#DFControl.Calculations.gencalc_nscf-Tuple{Calculation{QE}, Tuple{Int64, Int64, Int64}, Vararg{Any}}","page":"Calculations","title":"DFControl.Calculations.gencalc_nscf","text":"gencalc_nscf(template::Calculation{QE}, kpoints::NTuple{3, Int}, newflags...; name=\"nscf\")\n\nUses the information from the template and supplied kpoints to generate an nscf calculation. Extra flags can be supplied which will be set for the generated calculation.\n\n\n\n\n\n","category":"method"},{"location":"guide/calculations/#DFControl.Calculations.gencalc_projwfc-Tuple{Calculation{QE}, Real, Real, Real}","page":"Calculations","title":"DFControl.Calculations.gencalc_projwfc","text":"gencalc_projwfc(template::Calculation{QE}, Emin, Emax, DeltaE, newflags...; name=\"projwfc\")\n\nUses the information from the template and supplied kpoints to generate a projwfc.x calculation. Extra flags can be supplied which will be set for the generated calculation.\n\n\n\n\n\n","category":"method"},{"location":"guide/calculations/#DFControl.Calculations.gencalc_wan","page":"Calculations","title":"DFControl.Calculations.gencalc_wan","text":"gencalc_wan(nscf::Calculation{QE}, structure::Structure, Emin, wanflags...;\n Epad = 5.0,\n wanexec = Exec(path=\"wannier90.x\"))\n\nGenerates a Wannier90 calculation to follow on the supplied nscf calculation. It uses the projections defined in the structure, and starts counting the required amount of bands from Emin. The nscf needs to have a valid output since it will be used in conjunction with Emin to find the required amount of bands and energy window for the Wannier90 calculation.\n\n\n\n\n\ngencalc_wan(job::Job, min_window_determinator::Real, extra_wan_flags...; kwargs...)\n\nAutomates the generation of wannier calculations based on the job. When a projwfc calculation is present in the job, min_window_determinator will be used to determine the threshold value for including a band in the window based on the projections, otherwise it will be used as the Emin value from which to start counting the number of bands needed for all projections. extra_wan_flags can be any extra flags for the Wannier90 calculation such as write_hr etc.\n\n\n\n\n\n","category":"function"},{"location":"#DFControl","page":"Home","title":"DFControl","text":"","category":"section"},{"location":"#Introduction","page":"Home","title":"Introduction","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"The goal of DFControl is to alleviate some of the tedious day to day busy-work that material's scientists using DFT codes encounter. It aids in the creation, execution, monitoring, management, and post-processing of DFT jobs. The core framework is code-agnostic, however, most of the convenience features are so far only implemented for Quantum-Espresso and Wannier90. ABINIT and ELK support is highly experimental and incomplete.","category":"page"},{"location":"#Philosophy","page":"Home","title":"Philosophy","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"DFControl is aimed to be user friendly first and foremost, with features being added as time progresses without changing this core value. On the other hand, a core requirement has always been that power users that know all the ins and outs of the codes that they run should be able to have all the control they want without incurring friction from the library. DFControl therefore should never be a barrier to DFT code functionality, just a tool to increase efficiency of its users.","category":"page"},{"location":"","page":"Home","title":"Home","text":"In light of this DFControl is structured to mimic the often adopted strategy of a linear submission script that specifies which input files are ran with which DFT codes producing which outputs. Everything revolves around the Job that holds a collection of Calculations which will be ran sequentially in the job's directory, on the job's crystal Structure. A Job is therefore identified with a specific directory. Using the script that is created upon saving or submitting a job, a Job can be easily reloaded at a later stage to continue the investigation where left off.","category":"page"},{"location":"#Highlighted-features","page":"Home","title":"Highlighted features","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"Creation and submission of a simple self-consistent-field calculation starting from a structure Cif file in less than 10 lines of code (see the Basic Tutorial])\nSeparation of Structure and Calculation so that the same Calculations can be copied and used with a different Structure in a new job \nAutomatic validation and conversion of input flags\nTracking of Jobs for ease of continuation at later times\nEase of calculation generation\nAutomatic plotting of available results using a single command\nInput flag sanity checks\nRudimentary Job versioning to never lose previous Job's results even if running in the same directory\nFully human readable and transparent Job directory structure ","category":"page"}] +[{"location":"guide/flags/#Flags","page":"Flags","title":"Flags","text":"","category":"section"},{"location":"guide/structure/#Structure","page":"Structure","title":"Structure","text":"","category":"section"},{"location":"guide/structure/#Contents","page":"Structure","title":"Contents","text":"","category":"section"},{"location":"guide/structure/","page":"Structure","title":"Structure","text":"Pages=[\"structure.md\"]","category":"page"},{"location":"guide/structure/#Index","page":"Structure","title":"Index","text":"","category":"section"},{"location":"guide/structure/","page":"Structure","title":"Structure","text":"Pages=[\"structure.md\"]","category":"page"},{"location":"guide/structure/","page":"Structure","title":"Structure","text":"Structure\nBase.getindex(::Structure, ::Int)\nStructures.update_geometry!\nStructures.polyhedron","category":"page"},{"location":"guide/structure/#DFControl.Structures.Structure","page":"Structure","title":"DFControl.Structures.Structure","text":"Structure(cell::Mat3, atoms::Vector{Atom})\n\nThe structure on which the Calculations will be performed.\n\nStructure(cif_file::String)\n\nCreates a Structure from the supplied cif file.\n\n\n\n\n\n","category":"type"},{"location":"guide/structure/#Base.getindex-Tuple{Structure, Int64}","page":"Structure","title":"Base.getindex","text":"getindex(structure::Structure, i::Int)\ngetindex(structure::Structure, name::Symbol)\ngetindex(structure::Structure, el::Element)\n\nReturns the ith atom in structure, or all atoms with name or are of element el.\n\n\n\n\n\n","category":"method"},{"location":"guide/structure/#DFControl.Structures.update_geometry!","page":"Structure","title":"DFControl.Structures.update_geometry!","text":"update_geometry!(str1::Structure, str2::Structure)\n\nUpdates the spatial parameters of the atoms and cell of the first structure to those found in the second.\n\n\n\n\n\n","category":"function"},{"location":"guide/structure/#DFControl.Structures.polyhedron","page":"Structure","title":"DFControl.Structures.polyhedron","text":"polyhedron(at::Atom, atoms::Vector{Atom}, order::Int)\npolyhedron(at::Atom, str::Structure, order::Int)\n\nReturns a polyhedron around the atom, i.e. the order closest atoms. The returned atoms will be ordered according to their distance to the first one. In the case of a structure rather than a set of atoms, the search will be performed over all atoms in the structure.\n\n\n\n\n\n","category":"function"},{"location":"guide/structure/#Symmetries","page":"Structure","title":"Symmetries","text":"","category":"section"},{"location":"guide/structure/","page":"Structure","title":"Structure","text":"This functionality relies on spglib to find the symmetries of the Structure and supply various related quantities.","category":"page"},{"location":"guide/structure/","page":"Structure","title":"Structure","text":"Structures.high_symmetry_kpath\nStructures.high_symmetry_kpoints\nStructures.international\nStructures.niggli_reduce\nStructures.symmetry_operators","category":"page"},{"location":"guide/structure/#DFControl.Structures.high_symmetry_kpath","page":"Structure","title":"DFControl.Structures.high_symmetry_kpath","text":"high_symmetry_kpath(s::Structure, npoints_per_segment::Int; package=QE, kwargs...)\n\nGenerates a QE bands calculation compliant high symmetry kpath, to be used with e.g. set_kpoints!(bands_calculation, kpoints). \n\n\n\n\n\n","category":"function"},{"location":"guide/structure/#DFControl.Structures.high_symmetry_kpoints","page":"Structure","title":"DFControl.Structures.high_symmetry_kpoints","text":"high_symmetry_kpoints(s::Structure; tolerance = 1e-5)\n\nReturns (kpoints, path) where kpoints are the high-symmetry k-points, and path are the sections of the high symmetry path through the first Brillouin Zone.\n\n\n\n\n\n","category":"function"},{"location":"guide/structure/#DFControl.Structures.international","page":"Structure","title":"DFControl.Structures.international","text":"international(s::Structure; tolerance=1.0e-5)\n\nReturns the international symbol of the space group of the structure.\n\n\n\n\n\n","category":"function"},{"location":"guide/structure/#DFControl.Structures.niggli_reduce","page":"Structure","title":"DFControl.Structures.niggli_reduce","text":"niggli_reduce(s::Structure; tolerance=1.0e-5)\n\nReturns the niggli reduced Structure.\n\n\n\n\n\n","category":"function"},{"location":"guide/structure/#DFControl.Structures.symmetry_operators","page":"Structure","title":"DFControl.Structures.symmetry_operators","text":"symmetry_operators(s::Structure; maxsize=52, tolerance=1.0e-5)\n\nFinds and returns all the rotations and translations that are symmetry operators of the structure.\n\n\n\n\n\n","category":"function"},{"location":"guide/structure/#Cell","page":"Structure","title":"Cell","text":"","category":"section"},{"location":"guide/structure/","page":"Structure","title":"Structure","text":"note: Note\nThe lattice vectors are stored as the columns of the cell.","category":"page"},{"location":"guide/structure/","page":"Structure","title":"Structure","text":"Structures.a\nStructures.b\nStructures.c\nStructures.cell_parameters\nStructures.volume\nStructures.create_supercell\nStructures.scale_cell!","category":"page"},{"location":"guide/structure/#DFControl.Structures.a","page":"Structure","title":"DFControl.Structures.a","text":"a(str::Structure)\n\nFirst lattice vector.\n\n\n\n\n\n","category":"function"},{"location":"guide/structure/#DFControl.Structures.b","page":"Structure","title":"DFControl.Structures.b","text":"b(str::Structure)\n\nSecond lattice vector.\n\n\n\n\n\n","category":"function"},{"location":"guide/structure/#DFControl.Structures.c","page":"Structure","title":"DFControl.Structures.c","text":"c(str::Structure)\n\nThird lattice vector.\n\n\n\n\n\n","category":"function"},{"location":"guide/structure/#DFControl.Structures.cell_parameters","page":"Structure","title":"DFControl.Structures.cell_parameters","text":"cell_parameters(cell::Mat3)\ncell_parameters(str::Structure)\n\nParameters (a, b, c, α, β, γ)of the calculation cell returned in a NamedTuple.\n\n\n\n\n\n","category":"function"},{"location":"guide/structure/#DFControl.Structures.volume","page":"Structure","title":"DFControl.Structures.volume","text":"volume(cell::Mat3)\nvolume(str::Structure)\n\nCalculates the volume for the unit cell.\n\n\n\n\n\n","category":"function"},{"location":"guide/structure/#DFControl.Structures.create_supercell","page":"Structure","title":"DFControl.Structures.create_supercell","text":"create_supercell(structure::Structure, na::Int, nb::Int, nc::Int; make_afm=false)\ncreate_supercell(structure::Structure, na::UnitRange, nb::UnitRange, nc::UnitRange; make_afm=false)\n\nTakes a structure and creates a supercell from it with: the given amount of additional cells if (na::Int, nb::Int, nc::Int) along the a, b, c direction, or amount of cells specified by the ranges i.e. -1:1, -1:1, -1:1 would create a 3x3x3 supercell. If make_afm is set to true all the labels and magnetizations of the magnetic atoms will be reversed in a checkerboard fashion.\n\n\n\n\n\n","category":"function"},{"location":"guide/structure/#DFControl.Structures.scale_cell!","page":"Structure","title":"DFControl.Structures.scale_cell!","text":"scale_cell!(structure::Structure, scalemat::Matrix)\n\nRescales the cell of the structure.\n\n\n\n\n\n","category":"function"},{"location":"guide/structure/#Atom","page":"Structure","title":"Atom","text":"","category":"section"},{"location":"guide/structure/","page":"Structure","title":"Structure","text":"Atom\nStructures.set_position!","category":"page"},{"location":"guide/structure/#DFControl.Structures.Atom","page":"Structure","title":"DFControl.Structures.Atom","text":"Atom(name::Symbol, element::Element, position_cart::Point3{Length}, position_cryst::Point3;\n pseudo::String = \"\",\n projections::Vector{Projection} = Projection[],\n magnetization::Vec3 = Vec3(0.0, 0.0, 0.0),\n dftu::DFTU = DFTU())\n\nRepresentation of an atom.\n\nThe name of the atom is used as an identifier for the atom type, in the sense that atoms with the same pseudo, projections, magnetization and dftu attributes should belong to the same type. This also means that during sanity checks atoms that are not of the same type will be given different names. This is done in this way because it often makes sense to change these parameters on all atoms of the same kind at the same time, but still allow the flexibility to change them for individual atoms as well.\n\nposition_cart should have a valid Unitful.Length type such as Ang.\n\nSee documentation for Element for further information on this attribute.\n\n\n\n\n\n","category":"type"},{"location":"guide/structure/#DFControl.Structures.set_position!","page":"Structure","title":"DFControl.Structures.set_position!","text":"set_position!(at::Atom, pos::AbstractVector{T}, unit_cell::Mat3) where {T<:Real}\n\nUpdates the position of the atom to this. The unit cell is used to make sure both position_cryst and position_cart are correct.\n\n\n\n\n\n","category":"function"},{"location":"guide/structure/#Element","page":"Structure","title":"Element","text":"","category":"section"},{"location":"guide/structure/","page":"Structure","title":"Structure","text":"Structures.Element\nelement","category":"page"},{"location":"guide/structure/#DFControl.Structures.Element","page":"Structure","title":"DFControl.Structures.Element","text":"Element(symbol::Symbol, Z::Int, name::String, atomic_weight::Float64, color::NTuple{3, Float64})\n\nRepresents an element. Most conveniently used trough the function element.\n\n\n\n\n\n","category":"type"},{"location":"guide/structure/#DFControl.Structures.element","page":"Structure","title":"DFControl.Structures.element","text":"element(sym::Symbol)\n\nReturns the predefined Element with symbol sym, i.e. element(:Si) will return the pregenerated Silicon Element.\n\n\n\n\n\n","category":"function"},{"location":"guide/structure/#pseudo_header","page":"Structure","title":"Pseudo Potentials","text":"","category":"section"},{"location":"guide/structure/","page":"Structure","title":"Structure","text":"set_pseudos!\nconfigure_pseudoset\nlist_pseudosets","category":"page"},{"location":"guide/structure/","page":"Structure","title":"Structure","text":"See the section on Configuration for a demonstration on how to set up pseudopotential sets.","category":"page"},{"location":"guide/structure/#Magnetization","page":"Structure","title":"Magnetization","text":"","category":"section"},{"location":"guide/structure/","page":"Structure","title":"Structure","text":"Magnetization can be set on a per Atom basis. It will partially determine the unique Atom types and also what calculation flags should be set in order to allow for the magnetic calculation (either colinear or non-colinear).","category":"page"},{"location":"guide/structure/#Projections","page":"Structure","title":"Projections","text":"","category":"section"},{"location":"guide/structure/","page":"Structure","title":"Structure","text":"These projections will mainly be used for generating Wannier90 inputs, and to distinguish which indices in the Wannier90 output matrices correspond to the various atoms/orbitals.","category":"page"},{"location":"guide/structure/","page":"Structure","title":"Structure","text":"Projection","category":"page"},{"location":"guide/structure/#DFControl.Structures.Projection","page":"Structure","title":"DFControl.Structures.Projection","text":"Projection(orbital::Orbital, start::Int, last::Int)\n\nA Wannier90 Projection, representing an Orbital with indices from start to last.\n\n\n\n\n\n","category":"type"},{"location":"guide/structure/#Orbitals","page":"Structure","title":"Orbitals","text":"","category":"section"},{"location":"guide/structure/","page":"Structure","title":"Structure","text":"Structures.Orbital","category":"page"},{"location":"guide/structure/#DFControl.Structures.Orbital","page":"Structure","title":"DFControl.Structures.Orbital","text":"Orbital(name::String, size::Int, l::Int, mr::Int)\n\nWannier90 orbital as defined in the Wannier90 User Guide. The name will be written in the projections block of the Wannier90 input.\n\n\n\n\n\n","category":"type"},{"location":"guide/structure/#DFT-U","page":"Structure","title":"DFT + U","text":"","category":"section"},{"location":"guide/structure/","page":"Structure","title":"Structure","text":"DFTU","category":"page"},{"location":"guide/structure/#DFControl.Structures.DFTU","page":"Structure","title":"DFControl.Structures.DFTU","text":"DFTU(;l ::Int = -1,\n U ::T = zero(T),\n J0::T = zero(T),\n α ::T = zero(T),\n β ::T = zero(T),\n J ::Vector{T} = T[zero(T)])\n\nDFT+U parameters for a given Atom.\n\n\n\n\n\n","category":"type"},{"location":"guide/servers/#servers_header","page":"Servers","title":"Servers","text":"","category":"section"},{"location":"guide/servers/","page":"Servers","title":"Servers","text":"DFControl is structure as a client-server architecture where the communication happens through a rest-API. This means that on the server-side a small daemon will run that the client will communicate with in order to load, save and submit Jobs. There are three ways to set up a server. To setup a local server, simply call Servers.configure_local and follow the prompt. A Server can also be setup by calling the constructor with a String that signifies the name of the Server, e.g. \"localhost\", or an ssh string such as \"user@domain\", which will prompt an interactive setup menu. ","category":"page"},{"location":"guide/servers/","page":"Servers","title":"Servers","text":"Alternatively, for full customization, a Server can be set up by filling out the constructor, and saving it as save(server). A previously saved Server can be loaded again through e.g. Server(\"localhost\") which will retrieve the previously saved configuration.","category":"page"},{"location":"guide/servers/","page":"Servers","title":"Servers","text":"Server\nServers.configure_local\nstart\nsave(::Server)","category":"page"},{"location":"guide/jobs/#Jobs","page":"Jobs","title":"Jobs","text":"","category":"section"},{"location":"guide/jobs/#Contents","page":"Jobs","title":"Contents","text":"","category":"section"},{"location":"guide/jobs/","page":"Jobs","title":"Jobs","text":"Pages=[\"jobs.md\"]","category":"page"},{"location":"guide/jobs/#Index","page":"Jobs","title":"Index","text":"","category":"section"},{"location":"guide/jobs/","page":"Jobs","title":"Jobs","text":"Pages=[\"jobs.md\"]","category":"page"},{"location":"guide/jobs/#Job","page":"Jobs","title":"Job","text":"","category":"section"},{"location":"guide/jobs/","page":"Jobs","title":"Jobs","text":"Job\nload(::Server, ::Job)","category":"page"},{"location":"guide/jobs/#DFControl.Jobs.Job","page":"Jobs","title":"DFControl.Jobs.Job","text":"Job(name::String, structure::Structure;\n calculations ::Vector{Calculation} = Calculation[],\n dir ::String = pwd(),\n version ::Int = last_job_version(dir),\n copy_temp_folders ::Bool = false, \n server ::String = getdefault_server(),\n environment::String =\"\")\n\nA Job embodies a set of Calculations to be ran in directory dir, with the Structure as the subject.\n\nKeywords/further attributes\n\ncalculations: calculations to calculations that will be run sequentially.\ndir: the directory where the calculations will be run.\nversion: the current version of the job.\ncopy_temp_folders: whether or not the temporary directory associated with intermediate calculation results should be copied when storing a job version. CAUTION These can be quite large.\nserver: Server where to run the Job.\nenvironment: Environment to be used for running the Job.\n\nJob(job_name::String, structure::Structure, calculations::Vector{<:Calculation}, common_flags::Pair{Symbol, <:Any}...; kwargs...)\n\nCreates a new job. The common flags will be attempted to be set in each of the calculations. The kwargs... are passed to the Job constructor. \n\nJob(job_dir::String, job_script=\"job.sh\"; version=nothing, kwargs...)\n\nLoads the job in the dir. If job_dir is not a valid job path, the previously saved jobs will be scanned for a job with a dir that partly includes job_dir. If version is specified the corresponding job version will be returned if it exists. The kwargs... will be passed to the Job constructor.\n\n\n\n\n\n","category":"type"},{"location":"guide/jobs/#RemoteHPC.load-Tuple{Server, Job}","page":"Jobs","title":"RemoteHPC.load","text":"load(server::Server, j::Job)\n\nTries to load the Job from server at directory j.dir. If no exact matching directory is found, a list of job directories that comprise j.dir will be returned.\n\n\n\n\n\n","category":"method"},{"location":"guide/jobs/#Interacting-with-calculations","page":"Jobs","title":"Interacting with calculations","text":"","category":"section"},{"location":"guide/jobs/","page":"Jobs","title":"Jobs","text":"Base.getindex(::Job, ::String)","category":"page"},{"location":"guide/jobs/#Base.getindex-Tuple{Job, String}","page":"Jobs","title":"Base.getindex","text":"getindex(job::Job, name::String)\n\nReturns the Calculation with the specified name.\n\ngetindex(job::Job, i::Integer)\n\nReturns the i'th Calculation in the job.\n\n\n\n\n\n","category":"method"},{"location":"guide/jobs/","page":"Jobs","title":"Jobs","text":"using DFControl\njob = load(Job(joinpath(@__DIR__, \"..\", \"assets\", \"job\")))","category":"page"},{"location":"guide/jobs/","page":"Jobs","title":"Jobs","text":"Example: ","category":"page"},{"location":"guide/jobs/","page":"Jobs","title":"Jobs","text":"job[\"scf\"]\njob[2]","category":"page"},{"location":"guide/jobs/","page":"Jobs","title":"Jobs","text":"Base.push!(::Job, ::Calculation)\nBase.append!(::Job, ::Any...)\nBase.pop!(::Job)\nBase.insert!(::Job, ::Int, ::Calculation)","category":"page"},{"location":"guide/jobs/#Base.push!-Tuple{Job, Calculation}","page":"Jobs","title":"Base.push!","text":"push!(job::Job, calculation::Calculation) = push!(job.calculations, calculation)\n\n\n\n\n\n","category":"method"},{"location":"guide/jobs/#Base.append!-Tuple{Job, Vararg{Any}}","page":"Jobs","title":"Base.append!","text":"append!(job::Job, args...) = append!(job.calculations, args...)\n\n\n\n\n\n","category":"method"},{"location":"guide/jobs/#Base.pop!-Tuple{Job}","page":"Jobs","title":"Base.pop!","text":"pop!(job::Job) = pop!(job.calculations)\n\n\n\n\n\n","category":"method"},{"location":"guide/jobs/#Base.insert!-Tuple{Job, Int64, Calculation}","page":"Jobs","title":"Base.insert!","text":"insert!(job::Job, i::Int, calculation::Calculation) = insert!(job.calculations, i, calculation)\n\n\n\n\n\n","category":"method"},{"location":"guide/jobs/#Scheduling,-submission-and-monitoring","page":"Jobs","title":"Scheduling, submission and monitoring","text":"","category":"section"},{"location":"guide/jobs/","page":"Jobs","title":"Jobs","text":"set_flow!\nsave(::Job)\nsubmit\nisrunning\nabort","category":"page"},{"location":"guide/jobs/#DFControl.Jobs.set_flow!","page":"Jobs","title":"DFControl.Jobs.set_flow!","text":"set_flow!(job::Job, should_runs::Pair{String, Bool}...)\n\nSets whether or not calculations should be scheduled to run. The name of each calculation in the job will be checked against the string in each pair of should_runs, and the calculation.run will be set accordingly.\n\nExample:\n\nset_flow!(job, \"\" => false, \"scf\" => true)\n\nwould un-schedule all calculations in the job, and schedule the \"scf\" and \"nscf\" calculations to run.\n\n\n\n\n\n","category":"function"},{"location":"guide/jobs/#RemoteHPC.save-Tuple{Job}","page":"Jobs","title":"RemoteHPC.save","text":"save(job::Job)\n\nSaves the job's calculations and job.sh submission script in job.dir. Some sanity checks will be performed on the validity of flags, execs, pseudopotentials, etc. The job will also be registered for easy retrieval at a later stage.\n\nIf a previous job is present in the job directory (indicated by a valid job script), it will be copied to the .versions sub directory as the previous version of job, and the version of job will be incremented. \n\n\n\n\n\n","category":"method"},{"location":"guide/jobs/#RemoteHPC.submit","page":"Jobs","title":"RemoteHPC.submit","text":"submit(job::Job)\n\nSaves and launches job. \n\n\n\n\n\n","category":"function"},{"location":"guide/jobs/#DFControl.Client.isrunning","page":"Jobs","title":"DFControl.Client.isrunning","text":"isrunning(job::Job)\nisrunning(s::Server, jobdir::String)\n\nReturns whether a job is running or not. If the job was submitted using slurm, a QUEUED status also counts as running.\n\n\n\n\n\n","category":"function"},{"location":"guide/jobs/#RemoteHPC.abort","page":"Jobs","title":"RemoteHPC.abort","text":"abort(job::Job)\n\nWill try to remove the job from the scheduler's queue. If the last running calculation happened to be a Calculation{QE}, the correct abort file will be written. For other codes the process is not smooth, and restarting is not guaranteed.\n\n\n\n\n\n","category":"function"},{"location":"guide/jobs/#Directories","page":"Jobs","title":"Directories","text":"","category":"section"},{"location":"guide/jobs/","page":"Jobs","title":"Jobs","text":"joinpath(::Job, ::Any...)\nabspath(::Job)\ncleanup(::Job)","category":"page"},{"location":"guide/jobs/#Base.Filesystem.joinpath-Tuple{Job, Vararg{Any}}","page":"Jobs","title":"Base.Filesystem.joinpath","text":"joinpath(job::Job, args...)\n\nIf the job is local this is joinpath(job.dir, args...), otherwise it will resolve the path using the Server rootdir.\n\n\n\n\n\n","category":"method"},{"location":"guide/jobs/#Base.Filesystem.abspath-Tuple{Job}","page":"Jobs","title":"Base.Filesystem.abspath","text":"abspath(job::Job, args...)\n\nIf the job is local this is abspath(job.dir), otherwise it will resolve the abspath using the Server rootdir.\n\n\n\n\n\n","category":"method"},{"location":"guide/jobs/#Registry","page":"Jobs","title":"Registry","text":"","category":"section"},{"location":"guide/jobs/","page":"Jobs","title":"Jobs","text":"All Jobs are stored in an internal registry the first time save(job) is called. This means that finding all previously worked on Jobs is as straightforward as calling load(server, Job(fuzzy)) where fuzzy is a part of the previously saved Job dir. This will then return a list of Jobs with similar directories. ","category":"page"},{"location":"guide/jobs/#Versioning","page":"Jobs","title":"Versioning","text":"","category":"section"},{"location":"guide/jobs/","page":"Jobs","title":"Jobs","text":"As previously mentioned, a rudimentary implementation of a Job versioning system is implemented. Upon calling save on a Job, if there is already a valid job script present in job.dir, it is assumed that this was a previous version of the job and the script together with all other files in job.local_dir will be copied to a subdirectory of the .versions directory bearing the name of the respective previous job version. After this, job.version will be incremented by 1 signalling the new version of the current Job. ","category":"page"},{"location":"guide/jobs/","page":"Jobs","title":"Jobs","text":"The virtue of this system is that it is possible to roll back to a previous version after possibly making breaking changes, or to pull out previous results after further experimentation was performed.","category":"page"},{"location":"guide/jobs/","page":"Jobs","title":"Jobs","text":"note: Note\nIf job.copy_temp_folders=true all possible intermediate files inside the temporary calculation directory (i.e. \"job_dir/outputs\") will be copied every time the job is saved. These can be quite large and can quickly create very large job directories. Handle with care!","category":"page"},{"location":"guide/jobs/","page":"Jobs","title":"Jobs","text":"versions\nlast_version\nswitch_version!\nrm_version!","category":"page"},{"location":"guide/jobs/#DFControl.Client.versions","page":"Jobs","title":"DFControl.Client.versions","text":"versions(job::Job)\nversions(server::Server, jobdir::String)\n\nReturs the valid versions of job.\n\n\n\n\n\nversions(job::Job)\n\nReturs the valid versions of job.\n\n\n\n\n\n","category":"function"},{"location":"guide/jobs/#DFControl.Client.last_version","page":"Jobs","title":"DFControl.Client.last_version","text":"last_version(job::Job)\nlast_version(s::Server, jobdir::String)\n\nReturns the last version number of job.\n\n\n\n\n\n","category":"function"},{"location":"guide/jobs/#DFControl.Client.switch_version!","page":"Jobs","title":"DFControl.Client.switch_version!","text":"switch_version!(job::Job[, version::Int])\n\nSwitches the version of job to one of the previously stored ones. It will save also the current version for future reference.\n\n\n\n\n\n","category":"function"},{"location":"guide/jobs/#DFControl.Client.rm_version!","page":"Jobs","title":"DFControl.Client.rm_version!","text":"rm_version!(job::Job, version::Int)\nrm_versions!(job::Job, versions::Int...)\n\nRemoves the specified versions from the job if they exist.\n\n\n\n\n\n","category":"function"},{"location":"guide/jobs/#Archiving","page":"Jobs","title":"Archiving","text":"","category":"section"},{"location":"guide/jobs/","page":"Jobs","title":"Jobs","text":"After a Job is completed, or an interesting result is achieved, it makes sense to store it for future reference. This can be achieved through the archive function. This will take the current job, and copy it to a subdirectory (specified by the second argument to archive) of the jobs/archived directory inside the DFControl config directory. The third argument is a description of this job's result.","category":"page"},{"location":"guide/jobs/","page":"Jobs","title":"Jobs","text":"note: Note\nIn order to not cause huge file transfers, all the temporary directories will first be removed before archiving.","category":"page"},{"location":"guide/jobs/","page":"Jobs","title":"Jobs","text":"Example:","category":"page"},{"location":"guide/jobs/","page":"Jobs","title":"Jobs","text":"archive(job, \"test_archived_job\", \"This is a test archived job\")","category":"page"},{"location":"guide/jobs/","page":"Jobs","title":"Jobs","text":"To query previously archived jobs one can use load(Server(\"localhost\"), Job(\"archived\")).","category":"page"},{"location":"guide/jobs/","page":"Jobs","title":"Jobs","text":"archive","category":"page"},{"location":"guide/jobs/#Output","page":"Jobs","title":"Output","text":"","category":"section"},{"location":"guide/jobs/","page":"Jobs","title":"Jobs","text":"outputdata\nreadfermi\nreadbands\nbandgap","category":"page"},{"location":"guide/jobs/#DFControl.Client.outputdata","page":"Jobs","title":"DFControl.Client.outputdata","text":"outputdata(job::Job; server = job.server, calcs::Vector{String}=String[])\n\nFinds the output files for each of the calculations of a Job, and groups all the parsed data into a dictionary.\n\n\n\n\n\n","category":"function"},{"location":"guide/jobs/#DFControl.Client.readfermi","page":"Jobs","title":"DFControl.Client.readfermi","text":"readfermi(job::Job, outdat=outputdata(job))\n\nTries to read the fermi level from a valid Calculation inside job. \n\n\n\n\n\n","category":"function"},{"location":"guide/jobs/#DFControl.Client.readbands","page":"Jobs","title":"DFControl.Client.readbands","text":"readbands(job::Job, outdat=outputdata(job))\n\nTries to read the bands from a bands calculation that is present in job.\n\n\n\n\n\n","category":"function"},{"location":"guide/jobs/#DFControl.bandgap","page":"Jobs","title":"DFControl.bandgap","text":"bandgap(bands::AbstractVector{Band}, n_electrons::Int)\nbandgap(bands::AbstractVector{Band}, fermi::Float64)\n\nCalculates the bandgap (possibly indirect) around the fermi level.\n\n\n\n\n\nbandgap(job::Job, nelec=nothing)\n\nCalculates the bandgap (possibly indirect) around the fermi level. Uses the first found bands calculation, if there is none it uses the first found nscf calculation.\n\n\n\n\n\n","category":"function"},{"location":"guide/jobs/#environments_header","page":"Jobs","title":"Environments","text":"","category":"section"},{"location":"guide/jobs/","page":"Jobs","title":"Jobs","text":"Environments specify the skeleton of the job script, i.e. which environment variables need to be set, which scheduler flags, etc.","category":"page"},{"location":"guide/jobs/","page":"Jobs","title":"Jobs","text":"Environment","category":"page"},{"location":"guide/basic_tutorial/","page":"Basic Tutorial","title":"Basic Tutorial","text":"EditURL = \"basic_tutorial.jl\"","category":"page"},{"location":"guide/basic_tutorial/#Basic-Tutorial","page":"Basic Tutorial","title":"Basic Tutorial","text":"","category":"section"},{"location":"guide/basic_tutorial/","page":"Basic Tutorial","title":"Basic Tutorial","text":"note: Note\nMake sure to first go through the Configuration steps.","category":"page"},{"location":"guide/basic_tutorial/","page":"Basic Tutorial","title":"Basic Tutorial","text":"Since DFControl is aimed at improving the day to day quality of life of a material's scientist/anyone running DFT codes, we will look at a simple demonstration of how by creating and submitting some Quantum-Espresso calculations on Si starting from a cif file specifying the structure.","category":"page"},{"location":"guide/basic_tutorial/","page":"Basic Tutorial","title":"Basic Tutorial","text":"using DFControl","category":"page"},{"location":"guide/basic_tutorial/","page":"Basic Tutorial","title":"Basic Tutorial","text":"First we download the cif file, extract the Structure and assign the right pseudos to it. In this case Si (F d -3 m :1) from http://www.crystallography.net/cod/9011998.cif","category":"page"},{"location":"guide/basic_tutorial/","page":"Basic Tutorial","title":"Basic Tutorial","text":"using Downloads\ncif_file = Downloads.download(\"http://www.crystallography.net/cod/9011998.cif\", \"Si.cif\")\n\nstructure = Structure(cif_file)\nif false#hide\nset_pseudos!(structure, load(local_server(), PseudoSet(\"pbesol\")))\nend#hide","category":"page"},{"location":"guide/basic_tutorial/","page":"Basic Tutorial","title":"Basic Tutorial","text":"This assumes that the \"pbesol\" pseudopotential set was installed during the configuration step.","category":"page"},{"location":"guide/basic_tutorial/","page":"Basic Tutorial","title":"Basic Tutorial","text":"Next we specify the executables with which to run the QE calculations. We assume here that mpirun is installed and in the user's PATH, and that QE is installed, and to be found in the /opt/qe/bin, change this according to your own setup. The first argument to the constructor can be used as a label to later retrieve the executable after it was saved.","category":"page"},{"location":"guide/basic_tutorial/","page":"Basic Tutorial","title":"Basic Tutorial","text":"pw_exec = Exec(name=\"pw\", path=\"/opt/qe/bin/pw.x\",flags=Dict(\"-nk\" => 4))","category":"page"},{"location":"guide/basic_tutorial/","page":"Basic Tutorial","title":"Basic Tutorial","text":"Then we create the first calculation for our job, we name it scf, which will be used to reference it later. We also pass the executables to be used and additional flags to be set to the constructor. Afterwards we set the kpoints to be used in the scf calculation.","category":"page"},{"location":"guide/basic_tutorial/","page":"Basic Tutorial","title":"Basic Tutorial","text":"scf_calculation = Calculation(\"scf\", :calculation => \"scf\"; exec = pw_exec)\nset_kpoints!(scf_calculation, (6, 6, 6, 1, 1, 1))","category":"page"},{"location":"guide/basic_tutorial/","page":"Basic Tutorial","title":"Basic Tutorial","text":"The code recognizes internally that this 6-Tuple corresponds to a K_POINTS (automatic) block in QE. Alternatively (leading to an identical final result):","category":"page"},{"location":"guide/basic_tutorial/","page":"Basic Tutorial","title":"Basic Tutorial","text":"scf_calculation = Calculation(\"scf\", :calculation => \"scf\"; exec = pw_exec,\n data = [InputData(:k_points, :automatic,\n (6, 6, 6, 1, 1, 1))])","category":"page"},{"location":"guide/basic_tutorial/","page":"Basic Tutorial","title":"Basic Tutorial","text":"We can now define our job: job = Job(\"Si\", structure, [scfcalculation], :ecutwfc => 20, :convthr => 1e-6; dir=\"job\") Additional calculations would be be added to the list [scf_calculation]. The flag => value pairs will set the specified flags to that value for all calculations in the job that allow recognize that flag, so it's ideal for things like cutoffs and smearing etc.","category":"page"},{"location":"guide/basic_tutorial/","page":"Basic Tutorial","title":"Basic Tutorial","text":"if false#hide\njob = Job(\"Si\", structure, [scf_calculation], :ecutwfc => 40.0, :occupations => \"smearing\", :degauss=>0.01, :conv_thr => 1e-6, :nbnd => 18;\n dir = dir, server=gethostname(), environment=\"default\")\nend#hide","category":"page"},{"location":"guide/basic_tutorial/","page":"Basic Tutorial","title":"Basic Tutorial","text":"We are now ready to submit the job, which will run in the current working directory","category":"page"},{"location":"guide/basic_tutorial/","page":"Basic Tutorial","title":"Basic Tutorial","text":"if false #hide\nsubmit(job)\nelse #hide\n global job = load(local_server(), Job(joinpath(splitdir(pathof(DFControl))[1], \"..\", \"docs\",\"src\",\"assets\", \"job\")))#hide\n pop!(job) #hide\nend #hide","category":"page"},{"location":"guide/basic_tutorial/","page":"Basic Tutorial","title":"Basic Tutorial","text":"This will generate and save all calculation files, and the corresponding job script (job.sh), to the server specified in job.server, and then the job will be submitted on the server.","category":"page"},{"location":"guide/basic_tutorial/","page":"Basic Tutorial","title":"Basic Tutorial","text":"After the job finishes the outputs can be parsed through","category":"page"},{"location":"guide/basic_tutorial/","page":"Basic Tutorial","title":"Basic Tutorial","text":"outputdata(job)","category":"page"},{"location":"guide/basic_tutorial/","page":"Basic Tutorial","title":"Basic Tutorial","text":"this returns a dictionary with the input names as keys and a Dict with parsed outputs as values. i.e.","category":"page"},{"location":"guide/basic_tutorial/","page":"Basic Tutorial","title":"Basic Tutorial","text":"outputdata(job)[\"scf\"]","category":"page"},{"location":"guide/basic_tutorial/","page":"Basic Tutorial","title":"Basic Tutorial","text":"takes the outputdata of the input that we previously named \"scf\" when creating it.","category":"page"},{"location":"guide/basic_tutorial/","page":"Basic Tutorial","title":"Basic Tutorial","text":"Now that the scf calculation finished succesfully, the next step is usually to have a look at the bandstructure. For this we generate a bands calculation, using the scf calculation as a template and a generated high symmetry k-point path with 20 kpoints per segment.","category":"page"},{"location":"guide/basic_tutorial/","page":"Basic Tutorial","title":"Basic Tutorial","text":"bands_calc = Calculations.gencalc_bands(job[\"scf\"], Structures.high_symmetry_kpath(job.structure, 20))","category":"page"},{"location":"guide/basic_tutorial/","page":"Basic Tutorial","title":"Basic Tutorial","text":"Observe the :calculation => \"bands\", and automatic setting of the :verbosity => \"high\" flags. We now push! this calculation to the job queue.","category":"page"},{"location":"guide/basic_tutorial/","page":"Basic Tutorial","title":"Basic Tutorial","text":"push!(job, bands_calc)","category":"page"},{"location":"guide/basic_tutorial/","page":"Basic Tutorial","title":"Basic Tutorial","text":"However, since we know the scf succeeded there is no need to rerun it. To un-schedule it we do","category":"page"},{"location":"guide/basic_tutorial/","page":"Basic Tutorial","title":"Basic Tutorial","text":"job[\"scf\"].run = false","category":"page"},{"location":"guide/basic_tutorial/","page":"Basic Tutorial","title":"Basic Tutorial","text":"Printing the job will now highlight the scheduled calculations differently from the non-scheduled ones","category":"page"},{"location":"guide/basic_tutorial/","page":"Basic Tutorial","title":"Basic Tutorial","text":"job","category":"page"},{"location":"guide/basic_tutorial/","page":"Basic Tutorial","title":"Basic Tutorial","text":"Seeing that all is right we submit the job again","category":"page"},{"location":"guide/basic_tutorial/","page":"Basic Tutorial","title":"Basic Tutorial","text":"job.dir = \"job\"; #hide\nif false #hide\nsubmit(job)\nelse #hide\n global job = load(local_server(),Job(joinpath(splitdir(pathof(DFControl))[1], \"..\", \"docs\",\"src\",\"assets\", \"job\")));#hide\nend #hide","category":"page"},{"location":"guide/basic_tutorial/","page":"Basic Tutorial","title":"Basic Tutorial","text":"We can access the bands through","category":"page"},{"location":"guide/basic_tutorial/","page":"Basic Tutorial","title":"Basic Tutorial","text":"bands = readbands(job);\nnothing #hide","category":"page"},{"location":"guide/basic_tutorial/","page":"Basic Tutorial","title":"Basic Tutorial","text":"or","category":"page"},{"location":"guide/basic_tutorial/","page":"Basic Tutorial","title":"Basic Tutorial","text":"bands = outputdata(job)[\"bands\"][:bands];\nnothing #hide","category":"page"},{"location":"guide/basic_tutorial/","page":"Basic Tutorial","title":"Basic Tutorial","text":"They can be plotted too","category":"page"},{"location":"guide/basic_tutorial/","page":"Basic Tutorial","title":"Basic Tutorial","text":"fermi = readfermi(job) # = outputdata(job)[\"scf\"][:fermi]\nusing Plots\nplot(bands; fermi = fermi)","category":"page"},{"location":"guide/basic_tutorial/","page":"Basic Tutorial","title":"Basic Tutorial","text":"Since more info (such as the structure) is available in the job, plotting the job leads to a richer plot","category":"page"},{"location":"guide/basic_tutorial/","page":"Basic Tutorial","title":"Basic Tutorial","text":"plot(job, -10, 1)","category":"page"},{"location":"guide/basic_tutorial/","page":"Basic Tutorial","title":"Basic Tutorial","text":"As can be seen in the Advanced Usage, additional information generated by additional calculations will be picked up by DFControl in order to create richer plots.","category":"page"},{"location":"guide/installation/#Installation","page":"Installation","title":"Installation","text":"","category":"section"},{"location":"guide/installation/","page":"Installation","title":"Installation","text":"In case you don't have a working Julia installation yet, first download the Julia binaries and follow the Julia installation instructions.","category":"page"},{"location":"guide/installation/","page":"Installation","title":"Installation","text":"note: Note\nDFControl requires Julia 1.6 or newer, the server side functionality will not work with older versions.","category":"page"},{"location":"guide/installation/","page":"Installation","title":"Installation","text":"Afterwards you can install DFControl like any other package in Julia. For example run in your Julia REPL terminal:","category":"page"},{"location":"guide/installation/","page":"Installation","title":"Installation","text":"import Pkg\nPkg.add(\"DFControl\")","category":"page"},{"location":"guide/installation/","page":"Installation","title":"Installation","text":"which will install the latest DFControl release. Alternatively (if you like to be fully up to date) install the master branch:","category":"page"},{"location":"guide/installation/","page":"Installation","title":"Installation","text":"import Pkg\nPkg.add(name=\"DFControl\", rev=\"master\")","category":"page"},{"location":"guide/installation/","page":"Installation","title":"Installation","text":"DFControl is continuously tested on Debian, Ubuntu, mac OS and Windows and should work on these operating systems out of the box.","category":"page"},{"location":"guide/installation/","page":"Installation","title":"Installation","text":"After these steps it is highly recommended to go through some additional Configuration.","category":"page"},{"location":"guide/configuration/#Configuration","page":"Configuration","title":"Configuration","text":"","category":"section"},{"location":"guide/configuration/#[Servers](@ref-servers_header)","page":"Configuration","title":"Servers","text":"","category":"section"},{"location":"guide/configuration/","page":"Configuration","title":"Configuration","text":"Since DFControl utilizes a client-server rest-api model, each server will have its own local deamon running, which stores certain server-side items such as pseudopotentials, Environments and Execs.","category":"page"},{"location":"guide/configuration/","page":"Configuration","title":"Configuration","text":"Make sure that both julia and DFControl are installed on the target remote server before trying to create a connection to it. Also, it is necessary that your ssh keys are registered on the remote so that no passwords are required for ssh connections.","category":"page"},{"location":"guide/configuration/","page":"Configuration","title":"Configuration","text":"To up a new Server, in this case with name = \"daint\" an interactive menu can be called like:","category":"page"},{"location":"guide/configuration/","page":"Configuration","title":"Configuration","text":"Server(\"daint\")","category":"page"},{"location":"guide/configuration/","page":"Configuration","title":"Configuration","text":"This will set up all the required information and store it for later use. To start a Server simply call start(server), which will launch the daemon externally. Make sure that the host address points to a persistent server, i.e. if a cluster has multiple frontend nodes, find the ip address of one particular one, and set that one as the host address. During the setup of an external server, it may ask whether a local_tunnel should be created. If enabled, a persistent ssh tunnel will be created from the local machine to the target host through which the http requests will be sent. This is useful when the remote is behind an authentication firewall.","category":"page"},{"location":"guide/configuration/","page":"Configuration","title":"Configuration","text":"To reconfigure a Server you can always do:","category":"page"},{"location":"guide/configuration/","page":"Configuration","title":"Configuration","text":"s = Server(\"daint\")\ns.root_jobdir = \"\"\nsave(s)","category":"page"},{"location":"guide/configuration/","page":"Configuration","title":"Configuration","text":"If a Server was running first stop it using kill(server).","category":"page"},{"location":"guide/configuration/#Pseudopotentials","page":"Configuration","title":"Pseudopotentials","text":"","category":"section"},{"location":"guide/configuration/","page":"Configuration","title":"Configuration","text":"Pseudopotentials are grouped in sets, which are stored for later ease of use. They can be set up using the configure_pseudoset function.","category":"page"},{"location":"guide/configuration/","page":"Configuration","title":"Configuration","text":"configure_pseudoset(local_server(), \"set_name\", \"/dir/to/pseudos\")","category":"page"},{"location":"guide/configuration/","page":"Configuration","title":"Configuration","text":"This will go through the specified directories and find files that follow the naming convention element.x_y_z.xyz e.g. Si.pbesol-n-kjpaw_psl.0.1.UPF or si.pbesol-n-kjpaw_psl.0.1.UPF. If multiple are found, all will be stored and the required one can be later specified.","category":"page"},{"location":"guide/configuration/","page":"Configuration","title":"Configuration","text":"The pseudos will remain on the server where they are stored, and can be listed using list_pseudosets. See Pseudo Potentials for further usage details.","category":"page"},{"location":"guide/configuration/","page":"Configuration","title":"Configuration","text":"configure_pseudoset\nlist_pseudosets\nrm_pseudoset!","category":"page"},{"location":"guide/configuration/#DFControl.Client.configure_pseudoset","page":"Configuration","title":"DFControl.Client.configure_pseudoset","text":"configure_pseudoset(set_name::String, dir::String)\n\nReads the specified dir and sets up the pseudos for set.\n\n\n\n\n\n","category":"function"},{"location":"guide/configuration/#[Environments](@ref-environments_header)","page":"Configuration","title":"Environments","text":"","category":"section"},{"location":"guide/configuration/","page":"Configuration","title":"Configuration","text":"Environments specify the skeleton of the job script, i.e. which environment variables need to be set, which scheduler flags, etc. Here we will set up an environment and save it on the local Server. Change the information according to your own setup.","category":"page"},{"location":"guide/configuration/","page":"Configuration","title":"Configuration","text":"e = Environment(name=\"default\", parallel_exec=Exec(exec=\"mpirun\", flags=Dict(\"-np\"=> 4), directives=Dict(\"N\" => 1, \"partition\" => \"parallel\"), exports=Dict(\"OMP_NUM_THREADS\"=>1)))\nsave(local_server(), e)","category":"page"},{"location":"guide/configuration/#[Execs](@ref-execs_header)","page":"Configuration","title":"Execs","text":"","category":"section"},{"location":"guide/configuration/","page":"Configuration","title":"Configuration","text":"An Exec embodies an executable as the name suggests. They hold both the executable, directory and modules required to run the executable. Similar to Environments, they are stored on the server for later use. When storing it is verified that they are able to run.","category":"page"},{"location":"guide/configuration/","page":"Configuration","title":"Configuration","text":"e = Exec(name=\"pw\", exec=\"pw.x\", dir=\"/home/user/Softare/qe/bin\", modules = [\"intel\", \"intel-mpi\", \"intel-mkl\"])\nsave(local_server(), e)","category":"page"},{"location":"guide/configuration/#Loading/Saving","page":"Configuration","title":"Loading/Saving","text":"","category":"section"},{"location":"guide/configuration/","page":"Configuration","title":"Configuration","text":"As shown above there are three main methods related to storing and retrieving data i.e.:","category":"page"},{"location":"guide/configuration/","page":"Configuration","title":"Configuration","text":"DFControl.Client.RemoteHPC.load\nDFControl.Client.RemoteHPC.save","category":"page"},{"location":"guide/configuration/#RemoteHPC.load","page":"Configuration","title":"RemoteHPC.load","text":"load(server::Server, j::Job)\n\nTries to load the Job from server at directory j.dir. If no exact matching directory is found, a list of job directories that comprise j.dir will be returned.\n\n\n\n\n\n","category":"function"},{"location":"guide/configuration/#RemoteHPC.save","page":"Configuration","title":"RemoteHPC.save","text":"save(job::Job)\n\nSaves the job's calculations and job.sh submission script in job.dir. Some sanity checks will be performed on the validity of flags, execs, pseudopotentials, etc. The job will also be registered for easy retrieval at a later stage.\n\nIf a previous job is present in the job directory (indicated by a valid job script), it will be copied to the .versions sub directory as the previous version of job, and the version of job will be incremented. \n\n\n\n\n\n","category":"function"},{"location":"guide/configuration/","page":"Configuration","title":"Configuration","text":"After completing this configuration, it is suggested to look at the (Basic Usage)[@ref] for an introduction to the basic usage of DFControl.","category":"page"},{"location":"api/#API-reference","page":"API reference","title":"API reference","text":"","category":"section"},{"location":"api/","page":"API reference","title":"API reference","text":"This page provides a plain list of all inline documention associated with functions, structs and macros in DFControl. Note that this list is neither structured, complete nor particularly clean, so it only provides rough orientation at the moment. The best reference is the code itself.","category":"page"},{"location":"guide/advanced_tutorial/","page":"Advanced Tutorial","title":"Advanced Tutorial","text":"EditURL = \"advanced_tutorial.jl\"","category":"page"},{"location":"guide/advanced_tutorial/#Advanced-Usage","page":"Advanced Tutorial","title":"Advanced Usage","text":"","category":"section"},{"location":"guide/advanced_tutorial/","page":"Advanced Tutorial","title":"Advanced Tutorial","text":"In this tutorial we will continue from the job created in the Basic Tutorial, and demonstrate some more advanced functionality that DFControl offers.","category":"page"},{"location":"guide/advanced_tutorial/","page":"Advanced Tutorial","title":"Advanced Tutorial","text":"To load a previously saved job we here provide a valid job directory with a job.sh script in it.","category":"page"},{"location":"guide/advanced_tutorial/","page":"Advanced Tutorial","title":"Advanced Tutorial","text":"using DFControl\n\ntjob = load(local_server(),Job(joinpath(splitdir(pathof(DFControl))[1], \"..\", \"docs\",\"src\",\"assets\", \"job\")))#hide\ntjob2 = load(local_server(),Job(joinpath(splitdir(pathof(DFControl))[1], \"..\", \"docs\",\"src\",\"assets\", \"Job2\")))#hide\nif false#hide\njob = load(local_server(), Job(\"job\"))\nelse#hide\n global job = deepcopy(tjob)#hide\n job.dir= \"job\" #hide\n job#hide\nend#hide","category":"page"},{"location":"guide/advanced_tutorial/","page":"Advanced Tutorial","title":"Advanced Tutorial","text":"Since the job created in the Basic Tutorial was saved in the \"job\" directory this will work, see the section on Jobs for further details and options on how to load previously saved jobs.","category":"page"},{"location":"guide/advanced_tutorial/","page":"Advanced Tutorial","title":"Advanced Tutorial","text":"The next thing we may want to do is to change the directory where the job is running.","category":"page"},{"location":"guide/advanced_tutorial/","page":"Advanced Tutorial","title":"Advanced Tutorial","text":"if false#hide\njob.dir = \"Job2\"\nelse#hide\n global job = deepcopy(tjob2)#hide\n pop!(job)#hide\n pop!(job)#hide\n job#hide\nend#hide","category":"page"},{"location":"guide/advanced_tutorial/","page":"Advanced Tutorial","title":"Advanced Tutorial","text":"With the copy=true flag we let DFControl know that not only to create and set the new directory, but also to copy the previous results and temporary files to the new directory so we don't have to rerun the scf calculation.","category":"page"},{"location":"guide/advanced_tutorial/","page":"Advanced Tutorial","title":"Advanced Tutorial","text":"Next we would like to plot the projected density of states. For that we create both an nscf calculation to get a uniform k-grid, and projwfc calculation.","category":"page"},{"location":"guide/advanced_tutorial/","page":"Advanced Tutorial","title":"Advanced Tutorial","text":"push!(job, Calculations.gencalc_nscf(job[\"scf\"], (6, 6, 6)))","category":"page"},{"location":"guide/advanced_tutorial/","page":"Advanced Tutorial","title":"Advanced Tutorial","text":"The second argument of gencalc_nscf is the kgrid. When passing a 3-Tuple, the code will assume that an explicit k-grid is requested, which can be verified by","category":"page"},{"location":"guide/advanced_tutorial/","page":"Advanced Tutorial","title":"Advanced Tutorial","text":"data(job[\"nscf\"], :k_points)","category":"page"},{"location":"guide/advanced_tutorial/","page":"Advanced Tutorial","title":"Advanced Tutorial","text":"Next we generate a projwfc calculation using the fermi level as a guide for the energy window. The arguments are structured as (template, Emin, Emax, deltaE) respectively.","category":"page"},{"location":"guide/advanced_tutorial/","page":"Advanced Tutorial","title":"Advanced Tutorial","text":"fermi = readfermi(job)\npush!(job, Calculations.gencalc_projwfc(job[\"nscf\"], fermi - 10, fermi + 1, 0.1))","category":"page"},{"location":"guide/advanced_tutorial/","page":"Advanced Tutorial","title":"Advanced Tutorial","text":"Next we disable the bands calculation and run the new ones.","category":"page"},{"location":"guide/advanced_tutorial/","page":"Advanced Tutorial","title":"Advanced Tutorial","text":"job[\"bands\"].run = false\nif false#hide\n submit(job)\nelse#hide\n global job = deepcopy(tjob2)#hide\nend#hide","category":"page"},{"location":"guide/advanced_tutorial/#results_plotting","page":"Advanced Tutorial","title":"Plot Results","text":"","category":"section"},{"location":"guide/advanced_tutorial/","page":"Advanced Tutorial","title":"Advanced Tutorial","text":"using Plots\nplot(job, -10, 1)","category":"page"},{"location":"guide/advanced_tutorial/","page":"Advanced Tutorial","title":"Advanced Tutorial","text":"As we can see, again DFControl identifies the additional information that is now present in the job, and uses it to display in the plot.","category":"page"},{"location":"guide/advanced_tutorial/","page":"Advanced Tutorial","title":"Advanced Tutorial","text":"In the demonstrated case we see that everything went according to plan, however, often things need to be changed in a trial and error way until the desired results are found.","category":"page"},{"location":"guide/advanced_tutorial/","page":"Advanced Tutorial","title":"Advanced Tutorial","text":"On common occurence is that calculation flags have to be set, or changed. This can be done in two ways","category":"page"},{"location":"guide/advanced_tutorial/","page":"Advanced Tutorial","title":"Advanced Tutorial","text":"job[:ecutwfc] = 40.0","category":"page"},{"location":"guide/advanced_tutorial/","page":"Advanced Tutorial","title":"Advanced Tutorial","text":"will go through all the calculations of the job and set the flag if it is allowed, i.e. the flag will not be set in the projwfc calculation since it makes no sense.","category":"page"},{"location":"guide/advanced_tutorial/","page":"Advanced Tutorial","title":"Advanced Tutorial","text":"job[\"bands\"][:nbnd] = 30","category":"page"},{"location":"guide/advanced_tutorial/","page":"Advanced Tutorial","title":"Advanced Tutorial","text":"This will set a flag for one specific calculation, again checking whether the flag is valid, and the type will be converted to the correct one.","category":"page"},{"location":"guide/advanced_tutorial/","page":"Advanced Tutorial","title":"Advanced Tutorial","text":"In order to quickly specify what calculations to schedule and which not, one can use","category":"page"},{"location":"guide/advanced_tutorial/","page":"Advanced Tutorial","title":"Advanced Tutorial","text":"Jobs.set_flow!(job, \"\" => false, \"scf\" => true)","category":"page"},{"location":"guide/advanced_tutorial/","page":"Advanced Tutorial","title":"Advanced Tutorial","text":"As we can see, only the scf and nscf calculations are scheduled to run now, this is because for each of the pairs in the arguments of set_flow!, every calculation inside the job for which the string occurs in the name will be set to run or not depending on the Bool.","category":"page"},{"location":"guide/calculations/#Calculations","page":"Calculations","title":"Calculations","text":"","category":"section"},{"location":"guide/calculations/#Contents","page":"Calculations","title":"Contents","text":"","category":"section"},{"location":"guide/calculations/","page":"Calculations","title":"Calculations","text":"Pages=[\"calculations.md\"]","category":"page"},{"location":"guide/calculations/#Index","page":"Calculations","title":"Index","text":"","category":"section"},{"location":"guide/calculations/","page":"Calculations","title":"Calculations","text":"Pages=[\"calculations.md\"]","category":"page"},{"location":"guide/calculations/","page":"Calculations","title":"Calculations","text":"Calculation\nInputData","category":"page"},{"location":"guide/calculations/#DFControl.Calculations.Calculation","page":"Calculations","title":"DFControl.Calculations.Calculation","text":"Calculation{P<:Package}(name ::String;\n flags ::AbstractDict = Dict{Symbol, Any}(),\n data ::Vector{InputData} = InputData[],\n exec ::Exec,\n run ::Bool = true,\n infile ::String = P == Wannier90 ? name * \".win\" : name * \".in\",\n outfile ::String = name * \".out\")\n\nThe representation of a DFT calculation of package P, holding the flags that will be written to the infile, the executable exec and the output written by the calculation to the outfile. It essentially represents a line in a job script similar to exec < infile.in > outfile.out. outdata stores the parsed calculation output after it was read at least once. The run field indicates whether the calculation should be actually performed, e.g. if run=false the corresponding line will be commented out in the job script.\n\nCalculation{P<:Package}(name::AbstractString, flags::Pair{Symbol, Any}...; kwargs...)\n\nCreate a Calculation from name and flags, other kwargs... will be passed to the constructor.\n\nCalculation(template::Calculation, name::AbstractString, flags::Pair{Symbol, Any}...; excs=deepcopy(template.exec), run=true, data=nothing)\n\nCreates a new Calculation from the template, setting the flags of the newly created one to the specified ones.\n\n\n\n\n\n","category":"type"},{"location":"guide/calculations/#DFControl.Calculations.InputData","page":"Calculations","title":"DFControl.Calculations.InputData","text":"InputData(name::Symbol, option::Symbol, data::Any)\n\nRepresents a more structured block of input data. e.g. InputData(:k_points, :automatic, (6,6,6,1,1,1)) would be translated for a QE calculation into\n\nK_POINTS(automatic)\n6 6 6 1 1 1\n\n\n\n\n\n","category":"type"},{"location":"guide/calculations/#Basic-interaction","page":"Calculations","title":"Basic interaction","text":"","category":"section"},{"location":"guide/calculations/","page":"Calculations","title":"Calculations","text":"Calculations.set_name!\nCalculations.data\nCalculations.set_kpoints!","category":"page"},{"location":"guide/calculations/#DFControl.Calculations.set_name!","page":"Calculations","title":"DFControl.Calculations.set_name!","text":"set_name!(c::Calculation, name::AbstractString)\n\nSets calculation.name, and calculation.infile and calculation.outfile to conform with the new name.\n\n\n\n\n\n","category":"function"},{"location":"guide/calculations/#DFControl.Calculations.data","page":"Calculations","title":"DFControl.Calculations.data","text":"data(calculation::Calculation, n::Symbol)\n\nThe former returns calculation.data, the later – the InputData with name n.\n\n\n\n\n\n","category":"function"},{"location":"guide/calculations/#DFControl.Calculations.set_kpoints!","page":"Calculations","title":"DFControl.Calculations.set_kpoints!","text":"set_kpoints!(calculation::Calculation{QE}, k_grid::NTuple{3, Int}; print=true)\nset_kpoints!(calculation::Calculation{QE}, k_grid::NTuple{6, Int}; print=true)\nset_kpoints!(calculation::Calculation{QE}, k_grid::Vector{<:NTuple{4}}; print=true, k_option=:crystal_b)\n\nConvenience function to set the :k_points data block of calculation. The three different methods are targeted at nscf, scf or vcrelax, and bands calculations, respectively. For the nscf version an explicit list of k_points will be generated.\n\nset_kpoints!(calculation::Calculation{Wannier90}, k_grid::NTuple{3, Int})\n\nSimilar to the nscf targeted function in the sense that it will generate an explicit list of k_points, adhering to the same rules as for the nscf. The mp_grid flag will also automatically be set.\n\n\n\n\n\n","category":"function"},{"location":"guide/calculations/#Flags","page":"Calculations","title":"Flags","text":"","category":"section"},{"location":"guide/calculations/","page":"Calculations","title":"Calculations","text":"A big part of working with DFT calculations is specifying the various calculation flags. Remembering all the names of the flags, where they belong, and what types they are expected to be, is quite complicated and can lead to easily made mistakes like typos. DFControl tries to catch these as it knows which flags are allowed for which calculations. It will report when a flag can not be found for a given Calculation, and it will also try to convert a flag value to the expected type.","category":"page"},{"location":"guide/calculations/","page":"Calculations","title":"Calculations","text":"A Calculation behaves a lot as a normal Dict to interact with the stored flags. This means that the usual Dict operations such as haskey, get, and pop! work on a Calculation.","category":"page"},{"location":"guide/calculations/","page":"Calculations","title":"Calculations","text":"Base.getindex(::Calculation, ::Symbol)\nBase.setindex!(::Calculation, ::Symbol, ::Any)\nCalculations.set_flags!","category":"page"},{"location":"guide/calculations/#Base.getindex-Tuple{Calculation, Symbol}","page":"Calculations","title":"Base.getindex","text":"getindex(c::Calculation, n::Symbol)\n\nReturns the flag with given symbol.\n\ngetindex(job::Job, flag::Symbol)\n\nSearches through the job's calculations for the requested flag. A Dict will be returned with calculation names as the keys and the flags as values.\n\n\n\n\n\n","category":"method"},{"location":"guide/calculations/#Base.setindex!-Tuple{Calculation, Symbol, Any}","page":"Calculations","title":"Base.setindex!","text":"setindex!(c::Calculation, value, flag::Symbol)\n\nSets flags.\n\nsetindex!(job::Job, value, flag::Symbol)\n\nSet flag in all the appropriate calculations to the value.\n\n\n\n\n\n","category":"method"},{"location":"guide/calculations/#DFControl.Calculations.set_flags!","page":"Calculations","title":"DFControl.Calculations.set_flags!","text":"set_flags!(c::Calculation, flags::Pair{Symbol, Any}...; print=true, force=false)\n\nSets multiple flags in one go. Flag validity and type are verified.\n\nset_flags!(job::Job, calculations::Vector{<:Calculation}, flags::Pair{Symbol,<:Any}...; print=true)\nset_flags!(job::Job, flags::Pair{Symbol,<:Any}...; print=true)\n\nSets the flags in the names to the flags specified. This only happens if the specified flags are valid for the names.\n\n\n\n\n\n","category":"function"},{"location":"guide/calculations/#execs_header","page":"Calculations","title":"Execs","text":"","category":"section"},{"location":"guide/calculations/","page":"Calculations","title":"Calculations","text":"Exec","category":"page"},{"location":"guide/calculations/#calculation_generation","page":"Calculations","title":"Generating new calculations","text":"","category":"section"},{"location":"guide/calculations/","page":"Calculations","title":"Calculations","text":"Calculations.gencalc_vcrelax(::Calculation{QE}, ::NTuple{6, Int}, ::Any...)\nCalculations.gencalc_scf(::Calculation{QE}, ::NTuple{6, Int}, ::Any...)\nCalculations.gencalc_bands(::Calculation{QE}, ::Vector{<:NTuple{4}}, ::Any...)\nCalculations.gencalc_nscf(::Calculation{QE}, kpoints::NTuple{3, Int}, ::Any...)\nCalculations.gencalc_projwfc(::Calculation{QE}, ::Real, ::Real, ::Real)\nCalculations.gencalc_wan","category":"page"},{"location":"guide/calculations/#DFControl.Calculations.gencalc_vcrelax-Tuple{Calculation{QE}, NTuple{6, Int64}, Vararg{Any}}","page":"Calculations","title":"DFControl.Calculations.gencalc_vcrelax","text":"gencalc_vcrelax(template::Calculation{<:AbstractQE}, kpoints::NTuple{6, Int}, newflags...; name=\"scf\")\n\nUses the information from the template and supplied kpoints to generate a vcrelax calculation. Extra flags can be supplied which will be set for the generated calculation.\n\n\n\n\n\n","category":"method"},{"location":"guide/calculations/#DFControl.Calculations.gencalc_scf-Tuple{Calculation{QE}, NTuple{6, Int64}, Vararg{Any}}","page":"Calculations","title":"DFControl.Calculations.gencalc_scf","text":"gencalc_scf(template::Calculation{<:AbstractQE}, kpoints::NTuple{6, Int}, newflags...; name=\"scf\")\n\nUses the information from the template and supplied kpoints to generate an scf calculation. Extra flags can be supplied which will be set for the generated calculation.\n\n\n\n\n\n","category":"method"},{"location":"guide/calculations/#DFControl.Calculations.gencalc_bands-Tuple{Calculation{QE}, Vector{<:NTuple{4, T} where T}, Vararg{Any}}","page":"Calculations","title":"DFControl.Calculations.gencalc_bands","text":"gencalc_bands(template::Calculation{<:AbstractQE}, kpoints::Vector{NTuple{4}}, newflags...; name=\"bands\")\n\nUses the information from the template and supplied kpoints to generate a bands calculation. Extra flags can be supplied which will be set for the generated calculation.\n\n\n\n\n\n","category":"method"},{"location":"guide/calculations/#DFControl.Calculations.gencalc_nscf-Tuple{Calculation{QE}, Tuple{Int64, Int64, Int64}, Vararg{Any}}","page":"Calculations","title":"DFControl.Calculations.gencalc_nscf","text":"gencalc_nscf(template::Calculation{<:AbstractQE}, kpoints::NTuple{3, Int}, newflags...; name=\"nscf\")\n\nUses the information from the template and supplied kpoints to generate an nscf calculation. Extra flags can be supplied which will be set for the generated calculation.\n\n\n\n\n\n","category":"method"},{"location":"guide/calculations/#DFControl.Calculations.gencalc_projwfc-Tuple{Calculation{QE}, Real, Real, Real}","page":"Calculations","title":"DFControl.Calculations.gencalc_projwfc","text":"gencalc_projwfc(template::Calculation{<:AbstractQE}, Emin, Emax, DeltaE, newflags...; name=\"projwfc\")\n\nUses the information from the template and supplied kpoints to generate a projwfc.x calculation. Extra flags can be supplied which will be set for the generated calculation.\n\n\n\n\n\n","category":"method"},{"location":"guide/calculations/#DFControl.Calculations.gencalc_wan","page":"Calculations","title":"DFControl.Calculations.gencalc_wan","text":"gencalc_wan(job::Job, min_window_determinator::Real, extra_wan_flags...; kwargs...)\n\nAutomates the generation of wannier calculations based on the job. When a projwfc calculation is present in the job, min_window_determinator will be used to determine the threshold value for including a band in the window based on the projections, otherwise it will be used as the Emin value from which to start counting the number of bands needed for all projections. extra_wan_flags can be any extra flags for the Wannier90 calculation such as write_hr etc.\n\n\n\n\n\ngencalc_wan(nscf::Calculation{QE}, structure::Structure, Emin, wanflags...;\n Epad = 5.0,\n wanexec = Exec(path=\"wannier90.x\"))\n\nGenerates a Wannier90 calculation to follow on the supplied nscf calculation. It uses the projections defined in the structure, and starts counting the required amount of bands from Emin. The nscf needs to have a valid output since it will be used in conjunction with Emin to find the required amount of bands and energy window for the Wannier90 calculation.\n\n\n\n\n\n","category":"function"},{"location":"#DFControl","page":"Home","title":"DFControl","text":"","category":"section"},{"location":"#Introduction","page":"Home","title":"Introduction","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"The goal of DFControl is to alleviate some of the tedious day to day busy-work that material's scientists using DFT codes encounter. It aids in the creation, execution, monitoring, management, and post-processing of DFT jobs. The core framework is code-agnostic, however, most of the convenience features are so far only implemented for Quantum-Espresso and Wannier90. ABINIT and ELK support is highly experimental and incomplete.","category":"page"},{"location":"#Philosophy","page":"Home","title":"Philosophy","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"DFControl is aimed to be user friendly first and foremost, with features being added as time progresses without changing this core value. On the other hand, a core requirement has always been that power users that know all the ins and outs of the codes that they run should be able to have all the control they want without incurring friction from the library. DFControl therefore should never be a barrier to DFT code functionality, just a tool to increase efficiency of its users.","category":"page"},{"location":"","page":"Home","title":"Home","text":"In light of this DFControl is structured to mimic the often adopted strategy of a linear submission script that specifies which input files are ran with which DFT codes producing which outputs. Everything revolves around the Job that holds a collection of Calculations which will be ran sequentially in the job's directory, on the job's crystal Structure. A Job is therefore identified with a specific directory. Using the script that is created upon saving or submitting a job, a Job can be easily reloaded at a later stage to continue the investigation where left off.","category":"page"},{"location":"#Highlighted-features","page":"Home","title":"Highlighted features","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"Creation and submission of a simple self-consistent-field calculation starting from a structure Cif file in less than 10 lines of code (see the Basic Tutorial])\nSeparation of Structure and Calculation so that the same Calculations can be copied and used with a different Structure in a new job \nAutomatic validation and conversion of input flags\nTracking of Jobs for ease of continuation at later times\nEase of calculation generation\nAutomatic plotting of available results using a single command\nInput flag sanity checks\nRudimentary Job versioning to never lose previous Job's results even if running in the same directory\nFully human readable and transparent Job directory structure ","category":"page"}] }