RETURN
Simulation
September 2022

Star-CCM+ on Qarnot Cloud

Star-CCM+ is a multiphysics software for the simulation of products operating under real-world conditions. Simcenter STAR-CCM+ uniquely brings automated design exploration and optimization to the CFD simulation toolkit of every engineer*.

Here is a quick step by step walkthrough to guide you through the different steps of how to run a Star-CCM+ test case on Qarnot, so follow along!

License

In order to launch a Starccm simulation on Qarnot, you must grant Qarnot access to your license. For more details, please reach out to our team at qlab@qarnot-computing.com.

We will assume your license setup with us is already complete from this point on.

Versions

Here are the currently available versions on Qarnot: (dual when mixed and double are available)

If you are interested in another version, please send us an email at qlab@qarnot-computing.com.

Prerequisites

Before starting a calculation with the Python SDK, a few steps are required:

Note: in addition to the Python SDK, Qarnot provides C# and Node.js SDKs and a Command Line.

Test case

This test case will walk you through how to launch the cylindre_complet_extrusion_both_demi_DP_reconstruit_init model on Star-CCM+. The input files can be downloaded from the following archive.

cylindre_complet_extrusion_both_demi_DP_reconstruit_init.sim

Once you have downloaded the file, put it under a directory named input.

Launching the test-case

Once everything is set up, use the following run-starccm.py script to launch the computation on Qarnot.

"""Script to run a STAR-CCM sample computation on Qarnot cloud"""

import qarnot
from qarnot.scheduling_type import OnDemandScheduling

# =============================== Setup Variables =============================== #
# To change
CLIENT_TOKEN="MY_SECRET_TOKEN"
PROFILE="YOUR_PROFILE"

# If needed
TASK_NAME='RUN SAMPLE - STARCCM'
STARCCM_VERSION="19.04.009"
NB_INSTANCES = 1
STARCCM_CMD="starccm+ -power -batch run cylindre_complet_extrusion_both_demi_DP_reconstruit_init_c4056f43d7.sim"

# Optional - Multi node simulation
# NB_INSTANCES = 2
# STARCCM_CMD="starccm+ -power -batch -mpi openmpi -mpiflags \"--mca btl ^openib,tcp --mca pml ucx --mca osc ucx\" -machinefile /job/mpihosts run cylindre_complet_extrusion_both_demi_DP_reconstruit_init_c4056f43d7.sim"

# =============================================================================== #

# Create a connection, from which all other objects will be derived
conn = qarnot.connection.Connection(client_token=CLIENT_TOKEN)

# Create task
task = conn.create_task(TASK_NAME, PROFILE, NB_INSTANCES)

# Create the input bucket and synchronize with a local folder
input_bucket = conn.create_bucket('starccm-in')
input_bucket.sync_directory('input')
task.resources.append(input_bucket)

# Create a result bucket and attach it to the task
output_bucket = conn.create_bucket('starccm-out')
task.results = output_bucket

# Configure task parameters
task.constants['STARCCM_CMD'] = STARCCM_CMD
task.constants['DOCKER_TAG'] = STARCCM_VERSION

# Optional parameters
# Number of processes per node in the mpihost file, e.g. "26" out of 28 cores.
# task.constants['SETUP_CLUSTER_NB_SLOTS'] = "26"

# Define interval time in seconds when your simulation will be saved to your bucket.
# task.snapshot(900)

# OnDemand setup
# task.scheduling_type=OnDemandScheduling()

task.submit()

# ---------- Optional ----------

OUTPUT_DIR="cylindre-out"

# The following will download result to the OUTPUT_DIR 
# It will also print the state of the task to your console
LAST_STATE = ''
SSH_TUNNELING_DONE = False
while not SSH_TUNNELING_DONE:
    if task.state != LAST_STATE:
        LAST_STATE = task.state
        print(f"** {LAST_STATE}")

    # Wait for the task to be FullyExecuting
    if task.state == 'Success':
        task.download_results(OUTPUT_DIR, True)
        SSH_TUNNELING_DONE = True

    # Display errors on failure
    if task.state == 'Failure':
        print(f"** Errors: {task.errors[0]}")
        SSH_TUNNELING_DONE = True

To launch the computation on Qarnot, save the above code as a Python script in your working directory. Before running it, make sure to update the following constants at the beginning of the script:

Once this is done, your files should look like this:

├─ input/
│  ├─ cylindre_complet_extrusion_both_demi_DP_reconstruit_init_c4056f43d7.sim
├─ run-starccm.py

To launch this script, simply execute python3 run-starccm.py in your terminal.

Launching a Starccm task with SSH connectivity enabled

Here is an example of how to run a Starccm simulation with SSH activated on the platform. You will need:

"""Script to run a STAR-CCM sample with SSH connectivity on Qarnot cloud"""

import qarnot
from qarnot.scheduling_type import OnDemandScheduling

# =============================== Setup Variables =============================== #
# To change
CLIENT_TOKEN="MY_SECRET_TOKEN"
PROFILE="YOUR_SSH_PROFILE"
SSH_PUBLIC_KEY="YOUR_SSH_PUBLIC_KEY"

# If needed
TASK_NAME='RUN SAMPLE SSH - STARCCM'
STARCCM_VERSION="19.04.009"
NB_INSTANCES = 1
STARCCM_CMD="starccm+ -power -batch run cylindre_complet_extrusion_both_demi_DP_reconstruit_init_c4056f43d7.sim"

# Optional - Multi node simulation
# NB_INSTANCES = 2
# STARCCM_CMD="starccm+ -power -batch -mpi openmpi -mpiflags \"--mca btl ^openib,tcp --mca pml ucx --mca osc ucx\" -machinefile /job/mpihosts run cylindre_complet_extrusion_both_demi_DP_reconstruit_init_c4056f43d7.sim"

# =============================================================================== #

# Create a connection, from which all other objects will be derived
conn = qarnot.connection.Connection(client_token=CLIENT_TOKEN)

# Create task
task = conn.create_task(TASK_NAME, PROFILE, NB_INSTANCES)

# Create the input bucket and synchronize with a local folder
input_bucket = conn.create_bucket('starccm-in')
input_bucket.sync_directory('input')
task.resources.append(input_bucket)

# Create a result bucket and attach it to the task
output_bucket = conn.create_bucket('starccm-out')
task.results = output_bucket

# Configure task parameters
task.constants['STARCCM_CMD'] = STARCCM_CMD
task.constants['DOCKER_TAG'] = STARCCM_VERSION
task.constants['DOCKER_SSH'] = SSH_PUBLIC_KEY

# Optional parameters
# Set to 'true' to keep cluster alive once your simulation is done.
task.constants['NO_EXIT'] = "false" 

# Number of processes per node in the mpihost file, e.g. "26" out of 28 cores.
# task.constants['SETUP_CLUSTER_NB_SLOTS'] = "26"

# Define interval time in seconds when your simulation will be saved to your bucket.
# task.snapshot(900)

# OnDemand setup
# task.scheduling_type=OnDemandScheduling()

task.submit()

To launch the computation on Qarnot, save the above code as a Python script in your working directory. Before running it, make sure to update the following constants at the beginning of the script:

And now, you can execute python3 run-ssh.py.

To have details about starccm usage on Qarnot, please see our documentation. You will find useful tips about MPI clustering and available parameters.

Monitoring

At any given time, you can monitor the status of your task on Tasq.

On this page you can monitor your instances states, logs or execution time and check your task configuration you set up such as a profile name, the Starccm version or your SSH key.

In case of an SSH task, IP and port can be found under the Port Forward section.

Results

You should now have an output folder in your working directory on your computer and a starccm_out bucket in Tasq containing all output files.

You can visualize some images generated by the simulation that can be found in the images/ directory in your output bucket. Bellow is a preview of one of them.

Your results will be stored in the starccm-out bucket and can be retrieved with three methods:

Wrapping up

That’s it! If you have any questions, please contact qlab@qarnot-computing.com and we will help you with pleasure!

Star-CCM+ definition source*

Return

Our articles