s_surf_model_description_t surf_plugin_description[] = {
{"Energy",
"Cpu energy consumption.",
- sg_energy_plugin_init},
+ sg_host_energy_plugin_init},
{"MyNetworkPlugin",
"My network plugin.",
sg_my_network_plugin_init},
avoiding switching to Maestro and reading directly the data you're interested
in.
-For simcalls which might block, `kernelSync()` can be used. It takes a
+For simcalls which might block, `kernel_sync()` can be used. It takes a
C++ callback and executes it immediately in maestro. This C++ callback is
expected to return a `simgrid::kernel::Future<T>` reprensenting the operation
in the kernal. When the operations completes, the user process is waken up
~~~
try {
- std::vector<char> result = simgrid::simix::kernelSync([&] {
+ std::vector<char> result = simgrid::simix::kernel_sync([&] {
// Fictional example, simgrid::kernel::readFile does not exist.
simgrid::kernel::Future<std::vector<char>> result = simgrid::kernel::readFile(file);
return result;
});
XBT_DEBUG("Finished reading file %s: length %zu", file, result.size());
}
-// If the operation failed, kernelSync() throws an exception:
+// If the operation failed, kernel_sync() throws an exception:
catch (std::runtime_error& e) {
XBT_ERROR("Could not read file %s", file);
}
~~~
-Asynchronous blocks can be implemented with `kernelAsync()`. It works
-like `kernelSync()` but does not block. Instead, it returns a
+Asynchronous blocks can be implemented with `kernel_async()`. It works
+like `kernel_sync()` but does not block. Instead, it returns a
`simgrid::simix::Future` representing the operation in the process:
~~~
-simgrid::simix::Future<std:vector<char>> result = simgrid::simix::kernelSync([&] {
+simgrid::simix::Future<std:vector<char>> result = simgrid::simix::kernel_sync([&] {
// Fictional example, simgrid::kernel::readFile does not exist.
simgrid::kernek::Future<std::vector<char>> result = simgrid::kernel::readFile(file);
return result;
}
~~~
-<b>Note:</b> `kernelSync(f)` could be implemented as `kernelAsync(f).get()`.
+<b>Note:</b> `kernel_sync(f)` could be implemented as `kernel_async(f).get()`.
\section simgrid_dev_guide_tag What is How to add a new tag for xml files?