1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- #pragma once
- #include <stdint.h>
- #include <stddef.h>
- #ifdef __cplusplus
- // Only expose templated version with C++
- template<typename T>
- void debug_ipc_assert_equal(T value);
- extern "C" {
- #endif
- #define DEBUG_IPC_CHECKPOINT() debug_ipc_assert_source_location(__FILE__, __LINE__)
- void debug_ipc_init();
- void debug_ipc_assert_equal_double(double value);
- void debug_ipc_assert_equal_uint(uint32_t value);
- void debug_ipc_assert_equal_int(int32_t value);
- void debug_ipc_assert_equal_int64(int64_t value);
- void debug_ipc_assert_equal_array(void *value, size_t size);
- /**
- * Check that root and client are executing the same source line.
- * Should typically be called like this:
- * debug_ipc_assert_source_location(__FILE__, __LINE__)
- */
- void debug_ipc_assert_source_location(const char *source_file, const long int line_number);
- void debug_ipc_mpi_set_data_distribution(int start_index, uint64_t local_length);
- /**
- * Compare two MPI distributed arrays between processes.
- * array_length denotes the number of double elements in the array, not the number of bytes.
- *
- * The data distribution must be given through `debug_ipc_mpi_set_data_distribution` before calling
- * this method.
- *
- * Span is an additional parameter that acts as a multiplier on the assigned indices given by the data distribution.
- * For example, if our data distribution looks like this with three doubles assigned per global index:
- * Rank 0 Rank 1 Rank 2
- * ┌───────────────────┐ ┌───────────────────┐ ┌───────────────────┐
- * │ │ │ │ │ │
- * │ A B C │ │ A B C │ │ A B C │
- * │ │ │ │ │ │
- * └───────────────────┘ └───────────────────┘ └───────────────────┘
- * global index 0 1 2
- *
- *
- * …we would have to specify a span of 3, because each global index spans across 3 doubles.
- */
- void debug_ipc_assert_equal_mpi_double_array(double *array, size_t array_length, int span);
- #ifdef __cplusplus
- }
- #endif
|