mirror of
https://github.com/paboyle/Grid.git
synced 2025-04-04 19:25:56 +01:00
Changed the colouring classes
This commit is contained in:
parent
339be37dba
commit
565e9329ba
BIN
benchmarks/Benchmark_dwf_ntpf
Executable file
BIN
benchmarks/Benchmark_dwf_ntpf
Executable file
Binary file not shown.
BIN
benchmarks/Benchmark_zmm
Executable file
BIN
benchmarks/Benchmark_zmm
Executable file
Binary file not shown.
27
configure
vendored
27
configure
vendored
@ -721,6 +721,7 @@ infodir
|
|||||||
docdir
|
docdir
|
||||||
oldincludedir
|
oldincludedir
|
||||||
includedir
|
includedir
|
||||||
|
runstatedir
|
||||||
localstatedir
|
localstatedir
|
||||||
sharedstatedir
|
sharedstatedir
|
||||||
sysconfdir
|
sysconfdir
|
||||||
@ -802,6 +803,7 @@ datadir='${datarootdir}'
|
|||||||
sysconfdir='${prefix}/etc'
|
sysconfdir='${prefix}/etc'
|
||||||
sharedstatedir='${prefix}/com'
|
sharedstatedir='${prefix}/com'
|
||||||
localstatedir='${prefix}/var'
|
localstatedir='${prefix}/var'
|
||||||
|
runstatedir='${localstatedir}/run'
|
||||||
includedir='${prefix}/include'
|
includedir='${prefix}/include'
|
||||||
oldincludedir='/usr/include'
|
oldincludedir='/usr/include'
|
||||||
docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
|
docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
|
||||||
@ -1054,6 +1056,15 @@ do
|
|||||||
| -silent | --silent | --silen | --sile | --sil)
|
| -silent | --silent | --silen | --sile | --sil)
|
||||||
silent=yes ;;
|
silent=yes ;;
|
||||||
|
|
||||||
|
-runstatedir | --runstatedir | --runstatedi | --runstated \
|
||||||
|
| --runstate | --runstat | --runsta | --runst | --runs \
|
||||||
|
| --run | --ru | --r)
|
||||||
|
ac_prev=runstatedir ;;
|
||||||
|
-runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
|
||||||
|
| --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \
|
||||||
|
| --run=* | --ru=* | --r=*)
|
||||||
|
runstatedir=$ac_optarg ;;
|
||||||
|
|
||||||
-sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
|
-sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
|
||||||
ac_prev=sbindir ;;
|
ac_prev=sbindir ;;
|
||||||
-sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
|
-sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
|
||||||
@ -1191,7 +1202,7 @@ fi
|
|||||||
for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
|
for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
|
||||||
datadir sysconfdir sharedstatedir localstatedir includedir \
|
datadir sysconfdir sharedstatedir localstatedir includedir \
|
||||||
oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
|
oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
|
||||||
libdir localedir mandir
|
libdir localedir mandir runstatedir
|
||||||
do
|
do
|
||||||
eval ac_val=\$$ac_var
|
eval ac_val=\$$ac_var
|
||||||
# Remove trailing slashes.
|
# Remove trailing slashes.
|
||||||
@ -1344,6 +1355,7 @@ Fine tuning of the installation directories:
|
|||||||
--sysconfdir=DIR read-only single-machine data [PREFIX/etc]
|
--sysconfdir=DIR read-only single-machine data [PREFIX/etc]
|
||||||
--sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
|
--sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
|
||||||
--localstatedir=DIR modifiable single-machine data [PREFIX/var]
|
--localstatedir=DIR modifiable single-machine data [PREFIX/var]
|
||||||
|
--runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run]
|
||||||
--libdir=DIR object code libraries [EPREFIX/lib]
|
--libdir=DIR object code libraries [EPREFIX/lib]
|
||||||
--includedir=DIR C header files [PREFIX/include]
|
--includedir=DIR C header files [PREFIX/include]
|
||||||
--oldincludedir=DIR C header files for non-gcc [/usr/include]
|
--oldincludedir=DIR C header files for non-gcc [/usr/include]
|
||||||
@ -2569,7 +2581,7 @@ test -n "$target_alias" &&
|
|||||||
NONENONEs,x,x, &&
|
NONENONEs,x,x, &&
|
||||||
program_prefix=${target_alias}-
|
program_prefix=${target_alias}-
|
||||||
|
|
||||||
am__api_version='1.14'
|
am__api_version='1.15'
|
||||||
|
|
||||||
# Find a good install program. We prefer a C program (faster),
|
# Find a good install program. We prefer a C program (faster),
|
||||||
# so one script is as good as another. But avoid the broken or
|
# so one script is as good as another. But avoid the broken or
|
||||||
@ -2741,8 +2753,8 @@ test "$program_suffix" != NONE &&
|
|||||||
ac_script='s/[\\$]/&&/g;s/;s,x,x,$//'
|
ac_script='s/[\\$]/&&/g;s/;s,x,x,$//'
|
||||||
program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"`
|
program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"`
|
||||||
|
|
||||||
# expand $ac_aux_dir to an absolute path
|
# Expand $ac_aux_dir to an absolute path.
|
||||||
am_aux_dir=`cd $ac_aux_dir && pwd`
|
am_aux_dir=`cd "$ac_aux_dir" && pwd`
|
||||||
|
|
||||||
if test x"${MISSING+set}" != xset; then
|
if test x"${MISSING+set}" != xset; then
|
||||||
case $am_aux_dir in
|
case $am_aux_dir in
|
||||||
@ -2761,7 +2773,7 @@ else
|
|||||||
$as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;}
|
$as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if test x"${install_sh}" != xset; then
|
if test x"${install_sh+set}" != xset; then
|
||||||
case $am_aux_dir in
|
case $am_aux_dir in
|
||||||
*\ * | *\ *)
|
*\ * | *\ *)
|
||||||
install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
|
install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
|
||||||
@ -3089,8 +3101,8 @@ MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
|
|||||||
# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
|
# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
|
||||||
mkdir_p='$(MKDIR_P)'
|
mkdir_p='$(MKDIR_P)'
|
||||||
|
|
||||||
# We need awk for the "check" target. The system "awk" is bad on
|
# We need awk for the "check" target (and possibly the TAP driver). The
|
||||||
# some platforms.
|
# system "awk" is bad on some platforms.
|
||||||
# Always define AMTAR for backward compatibility. Yes, it's still used
|
# Always define AMTAR for backward compatibility. Yes, it's still used
|
||||||
# in the wild :-( We should find a proper way to deprecate it ...
|
# in the wild :-( We should find a proper way to deprecate it ...
|
||||||
AMTAR='$${TAR-tar}'
|
AMTAR='$${TAR-tar}'
|
||||||
@ -3149,6 +3161,7 @@ END
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
ac_config_headers="$ac_config_headers lib/Config.h"
|
ac_config_headers="$ac_config_headers lib/Config.h"
|
||||||
|
|
||||||
# Check whether --enable-silent-rules was given.
|
# Check whether --enable-silent-rules was given.
|
||||||
|
41
lib/Init.cc
41
lib/Init.cc
@ -237,24 +237,33 @@ void Grid_init(int *argc,char ***argv)
|
|||||||
std::cout<<GridLogMessage<<"\tvComplexD : "<<sizeof(vComplexD)*8 <<"bits ; " <<GridCmdVectorIntToString(GridDefaultSimd(4,vComplexD::Nsimd()))<<std::endl;
|
std::cout<<GridLogMessage<<"\tvComplexD : "<<sizeof(vComplexD)*8 <<"bits ; " <<GridCmdVectorIntToString(GridDefaultSimd(4,vComplexD::Nsimd()))<<std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::string COL_RED = GridLogColours.colour["RED"];
|
||||||
|
std::string COL_PURPLE = GridLogColours.colour["PURPLE"];
|
||||||
|
std::string COL_BLACK = GridLogColours.colour["BLACK"];
|
||||||
|
std::string COL_GREEN = GridLogColours.colour["GREEN"];
|
||||||
|
std::string COL_BLUE = GridLogColours.colour["BLUE"];
|
||||||
|
std::string COL_YELLOW = GridLogColours.colour["YELLOW"];
|
||||||
|
std::string COL_BACKGROUND = GridLogColours.colour["NORMAL"];
|
||||||
|
|
||||||
|
|
||||||
std::cout <<std::endl;
|
std::cout <<std::endl;
|
||||||
std::cout <<Logger::RED << "__|__|__|__|__"<< "|__|__|_"<<Logger::PURPLE<<"_|__|__|"<< "__|__|__|__|__"<<std::endl;
|
std::cout <<COL_RED << "__|__|__|__|__"<< "|__|__|_"<<COL_PURPLE<<"_|__|__|"<< "__|__|__|__|__"<<std::endl;
|
||||||
std::cout <<Logger::RED << "__|__|__|__|__"<< "|__|__|_"<<Logger::PURPLE<<"_|__|__|"<< "__|__|__|__|__"<<std::endl;
|
std::cout <<COL_RED << "__|__|__|__|__"<< "|__|__|_"<<COL_PURPLE<<"_|__|__|"<< "__|__|__|__|__"<<std::endl;
|
||||||
std::cout <<Logger::RED << "__|__| | | "<< "| | | "<<Logger::PURPLE<<" | | |"<< " | | | _|__"<<std::endl;
|
std::cout <<COL_RED << "__|__| | | "<< "| | | "<<COL_PURPLE<<" | | |"<< " | | | _|__"<<std::endl;
|
||||||
std::cout <<Logger::RED << "__|__ "<< " "<<Logger::PURPLE<<" "<< " _|__"<<std::endl;
|
std::cout <<COL_RED << "__|__ "<< " "<<COL_PURPLE<<" "<< " _|__"<<std::endl;
|
||||||
std::cout <<Logger::RED << "__|_ "<<Logger::GREEN<<" GGGG "<<Logger::RED<<" RRRR "<<Logger::BLUE <<" III "<<Logger::PURPLE<<"DDDD "<<Logger::PURPLE<<" _|__"<<std::endl;
|
std::cout <<COL_RED << "__|_ "<<COL_GREEN<<" GGGG "<<COL_RED<<" RRRR "<<COL_BLUE <<" III "<<COL_PURPLE<<"DDDD "<<COL_PURPLE<<" _|__"<<std::endl;
|
||||||
std::cout <<Logger::RED << "__|_ "<<Logger::GREEN<<"G "<<Logger::RED<<" R R "<<Logger::BLUE <<" I "<<Logger::PURPLE<<"D D "<<Logger::PURPLE<<" _|__"<<std::endl;
|
std::cout <<COL_RED << "__|_ "<<COL_GREEN<<"G "<<COL_RED<<" R R "<<COL_BLUE <<" I "<<COL_PURPLE<<"D D "<<COL_PURPLE<<" _|__"<<std::endl;
|
||||||
std::cout <<Logger::RED << "__|_ "<<Logger::GREEN<<"G "<<Logger::RED<<" R R "<<Logger::BLUE <<" I "<<Logger::PURPLE<<"D D"<<Logger::PURPLE<<" _|__"<<std::endl;
|
std::cout <<COL_RED << "__|_ "<<COL_GREEN<<"G "<<COL_RED<<" R R "<<COL_BLUE <<" I "<<COL_PURPLE<<"D D"<<COL_PURPLE<<" _|__"<<std::endl;
|
||||||
std::cout <<Logger::BLUE << "__|_ "<<Logger::GREEN<<"G GG "<<Logger::RED<<" RRRR "<<Logger::BLUE <<" I "<<Logger::PURPLE<<"D D"<<Logger::GREEN <<" _|__"<<std::endl;
|
std::cout <<COL_BLUE << "__|_ "<<COL_GREEN<<"G GG "<<COL_RED<<" RRRR "<<COL_BLUE <<" I "<<COL_PURPLE<<"D D"<<COL_GREEN <<" _|__"<<std::endl;
|
||||||
std::cout <<Logger::BLUE << "__|_ "<<Logger::GREEN<<"G G "<<Logger::RED<<" R R "<<Logger::BLUE <<" I "<<Logger::PURPLE<<"D D "<<Logger::GREEN <<" _|__"<<std::endl;
|
std::cout <<COL_BLUE << "__|_ "<<COL_GREEN<<"G G "<<COL_RED<<" R R "<<COL_BLUE <<" I "<<COL_PURPLE<<"D D "<<COL_GREEN <<" _|__"<<std::endl;
|
||||||
std::cout <<Logger::BLUE << "__|_ "<<Logger::GREEN<<" GGGG "<<Logger::RED<<" R R "<<Logger::BLUE <<" III "<<Logger::PURPLE<<"DDDD "<<Logger::GREEN <<" _|__"<<std::endl;
|
std::cout <<COL_BLUE << "__|_ "<<COL_GREEN<<" GGGG "<<COL_RED<<" R R "<<COL_BLUE <<" III "<<COL_PURPLE<<"DDDD "<<COL_GREEN <<" _|__"<<std::endl;
|
||||||
std::cout <<Logger::BLUE << "__|__ "<< " "<<Logger::GREEN <<" "<< " _|__"<<std::endl;
|
std::cout <<COL_BLUE << "__|__ "<< " "<<COL_GREEN <<" "<< " _|__"<<std::endl;
|
||||||
std::cout <<Logger::BLUE << "__|__|__|__|__"<< "|__|__|_"<<Logger::GREEN <<"_|__|__|"<< "__|__|__|__|__"<<std::endl;
|
std::cout <<COL_BLUE << "__|__|__|__|__"<< "|__|__|_"<<COL_GREEN <<"_|__|__|"<< "__|__|__|__|__"<<std::endl;
|
||||||
std::cout <<Logger::BLUE << "__|__|__|__|__"<< "|__|__|_"<<Logger::GREEN <<"_|__|__|"<< "__|__|__|__|__"<<std::endl;
|
std::cout <<COL_BLUE << "__|__|__|__|__"<< "|__|__|_"<<COL_GREEN <<"_|__|__|"<< "__|__|__|__|__"<<std::endl;
|
||||||
std::cout <<Logger::BLUE << " | | | | "<< "| | | "<<Logger::GREEN <<" | | |"<< " | | | | "<<std::endl;
|
std::cout <<COL_BLUE << " | | | | "<< "| | | "<<COL_GREEN <<" | | |"<< " | | | | "<<std::endl;
|
||||||
std::cout << std::endl;
|
std::cout << std::endl;
|
||||||
std::cout << std::endl;
|
std::cout << std::endl;
|
||||||
std::cout <<Logger::YELLOW<< std::endl;
|
std::cout <<COL_YELLOW<< std::endl;
|
||||||
std::cout << "Copyright (C) 2015 Peter Boyle, Azusa Yamaguchi, Guido Cossu, Antonin Portelli and other authors"<<std::endl;
|
std::cout << "Copyright (C) 2015 Peter Boyle, Azusa Yamaguchi, Guido Cossu, Antonin Portelli and other authors"<<std::endl;
|
||||||
std::cout << "Colours by Tadahito Boyle "<<std::endl;
|
std::cout << "Colours by Tadahito Boyle "<<std::endl;
|
||||||
std::cout << std::endl;
|
std::cout << std::endl;
|
||||||
@ -267,7 +276,7 @@ void Grid_init(int *argc,char ***argv)
|
|||||||
std::cout << "but WITHOUT ANY WARRANTY; without even the implied warranty of"<<std::endl;
|
std::cout << "but WITHOUT ANY WARRANTY; without even the implied warranty of"<<std::endl;
|
||||||
std::cout << "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the"<<std::endl;
|
std::cout << "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the"<<std::endl;
|
||||||
std::cout << "GNU General Public License for more details."<<std::endl;
|
std::cout << "GNU General Public License for more details."<<std::endl;
|
||||||
std::cout << Logger::BLACK <<std::endl;
|
std::cout << COL_BACKGROUND <<std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
35
lib/Log.cc
35
lib/Log.cc
@ -31,26 +31,18 @@ Author: paboyle <paboyle@ph.ed.ac.uk>
|
|||||||
#include <Grid.h>
|
#include <Grid.h>
|
||||||
|
|
||||||
namespace Grid {
|
namespace Grid {
|
||||||
|
|
||||||
GridStopWatch Logger::StopWatch;
|
GridStopWatch Logger::StopWatch;
|
||||||
std::ostream Logger::devnull(0);
|
std::ostream Logger::devnull(0);
|
||||||
std::string Logger::BLACK("\033[30m");
|
|
||||||
std::string Logger::RED("\033[31m");
|
Colours GridLogColours (0);
|
||||||
std::string Logger::GREEN("\033[32m");
|
GridLogger GridLogError (1,"Error",GridLogColours, "RED");
|
||||||
std::string Logger::YELLOW("\033[33m");
|
GridLogger GridLogWarning (1,"Warning",GridLogColours, "YELLOW");
|
||||||
std::string Logger::BLUE("\033[34m");
|
GridLogger GridLogMessage (1,"Message",GridLogColours, "NORMAL");
|
||||||
std::string Logger::PURPLE("\033[35m");
|
GridLogger GridLogDebug (1,"Debug",GridLogColours, "PURPLE");
|
||||||
std::string Logger::CYAN("\033[36m");
|
GridLogger GridLogPerformance(1,"Performance",GridLogColours, "GREEN");
|
||||||
std::string Logger::WHITE("\033[37m");
|
GridLogger GridLogIterative (1,"Iterative",GridLogColours, "BLUE");
|
||||||
std::string Logger::NORMAL("\033[0;39m");
|
GridLogger GridLogIntegrator (1,"Integrator",GridLogColours, "BLUE");
|
||||||
|
|
||||||
GridLogger GridLogError (1,"Error",Logger::RED);
|
|
||||||
GridLogger GridLogWarning (1,"Warning",Logger::YELLOW);
|
|
||||||
GridLogger GridLogMessage (1,"Message",Logger::BLACK);
|
|
||||||
GridLogger GridLogDebug (1,"Debug",Logger::PURPLE);
|
|
||||||
GridLogger GridLogPerformance(1,"Performance",Logger::GREEN);
|
|
||||||
GridLogger GridLogIterative (1,"Iterative",Logger::BLUE);
|
|
||||||
GridLogger GridLogIntegrator (1,"Integrator",Logger::BLUE);
|
|
||||||
|
|
||||||
void GridLogConfigure(std::vector<std::string> &logstreams)
|
void GridLogConfigure(std::vector<std::string> &logstreams)
|
||||||
{
|
{
|
||||||
@ -61,6 +53,7 @@ void GridLogConfigure(std::vector<std::string> &logstreams)
|
|||||||
GridLogDebug.Active(0);
|
GridLogDebug.Active(0);
|
||||||
GridLogPerformance.Active(0);
|
GridLogPerformance.Active(0);
|
||||||
GridLogIntegrator.Active(0);
|
GridLogIntegrator.Active(0);
|
||||||
|
GridLogColours.Active(0);
|
||||||
|
|
||||||
for(int i=0;i<logstreams.size();i++){
|
for(int i=0;i<logstreams.size();i++){
|
||||||
if ( logstreams[i]== std::string("Error") ) GridLogError.Active(1);
|
if ( logstreams[i]== std::string("Error") ) GridLogError.Active(1);
|
||||||
@ -70,6 +63,8 @@ void GridLogConfigure(std::vector<std::string> &logstreams)
|
|||||||
if ( logstreams[i]== std::string("Debug") ) GridLogDebug.Active(1);
|
if ( logstreams[i]== std::string("Debug") ) GridLogDebug.Active(1);
|
||||||
if ( logstreams[i]== std::string("Performance") ) GridLogPerformance.Active(1);
|
if ( logstreams[i]== std::string("Performance") ) GridLogPerformance.Active(1);
|
||||||
if ( logstreams[i]== std::string("Integrator" ) ) GridLogIntegrator.Active(1);
|
if ( logstreams[i]== std::string("Integrator" ) ) GridLogIntegrator.Active(1);
|
||||||
|
if ( logstreams[i]== std::string("Colours" ) ) GridLogColours.Active(1);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
120
lib/Log.h
120
lib/Log.h
@ -27,45 +27,94 @@ Author: Peter Boyle <paboyle@ph.ed.ac.uk>
|
|||||||
See the full license in the file "LICENSE" in the top level distribution directory
|
See the full license in the file "LICENSE" in the top level distribution directory
|
||||||
*************************************************************************************/
|
*************************************************************************************/
|
||||||
/* END LEGAL */
|
/* END LEGAL */
|
||||||
|
|
||||||
|
#include <map>
|
||||||
|
|
||||||
#ifndef GRID_LOG_H
|
#ifndef GRID_LOG_H
|
||||||
#define GRID_LOG_H
|
#define GRID_LOG_H
|
||||||
namespace Grid {
|
namespace Grid {
|
||||||
|
|
||||||
// Dress the output; use std::chrono for time stamping via the StopWatch class
|
// Dress the output; use std::chrono for time stamping via the StopWatch class
|
||||||
|
|
||||||
|
|
||||||
class Logger {
|
class Colours{
|
||||||
protected:
|
protected:
|
||||||
|
bool is_active;
|
||||||
|
public:
|
||||||
|
std::map<std::string, std::string> colour;
|
||||||
|
|
||||||
|
|
||||||
|
Colours(bool activate=false){
|
||||||
|
Active(activate);
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
void Active(bool activate){
|
||||||
|
is_active=activate;
|
||||||
|
|
||||||
|
if (is_active){
|
||||||
|
colour["BLACK"] ="\033[30m";
|
||||||
|
colour["RED"] ="\033[31m";
|
||||||
|
colour["GREEN"] ="\033[32m";
|
||||||
|
colour["YELLOW"] ="\033[33m";
|
||||||
|
colour["BLUE"] ="\033[34m";
|
||||||
|
colour["PURPLE"] ="\033[35m";
|
||||||
|
colour["CYAN"] ="\033[36m";
|
||||||
|
colour["WHITE"] ="\033[37m";
|
||||||
|
colour["NORMAL"] ="\033[0;39m";
|
||||||
|
} else {
|
||||||
|
std::cout << "Switching off colours\n";
|
||||||
|
colour["BLACK"] ="";
|
||||||
|
colour["RED"] ="";
|
||||||
|
colour["GREEN"] ="";
|
||||||
|
colour["YELLOW"]="";
|
||||||
|
colour["BLUE"] ="";
|
||||||
|
colour["PURPLE"]="";
|
||||||
|
colour["CYAN"] ="";
|
||||||
|
colour["WHITE"] ="";
|
||||||
|
colour["NORMAL"]="";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
class Logger {
|
||||||
|
protected:
|
||||||
|
Colours &Painter;
|
||||||
int active;
|
int active;
|
||||||
std::string name, topName, COLOUR;
|
std::string name, topName;
|
||||||
public:
|
std::string COLOUR;
|
||||||
|
|
||||||
|
public:
|
||||||
static GridStopWatch StopWatch;
|
static GridStopWatch StopWatch;
|
||||||
static std::ostream devnull;
|
static std::ostream devnull;
|
||||||
|
|
||||||
static std::string BLACK;
|
|
||||||
static std::string RED ;
|
|
||||||
static std::string GREEN;
|
|
||||||
static std::string YELLOW;
|
|
||||||
static std::string BLUE ;
|
|
||||||
static std::string PURPLE;
|
|
||||||
static std::string CYAN ;
|
|
||||||
static std::string WHITE ;
|
|
||||||
static std::string NORMAL;
|
|
||||||
|
|
||||||
Logger(std::string topNm, int on, std::string nm,std::string col)
|
std::string background() {return Painter.colour["NORMAL"];}
|
||||||
: active(on), name(nm), topName(topNm), COLOUR(col) {};
|
std::string evidence() {return Painter.colour["YELLOW"];}
|
||||||
|
std::string colour() {return Painter.colour[COLOUR];}
|
||||||
|
|
||||||
void Active(int on) {active = on;};
|
Logger(std::string topNm, int on, std::string nm, Colours& col_class, std::string col)
|
||||||
int isActive(void) {return active;};
|
: active(on),
|
||||||
|
name(nm),
|
||||||
friend std::ostream& operator<< (std::ostream& stream, const Logger& log){
|
topName(topNm),
|
||||||
if ( log.active ) {
|
Painter(col_class),
|
||||||
|
COLOUR(col){} ;
|
||||||
|
|
||||||
|
void Active(int on) {active = on;};
|
||||||
|
int isActive(void) {return active;};
|
||||||
|
|
||||||
|
friend std::ostream& operator<< (std::ostream& stream, Logger& log){
|
||||||
|
|
||||||
|
if ( log.active ) {
|
||||||
StopWatch.Stop();
|
StopWatch.Stop();
|
||||||
GridTime now = StopWatch.Elapsed();
|
GridTime now = StopWatch.Elapsed();
|
||||||
StopWatch.Start();
|
StopWatch.Start();
|
||||||
stream << BLACK<< log.topName << BLACK<< " : ";
|
stream << log.background()<< log.topName << log.background()<< " : ";
|
||||||
stream << log.COLOUR <<std::setw(10) << std::left << log.name << BLACK << " : ";
|
stream << log.colour() <<std::setw(10) << std::left << log.name << log.background() << " : ";
|
||||||
stream << YELLOW<< now <<BLACK << " : " << log.COLOUR;
|
stream << log.evidence()<< now << log.background() << " : " << log.colour();
|
||||||
return stream;
|
return stream;
|
||||||
} else {
|
} else {
|
||||||
return devnull;
|
return devnull;
|
||||||
@ -76,18 +125,21 @@ public:
|
|||||||
|
|
||||||
class GridLogger: public Logger {
|
class GridLogger: public Logger {
|
||||||
public:
|
public:
|
||||||
GridLogger(int on, std::string nm, std::string col = Logger::BLACK): Logger("Grid", on, nm, col){};
|
GridLogger(int on, std::string nm, Colours&col_class, std::string col_key = "NORMAL"):
|
||||||
|
Logger("Grid", on, nm, col_class, col_key){};
|
||||||
};
|
};
|
||||||
|
|
||||||
void GridLogConfigure(std::vector<std::string> &logstreams);
|
void GridLogConfigure(std::vector<std::string> &logstreams);
|
||||||
|
|
||||||
extern GridLogger GridLogError;
|
extern GridLogger GridLogError;
|
||||||
extern GridLogger GridLogWarning;
|
extern GridLogger GridLogWarning;
|
||||||
extern GridLogger GridLogMessage;
|
extern GridLogger GridLogMessage;
|
||||||
extern GridLogger GridLogDebug ;
|
extern GridLogger GridLogDebug ;
|
||||||
extern GridLogger GridLogPerformance;
|
extern GridLogger GridLogPerformance;
|
||||||
extern GridLogger GridLogIterative ;
|
extern GridLogger GridLogIterative ;
|
||||||
extern GridLogger GridLogIntegrator ;
|
extern GridLogger GridLogIntegrator ;
|
||||||
|
extern Colours GridLogColours;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -99,7 +99,7 @@ namespace Grid {
|
|||||||
typedef typename Impl::SiteSpinor SiteSpinor; \
|
typedef typename Impl::SiteSpinor SiteSpinor; \
|
||||||
typedef typename Impl::SiteHalfSpinor SiteHalfSpinor; \
|
typedef typename Impl::SiteHalfSpinor SiteHalfSpinor; \
|
||||||
typedef typename Impl::Compressor Compressor; \
|
typedef typename Impl::Compressor Compressor; \
|
||||||
typedef typename Impl::StencilImpl StencilImpl; \
|
typedef typename Impl::StencilImpl StencilImpl; \
|
||||||
typedef typename Impl::ImplParams ImplParams;
|
typedef typename Impl::ImplParams ImplParams;
|
||||||
|
|
||||||
#define INHERIT_IMPL_TYPES(Base) \
|
#define INHERIT_IMPL_TYPES(Base) \
|
||||||
|
@ -1 +0,0 @@
|
|||||||
timestamp for lib/Config.h
|
|
@ -607,7 +607,7 @@ int main (int argc, char ** argv)
|
|||||||
} // loop for omp
|
} // loop for omp
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
// Testing Smearing routine compilation, separate in a different file
|
// Testing Smearing routine compilation, separate in a different file
|
||||||
GridCartesian Fine(latt_size,simd_layout,mpi_layout);
|
GridCartesian Fine(latt_size,simd_layout,mpi_layout);
|
||||||
Smear_APE< PeriodicGimplR > APEsmearing; // periodic gauge implemetation
|
Smear_APE< PeriodicGimplR > APEsmearing; // periodic gauge implemetation
|
||||||
@ -615,6 +615,6 @@ int main (int argc, char ** argv)
|
|||||||
SmearedConfiguration< PeriodicGimplR > SmartConf(&Fine, 3, StoutSmearing);
|
SmearedConfiguration< PeriodicGimplR > SmartConf(&Fine, 3, StoutSmearing);
|
||||||
|
|
||||||
std::cout<<GridLogMessage << sizeof(vComplexF) << std::endl;
|
std::cout<<GridLogMessage << sizeof(vComplexF) << std::endl;
|
||||||
|
*/
|
||||||
Grid_finalize();
|
Grid_finalize();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user