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

Update Makefile for parallel CalculiX simulation #34

Closed
wants to merge 1 commit into from

Conversation

uekerman
Copy link
Member

@uekerman uekerman commented Mar 11, 2020

Modification of the Makefile of Calculix to make parallel runs possible with preCICE.
Contributed by @FabienSalmon.
How can we best integrate this?

Modification of the Makefile to make possible the parallelization of Calculix with preCICE
@uekerman uekerman changed the title Update Makefile Update Makefile for parallel CalculiX simulation Mar 11, 2020
@3rav
Copy link

3rav commented Jan 8, 2021

I suggest to be more interested in the version based on PaStiX solver (https://gitlab.inria.fr/solverstack/pastix), the difference in performance is significant.

@MakisH
Copy link
Member

MakisH commented Nov 10, 2021

@FabienSalmon Do I understand correctly that this change adds a feature of SPOOLES, which we should always want to use? Is there any situation in which this could cause any issues?

If this is something we can take as-is, then let's just merge it.

@boris-martin
Copy link
Collaborator

boris-martin commented Feb 8, 2022

I checked documentation (http://www.dhondt.de/ccx_2.16.pdf, page 12) and, to avoid confusion: this change impacts the use of parallelism within Spooles: multi-threading for CalculiX' own code is enabled without USE_MT flag (I think -fopenmp is sufficient).

I managed to compile and link without the additional linking file. I just had the default makefile from master branch (which just links -lspooles), with the Ubuntu (Mint actually) version of Spooles and it worked (the solver prints "Using X cpus for spooles" and I got a moderate speedup)

Note for configuration:
In the tutorial for partitioned beam, we have the following lines in the run script:

export OMP_NUM_THREADS=1
export CCX_NPROC_EQUATION_SOLVER=1

It is sufficient to define only OMP_NUM_THREADS to get the parrallelization, but the second flag takes precedence. So I ran with (2,1) and got no parallelism before realizing I had to ue (2,2) or just OMP_NUM_THREADS=2 without the second line.

Short version:

  • I'd add the -DUSE_MT flag on the makefile by default (maybe not on this PR since makefiles get changed a lot in the 4-5 PRs we're handling right now) and discard the other change.
  • We should indicate somewhere on the website that we recommend using an appropriate value of OMP_NUM_THREADS (and/or other flags) to get parallelization on a shared memory machine.
  • To clear some potential confusion: there is no support for distributed memory (MPI etc) parallelization within CalculiX, with or without this PR.

@boris-martin boris-martin mentioned this pull request Feb 8, 2022
3 tasks
@MakisH
Copy link
Member

MakisH commented Feb 8, 2022

Thanks a lot for figuring this out! Maybe open an issue in the website to document this later (if not directly tomorrow).

@MakisH
Copy link
Member

MakisH commented Feb 8, 2022

@boris-martin will document directly on the website. We can close this now.

@MakisH MakisH closed this Feb 8, 2022
@MakisH MakisH mentioned this pull request Feb 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants