|
tblite
Light-weight tight-binding framework
|
Provides a persistent configuration object to modify the behaviour of a calculation. Acts as an error handler. More...
Go to the source code of this file.
Typedefs | |
| typedef struct _tblite_context * | tblite_context |
| Context manager for the library usage. | |
| typedef void(*) | tblite_logger_callback(tblite_error, char *, int, void *) |
| Define callback function for use in custom logger. | |
Functions | |
| TBLITE_API_ENTRY tblite_context TBLITE_API_CALL | tblite_new_context (void) |
| TBLITE_API_ENTRY void TBLITE_API_CALL | tblite_delete_context (tblite_context *ctx) |
| TBLITE_API_ENTRY int TBLITE_API_CALL | tblite_check_context (tblite_context ctx) |
| TBLITE_API_ENTRY void TBLITE_API_CALL | tblite_get_context_error (tblite_context ctx, char *buffer, const int *buffersize) |
| TBLITE_API_ENTRY void TBLITE_API_CALL | tblite_set_context_logger (tblite_context ctx, tblite_logger_callback callback, void *userdata) |
| TBLITE_API_ENTRY void TBLITE_API_CALL | tblite_set_context_color (tblite_context ctx, int color) |
| TBLITE_API_ENTRY void TBLITE_API_CALL | tblite_set_context_verbosity (tblite_context ctx, int verbosity) |
| TBLITE_API_ENTRY void TBLITE_API_CALL | tblite_set_context_partition (tblite_context ctx, int part, int nparts) |
| TBLITE_API_ENTRY void TBLITE_API_CALL | tblite_set_context_mpi (tblite_context ctx, const int *comm) |
Provides a persistent configuration object to modify the behaviour of a calculation. Acts as an error handler.
The environment context tblite_context can be considered a persistent setup for all calculations performed with the library, it is usually used together with calculator objects tblite_calculator. While the error handle can only contain a single error, multiple errors can be accumulated in a context object, which allows storing more complex error information like they can occur in an actual calculation.
| TBLITE_API_ENTRY int TBLITE_API_CALL tblite_check_context | ( | tblite_context | ctx | ) |
Check calculation environment status
| ctx | Context handle |
| TBLITE_API_ENTRY void TBLITE_API_CALL tblite_delete_context | ( | tblite_context * | ctx | ) |
Delete a calculation environment object
| ctx | Context handle |
| TBLITE_API_ENTRY void TBLITE_API_CALL tblite_get_context_error | ( | tblite_context | ctx, |
| char * | buffer, | ||
| const int * | buffersize ) |
Get error message from calculation environment
| ctx | Context handle |
| buffer | Character buffer for writing error message to |
| buffersize | Maximum length of buffer (optional) |
| TBLITE_API_ENTRY tblite_context TBLITE_API_CALL tblite_new_context | ( | void | ) |
Create new calculation environment object
| TBLITE_API_ENTRY void TBLITE_API_CALL tblite_set_context_color | ( | tblite_context | ctx, |
| int | color ) |
Enable colorful output
| ctx | Context handle |
| color | Set color support, 0: disabled, 1: enabled |
| TBLITE_API_ENTRY void TBLITE_API_CALL tblite_set_context_logger | ( | tblite_context | ctx, |
| tblite_logger_callback | callback, | ||
| void * | userdata ) |
Set custom logger function
| ctx | Context handle |
| callback | Procedure pointer implementing logger |
| userdata | Passthrough data pointer |
| TBLITE_API_ENTRY void TBLITE_API_CALL tblite_set_context_mpi | ( | tblite_context | ctx, |
| const int * | comm ) |
Distribute the interaction loops over an MPI communicator and reduce the partial results inside the library. Fails if tblite was built without MPI support, check with tblite_get_feature("mpi"), or if MPI is not initialized.
| ctx | Context handle |
| comm | Fortran handle of the communicator as returned by MPI_Comm_c2f, NULL selects MPI_COMM_WORLD (optional) |
| TBLITE_API_ENTRY void TBLITE_API_CALL tblite_set_context_partition | ( | tblite_context | ctx, |
| int | part, | ||
| int | nparts ) |
Assign an externally managed share of the interaction loops to the context
The share is applied to the calculator when running a calculation, reducing the partial results of all parts is left to the caller.
| ctx | Context handle |
| part | Zero-based index of this part |
| nparts | Total number of parts |
| TBLITE_API_ENTRY void TBLITE_API_CALL tblite_set_context_verbosity | ( | tblite_context | ctx, |
| int | verbosity ) |
Set verbosity level of printout
| ctx | Context handle |
| verbosity | Printout verbosity |