Example #1
0
int main (int argc, char **argv)
{
  poti_header (0, 0);
  poti_DefineContainerType ("ROOT", "0", "ROOT");
  poti_DefineContainerType ("PROCESS", "ROOT", "PROCESS");
  poti_DefineContainerType ("THREAD", "PROCESS", "THREAD");


  poti_CreateContainer (0, "root", "ROOT", "0", "root");
  poti_CreateContainer (0, "p1", "PROCESS", "root", "p1");
  poti_CreateContainer (0, "p2", "PROCESS", "root", "p2");
  poti_CreateContainer (0, "p3", "PROCESS", "root", "p3");

  poti_CreateContainer (0, "1t1", "THREAD", "p1", "t1");
  poti_CreateContainer (0, "1t2", "THREAD", "p1", "t2");
  poti_CreateContainer (0, "1t3", "THREAD", "p1", "t3");

  poti_CreateContainer (0, "2t1", "THREAD", "p2", "t1");
  poti_CreateContainer (0, "2t2", "THREAD", "p2", "t2");

  poti_CreateContainer (0, "3t1", "THREAD", "p3", "t1");

  poti_DestroyContainer (0.76, "PROCESS", "p2");
  
  poti_DestroyContainer (1.34, "ROOT", "root");

  return 0;
}
Example #2
0
int main (int argc, char **argv)
{
  //Vite-SVN requires a trace file with no extended events)
  //So:
  //first parameter set to 1 means basic header with no extended events
  //second parameter set to 0 means *new* header
  poti_header (1, 0);

  //Defining my types
  poti_DefineContainerType ("ROOT", "0", "ROOT");
  poti_DefineContainerType("THREAD", "ROOT", "THREAD");
  poti_DefineStateType("STATE", "THREAD", "STATE");
  poti_DefineLinkType("LINK", "ROOT", "THREAD", "THREAD", "LINK");

  //define values and color for the STATE type
  poti_DefineEntityValue("r", "STATE", "running", "0.0 1.0 0.0");
  poti_DefineEntityValue("i", "STATE", "idle", "0.3 0.3 0.3");

  //define values and color for the LINK type
  poti_DefineEntityValue("c", "LINK", "communication", "1 0 0");

  //Create my root container and containers for two threads
  poti_CreateContainer (0.01, "root", "ROOT", "0", "root");
  poti_CreateContainer (0.12, "thread-0", "THREAD", "root", "thread-0");
  poti_CreateContainer (0.23, "thread-1", "THREAD", "root", "thread-1");
  
  //Start a link from thread-0
  poti_StartLink (0.24, "root", "LINK", "thread-0", "c", "myKey-001");

  //Push and Pop two states for each thread
  poti_PushState (0.34, "thread-0", "STATE", "r");
  poti_PushState (0.45, "thread-1", "STATE", "r");
  poti_PopState  (0.56, "thread-0", "STATE");
  poti_PushState (0.67, "thread-0", "STATE", "i");
  poti_PopState  (0.78, "thread-1", "STATE");
  poti_PushState (0.89, "thread-1", "STATE", "i");
  poti_PopState  (0.90, "thread-0", "STATE");
  poti_PopState  (1.01, "thread-1", "STATE");

  //End the link at thread-1
  poti_EndLink (1.02, "root", "LINK", "thread-1", "c", "myKey-001");

  //Closing containers
  poti_DestroyContainer (1.12, "THREAD", "thread-0");
  poti_DestroyContainer (1.23, "THREAD", "thread-1");
  poti_DestroyContainer (1.34, "ROOT", "root");

  return 0;
}
Example #3
0
int main (int argc, char **argv)
{
  poti_init ();
  poti_header ();
  poti_DefineContainerType ("PROCESS", "0", "PROCESS");
  poti_DefineEventType ("EV", "PROCESS", "EV");

  poti_CreateContainer (0, "p1", "PROCESS", "0", "p1");

  poti_NewEvent(2.43, "p1", "EV", "PrimeiroEvento");
  poti_NewEvent(2.87, "p1", "EV", "SegundoEvento");

  //change the timestamp of destroy to be larger than that of latest NewEvent
  poti_DestroyContainer (1.34, "PROCESS", "p1");

  poti_close();
  return 0;
}
Example #4
0
int main (int argc, char **argv)
{
  poti_header (0, 0);
  poti_DefineContainerType ("PROCESS", "0", "PROCESS");
  poti_DefineStateType ("VAR", "PROCESS", "VAR");

  poti_CreateContainer (0, "p1", "PROCESS", "0", "p1");
  
  poti_SetState (0, "p1", "VAR", "Inicio");
  poti_PushState (0.32, "p1", "VAR", "Meio");
  poti_PopState (0.53, "p1", "VAR");
  poti_PushState (0.86, "p1", "VAR", "Fim");
  poti_PopState (0.99, "p1", "VAR");

  poti_DestroyContainer (1.34, "PROCESS", "p1");

  return 0;
}
Example #5
0
int main (int argc, char **argv)
{
  bzero (&arguments, sizeof(struct arguments));
  if (argp_parse (&argp, argc, argv, 0, 0, &arguments) == ARGP_KEY_ERROR){
    fprintf(stderr,
            "[%s] at %s,"
            "error during the parsing of parameters\n",
            PROGRAM, __FUNCTION__);
    return 1;
  }

  /* create reader based on anchorfile passed as parameter */
  OTF2_Reader* reader = OTF2_Reader_Open (arguments.input[0]);
  if (reader == NULL){
    fprintf(stderr,
            "[%s] at %s, "
            "creation of OTF2_Reader_New failed\n",
            PROGRAM, __FUNCTION__);
    return 1;
  }

  /* parameter check about hierarchy */
  if (arguments.hostfile && arguments.flat){
    fprintf(stderr,
            "[%s] at %s, "
            "Choose only one between -h and -f (see ./otf22paje --help)\n",
            PROGRAM, __FUNCTION__);
    return 1;
  }


  /* we start here to output the paje converted file */
  if (!arguments.dummy){
    /* start output with comments */
    if (arguments.comment){
      aky_dump_comment (PROGRAM, arguments.comment);
    }
    if (arguments.comment_file){
      if (aky_dump_comment_file (PROGRAM, arguments.comment_file) == 1){
        return 1;
      }
    }

    /* output build version, date and conversion for aky in the trace */
    aky_dump_version (PROGRAM, argv, argc);
    poti_header(arguments.basic, 0);
  }

  /* read global definitions */
  /* User data for callbacks. */
  otf2paje_t *user_data = (otf2paje_t*) malloc (sizeof (otf2paje_t));
  user_data->reader = reader;

  /* Define definition callbacks. */
  OTF2_GlobalDefReaderCallbacks *def_callbacks = OTF2_GlobalDefReaderCallbacks_New();
  OTF2_GlobalDefReaderCallbacks_SetLocationCallback (def_callbacks, otf22paje_global_def_location);
  OTF2_GlobalDefReaderCallbacks_SetStringCallback (def_callbacks, otf22paje_global_def_string);
  OTF2_GlobalDefReaderCallbacks_SetRegionCallback (def_callbacks, otf22paje_global_def_region);
  OTF2_GlobalDefReaderCallbacks_SetClockPropertiesCallback (def_callbacks, otf22paje_global_def_clock_properties);

  if (arguments.hostfile){
    if (nf_read_and_create_hierarchy (arguments.hostfile)){
      fprintf(stderr,
	      "[%s] at %s, "
	      "Parsing hostfile %s did not work.\n",
	      PROGRAM, __FUNCTION__, arguments.hostfile);
      return 1;
    }
    OTF2_GlobalDefReaderCallbacks_SetLocationGroupCallback (def_callbacks, otf22paje_global_def_location_group_hostfile);
    OTF2_GlobalDefReaderCallbacks_SetSystemTreeNodeCallback (def_callbacks, otf22paje_global_def_system_tree_node_hostfile);
  }else if (arguments.flat){
    OTF2_GlobalDefReaderCallbacks_SetLocationGroupCallback (def_callbacks, otf22paje_global_def_location_group_flat);
  }else{
    OTF2_GlobalDefReaderCallbacks_SetLocationGroupCallback (def_callbacks, otf22paje_global_def_location_group);
    OTF2_GlobalDefReaderCallbacks_SetLocationCallback (def_callbacks, otf22paje_global_def_location);
    OTF2_GlobalDefReaderCallbacks_SetSystemTreeNodeCallback (def_callbacks, otf22paje_global_def_system_tree_node);
    OTF2_GlobalDefReaderCallbacks_SetSystemTreeNodePropertyCallback (def_callbacks, otf22paje_global_def_system_tree_node_property);
    OTF2_GlobalDefReaderCallbacks_SetSystemTreeNodeDomainCallback (def_callbacks, otf22paje_global_def_system_tree_node_domain);
  }

  /* Read global definitions. */
  OTF2_GlobalDefReader* glob_def_reader  = OTF2_Reader_GetGlobalDefReader (reader);
  OTF2_Reader_RegisterGlobalDefCallbacks (reader, glob_def_reader,
                                        def_callbacks,
                                        user_data);
  uint64_t definitions_read = 0;
  OTF2_Reader_ReadGlobalDefinitions (reader, glob_def_reader,
                                     OTF2_UNDEFINED_UINT64,
                                     &definitions_read);
  /* Check if number of global definitions read matches the number of global
   * definitions defined in the anchor file. */
  uint64_t defs_anchor = 0;
  OTF2_Reader_GetNumberOfGlobalDefinitions (reader, &defs_anchor);
  if (definitions_read != defs_anchor){
    fprintf(stderr,
            "[%s] at %s, "
            "Number of global definitions read and "
            "defined in anchor file do not match.\n",
            PROGRAM, __FUNCTION__);   
    return 1;
  }


  /* Get number of locations from the anchor file. */
  uint64_t          num_locations = 0;
  OTF2_Reader_GetNumberOfLocations (reader, &num_locations);

  /* Read definitions */
  size_t i;
  for ( i = 0; i < num_locations; i++ ){
    OTF2_DefReader* def_reader = OTF2_Reader_GetDefReader (reader, i);
    uint64_t definitions_read = 0;
    OTF2_Reader_ReadAllLocalDefinitions (reader, def_reader, &definitions_read);
    OTF2_Reader_CloseDefReader (reader, def_reader);
  }

  /* Create event readers */
  for (i = 0; i < num_locations; i++){
    OTF2_Reader_GetEvtReader (reader, i);
  }

  /* Define event callbacks. */
  OTF2_GlobalEvtReaderCallbacks* evt_callbacks = OTF2_GlobalEvtReaderCallbacks_New();
  OTF2_GlobalEvtReaderCallbacks_SetEnterCallback( evt_callbacks, otf22paje_enter );
  OTF2_GlobalEvtReaderCallbacks_SetLeaveCallback( evt_callbacks, otf22paje_leave );

  /* Get global event reader. */
  OTF2_GlobalEvtReader *glob_evt_reader = OTF2_Reader_GetGlobalEvtReader (reader);

  /* Register the above defined callbacks to the global event reader. */
  OTF2_Reader_RegisterGlobalEvtCallbacks (reader,
                                          glob_evt_reader,
                                          evt_callbacks,
                                          user_data);


  /* Read until events are all read. */
  uint64_t events_read = UINT64_MAX;
  while (events_read == UINT64_MAX){
    OTF2_Reader_ReadGlobalEvents (reader,
                                  glob_evt_reader,
                                  UINT64_MAX,
                                  &events_read );
  }

  for (i = 0; i < num_locations; i++){
    char mpi_process[AKY_DEFAULT_STR_SIZE];
    snprintf(mpi_process, AKY_DEFAULT_STR_SIZE, "rank%zu", i);
    if (!arguments.dummy){
      poti_DestroyContainer(user_data->last_timestamp, "P", mpi_process);
    }
  }

  OTF2_Reader_Close (reader);
  return 0;
}
Example #6
0
void create_poti_event (paje_line line)
{
  int identifier = atoi(line.word[0]); 
  PajeEventId eventId = getPajeEventId (identifier);
  switch (eventId) {
  case PajeDefineContainerTypeEventId:
    poti_DefineContainerType(line.word[getPajeFieldPosition(identifier,PAJE_Alias)],
			     line.word[getPajeFieldPosition(identifier,PAJE_Type)],
			     line.word[getPajeFieldPosition(identifier,PAJE_Name)]);
    break;
  case PajeDefineEventTypeEventId:
    poti_DefineEventType(line.word[getPajeFieldPosition(identifier,PAJE_Alias)],
			 line.word[getPajeFieldPosition(identifier,PAJE_Type)],
			 line.word[getPajeFieldPosition(identifier,PAJE_Name)]);
    break;
  case PajeDefineStateTypeEventId:
    poti_DefineStateType(line.word[getPajeFieldPosition(identifier,PAJE_Alias)],
			 line.word[getPajeFieldPosition(identifier,PAJE_Type)],
			 line.word[getPajeFieldPosition(identifier,PAJE_Name)]);
    break;
  case PajeDefineVariableTypeEventId:
    poti_DefineVariableType(line.word[getPajeFieldPosition(identifier,PAJE_Alias)],
			    line.word[getPajeFieldPosition(identifier,PAJE_Type)],
			    line.word[getPajeFieldPosition(identifier,PAJE_Name)],
			    line.word[getPajeFieldPosition(identifier,PAJE_Color)]);
    break;
  case PajeDefineLinkTypeEventId:
    poti_DefineLinkType(line.word[getPajeFieldPosition(identifier,PAJE_Alias)],
			line.word[getPajeFieldPosition(identifier,PAJE_Type)],
			line.word[getPajeFieldPosition(identifier,PAJE_StartContainerType)],
			line.word[getPajeFieldPosition(identifier,PAJE_EndContainerType)],
			line.word[getPajeFieldPosition(identifier,PAJE_Name)]);
    break;
  case PajeDefineEntityValueEventId:
    poti_DefineEntityValue(line.word[getPajeFieldPosition(identifier,PAJE_Alias)],
			   line.word[getPajeFieldPosition(identifier,PAJE_Type)],
			   line.word[getPajeFieldPosition(identifier,PAJE_Name)],
			   line.word[getPajeFieldPosition(identifier,PAJE_Color)]);
    break;
  case PajeCreateContainerEventId:
    poti_CreateContainer(strtod(line.word[getPajeFieldPosition(identifier,PAJE_Time)],NULL),
			 line.word[getPajeFieldPosition(identifier,PAJE_Alias)],
			 line.word[getPajeFieldPosition(identifier,PAJE_Type)],
			 line.word[getPajeFieldPosition(identifier,PAJE_Container)],
			 line.word[getPajeFieldPosition(identifier,PAJE_Name)]);
    break;
  case PajeDestroyContainerEventId:
    poti_DestroyContainer(strtod(line.word[getPajeFieldPosition(identifier,PAJE_Time)],NULL),
			  line.word[getPajeFieldPosition(identifier,PAJE_Type)],
			  line.word[getPajeFieldPosition(identifier,PAJE_Name)]);
    break;
  case PajeNewEventEventId:
    poti_NewEvent(strtod(line.word[getPajeFieldPosition(identifier,PAJE_Time)],NULL),
		  line.word[getPajeFieldPosition(identifier,PAJE_Container)],
		  line.word[getPajeFieldPosition(identifier,PAJE_Type)],
		  line.word[getPajeFieldPosition(identifier,PAJE_Value)]);
    break;
  case PajeSetStateEventId:
    poti_SetState(strtod(line.word[getPajeFieldPosition(identifier,PAJE_Time)],NULL),
		  line.word[getPajeFieldPosition(identifier,PAJE_Container)],
		  line.word[getPajeFieldPosition(identifier,PAJE_Type)],
		  line.word[getPajeFieldPosition(identifier,PAJE_Value)]);
    break;
  case PajePushStateEventId:
    poti_PushState(strtod(line.word[getPajeFieldPosition(identifier,PAJE_Time)],NULL),
		   line.word[getPajeFieldPosition(identifier,PAJE_Container)],
		   line.word[getPajeFieldPosition(identifier,PAJE_Type)],
		   line.word[getPajeFieldPosition(identifier,PAJE_Value)]);
    break;
  case PajePopStateEventId:
    poti_PopState(strtod(line.word[getPajeFieldPosition(identifier,PAJE_Time)],NULL),
		  line.word[getPajeFieldPosition(identifier,PAJE_Container)],
		  line.word[getPajeFieldPosition(identifier,PAJE_Type)]);
    break;
  case PajeResetStateEventId:
    poti_ResetState(strtod(line.word[getPajeFieldPosition(identifier,PAJE_Time)],NULL),
		    line.word[getPajeFieldPosition(identifier,PAJE_Container)],
		    line.word[getPajeFieldPosition(identifier,PAJE_Type)]);
    break;
  case PajeSetVariableEventId:
    poti_SetVariable(strtod(line.word[getPajeFieldPosition(identifier,PAJE_Time)],NULL),
		     line.word[getPajeFieldPosition(identifier,PAJE_Container)],
		     line.word[getPajeFieldPosition(identifier,PAJE_Type)],
		     strtod(line.word[getPajeFieldPosition(identifier,PAJE_Value)],NULL));
    break;
  case PajeAddVariableEventId:
    poti_AddVariable(strtod(line.word[getPajeFieldPosition(identifier,PAJE_Time)],NULL),
		     line.word[getPajeFieldPosition(identifier,PAJE_Container)],
		     line.word[getPajeFieldPosition(identifier,PAJE_Type)],
		     strtod(line.word[getPajeFieldPosition(identifier,PAJE_Value)],NULL));
    break;
  case PajeSubVariableEventId:
    poti_SubVariable(strtod(line.word[getPajeFieldPosition(identifier,PAJE_Time)],NULL),
		     line.word[getPajeFieldPosition(identifier,PAJE_Container)],
		     line.word[getPajeFieldPosition(identifier,PAJE_Type)],
		     strtod(line.word[getPajeFieldPosition(identifier,PAJE_Value)],NULL));
    break;
  case PajeStartLinkEventId:
    poti_StartLink(strtod(line.word[getPajeFieldPosition(identifier,PAJE_Time)],NULL),
		   line.word[getPajeFieldPosition(identifier,PAJE_Container)],
		   line.word[getPajeFieldPosition(identifier,PAJE_Type)],
		   line.word[getPajeFieldPosition(identifier,PAJE_StartContainer)],
		   line.word[getPajeFieldPosition(identifier,PAJE_Value)],
		   line.word[getPajeFieldPosition(identifier,PAJE_Key)]);
    break;
  case PajeEndLinkEventId:
    poti_EndLink(strtod(line.word[getPajeFieldPosition(identifier,PAJE_Time)],NULL),
		 line.word[getPajeFieldPosition(identifier,PAJE_Container)],
		 line.word[getPajeFieldPosition(identifier,PAJE_Type)],
		 line.word[getPajeFieldPosition(identifier,PAJE_EndContainer)],
		 line.word[getPajeFieldPosition(identifier,PAJE_Value)],
		 line.word[getPajeFieldPosition(identifier,PAJE_Key)]);
    break;
  default:
    break;
  }
}
Example #7
0
int main(int argc, char **argv)
{
  bzero (&arguments, sizeof(struct arguments));
  if (argp_parse (&argp, argc, argv, 0, 0, &arguments) == ARGP_KEY_ERROR){
    fprintf(stderr,
            "[%s] at %s, "
            "error during the parsing of parameters\n",
            PROGRAM, __FUNCTION__);
    return 1;
  }

  if (aky_key_init() == 1){
   fprintf(stderr,
           "[%s] at %s,"
           "error during hash table allocation\n",
           PROGRAM, __FUNCTION__);
    return 1;
  }

  rst_rastro_t rastro;
  bzero (&rastro, sizeof(rst_rastro_t));
  rst_event_t event;
  int i;
  int fail = 0;

  for (i = 0; i < arguments.input_size; i++){
    int ret = rst_open_file(&rastro, 100000,
                            arguments.input[i],
                            arguments.synchronization_file);
    if (ret == -1) {
      fprintf(stderr,
              "[%s] at %s, "
              "trace file %s could not be opened\n",
              PROGRAM, __FUNCTION__, arguments.input[i]);
      return 1;
    }
  }

  name_init();

  if (!arguments.dummy){
    /* start output with comments */
    if (arguments.comment){
      aky_dump_comment (PROGRAM, arguments.comment);
    }
    if (arguments.comment_file){
      if (aky_dump_comment_file (PROGRAM, arguments.comment_file) == 1){
        return 1;
      }
    }

    /* output contents of synchronization file if used */
    if (arguments.synchronization_file){
      if (aky_dump_comment_file (PROGRAM, arguments.synchronization_file) == 1){
        return 1;
      }
    }

    /* output build version, date and conversion for aky in the trace */
    aky_dump_version (PROGRAM, argv, argc);
    poti_header (arguments.basic, 0);
    aky_paje_hierarchy();
  }


  double timestamp = -1;
  while (rst_decode_event(&rastro, &event) && !fail) {
    static int root_created = 0;
    char mpi_process[AKY_DEFAULT_STR_SIZE];
    snprintf(mpi_process, AKY_DEFAULT_STR_SIZE, "rank%"PRIu64"", event.id1);
    timestamp = event.timestamp;
    switch (event.type) {
    case AKY_PTP_SEND:
      if (!arguments.no_links){
        char key[AKY_DEFAULT_STR_SIZE];
        int messageSize = -1;
        int mark = -1;
        if (event.ct.n_uint32 == 2){
          /* has message size */
          messageSize = event.v_uint32[1];
          if (event.ct.n_uint64 == 1){
            /* has message mark */
            mark = event.v_uint64[0];
          }
        }
        aky_put_key(AKY_KEY_PTP, event.id1, event.v_uint32[0], key,
                    AKY_DEFAULT_STR_SIZE);
        if (messageSize != -1 && mark != -1){
          poti_StartLinkSizeMark(timestamp, "root", "LINK",
                                 mpi_process, "PTP", key,
                                 messageSize, mark);
        }else{
          poti_StartLink(timestamp, "root", "LINK", mpi_process, "PTP", key);
        }
      }
      break;
    case AKY_PTP_RECV:
      if (!arguments.no_links){
        char key[AKY_DEFAULT_STR_SIZE];
        char *result = aky_get_key(AKY_KEY_PTP, event.v_uint32[0], event.id1,
            key, AKY_DEFAULT_STR_SIZE);
        if (result == NULL){
          fprintf (stderr,
                   "[aky_converter] at %s, no key to generate a pajeEndLink,\n"
                   "[aky_converter] got a receive at dst = %"PRIu64" from src = %d\n"
                   "[aky_converter] but no send for this receive yet,\n"
                   "[aky_converter] do you synchronize your input traces?\n",
                   __FUNCTION__, event.id1, event.v_uint32[0]);
          if (!arguments.ignore_errors){
            fail = 1;
          }
        }
        poti_EndLink(timestamp, "root", "LINK", mpi_process, "PTP", key);
      }
      break;
    case AKY_1TN_SEND:
      if (!arguments.no_links) {
        char key[AKY_DEFAULT_STR_SIZE];
        int messageSize = -1;
        int mark = -1;
        if (event.ct.n_uint32 == 2){
          messageSize = event.v_uint32[1];
          if (event.ct.n_uint64 == 1)
            mark = event.v_uint64[0];
        }
        u_int32_t rank;
        for (rank = 0; rank < event.v_uint32[0]; rank++) {
        /*                        ^ number of processes in the communicator */
          // TODO register a link to self also?
          if (rank != event.id1) {
            aky_put_key(AKY_KEY_1TN, event.id1, rank, key, AKY_DEFAULT_STR_SIZE);
                /*                   ^ our rank ^ dst */
            if (messageSize != -1 && mark != -1)
              poti_StartLinkSizeMark(timestamp, "root", "LINK", mpi_process,
                  "1TN", key, messageSize, mark);
            else
              poti_StartLink(timestamp, "root", "LINK", mpi_process, "1TN",
                  key);
          }
        }
      }
      break;
    case AKY_1TN_RECV:
      if (!arguments.no_links) {
        char key[AKY_DEFAULT_STR_SIZE];
        char *result = aky_get_key(AKY_KEY_1TN, event.v_uint32[0], event.id1,
            key, AKY_DEFAULT_STR_SIZE);
            /*                                  ^ src              ^ rank */
        if (!result) {
          fprintf (stderr,
                   "[aky_converter] at %s, no key to generate a pajeEndLink,\n"
                   "[aky_converter] got a receive at dst = %"PRIu64" from src = %d\n"
                   "[aky_converter] but no send for this receive yet,\n"
                   "[aky_converter] do you synchronize your input traces?\n",
                   __FUNCTION__, event.id1, event.v_uint32[0]);
          if (!arguments.ignore_errors)
            fail = 1;
        }
        poti_EndLink(timestamp, "root", "LINK", mpi_process, "1TN", key);
      }
      break;
    case MPI_INIT:
      if (root_created == 0){
        poti_CreateContainer (timestamp, "root", "ROOT", "0", "root");
        root_created = 1;
      }
      poti_CreateContainer(timestamp, mpi_process,
                           "PROCESS", "root", mpi_process);
      break;
    case MPI_COMM_SPAWN_IN:
    case MPI_COMM_GET_NAME_IN:
    case MPI_COMM_SET_NAME_IN:
    case MPI_REDUCE_IN:
    case MPI_ALLREDUCE_IN:
    case MPI_REDUCE_SCATTER_IN:
    case MPI_ALLGATHER_IN:
    case MPI_ALLGATHERV_IN:
    case MPI_SCATTER_IN:
    case MPI_SCATTERV_IN:
    case MPI_WAIT_IN:
    case MPI_IRECV_IN:
    case MPI_ISEND_IN:
    case MPI_RECV_IN:
    case MPI_SEND_IN:
    case MPI_BCAST_IN:
    case MPI_BARRIER_IN:
    case MPI_GATHER_IN:
    case MPI_GATHERV_IN:
    case MPI_ALLTOALL_IN:
    case MPI_ALLTOALLV_IN:
    case MPI_OP_CREATE_IN:
    case MPI_OP_FREE_IN:
    case MPI_SCAN_IN:
    case MPI_ATTR_DELETE_IN:
    case MPI_ATTR_GET_IN:
    case MPI_ATTR_PUT_IN:
    case MPI_COMM_COMPARE_IN:
    case MPI_COMM_CREATE_IN:
    case MPI_COMM_DUP_IN:
    case MPI_COMM_FREE_IN:
    case MPI_COMM_GROUP_IN:
    case MPI_COMM_RANK_IN:
    case MPI_COMM_REMOTE_GROUP_IN:
    case MPI_COMM_REMOTE_SIZE_IN:
    case MPI_COMM_SIZE_IN:
    case MPI_COMM_SPLIT_IN:
    case MPI_COMM_TEST_INTER_IN:
    case MPI_GROUP_COMPARE_IN:
    case MPI_GROUP_DIFFERENCE_IN:
    case MPI_GROUP_EXCL_IN:
    case MPI_GROUP_FREE_IN:
    case MPI_GROUP_INCL_IN:
    case MPI_GROUP_INTERSECTION_IN:
    case MPI_GROUP_RANK_IN:
    case MPI_GROUP_RANGE_EXCL_IN:
    case MPI_GROUP_RANGE_INCL_IN:
    case MPI_GROUP_SIZE_IN:
    case MPI_GROUP_TRANSLATE_RANKS_IN:
    case MPI_GROUP_UNION_IN:
    case MPI_INTERCOMM_CREATE_IN:
    case MPI_INTERCOMM_MERGE_IN:
    case MPI_KEYVAL_CREATE_IN:
    case MPI_KEYVAL_FREE_IN:
    case MPI_ABORT_IN:
    case MPI_ERROR_CLASS_IN:
    case MPI_ERRHANDLER_CREATE_IN:
    case MPI_ERRHANDLER_FREE_IN:
    case MPI_ERRHANDLER_GET_IN:
    case MPI_ERROR_STRING_IN:
    case MPI_ERRHANDLER_SET_IN:
    case MPI_GET_PROCESSOR_NAME_IN:
    case MPI_INITIALIZED_IN:
    case MPI_WTICK_IN:
    case MPI_WTIME_IN:
    case MPI_ADDRESS_IN:
    case MPI_BSEND_IN:
    case MPI_BSEND_INIT_IN:
    case MPI_BUFFER_ATTACH_IN:
    case MPI_BUFFER_DETACH_IN:
    case MPI_CANCEL_IN:
    case MPI_REQUEST_FREE_IN:
    case MPI_RECV_INIT_IN:
    case MPI_SEND_INIT_IN:
    case MPI_GET_ELEMENTS_IN:
    case MPI_GET_COUNT_IN:
    case MPI_IBSEND_IN:
    case MPI_IPROBE_IN:
    case MPI_IRSEND_IN:
    case MPI_ISSEND_IN:
    case MPI_PACK_IN:
    case MPI_PACK_SIZE_IN:
    case MPI_PROBE_IN:
    case MPI_RSEND_IN:
    case MPI_RSEND_INIT_IN:
    case MPI_SENDRECV_IN:
    case MPI_SENDRECV_REPLACE_IN:
    case MPI_SSEND_IN:
    case MPI_SSEND_INIT_IN:
    case MPI_START_IN:
    case MPI_STARTALL_IN:
    case MPI_TEST_IN:
    case MPI_TESTALL_IN:
    case MPI_TESTANY_IN:
    case MPI_TEST_CANCELLED_IN:
    case MPI_TESTSOME_IN:
    case MPI_TYPE_COMMIT_IN:
    case MPI_TYPE_CONTIGUOUS_IN:
    case MPI_TYPE_EXTENT_IN:
    case MPI_TYPE_FREE_IN:
    case MPI_TYPE_HINDEXED_IN:
    case MPI_TYPE_HVECTOR_IN:
    case MPI_TYPE_INDEXED_IN:
    case MPI_TYPE_LB_IN:
    case MPI_TYPE_SIZE_IN:
    case MPI_TYPE_STRUCT_IN:
    case MPI_TYPE_UB_IN:
    case MPI_TYPE_VECTOR_IN:
    case MPI_UNPACK_IN:
    case MPI_WAITALL_IN:
    case MPI_WAITANY_IN:
    case MPI_WAITSOME_IN:
    case MPI_CART_COORDS_IN:
    case MPI_CART_CREATE_IN:
    case MPI_CART_GET_IN:
    case MPI_CART_MAP_IN:
    case MPI_CART_SHIFT_IN:
    case MPI_CARTDIM_GET_IN:
    case MPI_DIMS_CREATE_IN:
    case MPI_GRAPH_CREATE_IN:
    case MPI_GRAPH_GET_IN:
    case MPI_GRAPH_MAP_IN:
    case MPI_GRAPH_NEIGHBORS_IN:
    case MPI_GRAPH_NEIGHBORS_COUNT_IN:
    case MPI_GRAPHDIMS_GET_IN:
    case MPI_TOPO_TEST_IN:
    case MPI_RECV_IDLE_IN:
    case MPI_CART_RANK_IN:
    case MPI_CART_SUB_IN:
    case MPI_FINALIZE_IN:
      if (!arguments.no_states){
        char value[AKY_DEFAULT_STR_SIZE];
        snprintf(value, AKY_DEFAULT_STR_SIZE, "%s", name_get(event.type));
        if (event.ct.n_uint64 == 1){
          /* has message mark */
          int mark = event.v_uint64[0];
          poti_PushStateMark(timestamp, mpi_process, "STATE", value, mark);
        }else{
          poti_PushState(timestamp, mpi_process, "STATE", value);
        }
      }
      break;
    case MPI_COMM_SPAWN_OUT:
    case MPI_COMM_GET_NAME_OUT:
    case MPI_COMM_SET_NAME_OUT:
    case MPI_REDUCE_OUT:
    case MPI_ALLREDUCE_OUT:
    case MPI_REDUCE_SCATTER_OUT:
    case MPI_ALLGATHER_OUT:
    case MPI_ALLGATHERV_OUT:
    case MPI_SCATTER_OUT:
    case MPI_SCATTERV_OUT:
    case MPI_WAIT_OUT:
    case MPI_IRECV_OUT:
    case MPI_ISEND_OUT:
    case MPI_RECV_OUT:
    case MPI_SEND_OUT:
    case MPI_BCAST_OUT:
    case MPI_BARRIER_OUT:
    case MPI_GATHER_OUT:
    case MPI_GATHERV_OUT:
    case MPI_ALLTOALL_OUT:
    case MPI_ALLTOALLV_OUT:
    case MPI_OP_CREATE_OUT:
    case MPI_OP_FREE_OUT:
    case MPI_SCAN_OUT:
    case MPI_ATTR_DELETE_OUT:
    case MPI_ATTR_GET_OUT:
    case MPI_ATTR_PUT_OUT:
    case MPI_COMM_COMPARE_OUT:
    case MPI_COMM_CREATE_OUT:
    case MPI_COMM_DUP_OUT:
    case MPI_COMM_FREE_OUT:
    case MPI_COMM_GROUP_OUT:
    case MPI_COMM_RANK_OUT:
    case MPI_COMM_REMOTE_GROUP_OUT:
    case MPI_COMM_REMOTE_SIZE_OUT:
    case MPI_COMM_SIZE_OUT:
    case MPI_COMM_SPLIT_OUT:
    case MPI_COMM_TEST_INTER_OUT:
    case MPI_GROUP_COMPARE_OUT:
    case MPI_GROUP_DIFFERENCE_OUT:
    case MPI_GROUP_EXCL_OUT:
    case MPI_GROUP_FREE_OUT:
    case MPI_GROUP_INCL_OUT:
    case MPI_GROUP_INTERSECTION_OUT:
    case MPI_GROUP_RANK_OUT:
    case MPI_GROUP_RANGE_EXCL_OUT:
    case MPI_GROUP_RANGE_INCL_OUT:
    case MPI_GROUP_SIZE_OUT:
    case MPI_GROUP_TRANSLATE_RANKS_OUT:
    case MPI_GROUP_UNION_OUT:
    case MPI_INTERCOMM_CREATE_OUT:
    case MPI_INTERCOMM_MERGE_OUT:
    case MPI_KEYVAL_CREATE_OUT:
    case MPI_KEYVAL_FREE_OUT:
    case MPI_ABORT_OUT:
    case MPI_ERROR_CLASS_OUT:
    case MPI_ERRHANDLER_CREATE_OUT:
    case MPI_ERRHANDLER_FREE_OUT:
    case MPI_ERRHANDLER_GET_OUT:
    case MPI_ERROR_STRING_OUT:
    case MPI_ERRHANDLER_SET_OUT:
    case MPI_GET_PROCESSOR_NAME_OUT:
    case MPI_INITIALIZED_OUT:
    case MPI_WTICK_OUT:
    case MPI_WTIME_OUT:
    case MPI_ADDRESS_OUT:
    case MPI_BSEND_OUT:
    case MPI_BSEND_INIT_OUT:
    case MPI_BUFFER_ATTACH_OUT:
    case MPI_BUFFER_DETACH_OUT:
    case MPI_CANCEL_OUT:
    case MPI_REQUEST_FREE_OUT:
    case MPI_RECV_INIT_OUT:
    case MPI_SEND_INIT_OUT:
    case MPI_GET_ELEMENTS_OUT:
    case MPI_GET_COUNT_OUT:
    case MPI_IBSEND_OUT:
    case MPI_IPROBE_OUT:
    case MPI_IRSEND_OUT:
    case MPI_ISSEND_OUT:
    case MPI_PACK_OUT:
    case MPI_PACK_SIZE_OUT:
    case MPI_PROBE_OUT:
    case MPI_RSEND_OUT:
    case MPI_RSEND_INIT_OUT:
    case MPI_SENDRECV_OUT:
    case MPI_SENDRECV_REPLACE_OUT:
    case MPI_SSEND_OUT:
    case MPI_SSEND_INIT_OUT:
    case MPI_START_OUT:
    case MPI_STARTALL_OUT:
    case MPI_TEST_OUT:
    case MPI_TESTALL_OUT:
    case MPI_TESTANY_OUT:
    case MPI_TEST_CANCELLED_OUT:
    case MPI_TESTSOME_OUT:
    case MPI_TYPE_COMMIT_OUT:
    case MPI_TYPE_CONTIGUOUS_OUT:
    case MPI_TYPE_EXTENT_OUT:
    case MPI_TYPE_FREE_OUT:
    case MPI_TYPE_HINDEXED_OUT:
    case MPI_TYPE_HVECTOR_OUT:
    case MPI_TYPE_INDEXED_OUT:
    case MPI_TYPE_LB_OUT:
    case MPI_TYPE_SIZE_OUT:
    case MPI_TYPE_STRUCT_OUT:
    case MPI_TYPE_UB_OUT:
    case MPI_TYPE_VECTOR_OUT:
    case MPI_UNPACK_OUT:
    case MPI_WAITALL_OUT:
    case MPI_WAITANY_OUT:
    case MPI_WAITSOME_OUT:
    case MPI_CART_COORDS_OUT:
    case MPI_CART_CREATE_OUT:
    case MPI_CART_GET_OUT:
    case MPI_CART_MAP_OUT:
    case MPI_CART_SHIFT_OUT:
    case MPI_CARTDIM_GET_OUT:
    case MPI_DIMS_CREATE_OUT:
    case MPI_GRAPH_CREATE_OUT:
    case MPI_GRAPH_GET_OUT:
    case MPI_GRAPH_MAP_OUT:
    case MPI_GRAPH_NEIGHBORS_OUT:
    case MPI_GRAPH_NEIGHBORS_COUNT_OUT:
    case MPI_GRAPHDIMS_GET_OUT:
    case MPI_TOPO_TEST_OUT:
    case MPI_RECV_IDLE_OUT:
    case MPI_CART_RANK_OUT:
    case MPI_CART_SUB_OUT:
      if (!arguments.no_states){
        poti_PopState(timestamp, mpi_process, "STATE");
      }
      break;
    case MPI_FINALIZE_OUT:
      if (!arguments.no_states){
        poti_PopState(timestamp, mpi_process, "STATE");
      }
      poti_DestroyContainer(timestamp, "PROCESS", mpi_process);
      break;
    }
  }
  if (timestamp >= 0){
    poti_DestroyContainer(timestamp, "ROOT", "root");
  }

  rst_close (&rastro);
  aky_key_free();
  return 0;
}