Documentation:
- New section in the user guide on the provided performance models.
- New section presenting some technical good practices for (potential) contributors.
+ - Add a section on errors and exceptions to the API documentation.
Fixed bugs (FG#.. -> FramaGit bugs; FG!.. -> FG merge requests)
(FG: issues on Framagit; GH: issues on GitHub)
INPUT += ../../include/simgrid/cond.h
INPUT += ../../include/simgrid/engine.h
INPUT += ../../include/simgrid/exec.h
+INPUT += ../../include/simgrid/Exception.hpp
INPUT += ../../include/simgrid/host.h
INPUT += ../../src/s4u/s4u_Host.cpp
#INPUT += ../../include/simgrid/instr.h
.. doxygenfunction:: sg_sem_release(sg_sem_t sem)
.. doxygenfunction:: sg_sem_would_block(const_sg_sem_t sem)
+===============
+Error reporting
+===============
+
+.. tabs::
+
+ .. group-tab:: C++
+
+ .. doxygenclass:: simgrid::Exception
+
+ The following exceptions denote a problem in the simulated platform, and it is often useful to catch them.
+
+ .. doxygenclass:: simgrid::CancelException
+ .. doxygenclass:: simgrid::HostFailureException
+ .. doxygenclass:: simgrid::NetworkFailureException
+ .. doxygenclass:: simgrid::StorageFailureException
+ .. doxygenclass:: simgrid::TimeoutException
+ .. doxygenclass:: simgrid::VmFailureException
+
+ The following errors denote a problem in the SimGrid tool itself. Most of the time, you should let these
+ exception go, so that the simulation stops. But you may want to catch them, for example when you launch
+ simgrid from a python notebook and want to handle the problem accordingly.
+
+ .. doxygenclass:: simgrid::AssertionError
+ .. doxygenclass:: simgrid::ParseError
+ .. doxygenclass:: simgrid::TracingError
+
+ .. group-tab:: Python
+
+ The following exceptions denote a problem in the simulated platform, and it is often useful to catch them.
+
+ .. autoclass:: simgrid.CancelException
+ .. autoclass:: simgrid.HostFailureException
+ .. autoclass:: simgrid.NetworkFailureException
+ .. autoclass:: simgrid.StorageFailureException
+ .. autoclass:: simgrid.TimeoutException
+ .. autoclass:: simgrid.VmFailureException
+
+ The following errors denote a problem in the SimGrid tool itself. Most of the time, you should let these
+ exception go, so that the simulation stops. But you may want to catch them, for example when you launch
+ simgrid from a python notebook and want to handle the problem accordingly.
+
+ .. autoclass:: simgrid.AssertionError
+
+ .. group-tab:: C
+
+ .. doxygenenum:: sg_error_t
+
+
.. |hr| raw:: html
<hr />
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
+/* This file defines all possible exception that could occur in a SimGrid library. */
+
#ifndef SIMGRID_EXCEPTIONS_HPP
#define SIMGRID_EXCEPTIONS_HPP
-/** @file exception.hpp SimGrid-specific Exceptions
- *
- * Defines all possible exception that could occur in a SimGrid library.
- */
-
#include <xbt/backtrace.hpp>
#include <xbt/ex.h>
#include <xbt/string.hpp>
* Constitute the contextual information of where an exception was thrown
*
* These tuples (__FILE__, __LINE__, __func__, backtrace, procname, pid)
- * are best created with @ref XBT_THROW_POINT.
- *
- * @ingroup XBT_ex
+ * are best created with the macro XBT_THROW_POINT.
*/
class ThrowPoint {
public:
typedef long aid_t;
typedef enum {
- SG_OK,
- SG_ERROR_CANCELED,
- SG_ERROR_TIMEOUT,
- SG_ERROR_HOST,
- SG_ERROR_NETWORK,
- SG_ERROR_STORAGE,
- SG_ERROR_VM
+ SG_OK /** Code returned when no problem occured */,
+ SG_ERROR_CANCELED /** Code returned when something got canceled before completion */,
+ SG_ERROR_TIMEOUT /** Code returned when timeout elapsed */,
+ SG_ERROR_HOST /** Code returned when a host fails */,
+ SG_ERROR_NETWORK /** Code returned when a communication fails because of the network or because of the remote host */,
+ SG_ERROR_STORAGE /** Code returned when a storage fails */,
+ SG_ERROR_VM /** Code returned when a VM fails */
} sg_error_t;
XBT_PUBLIC int SMPI_is_inited();