Multi-ApplicationOnlineProfiling  2.1
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Knowledge_System.h
Go to the documentation of this file.
1 /* ############################ MALP License ############################## */
2 /* # Fri Jan 18 14:00:00 CET 2013 # */
3 /* # Copyright or (C) or Copr. Commissariat a l'Energie Atomique # */
4 /* # # */
5 /* # This software is governed by the CeCILL-C license under French law # */
6 /* # and abiding by the rules of distribution of free software. You can # */
7 /* # use, modify and/ or redistribute the software under the terms of # */
8 /* # the CeCILL-C license as circulated by CEA, CNRS and INRIA at the # */
9 /* # following URL http://www.cecill.info. # */
10 /* # # */
11 /* # The fact that you are presently reading this means that you have # */
12 /* # had knowledge of the CeCILL-C license and that you accept its # */
13 /* # terms. # */
14 /* # # */
15 /* # Authors: # */
16 /* # - BESNARD Jean-Baptiste jean-baptiste.besnard@cea.fr # */
17 /* # # */
18 /* ######################################################################## */
19 
20 #ifndef KNOWLEDGE_SYSTEM_H
21 #define KNOWLEDGE_SYSTEM_H
22 
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26 
27 #include "Buffered_FIFO.h"
28 #include "Spinlock.h"
29 
30 struct Data_entry;
31 struct MALP_blackboard;
32 
40 {
41  uint8_t freed;
42  int64_t type;
45  /* Sensivity Handling */
46  uint32_t sensivity_count;
47  uint64_t *sensivity_keys;
48  uint64_t *sensivity_array;
50  int is_serial;
52  void (*process)( struct MALP_blackboard *bb,
53  struct Data_entry **de, uint32_t entry_count, void *arg );
54  void *arg;
55 };
56 
57 
68 void Knowledge_system_init( struct Knowledge_system *ks, uint64_t type, uint64_t *sensivity_keys, uint32_t sensivity_count,
69  void (*process)( struct MALP_blackboard *bb, struct Data_entry **de, uint32_t entry_count, void *arg ), void *arg );
70 
77 
85 void Knowledge_system_set_process( struct Knowledge_system *ks, void (*process)( struct MALP_blackboard *bb, struct Data_entry **de, uint32_t entry_count, void *arg ), void *arg );
86 
93 void Knowledge_system_set_serial( struct Knowledge_system *ks, int is_serial );
94 
102 
103 
104 
110 {
111  uint64_t ks_type;
112  int32_t entries_count;
113  struct Data_entry **entries;
114  void (*process)( struct MALP_blackboard *bb, struct Data_entry **de, uint32_t entry_count, void *arg );
115  void *arg;
116  int is_serial;
117 };
118 
126 
133 
134 
143 
144 
145 #ifdef __cplusplus
146 }
147 #endif
148 
149 
150 #endif
uint64_t * sensivity_array
struct Buffered_FIFO * data_entries
struct Knowledge_system_job Knowledge_system_job_new(struct Knowledge_system *ks)
Knowledge_system_job_new.
struct Data_entry ** entries
struct Knowledge_system_job Knowledge_system_submit_data_entry(struct Knowledge_system *ks, struct Data_entry *de)
Knowledge_system_submit_data_entry.
MALP_Spinlock lock
uint32_t sensivity_count
The Knowledge_system structure.
This is a struct defining a FIFO It is composed of several Buffered_FIFO_chunk.
void Knowledge_system_set_serial(struct Knowledge_system *ks, int is_serial)
sets the parallelism mode for this KS
struct representing a job that does the actual data processing (created by Knowledge_system) ...
The MALP_blackboard structure.
void(* process)(struct MALP_blackboard *bb, struct Data_entry **de, uint32_t entry_count, void *arg)
void Knowledge_system_set_process(struct Knowledge_system *ks, void(*process)(struct MALP_blackboard *bb, struct Data_entry **de, uint32_t entry_count, void *arg), void *arg)
sets the processing function to a Knowledge_system
int Knowledge_system_has_unsatisfied_sensivities(struct Knowledge_system *ks)
Knowledge_system_has_unsatisfied_sensivities.
void Knowledge_system_release(struct Knowledge_system *ks)
Knowledge_system release.
volatile unsigned int MALP_Spinlock
The type of spinlocks in MALP.
Definition: Spinlock.h:63
void(* process)(struct MALP_blackboard *bb, struct Data_entry **de, uint32_t entry_count, void *arg)
uint64_t ks_type
the type of Knowledge_system
Struct defining a piece of data that can exist on the blackboard.
Definition: Data_Entry.h:37
uint64_t * sensivity_keys
void Knowledge_system_job_release(struct Knowledge_system_job *ksj)
Knowledge_system_job_release.
void Knowledge_system_init(struct Knowledge_system *ks, uint64_t type, uint64_t *sensivity_keys, uint32_t sensivity_count, void(*process)(struct MALP_blackboard *bb, struct Data_entry **de, uint32_t entry_count, void *arg), void *arg)
Initializes a Knowledge_system.