From 0b3cd4d07ad34648bb46054f73c5e66988e53d5e Mon Sep 17 00:00:00 2001 From: rahuel Date: Wed, 14 Jun 2006 15:56:20 +0000 Subject: [PATCH] --terminal option for CCRT --- bin/launchConfigureParser.py | 7 +++- bin/runSalome.py | 54 +++++++++++++++++++++---------- doc/README.cluster-CCRT | 63 ++++++++++++++++++++++++++++++++++++ 3 files changed, 106 insertions(+), 18 deletions(-) create mode 100644 doc/README.cluster-CCRT diff --git a/bin/launchConfigureParser.py b/bin/launchConfigureParser.py index ca821fab9..3903af6e5 100755 --- a/bin/launchConfigureParser.py +++ b/bin/launchConfigureParser.py @@ -350,6 +350,8 @@ if cmd_opts.has_key("h"): --help or -h : print this help --gui or -g : launching with GUI --terminal -t : launching without gui (to deny --gui) + or -t=PythonScript[,...[,killall]] + : import of PythonScript(s) --logger or -l : redirect messages in a CORBA collector --file=filename or -f=filename: redirect messages in a log file --xterm or -x : execute servers in xterm console (messages appear in xterm windows) @@ -416,7 +418,10 @@ if not cmd_opts.has_key( "m" ) and os.getenv( "SALOME_MODULES" ): # 'terminal' must be processed in the end: to deny any 'gui' options if 't' in cmd_opts: - args[gui_nam] = 0 + #CCRTargs[gui_nam] = 0 + args[gui_nam] = cmd_opts['t'] + if args[gui_nam] == 0 : + args[gui_nam] = 0 pass # now modify SalomeAppConfig environment variable diff --git a/bin/runSalome.py b/bin/runSalome.py index 7bc9a4c07..143bdccaa 100755 --- a/bin/runSalome.py +++ b/bin/runSalome.py @@ -57,7 +57,7 @@ def get_config(): if args.has_key("modules"): modules_list += args["modules"] # KERNEL must be last in the list to locate it at the first place in PATH - if args["gui"] : + if args['gui'] == 1 : modules_list[:0] = ["GUI"] modules_list[:0] = ["KERNEL"] modules_list.reverse() @@ -104,14 +104,22 @@ def set_env(args, modules_list, modules_root_dir): python_version="python%d.%d" % sys.version_info[0:2] modules_root_dir_list = [] - if args["gui"] : + if args['gui'] == 1 : modules_list = modules_list[:] + ["GUI"] - modules_list = modules_list[:] + ["KERNEL"] + modules_list = modules_list[:] + ["KERNEL"] + resuname = os.uname() + if resuname[4] == "x86_64" : + LIB_LOCATION_SUFFIX = "64" + else : + LIB_LOCATION_SUFFIX = "" + salome_libname = "lib" + LIB_LOCATION_SUFFIX for module in modules_list : if modules_root_dir.has_key(module): module_root_dir = modules_root_dir[module] modules_root_dir_list[:0] = [module_root_dir] - add_path(os.path.join(module_root_dir,"lib",salome_subdir), + #add_path(os.path.join(module_root_dir,"lib",salome_subdir), + # "LD_LIBRARY_PATH") + add_path(os.path.join(module_root_dir,salome_libname,salome_subdir), "LD_LIBRARY_PATH") add_path(os.path.join(module_root_dir,"bin",salome_subdir), "PATH") @@ -326,7 +334,7 @@ class CatalogServer(Server): cata_path=[] list_modules = modules_list[:] list_modules.reverse() - if self.args["gui"] : + if self.args['gui'] == 1 : list_modules = ["KERNEL", "GUI"] + list_modules else : list_modules = ["KERNEL"] + list_modules @@ -424,9 +432,9 @@ class SessionServer(Server): self.SCMD2+=['PY'] if 'supervContainer' in self.args['containers'] or 'supervContainer' in self.args['standalone']: self.SCMD2+=['SUPERV'] - if self.args['gui']: + if self.args['gui'] == 1 : self.SCMD2+=['GUI'] - if self.args['splash'] and self.args['gui']: + if self.args['splash'] and self.args['gui'] == 1 : self.SCMD2+=['SPLASH'] if self.args['noexcepthandler']: self.SCMD2+=['noexcepthandler'] @@ -440,7 +448,7 @@ class SessionServer(Server): cata_path=[] list_modules = modules_list[:] list_modules.reverse() - if self.args["gui"] : + if self.args['gui'] == 1 : list_modules = ["KERNEL", "GUI"] + list_modules else : list_modules = ["KERNEL"] + list_modules @@ -452,7 +460,7 @@ class SessionServer(Server): glob.glob(os.path.join(module_root_dir,"share", salome_subdir,"resources", module_cata))) - if (self.args["gui"]) & ('moduleCatalog' in self.args['embedded']): + if (self.args['gui'] == 1) & ('moduleCatalog' in self.args['embedded']): self.CMD=self.SCMD1 + [string.join(cata_path,':')] + self.SCMD2 else: self.CMD=self.SCMD1 + self.SCMD2 @@ -465,7 +473,7 @@ class ContainerManagerServer(Server): self.initArgs() self.SCMD1=['SALOME_ContainerManagerServer'] self.SCMD2=[] - if args["gui"] : + if args['gui'] == 1 : if 'registry' in self.args['embedded']: self.SCMD1+=['--with','Registry', '(','--salome_session','theSession',')'] @@ -482,7 +490,7 @@ class ContainerManagerServer(Server): cata_path=[] list_modules = modules_list[:] list_modules.reverse() - if self.args["gui"] : + if self.args['gui'] == 1 : list_modules = ["GUI"] + list_modules for module in ["KERNEL"] + list_modules: if modules_root_dir.has_key(module): @@ -495,7 +503,7 @@ class ContainerManagerServer(Server): module_cata))) pass pass - if (self.args["gui"]) & ('moduleCatalog' in self.args['embedded']): + if (self.args['gui'] == 1) & ('moduleCatalog' in self.args['embedded']): self.CMD=self.SCMD1 + [string.join(cata_path,':')] + self.SCMD2 else: self.CMD=self.SCMD1 + self.SCMD2 @@ -564,7 +572,7 @@ def startSalome(args, modules_list, modules_root_dir): # Lancement Session Server (to show splash ASAP) # - if args["gui"]: + if args['gui'] == 1 : mySessionServ = SessionServer(args) mySessionServ.setpath(modules_list,modules_root_dir) mySessionServ.run() @@ -574,7 +582,7 @@ def startSalome(args, modules_list, modules_root_dir): # attente de la disponibilite du Registry dans le Naming Service # - if ('registry' not in args['embedded']) | (args["gui"] == 0) : + if ('registry' not in args['embedded']) | (args['gui'] != 1) : myServer=RegistryServer(args) myServer.run() clt.waitNSPID("/Registry",myServer.PID) @@ -585,7 +593,7 @@ def startSalome(args, modules_list, modules_root_dir): # - if ('moduleCatalog' not in args['embedded']) | (args["gui"] == 0): + if ('moduleCatalog' not in args['embedded']) | (args['gui'] != 1): cataServer=CatalogServer(args) cataServer.setpath(modules_list,modules_root_dir) cataServer.run() @@ -598,7 +606,7 @@ def startSalome(args, modules_list, modules_root_dir): # #print "ARGS = ",args - if ('study' not in args['embedded']) | (args["gui"] == 0): + if ('study' not in args['embedded']) | (args['gui'] != 1): print "RunStudy" myServer=SalomeDSServer(args) myServer.run() @@ -659,7 +667,7 @@ def startSalome(args, modules_list, modules_root_dir): # Attente de la disponibilite du Session Server dans le Naming Service # - if args["gui"]: + if args['gui'] == 1 : ##---------------- import Engines import SALOME @@ -764,6 +772,18 @@ def useSalome(args, modules_list, modules_root_dir): print print " --- registered objects tree in Naming Service ---" clt.showNS() + + if (args['gui'] != 0) & (args['gui'] != 1) : + toimport = args['gui'] + i = 0 + while i < len( toimport ) : + if toimport[ i ] == 'killall' : + killAllPorts() + else : + print 'importing',toimport[ i ] + doimport = 'import ' + toimport[ i ] + exec doimport + i = i + 1 return clt diff --git a/doc/README.cluster-CCRT b/doc/README.cluster-CCRT new file mode 100644 index 000000000..1c93650c5 --- /dev/null +++ b/doc/README.cluster-CCRT @@ -0,0 +1,63 @@ + +OverView +======== + +That describes how to start Salome without IHM in "terminal" mode. + +With that "terminal" mode Salome may be started in "Batch" mode. + +And one or more python scripts may be executed + +Warnings +======== + +The list of needed modules must be explicited with --modules option + +It is not possible to use embbedded components, so we must use --standalone option + +After the python script(s) listed in the --terminal option, ",killall" should +be added : so the processes of Salome will be killed after the execution of +the python script(s). + + +Examples +======== + +Sans IHM sans execution de script python (for interactive testing and developping) : +--------------------------------------------- + +runSalome --terminal --modules=KERNEL,MED,CALCULATOR,COMPONENT --containers=cpp,python --standalone=registry,study,moduleCatalog,cppContainer,pyContainer --killall --logger + +Sans IHM avec execution de script(s) python : +--------------------------------------------- + +runSalome --terminal=CALCULATOR_TEST --modules=KERNEL,MED,CALCULATOR,COMPONENT --containers=cpp,python --standalone=registry,study,moduleCatalog,cppContainer,pyContainer --killall --logger + +runSalome --terminal=CALCULATOR_TEST_WITHOUTIHM --modules=KERNEL,MED,CALCULATOR,COMPONENT --containers=cpp,python --standalone=registry,study,moduleCatalog,cppContainer,pyContainer --killall --logger + +runSalome --terminal=CALCULATOR_TEST_STUDY_WITHOUTIHM --modules=KERNEL,MED,CALCULATOR,COMPONENT --containers=cpp,python --standalone=registry,study,moduleCatalog,cppContainer,pyContainer --killall --logger + +runSalome --terminal=CALCULATOR_TEST_WITHOUTIHM,CALCULATOR_TEST_STUDY_WITHOUTIHM --modules=KERNEL,MED,CALCULATOR,COMPONENT --containers=cpp,python --standalone=registry,study,moduleCatalog,cppContainer,pyContainer --killall --logger + +runSalome --terminal=CALCULATOR_TEST,killall --modules=KERNEL,MED,CALCULATOR,COMPONENT --containers=cpp,python --standalone=registry,study,moduleCatalog,cppContainer,pyContainer --killall --logger +after the import of CALCULATOR_TEST, killall will be executed. + + +=================================================== +Example for starting Salome in Batch mode on CCRT : +=================================================== + +Create a shell file "runSalome.batch" with for example : +-------------------------------------------------------- +#BSUB -n 10 +#BSUB -o runSalome.log%J +#BSUB -c 0:10 +runSalome --terminal=CALCULATOR_TEST,killall --modules=KERNEL,MED,CALCULATOR,COMPONENT --containers=cpp,python --standalone=registry,study,moduleCatalog,cppContainer,pyContainer --killall +exit + +Queue for execution that file (here runSalome.batch) : +-------------------------------------------------------------------- +bsub < runSalome.batch + +See the "bsub" documentation for details (or "man bsub") + -- 2.39.2