fastm/BHgpu  1.5
Быстрые алгоритмы в вихревых методах моделирования плоских течений
Logo.h
См. документацию.
1 /*--------------------------------*- BHgpu -*----------------*---------------*\
2 | ##### ## ## | | Version 1.5 |
3 | ## ## ## ## #### ## ## | BHgpu: Barnes-Hut method | 2023/08/29 |
4 | ##### ###### ## ## ## | for 2D vortex particles *----------------*
5 | ## ## ## ## ## ## ## | Open Source Code |
6 | ##### ## ## #### #### | https://www.github.com/vortexmethods/fastm |
7 | |
8 | Copyright (C) 2020-2023 I. Marchevsky, E. Ryatina, A. Kolganova |
9 | Copyright (C) 2013, Texas State University-San Marcos. All rights reserved. |
10 *-----------------------------------------------------------------------------*
11 | File name: Logo.h |
12 | Info: Source code of BHgpu |
13 | |
14 | This file is part of BHgpu. |
15 | BHcu is free software: you can redistribute it and/or modify it |
16 | under the terms of the GNU General Public License as published by |
17 | the Free Software Foundation, either version 3 of the License, or |
18 | (at your option) any later version. |
19 | |
20 | BHcu is distributed in the hope that it will be useful, but WITHOUT |
21 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
22 | FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
23 | for more details. |
24 | |
25 | You should have received a copy of the GNU General Public License |
26 | along with BHgpu. If not, see <http://www.gnu.org/licenses/>. |
27 \*---------------------------------------------------------------------------*/
28 
39 #ifndef LOGO_H_
40 #define LOGO_H_
41 
42 #include <fstream>
43 #include "Params.h"
44 
45 namespace BHcu
46 {
47 
48  void PrintLogoToStream(std::ostream& str)
49  {
50  str <<
51  "/*--------------------------------*- BHgpu -*----------------*---------------*\\" << '\n' << \
52  "| ##### ## ## | | Version 1.5 |" << '\n' << \
53  "| ## ## ## ## #### ## ## | BHcu: Barnes-Hut method | 2023/08/29 |" << '\n' << \
54  "| ##### ###### ## ## ## | for 2D vortex particles *----------------*" << '\n' << \
55  "| ## ## ## ## ## ## ## | Open Source Code |" << '\n' << \
56  "| ##### ## ## #### #### | https://www.github.com/vortexmethods/fastm |" << '\n' << \
57  "| |" << '\n' << \
58  "| Copyright (C) 2020-2023 I. Marchevsky, E. Ryatina, A. Kolganova |" << '\n' << \
59  "| Copyright (C) 2013, Texas State University-San Marcos. All rights reserved. |" << '\n' << \
60  "\\*---------------------------------------------------------------------------*/" << '\n';
61  }
62 
63 
64  void PrintConfiguration(int nbodies)
65  {
66  std::cout << std::endl;
67  std::cout << " Configuration for task \"" << task << "\"" << std::endl;
68  std::cout << "------------------------------------------------------------------------" << std::endl;
69  std::cout << "Floating point type: " << (sizeof(real) == 4 ? "float" : "double") << " (" << sizeof(real) << " bytes)" << std::endl;
70  std::cout << "Number of bodies: " << nbodies << " (eps = " << EPS << ")" << std::endl;
71  std::cout << "Multipoles: " << "up to " << order << "-th order" << std::endl;
72  std::cout << "Theta in proximity criterion: " << THETA << std::endl;
73  std::cout << "Compare/save: " << (compare ? "true" : "false") << "/" << (save ? "true" : "false") << std::endl;
74  std::cout << "------------------------------------------------------------------------" << std::endl;
75  }
76 
77 
78 
79  void PrintStatistics(int run, int runs,
80  const float* timing, const float* mintiming, const float* avtiming,
81  double runtime, double minruntime, double avruntime)
82  {
83  if (run == 0)
84  {
85  std::cout << std::endl;
86  std::cout << " Time statistics " << std::endl;
87  std::cout << "------------------------------------------------------------------------" << std::endl;
88  std::cout << " run/runs total BBK TBK CLK SKK FCK ker.time " << std::endl;
89  }
90 
91 
92  printf("# %3d/%-3d: %6.3lf s (", run + 1, runs, runtime);
93 
94  printf(" %3.1f ", timing[1]);
95  printf(" %4.1f ", timing[2]);
96  printf(" %4.1f ", timing[3]);
97  printf(" %4.1f ", timing[4]);
98  printf(" %6.1f ", timing[5]);
99 
100  printf(") = %6.1f ms\n", timing[6]);
101 
102  if (run == runs - 1)
103  {
104  std::cout << "------------------------------------------------------------------------" << std::endl;
105 
106  printf(" min : %6.3lf s (", minruntime);
107 
108  printf(" %3.1f ", mintiming[1]);
109  printf(" %4.1f ", mintiming[2]);
110  printf(" %4.1f ", mintiming[3]);
111  printf(" %4.1f ", mintiming[4]);
112  printf(" %6.1f ", mintiming[5]);
113  printf(") | %6.1f ms\n", mintiming[6]);
114 
115 
116  printf(" aver : %6.3lf s (", avruntime / runs);
117 
118  printf(" %3.1f ", avtiming[1] / runs);
119  printf(" %4.1f ", avtiming[2] / runs);
120  printf(" %4.1f ", avtiming[3] / runs);
121  printf(" %4.1f ", avtiming[4] / runs);
122  printf(" %6.1f ", avtiming[5] / runs);
123  printf(") | %6.1f ms\n", avtiming[6] / runs);
124  }
125  }
126 
127 
129  {
130  std::cout << std::endl;
131  std::cout << " Accuracy control " << std::endl;
132  std::cout << "------------------------------------------------------------------------" << std::endl;
133  }
134 
136  {
137  std::cout << "Relative error: " << val << std::endl;
138 
139  std::cout << "------------------------------------------------------------------------" << std::endl;
140  }
141 
142 
143 
144 
145 }
146 #endif
void PrintStatistics(int run, int runs, const float *timing, const float *mintiming, const float *avtiming, double runtime, double minruntime, double avruntime)
Definition: Logo.h:79
void PrintLogoToStream(std::ostream &str)
Definition: Logo.h:48
Definition: Logo.h:45
void PrintConfiguration(int nbodies)
Definition: Logo.h:64
void PrintAccuracyHead()
Definition: Logo.h:128
static const std::string task
Definition: Params.h:74
#define THETA
Параметр точности
Definition: Params.h:63
Параметры решаемой задачи
static const bool save
Definition: Params.h:83
void PrintAccuracyError(real val)
Definition: Logo.h:135
#define EPS
Радиус вихревого элемента
Definition: Params.h:47
static const int order
Definition: Params.h:69
#define real
Definition: Params.h:113
static const int runs
Definition: Params.h:86
static const bool compare
Definition: Params.h:77