You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 5 Next »

forward2 is a bash script to submit from your local machine a batch job to a slurm managed remote cluster and port forwards it back to your local machine.

Useful for jupyter notebook and tensorboard, amongst other things. 

The tool is available by clicking by downloading the following file forward2.tar.gz

To access, use your CINECA HPC username and password.


Usage

Run on your local machine the following command

$ ./forward2 [-u user] [-r resource] sbatchfile [path]
-u, --user username
-r, --resource cluster name (galileo,marconi,m100)
-p, --port port number
-h, --help print this help
sbatchfile: sbatch script to submit that needs to be in the subfolder with the name of the cluster (you can already find some examples)
path: running path where to find your jupyter notebook on the cluster for example (default path: $HOME)

Optionally, user, resource, and port can be defined in a params.sh file located in the resource folder or in the current directory. If even the file is not found, the script asks the values and save them in params.sh.

By default the batch script creates a forward-util directory in your cluster home where to copy the batch script and save the batch ouptut. This default can be changed by setting RESOURCE_HOME in the params.sh file.


Usage example

1. ./forward2 -u marco -r marconi -p 47703 jupyter-conda /marconi_work/cin_staff/marco
2. ./forward2 jupyter-conda -r marconi
3. ./forward2 jupyter-conda /marconi_work/cin_staff/marco
4. ./forward2 -r galileo jupyter-tensorflow2.0
5. ./forward2 -r galileo tensorboard2.0 logs/fit

The script will output the different steps, and finally the instruction to connect, look for logs and end:

== Instructions ==
1. Open a browser at: http://localhost:47703/?token=5cffb394db829a61bf8d9df95def61125c411a5ee7341ed6
2. Something went wrong? Look at logs (see instruction above)
3. Use Control-C to end, cancel job and kill tunnels (twice to skip confirmation).


Add new batch scritps

New batch scripts can be added in the folder corresponding to the cluster name. Since the bash script waits for a token, if this is not written by your application, you must add echo "?token=" >&2 to your batch script, like in the tensorboard example.

  • No labels