Commit a839ea5c authored by Mathieu Faverge's avatar Mathieu Faverge
Browse files

Remove those useless check that were causing problem on simgrid traces

parent 03a65cdb
/*
** This file is part of the ViTE project.
**
** This software is governed by the CeCILL-A license under French law
** and abiding by the rules of distribution of free software. You can
** use, modify and/or redistribute the software under the terms of the
** CeCILL-A license as circulated by CEA, CNRS and INRIA at the following
** URL: "http://www.cecill.info".
**
** As a counterpart to the access to the source code and rights to copy,
** modify and redistribute granted by the license, users are provided
** only with a limited warranty and the software's author, the holder of
** the economic rights, and the successive licensors have only limited
** liability.
**
** In this respect, the user's attention is drawn to the risks associated
** with loading, using, modifying and/or developing or reproducing the
** software by the user in light of its specific status of free software,
** that may mean that it is complicated to manipulate, and that also
** therefore means that it is reserved for developers and experienced
** professionals having in-depth computer knowledge. Users are therefore
** encouraged to load and test the software's suitability as regards
** their requirements in conditions enabling the security of their
** systems and/or data to be ensured and, more generally, to use and
** operate it in the same conditions as regards security.
**
** The fact that you are presently reading this means that you have had
** knowledge of the CeCILL-A license and that you accept its terms.
**
**
** ViTE developers are (for version 0.* to 1.0):
**
** - COULOMB Kevin
** - FAVERGE Mathieu
** - JAZEIX Johnny
** - LAGRASSE Olivier
** - MARCOUEILLE Jule
** - NOISETTE Pascal
** - REDONDY Arthur
** - VUCHENER Clément
**
*/
** This file is part of the ViTE project.
**
** This software is governed by the CeCILL-A license under French law
** and abiding by the rules of distribution of free software. You can
** use, modify and/or redistribute the software under the terms of the
** CeCILL-A license as circulated by CEA, CNRS and INRIA at the following
** URL: "http://www.cecill.info".
**
** As a counterpart to the access to the source code and rights to copy,
** modify and redistribute granted by the license, users are provided
** only with a limited warranty and the software's author, the holder of
** the economic rights, and the successive licensors have only limited
** liability.
**
** In this respect, the user's attention is drawn to the risks associated
** with loading, using, modifying and/or developing or reproducing the
** software by the user in light of its specific status of free software,
** that may mean that it is complicated to manipulate, and that also
** therefore means that it is reserved for developers and experienced
** professionals having in-depth computer knowledge. Users are therefore
** encouraged to load and test the software's suitability as regards
** their requirements in conditions enabling the security of their
** systems and/or data to be ensured and, more generally, to use and
** operate it in the same conditions as regards security.
**
** The fact that you are presently reading this means that you have had
** knowledge of the CeCILL-A license and that you accept its terms.
**
**
** ViTE developers are (for version 0.* to 1.0):
**
** - COULOMB Kevin
** - FAVERGE Mathieu
** - JAZEIX Johnny
** - LAGRASSE Olivier
** - MARCOUEILLE Jule
** - NOISETTE Pascal
** - REDONDY Arthur
** - VUCHENER Clément
**
*/
#include <iostream>
#include <string>
#include <map>
......@@ -159,22 +159,22 @@ Trace::~Trace()
}
// Delete state types
for(std::map<Name, StateType* >::iterator it=_state_types.begin(); it !=_state_types.end(); it++)
for(std::map<Name, StateType* >::iterator it=_state_types.begin(); it !=_state_types.end(); it++)
delete (*it).second;
// Delete event types
for(std::map<Name, EventType* >::iterator it=_event_types.begin(); it !=_event_types.end(); it++)
for(std::map<Name, EventType* >::iterator it=_event_types.begin(); it !=_event_types.end(); it++)
delete (*it).second;
// Delete link types
for(std::map<Name, LinkType* >::iterator it=_link_types.begin(); it !=_link_types.end(); it++)
for(std::map<Name, LinkType* >::iterator it=_link_types.begin(); it !=_link_types.end(); it++)
delete (*it).second;
// Delete variable types
for(std::map<Name, VariableType* >::iterator it=_variable_types.begin(); it !=_variable_types.end(); it++)
for(std::map<Name, VariableType* >::iterator it=_variable_types.begin(); it !=_variable_types.end(); it++)
delete (*it).second;
_state_types.clear();
_event_types.clear();
......@@ -197,9 +197,9 @@ void Trace::define_container_type(Name &name, ContainerType *parent, map<string,
parent->add_child(type);
else
_root_container_types.push_back(type);
#if defined(USE_ITC) && defined(BOOST_SERIALIZE)
#if defined(USE_ITC) && defined(BOOST_SERIALIZE)
Serializer<ContainerType>::Instance().setUid(type);
#endif
#endif
// Delete unused extra fields
delete_opt(opt);
}
......@@ -256,29 +256,22 @@ void Trace::destroy_container(Date &time,
}
void Trace::define_event_type(Name &name, ContainerType *container_type, map<string, Value *> &opt) {
if (container_type){
EventType* et=new EventType(name, container_type, opt);
_event_types.insert ( pair<Name , EventType*>(name,et));
#if defined(USE_ITC) && defined(BOOST_SERIALIZE)
#if defined(USE_ITC) && defined(BOOST_SERIALIZE)
Serializer<EntityType>::Instance().setUid(et);
#endif
#endif
//_event_types.push_back(new EventType(name, container_type, opt));
}
}
void Trace::define_state_type(Name &name, ContainerType *container_type, map<string, Value *> &opt) {
if (container_type){
StateType* st=new StateType(name, container_type, opt);
_state_types.insert ( pair<Name , StateType*>(name,st));
#if defined(USE_ITC) && defined(BOOST_SERIALIZE)
#if defined(USE_ITC) && defined(BOOST_SERIALIZE)
Serializer<EntityType>::Instance().setUid(st);
#endif
}
#endif
// _state_types.push_back(new StateType(name, container_type, opt));
}
......@@ -287,21 +280,26 @@ void Trace::define_variable_type(Name &name, ContainerType *container_type, map<
VariableType* vt=new VariableType(name, container_type, opt);
_variable_types.insert ( pair<Name , VariableType*>(name,vt));
#if defined(USE_ITC) && defined(BOOST_SERIALIZE)
#if defined(USE_ITC) && defined(BOOST_SERIALIZE)
Serializer<EntityType>::Instance().setUid(vt);
#endif
#endif
}
//_variable_types.push_back(new VariableType(name, container_type, opt));
}
void Trace::define_link_type(Name &name, ContainerType *ancestor, ContainerType *source, ContainerType *destination, map<string, Value *> &opt) {
if (ancestor && source && destination){
void Trace::define_link_type(Name &name,
ContainerType *ancestor,
ContainerType *source,
ContainerType *destination,
map<string, Value *> &opt)
{
// TODO: make a clean error message if source or destination is undefined
if (source && destination){
LinkType * lt= new LinkType(name, ancestor, source, destination, opt);
_link_types.insert ( pair<Name , LinkType*>(name,lt));
#if defined(USE_ITC) && defined(BOOST_SERIALIZE)
#if defined(USE_ITC) && defined(BOOST_SERIALIZE)
Serializer<EntityType>::Instance().setUid(lt);
#endif
#endif
//_link_types.push_back(new LinkType(name, ancestor, source, destination, opt));
}
}
......@@ -444,7 +442,7 @@ void Trace::finish() {
#if defined(USE_ITC) && defined(BOOST_SERIALIZE)
void Trace::updateTrace(Interval* interval){
if(Info::Splitter::load_splitted==true){
if(Info::Splitter::load_splitted==true){
if(Info::Splitter::preview==false){
loadTraceInside(interval);
finish();
......@@ -486,7 +484,7 @@ void Trace::loadTraceInside(Interval* interval){
//wait for loading to finish
SerializerDispatcher::Instance().kill_all_threads();
}
}
void Trace::loadPreview (){
stack<Container *> containers;
......@@ -515,7 +513,7 @@ void Trace::loadPreview (){
}
}
}
}
void Trace::dump(std::string path, std::string filename) {
......@@ -1099,6 +1097,5 @@ std::map<long int,double> Trace::update_text_variable_values(double date){
containers.push(*it);
}
}
return values;
return values;
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment