12 #if defined(BUILD_JIT_CLOVER_TERM)
13 #if defined(QDPJIT_IS_QDPJITPTX)
14 #include "../actions/ferm/linop/clover_term_ptx_w.h"
24 #include "../qphix_singleton.h"
25 #ifdef CHROMA_BUILDING_QPHIX_DSLASH
26 #include "qdp_datalayout.h"
27 #include "qphix/geometry.h"
33 #include "MG_config.h"
34 #include "utils/memory.h"
35 #include "utils/initialize.h"
36 #ifdef MG_ENABLE_TIMERS
37 #include "utils/timer.h"
60 bool xmlOutputP =
false;
73 if ( filename[0] ==
'.' || filename[0]==
'/' ) {
79 ret_val =
getCWD() +
"/" + filename;
116 #if defined QDPJIT_IS_QDPJITPTX || defined QDPJIT_IS_QDPJITNVVM
117 if (! QDP_isInitialized())
118 QDP_initialize_CUDA(argc, argv);
120 if (! QDP_isInitialized())
121 QDP_initialize(argc, argv);
124 for(
int i=0;
i < *argc;
i++)
132 QDPIO::cerr <<
"Usage: " << (*argv)[0] <<
" <options>" << std::endl
141 <<
" -cwd [" <<
getCWD() <<
"] xml working directory\n"
142 <<
" --chroma-cwd [" <<
getCWD() <<
"] xml working directory\n"
161 QDPIO::cerr <<
"Error: dangling -i specified. " << std::endl;
169 if(
i + 1 < *argc ) {
176 QDPIO::cerr <<
"Error: dangling -o specified. " << std::endl;
184 if(
i + 1 < *argc ) {
191 QDPIO::cerr <<
"Error: dangling -l specified. " << std::endl;
199 if(
i + 1 < *argc ) {
206 QDPIO::cerr <<
"Error: dangling -cwd specified. " << std::endl;
214 #if defined QDPJIT_IS_QDPJITPTX || defined QDPJIT_IS_QDPJITNVVM
216 std::cout <<
"Setting CUDA device" << std::endl;
217 #ifndef QDP_USE_COMM_SPLIT_INIT
218 int cuda_device = QDP_setGPU();
220 std::cout <<
"Initializing QMP part" << std::endl;
221 QDP_initialize_QMP(argc, argv);
222 #ifdef QDP_USE_COMM_SPLIT_INIT
223 int cuda_device = QDP_setGPUCommSplit();
225 setVerbosityQuda(QUDA_SUMMARIZE,
"", stdout);
227 QDPIO::cout <<
"Initializing QUDA device (using CUDA device no. " << cuda_device <<
")" << std::endl;
229 initQudaDevice(cuda_device);
230 QDPIO::cout <<
"Initializing QDP-JIT GPUs" << std::endl;
232 QDPIO::cout <<
"Initializing QUDA memory" << std::endl;
235 std::cout <<
"Setting device" << std::endl;
236 #ifndef QDP_USE_COMM_SPLIT_INIT
239 std::cout <<
"Initializing QMP part" << std::endl;
240 QDP_initialize_QMP(argc, argv);
241 #ifdef QDP_USE_COMM_SPLIT_INIT
242 QDP_setGPUCommSplit();
244 QDPIO::cout <<
"Initializing start GPUs" << std::endl;
249 std::cout <<
"Initializing QUDA" << std::endl;
256 QDPIO::cout <<
"Initializing QPhiX CLI Args" << std::endl;
257 QPhiX::QPhiXCLIArgs& QPhiXArgs = TheQPhiXParams::Instance();
258 QPhiXArgs.init((*argc),(*argv));
259 QDPIO::cout <<
"QPhiX CLI Args Initialized" << std::endl;
260 QDPIO::cout <<
" QPhiX: By="<< QPhiXArgs.getBy() << std::endl;
261 QDPIO::cout <<
" QPhiX: Bz="<< QPhiXArgs.getBz() << std::endl;
262 QDPIO::cout <<
" QPhiX: Pxy="<< QPhiXArgs.getPxy() << std::endl;
263 QDPIO::cout <<
" QPhiX: Pxyz="<< QPhiXArgs.getPxyz() << std::endl;
264 QDPIO::cout <<
" QPhiX: NCores="<< QPhiXArgs.getNCores() << std::endl;
265 QDPIO::cout <<
" QPhiX: Sy="<< QPhiXArgs.getSy() << std::endl;
266 QDPIO::cout <<
" QPhiX: Sz="<< QPhiXArgs.getSz() << std::endl;
267 QDPIO::cout <<
" QPhiX: MinCt="<< QPhiXArgs.getMinCt() << std::endl;
269 int num_threads = QPhiXArgs.getNCores()*QPhiXArgs.getSy()*QPhiXArgs.getSz();
270 if( qdpNumThreads() != num_threads ) {
271 QDPIO::cerr <<
"ChromaInit: qdpNumThreads is different from NCores*Sy*Sz" << std::endl;
275 #if defined(QDP_IS_QDPJIT)
279 if (! QDP_assert_jit_datalayout(0,2,1,3,4) ) {
280 QDPIO::cerr <<
"ChromaInit: DataLayout Ordering Mismatch. Wanted ocsri layout, but have ";
281 QDP_print_jit_datalayout();
286 int64_t layout_inner_size=QDP::getDataLayoutInnerSize();
287 if( layout_inner_size != CHROMA_QPHIX_SOALEN ) {
288 QDPIO::cout <<
"ChromaInit: Our SOA Length is " << CHROMA_QPHIX_SOALEN <<
" but QDP-JIT has inner="<< layout_inner_size << std::endl;
296 QDPIO::cout <<
"Initializing MG_proto memory system" << std::endl;
297 MG::InitMemory(argc,argv);
299 QDPIO::cout <<
"Initializing QPhiX CLI Args for MG_proto" << std::endl;
300 MG::InitCLIArgs(argc,argv);
316 #ifdef MG_ENABLE_TIMERS
317 (MG::Timer::TimerAPI::getInstance())->reportAllTimer();
320 MG::FinalizeMemory();
323 #if defined(BUILD_JIT_CLOVER_TERM)
324 #if defined(QDPJIT_IS_QDPJITPTX)
329 if (! QDP_isInitialized())
398 XMLReader& getXMLInputInstance()
402 TheXMLInputReader::Instance().open(getXMLInputFileName());
405 QDPIO::cerr << "Unable to open " << pathname << std::endl;
411 return TheXMLInputReader::Instance();
Initialization of Chroma.
static PackForQUDATimer & Instance()
void get(multi1d< LatticeColorMatrix > &u, XMLBufferWriter &file_xml, XMLBufferWriter &record_xml)
Get the default gauge field.
const std::string name
Name to be used.
Asqtad Staggered-Dirac operator.
std::string getXMLOutputFileName()
Get output file name.
XMLFileWriter & getXMLLogInstance()
Get xml log instance.
void setCWD(const std::string &name)
Set current working directory.
void setXMLOutputFileName(const std::string &name)
Set output file name.
void initialize(int *argc, char ***argv)
Chroma initialisation routine.
void finalize(void)
Chroma finalization routine.
std::string getCWD()
Get current working directory.
std::string getXMLInputFileName()
Get input file name.
std::string getXMLLogFileName()
Get log file name.
void setXMLInputFileName(const std::string &name)
Set input file name.
void abort(int i)
Chroma abort routine.
void setXMLLogFileName(const std::string &name)
Set output logfile name.
XMLFileWriter & getXMLOutputInstance()
Get xml output instance.
Singleton instances of xml output.