Running FEBio Jobs in FEBio Studio
Prepared for FEBio Studio2
1. Overview
FEBio is a stand-alone application and can be run from the command line. However, it is often more convenient to run FEBio directly from FEBio Studio. This allows you to monitor the progress and open results of the simulation without leaving FEBio Studio.
There are several ways to invoke FEBio from within FEBio Studio. You can run the built-in version of FEBio; You can start FEBio in a separate process; and you can even run FEBio on a remote cluster. In this article, we’ll discuss in some detail these various options.
2. The Run FEBio Dialog Box
To run an FEBio model in FEBio Studio, open the Run FEBio dialog box by selecting the FEBio\Run FEBio menu, by clicking on the Run FEBio icon in the main toolbar, or by pressing the F5 shortcut.
There are several settings that can be customized before running the job:
- Job name: Set the name of the job. This name will be used as the template from which the default FEBio input and output files will be generated.
- Working directory: Set the location where the files will be written and the job will be started from. By default, it is the jobs folder in the same directoryas the model file is stored.
- Launch Configuration: This selects the configuration used for running FEBio jobs. Custom launch configurations can be created to run FEBio in a separate process or on a remote server.
- FEBio file format: Set the FEBio specification used for generating the FEBio input files.
The advanced settings will be discussed below.
3. Setting the Launch Configuration
The launch configuration determines how, where, and which version of FEBio will be called. FEBio Studio has a version of FEBio built-in, and this will be used in the default launch configuration. If you wish to run FEBio in a separate process, run different versions of FEBio, or wish to run an FEBio job remotely, you can create and configure a new launch configuration.
What are the main differences between these launch configuration types.
- default: The default configuration runs the FEBio version that is built into FEBio Studio. The advantage of this configuration is that any FEBio plugins loaded within FEBio Studio are available in FEBio and don’t require a special configuration file.
- local configuration: This runs FEBio in a separate process on your local machine. A configuration file will be needed if FEBio plugins are needed by the model. The advantage of this approach is that it is safer: when FEBio crashes, FEBio Studio will be able to continue unaffected. This configuration is also required when you wish to run different versions of the FEBio software.
- remote configurations: Remote configurations allow you to run FEBio on a remote cluster. This requires FEBio to be installed on the cluster and configured so that it can be called from a different computer. PBS or similar scripts can be setup from within FEBio Studio.
To edit existing or create new launch configurations, click the Edit Launch Configuration button located on the right side of the dialog next to the Launch Configuration drop-down menu. A new dialog box will appear, called the Launch Configuration Manager. The panel on the left lists your current launch configurations. You can reorder them by clicking and dragging on any of them. You can rename any launch configuration by double-clicking on the name in the list.
3.1. Creating new Local configurations
In the Launch Configuration manager, add a new launch configuration by clicking on the plus icon below the list, and then give it a new name. Select local from the Launch Type option.
Then, enter the path to the FEBio executable (including the executable’s name) in the text field. You can use absolute paths, relative paths, or the command to run the FEBio executable (i.e. what you would type to launch FEBio on a command or terminal window).
3.2. Creating Remote Configurations
Add a new launch configuration by clicking on the plus icon below the list, and then give it a new name (e.g. the name of the server).
On the right, select the type of configuration that you would like to create from the Launch Type drop-down menu. The options are:
- Local: will run your model in FEBio on your machine (section 3.1)
- Remote: will connect to a remote sever and run FEBio directly on that server.
- PSB Queue: will automatically add your job to the PBS queue located on the server that you specify.
- Slurm queue: will automatically add your job to the Slurm queue located on the server that you specify.
After you specify the launch type, fill out the fields that are created below the drop-down menu.
Note that you must enter an existing, absolute path for Remote Directory.
When you have finished editing your launch configurations, press the OK button, then press the Yes button when you are prompted to save your changes. You will now return to the Run FEBio dialog box.
4. Running the job remotely
In the Run FEBio dialog, select your desired launch configuration from the drop-down menu, and then click the Run button.
After you click Run, FEBio Studio will first save the model to a .feb file in the local working directory (which will usually be the jobs folder in the project’s directory). The first time you run a model FEBio Studio will prompt you to create the local working directory, if it does not exist yet. Note that it will store the model locally, even if you selected a remote launch configuration.
If you have chosen a remote launch configuration, you will then be prompted for your password. After the connection to the server was successfully established, your .feb file will be copied to the remote server in the location that you specified in the launch configuration. The job will then be started automatically on the remote server.
4.1. Getting the remote plot and log file
Note that when running a job from FEBio Studio a new item will appear in the model tree that corresponds to your run. If the job is run remotely a button will be shown, labeled “Get Remote Files”.
When the job is run remotely, FEBio Studio will not automatically download the log and plot files to your local machine, even when the job was completed on the server.
At any time after you have started the job, you can download a copy of your .xplt and .log files from the remote server by selecting the job in the Model Tree and the click on the Get Remote Files button. After the transfer is complete, you can open your .xplt file by clicking on either the Open in FEBioStudio button or the Open in PostView button.
If your selected launch configuration was a PBS Queue or Slurm Queue type, then you can use FEBio Studio to check on the status of the remote queue. To do this, select the job in the Model Tree and then click on the Get Queue Status button.