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

La3 ni2 o7 bilayer model #340

Open
wants to merge 23 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
d11cde9
added model files for La3Ni2O7 2-orbital bilayer model
maierta Jun 12, 2023
b9d73e8
Fixed interaction term in La3Ni2O7 model
maierta Jun 22, 2023
ae3e4f5
Fixed bug in La3Ni2O7 model file
maierta Jul 31, 2023
80767a8
Added two-orbital model files
maierta Aug 3, 2023
a630288
Change to getMultiBand
maierta Nov 15, 2023
5775a1b
Changed orbital indexing for PP G4
maierta Nov 15, 2023
7bcd84c
Fixed conjugation of G4
maierta Nov 15, 2023
6fe7cea
Merged master into La3Ni2O7_bilayer; compiles
maierta Sep 13, 2024
c2a94bb
Removed merge marker
maierta Sep 16, 2024
0a903dc
Added -r for non-local V interaction
maierta Oct 28, 2024
ce66dc0
Added non-density interaction to LNO model
maierta Oct 28, 2024
d67141e
Merged changes from master
maierta Nov 4, 2024
80e63d7
Merge branch 'master' into La3Ni2O7_bilayer
maierta Nov 6, 2024
c281ac6
Merge branch 'master' into La3Ni2O7_bilayer
PDoakORNL Nov 7, 2024
42d8f8f
Merge branch 'master' into La3Ni2O7_bilayer
PDoakORNL Nov 8, 2024
a6ad977
use reduce and bcast on root node vs all_reduce
PDoakORNL Jan 22, 2025
109dbe2
Merge branch 'change_mpi_collective' into La3Ni2O7_mpi_collective_change
PDoakORNL Jan 23, 2025
780aaa5
cuda 12.5 does not allow naive/user friendly use of copy to symbol
PDoakORNL Jan 23, 2025
90a7247
follwing HIP documentation with respect to symbol calls
PDoakORNL Jan 23, 2025
5633be2
Merge pull request #338 from PDoakORNL/La3Ni2O7_mpi_collective_change
PDoakORNL Jan 24, 2025
2e8bce9
post 2/18 update I can no longer hang Li3Ni2O7
PDoakORNL Feb 21, 2025
309d2f6
fixing another inconsistency with reader writer file existent check
PDoakORNL Feb 26, 2025
adfe99f
revert change MPI collectives add more debug tracing of init bcasts
PDoakORNL Feb 28, 2025
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
7 changes: 4 additions & 3 deletions applications/dca/main_dca.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@
#include "dca/io/writer.hpp"

int dca_main(int argc, char** argv) {
#ifdef DCA_HAVE_GPU
dca::linalg::util::initializeMagma();
#endif // DCA_HAVE_GPU

Concurrency concurrency(argc, argv);

try {
Expand Down Expand Up @@ -59,9 +63,6 @@ int dca_main(int argc, char** argv) {
<< std::endl;
}

#ifdef DCA_HAVE_GPU
dca::linalg::util::initializeMagma();
#endif // DCA_HAVE_GPU

// Create the parameters object from the input file.
ParametersType parameters(dca::util::GitVersion::string(), concurrency);
Expand Down
1 change: 0 additions & 1 deletion build-aux/frontier_rocm6_load_modules.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

module reset
module load rocm/6.0.0
module load libfabric/1.15.2.0
module load ninja
module load cmake

Expand Down
6 changes: 3 additions & 3 deletions build-aux/local_CPU.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ set(gtest_DIR "${CMAKE_CURRENT_LIST_DIR}/../libs/gmock-1.7.0/gtest/"

# HDF5
# CMake 3.6 does not properly find HDF5 if HDF5_ROOT is not set.
set(HDF5_ROOT "/usr/local/Cellar/hdf5/1.12.2_2/" CACHE PATH "Path to HDF5 installation directory.")
set(HDF5_ROOT "/opt/homebrew/Cellar/hdf5/1.14.4.3/" CACHE PATH "Path to HDF5 installation directory.")
# set(HDF5_ROOT "/usr/local/anaconda3/pkgs/hdf5-1.10.6-hdbbcd12_0/" CACHE PATH "Path to HDF5 installation directory.")

# FFTW
# set(FFTW_INCLUDE_DIR "/usr/local/Cellar/fftw/3.3.10/include" CACHE PATH "Path to fftw3.h.")
# set(FFTW_LIBRARY "/usr/local/Cellar/fftw/3.3.10/lib/libfftw3.a" CACHE FILEPATH "Path to FFTW3 library.")
set(FFTW_INCLUDE_DIR "/usr/local/anaconda3/pkgs/fftw-3.3.9-h9ed2024_1/include" CACHE PATH "Path to fftw3.h.")
set(FFTW_LIBRARY "/usr/local/anaconda3/pkgs/fftw-3.3.9-h9ed2024_1/lib/libfftw3.a" CACHE FILEPATH "Path to FFTW3 library.")
set(FFTW_INCLUDE_DIR "/opt/homebrew/Cellar/fftw/3.3.10_1/include" CACHE PATH "Path to fftw3.h.")
set(FFTW_LIBRARY "/opt/homebrew/Cellar/fftw/3.3.10_1/lib/libfftw3.a" CACHE FILEPATH "Path to FFTW3 library.")

mark_as_advanced(gtest_DIR SPRNG_DIR HDF5_ROOT)

Expand Down
16 changes: 13 additions & 3 deletions cmake/dca_config.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -121,15 +121,25 @@ endif()

# Lattice type
set(DCA_LATTICE "square" CACHE STRING "Lattice type, options are: bilayer | square | triangular |
Kagome | hund | twoband_Cu | threeband | Rashba_Hubbard | Moire_Hubbard | FeAs | material_NiO | material_FeSn ")
Kagome | hund | twoband_Cu | threeband | Rashba_Hubbard | Moire_Hubbard | FeAs | material_NiO | material_FeSn | La3Ni2O7_bilayer")
set_property(CACHE DCA_LATTICE PROPERTY STRINGS bilayer square triangular Kagome hund twoband_Cu threeband
Rashba_Hubbard Moire_Hubbard FeAs material_NiO material_FeSn)
Rashba_Hubbard Moire_Hubbard FeAs material_NiO material_FeSn La3Ni2O7_bilayer)

if (DCA_LATTICE STREQUAL "bilayer")
set(DCA_LATTICE_TYPE dca::phys::models::bilayer_lattice<PointGroup>)
set(DCA_LATTICE_INCLUDE
"dca/phys/models/analytic_hamiltonians/bilayer_lattice.hpp")

elseif (DCA_LATTICE STREQUAL "La3Ni2O7_bilayer")
set(DCA_LATTICE_TYPE dca::phys::models::La3Ni2O7_bilayer<PointGroup>)
set(DCA_LATTICE_INCLUDE
"dca/phys/models/analytic_hamiltonians/La3Ni2O7_bilayer.hpp")

elseif (DCA_LATTICE STREQUAL "twoOrbital")
set(DCA_LATTICE_TYPE dca::phys::models::twoOrbital<PointGroup>)
set(DCA_LATTICE_INCLUDE
"dca/phys/models/analytic_hamiltonians/twoOrbital.hpp")

elseif (DCA_LATTICE STREQUAL "square")
set(DCA_LATTICE_TYPE dca::phys::models::square_lattice<PointGroup>)
set(DCA_LATTICE_INCLUDE
Expand Down Expand Up @@ -182,7 +192,7 @@ elseif (DCA_LATTICE STREQUAL "material_FeSn")
"dca/phys/models/material_hamiltonians/material_lattice.hpp")
set(DCA_MODEL_IS_MATERIAL_LATTICE ON CACHE BOOL "is the model a material lattice")
else()
message(FATAL_ERROR "Please set DCA_LATTICE to a valid option: bilayer | square | triangular | Kagome | hund | twoband_Cu | threeband | Rashba_Hubbard | Moire_Hubbard | FeAs | material_NiO | material_FeSn.")
message(FATAL_ERROR "Please set DCA_LATTICE to a valid option: bilayer | La3Ni2O7_bilayer | square | triangular | Kagome | hund | twoband_Cu | threeband | Rashba_Hubbard | Moire_Hubbard | FeAs | material_NiO | material_FeSn.")
endif()

# Model type
Expand Down
164 changes: 98 additions & 66 deletions include/dca/linalg/matrix.hpp

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -626,7 +626,7 @@ inline void MPICollectiveSum::resolveSums() {
return resolveSumsImplementation<float>();
else if (current_type_ == MPI_CHAR)
return resolveSumsImplementation<char>();
//else if (current_type_ == MPI_BYTE)
// else if (current_type_ == MPI_BYTE)
else if (current_type_ == MPI_UNSIGNED_CHAR)
return resolveSumsImplementation<std::uint8_t>();
else if (current_type_ == MPI_SHORT)
Expand Down
35 changes: 34 additions & 1 deletion include/dca/phys/dca_data/dca_data.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -348,14 +348,36 @@ void DcaData<Parameters, DT>::read(const std::string& filename) {
read(reader);
reader.close_file();
}

concurrency_.broadcast(parameters_.get_chemical_potential());
#ifndef NDEBUG
if (concurrency_.id() == concurrency_.first()) {
std::cout << "broadcasted chemical potential: " << parameters_.get_chemical_potential() << '\n';
}
#endif
concurrency_.broadcast_object(Sigma);
#ifndef NDEBUG
if (concurrency_.id() == concurrency_.first()) {
std::cout << "broadcasted Sigma \n";
}
#endif

if (parameters_.isAccumulatingG4()) {
concurrency_.broadcast_object(G_k_w);
#ifndef NDEBUG
if (concurrency_.id() == concurrency_.first()) {
std::cout << "broadcasted G_k_w \n";
}
#endif

for (auto& G4_channel : G4_)
for (auto& G4_channel : G4_) {
concurrency_.broadcast_object(G4_channel);
#ifndef NDEBUG
if (concurrency_.id() == concurrency_.first()) {
std::cout << "broadcasted G4_channel \n";
}
#endif
}
}
}

Expand Down Expand Up @@ -533,6 +555,7 @@ void DcaData<Parameters, DT>::initializeH0_and_H_i() {
for (int nu2 = 0; nu2 < NuDmn::dmn_size(); ++nu2)
for (int nu1 = 0; nu1 < NuDmn::dmn_size(); ++nu1) {
if (std::abs(H_interactions(nu1, nu2, r) - H_interactions(nu2, nu1, minus_r)) > 1e-8) {
std::cout << r << " , " << minus_r << " , " << H_interactions(nu1, nu2, r) << " , " << H_interactions(nu2, nu1, minus_r) << "\n";
throw(std::logic_error("Double counting is not consistent."));
}
}
Expand Down Expand Up @@ -636,7 +659,17 @@ void DcaData<Parameters, DT>::initializeSigma(const std::string& filename) {
}
}
concurrency_.broadcast(parameters_.get_chemical_potential());
#ifndef NDEBUG
if (concurrency_.id() == concurrency_.first()) {
std::cout << "broadcasted chemical potential: " << parameters_.get_chemical_potential();
}
#endif
concurrency_.broadcast(Sigma);
#ifndef NDEBUG
if (concurrency_.id() == concurrency_.first()) {
std::cout << "broadcasted Sigma \n";
}
#endif
}

template <class Parameters, DistType DT>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,10 @@ protected:
// Global instance to be used in the tp accumulation kernel.
extern __device__ __constant__ G4Helper g4_helper;

extern __CONSTANT__ int* w_ex_indices_actual;
extern __CONSTANT__ int* k_ex_indices_actual;


inline __device__ int G4Helper::addWex(const int w_idx, const int w_ex_idx) const {
return w_idx + w_ex_indices_[w_ex_idx];
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class TpAccumulator<Parameters, DT, linalg::CPU> : public TpAccumulatorBase<Para
using Base = TpAccumulatorBase<Parameters, DT>;

using Real = typename Parameters::Real;

using typename Base::NuDmn;
using typename Base::TpPrecision;
using typename Base::TpComplex;
Expand Down Expand Up @@ -647,7 +647,7 @@ double TpAccumulator<Parameters, DT, linalg::CPU>::updateG4(const int channel_id
w_ex_minus_w(w1, w_ex), w_ex_minus_w(w2, w_ex), G_b_);
// getGMultiband(0, k2, k1, w2, w1, G_a_);
// getGMultiband(0, q_minus_k(k2, k_ex), q_minus_k(k1, k_ex),
// w_ex_minus_w(w2, w_ex), w_ex_minus_w(w1, w_ex), G_b_);
// w_ex_minus_w(w2, w_ex), w_ex_minus_w(w1, w_ex), G_b_);
for (int b4 = 0; b4 < BDmn::dmn_size(); ++b4)
for (int b3 = 0; b3 < BDmn::dmn_size(); ++b3)
for (int b2 = 0; b2 < BDmn::dmn_size(); ++b2)
Expand Down Expand Up @@ -752,7 +752,7 @@ void TpAccumulator<Parameters, DT, linalg::CPU>::updateG4Atomic(
// Assuming 0 = down 1 = up
//G_a = G[s_a]
//G_b = G[d_b]

if (!cross_legs)
for (int b4 = 0; b4 < n_bands_; ++b4)
for (int b3 = 0; b3 < n_bands_; ++b3)
Expand Down Expand Up @@ -810,7 +810,7 @@ void TpAccumulator<Parameters, DT, linalg::CPU>::updateG4SpinDifference(
// So G_a_ and G_b_ are accumulating over both spins for each band combination
getGMultiband(0, k1_a, k2_a, w1_a, w2_a, G_a_);
getGMultiband(1, k1_a, k2_a, w1_a, w2_a, G_a_, sign);

getGMultiband(0, k1_b, k2_b, w1_b, w2_b, G_b_);
getGMultiband(1, k1_b, k2_b, w1_b, w2_b, G_b_, sign);
// Assuming 0 = down 1 = up
Expand All @@ -820,7 +820,7 @@ void TpAccumulator<Parameters, DT, linalg::CPU>::updateG4SpinDifference(
// if sign == -1
// G_a_ = G_down(k1_a, k2_a, w1_a, w2_a) - G_up(k1_a, k2_a, w1_a, w2_a)
// G_b_ = G_down(k1_b, k2_b, w1_b, w2_b) - G_up(k1_b, k2_b, w1_b, w2_b)

if (!cross_legs)
for (int b4 = 0; b4 < n_bands_; ++b4)
for (int b3 = 0; b3 < n_bands_; ++b3)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,10 @@ namespace details {

class ClusterHelper {
public:
// Initialize real reciprocal cluster if mometnum == true.
static void set(int nc, const int* add, int lda, const int* sub, int lds, bool momentum);
/// Initialize real Cluster
static void set(int nc, const int* add, int lda, const int* sub, int lds);
/// Initialize reciprocal cluster
static void setMomentum(int nc, const int* add, int lda, const int* sub, int lds);

// Returns the index of id_1 + id_2.
__DEVICE__ inline int add(int id_1, int id_2) const;
Expand All @@ -39,12 +41,14 @@ public:
// returns the index of -id
__DEVICE__ inline int minus(int id) const;

private:
int nc_;
const int* add_matrix_;
const int* sub_matrix_;
};

extern __CONSTANT__ int* cluster_add_matrix;
extern __CONSTANT__ int* cluster_sub_matrix;

// Global instance for real space and momentum clusters.
extern __DEVICE__ __CONSTANT__ ClusterHelper cluster_real_helper;
extern __DEVICE__ __CONSTANT__ ClusterHelper cluster_momentum_helper;
Expand Down
Loading