COMSOL

This tutorial shows you how to use COMSOL's Client-Server mode of operation in Rescale. You will be able to access Rescale's cloud computing resources while still using the COMSOL software and graphics in your client machine.

If you use your personal workstation as the client:

You will set up a COMSOL Multiphysics Server in the form of a Rescale Job. Then, create an SSH tunnel connection in your personal workstation to securely transfer your data to the Rescale-hosted COMSOL server. Finally, you will use the COMSOL GUI to connect to this server, carry out your workflow, and disconnect/shut-down when finished.

If you use a Rescale Desktop as the client:

You will set up a COMSOL Multiphysics Server in the form of a Rescale Job. Then you will spin up a Rescale Desktop that will directly connect to the server without SSH. Finally, you will use the COMSOL GUI to connect to this server, carry out your workflow, and disconnect/shut-down when finished.

Generating your SSH key (Required only if Client is your Personal Workstation)

If the client machine is your personal workstation, you need to follow the directions in this section. If it's a Rescale Desktop you can skip to the next section.

  • Before setting up the COMSOL server, you must first Generate your SSH Key for your client computer.

  • Next, add the SSH key to your Rescale account to Configure your Job Settings. This setting will not only let you connect to the COMSOL server but also to any running clusters of your job submissions from your personal workstation.

Setting up COMSOL Server in Rescale

  • Go onto the Rescale platform and click + New Job to create a new job.

  • You do not need to add input files therefore you can skip the Input Files page.

  • Move onto the Software Settings page. In the Configure Software Settings section, select COMSOL Multiphysics Server.

COMSOL Server Setup software settings

  • Under Analysis Options, select the software version and do not change the command. Under License Options, select Use Existing license and enter your COMSOL Multiphysics Server license address

  • Move onto the Hardware Settings page. Here, specify the core type and the number of cores for this server. These comprise the compute resources available for solving your models.

COMSOL Server Setup hardware settings

  • Review the job settings and click Submit. Your cluster will now take a few minutes to spin up. Please use the live-tailing section to monitor the process_output.log file. Once the log looks like the one in the screenshot below, your server is ready to receive jobs.

COMSOL Server ready
From your process output.log file, you will need the following information to connect to the COMSOL server. At approximately lines 3,4, & 5 of the log, you can find the server information.

  • If the client is your computer, you will need: Username & Password
  • If the client is a Rescale Desktop, you will need: Username, Password, & Hostname

Connecting from your Personal Workstation

If you are using your personal workstation, you would first need to set up an SSH tunnel to the remote cluster (COMSOL server).

For Windows:

Ensure Pageant is running and that your private key is added. Next open a command prompt and enter the following command:

plink -ssh <user>@<ip> -L 2036:localhost:2036 -N -v

For Linux:

ssh -i </path/to/key> <user>@<ip> -L 2036:localhost:2036 -N -v

Note: you can extract the <user>@<ip> information under the "Job Logs" section on the Status Page of the Rescale Web UI.

COMSOL Server User ID & IP

When prompted to trust the host and store the key in cache, enter 'y' or 'yes'.

Lastly, return to the COMSOL GUI running in your personal workstation. Go to File > COMSOL Multiphysics Server > Connect to Server.

Enter the Username and Password information that you gathered from your running server in the process_output.log file as in the example below. Click OK and your Client-Server connection will be established.

COMSOL Workstation Client Connect

Connecting from a Rescale Desktop

If you would like to use a Rescale Desktop, you will just need to spin up a new custom Desktop and add a COMSOL Multiphysics GUI software. You can upload any files from your personal workstation to your Rescale File Storage which you can then download to your active Desktop.

You can find a guide on how to set up a desktop session here.

COMSOL Rescale Desktop Configuration

Once you are in your active Desktop session, launch the COMSOL Multiphysics GUI from the Windows Desktop. Go to File > COMSOL Multiphysics Server > Connect to Server.

Enter the Username, Password, and Hostname (under Server) information that you gathered from your running server in the process_output.log file as in the example below. Click OK and your Client-Server connection will be established.

COMSOL Rescale Desktop Client Connect

Saving your Model, Disconnecting and Shutting Down from the Server

  • When you connect to the COMSOL server, you may be asked if you want to save your current model. We recommend that you respond yes to get the most current version of your model transferred to the server. If you answer no, the latest saved copy of your model is transferred to the server.

  • When you connect to a server, your model is transferred to the server by default. If there is already a model in the server, you may be asked if you want to work with your current model in the desktop or the model on the server.

  • If you wish to disconnect/shut-down from your server, go to File > COMSOL Multiphysics Server > Disconnect from Server. To terminate your Rescale-hosted COMSOL server, you must do it here by pressing Shut Down.

COMSOL Server Disconnect/Shut-Down