Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Conversation

@simonpintarelli
Copy link
Collaborator

test_mempool.cpp failed to compile when the memory pool was disabled:

    /// Return a pointer to a memory block for n elements of type T.
    template <typename T>
    T*
    allocate(size_t num_elements__)
    {
#if defined(SIRIUS_USE_MEMORY_POOL)
        if (M_ == memory_t::none) {
            return nullptr;
        }

        return static_cast<T*>(memory_pool_allocator_.allocate(num_elements__ * sizeof(T)));
#else
        return sirius::allocate<T>(num_elements__, M_);
#endif
    }

Not quite clear to me why it allocate<T>(size_t , memory_t) from https://github.com/electronic-structure/SIRIUS/blob/develop/src/core/memory.hpp#L169 was not considered. Adding sirius:: fixed it.

  1338    In file included from /home/simon/work/SIRIUS--wt-develop/apps/unit_tests/test_mempool.cpp:
             2:
     1339    /home/simon/work/SIRIUS--wt-develop/src/core/memory.hpp: In instantiation of 'T* sirius::me
             mory_pool::allocate(size_t) [with T = std::complex<double>; size_t = long unsigned int]':
     1340    /home/simon/work/SIRIUS--wt-develop/apps/unit_tests/test_mempool.cpp:14:50:   required from
              here
  >> 1341    /home/simon/work/SIRIUS--wt-develop/src/core/memory.hpp:364:27: error: no matching function
              for call to 'sirius::memory_pool::allocate<std::complex<double> >(size_t&, sirius::memory_
             t&)'
     1342      364 |         return allocate<T>(num_elements__, M_);
     1343          |                ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
     1344    /home/simon/work/SIRIUS--wt-develop/src/core/memory.hpp:355:5: note: candidate: 'template<c
             lass T> T* sirius::memory_pool::allocate(size_t)'
     1345      355 |     allocate(size_t num_elements__)
     1346          |     ^~~~~~~~
     1347    /home/simon/work/SIRIUS--wt-develop/src/core/memory.hpp:355:5: note:   candidate expects 1 
             argument, 2 provided
     1348    /home/simon/work/SIRIUS--wt-develop/src/core/memory.hpp: In instantiation of 'T* sirius::me
             mory_pool::allocate(size_t) [with T = double; size_t = long unsigned int]':
     1349    /home/simon/work/SIRIUS--wt-develop/apps/unit_tests/test_mempool.cpp:49:46:   required from
              here

@toxa81 toxa81 merged commit ef93a25 into develop Dec 14, 2023
@simonpintarelli simonpintarelli deleted the fix/compilation-error branch December 15, 2023 08:43
toxa81 added a commit that referenced this pull request Jan 4, 2024
* [update] bump version; add link to discourse.group (#930)

* [refactor] get rid of template in radial_integrals_sum_L3() (#932)

* apply @simonpintarelli proposed code change

* get rid of one more tempale

* default: -> throw, whitespace

* fix

* apply format

---------

Co-authored-by: Simon Pintarelli <simon.pintarelli@cscs.ch>

* [fix] subspace initialization in test_lr_solver (#934)

* [cmake] remove std::filesystem target (#936)

std::filesystem is part of C++17 which is required via CXX_STANDARD, there is no
need to check for it explicitly

* [fix] compilation error for ~memory_pool+tests (#939)

* Ci/rebuild base image (#942)

* CI: rebuild base images / pin spack to v0.21
* CI: use anonymous environments instead of dev-build with SPEC
* avoid creating partitions with empty intervals in COSTA `custom_layout`



---------

Co-authored-by: Anton Kozhevnikov <toxa81@gmail.com>

* [fix] truncate very small occupation numbers to 0 (#943)

* [refactor] minor cleaups (#938)

* minor cleaups
* apply format

* [cmake] add missing REQUIRED (#945)

* [fix] scalar-relativistic radial solver (#941)

Introduce a few fixes for the scalar-relativistic radial solver.

* [feature] port lr_addusdens to sirius (#937)

Use a different sequence of operations to compute G+q augmentation charge.

---------

Co-authored-by: Simon Pintarelli <simon.pintarelli@cscs.ch>
Co-authored-by: Simon Pintarelli <1237199+simonpintarelli@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.