The Quantum Exact Simulation Toolkit v4.1.0
Loading...
Searching...
No Matches
Reporters

Functions for printing Qureg states or reporting their configuration. More...

Functions

void reportQureg (Qureg qureg)
 
void reportQuregParams (Qureg qureg)
 

Detailed Description

Functions for printing Qureg states or reporting their configuration.

Function Documentation

◆ reportQureg()

void reportQureg ( Qureg qureg)
Note
Documentation for this function or struct is under construction!
Warning
This function has not yet been unit tested and may contain bugs. Please use with caution!
See also
  • C and C++ examples

Definition at line 374 of file qureg.cpp.

374 {
375 validate_quregFields(qureg, __func__);
376 validate_numReportedNewlinesAboveZero(__func__); // because trailing newline mandatory
377
378 // account all local CPU memory (including buffer), neglecting GPU memory
379 // because it occupies distinct memory spaces, confusing accounting
380 size_t localMem = mem_getLocalQuregMemoryRequired(qureg.numAmpsPerNode);
381 if (qureg.isDistributed)
382 localMem *= 2; // include buffer. @todo will this ever overflow?!?!
383
384 // include struct size (expected negligibly tiny)
385 localMem += sizeof(qureg);
386
387 print_header(qureg, localMem);
388 print_elems(qureg);
389
390 // exclude mandatory newline above
391 print_oneFewerNewlines();
392}

◆ reportQuregParams()

void reportQuregParams ( Qureg qureg)
Note
Documentation for this function or struct is under construction!
Warning
This function has not yet been unit tested and may contain bugs. Please use with caution!
See also
  • C and C++ examples

Definition at line 356 of file qureg.cpp.

356 {
357 validate_quregFields(qureg, __func__);
358 validate_numReportedNewlinesAboveZero(__func__); // because trailing newline mandatory
359
360 /// @todo add function to write this output to file (useful for HPC debugging)
361
362 // printer routines will consult env rank to avoid duplicate printing
363 print_label("Qureg");
364 printDeploymentInfo(qureg);
365 printDimensionInfo(qureg);
366 printDistributionInfo(qureg);
367 printMemoryInfo(qureg);
368
369 // exclude mandatory newline above
370 print_oneFewerNewlines();
371}