Giter VIP home page Giter VIP logo

Comments (10)

dsambit avatar dsambit commented on June 9, 2024

@davidkleiven From the attached setup.sh I can see you are linking to dealii 9.2.0-pre. The instructions in the manual specify installing a forked version of the dealii library from

$ git clone -b dealiiStable https://github.com/dftfeDevelopers/dealii.git

Please let me know if using the above forked dealii repo resolves your issue.

from dftfe.

davidkleiven avatar davidkleiven commented on June 9, 2024

Ok, I missed that we needed the forked version. However, when using the forked version I get the following

-- Performing Test PETSC_LIBRARY_m
-- Performing Test PETSC_LIBRARY_m - Success
-- Performing Test PETSC_LIBRARY_pthread
-- Performing Test PETSC_LIBRARY_pthread - Success
-- Performing Test PETSC_LIBRARY_dl
-- Performing Test PETSC_LIBRARY_dl - Success
-- Found PETSC_LIBRARY_mpifort
-- Found PETSC_LIBRARY_mpi
-- Performing Test PETSC_LIBRARY_gfortran
-- Performing Test PETSC_LIBRARY_gfortran - Success
-- Performing Test PETSC_LIBRARY_quadmath
-- Performing Test PETSC_LIBRARY_quadmath - Success
--   PETSC_VERSION: 3.1.2.0
--   PETSC_LIBRARIES: /home/davidkleiven/.local/lib/dftfe/petscreal/lib/libpetsc.so;/usr/lib64/liblapack.so;/usr/lib64/libblas.so;m;pthread;dl;/usr/lib64/mpich/lib/libmpifort.so;/usr/lib64/mpich/lib/libmpi.so;gfortran;m;gfortran;m;quadmath;dl
--   PETSC_INCLUDE_DIRS: /home/davidkleiven/.local/lib/dftfe/petscreal/include;/home/davidkleiven/.local/lib/dftfe/petscreal/include;/home/davidkleiven/.local/lib/dftfe/petscreal/include
--   PETSC_USER_INCLUDE_DIRS: /home/davidkleiven/.local/lib/dftfe/petscreal/include;/home/davidkleiven/.local/lib/dftfe/petscreal/include;/home/davidkleiven/.local/lib/dftfe/petscreal/include
-- Found PETSC
-- Could not find a sufficiently modern PETSc installation: Version >=3.3.0 required!
-- DEAL_II_WITH_PETSC has unmet external dependencies.

However, if I look in the petscversion.h source

#define PETSC_VERSION_RELEASE    1
#define PETSC_VERSION_MAJOR      3
#define PETSC_VERSION_MINOR      11
#define PETSC_VERSION_SUBMINOR   2
#define PETSC_VERSION_PATCH      0
#define PETSC_RELEASE_DATE       "Mar, 29, 2019"
#define PETSC_VERSION_DATE       "May, 18, 2019"

so the version is newer than 3.3.In the fork the last commit for FindPETSC.cmake is dated June 6 2018, but in the official deal.II version there is a commit dated September 17 2018 with the commit message fix petsc version 3.10 works now too (minor version was found by the regexp as "0" and not "10"). Does this deal.II fork extract the versions correct when the minor version has two digits?

from dftfe.

davidkleiven avatar davidkleiven commented on June 9, 2024

By replacing FindPETSC.cmake and FindSLEPC.cmake by the ones in the official version, I can confirm that the configuration finished without errors on my system.

from dftfe.

davidkleiven avatar davidkleiven commented on June 9, 2024

With the forked version, the compilation still fails. I am not sure about the origin, as it is not nessecarily the forked deal.II files that fails. It seems to be something in slepc, but when I run the tests for the install slepc library they run fine. The error message I get when building the forked version of deal.II is

In file included from /home/davidkleiven/.local/include/slepceps.h:16,
                 from /home/davidkleiven/Documents/dealii_dftfe_fork/include/deal.II/lac/slepc_spectral_transformation.h:30,
                 from /home/davidkleiven/Documents/dealii_dftfe_fork/include/deal.II/lac/petsc_solver.h:32,
                 from /home/davidkleiven/Documents/dealii_dftfe_fork/source/lac/petsc_precondition.cc:25:
/home/davidkleiven/.local/include/slepcst.h:65:26: error: expected constructor, destructor, or type conversion before ‘(’ token
   65 | PETSC_DEPRECATED_FUNCTION("Use STGetMatrix()") PETSC_STATIC_INLINE PetscErrorCode STGetOperators(ST st,PetscInt k,Mat *A) {return STGetMatrix(st,k,A);}

from dftfe.

dsambit avatar dsambit commented on June 9, 2024

We never tested the forked dealii with latest versions of petsc and slepc. We mostly compile with petsc-3.9.2 and slepc-3.9.1 or lower versions. Could you try linking to these versions and using the un-modified dealii forked version?

I apologize for the confusion. I will make a note of this in the manual. Sometime this year, we plan to migrate to the latest deal.ii version.

from dftfe.

dsambit avatar dsambit commented on June 9, 2024

I have now updated the development version manual (https://github.com/dftfeDevelopers/dftfe/blob/manual/manual-develop.pdf). I would recommended using the development version of DFT-FE (publicGithubDevelop branch).

from dftfe.

davidkleiven avatar davidkleiven commented on June 9, 2024

Ok, now the original compilation error is resolved. The origin of that error was that I already had the official version of Deal.II installed and that the headers were located in a default location. When I uninstalled the official version, the original error disappeared. However, I think that the build system of DFT-FE should handle that, because you specify the deal.II location in setup.sh. In this case the headers that were loaded were collected from /home/username/.local/include even if the deal.II path was set to /home/username/.local/lib/dftfe/dealII which has the subfolders

  • examples
  • include
  • lib
  • share

when you specify the deal.II location, I think the build system should load the headers from that location and not a default location. @dsambit What do you think?

EDIT: Same seems to happen with PetSc and Slepc: If there are headers located in a default location, it appears like those are picked up before the headers in petsc_real and petsc_complex. If the wrong headers are read, the compilation of the real or complex version fails.

from dftfe.

davidkleiven avatar davidkleiven commented on June 9, 2024

Now the compilation works, but when the executables are linked I get an error:

[100%] Linking CXX executable dftfe
libdftfem.so: error: undefined reference to 'void dealii::FEValuesBase<3, 3>::get_function_values<dealii::LinearAlgebra::distributed::Vector<double, dealii::MemorySpace::Host> >(dealii::LinearAlgebra::distributed::Vector<double, dealii::MemorySpace::Host> const&, std::vector<dealii::LinearAlgebra::distributed::Vector<double, dealii::MemorySpace::Host>::value_type, std::allocator<dealii::LinearAlgebra::distributed::Vector<double, dealii::MemorySpace::Host>::value_type> >&) const'
libdftfem.so: error: undefined reference to 'dftfe::energyCalculator::computeEnergy(dealii::DoFHandler<3, 3> const&, dealii::DoFHandler<3, 3> const&, dealii::QGauss<3> const&, dealii::QGauss<3> const&, std::vector<std::vector<double, std::allocator<double> >, std::allocator<std::vector<double, std::allocator<double> > > > const&, std::vector<double, std::allocator<double> > const&, double, xc_func_type const&, xc_func_type const&, dealii::LinearAlgebra::distributed::Vector<double> const&, dealii::LinearAlgebra::distributed::Vector<double> const&, dealii::LinearAlgebra::distributed::Vector<double> const&, dealii::LinearAlgebra::distributed::Vector<double> const&, std::map<dealii::CellId, std::vector<double, std::allocator<double> >, std::less<dealii::CellId>, std::allocator<std::pair<dealii::CellId const, std::vector<double, std::allocator<double> > > > > const&, std::map<dealii::CellId, std::vector<double, std::allocator<double> >, std::less<dealii::CellId>, std::allocator<std::pair<dealii::CellId const, std::vector<double, std::allocator<double> > > > > const&, std::map<dealii::CellId, std::vector<double, std::allocator<double> >, std::less<dealii::CellId>, std::allocator<std::pair<dealii::CellId const, std::vector<double, std::allocator<double> > > > > const&, std::map<dealii::CellId, std::vector<double, std::allocator<double> >, std::less<dealii::CellId>, std::allocator<std::pair<dealii::CellId const, std::vector<double, std::allocator<double> > > > > const&, std::map<dealii::CellId, std::vector<double, std::allocator<double> >, std::less<dealii::CellId>, std::allocator<std::pair<dealii::CellId const, std::vector<double, std::allocator<double> > > > > const&, std::vector<std::vector<double, std::allocator<double> >, std::allocator<std::vector<double, std::allocator<double> > > > const&, std::map<dealii::CellId, std::vector<double, std::allocator<double> >, std::less<dealii::CellId>, std::allocator<std::pair<dealii::CellId const, std::vector<double, std::allocator<double> > > > > const&, std::map<dealii::CellId, std::vector<double, std::allocator<double> >, std::less<dealii::CellId>, std::allocator<std::pair<dealii::CellId const, std::vector<double, std::allocator<double> > > > > const&, std::map<unsigned long long, double, std::less<unsigned long long>, std::allocator<std::pair<unsigned long long const, double> > > const&, unsigned int, unsigned int, unsigned int, bool) const'
libdftfem.so: error: undefined reference to 'dftfe::energyCalculator::computeEnergySpinPolarized(dealii::DoFHandler<3, 3> const&, dealii::DoFHandler<3, 3> const&, dealii::QGauss<3> const&, dealii::QGauss<3> const&, std::vector<std::vector<double, std::allocator<double> >, std::allocator<std::vector<double, std::allocator<double> > > > const&, std::vector<double, std::allocator<double> > const&, double, double, double, xc_func_type const&, xc_func_type const&, dealii::LinearAlgebra::distributed::Vector<double> const&, dealii::LinearAlgebra::distributed::Vector<double> const&, dealii::LinearAlgebra::distributed::Vector<double> const&, dealii::LinearAlgebra::distributed::Vector<double> const&, std::map<dealii::CellId, std::vector<double, std::allocator<double> >, std::less<dealii::CellId>, std::allocator<std::pair<dealii::CellId const, std::vector<double, std::allocator<double> > > > > const&, std::map<dealii::CellId, std::vector<double, std::allocator<double> >, std::less<dealii::CellId>, std::allocator<std::pair<dealii::CellId const, std::vector<double, std::allocator<double> > > > > const&, std::map<dealii::CellId, std::vector<double, std::allocator<double> >, std::less<dealii::CellId>, std::allocator<std::pair<dealii::CellId const, std::vector<double, std::allocator<double> > > > > const&, std::map<dealii::CellId, std::vector<double, std::allocator<double> >, std::less<dealii::CellId>, std::allocator<std::pair<dealii::CellId const, std::vector<double, std::allocator<double> > > > > const&, std::map<dealii::CellId, std::vector<double, std::allocator<double> >, std::less<dealii::CellId>, std::allocator<std::pair<dealii::CellId const, std::vector<double, std::allocator<double> > > > > const&, std::map<dealii::CellId, std::vector<double, std::allocator<double> >, std::less<dealii::CellId>, std::allocator<std::pair<dealii::CellId const, std::vector<double, std::allocator<double> > > > > const&, std::map<dealii::CellId, std::vector<double, std::allocator<double> >, std::less<dealii::CellId>, std::allocator<std::pair<dealii::CellId const, std::vector<double, std::allocator<double> > > > > const&, std::map<dealii::CellId, std::vector<double, std::allocator<double> >, std::less<dealii::CellId>, std::allocator<std::pair<dealii::CellId const, std::vector<double, std::allocator<double> > > > > const&, std::map<dealii::CellId, std::vector<double, std::allocator<double> >, std::less<dealii::CellId>, std::allocator<std::pair<dealii::CellId const, std::vector<double, std::allocator<double> > > > > const&, std::vector<std::vector<double, std::allocator<double> >, std::allocator<std::vector<double, std::allocator<double> > > > const&, std::map<dealii::CellId, std::vector<double, std::allocator<double> >, std::less<dealii::CellId>, std::allocator<std::pair<dealii::CellId const, std::vector<double, std::allocator<double> > > > > const&, std::map<dealii::CellId, std::vector<double, std::allocator<double> >, std::less<dealii::CellId>, std::allocator<std::pair<dealii::CellId const, std::vector<double, std::allocator<double> > > > > const&, std::map<unsigned long long, double, std::less<unsigned long long>, std::allocator<std::pair<unsigned long long const, double> > > const&, unsigned int, unsigned int, unsigned int, bool) const'
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/dftfe.dir/build.make:113: dftfe] Error 1
make[1]: *** [CMakeFiles/Makefile2:393: CMakeFiles/dftfe.dir/all] Error 2
make: *** [Makefile:141: all] Error 2

from dftfe.

davidkleiven avatar davidkleiven commented on June 9, 2024

Ok, by removing all build files everything passed. Thanks a lot for your help! From my perspective there are a few thing that maybe could be considered concerning the build system

  • Not be sensitive to existing versions of deal.II, PetSc etc. when a path to each of these libraries are given.
  • As many users (including myself) in the first place are interested in testing the code and running a few small examples, I think it would be very useful to distribute a pre-compiled package (if the licences permit that...). This is of course not intended to be used for high performance computing, but for testing and running small tutorials to get a feeling for the program it is indeed useful.

In any case, thanks for your help.

Just for the record: How long does the demos typically take? For ex1 (on one processor) I got the message

...
Setting initial guess for wavefunctions....
Number of wavefunctions generated randomly to be used as initial guess for starting the SCF : 12
=============================================================================================================================
number of electrons: 10
number of eigen values: 12
=============================================================================================================================

Reading initial guess for electron-density.....
Initial total charge: 9.999999999999179323e+00

Pseudopotential initalization....
KSDFT problem initialization, wall time: 41.5652s.
Nuclear self-potential solve, wall time: 28.6255s.

************************Begin Self-Consistent-Field Iteration:  1 ***********************

and then nothing has happened for 21 minutes.

from dftfe.

dsambit avatar dsambit commented on June 9, 2024

Thank you for your feedback!

Not be sensitive to existing versions of deal.II, PetSc etc. when a path to each of these libraries are given.

We will soon be migrating to the latest dealii version, which will resolve such issues.

As many users (including myself) in the first place are interested in testing the code and running a few small examples, I think it would be very useful to distribute a pre-compiled package (if the licences permit that...). This is of course not intended to be used for high performance computing, but for testing and running small tutorials to get a feeling for the program it is indeed useful.

In the future, we are planning to have a Spack based installation capability.

Just for the record: How long does the demos typically take? For ex1 (on one processor) I got the message

From the /demo/ex1/ex1_a.output file which is run on 32 MPI tasks, it took 132 seconds. So on 1 processor the timings you are seeing are expected. As you are intend to just try out the code in the demo examples, you may use a very coarse FE mesh discretization which will enable you to run on 1 processor fast. Something like this

subsection Finite element mesh parameters
  set POLYNOMIAL ORDER=2
  subsection Auto mesh generation parameters
    set AUTO USER MESH PARAMS = true
    set MESH SIZE AROUND ATOM  = 0.8
  end
end

from dftfe.

Related Issues (3)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.