CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM

Running openfoam in parallel on local processors

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree1Likes
  • 1 Post By J_here

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 23, 2018, 13:54
Default Running openfoam in parallel on local processors
  #1
New Member
 
Jonty Pedersen
Join Date: Jun 2018
Posts: 8
Rep Power: 7
J_here is on a distinguished road
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
rmaries likes this.
J_here is offline   Reply With Quote

Old   July 24, 2018, 04:59
Default
  #2
Senior Member
 
Robert
Join Date: May 2015
Location: Bremen, GER
Posts: 292
Rep Power: 11
RobertHB is on a distinguished road
Hopefully this is the anywer:
Code:
mpirun -np 8 buoyantBoussinesqPimpleFoam -parallel
/edit: No its not probably. Sorry. Never seen your problem before.
__________________
If you liked my answer to your question, please consider leaving a "Like" in return
RobertHB is offline   Reply With Quote

Old   July 24, 2018, 05:48
Default
  #3
New Member
 
Jonty Pedersen
Join Date: Jun 2018
Posts: 8
Rep Power: 7
J_here is on a distinguished road
Quote:
Originally Posted by RobertHB View Post
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!
J_here is offline   Reply With Quote

Old   July 24, 2018, 07:37
Default
  #4
Member
 
Andreas P.
Join Date: May 2017
Posts: 41
Rep Power: 8
AndreasPe is on a distinguished road
Are you maybe running the command from a terminal where you are logged in as root?
AndreasPe is offline   Reply With Quote

Old   July 24, 2018, 10:10
Default
  #5
New Member
 
Jonty Pedersen
Join Date: Jun 2018
Posts: 8
Rep Power: 7
J_here is on a distinguished road
Quote:
Originally Posted by AndreasPe View Post
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
J_here is offline   Reply With Quote

Old   July 24, 2018, 10:38
Default
  #6
Member
 
Andreas P.
Join Date: May 2017
Posts: 41
Rep Power: 8
AndreasPe is on a distinguished road
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).
AndreasPe is offline   Reply With Quote

Old   July 24, 2018, 11:46
Default
  #7
Member
 
cyss38's Avatar
 
Cyrille Bonamy
Join Date: Mar 2015
Location: Grenoble, France
Posts: 85
Rep Power: 11
cyss38 is on a distinguished road
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.
cyss38 is offline   Reply With Quote

Old   July 24, 2018, 14:07
Default
  #8
New Member
 
Jonty Pedersen
Join Date: Jun 2018
Posts: 8
Rep Power: 7
J_here is on a distinguished road
Quote:
Originally Posted by AndreasPe View Post
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 is offline   Reply With Quote

Old   July 24, 2018, 14:08
Default
  #9
New Member
 
Jonty Pedersen
Join Date: Jun 2018
Posts: 8
Rep Power: 7
J_here is on a distinguished road
Quote:
Originally Posted by cyss38 View Post
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
J_here is offline   Reply With Quote

Old   March 10, 2019, 15:47
Default
  #10
Member
 
Maries
Join Date: Mar 2010
Location: Cologne, Germany
Posts: 75
Rep Power: 16
rmaries is on a distinguished road
Hi,


Did you solve this issue?


I too have similar issue.


Thanks in advance
rmaries is offline   Reply With Quote

Old   September 18, 2019, 07:02
Default OF installed via Docker
  #11
New Member
 
Vincent
Join Date: Aug 2019
Location: Germany
Posts: 14
Rep Power: 6
vince_cfd is on a distinguished road
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.

Last edited by vince_cfd; September 19, 2019 at 03:55.
vince_cfd is offline   Reply With Quote

Old   October 31, 2019, 07:34
Default
  #12
New Member
 
Marina
Join Date: Sep 2019
Posts: 6
Rep Power: 6
Marina PA is on a distinguished road
Hi,
I have the same problem, have anybody found a solution?
Thanks in advanced.
Marina PA is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Map of the OpenFOAM Forum - Understanding where to post your questions! wyldckat OpenFOAM 10 September 2, 2021 05:29
pimpleDyMFoam computation randomly stops babapeti OpenFOAM Running, Solving & CFD 5 January 24, 2018 05:28
Explicitly filtered LES saeedi Main CFD Forum 16 October 14, 2015 11:58
Micro Scale Pore, icoFoam gooya_kabir OpenFOAM Running, Solving & CFD 2 November 2, 2013 13:58
Upgraded from Karmic Koala 9.10 to Lucid Lynx10.04.3 bookie56 OpenFOAM Installation 8 August 13, 2011 04:03


All times are GMT -4. The time now is 05:41.