Hello everyone, I’m Ashraf Mohamed, a software engineering student from Egypt. I came across preCICE while browsing GSoC projects and the C++ config tasks immediately caught my eye. I’ve done competitive programming for years (Codeforces: Ashraf_AboBakr), so c++ is comfortable for me. Outside CP I focus on backend work with Node.js, and I’m comfortable with Git/GitHub workflows (branching, PRs, rebasing).
For GSoC, I’m mainly looking to learn from mentors while working on a real, active codebase. Right now I’m building the project from source and going through the entry test to see which of the two C++ projects suits me better.
I’m fully available this summer except possibly one week in August for a national contest (not confirmed). Excited to join the discussions and see where I can contribute.
I have finished going through the entry test and wanted to share what i found.
I have built precice from source on Arch Linux ( v3.3.1 ) on debug mode, ran the elastic-tube-1d tutorial from the tutorials repo, both fluid and solid python participants ran fine. Then commented out <data:scalar name="Pressure" /> in the elastic-tube-1d/precice-config.xml and got this error:
Then I seacrhed for why there’s no line info. I founded that precice uses libxml2’s SAX2 parser in ConfigParser.cpp, and found that the OnStartElementNs callback receives a ctx pointer which is actually a xmlParserCtxtPtr that means that the line numbers are already available in ctxt->input->line. But the code casts ctx directly to ConfigParser* and the line info is just thrown away right there.
So the data is available, it’s just never captured or stored anywhere in XMLTag or CTag.
I’m thinking the fix path goes something like:
1 - capture the line number in OnStartElementNs
2 - store it in CTag
3 - propagate to XMLTag
4 - and finally attach it to PRECICE_CHECK calls.
Happy to hear if I’m missing something or thinking about this wrong.
Still deciding between this project and the AST one, i feel like they are related honestly.
then accessed _ctxt->input->line inside OnStartElementNs. Rebuilt and tested with the broken config and got this:
TAG: use-data at line 13
TAG: use-data at line 14
...
ERROR: Data with name "Pressure" used by mesh "Fluid-Nodes-Mesh" is not defined.
Line 14 is exactly <use-data name="Pressure" /> — the tag causing the error. The line number is already available, it’s just never attached to the error message. So the proof of concept works.
i have completed the entry test and went beyond it and built a proof of concept. i would like to submit a PR to show my technical work but i see contributions are currently closed for collaborators. Is there any way to get access to submit something before the proposal deadline? @Makis@fsimonis