![]() |
NeoPZ
|
Performance tests on NUMA architecture. More...
#include <iostream>#include <cstdlib>#include "pzbfilestream.h"#include "pzmd5stream.h"#include "pzlog.h"#include <fstream>#include <string>#include "pzskylmat.h"#include "arglib.h"#include "run_stats_table.h"#include <sched.h>#include <pthread.h>Go to the source code of this file.
Classes | |
| class | FileStreamWrapper |
| class | thread_timer_t |
| class | synchronized_threads_t |
| struct | synchronized_threads_t::thread_arg_t |
Macros | |
| #define | VERBOSE(level, ...) |
| #define | SET_RANGE(mskp, start, end) |
| #define | CASE_OP(opid, method) |
Functions | |
| void | help (const char *prg) |
| void | setup_masks () |
| void | set_affinity (int af, int tidx) |
| void | init_decompose (int idx) |
| void | compute_decompose (int idx) |
| void * | threadfunc (void *parm) |
| int | main (int argc, char *argv[]) |
Variables | |
| clarg::argString | ifn ("-ifn", "input matrix file name (use -bi to read from binary files)", "matrix.txt") |
| clarg::argInt | affinity ("-af", "affinity mode (0=no affinity, 1=heuristi 1)", 0) |
| clarg::argInt | verb_level ("-v", "verbosity level", 0) |
| int | verbose |
| clarg::argInt | mop ("-op", "Matrix operation", 1) |
| clarg::argBool | br ("-br", "binary reference. Reference decomposed matrix file format == binary.", false) |
| clarg::argBool | bi ("-bi", "binary input. Input file format == binary.", false) |
| clarg::argBool | bd ("-bd", "binary dump. Dump file format == binary.", false) |
| clarg::argBool | h ("-h", "help message", false) |
| clarg::argBool | copy_matrix_inside_thread ("-cot", "copy on thread - copy matrix inside thread.", false) |
| clarg::argInt | mstats ("-mstats", "Matrix statistics vebosity level.", 0) |
| clarg::argInt | maxcol ("-maxcol", "Limit computation to max column (Use Resize(maxcol)).", 0) |
| clarg::argString | gen_dm_sig ("-gen_dm_md5", "generates MD5 signature for decomposed matrix into file.", "decomposed_matrix.md5") |
| clarg::argString | chk_dm_sig ("-chk_dm_md5", "compute MD5 signature for decomposed matrix and check against MD5 at file.", "decomposed_matrix.md5") |
| clarg::argString | chk_dm_error ("-chk_dm_error", "check the decomposed matrix error against a reference matrix. (use -br to read from binary files)", "ref_decomposed_matrix.txt") |
| clarg::argDouble | error_tol ("-error_tol", "error tolerance.", 1.e-12) |
| clarg::argString | dump_dm ("-dump_dm", "dump decomposed matrix. (use -bd for binary format)", "dump_matrix.txt") |
| clarg::argInt | cholesky_blk ("-chol_blk", "Cholesky blocking factor", 256) |
| RunStatsTable | total_rst ("-tot_rdt", "Whole program (total) statistics raw data table") |
| clarg::argInt | nmats ("-nmats", "Number of matrizes to decompose simultaneously.", 1) |
| std::vector< TPZSkylMatrix< REAL > *> | matrices |
| TPZSkylMatrix< REAL > | matrix |
| int | nthreads_initialized |
| int | nthreads |
| bool | wait_for_all_init |
| std::vector< thread_timer_t > | thread_timer |
| pthread_cond_t | cond |
| pthread_cond_t | main_cond |
| pthread_mutex_t | glob_mutex |
| pthread_mutex_t | main_mutex |
| bool | run_parallel |
| #define CASE_OP | ( | opid, | |
| method | |||
| ) |
Referenced by compute_decompose().
| #define SET_RANGE | ( | mskp, | |
| start, | |||
| end | |||
| ) |
Referenced by setup_masks().
| #define VERBOSE | ( | level, | |
| ... | |||
| ) |
Definition at line 64 of file numatst.cpp.
Referenced by main(), set_affinity(), and threadfunc().
| void compute_decompose | ( | int | idx | ) |
Definition at line 268 of file numatst.cpp.
References CASE_OP, cholesky_blk, clarg::argT< T >::get_value(), and mop.
Referenced by main().
| void help | ( | const char * | prg | ) |
Definition at line 46 of file numatst.cpp.
References affinity, clarg::arguments_descriptions(), ifn, and verb_level.
Referenced by main().
| void init_decompose | ( | int | idx | ) |
Definition at line 257 of file numatst.cpp.
References clarg::argT< T >::get_value(), matrix, and set_affinity().
Referenced by main().
| int main | ( | int | argc, |
| char * | argv[] | ||
| ) |
Dump decomposed matrix
Check decomposed matrix
Definition at line 457 of file numatst.cpp.
References abs(), bd, bi, br, TPZMD5Stream::CheckMD5(), chk_dm_error, chk_dm_sig, TPZMatrix< TVar >::Cols(), compute_decompose(), TPZMatrix< TVar >::Dim(), dump_dm, error_tol, synchronized_threads_t::execute_n_threads(), gen_dm_sig, clarg::argT< T >::get_value(), h, help(), init_decompose(), maxcol, mstats, nmats, FileStreamWrapper::OpenRead(), FileStreamWrapper::OpenWrite(), clarg::parse_arguments(), TPZSkylMatrix< TVar >::Read(), TPZSkylMatrix< TVar >::Resize(), TPZSkylMatrix< TVar >::s(), setup_masks(), TPZSkylMatrix< TVar >::SkyHeight(), clarg::values(), VERBOSE, clarg::arg_base::was_set(), TPZSkylMatrix< TVar >::Write(), and TPZMD5Stream::WriteMD5().
| void set_affinity | ( | int | af, |
| int | tidx | ||
| ) |
| void setup_masks | ( | ) |
| void* threadfunc | ( | void * | parm | ) |
Definition at line 367 of file numatst.cpp.
References synchronized_threads_t::thread_arg_t::cond, synchronized_threads_t::thread_arg_t::glob_mutex, synchronized_threads_t::thread_arg_t::init_routine, synchronized_threads_t::thread_arg_t::main_cond, synchronized_threads_t::thread_arg_t::parallel_routine, synchronized_threads_t::thread_arg_t::tid, and VERBOSE.
Referenced by synchronized_threads_t::execute_n_threads().
| clarg::argInt affinity("-af", "affinity mode (0=no affinity, 1=heuristi 1)", 0) |
Referenced by help().
| clarg::argBool bd("-bd", "binary dump. Dump file format == binary.", false) |
Referenced by main().
| clarg::argBool bi("-bi", "binary input. Input file format == binary.", false) |
Referenced by main().
| clarg::argBool br("-br", "binary reference. Reference decomposed matrix file format == binary.", false) |
Referenced by main().
| clarg::argString chk_dm_error("-chk_dm_error", "check the decomposed matrix error against a reference matrix. (use -br to read from binary files)", "ref_decomposed_matrix.txt") |
Referenced by main().
| clarg::argString chk_dm_sig("-chk_dm_md5", "compute MD5 signature for decomposed matrix and check against MD5 at file.", "decomposed_matrix.md5") |
Referenced by main().
| clarg::argInt cholesky_blk("-chol_blk", "Cholesky blocking factor", 256) |
Referenced by compute_decompose().
| pthread_cond_t cond |
Definition at line 318 of file numatst.cpp.
Referenced by BuildElementGroups(), TPZCompMesh::CleanUp(), ComputeError(), TPZCompMeshTools::CreatedCondensedElements(), TPZHybridizeHDiv::GroupandCondenseElements(), pz_pthread_log_report(), ResetMesh(), TPZCompMeshTools::UnCondensedElements(), TCedricTest::UnwrapElements(), and TPZSubCompMesh::~TPZSubCompMesh().
| clarg::argBool copy_matrix_inside_thread("-cot", "copy on thread - copy matrix inside thread.", false) |
| clarg::argString dump_dm("-dump_dm", "dump decomposed matrix. (use -bd for binary format)", "dump_matrix.txt") |
Referenced by main().
| clarg::argDouble error_tol("-error_tol", "error tolerance.", 1.e-12) |
Referenced by main().
| clarg::argString gen_dm_sig("-gen_dm_md5", "generates MD5 signature for decomposed matrix into file.", "decomposed_matrix.md5") |
Referenced by main().
| pthread_mutex_t glob_mutex |
Definition at line 320 of file numatst.cpp.
| clarg::argBool h("-h", "help message", false) |
Referenced by main().
| clarg::argString ifn("-ifn", "input matrix file name (use -bi to read from binary files)", "matrix.txt") |
Referenced by help().
| pthread_cond_t main_cond |
Definition at line 319 of file numatst.cpp.
| pthread_mutex_t main_mutex |
Definition at line 321 of file numatst.cpp.
| std::vector< TPZSkylMatrix<REAL>* > matrices |
Definition at line 127 of file numatst.cpp.
| TPZSkylMatrix<REAL> matrix |
Definition at line 255 of file numatst.cpp.
Referenced by TPZStructMatrixTBBFlow::Assemble(), TPZPlasticDiagnostic::CheckGlobal(), dump_matrix_stats(), TPZBlockDiagonal< STATE >::GetSizeofBlock(), init_decompose(), main(), PYBIND11_MODULE(), run_decompose_cholesky(), run_decompose_ldlt(), TPZPlane::SetPlane(), TPZMatrixSolver< STATE >::SetReferenceMatrix(), TPZFrontSym< TVar >::TensorProductIJ(), TPZDiffMatrix< T >::TPZDiffMatrix(), TPZDiffMatrix< T >::Transpose(), TPZSequenceSolver< TVar >::UpdateFrom(), TPZStepSolver< TVar >::UpdateFrom(), TPZSkylNSymMatrix< TVar >::UpdateFrom(), TPZMatrixSolver< STATE >::UpdateFrom(), TPZSkylMatrix< TVar >::UpdateFrom(), VisualMatrixDX(), VisualMatrixVTK(), and TPZStructMatrixTBBFlow::Write().
| clarg::argInt maxcol("-maxcol", "Limit computation to max column (Use Resize(maxcol)).", 0) |
Referenced by main().
| clarg::argInt mop("-op", "Matrix operation", 1) |
Referenced by compute_decompose().
| clarg::argInt mstats("-mstats", "Matrix statistics vebosity level.", 0) |
Referenced by main().
| clarg::argInt nmats("-nmats", "Number of matrizes to decompose simultaneously.", 1) |
Referenced by main().
| int nthreads |
Definition at line 315 of file numatst.cpp.
Referenced by TPZParFrontStructMatrix< front >::Assemble(), TPZSkylParMatrix< TVar >::Decompose_LDLt(), synchronized_threads_t::execute_n_threads(), main(), TPZSkylParMatrix< TVar >::main_nada(), pz::parallel_for(), process_arr(), TPZAnalysis::SetThreadsForError(), TPZFront< TVar >::STensorProductMTData::STensorProductMTData(), thread_map1(), TPZStructMatrixOT::ThreadData::ThreadWork(), TPZStructMatrixOT::ThreadData::ThreadWorkResidual(), TPZFront< STATE >::TPZFront(), and TPZFront< TVar >::STensorProductMTData::~STensorProductMTData().
| int nthreads_initialized |
Definition at line 314 of file numatst.cpp.
| bool run_parallel |
Definition at line 322 of file numatst.cpp.
| std::vector<thread_timer_t> thread_timer |
Definition at line 317 of file numatst.cpp.
| RunStatsTable total_rst("-tot_rdt", "Whole program (total) statistics raw data table") |
Referenced by synchronized_threads_t::execute_n_threads().
| clarg::argInt verb_level("-v", "verbosity level", 0) |
Referenced by help().
| int verbose |
Definition at line 62 of file numatst.cpp.
| bool wait_for_all_init |
Definition at line 316 of file numatst.cpp.
1.8.13