| 79 | } |
| 80 | |
| 81 | static int GraphBLAS_Init(RedisModuleCtx *ctx) { |
| 82 | // GraphBLAS should use Redis allocator |
| 83 | GrB_Info res = GxB_init(GrB_NONBLOCKING, RedisModule_Alloc, |
| 84 | RedisModule_Calloc, RedisModule_Realloc, RedisModule_Free); |
| 85 | if(res != GrB_SUCCESS) { |
| 86 | RedisModule_Log(ctx, "warning", "Encountered error initializing GraphBLAS"); |
| 87 | return REDISMODULE_ERR; |
| 88 | } |
| 89 | |
| 90 | // all matrices in CSR format |
| 91 | GxB_set(GxB_FORMAT, GxB_BY_ROW); |
| 92 | |
| 93 | return REDISMODULE_OK; |
| 94 | } |
| 95 | |
| 96 | int RedisModule_OnLoad(RedisModuleCtx *ctx, RedisModuleString **argv, int argc) { |
| 97 | if(RedisModule_Init(ctx, "graph", REDISGRAPH_MODULE_VERSION, |
no test coverage detected