Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update master branch #826

Merged
merged 44 commits into from
Apr 23, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
092ce1d
[ELPA] Fit latest elpa into the code (#798)
toxa81 Dec 20, 2022
9ac5895
[refactor] Change geometry3d -> r3 namespace (#793)
toxa81 Dec 21, 2022
e80d8c0
[refactor] mpi:: namespace (#801)
toxa81 Jan 3, 2023
d85bf93
[enhancement] Move dockerfiles to one place (#792)
toxa81 Jan 4, 2023
2209c4d
[enhancement] use conversion operator semantics to wrap types (#804)
toxa81 Jan 6, 2023
20ceeeb
[fix] mdarray wrapper for pybind11 (#806)
simonpintarelli Jan 10, 2023
81e7044
[refactor] Introduce fft:: namespace (#805)
toxa81 Jan 11, 2023
a30ef91
[refactor] linear algebra la:: namespace (#807)
toxa81 Jan 13, 2023
d459ecf
Merge branch 'master' into develop
toxa81 Jan 13, 2023
8ae1698
start version 7.4.3
toxa81 Jan 13, 2023
ee408c5
[bug] Low symmetry lattices (#812)
toxa81 Jan 21, 2023
f5393f9
[fix] Use MPI grid for setting fft communicators (#813)
toxa81 Jan 25, 2023
d371df2
[enhancement] Augmentation operator on GPUs (#803)
toxa81 Jan 30, 2023
e1d52b3
change spglib tolerance from 1e-4 to 1e-6
toxa81 Jan 30, 2023
c45f038
Merge pull request #814 from electronic-structure/fix/adjust-spglib-t…
mtaillefumier Jan 31, 2023
06ef332
start version 7.4.4
toxa81 Jan 31, 2023
34ac05d
[fix] Modify index_by_gvec() function to return -1 in case G-vector i…
toxa81 Feb 2, 2023
56b21b7
use remove reduntant cmake cuda_arch
simonpintarelli Feb 10, 2023
2d41576
Update cmake file
mtaillefumier Feb 16, 2023
7d8f025
simplify the impl. of non-local stress (#820)
toxa81 Feb 16, 2023
5b414e1
use remove reduntant cmake cuda_arch
simonpintarelli Feb 10, 2023
72b02bc
indent spack recipe
simonpintarelli Feb 10, 2023
2c5ea6d
update spack recipe for CMAKE_CUDA_ARCHITECTURES
simonpintarelli Feb 10, 2023
17f9f1a
cmake: use enable_language(HIP)
simonpintarelli Feb 10, 2023
4b0033c
add missing if(USE_ROCM)
simonpintarelli Feb 19, 2023
903fdf4
Minor modifications
mtaillefumier Feb 21, 2023
16337e7
Remove custom FindHIP.cmake
mtaillefumier Feb 21, 2023
7512f79
Use default architectures for hip
mtaillefumier Feb 21, 2023
1355b1b
Merge pull request #819 from electronic-structure/cmake-cuda
simonpintarelli Mar 2, 2023
eb4a1b2
update python module
simonpintarelli Feb 21, 2023
cb6ed0c
python: numpy.ascalar -> ndarray.item
simonpintarelli Feb 26, 2023
e9abb21
python: update total energy
simonpintarelli Feb 26, 2023
55864d3
cleanup smearing
simonpintarelli Feb 26, 2023
0e4c892
python cosmetics
simonpintarelli Feb 27, 2023
a1f1fdd
python: fix device transfer
simonpintarelli Feb 28, 2023
2cc1975
python: add missing function
simonpintarelli Feb 28, 2023
4610012
Merge pull request #823 from electronic-structure/update-python-module
simonpintarelli Mar 2, 2023
792d228
[feature] ci/cd workflow (#824)
toxa81 Mar 21, 2023
5ddddfe
Merge branch 'master' into develop
toxa81 Mar 21, 2023
4ac1c15
[enhancement] introduce Spheric_function_set class (#827)
toxa81 Mar 23, 2023
66835f3
python: numpy updates
simonpintarelli Apr 5, 2023
3eaceee
[enhancement] more CI on k8s (#829)
toxa81 Apr 15, 2023
8f56910
python: update api for CPMP project
simonpintarelli Apr 20, 2023
ca00676
[enhancement] Periodic_function class (#830)
toxa81 Apr 21, 2023
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
Prev Previous commit
Next Next commit
[refactor] Change geometry3d -> r3 namespace (#793)
No change in the code logic, just renaming namespace and classes.
  • Loading branch information
toxa81 authored Dec 21, 2022
commit 9ac58950a9905189008ddaa8558a20ddb135b861
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.18)

project(SIRIUS VERSION 7.4.0)
project(SIRIUS VERSION 7.4.1)

# user variables
set(CREATE_PYTHON_MODULE OFF CACHE BOOL "create sirius Python module")
Expand Down
10 changes: 5 additions & 5 deletions apps/dft_loop/sirius.scf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -476,13 +476,13 @@ void run_tasks(cmd_args const& args)

double t{0};
for (size_t i = 0; i < vertex.size() - 1; i++) {
vector3d<double> v0 = vector3d<double>(vertex[i].second);
vector3d<double> v1 = vector3d<double>(vertex[i + 1].second);
vector3d<double> dv = v1 - v0;
vector3d<double> dv_cart = dot(ctx->unit_cell().reciprocal_lattice_vectors(), dv);
r3::vector<double> v0 = r3::vector<double>(vertex[i].second);
r3::vector<double> v1 = r3::vector<double>(vertex[i + 1].second);
r3::vector<double> dv = v1 - v0;
r3::vector<double> dv_cart = dot(ctx->unit_cell().reciprocal_lattice_vectors(), dv);
int np = std::max(10, static_cast<int>(30 * dv_cart.length()));
for (int j = 1; j <= np; j++) {
vector3d<double> v = v0 + dv * static_cast<double>(j) / np;
r3::vector<double> v = v0 + dv * static_cast<double>(j) / np;
ks.add_kpoint(&v[0], 1.0);
t += dv_cart.length() / np;
x_axis.push_back(t);
Expand Down
7 changes: 3 additions & 4 deletions apps/nlcg/sirius.nlcg.cpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#include "utils/profiler.hpp"
#include <sirius.hpp>
#include <utils/json.hpp>
#include "nlcglib/adaptor.hpp"
#include <nlcglib/adaptor.hpp>
#include <nlcglib/nlcglib.hpp>
#include "utils/profiler.hpp"

using namespace sirius;
using json = nlohmann::json;
Expand Down Expand Up @@ -30,15 +30,14 @@ std::unique_ptr<Simulation_context> create_sim_ctx(std::string fname__,

auto& inp = ctx.cfg().parameters();
if (inp.gamma_point() && !(inp.ngridk()[0] * inp.ngridk()[1] * inp.ngridk()[2] == 1)) {
TERMINATE("this is not a Gamma-point calculation")
RTE_THROW("this is not a Gamma-point calculation")
}

ctx.import(args__);

return ctx_ptr;
}


double ground_state(Simulation_context& ctx,
task_t task,
cmd_args const& args,
Expand Down
4 changes: 2 additions & 2 deletions apps/tests/test_davidson.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -134,12 +134,12 @@ void test_davidson(cmd_args const& args__)
json_conf["parameters"]["num_bands"] = num_bands;
}

std::vector<geometry3d::vector3d<double>> coord;
std::vector<r3::vector<double>> coord;
double p = 1.0 / N;
for (int i = 0; i < N; i++) {
for (int j = 0; j < N; j++) {
for (int k = 0; k < N; k++) {
coord.push_back(geometry3d::vector3d<double>(i * p, j * p, k * p));
coord.push_back(r3::vector<double>(i * p, j * p, k * p));
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions apps/tests/test_examples.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ if (Communicator::world().rank() == 0) {
}
/* reciprocal lattice vectors in
inverse atomic units */
matrix3d<double> M = {{1, 0, 0},
r3::matrix<double> M = {{1, 0, 0},
{0, 1, 0},
{0, 0, 1}};
/* G-vector cutoff radius in
Expand Down Expand Up @@ -47,7 +47,7 @@ if (Communicator::world().rank() == 0) {
}
/* reciprocal lattice vectors in
inverse atomic units */
matrix3d<double> M = {{1, 0, 0},
r3::matrix<double> M = {{1, 0, 0},
{0, 1, 0},
{0, 0, 1}};
/* G-vector cutoff radius in
Expand Down Expand Up @@ -119,7 +119,7 @@ spla::Context spla_ctx(SPLA_PU_HOST);

/* reciprocal lattice vectors in
inverse atomic units */
matrix3d<double> M = {{1, 0, 0},
r3::matrix<double> M = {{1, 0, 0},
{0, 1, 0},
{0, 0, 1}};
/* G-vector cutoff radius in
Expand Down
2 changes: 1 addition & 1 deletion apps/tests/test_hloc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ int main(int argn, char** argv)
json_conf["parameters"]["gamma_point"] = reduce_gvec;

auto ctx = sirius::create_simulation_context(json_conf, {{10, 0, 0}, {0, 10, 0}, {0, 0, 10}}, 0,
std::vector<geometry3d::vector3d<double>>(), false, false);
std::vector<r3::vector<double>>(), false, false);
for (int i = 0; i < repeat; i++) {
if (fp32) {
#if defined(USE_FP32)
Expand Down
2 changes: 1 addition & 1 deletion apps/tests/test_phase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ using namespace sirius;
void test1()
{
int N = 30000000;
std::vector<vector3d<double>> a(N);
std::vector<r3::vector<double>> a(N);

for (int i = 0; i < N; i++) {
double r = utils::random<double>();
Expand Down
4 changes: 2 additions & 2 deletions apps/tests/test_pppw_xc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ void test_davidson(cmd_args const& args__)
json_conf["control"]["mpi_grid_dims"] = mpi_grid;

double p = 1.0 / N;
std::vector<geometry3d::vector3d<double>> coord;
std::vector<r3::vector<double>> coord;
for (int i = 0; i < N; i++) {
for (int j = 0; j < N; j++) {
for (int k = 0; k < N; k++) {
coord.push_back(geometry3d::vector3d<double>(i * p, j * p, k * p));
coord.push_back(r3::vector<double>(i * p, j * p, k * p));
}
}
}
Expand Down
12 changes: 6 additions & 6 deletions apps/tests/test_sym.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ void test_sym(cmd_args const& args__)
json_conf["parameters"]["num_bands"] = 1;
//ctx.so_correction(true);

std::vector<geometry3d::vector3d<double>> coord;
coord.push_back(geometry3d::vector3d<double>({1.0/2, 1.0/2, 0}));
coord.push_back(geometry3d::vector3d<double>({1.0/3, 1.0/3, 0}));
std::vector<r3::vector<double>> coord;
coord.push_back(r3::vector<double>({1.0/2, 1.0/2, 0}));
coord.push_back(r3::vector<double>({1.0/3, 1.0/3, 0}));
//ctx.unit_cell().add_atom("Cu", {0.113500, 0.613500, 0.886500});
//ctx.unit_cell().add_atom("Cu", {0.613500, 0.886500, 0.113500});
//ctx.unit_cell().add_atom("Cu", {0.886500, 0.113500, 0.613500});
Expand All @@ -33,8 +33,8 @@ void test_sym(cmd_args const& args__)
coord, false, false);
Simulation_context& ctx = *ctx_ptr;

vector3d<int> k_grid(4, 4, 1);
vector3d<int> k_shift(0, 0, 0);
r3::vector<int> k_grid(4, 4, 1);
r3::vector<int> k_shift(0, 0, 0);

K_point_set kset_sym(ctx, k_grid, k_shift, true);
K_point_set kset_nosym(ctx, k_grid, k_shift, false);
Expand Down Expand Up @@ -79,7 +79,7 @@ void test_sym(cmd_args const& args__)

auto rotm = sht::rotation_matrix<double>(2, eang, pr);

auto vk1 = geometry3d::reduce_coordinates(dot(R, kset_sym.get<double>(ik)->vk())).first;
auto vk1 = r3::reduce_coordinates(dot(R, kset_sym.get<double>(ik)->vk())).first;

std::cout << "isym: " << isym << " k: " << kset_sym.get<double>(ik)->vk() << " k1: " << vk1 << std::endl;

Expand Down
4 changes: 2 additions & 2 deletions apps/unit_tests/test_fft_correctness_1.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ int test_fft(cmd_args& args, device_t pu__)

double cutoff = args.value<double>("cutoff", 8);

matrix3d<double> M = {{1, 0, 0}, {0, 1, 0}, {0, 0, 1}};
r3::matrix<double> M = {{1, 0, 0}, {0, 1, 0}, {0, 0, 1}};

auto fft_grid = get_min_fft_grid(cutoff, M);

Expand Down Expand Up @@ -70,7 +70,7 @@ int test_fft(cmd_args& args, device_t pu__)
for (int j1 = 0; j1 < fft_grid[1]; j1++) {
for (int j2 = 0; j2 < spfft.local_z_length(); j2++) {
/* get real space fractional coordinate */
auto rl = vector3d<double>(double(j0) / fft_grid[0],
auto rl = r3::vector<double>(double(j0) / fft_grid[0],
double(j1) / fft_grid[1],
double(spfft.local_z_offset() + j2) / fft_grid[2]);
int idx = fft_grid.index_by_coord(j0, j1, j2);
Expand Down
2 changes: 1 addition & 1 deletion apps/unit_tests/test_fft_correctness_2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ int test_fft_complex(cmd_args& args, device_t fft_pu__)
eps = 1e-6;
}

matrix3d<double> M = {{1, 0, 0}, {0, 1, 0}, {0, 0, 1}};
r3::matrix<double> M = {{1, 0, 0}, {0, 1, 0}, {0, 0, 1}};

auto fft_grid = get_min_fft_grid(cutoff, M);

Expand Down
16 changes: 8 additions & 8 deletions apps/unit_tests/test_geom3d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,19 @@ using namespace sirius;

int run_test()
{
vector3d<double> a(1.1, 2.2, 3.3);
vector3d<double> b = a;
vector3d<double> c(b);
vector3d<double> d;
r3::vector<double> a(1.1, 2.2, 3.3);
r3::vector<double> b = a;
r3::vector<double> c(b);
r3::vector<double> d;
d = c;
matrix3d<int> R = {{1,0,0},{0,1,0},{0,0,1}};
r3::matrix<int> R = {{1,0,0},{0,1,0},{0,0,1}};
auto e = dot(R, a) + b;
vector3d<double> ref(2.2, 4.4, 6.6);
r3::vector<double> ref(2.2, 4.4, 6.6);
if ((ref - e).length() > 1e-16) {
return 1;
}
auto x = a + vector3d<int>(4, 5, 6);
vector3d<double> ref1(5.1, 7.2, 9.3);
auto x = a + r3::vector<int>(4, 5, 6);
r3::vector<double> ref1(5.1, 7.2, 9.3);
if ((ref1 - x).length() > 1e-16) {
return 2;
}
Expand Down
13 changes: 6 additions & 7 deletions apps/unit_tests/test_gvec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,21 @@
/* test G-vectors */

using namespace sirius;
using namespace sddk;

int run_test(cmd_args& args)
{
std::vector<int> vd = args.value("dims", std::vector<int>({132, 132, 132}));
vector3d<int> dims(vd[0], vd[1], vd[2]);
auto vd = args.value("dims", std::vector<int>({132, 132, 132}));
r3::vector<int> dims(vd[0], vd[1], vd[2]);
double cutoff = args.value<double>("cutoff", 50);

matrix3d<double> M;
r3::matrix<double> M;
M(0, 0) = M(1, 1) = M(2, 2) = 1.0;
M(0, 1) = 0.1;
M(0, 2) = 0.2;
M(2, 0) = 0.3;

Gvec gvec(M, cutoff, Communicator::world(), false);
Gvec gvec_r(M, cutoff, Communicator::world(), true);
sddk::Gvec gvec(M, cutoff, sddk::Communicator::world(), false);
sddk::Gvec gvec_r(M, cutoff, sddk::Communicator::world(), true);

if (gvec_r.num_gvec() * 2 != gvec.num_gvec() + 1) {
return 1;
Expand All @@ -30,7 +29,7 @@ int run_test(cmd_args& args)
int main(int argn, char** argv)
{
cmd_args args;
args.register_key("--dims=", "{vector3d<int>} FFT dimensions");
args.register_key("--dims=", "{vector<int>} FFT dimensions");
args.register_key("--cutoff=", "{double} cutoff radius in G-space");

args.parse_args(argn, argv);
Expand Down
10 changes: 5 additions & 5 deletions apps/unit_tests/test_rlm_deriv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ Table[

int test1()
{
std::vector<vector3d<double>> v({{1, 2, 3}, {-2, 2, 0.12}, {2, -1, 0}, {0, 1, -5}, {-4, -4, -2}, {-2, 0, 1}});
std::vector<r3::vector<double>> v({{1, 2, 3}, {-2, 2, 0.12}, {2, -1, 0}, {0, 1, -5}, {-4, -4, -2}, {-2, 0, 1}});

int lmax = 8;
int lmmax = utils::lmmax(lmax);
Expand Down Expand Up @@ -325,7 +325,7 @@ int test1()

int test2()
{
std::vector<vector3d<double>> v({{-1, 0, 0}, {1, 0, 0}, {0, -1, 0}, {0, 1, 0}, {0, 0, -1}, {0, 0, 1}});
std::vector<r3::vector<double>> v({{-1, 0, 0}, {1, 0, 0}, {0, -1, 0}, {0, 1, 0}, {0, 0, -1}, {0, 0, 1}});

int lmax = 8;
int lmmax = utils::lmmax(lmax);
Expand Down Expand Up @@ -478,7 +478,7 @@ int test3()
double max_diff{0};

for (int i = 0; i < 300; i++) {
vector3d<double> v(1 + 10 * utils::random<double>(),
r3::vector<double> v(1 + 10 * utils::random<double>(),
1 + 10 * utils::random<double>(),
1 + 10 * utils::random<double>());

Expand All @@ -490,9 +490,9 @@ int test3()

mdarray<double, 2> drlm(lmmax, 3);
for (int x = 0; x < 3; x++) {
vector3d<double> v1 = v;
r3::vector<double> v1 = v;
v1[x] += dr;
vector3d<double> v2 = v;
r3::vector<double> v2 = v;
v2[x] -= dr;

auto vs1 = SHT::spherical_coordinates(v1);
Expand Down
4 changes: 2 additions & 2 deletions apps/unit_tests/test_rot_ylm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ using namespace sddk;
template <typename T>
int run_test_impl(cmd_args& args)
{
matrix3d<double> lattice;
r3::matrix<double> lattice;
lattice(0, 0) = 7;
lattice(1, 1) = 7;
lattice(2, 2) = 7;
Expand Down Expand Up @@ -43,7 +43,7 @@ int run_test_impl(cmd_args& args)
auto ang = symmetry[isym].spg_op.euler_angles;

/* random Cartesian vector */
vector3d<double> coord(double(rand()) / RAND_MAX, double(rand()) / RAND_MAX, double(rand()) / RAND_MAX);
r3::vector<double> coord(double(rand()) / RAND_MAX, double(rand()) / RAND_MAX, double(rand()) / RAND_MAX);
auto scoord = SHT::spherical_coordinates(coord);
/* rotated coordinates */
auto coord2 = dot(Rc, coord);
Expand Down
8 changes: 4 additions & 4 deletions apps/unit_tests/test_serialize.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ int test1()
mdarray<double, 2> m1(4, 5);
m1 = [](uint64_t i1, uint64_t i2){return utils::random<double>();};

vector3d<double> v1{1.1, 2.2, 3.3};
matrix3d<double> u1{{4.4, 5.5, 6.6}, {1.2, 2.43334, 4.56666}, {400.333, 1e14, 2.33e20}};
r3::vector<double> v1{1.1, 2.2, 3.3};
r3::matrix<double> u1{{4.4, 5.5, 6.6}, {1.2, 2.43334, 4.56666}, {400.333, 1e14, 2.33e20}};

serializer s;

Expand All @@ -36,8 +36,8 @@ int test1()
std::vector<std::complex<float>> c2;
std::complex<double> d2;
mdarray<double, 2> m2;
vector3d<double> v2;
matrix3d<double> u2;
r3::vector<double> v2;
r3::matrix<double> u2;

deserialize(s, a2);
deserialize(s, b2);
Expand Down
4 changes: 2 additions & 2 deletions apps/unit_tests/test_spheric_function.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ int test3(int lmax, int nr)
*/
int test4()
{
vector3d<std::complex<double>> ref_v(0.00106237, std::complex<double>(0, -0.650989), 0);
r3::vector<std::complex<double>> ref_v(0.00106237, std::complex<double>(0, -0.650989), 0);

auto r = Radial_grid_factory<double>(radial_grid_t::exponential, 1000, 0.01, 2.0, 1.0);

Expand All @@ -140,7 +140,7 @@ int test4()

auto grad_f = gradient(f);

vector3d<std::complex<double>> v;
r3::vector<std::complex<double>> v;
for (int x = 0; x < 3; x++) {
v[x] = inner(f, grad_f[x]);
}
Expand Down
2 changes: 1 addition & 1 deletion apps/unit_tests/test_wf_ortho_1.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ int test_wf_ortho(std::vector<int> mpi_grid_dims__, double cutoff__, int num_ban

sddk::BLACS_grid blacs_grid(sddk::Communicator::world(), mpi_grid_dims__[0], mpi_grid_dims__[1]);

geometry3d::matrix3d<double> M = {{1, 0, 0}, {0, 1, 0}, {0, 0, 1}};
r3::matrix<double> M = {{1, 0, 0}, {0, 1, 0}, {0, 0, 1}};

/* create G-vectors */
auto gvec = std::make_shared<sddk::Gvec>(M, cutoff__, sddk::Communicator::world(), false);
Expand Down
Loading