#include <stdint.h>
#include <stdio.h>
#include <serene/rt/trace.h>
#include <serene/runtime.h>
#include "serene/utils.h"
Go to the source code of this file.
◆ NUMBER_OF_ELEMENTS
| #define NUMBER_OF_ELEMENTS 1000 |
◆ mapper_args_t
| typedef struct mapper_args_t mapper_args_t |
◆ mapper_f
| typedef uint64_t(* mapper_f) (uint64_t v) |
◆ add_1()
| uint64_t add_1 |
( |
uint64_t | v | ) |
|
|
static |
◆ main_13()
Definition at line 48 of file 13_map_reduce.c.
48 {
51
53
55
57
58
59
61 .val = i,
63 };
65 }
66
67
70 }
71
73 printf(">> %lu\n", xs[i]);
74 };
75
76 return 0;
77}
static uint64_t add_1(uint64_t v)
static srn_fiber_result_t mapper_fiber(srn_context_t *ctx, void *arg)
#define NUMBER_OF_ELEMENTS
#define SRN_FIBER_SPAWN_COPY(ctx, entry, value)
srn_fiber_spawn_copy for an lvalue, the address and size are taken for the caller.
srn_fiber_result_t srn_fiber_wait_for(srn_fiber_t *target)
Block the calling fiber until target finishes, then return its result.
◆ mapper_fiber()
Definition at line 40 of file 13_map_reduce.c.
40 {
41 (void)ctx;
43
44 uint64_t val = mapper_args->f(mapper_args->val);
45 return (void *)(uintptr_t)val;
46}