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 Multiphysics 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 Multiphysics 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

The process_output.log file will also display this tunnel information.

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

This tutorial shows you how to use COMSOL Server on Rescale.

You will set up a COMSOL Server by starting a Rescale Job. If you are connecting from your personal workstation, you will create a SSH tunnel to the Rescale-hosted COMSOL server. Finally, you will use a web browser to access COMSOL Server.

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 before starting a COMSOL Server instance. If it's a Rescale Desktop you can skip to the next section.

  • In order for you to be able to securely connect to a COMSOL Server from your workstation, we need to place your security credentials on the server.

  • So the first step is to Generate your SSH Key for your local workstation.

  • 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.

  • This is just a step you need to take once for your account.

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 Server

  • Under Analysis Options, select the software version and do not change the command. Under License Options, select Use Existing License and enter your COMSOL 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.

  • 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 process_output.log file reports that the server is ready, the server process is able to accept incoming requests. The output should look similar to the following text:

Please wait until service is started...

COMSOL Server 5.3a (Build: 180) started listening on port 2036
Use the console command 'close' to exit the program

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 workstation, you will need: Username & Password
  • If the client is a Rescale Desktop, you will need: Username, Password, & Hostname

Creating a Port Forwarding Tunnel from your Personal Workstation

If you intend on connecting to COMSOL Server using your personal workstation instead of a Rescale Desktop, you would first need to set up an SSH Tunnel to the remote cluster running the 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

The process_output.log file will also display this tunnel information. You can start the port-forwarding tunnel before the COMSOL Server process has spun up completely. Also remember to answer yes if the SSH connection asks you to confirm whether or not you want to connect to the server.

**Note: you can open the SSH tunnel to a different local port by changing the first port preceding localhost. The second port should remain 2036 as it is the default port that COMSOL Server will run on in the remote Rescale server. For example, if you initiate the tunnel as: ssh -i </path/to/key> <user>@<ip> -L 8000:localhost:2036 -N -v you will have to navigate to localhost:8000 instead.

Connecting to COMSOL Server from your Personal Workstation

  • Once the server process is up and running and the port-forwarding tunnel session has been established with the Rescale server, COMSOL Server should be accessible from your workstation.

  • Simply open a web browser and navigate to localhost:2036. This should bring up a log in page.

Connecting from a Rescale Desktop

  • If you are connecting to a COMSOL Server from a Rescale desktop, a port forwarding tunnel is unnecessary.

  • You should be able to access the server using the IP address represented in the Hostname output in process_output.log.

    • So if Hostname: ip-xxx-xxx-xxx-xxx is shown, please navigate to xxx.xxx.xxx.xxx:2036 from a web browser

Logging onto COMSOL Server

  • Here simply enter the Username and Password reported in the process_output.log file of the COMSOL Server job.

    • The default user name is rescale.

COMSOL Server Login

  • If you log in successfully, please read the COMSOL license agreement.

COMSOL Server License Agreement

  • If you accept the agreement, the COMSOL Server Application Library should now load:

COMSOL Server Interface

Shutting Down the COMSOL Server Process

  • The COMSOL Server will remain running until the job is stopped by the user. So when you have finished all of your operations, be sure to stop the COMSOL Server job from the Rescale platform.

  • From the Rescale portal, navigate to the job and click on the red 'STOP' button in the upper right hand corner:

Terminate COMSOL Server Job