Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
7d6ec3b0596515a106ce9ea3527671cf1b2b62b4
[simgrid.git] / src / simix / simcalls.in
1 # Copyright (c) 2014. The SimGrid Team. All rights reserved.
2
3 # This program is free software; you can redistribute it and/or modify it
4 # under the terms of the license (GNU LGPL) which comes with this package.
5
6 # CallType handler? name (resulttype,resultcast) (arg0name,arg0type,arg0cast) (arg1name,arg1type,arg1cast)
7
8 # CallType must be one of the three:
9 #
10 #  - Func: returning a value immediately (within the same scheduling round)
11 #    examples: all getters that only retrieve informations with no side effect
12 #
13 #  - Proc: not returning any value (but doing so immediately) 
14 #    examples: all setters, *_cancel 
15 #
16 #  - Blck: Blocking call that does not return in the same scheduling round.
17 #    The answer requires some interaction with SURF, even if this can
18 #    still occure at the same timestamp under some circonstances (eg
19 #    if the surf_action cannot start because of resources that are down)
20 #    examples: things that last some time (communicate, execute, mutex_lock)
21 #
22 #    In a perfect world, these answers would also be handled by the
23 #    script, but we are not there yet. Instead, the answer is manually
24 #    generated in one of the SIMIX_post_*() functions, that are called
25 #    when we unpack the done and failed actions returned by surf after
26 #    a surf simulation round. Weird things happen if you forget to
27 #    answer a given simcall in there...
28
29 # Handler? is either "H" if we need to generate a handler or "-" if we should go without handlers
30
31 # I wish we could completely remove the handlers as their only use is
32 # to adapt the interface between the exported symbol that is visible
33 # by the user applications and the internal symbol that is implemented 
34 # by the kernel. 
35 # The only remaining use of that mechanism is to add the caller
36 # identity as a parameter of internal call, but that could be
37 # automatized too (eg by having a special parameter type called "self")
38
39 # Please note that in addition to completing this file with your new simcall,
40 # you should complete the libsmx.c file by adding the corresponding function
41 # (aka. stub). Anyway, if you omit to do it, the invocation of ./simcalls.py will notify you ;)
42 # If you want to remove an handler, it is important to remove although
43 # the corresponding code (simcall_HANDLER_name_of_simcall(xxx) (note that comment the code 
44 # is not sufficient, the python script does not check whether the code is commented or not).
45 # Last but not the least, you should declare the new simix call in
46 # ./include/simgrid/simix.h (otherwise you will get a warning at the
47 # compilation time)
48
49 Proc - host_on (void) (host, void*, sg_host_t)
50 Proc H host_off (void) (host, void*, sg_host_t)
51 Func - host_get_properties (void*, xbt_dict_t) (host, void*, sg_host_t)
52 Func - host_get_process_list (void*, xbt_swag_t) (host, void*, sg_host_t)
53 Func - host_get_current_power_peak (double) (host, void*, sg_host_t)
54 Func - host_get_power_peak_at (double) (host, void*, sg_host_t) (pstate_index, int)
55 Func - host_get_wattmin_at (double) (host, void*, sg_host_t) (pstate_index, int)
56 Func - host_get_wattmax_at (double) (host, void*, sg_host_t) (pstate_index, int)
57 Proc - host_set_pstate (void) (host, void*, sg_host_t) (pstate_index, int)
58
59 Func - host_get_mounted_storage_list (void*, xbt_dict_t) (host, void*, sg_host_t)
60 Func - host_get_attached_storage_list (void*, xbt_dynar_t) (host, void*, sg_host_t)
61 Proc - host_get_params (void) (ind_vm, void*, sg_host_t) (params, void*, vm_params_t)
62 Proc - host_set_params (void) (ind_vm, void*, sg_host_t) (params, void*, vm_params_t)
63 Func - vm_create (void*, sg_host_t) (name, const char*) (ind_pm, void*, sg_host_t)
64 Proc - vm_start (void) (ind_vm, void*, sg_host_t)
65 Func - vm_get_state (int) (ind_vm, void*, sg_host_t)
66 Proc - vm_migrate (void) (ind_vm, void*, sg_host_t) (ind_dst_pm, void*, sg_host_t)
67 Func - vm_get_pm (void*) (ind_vm, void*, sg_host_t)
68 Proc - vm_set_bound (void) (ind_vm, void*, sg_host_t) (bound, double)
69 Proc - vm_set_affinity (void) (ind_vm, void*, sg_host_t) (ind_pm, void*, sg_host_t) (mask, unsigned long)
70 Proc - vm_destroy (void) (ind_vm, void*, sg_host_t)
71 Proc H vm_suspend (void) (ind_vm, void*, sg_host_t)
72 Proc H vm_resume (void) (ind_vm, void*, sg_host_t)
73 Proc H vm_shutdown (void) (ind_vm, void*, sg_host_t)
74 Proc H vm_save (void) (ind_vm, void*, sg_host_t)
75 Proc H vm_restore (void) (ind_vm, void*, sg_host_t)
76 Proc - vm_migratefrom_resumeto (void) (vm, void*, sg_host_t)(src_pm, void*, sg_host_t) (dst_pm, void*, sg_host_t)
77 Func H process_create (void*) (name, const char*) (code, FPtr, xbt_main_func_t) (data, void*) (hostname, const char*) (kill_time, double) (argc, int) (argv, void*, char**) (properties, void*, xbt_dict_t) (auto_restart, int)
78 Proc H process_kill (void) (process, void*, smx_process_t)
79 Proc H process_killall (void) (reset_pid, int)
80 Proc - process_cleanup (void) (process, void*, smx_process_t)
81 Blck H process_suspend (void) (process, void*, smx_process_t)
82 Proc H process_resume (void) (process, void*, smx_process_t)
83 Func - process_count (int)
84 Func - process_get_PID (int) (process, void*, smx_process_t)
85 Func - process_get_PPID (int) (process, void*, smx_process_t)
86 Func - process_get_data (void*) (process, void*, smx_process_t)
87 Proc - process_set_data (void) (process, void*, smx_process_t) (data, void*)
88 Proc H process_set_host (void) (process, void*, smx_process_t) (dest, void*, sg_host_t)
89 Func - process_get_host (void*, sg_host_t) (process, void*, smx_process_t)
90 Func - process_get_name (const char*) (process, void*, smx_process_t)
91 Func - process_is_suspended (int) (process, void*, smx_process_t)
92 Func - process_get_properties (void*, xbt_dict_t) (process, void*, smx_process_t)
93 Blck H process_join (int) (process, void*, smx_process_t) (timeout, double)
94 Blck H process_sleep (int) (duration, double)
95
96 Func H process_execute (void*, smx_synchro_t) (name, const char*) (flops_amount, double) (priority, double) (bound, double) (affinity_mask, unsigned long)
97 Func - process_parallel_execute (void*, smx_synchro_t) (name, const char*) (host_nb, int) (host_list, void*, sg_host_t*) (flops_amount, void*, double*) (bytes_amount, void*, double*) (amount, double) (rate, double)
98 Proc - process_execution_destroy (void) (execution, void*, smx_synchro_t)
99 Proc - process_execution_cancel (void) (execution, void*, smx_synchro_t)
100 Func - process_execution_get_remains (double) (execution, void*, smx_synchro_t)
101 Func - process_execution_get_state (int, e_smx_state_t) (execution, void*, smx_synchro_t)
102 Proc - process_execution_set_priority (void) (execution, void*, smx_synchro_t) (priority, double)
103 Proc - process_execution_set_bound (void) (execution, void*, smx_synchro_t) (bound, double)
104 Proc - process_execution_set_affinity (void) (execution, void*, smx_synchro_t) (ws, void*, sg_host_t) (mask, unsigned long)
105 Blck H process_execution_wait (int) (execution, void*, smx_synchro_t)
106
107 Proc - process_on_exit (void) (process, void*, smx_process_t) (fun, FPtr, int_f_pvoid_pvoid_t) (data, void*)
108 Proc - process_auto_restart_set (void) (process, void*, smx_process_t) (auto_restart, int)
109 Func H process_restart (void*, smx_process_t) (process, void*, smx_process_t)
110
111 Func - rdv_create (void*, smx_rdv_t) (name, const char*)
112 Proc - rdv_destroy (void) (rdv, void*, smx_rdv_t)
113 Func - rdv_comm_count_by_host (unsigned int) (rdv, void*, smx_rdv_t) (host, void*, sg_host_t)
114 Func - rdv_get_head (void*, smx_synchro_t) (rdv, void*, smx_rdv_t)
115 Proc - rdv_set_receiver (void) (rdv, void*, smx_rdv_t) (receiver, void*, smx_process_t)
116 Func - rdv_get_receiver (void*, smx_process_t) (rdv, void*, smx_rdv_t)
117 Func H comm_iprobe (void*, smx_synchro_t) (rdv, void*, smx_rdv_t) (type, int) (src, int) (tag, int) (match_fun, FPtr, simix_match_func_t) (data, void*)
118 Blck H comm_send (void)                  (sender, void*, smx_process_t) (rdv, void*, smx_rdv_t)  (task_size, double) (rate, double) (src_buff, void*) (src_buff_size, size_t) (match_fun, FPtr, simix_match_func_t) (copy_data_fun, FPtr, simix_copy_data_func_t) (data, void*) (timeout, double)
119 Func H comm_isend (void*, smx_synchro_t) (sender, void*, smx_process_t) (rdv, void*, smx_rdv_t) (task_size, double) (rate, double) (src_buff, void*) (src_buff_size, size_t) (match_fun, FPtr, simix_match_func_t) (clean_fun, FPtr, simix_clean_func_t) (copy_data_fun, FPtr, simix_copy_data_func_t) (data, void*) (detached, int)
120 Blck H comm_recv (void)                  (receiver, void*, smx_process_t) (rdv, void*, smx_rdv_t) (dst_buff, void*) (dst_buff_size, void*, size_t*) (match_fun, FPtr, simix_match_func_t) (copy_data_fun, FPtr, simix_copy_data_func_t) (data, void*) (timeout, double) (rate, double)
121 Func H comm_irecv (void*, smx_synchro_t) (receiver, void*, smx_process_t) (rdv, void*, smx_rdv_t) (dst_buff, void*) (dst_buff_size, void*, size_t*) (match_fun, FPtr, simix_match_func_t) (copy_data_fun, FPtr, simix_copy_data_func_t) (data, void*) (rate, double)
122 Proc - comm_cancel (void) (comm, void*, smx_synchro_t)
123 Blck H comm_waitany (int) (comms, void*, xbt_dynar_t)
124 Blck H comm_wait (void) (comm, void*, smx_synchro_t) (timeout, double)
125 Blck H comm_test (int) (comm, void*, smx_synchro_t)
126 Blck H comm_testany (int) (comms, void*, xbt_dynar_t)
127 Func - comm_get_remains (double) (comm, void*, smx_synchro_t)
128 Func - comm_get_state (int, e_smx_state_t) (comm, void*, smx_synchro_t)
129 Func - comm_get_src_data (void*) (comm, void*, smx_synchro_t)
130 Func - comm_get_dst_data (void*) (comm, void*, smx_synchro_t)
131 Func - comm_get_src_proc (void*, smx_process_t) (comm, void*, smx_synchro_t)
132 Func - comm_get_dst_proc (void*, smx_process_t) (comm, void*, smx_synchro_t)
133 Func H mutex_init (void*, smx_mutex_t)
134 Proc - mutex_destroy (void) (mutex, void*, smx_mutex_t)
135 Blck H mutex_lock (void) (mutex, void*, smx_mutex_t)
136 Func H mutex_trylock (int) (mutex, void*, smx_mutex_t)
137 Proc H mutex_unlock (void) (mutex, void*, smx_mutex_t)
138 Func - cond_init (void*, smx_cond_t)
139 Proc - cond_destroy (void) (cond, void*, smx_cond_t)
140 Proc - cond_signal (void) (cond, void*, smx_cond_t)
141 Blck H cond_wait (void) (cond, void*, smx_cond_t) (mutex, void*, smx_mutex_t)
142 Blck H cond_wait_timeout (void) (cond, void*, smx_cond_t) (mutex, void*, smx_mutex_t) (timeout, double)
143 Proc - cond_broadcast (void) (cond, void*, smx_cond_t)
144 Func - sem_init (void*, smx_sem_t) (capacity, unsigned int)
145 Proc - sem_destroy (void) (sem, void*, smx_sem_t)
146 Proc H sem_release (void) (sem, void*, smx_sem_t)
147 Func H sem_would_block (int) (sem, void*, smx_sem_t)
148 Blck H sem_acquire (void) (sem, void*, smx_sem_t)
149 Blck H sem_acquire_timeout (void) (sem, void*, smx_sem_t) (timeout, double)
150 Func H sem_get_capacity (int) (sem, void*, smx_sem_t)
151 Blck H file_read (sg_size_t) (fd, void*, smx_file_t) (size, sg_size_t) (host, void*, sg_host_t)
152 Blck H file_write (sg_size_t) (fd, void*, smx_file_t) (size, sg_size_t) (host, void*, sg_host_t)
153 Blck H file_open (void*, smx_file_t) (fullpath, const char*) (host, void*, sg_host_t)
154 Blck H file_close (int) (fd, void*, smx_file_t) (host, void*, sg_host_t)
155 Func - file_unlink (int) (fd, void*, smx_file_t) (host, void*, sg_host_t)
156 Func H file_get_size (sg_size_t) (fd, void*, smx_file_t)
157 Func H file_tell (sg_size_t) (fd, void*, smx_file_t)
158 Func H file_seek (int) (fd, void*, smx_file_t) (offset, sg_offset_t) (origin, int)
159 Func H file_get_info (void*, xbt_dynar_t) (fd, void*, smx_file_t)
160 Func H file_move (int) (fd, void*, smx_file_t) (fullpath, const char*)
161 Func H storage_get_free_size (sg_size_t) (storage, void*, smx_storage_t)
162 Func H storage_get_used_size (sg_size_t) (name, void*, smx_storage_t)
163 Func - storage_get_properties (void*, xbt_dict_t) (storage, void*, smx_storage_t)
164 Func - storage_get_content (void*, xbt_dict_t) (storage, void*, smx_storage_t)
165 Func H asr_get_properties (void*, xbt_dict_t) (name, const char*)
166 Func H mc_random (int) (min, int) (max, int)
167 Proc - set_category (void) (synchro, void*, smx_synchro_t) (category, const char*)
168 Proc - run_kernel (void) (code, void*)
169 ## HAVE_LATENCY_BOUND_TRACKING
170 Func - comm_is_latency_bounded (int) (comm, void*, smx_synchro_t)
171 ## HAVE_MC
172 Func H mc_snapshot (void*, mc_snapshot_t)
173 Func H mc_compare_snapshots (int) (s1, void*, mc_snapshot_t) (s2, void*, mc_snapshot_t)