Commit df67b7da authored by Swann Perarnau's avatar Swann Perarnau Committed by Florence Monna

[feature] add nrm context create/delete functions

Will help passing opaque pointers from Fortran.
parent c0c3f28a
......@@ -17,6 +17,21 @@
#include "nrm.h"
int nrm_ctxt_create(struct nrm_context **ctxt)
{
assert(ctxt != NULL);
*ctxt = calloc(1, sizeof(struct nrm_context));
assert(*ctxt != NULL);
return 0;
}
int nrm_ctxt_delete(struct nrm_context **ctxt)
{
assert(ctxt != NULL);
free(*ctxt);
return 0;
}
int nrm_init(struct nrm_context *ctxt, const char *uuid)
{
assert(ctxt != NULL);
......
......@@ -36,6 +36,9 @@ struct nrm_context {
#define NRM_PHASE_CONTEXT_FORMAT "{\"api\":\"down_event\",\"type\":\"phase_context\", \"cpu\": %u, \"aggregation\": %u, \"computetime\": %llu, \"totaltime\": %llu, \"application_uuid\": \"%s\"}"
#define NRM_EXIT_FORMAT "{\"api\": \"down_event\", \"type\":\"application_exit\"}"
int nrm_ctxt_create(struct nrm_context **);
int nrm_ctxt_delete(struct nrm_context **);
int nrm_init(struct nrm_context *, const char *);
int nrm_fini(struct nrm_context *);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment