Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make line parsing more robust #1

Open
ashton314 opened this issue May 22, 2023 · 0 comments
Open

Make line parsing more robust #1

ashton314 opened this issue May 22, 2023 · 0 comments

Comments

@ashton314
Copy link
Member

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);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant