Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Don't use pass-by-value for large parameters.
[simgrid.git] / src / mc / mc_record.hpp
1 /* Copyright (c) 2014-2019. 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 /** \file mc_record.hpp
7  *
8  *  This file contains the MC replay/record functionnality.
9  *  A MC path may be recorded by using ``-cfg=model-check/record:1`'`.
10  *  The path is written in the log output and an be replayed with MC disabled
11  *  (even with an non-MC build) with `--cfg=model-check/replay:$replayPath`.
12  *
13  *  The same version of Simgrid should be used and the same arguments should be
14  *  passed to the application (without the MC specific arguments).
15  */
16
17 #ifndef SIMGRID_MC_RECORD_HPP
18 #define SIMGRID_MC_RECORD_HPP
19
20 #include "src/mc/mc_config.hpp"
21 #include "src/mc/mc_forward.hpp"
22 #include "xbt/base.h"
23
24 #include <vector>
25
26 namespace simgrid {
27 namespace mc {
28
29 typedef std::vector<Transition> RecordTrace;
30
31 /** Convert a string representation of the path into a array of `simgrid::mc::Transition`
32  */
33 XBT_PRIVATE RecordTrace parseRecordTrace(const char* data);
34 XBT_PRIVATE std::string traceToString(simgrid::mc::RecordTrace const& trace);
35 XBT_PRIVATE void dumpRecordPath();
36
37 XBT_PRIVATE void replay(RecordTrace const& trace);
38 XBT_PRIVATE void replay(std::string trace);
39 }
40 }
41
42 /** Whether the MC record mode is enabled
43  *
44  *  The behaviour is not changed. The only real difference is that
45  *  the path is writtent in the log when an interesting path is found.
46  */
47 #define MC_record_is_active() _sg_do_model_check_record
48
49 // **** Data conversion
50
51 #endif