Intro - Ashraf Mohamed

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.

Progress update

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:

i have traced it to src/mesh/config/MeshConfiguration.cpp:116, a PRECICE_CHECK call that has no line info attached to it.

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.

waiting to hear your thoughts about my progress till now @fsimonis @uekerman, thanks!

Quick update

i have added _ctxt as a member to ConfigParser, stored the xmlParserCtxtPtr there.


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

Welcome @ashraf_mohamed,

we don’t have the capacity to review more PRs right now. We will open again the system after the proposal submission period is over.

If you are very motivated, I would still suggest that you submit a proposal and link to the respective branch.

1 Like