MCPcopy Create free account
hub / github.com/dmtcp/dmtcp / example_event_hook

Function example_event_hook

test/plugin/example/example.c:22–50  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

20}
21
22static void
23example_event_hook(DmtcpEvent_t event, DmtcpEventData_t *data)
24{
25 /* NOTE: See warning in plugin/README about calls to printf here. */
26 switch (event) {
27 case DMTCP_EVENT_INIT:
28 printf("The plugin containing %s has been initialized.\n", __FILE__);
29 break;
30
31 case DMTCP_EVENT_EXIT:
32 printf("The plugin is being called before exiting.\n");
33 break;
34
35 case DMTCP_EVENT_PRECHECKPOINT:
36 checkpoint();
37 break;
38
39 case DMTCP_EVENT_RESUME:
40 resume();
41 break;
42
43 case DMTCP_EVENT_RESTART:
44 restart();
45 break;
46
47 default:
48 break;
49 }
50}
51
52DmtcpPluginDescriptor_t example_plugin = {
53 DMTCP_PLUGIN_API_VERSION,

Callers

nothing calls this directly

Calls 3

checkpointFunction · 0.70
resumeFunction · 0.70
restartFunction · 0.70

Tested by

no test coverage detected