Skip to content

Commit

Permalink
Deactivated hpc versions woodburry
Browse files Browse the repository at this point in the history
  • Loading branch information
scemama committed Feb 23, 2024
1 parent 574cde8 commit fd9ce7e
Showing 1 changed file with 45 additions and 50 deletions.
95 changes: 45 additions & 50 deletions org/qmckl_sherman_morrison_woodbury.org
Original file line number Diff line number Diff line change
Expand Up @@ -365,11 +365,11 @@ qmckl_exit_code qmckl_sm_naive_hpc(
const uint64_t LDS,
const uint64_t Dim,
const uint64_t N_updates,
const double* __restrict Updates,
const uint64_t* __restrict Updates_index,
const double* restrict Updates,
const uint64_t* restrict Updates_index,
const double breakdown,
double* __restrict Slater_inv,
double* __restrict determinant) {
double* restrict Slater_inv,
double* restrict determinant) {

if (qmckl_context_check(context) == QMCKL_NULL_CONTEXT) {
return qmckl_failwith( context,
Expand Down Expand Up @@ -435,11 +435,11 @@ qmckl_exit_code qmckl_sm_naive_hpc(
static inline qmckl_exit_code qmckl_sm_naive_{Dim}(
const qmckl_context context,
const uint64_t N_updates,
const double* __restrict Updates,
const uint64_t* __restrict Updates_index,
const double* restrict Updates,
const uint64_t* restrict Updates_index,
const double breakdown,
double* __restrict Slater_inv,
double* __restrict determinant) {
double* restrict Slater_inv,
double* restrict determinant) {

if (qmckl_context_check(context) == QMCKL_NULL_CONTEXT) {
return qmckl_failwith(context,
Expand Down Expand Up @@ -561,13 +561,14 @@ qmckl_exit_code qmckl_sm_naive(const qmckl_context context,
NULL);
}

#ifdef HAVE_HPC
#ifdef HAVE_HPC__BROKEN_WITH_CRAY
if (LDS == (1+(Dim-1)/SIMD_LENGTH)*SIMD_LENGTH) { // Most cases
switch (Dim) {
<<naive_switch-case_generator()>>
}
}
else { // Updating smaller sub-matrix
else
{ // Updating smaller sub-matrix
return qmckl_sm_naive_hpc(
context,
LDS,
Expand Down Expand Up @@ -1033,14 +1034,14 @@ qmckl_exit_code qmckl_sm_splitting_core_hpc(
uint64_t LDS,
uint64_t Dim,
uint64_t N_updates,
const double* __restrict Updates,
const uint64_t* __restrict Updates_index,
const double* restrict Updates,
const uint64_t* restrict Updates_index,
const double breakdown,
double* __restrict Slater_inv,
double* __restrict later_updates,
uint64_t* __restrict later_index,
uint64_t* __restrict later,
double* __restrict determinant) {
double* restrict Slater_inv,
double* restrict later_updates,
uint64_t* restrict later_index,
uint64_t* restrict later,
double* restrict determinant) {

if (qmckl_context_check(context) == QMCKL_NULL_CONTEXT) {
return qmckl_failwith(
Expand Down Expand Up @@ -1117,14 +1118,14 @@ qmckl_exit_code qmckl_sm_splitting_core_hpc(
static inline qmckl_exit_code qmckl_sm_splitting_core_{Dim}(
const qmckl_context context,
uint64_t N_updates,
const double* __restrict Updates,
const uint64_t* __restrict Updates_index,
const double* restrict Updates,
const uint64_t* restrict Updates_index,
const double breakdown,
double* __restrict Slater_inv,
double* __restrict later_updates,
uint64_t* __restrict later_index,
uint64_t* __restrict later,
double* __restrict determinant) {
double* restrict Slater_inv,
double* restrict later_updates,
uint64_t* restrict later_index,
uint64_t* restrict later,
double* restrict determinant) {

if (qmckl_context_check(context) == QMCKL_NULL_CONTEXT) {
return qmckl_failwith(
Expand Down Expand Up @@ -1252,7 +1253,7 @@ qmckl_exit_code qmckl_sm_splitting_core(
uint64_t* later,
double* determinant) {

#ifdef HAVE_HPC
#ifdef HAVE_HPC__BROKEN_WITH_CRAY
if (LDS == (1+(Dim-1)/SIMD_LENGTH)*SIMD_LENGTH) { // Most cases
switch (Dim) {
<<slagel_splitting_switch-case_generator()>>
Expand Down Expand Up @@ -1662,11 +1663,11 @@ qmckl_exit_code qmckl_woodbury_2x2_doc (
qmckl_exit_code qmckl_woodbury_2x2_hpc(const qmckl_context context,
const uint64_t LDS,
const uint64_t Dim,
const double* __restrict Updates,
const uint64_t* __restrict Updates_index,
const double* restrict Updates,
const uint64_t* restrict Updates_index,
const double breakdown,
double* __restrict Slater_inv,
double* __restrict determinant) {
double* restrict Slater_inv,
double* restrict determinant) {
/*
C := S^{-1} * U, dim x 2
B := 1 + V * C, 2 x 2
Expand All @@ -1688,8 +1689,6 @@ qmckl_exit_code qmckl_woodbury_2x2_hpc(const qmckl_context context,
for (uint64_t i = 0; i < Dim; i++) {
C[i * 2] = 0;
C[i * 2 + 1] = 0;
IVDEP
ALIGNED
for (uint64_t k = 0; k < LDS; k++) {
C[i * 2] += Slater_inv[i * LDS + k] * Updates[k];
C[i * 2 + 1] += Slater_inv[i * LDS + k] * Updates[LDS + k];
Expand Down Expand Up @@ -1723,17 +1722,13 @@ qmckl_exit_code qmckl_woodbury_2x2_hpc(const qmckl_context context,
double __attribute__((aligned(8))) tmp[2 * LDS];
double* r1dim = &(Slater_inv[row1 * LDS]);
double* r2dim = &(Slater_inv[row2 * LDS]);
IVDEP
ALIGNED
for (uint64_t j = 0; j < LDS; j++) {
tmp[j] = Binv[0] * r1dim[j] + Binv[1] * r2dim[j];
tmp[LDS + j] = Binv[2] * r1dim[j] + Binv[3] * r2dim[j];
}

// Compute (S^T)^{-1} - C * tmp : Dim x LDS
for (uint64_t i = 0; i < Dim; i++) {
IVDEP
ALIGNED
for (uint64_t j = 0; j < LDS; j++) {
Slater_inv[i * LDS + j] -= C[i * 2] * tmp[j];
Slater_inv[i * LDS + j] -= C[i * 2 + 1] * tmp[LDS + j];
Expand All @@ -1748,11 +1743,11 @@ qmckl_exit_code qmckl_woodbury_2x2_hpc(const qmckl_context context,
#+begin_src c
static inline qmckl_exit_code qmckl_woodbury_2x2_{Dim}(
const qmckl_context context,
const double* __restrict Updates,
const uint64_t* __restrict Updates_index,
const double* restrict Updates,
const uint64_t* restrict Updates_index,
const double breakdown,
double* __restrict Slater_inv,
double* __restrict determinant) {
double* restrict Slater_inv,
double* restrict determinant) {
/*
C := S^{-1} * U, dim x 2
B := 1 + V * C, 2 x 2
Expand Down Expand Up @@ -1883,7 +1878,7 @@ qmckl_exit_code qmckl_woodbury_2x2(const qmckl_context context,
NULL);
}

#ifdef HAVE_HPC
#ifdef HAVE_HPC__BROKEN_WITH_CRAY
if (LDS == (1+(Dim-1)/SIMD_LENGTH)*SIMD_LENGTH) { // Most cases
switch (Dim) {
<<woodbury_2x2_switch-case_generator()>>
Expand Down Expand Up @@ -2314,11 +2309,11 @@ qmckl_exit_code qmckl_woodbury_3x3_doc (
qmckl_exit_code qmckl_woodbury_3x3_hpc(const qmckl_context context,
const uint64_t LDS,
const uint64_t Dim,
const double* __restrict Updates,
const uint64_t* __restrict Updates_index,
const double* restrict Updates,
const uint64_t* restrict Updates_index,
const double breakdown,
double* __restrict Slater_inv,
double* __restrict determinant) {
double* restrict Slater_inv,
double* restrict determinant) {
/*
C := S^{-1} * U, dim x 3
B := 1 + V * C, 3 x 3
Expand Down Expand Up @@ -2420,11 +2415,11 @@ qmckl_exit_code qmckl_woodbury_3x3_hpc(const qmckl_context context,
#+begin_src c
static inline qmckl_exit_code qmckl_woodbury_3x3_{Dim}(
const qmckl_context context,
const double* __restrict Updates,
const uint64_t* __restrict Updates_index,
const double* restrict Updates,
const uint64_t* restrict Updates_index,
const double breakdown,
double* __restrict Slater_inv,
double* __restrict determinant) {
double* restrict Slater_inv,
double* restrict determinant) {
/*
C := S^{-1} * U, dim x 3
B := 1 + V * C, 3 x 3
Expand Down Expand Up @@ -2575,7 +2570,7 @@ qmckl_exit_code qmckl_woodbury_3x3(const qmckl_context context,
NULL);
}

#ifdef HAVE_HPC
#ifdef HAVE_HPC__BROKEN_WITH_CRAY
if (LDS == (1+(Dim-1)/SIMD_LENGTH)*SIMD_LENGTH) { // Most cases
switch (Dim) {
<<woodbury_3x3_switch-case_generator()>>
Expand Down Expand Up @@ -3037,7 +3032,7 @@ qmckl_exit_code qmckl_sm_splitting(
"qmckl_sm_splitting",
NULL);
}
#ifdef HAVE_HPC
#ifdef HAVE_HPC__BROKEN_WITH_CRAY
return qmckl_sm_splitting_hpc(
context,
LDS,
Expand Down

0 comments on commit fd9ce7e

Please sign in to comment.