![]() |
The Quantum Exact Simulation Toolkit v4.3.0
|
Experimental functions with tentative APIs. More...
Functions | |
| Qureg | createQuregFromFile (const char *fn) |
| int | getQuESTNumGpuThreadsPerBlock () |
| void | initCustomMpiCommQuESTEnv (MPI_Comm questComm, int useGpuAccel, int useMultithread) |
| void | initCustomMpiQuESTEnv (int useDistrib, bool userOwnsMpi, int useGpuAccel, int useMultithread) |
| void | saveQuregToFile (Qureg qureg, const char *fn) |
| void | setQuESTNumGpuThreadsPerBlock (int numThreadsPerBlock) |
Experimental functions with tentative APIs.
| Qureg createQuregFromFile | ( | const char * | fn | ) |
Creates a new Qureg from a file (or folder) previously created by saveQuregToFile(), with automatically chosen deployments (independent of those used when the file was saved), and populates the Qureg with the saved amplitudes.
The chosen deployments are identical to those chosen by createQureg() and createDensityQureg().
QUEST_ENABLE_ADIOS2=1.| [in] | fn | the file (or folder) path previously created by saveQuregToFile(). |
| error |
|
Definition at line 240 of file experimental.cpp.
Referenced by createQuregFromFile().
| int getQuESTNumGpuThreadsPerBlock | ( | ) |
Definition at line 137 of file experimental.cpp.
Referenced by TEST_CASE().
| void initCustomMpiCommQuESTEnv | ( | MPI_Comm | questComm, |
| int | useGpuAccel, | ||
| int | useMultithread ) |
Advanced initialiser which allows the user to provide an MPI communicator for QuEST to use. Use of this initialiser implies userOwnsMpi = true, (exposed by initCustomMpiQuESTEnv) and therefore that they have already initialised MPI, and they will call MPI_Finalize at the appropriate time.
The user-provided MPI communicator undergoes the same validation procedure as any that QuEST would use, and so must contain a power-of-2 number of processes.
Definition at line 113 of file experimental.cpp.
| void initCustomMpiQuESTEnv | ( | int | useDistrib, |
| bool | userOwnsMpi, | ||
| int | useGpuAccel, | ||
| int | useMultithread ) |
Advanced initialiser which lets the user positively declare that they take responsibility for MPI. This means we assume they have called MPI_Init, and that they will call MPI_Finalize.
Definition at line 107 of file experimental.cpp.
| void saveQuregToFile | ( | Qureg | qureg, |
| const char * | fn ) |
Writes the contents of qureg to the file (or folder) fn, so that it may later be restored with createQuregFromFile(), potentially in another process.
The output records the qureg dimension (number of qubits and whether it is a density matrix), the amplitude precision, the Qureg's distribution, and the Qureg's full set of amplitudes. Other deployment information, such as whether the Qureg is multithreaded or GPU-accelerated, is not recorded.
There is no particular file extension or folder name suffix required, though since saving is performed with ADIOS2, a suffix of .bp is conventional.
fn equal to an existing directory or file will cause erasure and overwriting of its contents. It is especially dangerous to pass fn equal to a system directory, such as / on Unix, and may cause system corruption.QUEST_ENABLE_ADIOS2=1.| [in] | qureg | the Qureg to write to disk. |
| [in] | fn | the output file (or folder) path. |
| error |
|
Definition at line 155 of file experimental.cpp.
Referenced by saveQuregToFile().
| void setQuESTNumGpuThreadsPerBlock | ( | int | numThreadsPerBlock | ) |
Overrides the number of CUDA threads per block (or blockDim) used by QuEST's GPU-accelerated backend.
This changes the GPU parallelisation granularity and can affect performance, and is useful for performance tuning or diagnostics. Before this function is called, QuEST will use the number as specified by the environment variable QUEST_DEFAULT_NUM_GPU_THREADS_PER_BLOCK, if defined. Otherwise, it will use the value specified by the CMake/compile option of the same name, which itself presently defaults to 128. After this function is called, QuEST will adopt numThreadsPerBlock for the remainder of execution, or until this function is called again.
Practical values of numThreadsPerBlock can vary with the simulation size, the user's GPU hardware, and whether it is NVIDIA or AMD, which have respective warp sizes of 32 and 64.
| [in] | numThreadsPerBlock | the new block size. |
| error |
|
Definition at line 144 of file experimental.cpp.
Referenced by TEST_CASE().