RETURN
Simulation
January 2022

LMGC-90 on Qarnot Cloud

LMGC90 is a free and open source software dedicated to multiple physics simulation of discrete material and structures. A list of publications which used the software can be found here. The documentation can be found here.

Versions

Versions available on Qarnot's cloud plateform:

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

Prerequisites

Before launching a computation task, please ensure that the following prerequisites have been met:

Test Case

We use an example provided by LMGC90 team of a brick wall. You need to unzip this folder to be able to use it on Qarnot Cloud.

Launching the case

Copy the following code in a Python script and save it next to the lmgc90_wall_example folder you unzipped before. Be sure you have copied your authentication token in the script (instead of <<<MY_SECRET_TOKEN>>>) to be able to launch the task on Qarnot.

lmgc90.py

#!/usr/bin/env python3

# Import the Qarnot SDK
import qarnot

# Create a connection
conn = qarnot.Connection(client_token = '<<<MY_SECRET_TOKEN>>>')

# Create a task
task = conn.create_task('lmgc90_Wall_Example', 'docker-batch', 1)

# Create a resource bucket and add iput files 
input_bucket = conn.create_bucket('lmgc90_input')
input_bucket.sync_directory('lmgc90_wall_example/')

# Attach the bucket to the task
task.resources.append(input_bucket)

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

# Set the command to run when launching the container, by overriding a constant.
# Task constants are the main way of controlling a task's behaviour
task.constants['DOCKER_REPO'] = 'qarnotlab/lmgc90'
task.constants['DOCKER_TAG'] = '2021'
task.constants['DOCKER_CMD'] = 'sh -c "export OMP_SCHEDULE=STATIC && \
				export OMP_NUM_THREADS=$(\
					cat /proc/cpuinfo | grep -i "^processor" | wc -l) &&\
				export OPENBLAS_NUM_THREADS=1 &&\
				python3 command.py"'

# Submit the task and download results
task.run(output_dir = "output")

Make sure that all input files are in the same folder named lmgc90_wall_example. Your working directory should look like this:

To launch this script, open a terminal in your working directory and execute python3 lmgc90.py &. It will launch the execution of lmgc90 on Qarnot and wait until the execution is over to download the results.

Results

At any given time, you can monitor the status of your task. You should now have an output folder in your working directory on your computer and a lmgc90_output bucket on Qarnot’s Tasq containing all output files. It should comport 3 directories:

The ASCII files in POSTPRO directory result from the commands in the DATBOX/POSTPRO.DAT file. To have more information on how to use this features read this document. The files inside the DISPLAY directory can be visualized with paraview. It is advised to read the .pvd files which ensure time consistency. The different output files are:

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

Return

Our articles