launch

Module: run.launch

Main program to run pySPACE

For further instructions take a look at the pySPACE documentation and the tutorials in there!

Note

Due to errors in configuration files, data or the software, the software may crash. Because of internal parallelization and threading, it is currently not possible to use ‘’ctrl + c’‘. So you should kill the processes manually e.g.:

ctrl + z
kill -9 %1
fg

Profiling

For profiling the software you should use the option --profile, when running pySPACE. Furthermore you should use the SerialBackend. Otherwise the started subprocesses can not be examined. The result is called profile.pstat and saved in your result folder. For getting a print out of this profiling, you can use gprof2dot.py in the library folder. (partial) Copy from the documentation:

General usage:

python gprof2dot.py -f pstats profiling_file -r pySPACE | dot -Tpng -o output.png

or simple usage in result folder, when pyspace is on same level as general storage folder:

python ../../../pyspace/pySPACE/tools/gprof2dot.py -f pstats profile.pstat | dot -Tpng -o output.png

where profiling_file is the file that is generated by the cProfile module and output.png is the filename of the resulting picture. The option ‘-r’, ‘–restrict’ is there to eliminate functions in the profiling, that do not contain this string in their path name [default: None].

Note

For creating the graphic, which is done with the ‘dot’ command, the GraphViz package needs to be installed.

Inheritance diagram for pySPACE.run.launch:

Inheritance diagram of pySPACE.run.launch

Class Summary

LaunchParser([usage, option_list, ...]) Overwrite epilog printout

Function Summary

run_operation(default_backend, operation[, ...]) Runs the given operation on the backend
run_operation_chain(default_backend, ...) Runs the given operation chain on the backend
main()

Class

LaunchParser

class pySPACE.run.launch.LaunchParser(usage=None, option_list=None, option_class=<class optparse.Option>, version=None, conflict_handler='error', description=None, formatter=None, add_help_option=True, prog=None, epilog=None)[source]

Bases: optparse.OptionParser

Overwrite epilog printout

Code taken from:

http://stackoverflow.com/questions/5961160/displaying-newlines-in-the-help-message-when-using-pythons-optparse

Class Components Summary

format_epilog(formatter) Simply do not change the format of the string
format_epilog(formatter)[source]

Simply do not change the format of the string

Functions

run_operation()

pySPACE.run.launch.run_operation(default_backend, operation, ex_timeout=1000000.0, re_timeout=1000000.0)[source]

Runs the given operation on the backend

Runs the given operation operation either on the backend specified in the operation’ spec file or (if none is specified) on the backend passed as default_backend.

Different timeouts are required, because for the execute function get is called which does not accept to high timeouts without proper error handling on a Mac OS X whereas Linux systems are fine with larger timeouts.

run_operation_chain()

pySPACE.run.launch.run_operation_chain(default_backend, operation_chain)[source]

Runs the given operation chain on the backend

Runs the given operation chain operation_chain on the backend passed as default_backend.

main()

pySPACE.run.launch.main()[source]