Welcome to Qarnot Cloud
Discover our work, our latest news, and tips
to optimize your computation

go to
< Back

SpecFem3d on Qarnot Cloud – documentation

by Thomas Badts - March 6, 2023 - Documentation
SpecFem3d on Qarnot Cloud – documentation


SpecFem3D Cartesian is an open source software for seismic wave propagation in 3D. It is based upon the Spectral Elements Method, encompasses its own mesher and can also perform Full Waveform Inversion among other things. It is flexible and powerful enough to run seismic simulations at a local and regional scale. The software was developed by researchers from the CNRS, Princeton and ETH Zürich since the late 90’s.


Versions available on Qarnot’s cloud platform.

Release year Version
2021 3.0

If you are interested in another version, please send us an email at


Before launching the case, please ensure that the following prerequisites have been met.

Test cases

We will be running one of the toy examples that can be found from the official SpecFem3d git repository. This simulation demonstrates how SpecFem3D works with coupled acoustic/elastic domains by simulating a seismic source inside a coffee cup. The mesh is already provided in this case.

The example folder contains :

  • A DATA folder containing :
    • Par_file : input file configuration
    • STATIONS : coordinates of the receivers that will output time recordings
    • CMTSOLUTION : source definition
  • MESH-default : mesh files
  • : batch script that will be running SpecFem3D on Qarnot.

We will run 2 slightly different versions of the same example, hence you can download scripts to run these examples from the archive just below. You need to unzip this folder to be able to use it.

Launching a batch case

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

  • Please ensure that you have created a Qarnot account here.
  • Retrieve the authentication token here
  • Install Qarnot’s Python SDK here

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

Copy the following code in a Python script and save it next to the input 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.

Please unzip the input folder, copy the preceding code into a python script named, for example, and make sure that your tree view looks like :

  • test_case_qarnot_specfem3d
    • DATA
    • MESH-default

Now simply run the python script from your terminal and it will launch a SpecFem3D simulation on the platform.

Results – batch

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

Once the task is deployed, it should take around 5 minutes to run, and a few more to download the results to your computer. At any time you can monitor  You can visualize the AVS_movie_*.inp files using Paraview or any other viewer that supports the format. You can also use our Paraview Web payload to view the results online if needed. It must look something like this :

Animation of ground velocity on our test case

Launching a cluster case

Now that you know how to launch a “batch” case, we will now demonstrate the same “mug” simulation test case but running it simultaneously on a cluster of 2 instances.

Please unzip the input folder and make sure that your tree view looks like :

  • test_case_qarnot_specfem3d
    • DATA
    • MESH

The script will run the simulation on the Qarnot platform and output the result in the ‘sf3d_cluster_results’ on your computer once it is completed. You should be able to view the same results as the previous case using Paraview.

Wrapping up

That’s it! If you have any questions, please contact and we will help you with pleasure!
You can read a more detailed article on this use case : Seismic simulations on Qarnot Cloud – SPECFEM3D


Leave a Reply

Your email address will not be published.