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

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "PotentialCalculation"
uuid = "76415700-ec45-11e8-0f65-f1df3c899b21"
authors = ["Teemu Järvinen <teemu.j.jarvinen@student.jyu.fi>"]
version = "0.5.1-DEV"
version = "0.6.0-DEV"

[deps]
AtomsBase = "a963bdd2-2df7-4f54-a1ee-49d51e6be12a"
Expand All @@ -11,7 +11,6 @@ FileIO = "5789e2e9-d7fb-5bc7-8068-2c6fae9b9549"
JLD2 = "033835bb-8acc-5ee8-8aae-3f567f8a3819"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
ProgressMeter = "92933f4c-e287-5a05-a399-4b506db050ca"
PyCall = "438e738f-606a-5dbb-bf0a-cddfbfd45ab0"
Reexport = "189a3867-3050-52da-a836-e630ba90ab69"
Rotations = "6038ab10-8711-5258-84ad-4b1120ba62dc"
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
Expand All @@ -25,7 +24,6 @@ Distances = "0.10"
FileIO = "1"
JLD2 = "0.4"
ProgressMeter = "1.2"
PyCall = "1.90"
Reexport = "1.0"
Rotations = "1.0"
Unitful = "1"
Expand Down
2 changes: 1 addition & 1 deletion docs/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ experiments.

- Calculate potentials with [ORCA](https://orcaforum.kofo.mpg.de) or [Psi4](http://www.psicode.org/)
- Automatic sampling of calculation points
- Supports parallelisation of calculation across compute nodes
- Supports parallelization of calculation across compute nodes

### [PotentialFitting](https://github.com/MatrixLabTools/PotentialFitting.jl)

Expand Down
2 changes: 1 addition & 1 deletion docs/src/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ pkg> add PotentialCalculation

Currently there are two backends, [ORCA](https://orcaforum.kofo.mpg.de)
and [Psi4](http://www.psicode.org/). To do any calculation, you need to have
at least one of these installed.
at least one of these installed. With Psi4 you need to also load [Psi4Calculator](https://github.com/MatrixLabTools/Psi4Calculator.jl)

## Testing installation

Expand Down
15 changes: 9 additions & 6 deletions docs/src/use.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ data3 = continue_calculation(
## Calculators

PotentilaCalculation can use either [Orca](@ref)
or [Psi4](@ref) as a backend for calculations.
or [Psi4](https://github.com/MatrixLabTools/Psi4Calculator.jl) as a backend for calculations.

To create ORCA calculator you can use

Expand All @@ -108,18 +108,19 @@ PATH is searched for orca-binary. `tmp_dir` is by default created in `$TMP`.
For Psi4 use

```julia
using PotentialCalculation.psi4
using PotentialCalculation
using Psi4Calculator

Psi4(
memory="1GiB",
nthreads=1,
)
```

You need to import Psi4 explicitly with `using PotentialCalculation.psi4`. All
Psi4 global environmental variables are present. To access them you need to use
`PotentialCalculation.psi4.gPsi4`-handel after using
`PotentialCalculation.psi4.initpsi()`-function to initialize Psi4 environment.
You need to install Psi4Calculator separately, as it has now been moved to its own package.
All Psi4 global environmental variables are present. To access them you need to use
`Psi4Calculator.gPsi4`-handel after using
`Psi4Calculator.initpsi()`-function to initialize Psi4 environment.

### Adding Calculation Method and Basis Set

Expand Down Expand Up @@ -205,3 +206,5 @@ using ClusterManagers
addprocs_slurm(number_of_processes) # ntasks option in Slurm job file
@everywhere using PotentialCalculation
```

Consider also using [SlurmClusterManager](https://github.com/kleinhenz/SlurmClusterManager.jl) to make things easy.
1 change: 0 additions & 1 deletion src/PotentialCalculation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,5 @@ include("SubModules/sample.jl")
include("SubModules/restarttools.jl")
@reexport using .Restarttools

include("SubModules/psi4.jl")

end # module
9 changes: 5 additions & 4 deletions src/SubModules/clusters.jl
Original file line number Diff line number Diff line change
Expand Up @@ -233,23 +233,24 @@ end


"""
print_xyz(io::IO, c::AbstractClusterWithSymbols, note=""; printheader=true)
print_xyz(io::IO, c, note=""; printheader=true)

Prints cluster in xyz file format

# Arguments
- `io::IO` : stream where writing is done
- `c::AbstractClusterWithSymbols` : cluster that is writen
- `c` : `AtomsBase` compatable structure
- `note=""` : message writen on note line
- `printheader=true` : wheather or not header is writen (number of atoms and note)
"""
function print_xyz(io::IO, c::AbstractClusterWithSymbols, note=""; printheader=true)
function print_xyz(io::IO, c, note=""; printheader=true)
if printheader
println(io, " ",length(c))
println(io, note)
end
for i in 1:length(c)
println(io, c.atoms[i].id, " ", c.xyz[1,i], " ", c.xyz[2,i], " ", c.xyz[3,i])
r = ustrip.(u"Å", position(c,i))
println(io, atomic_symbol(c, i), " ", r[1], " ", r[2], " ", r[3])
end
end

Expand Down
90 changes: 0 additions & 90 deletions src/SubModules/psi4.jl

This file was deleted.

1 change: 0 additions & 1 deletion test/Project.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
[deps]
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
PyCall = "438e738f-606a-5dbb-bf0a-cddfbfd45ab0"
Distributed = "8ba89e20-285c-5b6f-9357-94700520ee1b"
AtomsBase = "a963bdd2-2df7-4f54-a1ee-49d51e6be12a"
35 changes: 1 addition & 34 deletions test/test_restarttools.jl
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
using Test
using PyCall

using Distributed

addprocs(2)
@everywhere using PotentialCalculation
@everywhere using PotentialCalculation.psi4

fname = tempname() * ".jld2"
rname = tempname() * ".jld2"
Expand All @@ -31,7 +29,7 @@ pbar=true

testrestarts = false

if Sys.which("orca") != nothing && Sys.which("orca_scf") != nothing
if Sys.which("orca") !== nothing && Sys.which("orca_scf") !== nothing
@info "Orca binary found. Testing ORCA."
@testset "Orca" begin
ca = Calculator("blyp d3bj TIGHTSCF", "def2-svp", Orca())
Expand All @@ -55,37 +53,6 @@ end



testpsi4 = true

try
pyimport("psi4")
catch
global testpsi4 = false
@warn "Psi4 was not detected. Skipping testing. Psi4 backend is not working!"
end
if testpsi4
@info "Psi4 found. Testing Psi4."
@testset "Psi4" begin
ca = Calculator("blyp-d3bj", "def2-svp",Psi4(memory="1000MiB", nthreads=2))

input1=create_inputs(xyzname, Ar, ca)
inputs=create_inputs(xyzname, N2, ca; npoints=5)
inputss=create_inputs(xyzname, xyzname, ca)

data1=calculate_potential(inputs, save_file=fname, pbar=pbar)
data2=calculate_potential(fname,ca,save_file=sname, restart_file=rname, pbar=pbar)
data3=continue_calculation(rname,ca, save_file=sname, restart_file=rname, pbar=pbar)

calculate_energy(ca, N2)
calculate_energy(ca, [N2,N2])
@test all(isapprox.(data1["Energy"], data2["Energy"], atol=2E-6))
@test all(isapprox.(data1["Energy"], data3["Energy"], atol=2E-6))
@test all(isapprox.(data2["Energy"], data3["Energy"], atol=2E-6))
end
testrestarts = true
end


if testrestarts
@testset "restarttools" begin
savedata = load_data_file(sname)
Expand Down