Skip to content

Commit

Permalink
update version and README
Browse files Browse the repository at this point in the history
  • Loading branch information
louisponet committed Jun 20, 2021
1 parent b85e799 commit ef5a995
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 90 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Expand Up @@ -2,7 +2,7 @@ name = "DFControl"
uuid = "1e31e15d-4957-550d-a244-318eced754ae"
authors = ["Louis Ponet <louisponet@gmail.com>"]
repo = "https://github.com/louisponet/DFControl.jl.git"
version = "0.2.1"
version = "0.3.0"

[deps]
BinDeps = "9e28174c-4ba2-5203-b857-d8d62c4213ee"
Expand Down
93 changes: 4 additions & 89 deletions README.md
Expand Up @@ -2,6 +2,7 @@
[![Build Status](https://travis-ci.com/louisponet/DFControl.jl.svg?branch=master)](https://travis-ci.com/louisponet/DFControl.jl)
[![Build status](https://ci.appveyor.com/api/projects/status/05vktbyj39u47usa?svg=true)](https://ci.appveyor.com/project/louisponet/dfcontrol-jl)
[![Coverage Status](https://coveralls.io/repos/github/louisponet/DFControl.jl/badge.svg?branch=master)](https://coveralls.io/github/louisponet/DFControl.jl?branch=master)
[![](https://img.shields.io/badge/docs-stable-blue.svg)](https://louisponet.github.io/DFControl.jl/v0.3.0)
[![](https://img.shields.io/badge/docs-latest-blue.svg)](https://louisponet.github.io/DFControl.jl/dev)

This package is a tool to interact with DFT related packages. Currently best support is for Quantum-Espresso and WANNIER90.
Expand All @@ -10,95 +11,9 @@ There is some integration with Juno, namely the display of various Types is spec

## Installation

This package is registered, but the recommended way to install it is by:
This package is registered, so as any normal Julia package:
```julia
Pkg.clone("https://github.com/louisponet/DFControl.jl.git")
Pkg.build("DFControl")
Pkg.add("DFControl")
```
Since the package has changed quite a lot since the last release.

This will create a directory `user_defaults` with file `user_defaults.jl` inside the `DFControl` source folder. This is done because it allows one to define certain variables and defaults that will get loaded when `using DFControl` is called. The main use for this is to define various defaults, which make a lot of actions more streamlined.

## Defaults/Setup

After installation it is recommended to define a couple of those defaults.
```julia
using DFControl
```
default server:
```julia
setdefault_server("blabla@server.com") #default server
```

default pseudo potentials:
this defines a directory on the server to look through for the pseudo potentials for each element. This will be used for certain options when changing atom properties etc.
```julia
setdefault_pseudodir(:pbesol, "pseudos/pbesol/") #change to your pseudo_set_name and directory of choice
setdefault_pseudodir(:pbesolrel, "pseudos/pbesolrel/")
#more sets can be defined
```

followed by the actual loading of the various pseudo filenames:
```julia
configuredefault_pseudos()
```
This will then connect to the server, look through all the defined pseudo sets inside the `default_pseudos` and tries to link for each element, for each set the correct filename.
To find out the filename of a certain atom for a certain pseudo set, or to check whether your config worked, you can do:
```julia
getdefault_pseudo(:O, :pbesolrel) #again change `pbesolrel` to the set you defined before
```
This should return you the filename for the pseudo potential file of Oxygen, `:O`, the format for elements in general is e.g. `:Mn`.
If multiple pseudos are defined for one set and element, you can specify keyword `pseudo_fuzzy = ...` to pull out the one you want to use.
For more info on other default functionality please look in the documentation and examples.

## General Usage

The main types in around which the package revolves are the `DFJob`, `DFCalculation`.
A `DFJob` is comprised of a `Structure`, representing the structure that is simulated in the job, and a collection of calculations to be done. Other fields in `DFJob` are auxiliary properties, such as name, directories, etc.

At this point, the main way the package works is by reading slurm job scripts such as the `test/test_job/job.tt` one.
What is most important for succesfully parsing these is the format used in the lines that do the actual calculations, i.e. `runcommand exec <input_file.in> output_file.out`, for example: `mpirun -np 24 ~/bin/projwfc.x <projwfc.in> projwfc.out`.
The parsing is sort of robust but one should probably stick to this format.
All other not recognized lines will be saved in the `header` field of the `DFJob`.
The calculations in commented out lines will also be read and loaded, but they will have a field `DFCalculation.run=false`.
When the `job.tt` file gets written upon saving of the `DFJob`, calculations which are marked to not run will be written in the `job.tt` file, but be commented out.

As a quick start to see this in action you can do (Juno is highly recommended, for reading clarity)
```julia
job = DFJob(joinpath(dirname(pathof("DFControl")), "..", "test/test_job/"))
```

It will automatically look through the directory for a file which matches the fuzzy `*job*`. This can be specified through kwargs, further info in the documentation and examples.

To do something similar on a directory on a server, you can do
```julia
job = DFJob("path/to/job/starting_from_home", "local_dir", server=getdefault_server())
```
If the `local_dir` doesn't exist it will be first created before pulling the `job` script and the calculations that it read from this file.

If you ran some calculations, you should be able to pull the outputs into the `local_dir` of the `job`, followed by reading them:
```julia
outs = pulloutputs(job)
outdata= outputdata(job)
```

If one of the calculations that were performed was a calculation that produced `bands` of some sort (currently both outputs of `nscf` and `bands` calculations count) using Quantum-Espresso, you can do
```julia
bands = outdata["name_of_calculation(e.g. nscf)"]
using Plots
plot(bands, fermi=outdata["nscf"][:fermi])
```

Calculations can be set to run or not by
```julia
setflow!(job, "" => false) #none will run
setflow!(job, "nscf" => true, "bands" => true) #args..., and they are matched fuzzily
```

A job can be submitted by
```julia
submit(job)
```
If the job had "localhost" as it's server, it will run `qsub job.tt` locally, whereas if server and server_dir are something else, it will push the files and subsequently run them on the server.

This gave just a very small overview of the functionality, please look into the [documentation](https://louisponet.github.io/DFControl.jl/latest) and the examples for more.
See the [documentation](https://louisponet.github.io/DFControl.jl/) on how to get started.

0 comments on commit ef5a995

Please sign in to comment.