From your laptop to large-scale simulations with five lines of Python.
Letās break down each step of running a simulation with Inductiva and see how it transforms your typical workflow for the better!
1ļøā£Pick a Cloud Machine -> 2ļøā£Pick Your Simulator -> 3ļøā£Start Your Simulation -> 4ļøā£Stop Your Machine & Analyze Results
At the end of this step-by-step guide you will: š”Master the key commands in the Inductiva simulation workflow. šHave created a python script to run your first simulation.
Before starting, ensure the following:
Save a new file my_inductiva_run.py
import inductiva
In your computerās Terminal, use the command
inductiva resources available
to display a list of machines, including their types, configurations, and capabilities. Alternatively, go to the web Console to check out the list of machines.
Inductiva provides you access to hundreds of cutting-edge cloud machines and empowers you to select the best option for your simulation use-case. These machines cover a wide range of specifications, and provide you with options at different levels of performance and cost. Learn how to navigate performance and price options - Pick a cloud machine for your simulation case
The machine you selected is the first parameter of the command to create the MachineGroup.
cloud_machine = inductiva.resources.MachineGroup(
machine_type="c2d-highcpu-112",
spot=True)
š”This instruction will allocate a group of cloud machines exclusively for you - No queue, No waiting time!
š Python script checkpoint: By this time, your my_inductiva_run.py file should look like this:
import inductiva
cloud_machine = inductiva.resources.MachineGroup(
machine_type="c2d-highcpu-112",
spot=True)
In your computerās Terminal, use the command
inductiva simulators ls
to list the simulators built in Inductiva API, along with their supported versions. Alternatively, go to the website to check out the list of simulators.
Instantiate the selected simulator in your Python script:
reef3d = inductiva.simulators.REEF3D()
š”This will initialize the simulator in your MachineGroup.
š In this guide, weāll be using reef3d, but hereās a cheat sheet for your preferred simulator:
- Go to Inductivaās simulators webpage.
- Click on tableās cell that matches your simulator.
- In that simulatorās webpage, find the code example and copy the command that initializes that simulator.
š Python script checkpoint: By this time, your my_inductiva_run.py file should look like this:
import inductiva
cloud_machine = inductiva.resources.MachineGroup(
machine_type="c2d-highcpu-112",
spot=True)
reef3d = inductiva.simulators.REEF3D()
Once your simulator is set on your MachineGroup, start your simulation and wait for it to finish.
task = reef3d.run(
input_dir="/path/to/my/input/files",
on=cloud_machine)
task.wait()
š”This will:
When your simulation is finished, terminate your cloud machine and download your simulation results.
cloud_machine.terminate()
task.download_outputs()
š”An idle machine still costs you credits. Terminate it after the task is finished to save you compute costs. š”If you donāt do it explicitly, Inductiva will do it for you after a while.
š Python script checkpoint: By this time, your my_inductiva_run.py file should look like this:
import inductiva
cloud_machine = inductiva.resources.MachineGroup(
machine_type="c2d-highcpu-112",
spot=True)
reef3d = inductiva.simulators.REEF3D()
task = reef3d.run(
input_dir="/path/to/my/input/files",
on=cloud_machine)
task.wait()
cloud_machine.terminate()
task.download_outputs()
Your Python script is ready! Letās run your simulation Run your my_inductiva_run.py file, using your preferred option: On your IDE: run the project. On the computerās Terminal: navigate to the location of the .py file:
cd path/to/your/.py/file
and run the file:
python my_inductiva_run.py