CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM (https://www.cfd-online.com/Forums/openfoam/)
-   -   Running openfoam in parallel on local processors (https://www.cfd-online.com/Forums/openfoam/204434-running-openfoam-parallel-local-processors.html)

J_here July 23, 2018 13:54

Running openfoam in parallel on local processors
 
Dear Foamers,

Last time I posted a question that I was trying to answer for hours it was solved in a matter of minutes, so fingers crossed this happens again :).

I am trying to run a simulation in parallel on local processors.

All goes well when I run decomposePar, I get 8 new processor directories (processor0 -> processor7) but when I use the command:

Code:

mpirun -np 8 buoyantBoussinesqPimpleFoam

in the case directory that I want, I get the output


Code:

mpirun has detected an attempt to run as root.
Running at root is *strongly* discouraged as any mistake (e.g., in
defining TMPDIR) or bug can result in catastrophic damage to the OS
file system, leaving your system in an unusable state.

You can override this protection by adding the --allow-run-as-root
option to your cmd line. However, we reiterate our strong advice
against doing so - please do so at your own risk.

Does anyone know why its running as a root and how to stop it if they do?

I am running openfoam on ubuntu if that makes any difference.

Many thanks in advance!
J

RobertHB July 24, 2018 04:59

Hopefully this is the anywer:
Code:

mpirun -np 8 buoyantBoussinesqPimpleFoam -parallel
/edit: No its not probably. Sorry. Never seen your problem before.

J_here July 24, 2018 05:48

Quote:

Originally Posted by RobertHB (Post 700239)
Hopefully this is the anywer:
Code:

mpirun -np 8 buoyantBoussinesqPimpleFoam -parallel
/edit: No its not probably. Sorry. Never seen your problem before.

Ooops sorry I had that -parallel before just forgot to type it in. Sadly you're right it doesn't solve the problem at hand.

Many thanks trying though!

AndreasPe July 24, 2018 07:37

Are you maybe running the command from a terminal where you are logged in as root?

J_here July 24, 2018 10:10

Quote:

Originally Posted by AndreasPe (Post 700262)
Are you maybe running the command from a terminal where you are logged in as root?


Andreas I think you are totally right! I can't use the:

Code:

./startOpenFOAM
command without running it as:

Code:

sudo ./startOpenFOAM
I'm very new to Linux but I guess this means I'm logging in as root? Do you know of anyway to run the ./startOpenFOAM command without using sudo?

Thank you,
J

AndreasPe July 24, 2018 10:38

I am not familiar with the "./startOpenFOAM" command.



Typically you just need to source the bashrc-file that is located in the etc/-directory of your OpenFOAM installation. This is done by going into the main directory of your OpenFOAM and then typing "source etc/bashrc". This should also be possible without root rights.



Did you maybe install/compile OpenFOAM as a root user and thus only the root user has access to all OpenFOAM files? Maybe check the rights of the startOpenFOAM script by typing "ls -al startOpenFOAM" and have a look who has got execution rights (just google for rights management in linux).

cyss38 July 24, 2018 11:46

it is not a problem if the openfoam installation has been done by root.

But the case that you want run must be yours and not root.
So just check the permissions and the owner of the testcase directory.

J_here July 24, 2018 14:07

Quote:

Originally Posted by AndreasPe (Post 700283)
I am not familiar with the "./startOpenFOAM" command.



Typically you just need to source the bashrc-file that is located in the etc/-directory of your OpenFOAM installation. This is done by going into the main directory of your OpenFOAM and then typing "source etc/bashrc". This should also be possible without root rights.



Did you maybe install/compile OpenFOAM as a root user and thus only the root user has access to all OpenFOAM files? Maybe check the rights of the startOpenFOAM script by typing "ls -al startOpenFOAM" and have a look who has got execution rights (just google for rights management in linux).

Thank you for all your help, I think that might be it. I checked the rights of the openfoam written files and they are all root.

Thanks again you are a life saver,
J

J_here July 24, 2018 14:08

Quote:

Originally Posted by cyss38 (Post 700292)
it is not a problem if the openfoam installation has been done by root.

But the case that you want run must be yours and not root.
So just check the permissions and the owner of the testcase directory.

Yeah it was all installed by root, thanks for the help!
J

rmaries March 10, 2019 15:47

Hi,


Did you solve this issue?


I too have similar issue.


Thanks in advance

vince_cfd September 18, 2019 07:02

OF installed via Docker
 
I have the exactly same problem.
I believe this happens, when you have installed OF via Docker. Using the "ls -al startOpenFOAM" command shows, who has the rights to the file.

This command "sudo usermod -a -G docker $USER" will add permission to your user to start and navigate Docker. Now you are able to start OpenFOAM (./startOpenFOAM), without using the sudo prefix, but the problem on using the mpirun command remains, as somehow Docker is still starting in the root mode.


Does anyone have input on how to fix this?


Edit: Couldn't resolve the problem. Went with building OpenFOAM ESI version from source.

Marina PA October 31, 2019 07:34

Hi,
I have the same problem, have anybody found a solution?
Thanks in advanced.


All times are GMT -4. The time now is 06:21.