14 #ifdef CHROMA_USE_ITTNOTIFY
15 #include "ittnotify.h"
42 int main(
int argc,
char *argv[])
49 QDPIO::cout <<
"Linkage = " <<
linkageHack() << std::endl;
53 XMLReader paramtop(param_in,
"/MonomialTests");
55 multi1d<int> nrow(
Nd);
58 read(paramtop,
"nrow", nrow);
61 QDPIO::cerr <<
"Unable to read nrow from XML: " << e << std::endl;
65 Layout::setLattSize(nrow);
68 QDPIO::cout <<
" HELLLOOOO!!!!!!!!" << std::endl;
72 push(xml_out,
"MonomialTimings");
73 push(xml_log,
"MonomialTimings");
76 multi1d<int> boundary(
Nd);
82 read(paramtop,
"./GaugeStartup", cfg);
85 QDPIO::cerr <<
" Error reading XML " << e << std::endl;
89 multi1d<LatticeColorMatrix>
u(
Nd);
102 QDPIO::cout <<
"Failed to read monomials " << std::endl;
105 QDPIO::cout <<
"ALL MONOMIALS READ " << std::endl << std::flush;
108 multi1d<std::string> monomial_test_ids;
109 multi1d<int> n_iters;
111 read(paramtop,
"//MonomialTestIds", monomial_test_ids);
114 QDPIO::cout <<
"Caught exception: reading monomial_test_ids" <<std::endl;
118 QDPIO::cout <<
"MONOMIAL TEST IDS READ " << std::endl << std::flush;
121 read(paramtop,
"//n_iters", n_iters);
124 QDPIO::cout <<
"Couldnt read n_iters. Caught exception: "<< e << std::endl;
128 QDPIO::cout <<
"ALL parameters read " << std::endl;
129 if ( n_iters.size() != monomial_test_ids.size()) {
130 if( n_iters.size() == 1 ) {
131 QDPIO::cout <<
"Using same value of n_iters for all monomials" << std::endl;
132 int n_iters_val = n_iters[0];
133 n_iters.resize( monomial_test_ids.size());
134 for(
int i=0;
i < monomial_test_ids.size(); ++
i) {
135 n_iters[
i]=n_iters_val;
139 QDPIO::cout <<
" There are " << monomial_test_ids.size()
140 <<
" monomials but " << n_iters.size()
141 <<
" values for n_iters" << std::endl;
146 QDPIO::cout <<
"STARTING MOMENTA " << std::endl << std::flush ;
148 multi1d<LatticeColorMatrix>
p(
Nd);
157 QDPIO::cout <<
"create state" << std::endl;
162 QDPIO::cout <<
"There are " << monomial_test_ids.size() <<
" monomials to test" << std::endl;
163 typedef multi1d<LatticeColorMatrix>
P;
164 typedef multi1d<LatticeColorMatrix>
Q;
165 QDPIO::cout <<
"Binding Monomials" << std::endl;
167 multi1d< Chroma::IntegratorShared::MonomialPair > mon_pairs(monomial_test_ids.size());
172 QDPIO::cout <<
"Caught exception string:" << err << std::endl;
178 for(
int m = 0;
m < monomial_test_ids.size();
m++) {
182 QDPIO::cout <<
"Timing monomial force: " << mon_name << std::endl;
183 QDPIO::cout <<
"Refreshing internal fields: " << std::endl;
187 QDPIO::cout <<
"Single Application in case one is JIT-ing" << std::endl;
193 the_mon.
dsdq(
F,gauge_state);
196 seconds = swatch.getTimeInSeconds();
197 QDPInternal::globalSum(seconds);
198 seconds /= (double)Layout::numNodes();
199 QDPIO::cout <<
"First application took: " << seconds <<
" (s) "<< std::endl << std::flush;
203 int hits = n_iters[
m];
204 QDPIO::cout <<
"Timing monomial force: " << mon_name <<
" with " << hits <<
" hits " << std::endl;
207 #ifdef CHROMA_USE_ITTNOTIFY
210 for(
int i=0;
i < hits;
i++) {
211 the_mon.
dsdq(
F,gauge_state);
213 #ifdef CHROMA_USE_ITTNOTIFY
217 seconds = swatch.getTimeInSeconds();
218 QDPInternal::globalSum(seconds);
219 seconds /= (double)Layout::numNodes();
221 QDPIO::cout <<
"monomial_id = " << mon_name
222 <<
", Nhits = " << hits
223 <<
", Time = " << seconds <<
"(s)"
224 <<
", Time per hit = " << seconds/(double)hits <<
"(s)"<< std::endl;
226 push(xml_out,
"ForceTiming");
227 write(xml_out,
"monomial_id", mon_name);
228 write(xml_out,
"nhits", hits);
229 write(xml_out,
"time", seconds);
230 write(xml_out,
"time_per_hit", (seconds/(
double)hits));
238 QDPIO::cout <<
"Timing taproj()" << std::endl;
239 QDPIO::cout <<
"Calibrating";
240 while( seconds < 10 ) {
244 for(
int i=0;
i < hits;
i++) {
250 seconds = swatch.getTimeInSeconds();
251 QDPInternal::globalSum(seconds);
252 seconds /= (double)Layout::numNodes();
253 QDPIO::cout <<
"." << std::flush;
256 QDPIO::cout <<
" " << seconds <<
"(s)"<< std::endl;
259 QDPIO::cout <<
"Timing taproj with " << hits <<
" hits " << std::endl;
262 for(
int i=0;
i < hits;
i++) {
268 seconds = swatch.getTimeInSeconds();
269 QDPInternal::globalSum(seconds);
270 seconds /= (double)Layout::numNodes();
272 QDPIO::cout <<
"taproj"
273 <<
", Nhits = " << hits
274 <<
", Time = " << seconds <<
"(s)"
275 <<
", Time per hit = " << seconds/(double)hits <<
"(s)" << std::endl;
277 push(xml_out,
"TaprojTiming");
278 write(xml_out,
"nhits", hits);
279 write(xml_out,
"time", seconds);
280 write(xml_out,
"time_per_hit", (seconds/(
double)hits));
286 QDPIO::cout <<
"Timing expmat()" << std::endl;
287 QDPIO::cout <<
"Calibrating";
289 while( seconds < 10 ) {
293 for(
int i=0;
i < hits;
i++) {
299 seconds = swatch.getTimeInSeconds();
300 QDPInternal::globalSum(seconds);
301 seconds /= (double)Layout::numNodes();
303 QDPIO::cout <<
"." << std::flush;
305 QDPIO::cout <<
" " << seconds <<
"(s)"<< std::endl;
307 QDPIO::cout <<
"Timing expmat with " << hits <<
" hits " << std::endl;
310 for(
int i=0;
i < hits;
i++) {
316 seconds = swatch.getTimeInSeconds();
317 QDPInternal::globalSum(seconds);
318 seconds /= (double)Layout::numNodes();
320 QDPIO::cout <<
"expmat"
321 <<
", Nhits = " << hits
322 <<
", Time = " << seconds <<
"(s)"
323 <<
", Time per hit = " << seconds/(double)hits <<
"(s)" << std::endl;
325 push(xml_out,
"ExpmatTiming");
326 write(xml_out,
"nhits", hits);
327 write(xml_out,
"time", seconds);
328 write(xml_out,
"time_per_hit", (seconds/(
double)hits));
335 QDPIO::cout <<
"Timing reunit()" << std::endl;
336 QDPIO::cout <<
"Calibrating";
338 while( seconds < 10 ) {
342 for(
int i=0;
i < hits;
i++) {
348 seconds = swatch.getTimeInSeconds();
349 QDPInternal::globalSum(seconds);
350 seconds /= (double)Layout::numNodes();
352 QDPIO::cout <<
"." << std::flush;
354 QDPIO::cout <<
" " << seconds <<
"(s)"<< std::endl;
356 QDPIO::cout <<
"Timing reunit with " << hits <<
" hits " << std::endl;
359 for(
int i=0;
i < hits;
i++) {
365 seconds = swatch.getTimeInSeconds();
366 QDPInternal::globalSum(seconds);
367 seconds /= (double)Layout::numNodes();
369 QDPIO::cout <<
"reunit"
370 <<
", Nhits = " << hits
371 <<
", Time = " << seconds <<
"(s)"
372 <<
", Time per hit = " << seconds/(double)hits <<
"(s)" << std::endl;
374 push(xml_out,
"ReunitTiming");
375 write(xml_out,
"nhits", hits);
376 write(xml_out,
"time", seconds);
377 write(xml_out,
"time_per_hit", (seconds/(
double)hits));
Primary include file for CHROMA in application codes.
const multi1d< LatticeColorMatrix > & getP(void) const
Accessors.
const multi1d< LatticeColorMatrix > & getQ(void) const
An abstract monomial class, for inexact algorithms.
virtual void dsdq(P &F, const AbsFieldState< P, Q > &s)=0
Compute dsdq for the system...
virtual void refreshInternalFields(const AbsFieldState< P, Q > &field_state)=0
Refresh pseudofermion fields if any.
void read(XMLReader &xml, const std::string &path, AsqtadFermActParams ¶m)
Read parameters.
void write(XMLWriter &xml, const std::string &path, const AsqtadFermActParams ¶m)
Writer parameters.
void taproj(LatticeColorMatrix &a)
Take the traceless antihermitian projection of a color matrix.
void expmat(LatticeColorMatrix &a, enum ExpMat_t opt)
Exponentiate a SU(n) lie algebra element by some method.
void gaugeStartup(XMLReader &gauge_file_xml, XMLReader &gauge_xml, multi1d< LatticeColorMatrix > &u, Cfg_t &cfg)
Initialize the gauge fields.
void readNamedMonomialArray(XMLReader &xml, const std::string &path)
Read an array of named monomials from an XML reader. use factory to create the monomials and put them...
bool registerAll()
Register all the factories.
bool registerAll()
Register all the factories.
bool registerAll()
Register all the factories.
multi1d< LatticeColorMatrix > P
void bindMonomials(const multi1d< std::string > &monomial_ids, multi1d< MonomialPair > &monomials)
A routine to bind Monomial IDs to an array of Monomial Handles.
bool registerAll()
Register all the factories.
Asqtad Staggered-Dirac operator.
XMLFileWriter & getXMLLogInstance()
Get xml log instance.
static multi1d< LatticeColorMatrix > u
LinOpSysSolverMGProtoClover::Q Q
push(xml_out,"Condensates")
void initialize(int *argc, char ***argv)
Chroma initialisation routine.
void finalize(void)
Chroma finalization routine.
void reunit(LatticeColorMatrixF3 &xa)
std::string getXMLInputFileName()
Get input file name.
XMLFileWriter & getXMLOutputInstance()
Get xml output instance.
Gauge configuration structure.
multi1d< LatticeColorMatrix > P
int main(int argc, char *argv[])
static INTERNAL_PRECISION F