Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 27 additions & 14 deletions src/libpaje/PajeEventDecoder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -44,19 +44,21 @@ char *PajeEventDecoder::break_line (char *s, paje_line *line)
line->lineNumber = currentLineNumber;

for (p = s; *p != '\0'; p++) {
if (*p == '\n') {

if (*p == '\n') { // If new line, remove the \n and stops
*p = '\0';
p++;
break;
}

if (in_string) {
if (*p == '"') {
*p = '\0';
if (*p == '"') { // if already in string and found a ", mark that is out of the string
in_string = false;
}
continue;
}
if (*p == '#') {

if (*p == '#') { // Comment
*p = '\0';
while (true) {
p++;
Expand All @@ -69,28 +71,39 @@ char *PajeEventDecoder::break_line (char *s, paje_line *line)
}
break;
}

if (in_word && isspace(*p)) {
*p = '\0';
in_word = false;
continue;
}
if (!in_word && !isspace(*p)) {
if (*p == '"') {

if (!in_string && isspace(*p)) {
*p = '\0';
if(in_word){
in_word = false;
}
continue;
}


if (!in_word && !isspace(*p)) { // if not in a word and p is not a space, then
if (*p == '"') { // the " marks the start of a string around quotes
in_string = true;
} else {
in_word = true;
in_word = true; // else is just a word, not a full string
}
if (line->word_count < PAJE_MAX_FIELDS) {
if(in_string){
line->word[line->word_count] = p+1; //ignore "
}else{
line->word[line->word_count] = p;
}

if (line->word_count < PAJE_MAX_FIELDS) { // if the word account of the line is less then the PAJE_MAX_FIELDS
line->word[line->word_count] = p; // save the current argument as the word
line->word_count ++;
}

continue;
}

}

return p;
}

Expand Down Expand Up @@ -180,7 +193,7 @@ void PajeEventDecoder::scanDefinitionLine (paje_line *line)
eventBeingDefined->addField (f, t, line->lineNumber);
}


}
break;
default:
Expand Down
386 changes: 193 additions & 193 deletions tests/pj_dump_categories.tesh

Large diffs are not rendered by default.

37,846 changes: 18,923 additions & 18,923 deletions tests/pj_dump_g5k.tesh

Large diffs are not rendered by default.

832 changes: 416 additions & 416 deletions tests/pj_dump_ms.tesh

Large diffs are not rendered by default.

22 changes: 11 additions & 11 deletions tests/pj_dump_shurakai.tesh
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

$ ./pj_dump ../traces/replay_output_shurakai_extract.trace
> Container, 0, 0, 0, 29.5381, 29.5381, 0
> Container, 0, MPI, 0, 29.5381, 29.5381, rank-0
> State, rank-0, MPI_STATE, 29.537220, 29.537220, 0.000000, 0.000000, action_Irecv
> State, rank-0, MPI_STATE, 29.537225, 29.537242, 0.000017, 0.000000, action_wait
> State, rank-0, MPI_STATE, 29.537254, 29.537274, 0.000020, 0.000000, action_allReduce
> State, rank-0, MPI_STATE, 29.537539, 29.537539, 0.000000, 0.000000, action_Irecv
> State, rank-0, MPI_STATE, 29.537544, 29.537544, 0.000000, 0.000000, action_wait
> State, rank-0, MPI_STATE, 29.537559, 29.537575, 0.000016, 0.000000, action_allReduce
> State, rank-0, MPI_STATE, 29.537827, 29.537827, 0.000000, 0.000000, action_Irecv
> State, rank-0, MPI_STATE, 29.537832, 29.537882, 0.000050, 0.000000, action_wait
> State, rank-0, MPI_STATE, 29.537900, 29.537916, 0.000016, 0.000000, action_allReduce
> State, rank-0, MPI_STATE, 29.538086, 29.538086, 0.000000, 0.000000, smpi_replay_run_finalize
> Container, 0, MPI, 0, 29.5381, 29.5381, "rank-0"
> State, "rank-0", MPI_STATE, 29.537220, 29.537220, 0.000000, 0.000000, action_Irecv
> State, "rank-0", MPI_STATE, 29.537225, 29.537242, 0.000017, 0.000000, action_wait
> State, "rank-0", MPI_STATE, 29.537254, 29.537274, 0.000020, 0.000000, action_allReduce
> State, "rank-0", MPI_STATE, 29.537539, 29.537539, 0.000000, 0.000000, action_Irecv
> State, "rank-0", MPI_STATE, 29.537544, 29.537544, 0.000000, 0.000000, action_wait
> State, "rank-0", MPI_STATE, 29.537559, 29.537575, 0.000016, 0.000000, action_allReduce
> State, "rank-0", MPI_STATE, 29.537827, 29.537827, 0.000000, 0.000000, action_Irecv
> State, "rank-0", MPI_STATE, 29.537832, 29.537882, 0.000050, 0.000000, action_wait
> State, "rank-0", MPI_STATE, 29.537900, 29.537916, 0.000016, 0.000000, action_allReduce
> State, "rank-0", MPI_STATE, 29.538086, 29.538086, 0.000000, 0.000000, smpi_replay_run_finalize
Loading