Skip to content

Commit

Permalink
Merge pull request #485 from toxa81/develop
Browse files Browse the repository at this point in the history
update travis ci and front page documentation
  • Loading branch information
toxa81 authored Mar 11, 2020
2 parents 8b8564c + 4b81e01 commit 6df5b0b
Show file tree
Hide file tree
Showing 14 changed files with 163 additions and 67 deletions.
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ branches:
# - develop

env:
- CC=mpicc CXX=mpic++ FC=mpif90 FCCPP=cpp SIRIUS_BINARIES=/home/travis/local/bin PATH=/home/travis/local/bin:$PATH
- CC=mpicc CXX=mpic++ FC=mpif90 FCCPP=cpp PATH=/home/travis/local/bin:$PATH

before_install:
- ./check_format.x
Expand All @@ -27,6 +27,7 @@ install:
- ./ci/travis_build_sirius.sh

script:
- ./ci/travis_run_unit_tests.sh
- ./ci/travis_run_verification.sh

#after_success:
Expand Down
51 changes: 47 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
* [Accelerating DFT codes](#accelerating-dft-codes)
* [Quantum ESPRESSO](#quantum-espresso)
* [Examples](#examples)
* [Contacts](#contacts)
* [Acknowledgements](#acknowledgements)

## Introduction
SIRIUS is a domain specific library for electronic structure calculations. It implements pseudopotential plane wave (PP-PW)
Expand Down Expand Up @@ -305,16 +307,57 @@ SIRIUS library is usgin OpenMP for node-level parallelization. To run QE/SIRIUS
* by default, use one rank per node and many OMP threads; if the calculated system is really small, try to saturate
the GPU card using more MPI ranks (e.g.: on a 12-core node, use 2-3-4 ranks with 6-4-3 OMP threads)

#### Example: ground state of Si511Ge
In the following example we compare performace of native and SIRIUS-enabled versions of QE. Native QE was run on the
dual-socket nodes containing two 18-core Intel Haswell CPUs.
### Benchmarks
In the following examples we compare performace of native and SIRIUS-enabled versions of QE. CPU-only runs were executed
on the dual-socket multi-core nodes containing two 18-core Intel Broadwell CPUs. GPU rus were executed on the hybrid
nodes containing 12-core Intel Haswell CPU and NVIDIA Tesla P100 card:

|Hybrid partition (Cray XC50) | Multicore partition (Cray XC40) |
|--------------------------------------------|--------------------------------------------------|
|Intel Xeon E5-2690 v3 @2.60GHz, 12 cores <br> NVIDIA Tesla P100 16GB | Two Intel Xeon E5-2695 v4 @2.10GHz (2 x 18 cores)|

Ground state calculation ([input](https://github.com/electronic-structure/benchmarks/tree/master/performance/Si511Ge))
of Si511Ge.

<p align="center">
<img src="doc/images/Si511Ge_perf.png">
</p>




## Examples

## Contacts
Have you got any questions, feel free to contact us:
* Anton Kozhevnikov ([email protected])
* Mathieu Taillefumier ([email protected])
* Simon Pintarelli ([email protected])

## Acknowledgements
The development of SIRIUS library would not be possible without support of the following organizations:

|List of supporting organizations |
|:------------------------------------------------:|
| |
| Swiss Federal Institute of Technology in Zürich | |
| ![ethz](doc/images/logo_ethz.png) |
| https://www.ethz.ch/ |
| |
| Swiss National Supercomputing Centre |
| ![cscs](doc/images/logo_cscs.png) |
| https://www.cscs.ch/ |
| |
| Platform for Advanced Scientific Computing |
| ![pasc](doc/images/logo_pasc.png) |
| https://www.pasc-ch.org/ |
| |
| MAX (MAterials design at the eXascale) <br> European Centre of Excellence |
| ![pasc](doc/images/logo_max.png) |
| http://www.max-centre.eu/ |
| |
| Partnership for Advanced Computing in Europe |
| ![pasc](doc/images/logo_prace.png) |
| https://prace-ri.eu/ |



2 changes: 1 addition & 1 deletion ci/travis_build_sirius.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

mkdir build
cd build
cmake ../ -DCMAKE_BUILD_TYPE=RelWithDebInfo -DSpFFT_DIR=/home/travis/local/lib/cmake/SpFFT -DCMAKE_INSTALL_PREFIX=/home/travis/local
cmake ../ -DCMAKE_BUILD_TYPE=RelWithDebInfo -DSpFFT_DIR=/home/travis/local/lib/cmake/SpFFT -DCMAKE_INSTALL_PREFIX=/home/travis/local -DBUILD_TESTS=1
make -j 2 install

3 changes: 3 additions & 0 deletions ci/travis_run_unit_tests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash
cd build/apps/unit_tests
./unit_tests.x
Binary file modified doc/images/Si511Ge_perf.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/images/logo_cscs.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/images/logo_ethz.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/images/logo_max.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/images/logo_pasc.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/images/logo_prace.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
29 changes: 26 additions & 3 deletions src/api/generated.f90
Original file line number Diff line number Diff line change
Expand Up @@ -427,9 +427,13 @@ end subroutine sirius_set_parameters
!> @param [out] iter_solver_tol_empty Tolerance for the empty states.
!> @param [out] verbosity Verbosity level.
!> @param [out] hubbard_correction True if LDA+U correction is enabled.
!> @param [out] evp_work_count Internal counter of total eigen-value problem work.
!> @param [out] num_loc_op_applied Internal counter of the number of wave-functions to which Hamiltonian was applied.
!> @param [out] error_code Error code.
subroutine sirius_get_parameters(handler,lmax_apw,lmax_rho,lmax_pot,num_fv_states,&
&num_bands,num_mag_dims,pw_cutoff,gk_cutoff,fft_grid_size,auto_rmt,gamma_point,use_symmetry,&
&so_correction,iter_solver_tol,iter_solver_tol_empty,verbosity,hubbard_correction)
&so_correction,iter_solver_tol,iter_solver_tol_empty,verbosity,hubbard_correction,&
&evp_work_count,num_loc_op_applied,error_code)
implicit none
type(C_PTR), intent(in) :: handler
integer(C_INT), optional, target, intent(out) :: lmax_apw
Expand All @@ -449,6 +453,9 @@ subroutine sirius_get_parameters(handler,lmax_apw,lmax_rho,lmax_pot,num_fv_state
real(C_DOUBLE), optional, target, intent(out) :: iter_solver_tol_empty
integer(C_INT), optional, target, intent(out) :: verbosity
logical(C_BOOL), optional, target, intent(out) :: hubbard_correction
real(C_DOUBLE), optional, target, intent(out) :: evp_work_count
integer(C_INT), optional, target, intent(out) :: num_loc_op_applied
integer(C_INT), optional, target, intent(out) :: error_code
type(C_PTR) :: lmax_apw_ptr
type(C_PTR) :: lmax_rho_ptr
type(C_PTR) :: lmax_pot_ptr
Expand All @@ -466,10 +473,14 @@ subroutine sirius_get_parameters(handler,lmax_apw,lmax_rho,lmax_pot,num_fv_state
type(C_PTR) :: iter_solver_tol_empty_ptr
type(C_PTR) :: verbosity_ptr
type(C_PTR) :: hubbard_correction_ptr
type(C_PTR) :: evp_work_count_ptr
type(C_PTR) :: num_loc_op_applied_ptr
type(C_PTR) :: error_code_ptr
interface
subroutine sirius_get_parameters_aux(handler,lmax_apw,lmax_rho,lmax_pot,num_fv_states,&
&num_bands,num_mag_dims,pw_cutoff,gk_cutoff,fft_grid_size,auto_rmt,gamma_point,use_symmetry,&
&so_correction,iter_solver_tol,iter_solver_tol_empty,verbosity,hubbard_correction)&
&so_correction,iter_solver_tol,iter_solver_tol_empty,verbosity,hubbard_correction,&
&evp_work_count,num_loc_op_applied,error_code)&
&bind(C, name="sirius_get_parameters")
use, intrinsic :: ISO_C_BINDING
type(C_PTR), intent(in) :: handler
Expand All @@ -490,6 +501,9 @@ subroutine sirius_get_parameters_aux(handler,lmax_apw,lmax_rho,lmax_pot,num_fv_s
type(C_PTR), value :: iter_solver_tol_empty
type(C_PTR), value :: verbosity
type(C_PTR), value :: hubbard_correction
type(C_PTR), value :: evp_work_count
type(C_PTR), value :: num_loc_op_applied
type(C_PTR), value :: error_code
end subroutine
end interface

Expand Down Expand Up @@ -544,10 +558,19 @@ subroutine sirius_get_parameters_aux(handler,lmax_apw,lmax_rho,lmax_pot,num_fv_s
hubbard_correction_ptr = C_NULL_PTR
if (present(hubbard_correction)) hubbard_correction_ptr = C_LOC(hubbard_correction)

evp_work_count_ptr = C_NULL_PTR
if (present(evp_work_count)) evp_work_count_ptr = C_LOC(evp_work_count)

num_loc_op_applied_ptr = C_NULL_PTR
if (present(num_loc_op_applied)) num_loc_op_applied_ptr = C_LOC(num_loc_op_applied)

error_code_ptr = C_NULL_PTR
if (present(error_code)) error_code_ptr = C_LOC(error_code)

call sirius_get_parameters_aux(handler,lmax_apw_ptr,lmax_rho_ptr,lmax_pot_ptr,num_fv_states_ptr,&
&num_bands_ptr,num_mag_dims_ptr,pw_cutoff_ptr,gk_cutoff_ptr,fft_grid_size_ptr,auto_rmt_ptr,&
&gamma_point_ptr,use_symmetry_ptr,so_correction_ptr,iter_solver_tol_ptr,iter_solver_tol_empty_ptr,&
&verbosity_ptr,hubbard_correction_ptr)
&verbosity_ptr,hubbard_correction_ptr,evp_work_count_ptr,num_loc_op_applied_ptr,error_code_ptr)
end subroutine sirius_get_parameters

!> @brief Add one of the XC functionals.
Expand Down
124 changes: 69 additions & 55 deletions src/api/sirius_api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,9 @@ void sirius_set_parameters(void* const* handler__,
@fortran argument out optional double iter_solver_tol_empty Tolerance for the empty states.
@fortran argument out optional int verbosity Verbosity level.
@fortran argument out optional bool hubbard_correction True if LDA+U correction is enabled.
@fortran argument out optional double evp_work_count Internal counter of total eigen-value problem work.
@fortran argument out optional int num_loc_op_applied Internal counter of the number of wave-functions to which Hamiltonian was applied.
@fortran argument out optional int error_code Error code.
@fortran end */
void sirius_get_parameters(void* const* handler__,
int* lmax_apw__,
Expand All @@ -433,62 +436,74 @@ void sirius_get_parameters(void* const* handler__,
double* iter_solver_tol__,
double* iter_solver_tol_empty__,
int* verbosity__,
bool* hubbard_correction__)
bool* hubbard_correction__,
double* evp_work_count__,
int* num_loc_op_applied__,
int* error_code__)
{
auto& sim_ctx = get_sim_ctx(handler__);
if (lmax_apw__ != nullptr) {
*lmax_apw__ = sim_ctx.lmax_apw();
}
if (lmax_rho__ != nullptr) {
*lmax_rho__ = sim_ctx.lmax_rho();
}
if (lmax_pot__ != nullptr) {
*lmax_pot__ = sim_ctx.lmax_pot();
}
if (num_fv_states__ != nullptr) {
*num_fv_states__ = sim_ctx.num_fv_states();
}
if (num_bands__ != nullptr) {
*num_bands__ = sim_ctx.num_bands();
}
if (num_mag_dims__ != nullptr) {
*num_mag_dims__ = sim_ctx.num_mag_dims();
}
if (pw_cutoff__ != nullptr) {
*pw_cutoff__ = sim_ctx.pw_cutoff();
}
if (gk_cutoff__ != nullptr) {
*gk_cutoff__ = sim_ctx.gk_cutoff();
}
if (auto_rmt__ != nullptr) {
*auto_rmt__ = sim_ctx.auto_rmt();
}
if (gamma_point__ != nullptr) {
*gamma_point__ = sim_ctx.gamma_point();
}
if (use_symmetry__ != nullptr) {
*use_symmetry__ = sim_ctx.use_symmetry();
}
if (so_correction__ != nullptr) {
*so_correction__ = sim_ctx.so_correction();
}
if (iter_solver_tol__ != nullptr) {
*iter_solver_tol__ = sim_ctx.iterative_solver_tolerance();
}
if (iter_solver_tol_empty__ != nullptr) {
*iter_solver_tol_empty__ = sim_ctx.iterative_solver_input().empty_states_tolerance_;
}
if (verbosity__ != nullptr) {
*verbosity__ = sim_ctx.control().verbosity_;
}
if (hubbard_correction__ != nullptr) {
*hubbard_correction__ = sim_ctx.hubbard_correction();
}
if (fft_grid_size__ != nullptr) {
for (int x: {0, 1, 2}) {
fft_grid_size__[x] = sim_ctx.fft_grid()[x];
call_sirius([&]()
{
auto& sim_ctx = get_sim_ctx(handler__);
if (lmax_apw__ != nullptr) {
*lmax_apw__ = sim_ctx.lmax_apw();
}
}
if (lmax_rho__ != nullptr) {
*lmax_rho__ = sim_ctx.lmax_rho();
}
if (lmax_pot__ != nullptr) {
*lmax_pot__ = sim_ctx.lmax_pot();
}
if (num_fv_states__ != nullptr) {
*num_fv_states__ = sim_ctx.num_fv_states();
}
if (num_bands__ != nullptr) {
*num_bands__ = sim_ctx.num_bands();
}
if (num_mag_dims__ != nullptr) {
*num_mag_dims__ = sim_ctx.num_mag_dims();
}
if (pw_cutoff__ != nullptr) {
*pw_cutoff__ = sim_ctx.pw_cutoff();
}
if (gk_cutoff__ != nullptr) {
*gk_cutoff__ = sim_ctx.gk_cutoff();
}
if (auto_rmt__ != nullptr) {
*auto_rmt__ = sim_ctx.auto_rmt();
}
if (gamma_point__ != nullptr) {
*gamma_point__ = sim_ctx.gamma_point();
}
if (use_symmetry__ != nullptr) {
*use_symmetry__ = sim_ctx.use_symmetry();
}
if (so_correction__ != nullptr) {
*so_correction__ = sim_ctx.so_correction();
}
if (iter_solver_tol__ != nullptr) {
*iter_solver_tol__ = sim_ctx.iterative_solver_tolerance();
}
if (iter_solver_tol_empty__ != nullptr) {
*iter_solver_tol_empty__ = sim_ctx.iterative_solver_input().empty_states_tolerance_;
}
if (verbosity__ != nullptr) {
*verbosity__ = sim_ctx.control().verbosity_;
}
if (hubbard_correction__ != nullptr) {
*hubbard_correction__ = sim_ctx.hubbard_correction();
}
if (fft_grid_size__ != nullptr) {
for (int x: {0, 1, 2}) {
fft_grid_size__[x] = sim_ctx.fft_grid()[x];
}
}
if (evp_work_count__ != nullptr) {
*evp_work_count__ = sim_ctx.evp_work_count();
}
if (num_loc_op_applied__ != nullptr) {
*num_loc_op_applied__ = sim_ctx.num_loc_op_applied();
}
}, error_code__);
}


Expand Down Expand Up @@ -3581,5 +3596,4 @@ void sirius_set_callback_function(void* const* handler__, char const* label__, v
}, error_code__);
}


} // extern "C"
8 changes: 8 additions & 0 deletions src/mpi/communicator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,14 @@ class Communicator
return (j__ * (j__ + 1) / 2 + i__ + 1) << 6;
}

static std::string processor_name()
{
char name[MPI_MAX_PROCESSOR_NAME];
int len;
CALL_MPI(MPI_Get_processor_name, (name, &len));
return std::string(name, len);
}

/// Rank of MPI process inside communicator.
inline int rank() const
{
Expand Down
10 changes: 7 additions & 3 deletions src/simulation_context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#include "simulation_context.hpp"
#include "symmetry/find_lat_sym.hpp"
#include "utils/profiler.hpp"
#include "utils/env.hpp"

namespace sirius {

Expand Down Expand Up @@ -280,14 +281,17 @@ void Simulation_context::initialize()
/* initialize MPI communicators */
init_comm();

if (control().verbosity_ >= 3) {
auto print_mpi_layout = utils::get_env<int>("SIRIUS_PRINT_MPI_LAYOUT");

if (control().verbosity_ >= 3 || (print_mpi_layout && *print_mpi_layout)) {
pstdout pout(comm());
if (comm().rank() == 0) {
pout.printf("MPI rank placement\n");
pout.printf("------------------\n");
}
pout.printf("rank: %3i, comm_band_rank: %3i, comm_k_rank: %3i, hostname: %s\n", comm().rank(),
comm_band().rank(), comm_k().rank(), utils::hostname().c_str());
auto name = sddk::Communicator::processor_name();
pout.printf("rank: %3i, comm_band_rank: %3i, comm_k_rank: %3i, hostname: %s, mpi processor name: %s\n",
comm().rank(), comm_band().rank(), comm_k().rank(), utils::hostname().c_str(), name.c_str());
}

switch (processing_unit()) {
Expand Down

0 comments on commit 6df5b0b

Please sign in to comment.