00001 // -*- C++ -*- 00002 /*************************************************************************** 00003 * 00004 * The IPPL Framework 00005 * 00006 * This program was prepared by PSI. 00007 * All rights in the program are reserved by PSI. 00008 * Neither PSI nor the author(s) 00009 * makes any warranty, express or implied, or assumes any liability or 00010 * responsibility for the use of this software 00011 * 00012 * Visit http://www.acl.lanl.gov/POOMS for more details 00013 * 00014 ***************************************************************************/ 00015 00016 // -*- C++ -*- 00017 //----------------------------------------------------------------------------- 00018 // The IPPL Framework - Visit http://people.web.psi.ch/adelmann/ for more details 00019 // 00020 // This program was prepared by the Regents of the University of California at 00021 // ParticleDebugFunctions.h , Tim Williams 8/6/1998 00022 // Helper functions to print out (formatted ASCII) ParticleAttrib elements. 00023 // Intended mainly for use from within a debugger, called interactively, but 00024 // also callable as template functions from source code. To call from many 00025 // debuggers, the user has to provide nontemplate wrapper functions, as 00026 // described in ParticleDebugFunctions.cpp. 00027 00028 // include files 00029 #include "Profile/Profiler.h" 00030 #include "Utility/PAssert.h" 00031 #include "Utility/IpplInfo.h" 00032 00033 // forward class declarations 00034 //class Inform; 00035 00036 //---------------------------------------------------------------------- 00037 // Set up the I/O "stream" (IPPL Inform object) format where the output goes. 00038 // This "sticks around" once set until re-set. 00039 //---------------------------------------------------------------------- 00040 Inform* PtclDbgInform; // Pointer to active Inform object 00041 bool PtclDbgInformIsSet = false; // Flags whether pointer is set 00042 void setPtclDbgInform(Inform& inform) { 00043 TAU_PROFILE("setPtclDbgInform", "void (Inform&)", TAU_UTILITY); 00044 PtclDbgInform = &inform; 00045 PtclDbgInformIsSet = true; 00046 } 00047 00048 //----------------------------------------------------------------------------- 00049 // Set up some pre-instantiated common template particle debug functions, for 00050 // common ParticleAttrib types. 00051 // Uncallable from the debuggers I've tried, so comment out and use named 00052 // nontemplate function workaraound below. --TJW 8/7/98 00053 //----------------------------------------------------------------------------- 00054 // Forward template function declarations 00055 // template<class T> 00056 // void pap(ParticleAttrib<T>& pattr, bool docomm); 00057 // template<class T> 00058 // void epap(ParticleAttrib<T>& pattr, int i, bool docomm); 00059 // template<class T> 00060 // void spap(ParticleAttrib<T>& pattr, 00061 // int ibase, int ibound, int istride, bool docomm); 00062 // #include "Utility/ParticleDebug.h" 00063 00064 // Need these additional forward class declarations as well 00065 // template<class T> class ParticleAttrib; 00066 // template<class T, unsigned D> class Vektor; 00067 00068 // template void epap(ParticleAttrib<double>& pattr, int i, bool docomm); 00069 // template void spap(ParticleAttrib<double>& pattr, int base, int bnd, 00070 // int stride, bool docomm); 00071 // template void epap(ParticleAttrib<int>& pattr, int i, bool docomm); 00072 // template void spap(ParticleAttrib<int>& pattr, int base, int bnd, 00073 // int stride, bool docomm); 00074 00075 //----------------------------------------------------------------------------- 00076 // Named nontemplate function workaraound: --TJW 8/7/98 00077 // Users should put functions like these examples somewhere in their own source 00078 // modules, to get access from brain-dead debuggers like the SGI debugger cvd, 00079 // which can't invoke template functions, and gets confused by multipple 00080 // prototypes (making it necessary to embed all this information into the names 00081 // of separately-defined functions). 00082 //----------------------------------------------------------------------------- 00083 // void dpap(ParticleAttrib<double>& pattr, bool docomm) { 00084 // pap(pattr, docomm); 00085 // } 00086 // void depap(ParticleAttrib<double>& pattr, int i, bool docomm) { 00087 // epap(pattr, i, docomm); 00088 // } 00089 // void dspap(ParticleAttrib<double>& pattr, int base, int bnd, int stride, 00090 // bool docomm) { 00091 // spap(pattr, base, bnd, stride, docomm); 00092 // } 00093 // void fpap(ParticleAttrib<float>& pattr, bool docomm) { 00094 // pap(pattr, docomm); 00095 // } 00096 // void fepap(ParticleAttrib<float>& pattr, int i, bool docomm) { 00097 // epap(pattr, i, docomm); 00098 // } 00099 // void fspap(ParticleAttrib<float>& pattr, int base, int bnd, int stride, 00100 // bool docomm) { 00101 // spap(pattr, base, bnd, stride, docomm); 00102 // } 00103 // void ipap(ParticleAttrib<int>& pattr, bool docomm) { 00104 // pap(pattr, docomm); 00105 // } 00106 // void iepap(ParticleAttrib<int>& pattr, int i, bool docomm) { 00107 // epap(pattr, i, docomm); 00108 // } 00109 // void ispap(ParticleAttrib<int>& pattr, int base, int bnd, int stride, 00110 // bool docomm) { 00111 // spap(pattr, base, bnd, stride, docomm); 00112 // } 00113 // void bpap(ParticleAttrib<bool>& pattr, bool docomm) { 00114 // pap(pattr, docomm); 00115 // } 00116 // void bepap(ParticleAttrib<bool>& pattr, int i, bool docomm) { 00117 // epap(pattr, i, docomm); 00118 // } 00119 // void bspap(ParticleAttrib<bool>& pattr, int base, int bnd, int stride, 00120 // bool docomm) { 00121 // spap(pattr, base, bnd, stride, docomm); 00122 // } 00123 // void dv1pap(ParticleAttrib<Vektor<double,1> >& pattr, bool docomm) { 00124 // pap(pattr, docomm); 00125 // } 00126 // void dv1epap(ParticleAttrib<Vektor<double,1> >& pattr, int i, bool docomm) { 00127 // epap(pattr, i, docomm); 00128 // } 00129 // void dv1spap(ParticleAttrib<Vektor<double,1> >& pattr, int base, int bnd, 00130 // int stride, bool docomm) { 00131 // spap(pattr, base, bnd, stride, docomm); 00132 // } 00133 // void dv2pap(ParticleAttrib<Vektor<double,2> >& pattr, bool docomm) { 00134 // pap(pattr, docomm); 00135 // } 00136 // void dv2epap(ParticleAttrib<Vektor<double,2> >& pattr, int i, bool docomm) { 00137 // epap(pattr, i, docomm); 00138 // } 00139 // void dv2spap(ParticleAttrib<Vektor<double,2> >& pattr, int base, int bnd, 00140 // int stride, bool docomm) { 00141 // spap(pattr, base, bnd, stride, docomm); 00142 // } 00143 // void dv3pap(ParticleAttrib<Vektor<double,3> >& pattr, bool docomm) { 00144 // pap(pattr, docomm); 00145 // } 00146 // void dv3epap(ParticleAttrib<Vektor<double,3> >& pattr, int i, bool docomm) { 00147 // epap(pattr, i, docomm); 00148 // } 00149 // void dv3spap(ParticleAttrib<Vektor<double,3> >& pattr, int base, int bnd, 00150 // int stride, bool docomm) { 00151 // spap(pattr, base, bnd, stride, docomm); 00152 // } 00153 // void fv1pap(ParticleAttrib<Vektor<float,1> >& pattr, bool docomm) { 00154 // pap(pattr, docomm); 00155 // } 00156 // void fv1epap(ParticleAttrib<Vektor<float,1> >& pattr, int i, bool docomm) { 00157 // epap(pattr, i, docomm); 00158 // } 00159 // void fv1spap(ParticleAttrib<Vektor<float,1> >& pattr, int base, int bnd, 00160 // int stride, bool docomm) { 00161 // spap(pattr, base, bnd, stride, docomm); 00162 // } 00163 // void fv2pap(ParticleAttrib<Vektor<float,2> >& pattr, bool docomm) { 00164 // pap(pattr, docomm); 00165 // } 00166 // void fv2epap(ParticleAttrib<Vektor<float,2> >& pattr, int i, bool docomm) { 00167 // epap(pattr, i, docomm); 00168 // } 00169 // void fv2spap(ParticleAttrib<Vektor<float,2> >& pattr, int base, int bnd, 00170 // int stride, bool docomm) { 00171 // spap(pattr, base, bnd, stride, docomm); 00172 // } 00173 // void fv3pap(ParticleAttrib<Vektor<float,3> >& pattr, bool docomm) { 00174 // pap(pattr, docomm); 00175 // } 00176 // void fv3epap(ParticleAttrib<Vektor<float,3> >& pattr, int i, bool docomm) { 00177 // epap(pattr, i, docomm); 00178 // } 00179 // void fv3spap(ParticleAttrib<Vektor<float,3> >& pattr, int base, int bnd, 00180 // int stride, bool docomm) { 00181 // spap(pattr, base, bnd, stride, docomm); 00182 // } 00183 00184 // $Id: ParticleDebugFunctions.cpp,v 1.1.1.1 2003/01/23 07:40:33 adelmann Exp $ 00185 00186 /*************************************************************************** 00187 * $RCSfile: addheaderfooter,v $ $Author: adelmann $ 00188 * $Revision: 1.1.1.1 $ $Date: 2003/01/23 07:40:17 $ 00189 * IPPL_VERSION_ID: $Id: addheaderfooter,v 1.1.1.1 2003/01/23 07:40:17 adelmann Exp $ 00190 ***************************************************************************/ 00191