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

Remove useless code from updateTag function #100

Merged
merged 5 commits into from
Dec 8, 2023

Conversation

Algiane
Copy link
Member

@Algiane Algiane commented Dec 4, 2023

Remove useless code in PMMG_updateTag function

In this function :

  • edges (required by the user or not) are first added to the hash table without any tag;
  • then we process boundary edges and add the MG_BDY tag;
  • Thus, the first time that we call hGet, we found gettag==MG_BDY and the testing that gettag is not MG_REQ always answer;
  • in consequence, we add the MG_REQ + MG_NOSURF tag to edges that are not required by the user AND to edges that are required by the user and the part of code related to nosurf command line option is useless.

Test case

The removed lines can be tested on the cube-edgReq.mesh.tgz (the file has first to be uncompressed):

  • the edge 7-12 is required by the user
  • we can run sequentially ParMmg on this mesh inside a debugger (./bin/parmmg_debug cube-edgReq.mesh -nosurf -v 10 command line);
  • the parmesh (1 group, 24 elements) is splitted into 2 groups at the end of the first iteration of adaptation and at the beginning of the load balancing step. Groups are then merged by the PMMG_merge_grps2send function and the PMMG_updateTag function is called to update parallel tags (see bt.txt).
  • we can use a breakpoint to inspect the tags stored by the hash table (see attached log.txt)

When a required edge is added to the hash table, it is added without any tag, then we add the MG_BDY tag so the first time that we call hGet, we found gettag==MG_BDY and the test gettag is not MG_REQ answers always. In consequence, we add the MG_REQ + MG_NOSURF tag  to all the edges (even the user required once).

Note that user required edges are nevertheless preserved because during the step 4 we check the tag that is stored in each xtetra (and user's required tags have been preserved) and we remove the spurious NOSURF tag from the tag that is founded in the hash table.
@Algiane Algiane added kind: cleanup should be clean part: parmmg specific to parmmg code part labels Dec 4, 2023
@Algiane Algiane self-assigned this Dec 4, 2023
@Algiane Algiane merged commit 91ac166 into develop Dec 8, 2023
36 of 38 checks passed
@Algiane Algiane deleted the feature/PMMG_updateTag-review branch December 8, 2023 09:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: cleanup should be clean part: parmmg specific to parmmg code part
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant