|
@@ -20,8 +20,8 @@
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
*/
|
|
*/
|
|
|
|
|
|
-#ifndef UTILS_TRACE
|
|
|
|
-#define UTILS_TRACE
|
|
|
|
|
|
+#ifndef ARTIS_UTILS_TRACE
|
|
|
|
+#define ARTIS_UTILS_TRACE
|
|
|
|
|
|
#include <algorithm>
|
|
#include <algorithm>
|
|
#include <iterator>
|
|
#include <iterator>
|
|
@@ -32,11 +32,30 @@
|
|
#include <vector>
|
|
#include <vector>
|
|
|
|
|
|
#include <artis/utils/DateTime.hpp>
|
|
#include <artis/utils/DateTime.hpp>
|
|
|
|
+#include <artis/kernel/Any.hpp>
|
|
|
|
|
|
namespace artis { namespace utils {
|
|
namespace artis { namespace utils {
|
|
|
|
|
|
enum TraceType { NONE = 0, CHECK, COMPUTE, INIT, KERNEL, PUT };
|
|
enum TraceType { NONE = 0, CHECK, COMPUTE, INIT, KERNEL, PUT };
|
|
|
|
|
|
|
|
+enum InformationType { CONSTRUCTION, DESTRUCTION,
|
|
|
|
+ BEFORE_COMPUTE, AFTER_COMPUTE, INTERNAL_VALUE,
|
|
|
|
+ EXTERNAL_VALUE, PUT_TO_EXTERNAL, LINK_INTERNAL };
|
|
|
|
+
|
|
|
|
+struct TraceInfo
|
|
|
|
+{
|
|
|
|
+
|
|
|
|
+ std::string _src_model_name;
|
|
|
|
+ artis::kernel::Any _value;
|
|
|
|
+ InformationType _type;
|
|
|
|
+ std::string _tgt_model_model;
|
|
|
|
+
|
|
|
|
+ TraceInfo(const std::string& src_model_name, artis::kernel::Any value,
|
|
|
|
+ InformationType type, const std::string& tgt_model_model = "") :
|
|
|
|
+ _src_model_name(src_model_name), _value(value), _type(type), _tgt_model_model(tgt_model_model)
|
|
|
|
+ { }
|
|
|
|
+};
|
|
|
|
+
|
|
template < class Time >
|
|
template < class Time >
|
|
class TraceElement
|
|
class TraceElement
|
|
{
|
|
{
|
|
@@ -124,9 +143,9 @@ public:
|
|
for (typename TraceElements < Time >::const_iterator it =
|
|
for (typename TraceElements < Time >::const_iterator it =
|
|
TraceElements < Time >::begin();
|
|
TraceElements < Time >::begin();
|
|
it != TraceElements < Time >::end(); ++it) {
|
|
it != TraceElements < Time >::end(); ++it) {
|
|
- std::string date = it->get_time() == -1 ? "start" :
|
|
|
|
- it->get_time() == 0 ? "end" :
|
|
|
|
- utils::DateTime::toJulianDay(it->get_time());
|
|
|
|
|
|
+ std::string date = it->get_time() == -1 ? "construction" :
|
|
|
|
+ it->get_time() == 0 ? "initialization" :
|
|
|
|
+ utils::DateTime::toJulianDay(it->get_time());
|
|
ss << "TRACE: " << it->get_model_name() << " at "
|
|
ss << "TRACE: " << it->get_model_name() << " at "
|
|
<< date << " <";
|
|
<< date << " <";
|
|
switch (it->get_type())
|
|
switch (it->get_type())
|