OPAL (Object Oriented Parallel Accelerator Library) 2022.1
OPAL
FieldDebug.h
Go to the documentation of this file.
1// -*- C++ -*-
2/***************************************************************************
3 *
4 * The IPPL Framework
5 *
6 *
7 * Visit http://people.web.psi.ch/adelmann/ for more details
8 *
9 ***************************************************************************/
10
11// FieldDebug.h , Tim Williams 10/23/1996
12// Helper functions to print out (formatted ASCII) Field elements.
13// Intended mainly for use from within a debugger, called interactively.
14// See comments in FieldDebug.cpp for more details.
15
16#ifndef FIELD_DEBUG_H
17#define FIELD_DEBUG_H
18
20
21// forward declarations
22class Inform;
23template<class T, unsigned Dim> class BareField;
24
25// extern declarations of global variables in FieldDebugFunctions.cpp
26extern Inform* FldDbgInform;
27extern bool FldDbgInformIsSet;
28extern int elementsPerLine;
29extern int digitsPastDecimal;
30extern int widthOfElements;
31
32//=============================================================================
33// Helper functions to print out (formatted ASCII) Field elements.
34// Intended mainly for use from within a debugger, called interactively.
35// fp[1,2,3](Field&) print all elements of [1D,2D,3D] Field
36// decimal point
37// efp[1,2,3](Field&,....) prints single element of [1D,2D,3D] Field; requires
38// specification of integer index for each
39// sfp[1,2,3](Field&,....) prints strided slice of [1D,2D,3D] Field; requires
40// specification of (base,bound,stride) for each
41// dimension
42// Implementation notes: The specially-named functions for [1D,2D,3D] are
43// needed because the SGI debuggers don't handle single-name functions with
44// multipple prototypes for different argument types/numbers properly.
45//=============================================================================
46
47//------------------------------------------------------
48// Function prototypes; see FieldDebug.cpp for comments:
49//------------------------------------------------------
50// For printing all elements of a Field:
51template<class T>
52void fp1(BareField<T, 1U>& field, bool docomm = true);
53template<class T>
54void fp2(BareField<T, 2U>& field, bool docomm = true);
55template<class T>
56void fp3(BareField<T, 3U>& field, bool docomm = true);
57
58// For printing all elements of a Field, including global guard layers:
59template<class T>
60void ggfp1(BareField<T, 1U>& field, bool docomm = true);
61template<class T>
62void ggfp2(BareField<T, 2U>& field, bool docomm = true);
63template<class T>
64void ggfp3(BareField<T, 3U>& field, bool docomm = true);
65
66// For printing all elements of a Field, including all guard layers (global and
67// internal). These will print the data in a different format: all data for a
68// vnode, one vnode at a time:
69template<class T>
70void agfp1(BareField<T, 1U>& field);
71template<class T>
72void agfp2(BareField<T, 2U>& field);
73template<class T>
74void agfp3(BareField<T, 3U>& field);
75
76// For printing one element of a Field:
77template<class T>
78void efp1(BareField<T, 1U>& field, int i, bool docomm = true);
79template<class T>
80void efp2(BareField<T, 2U>& field, int i, int j, bool docomm = true);
81template<class T>
82void efp3(BareField<T, 3U>& field, int i, int j, int k, bool docomm = true);
83
84// For printing strided subrange of elements of a Field:
85template<class T>
86void sfp1(BareField<T, 1U>& field,
87 int ibase, int ibound, int istride, bool docomm = true);
88template<class T>
89void sfp2(BareField<T, 2U>& field,
90 int ibase, int ibound, int istride,
91 int jbase, int jbound, int jstride, bool docomm = true);
92template<class T>
93void sfp3(BareField<T, 3U>& field,
94 int ibase, int ibound, int istride,
95 int jbase, int jbound, int jstride,
96 int kbase, int kbound, int kstride, bool docomm = true);
97
98//-----------------------------------------------------------------------------
99// Specializations, so that these types are available from debugger:
100//
101// USAGE:
102// For now, all of these are commented out in this FieldDebug.h header file,
103// so that libippl.a doesn't take forever to build and isn't unnecessarily
104// large. (In fact, the KCC compiler dies if you have too many of these in
105// here.) It is up to the user to include a line like these in his source
106// (most logically in the main()), in order to have access to Field-printing
107// for his special types of Field's from the debugger.
108//
109// To call the functions from the *code* (not from the debugger), the user need
110// not include any lines like these; he can just invoke the generic
111// parameterized functions from the list above: [e,s]fp[1,2,3]().
112//-----------------------------------------------------------------------------
113
114// User must put lines like the commented-out ones in his own code to get
115// access to specialized Field-type functions like these from the debugger.
116
117// Scalar Field's of double's:-------------------------------------------------
118//void dfp1(BareField<double, 1U>& f) {fp1(f);}
119//void defp1(BareField<double, 1U>& f, int i) {efp1(f,i);}
120//void dsfp1(BareField<double,1U>& f,
121// int base1, int bound1, int stride1) {sfp1(f,base1,bound1,stride1);}
122//void dfp2(BareField<double, 2U>& f) {fp2(f);}
123//void defp2(BareField<double, 2U>& f, int i, int j) {efp2(f,i,j);}
124//void dsfp2(BareField<double,2U>& f,
125// int base1, int bound1, int stride1,
126// int base2, int bound2, int stride2) {
127// sfp2(f,base1,bound1,stride1,base2,bound2,stride2);}
128//void dfp3(BareField<double, 3U>& f) {fp3(f);}
129//void defp3(BareField<double, 3U>& f, int i, int j, int k) {efp3(f,i,j,k);}
130//void dsfp3(BareField<double,3U>& f,
131// int base1, int bound1, int stride1,
132// int base2, int bound2, int stride2,
133// int base3, int bound3, int stride3) {
134// sfp3(f,base1,bound1,stride1,base2,bound2,stride2,base3,bound3,stride3);}
135
136// Scalar Field's of float's:--------------------------------------------------
137//void ffp1(BareField<float, 1U>& f) {fp1(f);}
138//void fefp1(BareField<float, 1U>& f, int i) {efp1(f,i);}
139//void fsfp1(BareField<float,1U>& f,
140// int base1, int bound1, int stride1) {sfp1(f,base1,bound1,stride1);}
141//void ffp2(BareField<float, 2U>& f) {fp2(f);}
142//void fefp2(BareField<float, 2U>& f, int i, int j) {efp2(f,i,j);}
143//void fsfp2(BareField<float,2U>& f,
144// int base1, int bound1, int stride1,
145// int base2, int bound2, int stride2) {
146// sfp2(f,base1,bound1,stride1,base2,bound2,stride2);}
147//void ffp3(BareField<float, 3U>& f) {fp3(f);}
148//void fefp3(BareField<float, 3U>& f, int i, int j, int k) {efp3(f,i,j,k);}
149//void fsfp3(BareField<float,3U>& f,
150// int base1, int bound1, int stride1,
151// int base2, int bound2, int stride2,
152// int base3, int bound3, int stride3) {
153// sfp3(f,base1,bound1,stride1,base2,bound2,stride2,base3,bound3,stride3);}
154
155// Vector Field's of double's:-------------------------------------------------
156//void vdfp2(BareField<Vektor<double,2U>, 2U>& f) {fp2(f);}
157//void vdefp2(BareField<Vektor<double,2U>, 2U>& f, int i, int j) {efp2(f,i,j);}
158//void vdsfp2(BareField<Vektor<double,2U>,2U>& f,
159// int base1, int bound1, int stride1,
160// int base2, int bound2, int stride2) {
161// sfp2(f,base1,bound1,stride1,base2,bound2,stride2);}
162//void vdfp3(BareField<Vektor<double,3U>, 3U>& f) {fp3(f);}
163//void vdefp3(BareField<Vektor<double,3U>, 3U>& f, int i, int j, int k) {
164// efp3(f,i,j,k);}
165//void vdsfp3(BareField<Vektor<double,3U>,3U>& f,
166// int base1, int bound1, int stride1,
167// int base2, int bound2, int stride2,
168// int base3, int bound3, int stride3) {
169// sfp3(f,base1,bound1,stride1,base2,bound2,stride2,base3,bound3,stride3);}
170
171// Vector Field's of float's:--------------------------------------------------
172//void vffp2(BareField<Vektor<float,2U>, 2U>& f) {fp2(f);}
173//void vfefp2(BareField<Vektor<float,2U>, 2U>& f, int i, int j) {efp2(f,i,j);}
174//void vfsfp2(BareField<Vektor<float,2U>,2U>& f,
175// int base1, int bound1, int stride1,
176// int base2, int bound2, int stride2) {
177// sfp2(f,base1,bound1,stride1,base2,bound2,stride2);}
178//void vffp3(BareField<Vektor<float,3U>, 3U>& f) {fp3(f);}
179//void vfefp3(BareField<Vektor<float,3U>, 3U>& f, int i, int j, int k) {
180// efp3(f,i,j,k);}
181//void vfsfp3(BareField<Vektor<float,3U>,3U>& f,
182// int base1, int bound1, int stride1,
183// int base2, int bound2, int stride2,
184// int base3, int bound3, int stride3) {
185// sfp3(f,base1,bound1,stride1,base2,bound2,stride2,base3,bound3,stride3);}
186
187#include "Utility/FieldDebug.hpp"
188
189#endif // FIELD_DEBUG_H
190
191/***************************************************************************
192 * $RCSfile: FieldDebug.h,v $ $Author: adelmann $
193 * $Revision: 1.1.1.1 $ $Date: 2003/01/23 07:40:33 $
194 * IPPL_VERSION_ID: $Id: FieldDebug.h,v 1.1.1.1 2003/01/23 07:40:33 adelmann Exp $
195 ***************************************************************************/
Inform * FldDbgInform
void fp2(BareField< T, 2U > &field, bool docomm=true)
Definition: FieldDebug.hpp:56
bool FldDbgInformIsSet
int widthOfElements
void agfp2(BareField< T, 2U > &field)
Definition: FieldDebug.hpp:161
void agfp3(BareField< T, 3U > &field)
Definition: FieldDebug.hpp:171
int digitsPastDecimal
void efp3(BareField< T, 3U > &field, int i, int j, int k, bool docomm=true)
Definition: FieldDebug.hpp:199
void efp2(BareField< T, 2U > &field, int i, int j, bool docomm=true)
Definition: FieldDebug.hpp:190
void agfp1(BareField< T, 1U > &field)
Definition: FieldDebug.hpp:151
void sfp2(BareField< T, 2U > &field, int ibase, int ibound, int istride, int jbase, int jbound, int jstride, bool docomm=true)
Definition: FieldDebug.hpp:261
void ggfp1(BareField< T, 1U > &field, bool docomm=true)
Definition: FieldDebug.hpp:91
void sfp3(BareField< T, 3U > &field, int ibase, int ibound, int istride, int jbase, int jbound, int jstride, int kbase, int kbound, int kstride, bool docomm=true)
Definition: FieldDebug.hpp:345
int elementsPerLine
void sfp1(BareField< T, 1U > &field, int ibase, int ibound, int istride, bool docomm=true)
Definition: FieldDebug.hpp:208
void efp1(BareField< T, 1U > &field, int i, bool docomm=true)
Definition: FieldDebug.hpp:181
void ggfp3(BareField< T, 3U > &field, bool docomm=true)
Definition: FieldDebug.hpp:126
void fp3(BareField< T, 3U > &field, bool docomm=true)
Definition: FieldDebug.hpp:72
void ggfp2(BareField< T, 2U > &field, bool docomm=true)
Definition: FieldDebug.hpp:106
void fp1(BareField< T, 1U > &field, bool docomm=true)
Definition: FieldDebug.hpp:43
Definition: Inform.h:42