26 namespace MdagMSysSolverQUDAMULTIGRIDCloverEnv
43 Handle<
FermState< LatticeFermion, multi1d<LatticeColorMatrix>, multi1d<LatticeColorMatrix> > >
state,
74 mod_chi[rb[0]] =
zero;
80 if( invParam.asymmetricP) {
94 mod_chi[rb[1]] = chi_s;
97 #ifndef BUILD_QUDA_DEVIFACE_SPINOR
98 void* spinorIn =(
void *)&(mod_chi.elem(rb[1].start()).elem(0).elem(0).real());
99 void* spinorOut =(
void *)&(psi_s.elem(rb[1].start()).elem(0).elem(0).real());
105 GetMemoryPtr2(spinorIn,spinorOut,mod_chi.getId(),psi_s.getId());
112 invertQuda(spinorOut, spinorIn, (QudaInvertParam*)&quda_inv_param);
117 QDPIO::cout << solver_string<<
"time="<< quda_inv_param.secs <<
" s" ;
118 QDPIO::cout <<
"\tPerformance="<< quda_inv_param.gflops/quda_inv_param.secs<<
" GFLOPS" ;
119 QDPIO::cout <<
"\tTotal Time (incl. load gauge)=" << swatch1.getTimeInSeconds() <<
" s"<<std::endl;
121 ret.
n_count =quda_inv_param.iter;
128 void MdagMSysSolverQUDAMULTIGRIDClover::dumpYSolver(
const LatticeFermion&
chi,
const LatticeFermion& Y)
const
131 auto time_value = std::time(
nullptr);
132 auto local_time = std::localtime(&time_value);
133 std::ostringstream time_strstream;
134 time_strstream <<
"./failed_Y_solve_" << std::put_time(local_time,
"%d-%m-%Y-%H-%M-%S");
139 std::string gauge_filename = file_prefix +
"_gauge_field.lime";
140 std::string chi_filename = file_prefix +
"_chi.lime";
146 XMLBufferWriter filebuf;
147 XMLBufferWriter recbuf;
148 push( filebuf,
"GaugeFile" );
149 write( filebuf,
"FilePrefix", file_prefix);
152 push( recbuf,
"GaugeRecord" );
153 write( recbuf,
"FilePrefix", file_prefix);
156 QDPIO::cout <<
"Dumping gauge links to " << gauge_filename << std::endl;
158 QDPFileWriter writer(filebuf,gauge_filename, QDPIO_SINGLEFILE, QDPIO_PARALLEL);
159 write(writer, recbuf, gstate->getLinks());
165 XMLBufferWriter filebuf;
166 XMLBufferWriter recbuf;
167 push( filebuf,
"ChiFile" );
168 write( filebuf,
"FilePrefix", file_prefix);
171 push( recbuf,
"ChiRecord" );
172 write( recbuf,
"FilePrefix", file_prefix);
175 QDPIO::cout <<
"Dumping chi (original source) vector to " << chi_filename << std::endl;
177 QDPFileWriter writer(filebuf, chi_filename, QDPIO_SINGLEFILE, QDPIO_PARALLEL);
186 XMLBufferWriter filebuf;
187 XMLBufferWriter recbuf;
188 push( filebuf,
"YFile" );
189 write( filebuf,
"FilePrefix", file_prefix);
192 push( recbuf,
"YRecord" );
193 write( recbuf,
"FilePrefix", file_prefix);
196 QDPIO::cout <<
"Dumping Y (source) vector to " << Y_filename << std::endl;
198 QDPFileWriter writer(filebuf, Y_filename, QDPIO_SINGLEFILE, QDPIO_PARALLEL);
199 write(writer, recbuf, Y);
205 auto mg_params = *(invParam.MULTIGRIDParams);
206 for(
int l = 0;
l < mg_params.mg_levels; ++
l) {
207 std::ostringstream subspace_prefix;
208 subspace_prefix << file_prefix <<
"_subspace_l" <<
l;
211 std::strncpy((subspace_pointers->mg_param).vec_outfile[
l], (subspace_prefix.str()).c_str(), 256);
213 if( subspace_prefix.str().size() > 255 ) { (subspace_pointers->mg_param).vec_outfile[
l][255] =
'\0'; }
219 QDPInternal::globalSum(
i);
221 #ifdef QUDA_MG_DUMP_ENABLED
222 dumpMultigridQuda(subspace_pointers->preconditioner, &(subspace_pointers->mg_param));
225 for(
int l = 0;
l < mg_params.mg_levels; ++
l) {
226 (subspace_pointers->mg_param).vec_outfile[
l][0] =
'\0';
228 QDPInternal::globalSum(
i);
233 unsigned long MdagMSysSolverQUDAMULTIGRIDClover::seqno = 0;
235 void MdagMSysSolverQUDAMULTIGRIDClover::dumpXSolver(
const LatticeFermion&
chi,
236 const LatticeFermion& Y,
237 const LatticeFermion& X)
const
241 auto time_value = std::time(
nullptr);
242 auto local_time = std::localtime(&time_value);
243 std::ostringstream time_strstream;
244 time_strstream <<
"./failed_X_solve_" << std::put_time(local_time,
"%d-%m-%Y-%H-%M-%S");
249 std::string gauge_filename = file_prefix +
"_gauge_field.lime";
250 std::string chi_filename = file_prefix +
"_chi.lime";
257 XMLBufferWriter filebuf;
258 XMLBufferWriter recbuf;
259 push( filebuf,
"GaugeFile" );
260 write( filebuf,
"FilePrefix", file_prefix);
263 push( recbuf,
"GaugeRecord" );
264 write( recbuf,
"FilePrefix", file_prefix);
267 QDPIO::cout <<
"Dumping gauge links to " << gauge_filename << std::endl;
269 QDPFileWriter writer(filebuf,gauge_filename, QDPIO_SINGLEFILE, QDPIO_PARALLEL);
270 write(writer, recbuf, gstate->getLinks());
276 XMLBufferWriter filebuf;
277 XMLBufferWriter recbuf;
278 push( filebuf,
"ChiFile" );
279 write( filebuf,
"FilePrefix", file_prefix);
282 push( recbuf,
"ChiRecord" );
283 write( recbuf,
"FilePrefix", file_prefix);
286 QDPIO::cout <<
"Dumping chi (original source) vector to " << chi_filename << std::endl;
288 QDPFileWriter writer(filebuf, chi_filename, QDPIO_SINGLEFILE, QDPIO_PARALLEL);
297 XMLBufferWriter filebuf;
298 XMLBufferWriter recbuf;
299 push( filebuf,
"YFile" );
300 write( filebuf,
"FilePrefix", file_prefix);
303 push( recbuf,
"YRecord" );
304 write( recbuf,
"FilePrefix", file_prefix);
307 QDPIO::cout <<
"Dumping Y (source) vector to " << Y_filename << std::endl;
309 QDPFileWriter writer(filebuf, Y_filename, QDPIO_SINGLEFILE, QDPIO_PARALLEL);
310 write(writer, recbuf, Y);
316 XMLBufferWriter filebuf;
317 XMLBufferWriter recbuf;
318 push( filebuf,
"XFile" );
319 write( filebuf,
"FilePrefix", file_prefix);
322 push( recbuf,
"XRecord" );
323 write( recbuf,
"FilePrefix", file_prefix);
326 QDPIO::cout <<
"Dumping X (solution) vector to " << X_filename << std::endl;
328 QDPFileWriter writer(filebuf, X_filename, QDPIO_SINGLEFILE, QDPIO_PARALLEL);
329 write(writer, recbuf, X);
336 auto mg_params = *(invParam.MULTIGRIDParams);
337 for(
int l = 0;
l < mg_params.mg_levels; ++
l) {
338 std::ostringstream subspace_prefix;
339 subspace_prefix << file_prefix <<
"_subspace_l" <<
l;
342 std::strncpy((subspace_pointers->mg_param).vec_outfile[
l], (subspace_prefix.str()).c_str(), 256);
344 if( subspace_prefix.str().size() > 255 ) { (subspace_pointers->mg_param).vec_outfile[
l][255] =
'\0'; }
350 QDPInternal::globalSum(
i);
353 #ifdef QUDA_MG_DUMP_ENABLED
354 dumpMultigridQuda(subspace_pointers->preconditioner, &(subspace_pointers->mg_param));
357 for(
int l = 0;
l < mg_params.mg_levels; ++
l) {
358 (subspace_pointers->mg_param).vec_outfile[
l][0] =
'\0';
361 QDPInternal::globalSum(
i);
Support class for fermion actions and linear operators.
Class for counted reference semantics.
void apply(T &chi, const T &psi, enum PlusMinus isign, int cb) const
void write(XMLWriter &xml, const std::string &path, const AsqtadFermActParams ¶m)
Writer parameters.
Class for counted reference semantics.
Wilson Dslash linear operator.
static bool registered
Local registration flag.
const std::string name
Name to be used.
MdagMSystemSolver< LatticeFermion > * createFerm(XMLReader &xml_in, const std::string &path, Handle< FermState< LatticeFermion, multi1d< LatticeColorMatrix >, multi1d< LatticeColorMatrix > > > state, Handle< LinearOperator< LatticeFermion > > A)
bool registerAll()
Register all the factories.
Asqtad Staggered-Dirac operator.
push(xml_out,"Condensates")
LinOpSysSolverMGProtoClover::T T
multi1d< LatticeFermion > chi(Ncb)
const WilsonTypeFermAct< multi1d< LatticeFermion > > Handle< const ConnectState > state
Periodic ferm state and a creator.
Holds return info from SystemSolver call.
Register MdagM system solvers.
Factory for producing system solvers for MdagM*psi = chi.