The Quantum Exact Simulation Toolkit v4.0.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!

Definition at line 371 of file qureg.cpp.

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

◆ 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!

Definition at line 353 of file qureg.cpp.

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