Skip to content

Conversation

@IshaanDesai
Copy link
Member

The FEniCS-Adapter now supports parallel runs: precice/fenics-adapter#71.
Correspondingly minor modifications to FEniCS scripts and preCICE configurations for all FEniCS tutorials are necessary to enable parallel runs.

@IshaanDesai
Copy link
Member Author

For testing purposes the tutorial HT/paritioned-heat/fenics-fenics was manually copied to the adapter branch: https://github.com/precice/fenics-adapter/tree/parallelMidLevel
Now that this PR exists, the prototype within the adapter branch has been removed (precice/fenics-adapter@f541ddd) and testing is done within this PR to record the results of parallel runs of all tutorials.

@IshaanDesai
Copy link
Member Author

The tutorial HT/partitioned-heat/fenics-fenics with a coupling interface which is parallel to the Y-axis now works in parallel. The domain decomposition is as follows:
ranks_heatEx_simple

The left participant is the Dirichlet participant and the right participant is the Neumann participant.

@BenjaminRodenberg BenjaminRodenberg changed the base branch from develop to fenics-adapter-v1.0.0 December 8, 2020 15:25
@BenjaminRodenberg BenjaminRodenberg changed the base branch from fenics-adapter-v1.0.0 to develop December 8, 2020 15:26
@BenjaminRodenberg
Copy link
Member

Do we want to merge this PR first into develop or #124? @fsimonis @MakisH any opinions?

Copy link
Member

@BenjaminRodenberg BenjaminRodenberg left a comment

Choose a reason for hiding this comment

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

While reviewing precice/fenics-adapter#71 I used the content of this PR. I tried to run the CHT tutorial and ran into the following error (looking like issue with the parallelization):

benjamin@benjamin-ThinkPad-X1-Yoga-2nd:~/tutorials/CHT/flow-over-plate/buoyantPimpleFoam-fenics$ mpirun -np 2 python3 Solid/heat.py
---[precice] ERROR:  For a parallel participant, only the mapping combinations read-consistent and write-conservative are allowed
--------------------------------------------------------------------------
Primary job  terminated normally, but 1 process returned
a non-zero exit code. Per user-direction, the job has been aborted.
--------------------------------------------------------------------------
--------------------------------------------------------------------------
mpirun detected that one or more processes exited with non-zero status, thus causing
the job to be terminated. The first process to do so was:

  Process name: [[38575,1],0]
  Exit code:    255
--------------------------------------------------------------------------

For the FSI test cases I also ran into errors (looking like issues with the adapter):

benjamin@benjamin-ThinkPad-X1-Yoga-2nd:~/tutorials/FSI/flap_perp/OpenFOAM-FEniCS$ python3 Solid/perp-flap.py
---[precice]  This is preCICE version 2.1.1
---[precice]  Revision info: v2.1.1-54-g25b9f155
---[precice]  Configuring preCICE with configuration "/home/benjamin/tutorials/FSI/flap_perp/OpenFOAM-FEniCS/Solid/../precice-config.xml"
---[precice]  I am participant "fenics"
Traceback (most recent call last):
  File "Solid/perp-flap.py", line 76, in <module>
    precice_dt = precice.initialize(coupling_boundary, read_function_space=V, write_object=V,
  File "/home/benjamin/.local/lib/python3.8/site-packages/fenicsprecice/fenicsprecice.py", line 363, in initialize
    raise Exception("Dimension of preCICE setup and FEniCS do not match")
Exception: Dimension of preCICE setup and FEniCS do not match
---[precice]  Implicitly finalizing in destructor

and

benjamin@benjamin-ThinkPad-X1-Yoga-2nd:~/tutorials/FSI/cylinderFlap/OpenFOAM-FEniCS$ python3 Solid/cyl-flap.py 
---[precice]  This is preCICE version 2.1.1
---[precice]  Revision info: v2.1.1-54-g25b9f155
---[precice]  Configuring preCICE with configuration "/home/benjamin/tutorials/FSI/cylinderFlap/OpenFOAM-FEniCS/Solid/../precice-config.xml"
---[precice]  I am participant "fenics"
Traceback (most recent call last):
  File "Solid/cyl-flap.py", line 92, in <module>
    precice_dt = precice.initialize(coupling_boundary, read_function_space=V, write_object=V,
  File "/home/benjamin/.local/lib/python3.8/site-packages/fenicsprecice/fenicsprecice.py", line 363, in initialize
    raise Exception("Dimension of preCICE setup and FEniCS do not match")
Exception: Dimension of preCICE setup and FEniCS do not match
---[precice]  Implicitly finalizing in destructor

@MakisH
Copy link
Member

MakisH commented Dec 8, 2020

Do we want to merge this PR first into develop or #124? @fsimonis @MakisH any opinions?

If it should work with the develop branch of the fenics adapter, add it to the develop of the tutorials. If it depends on the v1 branch, merge it to the v1 branch. Unless I am missing something.

@IshaanDesai
Copy link
Member Author

I tried to run the CHT tutorial and ran into the following error (looking like issue with the parallelization)

This PR currently only tests the HT/paritioned-heat/fenics-fenics tutorial. For FSI, the 2D-3D coupling needs to changed to a new mechanism where the non-FEniCS participant will handle the data modification. The corresponding change in the fenics-adapter is already included in the parallel design and is being separately also handled here: precice/fenics-adapter#102

@fsimonis
Copy link
Member

fsimonis commented Dec 8, 2020

Feel free to merge this PR first.

@BenjaminRodenberg
Copy link
Member

BenjaminRodenberg commented Dec 8, 2020

I tried to run the CHT tutorial and ran into the following error (looking like issue with the parallelization)

This PR currently only tests the HT/paritioned-heat/fenics-fenics tutorial. For FSI, the 2D-3D coupling needs to changed to a new mechanism where the non-FEniCS participant will handle the data modification. The corresponding change in the fenics-adapter is already included in the parallel design and is being separately also handled here: precice/fenics-adapter#102

@IshaanDesai

@IshaanDesai
Copy link
Member Author

I tested the FSI cases from this PR (#120) with the fenics-adapter from precice/fenics-adapter#71 is this expected to fail? I understand from your comment that this should work.

All FSI cases currently are also 2D-3D and hence will not work with the current parallel design. Just changing the precice-config by setting <solver-interface dimensions="2"> instead of "3" should ideally work. I am still confirming this.

@BenjaminRodenberg
Copy link
Member

Merged #127 into this PR. Note that CHT case is still causing problems. I think that there is a bug in the configuration of the mapping. If I git checkout develop CHT/flow-over-plate/buoyantPimpleFoam-fenics/precice-config.xml and change the dimension to 2. I.e.: Correct 2D/3D, but not working with parallel runs, everything is fine.

@BenjaminRodenberg
Copy link
Member

55d7579 uses this configuration file. Results look good (for 1 and 2 ranks for Solid/heat.py). This is also a good step, if we want to make the tutorials more consistent (@uekerman).

However, I got some confusing messages from the adapter for this case, when running buoyantPimpleFoam -case Fluid/ & python3 Solid/heat.py:

---[precice]  it 1 of 200 | dt# 1 | t 0 of 1 | dt 0.01 | max dt 0.01 | ongoing yes | dt complete no | write-iteration-checkpoint | 
---[precice]  initializeData is skipped since no data has to be initialized.
output vtk for time = 0.0
Rank 0: Nothing to Receive
Rank 0: Nothing to Send
Solving linear variational problem.
Solving linear variational problem.

Nothing to Receive, Nothing to Send looks wrong to me, but the results look fine. I assume this is just a logging issue and debugging output that can be removed anyway. @IshaanDesai can you take a look at this?

Copy link
Member

@BenjaminRodenberg BenjaminRodenberg left a comment

Choose a reason for hiding this comment

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

Intermediate summary

  • HT and CHT are working nicely
  • FSI cases fail due to a deadlock in the adapter that occurs, if point sources are used. @IshaanDesai is aware of this issue and will fix it in precice/fenics-adapter#71.

@IshaanDesai
Copy link
Member Author

FSI cases with FEniCS as the structure participant do not work in parallel because fenics-2019.1.0 hangs while defining PointSources in parallel. This has been buggy in the past as said by the core developers here: https://fenicsproject.discourse.group/t/pointsource-definition-in-parallel-leads-to-deadlock/4729/3

Note: The changes to preCICE configurations for FSI cases can be retained as these configurations work in serial.

@IshaanDesai IshaanDesai marked this pull request as ready for review December 19, 2020 13:45
Copy link
Member

@BenjaminRodenberg BenjaminRodenberg left a comment

Choose a reason for hiding this comment

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

Minor comment on dead code. Rest looks good to me. I did not try running the CHT and HT case again. Do you want me to run them?

@IshaanDesai
Copy link
Member Author

Minor comment on dead code. Rest looks good to me. I did not try running the CHT and HT case again. Do you want me to run them?

Last clean-up is on-going. A last run from you will make this foolproof, so yes one run check would be good.

@IshaanDesai IshaanDesai merged commit 1c891a7 into develop Dec 19, 2020
BenjaminRodenberg added a commit that referenced this pull request Dec 19, 2020
* Modifying all FEniCS based tutorials to be compatible with parallel design of FEniCS-Adapter
Co-authored-by: BenjaminRueth <benjamin.rueth@tum.de>
BenjaminRodenberg added a commit that referenced this pull request Dec 20, 2020
* Modifying all FEniCS based tutorials to be compatible with parallel design of FEniCS-Adapter
Co-authored-by: BenjaminRueth <benjamin.rueth@tum.de>
BenjaminRodenberg added a commit that referenced this pull request Dec 20, 2020
* Modifying all FEniCS based tutorials to be compatible with parallel design of FEniCS-Adapter
Co-authored-by: BenjaminRueth <benjamin.rueth@tum.de>
@BenjaminRodenberg BenjaminRodenberg deleted the overhaulFEniCSTutorials branch December 23, 2020 11:47
BenjaminRodenberg added a commit that referenced this pull request Dec 23, 2020
* Modifying all FEniCS based tutorials to be compatible with parallel design of FEniCS-Adapter
Co-authored-by: BenjaminRueth <benjamin.rueth@tum.de>
BenjaminRodenberg added a commit that referenced this pull request Jan 8, 2021
* Modifying all FEniCS based tutorials to be compatible with parallel design of FEniCS-Adapter
Co-authored-by: BenjaminRueth <benjamin.rueth@tum.de>
BenjaminRodenberg added a commit that referenced this pull request Jan 8, 2021
* Modifying all FEniCS based tutorials to be compatible with parallel design of FEniCS-Adapter
Co-authored-by: BenjaminRueth <benjamin.rueth@tum.de>
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.

5 participants