NeoPZ
Classes | Macros | Functions | Variables
numatst.cpp File Reference

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>
Include dependency graph for numatst.cpp:

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_tthread_timer
 
pthread_cond_t cond
 
pthread_cond_t main_cond
 
pthread_mutex_t glob_mutex
 
pthread_mutex_t main_mutex
 
bool run_parallel
 

Detailed Description

Performance tests on NUMA architecture.

Author
Edson Borin
Since
2012

Definition in file numatst.cpp.

Macro Definition Documentation

◆ CASE_OP

#define CASE_OP (   opid,
  method 
)

Referenced by compute_decompose().

◆ SET_RANGE

#define SET_RANGE (   mskp,
  start,
  end 
)

Referenced by setup_masks().

◆ VERBOSE

#define VERBOSE (   level,
  ... 
)

Definition at line 64 of file numatst.cpp.

Referenced by main(), set_affinity(), and threadfunc().

Function Documentation

◆ compute_decompose()

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().

◆ help()

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().

◆ init_decompose()

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().

◆ main()

int main ( int  argc,
char *  argv[] 
)

◆ set_affinity()

void set_affinity ( int  af,
int  tidx 
)

Definition at line 202 of file numatst.cpp.

References VERBOSE.

Referenced by init_decompose().

◆ setup_masks()

void setup_masks ( )

Definition at line 161 of file numatst.cpp.

References SET_RANGE.

Referenced by main().

◆ threadfunc()

void* threadfunc ( void *  parm)

Variable Documentation

◆ affinity

clarg::argInt affinity("-af", "affinity mode (0=no affinity, 1=heuristi 1)", 0)

Referenced by help().

◆ bd

clarg::argBool bd("-bd", "binary dump. Dump file format == binary.", false)

Referenced by main().

◆ bi

clarg::argBool bi("-bi", "binary input. Input file format == binary.", false)

Referenced by main().

◆ br

clarg::argBool br("-br", "binary reference. Reference decomposed matrix file format == binary.", false)

Referenced by main().

◆ chk_dm_error

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().

◆ chk_dm_sig

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().

◆ cholesky_blk

clarg::argInt cholesky_blk("-chol_blk", "Cholesky blocking factor", 256)

Referenced by compute_decompose().

◆ cond

pthread_cond_t cond

◆ copy_matrix_inside_thread

clarg::argBool copy_matrix_inside_thread("-cot", "copy on thread - copy matrix inside thread.", false)

◆ dump_dm

clarg::argString dump_dm("-dump_dm", "dump decomposed matrix. (use -bd for binary format)", "dump_matrix.txt")

Referenced by main().

◆ error_tol

clarg::argDouble error_tol("-error_tol", "error tolerance.", 1.e-12)

Referenced by main().

◆ gen_dm_sig

clarg::argString gen_dm_sig("-gen_dm_md5", "generates MD5 signature for decomposed matrix into file.", "decomposed_matrix.md5")

Referenced by main().

◆ glob_mutex

pthread_mutex_t glob_mutex

Definition at line 320 of file numatst.cpp.

◆ h

clarg::argBool h("-h", "help message", false)

Referenced by main().

◆ ifn

clarg::argString ifn("-ifn", "input matrix file name (use -bi to read from binary files)", "matrix.txt")

Referenced by help().

◆ main_cond

pthread_cond_t main_cond

Definition at line 319 of file numatst.cpp.

◆ main_mutex

pthread_mutex_t main_mutex

Definition at line 321 of file numatst.cpp.

◆ matrices

std::vector< TPZSkylMatrix<REAL>* > matrices

Definition at line 127 of file numatst.cpp.

◆ matrix

TPZSkylMatrix<REAL> matrix

◆ maxcol

clarg::argInt maxcol("-maxcol", "Limit computation to max column (Use Resize(maxcol)).", 0)

Referenced by main().

◆ mop

clarg::argInt mop("-op", "Matrix operation", 1)

Referenced by compute_decompose().

◆ mstats

clarg::argInt mstats("-mstats", "Matrix statistics vebosity level.", 0)

Referenced by main().

◆ nmats

clarg::argInt nmats("-nmats", "Number of matrizes to decompose simultaneously.", 1)

Referenced by main().

◆ nthreads

int nthreads

◆ nthreads_initialized

int nthreads_initialized

Definition at line 314 of file numatst.cpp.

◆ run_parallel

bool run_parallel

Definition at line 322 of file numatst.cpp.

◆ thread_timer

std::vector<thread_timer_t> thread_timer

Definition at line 317 of file numatst.cpp.

◆ total_rst

RunStatsTable total_rst("-tot_rdt", "Whole program (total) statistics raw data table")

◆ verb_level

clarg::argInt verb_level("-v", "verbosity level", 0)

Referenced by help().

◆ verbose

int verbose

Definition at line 62 of file numatst.cpp.

◆ wait_for_all_init

bool wait_for_all_init

Definition at line 316 of file numatst.cpp.