Usage
pycompss-cli
provides the pycompss
command line tool (compss
and dislib
are also alternatives to pycompss
).
This command line tool enables to deploy and manage multiple COMPSs infrastructures
from a single place and for 3 different types of environments (docker
, local
and remote
)
The supported flags are:
$ pycompss
PyCOMPSs|COMPSS CLI:
Usage: pycompss COMMAND | compss COMMAND | dislib COMMAND
Available commands:
init -n [NAME]: initialize COMPSs environment (default local).
If -n is set it will initialize with NAME as name or else with a random id.
environment: lists, switch a remove COMPSs environments.
exec CMD: executes the CMD within the current COMPSs environment.
run [--app_name] [OPTIONS] FILE [PARAMS]: runs FILE with COMPSs, where OPTIONS are COMPSs options and PARAMS are application parameters.
--app_name parameter is only required for remote environments
monitor [start|stop]: starts or stops the COMPSs monitoring.
jupyter [--app_name] [PATH|FILE]: starts jupyter-notebook in the given PATH or FILE.
--app_name parameter is only required for remote environments
job: submits, cancel and list jobs on remote and local environments.
app: deploy, list and remove applications on remote and local environments.
gengraph [FILE.dot]: converts the .dot graph into .pdf
components list: lists COMPSs actives components.
components add RESOURCE: adds the RESOURCE to the pool of workers of the COMPSs.
Example given: pycompss components add worker 2 # to add 2 local workers.
Example given: pycompss components add worker <IP>:<CORES> # to add a remote worker
Note: compss and dislib can be used instead of pycompss in both examples.
components remove RESOURCE: removes the RESOURCE to the pool of workers of the COMPSs.
Example given: pycompss components remove worker 2 # to remove 2 local workers.
Example given: pycompss components remove worker <IP>:<CORES> # to remove a remote worker
Note: compss and dislib can be used instead of pycompss in both examples.
Create a new COMPSs environment in your development directory
Creates a docker type evironment and deploy a COMPSs container
$ pycompss init docker -w [WORK_DIR] -i [IMAGE]
The command initializes COMPSs in the current working dir or in WORK_DIR if -w is set. The COMPSs docker image to be used can be specified with -i (it can also be specified with the COMPSS_DOCKER_IMAGE environment variable).
Initialize the COMPSs infrastructure where your source code will be. This will allow docker to access your local code and run it inside the container.
$ pycompss init docker # operates on the current directory as working directory.
Note
The first time needs to download the docker image from the repository, and it may take a while.
Alternatively, you can specify the working directory, the COMPSs docker image to use, or both at the same time:
$ # You can also provide a path
$ pycompss init docker -w /home/user/replace/path/
$
$ # Or the COMPSs docker image to use
$ pycompss init docker -i compss/compss-tutorial:3.0
$
$ # Or both
$ pycompss init docker -w /home/user/replace/path/ -i compss/compss-tutorial:3.0
$ pycompss init local -w [WORK_DIR] -m [MODULES ...]
Creates a local type evironment and initializes COMPSs in the current working dir or in WORK_DIR if -w is set. The modules to be loaded automatically can be specified with -m.
Initialize the COMPSs infrastructure where your source code will be.
$ pycompss init local # operates on the current directory as working directory.
Alternatively, you can specify the working directory, the modules to automatically load or both at the same time:
$ # You can also provide a path
$ pycompss init local -w /home/user/replace/path/
$
$ # Or a list of modules to load automatically before every command
$ pycompss init local -m COMPSs/3.0 ANACONDA/5.1.0_py3
$
$ # Or both
$ pycompss init local -w /home/user/replace/path/ -m COMPSs/3.0 ANACONDA/5.1.0_py3
$ pycompss init remote -l [LOGIN] -m [FILE | MODULES ...]
Creates a remote type evironment with the credentials specified in LOGIN. The modules to be loaded automatically can be specified with -m.
Parameter LOGIN is necessary to connect to the remote host and must follow
standard format i.e. [user]@[hostname]:[port]. port
is optional and defaults to 22 for ssh.
$ pycompss init remote -l username@mn1.bsc.es
$
$ # Or with list of modules
$ pycompss init remote -l username@mn1.bsc.es -m COMPSs/3.0 ANACONDA/5.1.0_py3
Note
The SSH access to the remote should be configured to work without password. If you need to set up your machine for the first time please take a look at Additional Configuration Section for a detailed description of the additional configuration.
The parameter -m
also supports passing a file containing not only modules but any kind of commands
that you need to execute for the remote environment.
Suppose we have a file modules.sh
with the following content:
export ComputingUnits=1
export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
module load COMPSs/3.0
module load ANACONDA/5.1.0_py3
$ pycompss init remote -l username@mn1.bsc.es -m /path/to/modules.sh
Managing environments
Every time command pycompss init
is executed, a new environment is created and becomes the active
environment in wich the rest of the commands will be executed.
The subcommands pycompss environment
will help inspecting, removing and switching between the environments.
You can list all the environments created with pycompss environment list
and inspect which one is active,
the types of each one and the ID.
$ pycompss environment list
ID Type Active
- 5eeb858c2b10 remote *
- default local
- container-b54 docker
The ID of the environments is what you will use to switch between them.
$ pycompss environment change container-b54
Environment `container-b54` is now active
Every environment can also be deleted, except default
environment.
$ pycompss environment remove container-b54
Deleting environment `container-b54`...
$ pycompss environment remove default
ERROR: `default` environment is required and cannot be deleted.
Also every remote environment can have multiple applications deployed in remote. So if you want to delete the environment all the data associated with them will be aslo deleted.
$ pycompss environment remove 5eeb858c2b10 # deleting a remote env with 2 apps deployed
WARNING: There are still applications binded to this environment
Do you want to delete this environment and all the applications? (y/N) y # default is no
Deleting app1...
Deleting app2...
Deleting environment `5eeb858c2b10`...
Deploying applications
For a remote environment is required to deploy any application before executing it.
$ pycompss app deploy [APP_NAME] --source_dir [SOURCE_DIR] --destination_dir [DESTINATION_DIR]
APP_NAME is required and must be unique.
SOURCE_DIR and DESTINATION_DIR are optional
the command copies the application from the current directory or from SOURCE_DIR if –source_dir is set
to the remote directory specified with DESTINATION_DIR.
if DESTINATION_DIR is not set, the application will be deployed in $HOME/.COMPSsApps
In order to show how to deploy an application, clone the PyCOMPSs’ tutorial apps repository:
$ git clone https://github.com/bsc-wdc/tutorial_apps.git
This is not necessary for docker environments since the working directory is set at the initialization of the environment.
On local
environment deploying an application wil just copy the --source_dir
directory to another location.
Let’s deploy the matrix multiplication tutorial application.
$ pycompss app deploy matmul --source_dir tutorial_apps/python/matmul_files
Also you could specify the path where to copy the files.
$ pycompss app deploy matmul --source_dir tutorial_apps/python/matmul_files/src/ --destination_dir /home/user/matmul_copy
If the parameter --destination_dir
is missing then the files will be copied to ~/.COMPSsApps/%env_name%/%app_name%/
Each deployed application can be listed using the command:
$ pycompss app list
Name Source Destination
------------ ------------------------------------------------------------ ---------------------------------------
matmul /home/user/tutorial_apps/python/matmul_files /home/user/.COMPSsApps/default/matmul
test_jenkins /jenkins/tests_execution_sandbox/apps/app009/.COMPSsWorker /tmp/test_jenkins
Also every app can be deleted using the command:
$ pycompss app remove matmul
Deleting application `matmul`...
Caution
Removing an applocation will delete the copied app directory and every valuable results generated inside.
Let’s deploy the matrix multiplication tutorial application.
$ pycompss app deploy matmul --source_dir tutorial_apps/python/matmul_files
Also you could specify the path where to copy the files on the remote host.
$ pycompss app deploy matmul --source_dir tutorial_apps/python/matmul_files/src/ --destination_dir /path/cluster/my_app
Each deployed application within a remote environment can be listed using the command:
$ pycompss app list
Name
- matmul
- app1
Also every app can be deleted using the command:
$ pycompss app remove matmul
Deleting application `matmul`...
Caution
Removing an applocation will delete the entire app directory and every valuable results generated inside.
Executing applications
$ pycompss run [COMPSS_ARGS] APP_FILE [APP_ARGS]
APP_FILE is required and must be a valid python file. APP_ARGS is optional and can be used to pass any argument to the application.
COMPSS_ARGS is optional and can accept the following arguments
1--graph=<bool>, --graph, -g Generation of the complete graph (true/false)
2 When no value is provided it is set to true
3 Default: false
4--tracing=<level>, --tracing, -t Set generation of traces and/or tracing level ( [ true | basic ] | advanced | scorep | arm-map | arm-ddt | false)
5 True and basic levels will produce the same traces.
6 When no value is provided it is set to 1
7 Default: 0
8--monitoring=<int>, --monitoring, -m Period between monitoring samples (milliseconds)
9 When no value is provided it is set to 2000
10 Default: 0
11--external_debugger=<int>,
12--external_debugger Enables external debugger connection on the specified port (or 9999 if empty)
13 Default: false
14--jmx_port=<int> Enable JVM profiling on specified port
15
16Runtime configuration options:
17--task_execution=<compss|storage> Task execution under COMPSs or Storage.
18 Default: compss
19--storage_impl=<string> Path to an storage implementation. Shortcut to setting pypath and classpath. See Runtime/storage in your installation folder.
20--storage_conf=<path> Path to the storage configuration file
21 Default: null
22--project=<path> Path to the project XML file
23 Default: /opt/COMPSs//Runtime/configuration/xml/projects/default_project.xml
24--resources=<path> Path to the resources XML file
25 Default: /opt/COMPSs//Runtime/configuration/xml/resources/default_resources.xml
26--lang=<name> Language of the application (java/c/python)
27 Default: Inferred is possible. Otherwise: java
28--summary Displays a task execution summary at the end of the application execution
29 Default: false
30--log_level=<level>, --debug, -d Set the debug level: off | info | api | debug | trace
31 Warning: Off level compiles with -O2 option disabling asserts and __debug__
32 Default: off
33
34Advanced options:
35--extrae_config_file=<path> Sets a custom extrae config file. Must be in a shared disk between all COMPSs workers.
36 Default: null
37--extrae_config_file_python=<path> Sets a custom extrae config file for python. Must be in a shared disk between all COMPSs workers.
38 Default: null
39--trace_label=<string> Add a label in the generated trace file. Only used in the case of tracing is activated.
40 Default: None
41--tracing_task_dependencies Adds communication lines for the task dependencies ( [ true | false ] )
42 Default: false
43--comm=<ClassName> Class that implements the adaptor for communications
44 Supported adaptors:
45 ├── es.bsc.compss.nio.master.NIOAdaptor
46 └── es.bsc.compss.gat.master.GATAdaptor
47 Default: es.bsc.compss.nio.master.NIOAdaptor
48--conn=<className> Class that implements the runtime connector for the cloud
49 Supported connectors:
50 ├── es.bsc.compss.connectors.DefaultSSHConnector
51 └── es.bsc.compss.connectors.DefaultNoSSHConnector
52 Default: es.bsc.compss.connectors.DefaultSSHConnector
53--streaming=<type> Enable the streaming mode for the given type.
54 Supported types: FILES, OBJECTS, PSCOS, ALL, NONE
55 Default: NONE
56--streaming_master_name=<str> Use an specific streaming master node name.
57 Default: null
58--streaming_master_port=<int> Use an specific port for the streaming master.
59 Default: null
60--scheduler=<className> Class that implements the Scheduler for COMPSs
61 Supported schedulers:
62 ├── es.bsc.compss.scheduler.fifodatalocation.FIFODataLocationScheduler
63 ├── es.bsc.compss.scheduler.fifonew.FIFOScheduler
64 ├── es.bsc.compss.scheduler.fifodatanew.FIFODataScheduler
65 ├── es.bsc.compss.scheduler.lifonew.LIFOScheduler
66 ├── es.bsc.compss.components.impl.TaskScheduler
67 └── es.bsc.compss.scheduler.loadbalancing.LoadBalancingScheduler
68 Default: es.bsc.compss.scheduler.loadbalancing.LoadBalancingScheduler
69--scheduler_config_file=<path> Path to the file which contains the scheduler configuration.
70 Default: Empty
71--library_path=<path> Non-standard directories to search for libraries (e.g. Java JVM library, Python library, C binding library)
72 Default: Working Directory
73--classpath=<path> Path for the application classes / modules
74 Default: Working Directory
75--appdir=<path> Path for the application class folder.
76 Default: /home/bscuser/Documents/documentation/COMPSs_Manuals
77--pythonpath=<path> Additional folders or paths to add to the PYTHONPATH
78 Default: /home/bscuser/Documents/documentation/COMPSs_Manuals
79--env_script=<path> Path to the script file where the application environment variables are defined.
80 COMPSs sources this script before running the application.
81 Default: Empty
82--base_log_dir=<path> Base directory to store COMPSs log files (a .COMPSs/ folder will be created inside this location)
83 Default: User home
84--specific_log_dir=<path> Use a specific directory to store COMPSs log files (no sandbox is created)
85 Warning: Overwrites --base_log_dir option
86 Default: Disabled
87--uuid=<int> Preset an application UUID
88 Default: Automatic random generation
89--master_name=<string> Hostname of the node to run the COMPSs master
90 Default:
91--master_port=<int> Port to run the COMPSs master communications.
92 Only for NIO adaptor
93 Default: [43000,44000]
94--jvm_master_opts="<string>" Extra options for the COMPSs Master JVM. Each option separed by "," and without blank spaces (Notice the quotes)
95 Default:
96--jvm_workers_opts="<string>" Extra options for the COMPSs Workers JVMs. Each option separed by "," and without blank spaces (Notice the quotes)
97 Default: -Xms1024m,-Xmx1024m,-Xmn400m
98--cpu_affinity="<string>" Sets the CPU affinity for the workers
99 Supported options: disabled, automatic, user defined map of the form "0-8/9,10,11/12-14,15,16"
100 Default: automatic
101--gpu_affinity="<string>" Sets the GPU affinity for the workers
102 Supported options: disabled, automatic, user defined map of the form "0-8/9,10,11/12-14,15,16"
103 Default: automatic
104--fpga_affinity="<string>" Sets the FPGA affinity for the workers
105 Supported options: disabled, automatic, user defined map of the form "0-8/9,10,11/12-14,15,16"
106 Default: automatic
107--fpga_reprogram="<string>" Specify the full command that needs to be executed to reprogram the FPGA with the desired bitstream. The location must be an absolute path.
108 Default:
109--io_executors=<int> IO Executors per worker
110 Default: 0
111--task_count=<int> Only for C/Python Bindings. Maximum number of different functions/methods, invoked from the application, that have been selected as tasks
112 Default: 50
113--input_profile=<path> Path to the file which stores the input application profile
114 Default: Empty
115--output_profile=<path> Path to the file to store the application profile at the end of the execution
116 Default: Empty
117--PyObject_serialize=<bool> Only for Python Binding. Enable the object serialization to string when possible (true/false).
118 Default: false
119--persistent_worker_c=<bool> Only for C Binding. Enable the persistent worker in c (true/false).
120 Default: false
121--enable_external_adaptation=<bool> Enable external adaptation. This option will disable the Resource Optimizer.
122 Default: false
123--gen_coredump Enable master coredump generation
124 Default: false
125--keep_workingdir Do not remove the worker working directory after the execution
126 Default: false
127--python_interpreter=<string> Python interpreter to use (python/python2/python3).
128 Default: python Version:
129--python_propagate_virtual_environment=<bool> Propagate the master virtual environment to the workers (true/false).
130 Default: true
131--python_mpi_worker=<bool> Use MPI to run the python worker instead of multiprocessing. (true/false).
132 Default: false
133--python_memory_profile Generate a memory profile of the master.
134 Default: false
135--python_worker_cache=<string> Python worker cache (true/size/false).
136 Only for NIO without mpi worker and python >= 3.8.
137 Default: false
138--wall_clock_limit=<int> Maximum duration of the application (in seconds).
139 Default: 0
140--shutdown_in_node_failure=<bool> Stop the whole execution in case of Node Failure.
141 Default: false
Init a docker environment in the root of the repository. The source
files path are resolved from the init directory which sometimes can be
confusing. As a rule of thumb, initialize the library in a current
directory and check the paths are correct running the file with
python3 path_to/file.py
(in this case
python3 python/matmul_files/src/matmul_files.py
).
$ cd tutorial_apps
$ pycompss init docker
Now we can run the matmul_files.py
application:
$ pycompss run python/matmul_files/src/matmul_files.py 4 4
The log files of the execution can be found at $HOME/.COMPSs
.
You can also init the docker environment inside the examples folder. This will mount the examples directory inside the container so you can execute it without adding the path:
$ pycompss init docker -w python/matmul_files/src
$ pycompss run matmul_files.py 4 4
Not available
Not available. Submitting jobs for applications is only possible for remote and local environments.
$ pycompss run [COMPSS_ARGS] APP_FILE [APP_ARGS]
APP_FILE is required and must be a valid python file. APP_ARGS is optional and can be used to pass any argument to the application.
COMPSS_ARGS is optional and can accept the following arguments
1--graph=<bool>, --graph, -g Generation of the complete graph (true/false)
2 When no value is provided it is set to true
3 Default: false
4--tracing=<level>, --tracing, -t Set generation of traces and/or tracing level ( [ true | basic ] | advanced | scorep | arm-map | arm-ddt | false)
5 True and basic levels will produce the same traces.
6 When no value is provided it is set to 1
7 Default: 0
8--monitoring=<int>, --monitoring, -m Period between monitoring samples (milliseconds)
9 When no value is provided it is set to 2000
10 Default: 0
11--external_debugger=<int>,
12--external_debugger Enables external debugger connection on the specified port (or 9999 if empty)
13 Default: false
14--jmx_port=<int> Enable JVM profiling on specified port
15
16Runtime configuration options:
17--task_execution=<compss|storage> Task execution under COMPSs or Storage.
18 Default: compss
19--storage_impl=<string> Path to an storage implementation. Shortcut to setting pypath and classpath. See Runtime/storage in your installation folder.
20--storage_conf=<path> Path to the storage configuration file
21 Default: null
22--project=<path> Path to the project XML file
23 Default: /opt/COMPSs//Runtime/configuration/xml/projects/default_project.xml
24--resources=<path> Path to the resources XML file
25 Default: /opt/COMPSs//Runtime/configuration/xml/resources/default_resources.xml
26--lang=<name> Language of the application (java/c/python)
27 Default: Inferred is possible. Otherwise: java
28--summary Displays a task execution summary at the end of the application execution
29 Default: false
30--log_level=<level>, --debug, -d Set the debug level: off | info | api | debug | trace
31 Warning: Off level compiles with -O2 option disabling asserts and __debug__
32 Default: off
33
34Advanced options:
35--extrae_config_file=<path> Sets a custom extrae config file. Must be in a shared disk between all COMPSs workers.
36 Default: null
37--extrae_config_file_python=<path> Sets a custom extrae config file for python. Must be in a shared disk between all COMPSs workers.
38 Default: null
39--trace_label=<string> Add a label in the generated trace file. Only used in the case of tracing is activated.
40 Default: None
41--tracing_task_dependencies Adds communication lines for the task dependencies ( [ true | false ] )
42 Default: false
43--comm=<ClassName> Class that implements the adaptor for communications
44 Supported adaptors:
45 ├── es.bsc.compss.nio.master.NIOAdaptor
46 └── es.bsc.compss.gat.master.GATAdaptor
47 Default: es.bsc.compss.nio.master.NIOAdaptor
48--conn=<className> Class that implements the runtime connector for the cloud
49 Supported connectors:
50 ├── es.bsc.compss.connectors.DefaultSSHConnector
51 └── es.bsc.compss.connectors.DefaultNoSSHConnector
52 Default: es.bsc.compss.connectors.DefaultSSHConnector
53--streaming=<type> Enable the streaming mode for the given type.
54 Supported types: FILES, OBJECTS, PSCOS, ALL, NONE
55 Default: NONE
56--streaming_master_name=<str> Use an specific streaming master node name.
57 Default: null
58--streaming_master_port=<int> Use an specific port for the streaming master.
59 Default: null
60--scheduler=<className> Class that implements the Scheduler for COMPSs
61 Supported schedulers:
62 ├── es.bsc.compss.scheduler.fifodatalocation.FIFODataLocationScheduler
63 ├── es.bsc.compss.scheduler.fifonew.FIFOScheduler
64 ├── es.bsc.compss.scheduler.fifodatanew.FIFODataScheduler
65 ├── es.bsc.compss.scheduler.lifonew.LIFOScheduler
66 ├── es.bsc.compss.components.impl.TaskScheduler
67 └── es.bsc.compss.scheduler.loadbalancing.LoadBalancingScheduler
68 Default: es.bsc.compss.scheduler.loadbalancing.LoadBalancingScheduler
69--scheduler_config_file=<path> Path to the file which contains the scheduler configuration.
70 Default: Empty
71--library_path=<path> Non-standard directories to search for libraries (e.g. Java JVM library, Python library, C binding library)
72 Default: Working Directory
73--classpath=<path> Path for the application classes / modules
74 Default: Working Directory
75--appdir=<path> Path for the application class folder.
76 Default: /home/bscuser/Documents/documentation/COMPSs_Manuals
77--pythonpath=<path> Additional folders or paths to add to the PYTHONPATH
78 Default: /home/bscuser/Documents/documentation/COMPSs_Manuals
79--env_script=<path> Path to the script file where the application environment variables are defined.
80 COMPSs sources this script before running the application.
81 Default: Empty
82--base_log_dir=<path> Base directory to store COMPSs log files (a .COMPSs/ folder will be created inside this location)
83 Default: User home
84--specific_log_dir=<path> Use a specific directory to store COMPSs log files (no sandbox is created)
85 Warning: Overwrites --base_log_dir option
86 Default: Disabled
87--uuid=<int> Preset an application UUID
88 Default: Automatic random generation
89--master_name=<string> Hostname of the node to run the COMPSs master
90 Default:
91--master_port=<int> Port to run the COMPSs master communications.
92 Only for NIO adaptor
93 Default: [43000,44000]
94--jvm_master_opts="<string>" Extra options for the COMPSs Master JVM. Each option separed by "," and without blank spaces (Notice the quotes)
95 Default:
96--jvm_workers_opts="<string>" Extra options for the COMPSs Workers JVMs. Each option separed by "," and without blank spaces (Notice the quotes)
97 Default: -Xms1024m,-Xmx1024m,-Xmn400m
98--cpu_affinity="<string>" Sets the CPU affinity for the workers
99 Supported options: disabled, automatic, user defined map of the form "0-8/9,10,11/12-14,15,16"
100 Default: automatic
101--gpu_affinity="<string>" Sets the GPU affinity for the workers
102 Supported options: disabled, automatic, user defined map of the form "0-8/9,10,11/12-14,15,16"
103 Default: automatic
104--fpga_affinity="<string>" Sets the FPGA affinity for the workers
105 Supported options: disabled, automatic, user defined map of the form "0-8/9,10,11/12-14,15,16"
106 Default: automatic
107--fpga_reprogram="<string>" Specify the full command that needs to be executed to reprogram the FPGA with the desired bitstream. The location must be an absolute path.
108 Default:
109--io_executors=<int> IO Executors per worker
110 Default: 0
111--task_count=<int> Only for C/Python Bindings. Maximum number of different functions/methods, invoked from the application, that have been selected as tasks
112 Default: 50
113--input_profile=<path> Path to the file which stores the input application profile
114 Default: Empty
115--output_profile=<path> Path to the file to store the application profile at the end of the execution
116 Default: Empty
117--PyObject_serialize=<bool> Only for Python Binding. Enable the object serialization to string when possible (true/false).
118 Default: false
119--persistent_worker_c=<bool> Only for C Binding. Enable the persistent worker in c (true/false).
120 Default: false
121--enable_external_adaptation=<bool> Enable external adaptation. This option will disable the Resource Optimizer.
122 Default: false
123--gen_coredump Enable master coredump generation
124 Default: false
125--keep_workingdir Do not remove the worker working directory after the execution
126 Default: false
127--python_interpreter=<string> Python interpreter to use (python/python2/python3).
128 Default: python Version:
129--python_propagate_virtual_environment=<bool> Propagate the master virtual environment to the workers (true/false).
130 Default: true
131--python_mpi_worker=<bool> Use MPI to run the python worker instead of multiprocessing. (true/false).
132 Default: false
133--python_memory_profile Generate a memory profile of the master.
134 Default: false
135--python_worker_cache=<string> Python worker cache (true/size/false).
136 Only for NIO without mpi worker and python >= 3.8.
137 Default: false
138--wall_clock_limit=<int> Maximum duration of the application (in seconds).
139 Default: 0
140--shutdown_in_node_failure=<bool> Stop the whole execution in case of Node Failure.
141 Default: false
Init a local environment in the root of the repository. The source
files path are resolved from the init directory which sometimes can be
confusing. As a rule of thumb, initialize the library in a current
directory and check the paths are correct running the file with
python3 path_to/file.py
(in this case
python3 python/matmul_files/src/matmul_files.py
).
$ cd tutorial_apps
$ pycompss init local
Now we can run the matmul_files.py
application:
$ pycompss run python/matmul_files/src/matmul_files.py 4 4
The log files of the execution can be found at $HOME/.COMPSs
.
You can also init the local environment inside the examples folder. This will mount the examples directory inside the container so you can execute it without adding the path:
$ pycompss init local -w python/matmul_files/src
$ pycompss run matmul_files.py 4 4
Important
To be able to submit a job in a local environment you must have installed some cluster management/job scheduling system .i.e SLURM, SGE, PBS, etc.
The pycompss job
command can be used to submit, cancel and list jobs to a remote environment.
It is only available for local and remote environments.
$ pycompss job submit -e [ENV_VAR...] [COMPSS_ARGS] APP_FILE [APP_ARGS]
ENV_VAR is optional and can be used to pass any environment variable to the application. APP_FILE is required and must be a valid python file inside app directory. APP_ARGS is optional and can be used to pass any argument to the application.
COMPSS_ARGS is optional and can accept the following arguments
1Queue system configuration:
2 --sc_cfg=<name> SuperComputer configuration file to use. Must exist inside queues/cfgs/
3 Default: default
4
5Submission configuration:
6General submision arguments:
7 --exec_time=<minutes> Expected execution time of the application (in minutes)
8 Default: 10
9 --job_name=<name> Job name
10 Default: COMPSs
11 --queue=<name> Queue name to submit the job. Depends on the queue system.
12 For example (MN3): bsc_cs | bsc_debug | debug | interactive
13 Default: default
14 --reservation=<name> Reservation to use when submitting the job.
15 Default: disabled
16 --env_script=<path/to/script> Script to source the required environment for the application.
17 Default: Empty
18 --extra_submit_flag=<flag> Flag to pass queue system flags not supported by default command flags.
19 Spaces must be added as '#'
20 Default: Empty
21 --cpus_per_task Number of cpus per task the queue system must allocate per task.
22 Note that this will be equal to the cpus_per_node in a worker node and
23 equal to the worker_in_master_cpus in a master node respectively.
24 Default: false
25 --job_dependency=<jobID> Postpone job execution until the job dependency has ended.
26 Default: None
27 --forward_time_limit=<true|false> Forward the queue system time limit to the runtime.
28 It will stop the application in a controlled way.
29 Default: true
30 --storage_home=<string> Root installation dir of the storage implementation
31 Default: null
32 --storage_props=<string> Absolute path of the storage properties file
33 Mandatory if storage_home is defined
34Agents deployment arguments:
35 --agents=<string> Hierarchy of agents for the deployment. Accepted values: plain|tree
36 Default: tree
37 --agents Deploys the runtime as agents instead of the classic Master-Worker deployment.
38 Default: disabled
39
40Homogeneous submission arguments:
41 --num_nodes=<int> Number of nodes to use
42 Default: 2
43 --num_switches=<int> Maximum number of different switches. Select 0 for no restrictions.
44 Maximum nodes per switch: 18
45 Only available for at least 4 nodes.
46 Default: 0
47Heterogeneous submission arguments:
48 --type_cfg=<file_location> Location of the file with the descriptions of node type requests
49 File should follow the following format:
50 type_X(){
51 cpus_per_node=24
52 node_memory=96
53 ...
54 }
55 type_Y(){
56 ...
57 }
58 --master=<master_node_type> Node type for the master
59 (Node type descriptions are provided in the --type_cfg flag)
60 --workers=type_X:nodes,type_Y:nodes Node type and number of nodes per type for the workers
61 (Node type descriptions are provided in the --type_cfg flag)
62Launch configuration:
63 --cpus_per_node=<int> Available CPU computing units on each node
64 Default: 32
65 --gpus_per_node=<int> Available GPU computing units on each node
66 Default: 0
67 --fpgas_per_node=<int> Available FPGA computing units on each node
68 Default:
69 --io_executors=<int> Number of IO executors on each node
70 Default: 0
71 --fpga_reprogram="<string> Specify the full command that needs to be executed to reprogram the FPGA with
72 the desired bitstream. The location must be an absolute path.
73 Default:
74 --max_tasks_per_node=<int> Maximum number of simultaneous tasks running on a node
75 Default: -1
76 --node_memory=<MB> Maximum node memory: disabled | <int> (MB)
77 Default: disabled
78 --node_storage_bandwidth=<MB> Maximum node storage bandwidth: <int> (MB)
79 Default:
80
81 --network=<name> Communication network for transfers: default | ethernet | infiniband | data.
82 Default: ethernet
83
84 --prolog="<string>" Task to execute before launching COMPSs (Notice the quotes)
85 If the task has arguments split them by "," rather than spaces.
86 This argument can appear multiple times for more than one prolog action
87 Default: Empty
88 --epilog="<string>" Task to execute after executing the COMPSs application (Notice the quotes)
89 If the task has arguments split them by "," rather than spaces.
90 This argument can appear multiple times for more than one epilog action
91 Default: Empty
92
93 --master_working_dir=<path> Working directory of the application
94 Default: .
95 --worker_working_dir=<name | path> Worker directory. Use: local_disk | shared_disk | <path>
96 Default: local_disk
97
98 --worker_in_master_cpus=<int> Maximum number of CPU computing units that the master node can run as worker. Cannot exceed cpus_per_node.
99 Default: 0
100 --worker_in_master_memory=<int> MB Maximum memory in master node assigned to the worker. Cannot exceed the node_memory.
101 Mandatory if worker_in_master_cpus is specified.
102 Default: disabled
103 --worker_port_range=<min>,<max> Port range used by the NIO adaptor at the worker side
104 Default: 43001,43005
105 --jvm_worker_in_master_opts="<string>" Extra options for the JVM of the COMPSs Worker in the Master Node.
106 Each option separed by "," and without blank spaces (Notice the quotes)
107 Default:
108 --container_image=<path> Runs the application by means of a container engine image
109 Default: Empty
110 --container_compss_path=<path> Path where compss is installed in the container image
111 Default: /opt/COMPSs
112 --container_opts="<string>" Options to pass to the container engine
113 Default: empty
114 --elasticity=<max_extra_nodes> Activate elasticity specifiying the maximum extra nodes (ONLY AVAILABLE FORM SLURM CLUSTERS WITH NIO ADAPTOR)
115 Default: 0
116 --automatic_scaling=<bool> Enable or disable the runtime automatic scaling (for elasticity)
117 Default: true
118 --jupyter_notebook=<path>, Swap the COMPSs master initialization with jupyter notebook from the specified path.
119 --jupyter_notebook Default: false
120 --ipython Swap the COMPSs master initialization with ipython.
121 Default: empty
122
123
124Runcompss configuration:
125
126
127Tools enablers:
128 --graph=<bool>, --graph, -g Generation of the complete graph (true/false)
129 When no value is provided it is set to true
130 Default: false
131 --tracing=<level>, --tracing, -t Set generation of traces and/or tracing level ( [ true | basic ] | advanced | scorep | arm-map | arm-ddt | false)
132 True and basic levels will produce the same traces.
133 When no value is provided it is set to 1
134 Default: 0
135 --monitoring=<int>, --monitoring, -m Period between monitoring samples (milliseconds)
136 When no value is provided it is set to 2000
137 Default: 0
138 --external_debugger=<int>,
139 --external_debugger Enables external debugger connection on the specified port (or 9999 if empty)
140 Default: false
141 --jmx_port=<int> Enable JVM profiling on specified port
142
143Runtime configuration options:
144 --task_execution=<compss|storage> Task execution under COMPSs or Storage.
145 Default: compss
146 --storage_impl=<string> Path to an storage implementation. Shortcut to setting pypath and classpath. See Runtime/storage in your installation folder.
147 --storage_conf=<path> Path to the storage configuration file
148 Default: null
149 --project=<path> Path to the project XML file
150 Default: /opt/COMPSs//Runtime/configuration/xml/projects/default_project.xml
151 --resources=<path> Path to the resources XML file
152 Default: /opt/COMPSs//Runtime/configuration/xml/resources/default_resources.xml
153 --lang=<name> Language of the application (java/c/python)
154 Default: Inferred is possible. Otherwise: java
155 --summary Displays a task execution summary at the end of the application execution
156 Default: false
157 --log_level=<level>, --debug, -d Set the debug level: off | info | api | debug | trace
158 Warning: Off level compiles with -O2 option disabling asserts and __debug__
159 Default: off
160
161Advanced options:
162 --extrae_config_file=<path> Sets a custom extrae config file. Must be in a shared disk between all COMPSs workers.
163 Default: null
164 --extrae_config_file_python=<path> Sets a custom extrae config file for python. Must be in a shared disk between all COMPSs workers.
165 Default: null
166 --trace_label=<string> Add a label in the generated trace file. Only used in the case of tracing is activated.
167 Default: None
168 --tracing_task_dependencies Adds communication lines for the task dependencies ( [ true | false ] )
169 Default: false
170 --comm=<ClassName> Class that implements the adaptor for communications
171 Supported adaptors:
172 ├── es.bsc.compss.nio.master.NIOAdaptor
173 └── es.bsc.compss.gat.master.GATAdaptor
174 Default: es.bsc.compss.nio.master.NIOAdaptor
175 --conn=<className> Class that implements the runtime connector for the cloud
176 Supported connectors:
177 ├── es.bsc.compss.connectors.DefaultSSHConnector
178 └── es.bsc.compss.connectors.DefaultNoSSHConnector
179 Default: es.bsc.compss.connectors.DefaultSSHConnector
180 --streaming=<type> Enable the streaming mode for the given type.
181 Supported types: FILES, OBJECTS, PSCOS, ALL, NONE
182 Default: NONE
183 --streaming_master_name=<str> Use an specific streaming master node name.
184 Default: null
185 --streaming_master_port=<int> Use an specific port for the streaming master.
186 Default: null
187 --scheduler=<className> Class that implements the Scheduler for COMPSs
188 Supported schedulers:
189 ├── es.bsc.compss.scheduler.fifodatalocation.FIFODataLocationScheduler
190 ├── es.bsc.compss.scheduler.fifonew.FIFOScheduler
191 ├── es.bsc.compss.scheduler.fifodatanew.FIFODataScheduler
192 ├── es.bsc.compss.scheduler.lifonew.LIFOScheduler
193 ├── es.bsc.compss.components.impl.TaskScheduler
194 └── es.bsc.compss.scheduler.loadbalancing.LoadBalancingScheduler
195 Default: es.bsc.compss.scheduler.loadbalancing.LoadBalancingScheduler
196 --scheduler_config_file=<path> Path to the file which contains the scheduler configuration.
197 Default: Empty
198 --library_path=<path> Non-standard directories to search for libraries (e.g. Java JVM library, Python library, C binding library)
199 Default: Working Directory
200 --classpath=<path> Path for the application classes / modules
201 Default: Working Directory
202 --appdir=<path> Path for the application class folder.
203 Default: /home/bscuser/Documents/framework/builders/specs/cli/pyCOMPSsCLIResources
204 --pythonpath=<path> Additional folders or paths to add to the PYTHONPATH
205 Default: /home/bscuser/Documents/framework/builders/specs/cli/pyCOMPSsCLIResources
206 --env_script=<path> Path to the script file where the application environment variables are defined.
207 COMPSs sources this script before running the application.
208 Default: Empty
209 --base_log_dir=<path> Base directory to store COMPSs log files (a .COMPSs/ folder will be created inside this location)
210 Default: User home
211 --specific_log_dir=<path> Use a specific directory to store COMPSs log files (no sandbox is created)
212 Warning: Overwrites --base_log_dir option
213 Default: Disabled
214 --uuid=<int> Preset an application UUID
215 Default: Automatic random generation
216 --master_name=<string> Hostname of the node to run the COMPSs master
217 Default:
218 --master_port=<int> Port to run the COMPSs master communications.
219 Only for NIO adaptor
220 Default: [43000,44000]
221 --jvm_master_opts="<string>" Extra options for the COMPSs Master JVM. Each option separed by "," and without blank spaces (Notice the quotes)
222 Default:
223 --jvm_workers_opts="<string>" Extra options for the COMPSs Workers JVMs. Each option separed by "," and without blank spaces (Notice the quotes)
224 Default: -Xms1024m,-Xmx1024m,-Xmn400m
225 --cpu_affinity="<string>" Sets the CPU affinity for the workers
226 Supported options: disabled, automatic, user defined map of the form "0-8/9,10,11/12-14,15,16"
227 Default: automatic
228 --gpu_affinity="<string>" Sets the GPU affinity for the workers
229 Supported options: disabled, automatic, user defined map of the form "0-8/9,10,11/12-14,15,16"
230 Default: automatic
231 --fpga_affinity="<string>" Sets the FPGA affinity for the workers
232 Supported options: disabled, automatic, user defined map of the form "0-8/9,10,11/12-14,15,16"
233 Default: automatic
234 --fpga_reprogram="<string>" Specify the full command that needs to be executed to reprogram the FPGA with the desired bitstream. The location must be an absolute path.
235 Default:
236 --io_executors=<int> IO Executors per worker
237 Default: 0
238 --task_count=<int> Only for C/Python Bindings. Maximum number of different functions/methods, invoked from the application, that have been selected as tasks
239 Default: 50
240 --input_profile=<path> Path to the file which stores the input application profile
241 Default: Empty
242 --output_profile=<path> Path to the file to store the application profile at the end of the execution
243 Default: Empty
244 --PyObject_serialize=<bool> Only for Python Binding. Enable the object serialization to string when possible (true/false).
245 Default: false
246 --persistent_worker_c=<bool> Only for C Binding. Enable the persistent worker in c (true/false).
247 Default: false
248 --enable_external_adaptation=<bool> Enable external adaptation. This option will disable the Resource Optimizer.
249 Default: false
250 --gen_coredump Enable master coredump generation
251 Default: false
252 --keep_workingdir Do not remove the worker working directory after the execution
253 Default: false
254 --python_interpreter=<string> Python interpreter to use (python/python2/python3).
255 Default: python Version:
256 --python_propagate_virtual_environment=<bool> Propagate the master virtual environment to the workers (true/false).
257 Default: true
258 --python_mpi_worker=<bool> Use MPI to run the python worker instead of multiprocessing. (true/false).
259 Default: false
260 --python_memory_profile Generate a memory profile of the master.
261 Default: false
262 --python_worker_cache=<string> Python worker cache (true/size/false).
263 Only for NIO without mpi worker and python >= 3.8.
264 Default: false
265 --wall_clock_limit=<int> Maximum duration of the application (in seconds).
266 Default: 0
267 --shutdown_in_node_failure=<bool> Stop the whole execution in case of Node Failure.
268 Default: false
The command will submit a job and return the Job ID. In order to run a COMPSs program on the local machine we can use the command:
$ cd tutorial_apps/python/matmul_files/src
$ pycompss job submit -e ComputingUnits=1 --num_nodes=2 --exec_time=10 --worker_working_dir=local_disk --tracing=false --lang=python --qos=debug matmul_files.py 4 4
The pycompss job
command can be used to submit, cancel and list jobs to a remote environment.
It is only available for local and remote environments.
$ pycompss job submit -e [ENV_VAR...] -app APP_NAME [COMPSS_ARGS] APP_FILE [APP_ARGS]
ENV_VAR is optional and can be used to pass any environment variable to the application. APP_NAME is required and must be a valid application name previously deployed. APP_FILE is required and must be a valid python file inside app directory. APP_ARGS is optional and can be used to pass any argument to the application.
COMPSS_ARGS is optional and can accept the following arguments
1Queue system configuration:
2 --sc_cfg=<name> SuperComputer configuration file to use. Must exist inside queues/cfgs/
3 Default: default
4
5Submission configuration:
6General submision arguments:
7 --exec_time=<minutes> Expected execution time of the application (in minutes)
8 Default: 10
9 --job_name=<name> Job name
10 Default: COMPSs
11 --queue=<name> Queue name to submit the job. Depends on the queue system.
12 For example (MN3): bsc_cs | bsc_debug | debug | interactive
13 Default: default
14 --reservation=<name> Reservation to use when submitting the job.
15 Default: disabled
16 --env_script=<path/to/script> Script to source the required environment for the application.
17 Default: Empty
18 --extra_submit_flag=<flag> Flag to pass queue system flags not supported by default command flags.
19 Spaces must be added as '#'
20 Default: Empty
21 --cpus_per_task Number of cpus per task the queue system must allocate per task.
22 Note that this will be equal to the cpus_per_node in a worker node and
23 equal to the worker_in_master_cpus in a master node respectively.
24 Default: false
25 --job_dependency=<jobID> Postpone job execution until the job dependency has ended.
26 Default: None
27 --forward_time_limit=<true|false> Forward the queue system time limit to the runtime.
28 It will stop the application in a controlled way.
29 Default: true
30 --storage_home=<string> Root installation dir of the storage implementation
31 Default: null
32 --storage_props=<string> Absolute path of the storage properties file
33 Mandatory if storage_home is defined
34Agents deployment arguments:
35 --agents=<string> Hierarchy of agents for the deployment. Accepted values: plain|tree
36 Default: tree
37 --agents Deploys the runtime as agents instead of the classic Master-Worker deployment.
38 Default: disabled
39
40Homogeneous submission arguments:
41 --num_nodes=<int> Number of nodes to use
42 Default: 2
43 --num_switches=<int> Maximum number of different switches. Select 0 for no restrictions.
44 Maximum nodes per switch: 18
45 Only available for at least 4 nodes.
46 Default: 0
47Heterogeneous submission arguments:
48 --type_cfg=<file_location> Location of the file with the descriptions of node type requests
49 File should follow the following format:
50 type_X(){
51 cpus_per_node=24
52 node_memory=96
53 ...
54 }
55 type_Y(){
56 ...
57 }
58 --master=<master_node_type> Node type for the master
59 (Node type descriptions are provided in the --type_cfg flag)
60 --workers=type_X:nodes,type_Y:nodes Node type and number of nodes per type for the workers
61 (Node type descriptions are provided in the --type_cfg flag)
62Launch configuration:
63 --cpus_per_node=<int> Available CPU computing units on each node
64 Default: 32
65 --gpus_per_node=<int> Available GPU computing units on each node
66 Default: 0
67 --fpgas_per_node=<int> Available FPGA computing units on each node
68 Default:
69 --io_executors=<int> Number of IO executors on each node
70 Default: 0
71 --fpga_reprogram="<string> Specify the full command that needs to be executed to reprogram the FPGA with
72 the desired bitstream. The location must be an absolute path.
73 Default:
74 --max_tasks_per_node=<int> Maximum number of simultaneous tasks running on a node
75 Default: -1
76 --node_memory=<MB> Maximum node memory: disabled | <int> (MB)
77 Default: disabled
78 --node_storage_bandwidth=<MB> Maximum node storage bandwidth: <int> (MB)
79 Default:
80
81 --network=<name> Communication network for transfers: default | ethernet | infiniband | data.
82 Default: ethernet
83
84 --prolog="<string>" Task to execute before launching COMPSs (Notice the quotes)
85 If the task has arguments split them by "," rather than spaces.
86 This argument can appear multiple times for more than one prolog action
87 Default: Empty
88 --epilog="<string>" Task to execute after executing the COMPSs application (Notice the quotes)
89 If the task has arguments split them by "," rather than spaces.
90 This argument can appear multiple times for more than one epilog action
91 Default: Empty
92
93 --master_working_dir=<path> Working directory of the application
94 Default: .
95 --worker_working_dir=<name | path> Worker directory. Use: local_disk | shared_disk | <path>
96 Default: local_disk
97
98 --worker_in_master_cpus=<int> Maximum number of CPU computing units that the master node can run as worker. Cannot exceed cpus_per_node.
99 Default: 0
100 --worker_in_master_memory=<int> MB Maximum memory in master node assigned to the worker. Cannot exceed the node_memory.
101 Mandatory if worker_in_master_cpus is specified.
102 Default: disabled
103 --worker_port_range=<min>,<max> Port range used by the NIO adaptor at the worker side
104 Default: 43001,43005
105 --jvm_worker_in_master_opts="<string>" Extra options for the JVM of the COMPSs Worker in the Master Node.
106 Each option separed by "," and without blank spaces (Notice the quotes)
107 Default:
108 --container_image=<path> Runs the application by means of a container engine image
109 Default: Empty
110 --container_compss_path=<path> Path where compss is installed in the container image
111 Default: /opt/COMPSs
112 --container_opts="<string>" Options to pass to the container engine
113 Default: empty
114 --elasticity=<max_extra_nodes> Activate elasticity specifiying the maximum extra nodes (ONLY AVAILABLE FORM SLURM CLUSTERS WITH NIO ADAPTOR)
115 Default: 0
116 --automatic_scaling=<bool> Enable or disable the runtime automatic scaling (for elasticity)
117 Default: true
118 --jupyter_notebook=<path>, Swap the COMPSs master initialization with jupyter notebook from the specified path.
119 --jupyter_notebook Default: false
120 --ipython Swap the COMPSs master initialization with ipython.
121 Default: empty
122
123
124Runcompss configuration:
125
126
127Tools enablers:
128 --graph=<bool>, --graph, -g Generation of the complete graph (true/false)
129 When no value is provided it is set to true
130 Default: false
131 --tracing=<level>, --tracing, -t Set generation of traces and/or tracing level ( [ true | basic ] | advanced | scorep | arm-map | arm-ddt | false)
132 True and basic levels will produce the same traces.
133 When no value is provided it is set to 1
134 Default: 0
135 --monitoring=<int>, --monitoring, -m Period between monitoring samples (milliseconds)
136 When no value is provided it is set to 2000
137 Default: 0
138 --external_debugger=<int>,
139 --external_debugger Enables external debugger connection on the specified port (or 9999 if empty)
140 Default: false
141 --jmx_port=<int> Enable JVM profiling on specified port
142
143Runtime configuration options:
144 --task_execution=<compss|storage> Task execution under COMPSs or Storage.
145 Default: compss
146 --storage_impl=<string> Path to an storage implementation. Shortcut to setting pypath and classpath. See Runtime/storage in your installation folder.
147 --storage_conf=<path> Path to the storage configuration file
148 Default: null
149 --project=<path> Path to the project XML file
150 Default: /opt/COMPSs//Runtime/configuration/xml/projects/default_project.xml
151 --resources=<path> Path to the resources XML file
152 Default: /opt/COMPSs//Runtime/configuration/xml/resources/default_resources.xml
153 --lang=<name> Language of the application (java/c/python)
154 Default: Inferred is possible. Otherwise: java
155 --summary Displays a task execution summary at the end of the application execution
156 Default: false
157 --log_level=<level>, --debug, -d Set the debug level: off | info | api | debug | trace
158 Warning: Off level compiles with -O2 option disabling asserts and __debug__
159 Default: off
160
161Advanced options:
162 --extrae_config_file=<path> Sets a custom extrae config file. Must be in a shared disk between all COMPSs workers.
163 Default: null
164 --extrae_config_file_python=<path> Sets a custom extrae config file for python. Must be in a shared disk between all COMPSs workers.
165 Default: null
166 --trace_label=<string> Add a label in the generated trace file. Only used in the case of tracing is activated.
167 Default: None
168 --tracing_task_dependencies Adds communication lines for the task dependencies ( [ true | false ] )
169 Default: false
170 --comm=<ClassName> Class that implements the adaptor for communications
171 Supported adaptors:
172 ├── es.bsc.compss.nio.master.NIOAdaptor
173 └── es.bsc.compss.gat.master.GATAdaptor
174 Default: es.bsc.compss.nio.master.NIOAdaptor
175 --conn=<className> Class that implements the runtime connector for the cloud
176 Supported connectors:
177 ├── es.bsc.compss.connectors.DefaultSSHConnector
178 └── es.bsc.compss.connectors.DefaultNoSSHConnector
179 Default: es.bsc.compss.connectors.DefaultSSHConnector
180 --streaming=<type> Enable the streaming mode for the given type.
181 Supported types: FILES, OBJECTS, PSCOS, ALL, NONE
182 Default: NONE
183 --streaming_master_name=<str> Use an specific streaming master node name.
184 Default: null
185 --streaming_master_port=<int> Use an specific port for the streaming master.
186 Default: null
187 --scheduler=<className> Class that implements the Scheduler for COMPSs
188 Supported schedulers:
189 ├── es.bsc.compss.scheduler.fifodatalocation.FIFODataLocationScheduler
190 ├── es.bsc.compss.scheduler.fifonew.FIFOScheduler
191 ├── es.bsc.compss.scheduler.fifodatanew.FIFODataScheduler
192 ├── es.bsc.compss.scheduler.lifonew.LIFOScheduler
193 ├── es.bsc.compss.components.impl.TaskScheduler
194 └── es.bsc.compss.scheduler.loadbalancing.LoadBalancingScheduler
195 Default: es.bsc.compss.scheduler.loadbalancing.LoadBalancingScheduler
196 --scheduler_config_file=<path> Path to the file which contains the scheduler configuration.
197 Default: Empty
198 --library_path=<path> Non-standard directories to search for libraries (e.g. Java JVM library, Python library, C binding library)
199 Default: Working Directory
200 --classpath=<path> Path for the application classes / modules
201 Default: Working Directory
202 --appdir=<path> Path for the application class folder.
203 Default: /home/bscuser/Documents/framework/builders/specs/cli/pyCOMPSsCLIResources
204 --pythonpath=<path> Additional folders or paths to add to the PYTHONPATH
205 Default: /home/bscuser/Documents/framework/builders/specs/cli/pyCOMPSsCLIResources
206 --env_script=<path> Path to the script file where the application environment variables are defined.
207 COMPSs sources this script before running the application.
208 Default: Empty
209 --base_log_dir=<path> Base directory to store COMPSs log files (a .COMPSs/ folder will be created inside this location)
210 Default: User home
211 --specific_log_dir=<path> Use a specific directory to store COMPSs log files (no sandbox is created)
212 Warning: Overwrites --base_log_dir option
213 Default: Disabled
214 --uuid=<int> Preset an application UUID
215 Default: Automatic random generation
216 --master_name=<string> Hostname of the node to run the COMPSs master
217 Default:
218 --master_port=<int> Port to run the COMPSs master communications.
219 Only for NIO adaptor
220 Default: [43000,44000]
221 --jvm_master_opts="<string>" Extra options for the COMPSs Master JVM. Each option separed by "," and without blank spaces (Notice the quotes)
222 Default:
223 --jvm_workers_opts="<string>" Extra options for the COMPSs Workers JVMs. Each option separed by "," and without blank spaces (Notice the quotes)
224 Default: -Xms1024m,-Xmx1024m,-Xmn400m
225 --cpu_affinity="<string>" Sets the CPU affinity for the workers
226 Supported options: disabled, automatic, user defined map of the form "0-8/9,10,11/12-14,15,16"
227 Default: automatic
228 --gpu_affinity="<string>" Sets the GPU affinity for the workers
229 Supported options: disabled, automatic, user defined map of the form "0-8/9,10,11/12-14,15,16"
230 Default: automatic
231 --fpga_affinity="<string>" Sets the FPGA affinity for the workers
232 Supported options: disabled, automatic, user defined map of the form "0-8/9,10,11/12-14,15,16"
233 Default: automatic
234 --fpga_reprogram="<string>" Specify the full command that needs to be executed to reprogram the FPGA with the desired bitstream. The location must be an absolute path.
235 Default:
236 --io_executors=<int> IO Executors per worker
237 Default: 0
238 --task_count=<int> Only for C/Python Bindings. Maximum number of different functions/methods, invoked from the application, that have been selected as tasks
239 Default: 50
240 --input_profile=<path> Path to the file which stores the input application profile
241 Default: Empty
242 --output_profile=<path> Path to the file to store the application profile at the end of the execution
243 Default: Empty
244 --PyObject_serialize=<bool> Only for Python Binding. Enable the object serialization to string when possible (true/false).
245 Default: false
246 --persistent_worker_c=<bool> Only for C Binding. Enable the persistent worker in c (true/false).
247 Default: false
248 --enable_external_adaptation=<bool> Enable external adaptation. This option will disable the Resource Optimizer.
249 Default: false
250 --gen_coredump Enable master coredump generation
251 Default: false
252 --keep_workingdir Do not remove the worker working directory after the execution
253 Default: false
254 --python_interpreter=<string> Python interpreter to use (python/python2/python3).
255 Default: python Version:
256 --python_propagate_virtual_environment=<bool> Propagate the master virtual environment to the workers (true/false).
257 Default: true
258 --python_mpi_worker=<bool> Use MPI to run the python worker instead of multiprocessing. (true/false).
259 Default: false
260 --python_memory_profile Generate a memory profile of the master.
261 Default: false
262 --python_worker_cache=<string> Python worker cache (true/size/false).
263 Only for NIO without mpi worker and python >= 3.8.
264 Default: false
265 --wall_clock_limit=<int> Maximum duration of the application (in seconds).
266 Default: 0
267 --shutdown_in_node_failure=<bool> Stop the whole execution in case of Node Failure.
268 Default: false
Set environment variables (-e, –env_var)
$ pycompss job submit -e MYVAR1 --env MYVAR2=foo APPNAME EXECFILE ARGS
Use the -e, –env_var flags to set simple (non-array) environment variables in the remote environment. Or overwrite variables that are defined in the init command of the environment.
Submitting Jobs
The command will submit a job and return the Job ID. In order to run a COMPSs program on the local machine we can use the command:
$ pycompss job submit -e ComputingUnits=1 -app matmul --num_nodes=2 --exec_time=10 --master_working_dir={COMPS_APP_PATH} --worker_working_dir=local_disk --tracing=false --pythonpath={COMPS_APP_PATH}/src --lang=python --qos=debug {COMPS_APP_PATH}/src/matmul_files.py 4 4
Note
We can also use a macro specific to this CLI in order to use absolute paths:
{COMPS_APP_PATH}
will be resolved by the CLI and replaced with the /absolute/path/to/app on the remote cluster.
Not available
Not available.
A remote type environment only accepts submitting jobs for deployed applications.
See Job
tab for more information.
Managing jobs
Once the job is submitted, it can be inspected using the pycompss job list
command.
The command will list all pending/running jobs subbmited in this environment.
$ pycompss job list
SUCCESS
19152612 - RUNNING - COMPSs
Every subbmited job that didn’t finish yet can be cancelled using the pycompss job cancel
command.
$ pycompss job cancel 19152612 # JOBID
Job `19152612` cancelled
You can also check the status of a particular job with the pycompss job status
command.
$ pycompss job status 19152612 # JOBID
SUCCESS:RUNNING
Also we can query the history of past jobs and we’ll get the app name, the environment variables and the enqueue_compss arguments used to submit the job.
$ pycompss job history --job_id 19152612
Environment Variables: ComputingUnits=1
Enqueue Args: --num_nodes=2
--exec_time=10
--worker_working_dir=local_disk
--tracing=false
--lang=python
--qos=debug
matmul_files.py 4 4
Running the COMPSs monitor
The COMPSs monitor can be started using the pycompss monitor start
command. This will start the COMPSs monitoring facility which enables to
check the application status while running. Once started, it will show
the url to open the monitor in your web browser
(i.e. http://127.0.0.1:8080/compss-monitor)
Important
Include the --monitor=<REFRESH_RATE_MS>
flag in the execution before
the binary to be executed.
$ pycompss monitor start
$ pycompss run --monitor=1000 -g matmul_files.py 4 4
$ # During the execution, go to the URL in your web browser
$ pycompss monitor stop
If running a notebook, just add the monitoring parameter into the COMPSs runtime start call.
Once finished, it is possible to stop the monitoring facility by using
the pycompss monitor stop
command.
The COMPSs monitor can be started using the pycompss monitor start
command. This will start the COMPSs monitoring facility which enables to
check the application status while running. Once started, it will show
the url to open the monitor in your web browser
(i.e. http://127.0.0.1:8080/compss-monitor)
Important
Include the --monitor=<REFRESH_RATE_MS>
flag in the execution before
the binary to be executed.
$ pycompss monitor start
$ pycompss run --monitor=1000 -g matmul_files.py 4 4
$ # During the execution, go to the URL in your web browser
$ pycompss monitor stop
If running a notebook, just add the monitoring parameter into the pycompss jupyter
call.
Once finished, it is possible to stop the monitoring facility by using
the pycompss monitor stop
command.
Not implemented yet.
Running Jupyter notebooks
Notebooks can be run using the pycompss jupyter
command. Run the
following snippet from the root of the project:
$ cd tutorial_apps/python
$ pycompss jupyter ./notebooks
And access interactively to your notebook by opening following the http://127.0.0.1:8888/ URL in your web browser.
Notebooks can be run using the pycompss jupyter
command. Run the
following snippet from the root of the project:
$ cd tutorial_apps/python
$ pycompss jupyter ./notebooks
A web browser will opened automatically with the notebook.
You could also add any jupyter argument to the command, like for example the port number:
$ pycompss jupyter --port 9999 ./notebooks
In order to run a jupyter notebook in remote, it must be bound to an already deployed app
Let’s deploy another application that contains jupyter notebooks:
$ pycompss app deploy synchronization --source_dir tutorial_apps/python/notebooks/syntax/
The command will be executed inside the remote directory specified at deployment. The path for the selected application will be automatically resolved and the jupyter server will be started and you’ll be promted with the URL of the jupyter web page.
$ pycompss jupyter -app synchronization --port 9999
Job submitted: 19320191
Waiting for jupyter to start...
Connecting to jupyter server...
Connection established. Please use the following URL to connect to the job.
http://localhost:9999/?token=35199bb8917a97ef2ed0e7a79fbfb6e4c727983bb3a87483
Ready to work!
To force quit: CTRL + C
How to use Jupyter in MN4 from local machine with PyCOMPSs CLI?
1st Step (to be done in your laptop)
Create the MN4 environment in the PyCOMPSs CLI:
pycompss init -n mn4 cluster -l <MN4_USER>@mn1.bsc.es
By default, pycompss
creates the local environment, and since the objective
is to run in MN4, this command will create the MN4 environment and set it by
default.
Important
This environment will use the mn1.bsc.es
login node to submit the
job, and the notebook will be started within a MN4 compute node.
2nd Step (to be done in your laptop)
Go to the folder where your notebook is in your local machine.
cd /path/to/notebook/
3rd Step (to be done in your laptop)
Deploy the current folder to MN4 with the following command:
pycompss app deploy mynotebook
This command will copy the whole current folder into your $HOME/.COMPSsApps/
folder, and will be used from jupyter notebook.
It will register mynotebook
name (choose the name that you want), so
that it can be used in the next step.
4th Step (to be done in your laptop)
Launch a jupyter job into MN4 using the deployed folder with name
mynotebook
(or the name defined in previous step):
pycompss jupyter -app mynotebook --qos=debug --exec_time=20
A job will be submitted to MN4 queueing system within the debug
queue and
with a 20 minutes
walltime. Please, wait for it to start.
It can be checked with squeue
from MN4 while waiting, and its expected
start time with squeue --start
command.
This job will deploy the PyCOMPSs infrastructure in the given nodes.
Once started, the URL to open jupyter from your web browser will automatically appear a few seconds after the job started. Output example:
Job submitted: 20480430
Waiting for jupyter to start...
Jupyter started
Connecting to jupyter server...
Connection established. Please use the following URL to connect to the job.
http://localhost:8888/?token=c653b02a899265ad6c9cf075d4882f91d9d372b06132d1fe
Ready to work!
To force quit: CTRL + C
5th Step (to be done in your laptop)
Open the given URL (in some consoles with CTRL + left click) in your local web browser and you can start working with the notebook.
Inside the notebook, PyCOMPSs must be imported, its runtime started, tasks defined, etc.
Please, check the documentation to get help and examples:
Caution
If the walltime of the job is reached, the job will be killed by the queuing system and the notebook will stop working.
6th Step (to be done in your laptop)
Once finished working with the notebook, press CTRL+C
in the console where you
launched the pycompss jupyter
command. This will trigger the job
cancellation.
Generating the task graph
COMPSs is able to produce the task graph showing the dependencies that
have been respected. In order to producee it, include the --graph
flag in
the execution command:
$ cd tutorial_apps/python/simple/src
$ pycompss init docker
$ pycompss run --graph simple.py 1
Once the application finishes, the graph will be stored into the
.COMPSs\app_name_XX\monitor\complete_graph.dot
file. This dot file
can be converted to pdf for easier visualilzation through the use of the
gengraph
parameter:
$ pycompss gengraph .COMPSs/simple.py_01/monitor/complete_graph.dot
The resulting pdf file will be stored into the
.COMPSs\app_name_XX\monitor\complete_graph.pdf
file, that is, the
same folder where the dot file is.
$ cd tutorial_apps/python/simple/src
$ pycompss run --graph simple.py 1
Once the application finishes, the graph will be stored into the
~\.COMPSs\app_name_XX\monitor\complete_graph.dot
file. This dot file
can be converted to pdf for easier visualilzation through the use of the
gengraph
parameter:
$ pycompss gengraph ~/.COMPSs/simple.py_01/monitor/complete_graph.dot
The resulting pdf file will be stored into the
~\.COMPSs\app_name_XX\monitor\complete_graph.pdf
file, that is, the
same folder where the dot file is.
Not implemented yet!
Tracing applications or notebooks
COMPSs is able to produce tracing profiles of the application execution
through the use of EXTRAE. In order to enable it, include the --tracing
flag in the execution command:
$ cd python/matmul_files/src
$ pycompss run --tracing matmul_files.py 4 4
If running a notebook, just add the tracing parameter into pycompss jupyter
call.
Once the application finishes, the trace will be stored into the
~\.COMPSs\app_name_XX\trace
folder. It can then be analysed with
Paraver.
Adding more nodes
Note
Adding more nodes is still in beta phase. Please report issues, suggestions, or feature requests on Github.
To add more computing nodes, you can either let docker create more workers for you or manually create and config a custom node.
For docker just issue the desired number of workers to be added. For example, to add 2 docker workers:
$ pycompss components add worker 2
You can check that both new computing nodes are up with:
$ pycompss components list
If you want to add a custom node it needs to be reachable through ssh
without user. Moreover, pycompss will try to copy the working_dir
there, so it needs write permissions for the scp.
For example, to add the local machine as a worker node:
$ pycompss components add worker '127.0.0.1:6'
‘127.0.0.1’: is the IP used for ssh (can also be a hostname like ‘localhost’ as long as it can be resolved).
‘6’: desired number of available computing units for the new node.
Important
Please be aware** that pycompss components
will not list your
custom nodes because they are not docker processes and thus it can’t be
verified if they are up and running.
Environment not compatible with this feature.
Environment not compatible with this feature.
Removing existing nodes
Note
Removing nodes is still in beta phase. Please report issues, suggestions, or feature requests on Github.
For docker just issue the desired number of workers to be removed. For example, to remove 2 docker workers:
$ pycompss components remove worker 2
You can check that the workers have been removed with:
$ pycompss components list
If you want to remove a custom node, you just need to specify its IP and number of computing units used when defined.
$ pycompss components remove worker '127.0.0.1:6'
Environment not compatible with this feature.
Environment not compatible with this feature.