Skip to content

Commit

Permalink
[release] SIRIUS v7.6.1 (#1019)
Browse files Browse the repository at this point in the history
* fix for mpi_grid_mt_sym_ place of construction
* add sht_lmax setting
  • Loading branch information
toxa81 authored Sep 9, 2024
1 parent 21c8fd5 commit 6320262
Show file tree
Hide file tree
Showing 7 changed files with 45 additions and 40 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ include(CMakePackageConfigHelpers)
project(SIRIUS
DESCRIPTION "Domain specific library for electronic structure calculations"
HOMEPAGE_URL "https://github.com/electronic-structure/SIRIUS"
VERSION 7.6.0
VERSION 7.6.1
LANGUAGES CXX C)

# for CUDA_ARCHITECTURES
Expand Down
2 changes: 1 addition & 1 deletion doc/doxygen.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ PROJECT_NAME = "SIRIUS"
# control system is used.


PROJECT_NUMBER = "7.6.0"
PROJECT_NUMBER = "7.6.1"

# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer a
Expand Down
15 changes: 15 additions & 0 deletions src/context/config.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,21 @@ class config_t
}
dict_["/settings/sht_coverage"_json_pointer] = sht_coverage__;
}
/// Maximum orbital quantum number for which spherical coverage need to be generated.
/**
This option can be used to increase shpherical coverage in muffin-tins. Impacts generation of XC potential.
*/
inline auto sht_lmax() const
{
return dict_.at("/settings/sht_lmax"_json_pointer).get<int>();
}
inline void sht_lmax(int sht_lmax__)
{
if (dict_.contains("locked")) {
throw std::runtime_error(locked_msg);
}
dict_["/settings/sht_lmax"_json_pointer] = sht_lmax__;
}
/// Density RMS tolerance to switch to FP64 implementation. If zero, estimation of iterative solver tolerance is used.
inline auto fp32_to_fp64_rms() const
{
Expand Down
6 changes: 6 additions & 0 deletions src/context/input_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,12 @@
"title": "Coverage of sphere in case of spherical harmonics transformation",
"description": "0 is Lebedev-Laikov coverage, 1 is unifrom coverage"
},
"sht_lmax" : {
"type": "integer",
"default": -1,
"title": "Maximum orbital quantum number for which spherical coverage need to be generated.",
"description": "This option can be used to increase spherical coverage in muffin-tins. Impacts generation of XC potential."
},
"fp32_to_fp64_rms": {
"type": "number",
"default": 0,
Expand Down
41 changes: 21 additions & 20 deletions src/context/simulation_context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -482,26 +482,6 @@ Simulation_context::initialize()
/* set the smearing */
smearing(cfg().parameters().smearing());

/* create auxiliary mpi grid for symmetrization */
auto make_mpi_grid_mt_sym = [](int na, int np) {
std::vector<int> result;
for (int ia = 1; ia <= na; ia++) {
if (na % ia == 0 && np % ia == 0) {
result = std::vector<int>({ia, np / ia});
}
}
return result;
};

for (int ic = 0; ic < unit_cell().num_atom_symmetry_classes(); ic++) {
if (this->full_potential() || unit_cell().atom_symmetry_class(ic).atom_type().is_paw()) {
auto r = make_mpi_grid_mt_sym(unit_cell().atom_symmetry_class(ic).num_atoms(), this->comm().size());
mpi_grid_mt_sym_.push_back(std::make_unique<mpi::Grid>(r, this->comm()));
} else {
mpi_grid_mt_sym_.push_back(nullptr);
}
}

/* create G-vectors on the first call to update() */
update();

Expand Down Expand Up @@ -836,6 +816,27 @@ Simulation_context::update()
}
}

/* create auxiliary mpi grid for symmetrization */
auto make_mpi_grid_mt_sym = [](int na, int np) {
std::vector<int> result;
for (int ia = 1; ia <= na; ia++) {
if (na % ia == 0 && np % ia == 0) {
result = std::vector<int>({ia, np / ia});
}
}
return result;
};

mpi_grid_mt_sym_.clear();
for (int ic = 0; ic < unit_cell().num_atom_symmetry_classes(); ic++) {
if (this->full_potential() || unit_cell().atom_symmetry_class(ic).atom_type().is_paw()) {
auto r = make_mpi_grid_mt_sym(unit_cell().atom_symmetry_class(ic).num_atoms(), this->comm().size());
mpi_grid_mt_sym_.push_back(std::make_unique<mpi::Grid>(r, this->comm()));
} else {
mpi_grid_mt_sym_.push_back(nullptr);
}
}

/* get new reciprocal vector */
auto rlv = unit_cell().reciprocal_lattice_vectors();

Expand Down
18 changes: 0 additions & 18 deletions src/context/simulation_context.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,24 +59,6 @@ print_memory_usage(OUT&& out__, std::string file_and_line__ = "")
out__ << ", GPU: " << (gpu_mem >> 20) << " Mb";
}
out__ << std::endl;

std::vector<std::string> labels = {"host"};
std::vector<memory_pool*> mp = {&get_memory_pool(memory_t::host)};

int np{1};
if (acc::num_devices() > 0) {
labels.push_back("host pinned");
labels.push_back("device");
mp.push_back(&get_memory_pool(memory_t::host_pinned));
mp.push_back(&get_memory_pool(memory_t::device));
np = 3;
}

for (int i = 0; i < np; i++) {
out__ << "[mem.pool] " << labels[i] << ": total capacity: " << (mp[i]->total_size() >> 20) << " Mb, "
<< "free: " << (mp[i]->free_size() >> 20) << " Mb, "
<< "num.blocks: " << mp[i]->num_blocks() << std::endl;
}
}

/// Store all callback functions in one place.
Expand Down
1 change: 1 addition & 0 deletions src/potential/potential.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ Potential::Potential(Simulation_context& ctx__)
} else {
lmax = 2 * ctx_.unit_cell().lmax();
}
lmax = std::max(lmax, ctx_.cfg().settings().sht_lmax());

if (lmax >= 0) {
sht_ = std::make_unique<SHT>(ctx_.processing_unit(), lmax, ctx_.cfg().settings().sht_coverage());
Expand Down

0 comments on commit 6320262

Please sign in to comment.