Commit 9bcc7d15 by Marcus Winter

examples: fixed mtapi_cpp example

parent a90d311a
...@@ -51,8 +51,8 @@ static ...@@ -51,8 +51,8 @@ static
static static
int fibonacci(int n) { int fibonacci(int n) {
#include "mtapi/mtapi_cpp_initialize-snippet.h" #include "mtapi/mtapi_cpp_initialize-snippet.h"
#include "mtapi/mtapi_cpp_register_action-snippet.h"
#include "mtapi/mtapi_cpp_get_node-snippet.h" #include "mtapi/mtapi_cpp_get_node-snippet.h"
#include "mtapi/mtapi_cpp_register_action-snippet.h"
/* start calculation */ /* start calculation */
#include "mtapi/mtapi_cpp_start_task-snippet.h" #include "mtapi/mtapi_cpp_start_task-snippet.h"
/* wait for task completion */ /* wait for task completion */
......
/* create action */ /* create action */
embb::mtapi::Action fibonacciAction( embb::mtapi::Action fibonacciAction = node.CreateAction(
FIBONACCI_JOB, /* action ID, defined by the FIBONACCI_JOB, /* action ID, defined by the
application */ application */
(fibonacciActionFunction) /* action function */ (fibonacciActionFunction) /* action function */
); );
/* get job */ /* get job */
fibonacciJob = embb::mtapi::Job(FIBONACCI_JOB, THIS_DOMAIN_ID); fibonacciJob = node.GetJob(FIBONACCI_JOB, THIS_DOMAIN_ID);
mtapi_status_t status = task.Wait(MTAPI_INFINITE); status = task.Wait(MTAPI_INFINITE);
if (status != MTAPI_SUCCESS) { if (status != MTAPI_SUCCESS) {
printf("task failed with error: %d\n\n", status); printf("task failed with error: %d\n\n", status);
exit(status); exit(status);
......
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 sign in to comment