Skip to content

Make line parsing more robust #1

@ashton314

Description

@ashton314

With FloatTracker we're seeing some funky behavior from CSTG, and I think it's because of a strangely-formatted line. Most of these lines are just how Julia decides to stringify stack frames, so while we could make FloatTracker print prettier frames, I think it might be good to make CSTG a little more flexible/robust in the format it accepts.

Example line that's proving a problem:

(::ShallowWaters.var"#run_model##kw")(::NamedTuple{(:T, :nx, :L_ratio, :bc, :wind_forcing_x, :topography, :cfl, :Ndays), Tuple{DataType, Int64, Int64, String, String, String, Int64, Int64}}, ::typeof(run_model)) at run_model.jl:12

I think the code we'll want to look at is here in tracerSum.cpp:

	// read input
	double startTime = 0;
	getline(inFile, line);
	sscanf(line.c_str(), "%s %lf", tmp, &startTime);
	splitToken = tmp;
	while (getline(inFile, line)){
		sscanf(line.c_str(), "%s", tmp);
		if (tmp == splitToken){
			processStack(startTime);
			sscanf(line.c_str(), "%s %lf", tmp, &startTime);
			continue;
		}
		queue.push_back(line);
	}
	processStack(startTime);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions