Skip to content

[WIP] CGNS output#1131

Closed
EttoreSaetta wants to merge 15 commits intodevelopfrom
feature_CGNS_output
Closed

[WIP] CGNS output#1131
EttoreSaetta wants to merge 15 commits intodevelopfrom
feature_CGNS_output

Conversation

@EttoreSaetta
Copy link
Copy Markdown
Contributor

@EttoreSaetta EttoreSaetta commented Dec 11, 2020

Proposed Changes

Hello to everyone,
my research group and I are working on the implementation of the CGNS output format.
We think that this could be an useful feature.

For the moment, in order to provide the output file in CGNS format you should choose CGNS in the OUTPUT_FILES option.
This is a first implementation that will need some improvements.
We hope that this could be useful.

Authors: Ettore Saetta, Lorenzo Russo, Renato Tognaccini.
TAARG (Theoretical and Applied Aerodynamics Research Group), University of Naples Federico II

Related Work

PR Checklist

  • I am submitting my contribution to the develop branch.
  • My contribution generates no new compiler warnings (try with the '-Wall -Wextra -Wno-unused-parameter -Wno-empty-body' compiler flags, or simply --warnlevel=2 when using meson).
  • My contribution is commented and consistent with SU2 style.
  • I have added a test case that demonstrates my contribution, if necessary.
  • I have updated appropriate documentation (Tutorials, Docs Page, config_template.cpp) , if necessary.

@pr-triage pr-triage bot added the PR: draft label Dec 11, 2020
@MicK7
Copy link
Copy Markdown
Contributor

MicK7 commented Dec 11, 2020

Currently the CGNS library embedded with SU2 does not handle parallel writing.
How is it handled in the code ? Is one file per MPI process generated or only main process is doing the writing ?
It should be nice to have 2 classes : CCGNSMeshWriter and a CCGNSWriter (that call the other one for the mesh but focus on solution handling). My two cents.

Good idea to start a draft on this topic.

if(cgns_err) cg_error_print;
cgns_err = cg_zone_write(cgns_file1, base_number, zonename, *isize, Unstructured, &zone_number);

/*--- Write Coordinates ---*/
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of copying the mesh data it should be nice to have the possibility to create a link to the mesh file.
cg_goto(cgns_file1, base_number, "Zone_t", zone_number, "end");
std::string path = basename + "/" + zonename + "/GridCoordinates";
cg_link_write("GridCoordinates", mesh_file.c_str(), path.c_str());
...

@EttoreSaetta
Copy link
Copy Markdown
Contributor Author

EttoreSaetta commented Dec 11, 2020

Hello @MicK7, thanks for your review.

Currently the CGNS library embedded with SU2 does not handle parallel writing.
How is it handled in the code ? Is one file per MPI process generated or only main process is doing the writing ?

Yes we notice that it does not handle parallel writing, so I decided to gather the data from the processes to the master node, so that only the main process writes the solution file.

It should be nice to have 2 classes : CCGNSMeshWriter and a CCGNSWriter (that call the other one for the mesh but focus on solution handling). My two cents.

Good idea to start a draft on this topic.

Thanks for your suggestion, it would be more tidy. It is just a draft for the moment, we still have to work on it.

Thank you for all the other proposed changes also, I will work on it in the next few days.

Copy link
Copy Markdown
Member

@pcarruscag pcarruscag left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice to have this addition to the code, I don't know much about CGNS so these are maybe dumb questions:

  • Will this also work to output meshes after deformation with SU2_DEF? I am guessing not because we had that issue with where to put the FFD information.
  • Is it possible to write the file by sections? i.e. instead of gathering all the data in a single node do a number of Send/Recv to avoid running out of memory for large problems.

@pcarruscag pcarruscag changed the title Feature CGNS output CGNS output Dec 12, 2020
@EttoreSaetta
Copy link
Copy Markdown
Contributor Author

EttoreSaetta commented Dec 13, 2020

Hello @pcarruscag, thank you for your suggestions.

Nice to have this addition to the code, I don't know much about CGNS so these are maybe dumb questions:

* Will this also work to output meshes after deformation with SU2_DEF? I am guessing not because we had that issue with where to put the FFD information.

We did not think to output CGNS meshes with SU2_DEF yet. Maybe it is a development that we can consider.
For the moment, it works just to output the flow-field in CGNS format running SU2_SOL or SU2_CFD.

* Is it possible to write the file by sections? i.e. instead of gathering all the data in a single node do a number of Send/Recv to avoid running out of memory for large problems.

I was thinking about problems with the memory. Maybe one possibility is to make each process to write a CGNS file and then merge them into one file (but I have never tried it).
The CGNS library currently embedded with SU2 does not support the parallel writing.

@MicK7
Copy link
Copy Markdown
Contributor

MicK7 commented Dec 15, 2020

  • having a configuration switch to the class so that each process write its own file should work really well (already seen this stuff in other cfd packages) : it is very fast and not too memory consuming

  • To cope with high memory usage, the only other solution is to enable parallel cgns in su2. But the problem may be that it requires hdf5 parallel library. @pcarruscag do you know if it is a licence issue or just technical difficulties (hdf5 use cmake and not meson) that prevent adding hdf5 to the external libraries ?

@pcarruscag
Copy link
Copy Markdown
Member

I don't know @MicK7, but for the other cgns stuff Tim Albring created a meson.build file (and for metis, parmetis, etc.)
I asked about writing in chunks because that is what we do to output the native mesh file.
In any case we don't need to solve every possible problem right now

@pcarruscag pcarruscag changed the title CGNS output [WIP] CGNS output Feb 8, 2021
@stale
Copy link
Copy Markdown

stale bot commented Apr 18, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If this is still a relevant issue please comment on it to restart the discussion. Thank you for your contributions.

@stale stale bot added the stale label Apr 18, 2021
@stale stale bot closed this Jun 2, 2021
@baldang baldang mentioned this pull request Oct 1, 2021
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants