UG4 / ugcore

The core functionality of UG4. Includes sources, build-scripts, and utility scripts.
https://github.com/UG4/ugcore
Other
36 stars 23 forks source link

How to enable multiple processors? #15

Closed yxinli92 closed 5 years ago

yxinli92 commented 5 years ago

I am new to ug4 and I am running a ug4 script. It is coded for multiple processes, distributed matrices and vectors, but when I run it, it only uses a single processor. I think there should be a quick configuration to enable multiple processes? Thanks a lot!

image

yxinli92 commented 5 years ago

The script is located in your plugin repository apps/calciumDynamics_app/wave/wave_creation_noLimex.lua

sreiter commented 5 years ago

Hello,

please have a look at http://ug4.github.io/docs/page_u_g4_parallel_usage.html for information on how to run parallel jobs. Please make sure that ug was compiled with the cmake flag -DPARALLEL=ON (check it, e.g., by executing 'cmake .' in your build directory). This requires an installation of MPI (e.g. OpenMPI) on your computer.

Kind regards, Sebastian

Am 24.09.2018 um 04:10 schrieb yxinli92:

The script is located in your plugin repository apps/calciumDynamics_app/wave/wave_creation_noLimex.lua

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/UG4/ugcore/issues/15#issuecomment-423865474, or mute the thread https://github.com/notifications/unsubscribe-auth/AFYvWDFhK5ZGif9woJ1-s2YppfcMSt5wks5ueD8MgaJpZM4W1_JU.

yxinli92 commented 5 years ago

Many thanks, Sebastian. Yes my cmake command was not including the DPARALLEL flag. I happen to notice in my cmake command there is a -DCPU="1" config, do you know what is that for? Compile ug4 for a particular number of processes? Do I need to change it to -DCPU="4" for example (my computer has 4 cores)?

Thanks again!

sreiter commented 5 years ago

The CPU flag is not related to parallelization. The name is a bit misleading, unfortunately (it determines the available block sizes for the matrix class). Normally -DCPU=1 is fine, unless your specific simulation setup requires anything else. You would receive an  error message during execution of the simulation script in that case.

So - regarding compilation flags it is sufficient to set -DPARALLEL=ON for parallel compilation of UG4. The number of cores used is then determined by the -n parameter to mpirun or by similar parameters to the scheduler you may be using. This is explained in more detail in the resources linked in my last message.

Kind regards, Sebastian

Am 24.09.2018 um 15:47 schrieb yxinli92:

Many thanks, Sebastian. Yes my cmake command was not including the DPARALLEL flag. I happen to notice in my cmake command there is a |-DCPU="1"| config, do you know what is that for? Compile ug4 for a particular number of processes? Do I need to change it to |-DCPU="4"| for example (my computer has 4 cores)?

Thanks again!

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/UG4/ugcore/issues/15#issuecomment-423980515, or mute the thread https://github.com/notifications/unsubscribe-auth/AFYvWIIUCjFLvnSm7l3qBMdGzsEIK3KCks5ueOKIgaJpZM4W1_JU.

yxinli92 commented 5 years ago

Thanks again, that solves my problem!