ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
Loading...
Searching...
No Matches
test_hs_dense_io.cpp File Reference

Unit tests for ModuleIO::save_mat. More...

#include <gtest/gtest.h>
#include "source_io/module_hs/hs_dense_io.h"
#include "source_base/parallel_blkcyc.h"
#include "source_base/parallel_comm.h"
#include "source_basis/module_ao/parallel_orbitals.h"
#include <algorithm>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <fstream>
#include <sstream>
#include <string>
#include <vector>
#include <mpi.h>
#include "source_base/module_parallel/para_mpi_func.h"
Include dependency graph for test_hs_dense_io.cpp:

Functions

 TEST (HsDenseIoSaveMat, TextHeaderContainsStepAndDimension)
 TEST (HsDenseIoSaveMat, TextHeaderStepTwo)
 TEST (HsDenseIoSaveMat, TextHeaderGammaOnlyDouble)
 TEST (HsDenseIoSaveMat, TextHeaderGammaOnlyComplex)
 TEST (HsDenseIoSaveMat, BinaryDimHeaderDouble)
 TEST (HsDenseIoSaveMat, BinaryDimHeaderComplex)
 TEST (HsDenseIoSaveMat, BinaryGammaUpperTriangle)
 TEST (HsDenseIoSaveMat, BinaryComplexUpperTriangleMpiReduction)
 TEST (HsDenseIoSaveMat, BinaryAppendCompleteRecordsAndOverwrite)
 TEST (HsDenseIoSaveMat, TextAppendTwoStepsAndFirstStepTruncates)
 TEST (HsDenseIoSaveMat, TextPrecisionFollowsArgument)
int main (int argc, char **argv)

Detailed Description

Unit tests for ModuleIO::save_mat.

save_mat writes a square matrix in text or binary upper-triangle/full format. When built with __MPI (the project default), save_mat uses MPI collectives and MPI_Barrier. This test provides a main() that calls MPI_Init first so the MPI path is safe on a single rank. Header-only tests use a default-constructed/serial Parallel_Blkcyclic and do not check values; the binary upper-triangle tests distribute a known matrix over a real Parallel_Orbitals and verify the gathered payload.

Function Documentation

◆ main()

int main ( int argc,
char ** argv )

◆ TEST() [1/11]

TEST ( HsDenseIoSaveMat ,
BinaryAppendCompleteRecordsAndOverwrite  )
Here is the call graph for this function:

◆ TEST() [2/11]

TEST ( HsDenseIoSaveMat ,
BinaryComplexUpperTriangleMpiReduction  )
Here is the call graph for this function:

◆ TEST() [3/11]

TEST ( HsDenseIoSaveMat ,
BinaryDimHeaderComplex  )
Here is the call graph for this function:

◆ TEST() [4/11]

TEST ( HsDenseIoSaveMat ,
BinaryDimHeaderDouble  )
Here is the call graph for this function:

◆ TEST() [5/11]

TEST ( HsDenseIoSaveMat ,
BinaryGammaUpperTriangle  )
Here is the call graph for this function:

◆ TEST() [6/11]

TEST ( HsDenseIoSaveMat ,
TextAppendTwoStepsAndFirstStepTruncates  )
Here is the call graph for this function:

◆ TEST() [7/11]

TEST ( HsDenseIoSaveMat ,
TextHeaderContainsStepAndDimension  )
Here is the call graph for this function:

◆ TEST() [8/11]

TEST ( HsDenseIoSaveMat ,
TextHeaderGammaOnlyComplex  )
Here is the call graph for this function:

◆ TEST() [9/11]

TEST ( HsDenseIoSaveMat ,
TextHeaderGammaOnlyDouble  )
Here is the call graph for this function:

◆ TEST() [10/11]

TEST ( HsDenseIoSaveMat ,
TextHeaderStepTwo  )
Here is the call graph for this function:

◆ TEST() [11/11]

TEST ( HsDenseIoSaveMat ,
TextPrecisionFollowsArgument  )
Here is the call graph for this function: