/* prevent 0.0000 in the trace - this was the behavior before the transition to c++ */
if (timestamp < 1e-12)
stream << 0;
- else
- stream << timestamp;
+ else
+ stream << timestamp;
stream << " " << container->type->id << " " << container->id;
print_row();
} else if (instr_fmt_type == instr_fmt_TI) {
if(f2c_lookup_==nullptr){
f2c_lookup_=xbt_dict_new_homogeneous(nullptr);
}
- char key[KEY_SIZE];
if(id >= 0){
+ char key[KEY_SIZE];
return static_cast<F2C*>(xbt_dict_get_or_null(f2c_lookup_, get_key(key, id)));
}else
return NULL;
void Group::set_mapping(int index, int rank)
{
- int * val_rank;
-
if (rank < size_) {
rank_to_index_map_[rank] = index;
if (index!=MPI_UNDEFINED ) {
- val_rank = static_cast<int *>(xbt_malloc(sizeof(int)));
+ int* val_rank = static_cast<int*>(xbt_malloc(sizeof(int)));
*val_rank = rank;
char * key = bprintf("%d", index);
int Group::compare(MPI_Group group2)
{
int result;
- int i;
- int index;
result = MPI_IDENT;
if (size_ != group2->size()) {
result = MPI_UNEQUAL;
} else {
int sz = group2->size();
- for (i = 0; i < sz; i++) {
- index = this->index(i);
+ for (int i = 0; i < sz; i++) {
+ int index = this->index(i);
int rank = group2->rank(index);
if (rank == MPI_UNDEFINED) {
result = MPI_UNEQUAL;
int Request::waitsome(int incount, MPI_Request requests[], int *indices, MPI_Status status[])
{
- int i;
int count = 0;
- int index;
MPI_Status stat;
MPI_Status *pstat = status == MPI_STATUSES_IGNORE ? MPI_STATUS_IGNORE : &stat;
- for(i = 0; i < incount; i++)
- {
- index=waitany(incount, requests, pstat);
+ for (int i = 0; i < incount; i++) {
+ int index = waitany(incount, requests, pstat);
if(index!=MPI_UNDEFINED){
indices[count] = index;
count++;
static void sg_instr_new_router(simgrid::kernel::routing::NetPoint * netpoint)
{
if (not netpoint->isRouter())
- return;
+ return;
if (TRACE_is_enabled() && TRACE_needs_platform()) {
container_t father = currentContainer.back();
PJ_container_new(netpoint->cname(), INSTR_ROUTER, father);
*/
void xbt_dict_dump(xbt_dict_t dict, void_f_pvoid_t output)
{
- int i;
xbt_dictelm_t element;
printf("Dict %p:\n", dict);
if (dict != nullptr) {
- for (i = 0; i < dict->table_size; i++) {
+ for (int i = 0; i < dict->table_size; i++) {
element = dict->table[i];
if (element) {
printf("[\n");
e->run();
XBT_INFO("Simulation time %g", e->getClock());
+ delete e;
return 0;
}
simgrid::s4u::Actor::createActor("Sender", hosts[1], sender);
xbt_free(hosts);
- simgrid::s4u::Engine::instance()->run();
+ engine->run();
+ delete engine;
return 0;
}