Personal tools
You are here: Home Forum Use killSalomeWithPort.py

killSalomeWithPort.py

Up to Use

killSalomeWithPort.py

Posted by Chaz at December 10. 2012

Hello,

I would like to kill a specific session of Salome that was launched without the gui.  I see the script killSalomeWithPort.py.  However, I would like to have several sessions of salome running, and kill a specific one.  This would require me to launch Salome with a specific port, so that I can kill it specifically later, I think.

Is there the ability to launch salome to run on a specific port, so that I can kill it later, without killing other sessions that are running?

I am trying to run an geometric optimization routine, and trying to run multiple sessions to speed things up.

 

Thanks

 

Re: killSalomeWithPort.py

Posted by Saint Michael at December 11. 2012

Hello Chaz

I launch "runSalome --help" and see several options relating to ports. I haven't checked yet but

"--ns-port-log=<ns_port_log_file> Print Naming Service Port into a user file." option seems suitable for your issue. I think with use of this option you can learn on what port a SALOME session of interest is running and thus to kill it as you need.

St.Michael

Re: killSalomeWithPort.py

Posted by Chaz at December 13. 2012

This works very well. Thanks!

The command seems to require the absolute directory, and will not work with just a file name.  This works:

currentDirectory=os.getcwd() # get the string to the current directory
os.system('/home/username/salome/appli_V6_4_0/./runAppli -t --ns-port-log='+currentDirectory+'/salomePort.txt -u buildSalomeGeometry.py')  # launch salome

the port is written to the file in the current directory salomePort.txt.  If the script is run again in the same directory with a salome session already open, the file will be overwritten, not appended.  Therefore, multiple concurrent salome sessions need to be written with multiple kill filenames, or with the files stored in different directories.

Later, to kill the specific salome session, read the port number to portToKill and:

os.system('/home/username/salome/appli_V6_4_0/bin/salome/./killSalomeWithPort.py '+portToKill)  # kill selectively by port

 

Re: killSalomeWithPort.py

Posted by Chaz at December 20. 2012

Hello,

While attempting to run several automated salome / openfoam simulations where salome is killed by the port number, Salome is crashing.

 

I get errors such as:

*** Abort *** an exception was raised, but no catch was found.
*** Abort *** an exception was raised, but no catch was found.
*** Abort *** an exception was raised, but no catch was found.
*** Abort *** an exception was raised, but no catch was found.
*** glibc detected *** SALOME_Container: double free or corruption (!prev): 0x0000000000ffc040 ***
*** glibc detected *** SALOME_Container: malloc(): memory corruption: 0x00007f5ae4000087 ***

This seems to only happen when more than one simulation is running.  It does not occur as soon as the second simulation runs.  It crashes some time into the simulation after salome has opened and closed many times. Any thoughts as to what this error is?

Thanks

Re: killSalomeWithPort.py

Posted by Achraf Soussi at December 26. 2012

Hi Chaz,

I'm also working in some optimisation problems and I have some issue with these ports and their avaibility.
the solution that I found in this forum is to add this command at the end of my python script and normally it should works with parallel sessions:

import os
from killSalomeWithPort import killMyPort
killMyPort(os.getenv('NSPORT'))

Best regard
Achraf Soussi

Re: killSalomeWithPort.py

Posted by Chaz at January 07. 2013

Thank you, that looks like a more elegant way of killing salome sessions.  I will try it.

Powered by Ploneboard
Document Actions