... | ... | @@ -4,39 +4,37 @@ In this tutorial, we will explore PhysiCell-X’s capabilities to run simulation |
|
|
|
|
|
## Installing the code
|
|
|
|
|
|
To start the installation, the user must download the PhysiCell-X source code from this repository (https://gitlab.bsc.es/gsaxena/physicell_x). The project can be either cloned or downloaded in zip format, where the user will need to unzip the file in order to proceed with the installation.
|
|
|
Due to the fact that PhysiCell-X has minimal requirements (limiting the incorporation of third-party-libraries), its installation becomes very easy for the user. One of the few requirements in this specific release is the installation of the openMPI libraries, in order to properly compile the code and, in execution time, to manage simulations that require more than one computing node.
|
|
|
To start the installation, the user must download the PhysiCell-X source code from this repository (<https://gitlab.bsc.es/gsaxena/physicell_x>). The project can be either cloned or downloaded in zip format, where the user will need to unzip the file in order to proceed with the installation. Due to the fact that PhysiCell-X has minimal requirements (limiting the incorporation of third-party-libraries), its installation becomes very easy for the user. One of the few requirements in this specific release is the installation of the openMPI libraries, in order to properly compile the code and, in execution time, to manage simulations that require more than one computing node.
|
|
|
|
|
|
## Compiling the code
|
|
|
|
|
|
PhysiCell-X has a number of use cases to provide the user with examples to guide them through the process of designing their own simulations. The available use cases can be listed using the following command.
|
|
|
PhysiCell-X has a number of use cases to provide the user with examples to guide them through the process of designing their own simulations. The available use cases can be listed using the following command.
|
|
|
|
|
|
```
|
|
|
```plaintext
|
|
|
> make list-projects
|
|
|
```
|
|
|
|
|
|
```
|
|
|
```plaintext
|
|
|
Sample projects: template biorobots-sample cancer-biorobots-sample cancer-immune-sample
|
|
|
celltypes3-sample heterogeneity-sample pred-prey-farmer virus-macrophage-sample worm-sample
|
|
|
|
|
|
Sample intracellular projects: ode-energy-sample physiboss-cell-lines-sample cancer-metabolism-sample
|
|
|
```
|
|
|
|
|
|
For this tutorial, we will focus on the "heterogeneity-sample" example, which deals with the simulation of a heterogeneous population of tumour cells.
|
|
|
In order to compile the example, we use the following commands:
|
|
|
For this tutorial, we will focus on the "heterogeneity-sample" example, which deals with the simulation of a heterogeneous population of tumour cells. In order to compile the example, we use the following commands:
|
|
|
|
|
|
```
|
|
|
```plaintext
|
|
|
> make heterogeneity-sample
|
|
|
> make
|
|
|
```
|
|
|
|
|
|
After compilation, we should see an executable created in the same folder and called "heterogeneity". This binary allows us to run the example, having "results" as the default output folder. But before running the example, we should take a look at the configuration file config/PhysiCell_settings.xml.
|
|
|
|
|
|
```
|
|
|
```plaintext
|
|
|
> vim config/PhysiCell_settings.xml
|
|
|
```
|
|
|
|
|
|
```
|
|
|
```plaintext
|
|
|
…
|
|
|
<overall>
|
|
|
<max_time units="min">64800</max_time>
|
... | ... | @@ -55,29 +53,23 @@ By editing this file we can set most of the essential parameters in a PhysiCell- |
|
|
|
|
|
To run the heterogeneity-sample project we just have to execute the binary
|
|
|
|
|
|
```
|
|
|
```plaintext
|
|
|
> ./heterogeneity
|
|
|
```
|
|
|
|
|
|
After starting the simulation, the user can see the course of the simulation through the log messages emitted to the standard output. In addition, a set of output files describing the main characteristics of each cell, as well as the density of each of the substrates along the physical space used in the simulation, will be progressively generated in the results folder. These files are created by using the MultiCellDS standard format, composed mainly of an .m file and an xml file (see for more information <http://www.mathcancer.org/blog/working-with-physicell-snapshots-in-matlab/>). In addition, PhysiCell-X additionally stores a series of SVG files that graphically describe the position of each of the simulated cells, of great interest when the user needs to generate movies to visualize the full course of the simulation.
|
|
|
|
|
|
After starting the simulation, the user can see the course of the simulation through the log messages emitted to the standard output. In addition, a set of output files describing the main characteristics of each cell, as well as the density of each of the substrates along the physical space used in the simulation, will be progressively generated in the results folder. These files are created by using the MultiCellDS standard format, composed mainly of an .m file and an xml file (see for more information http://www.mathcancer.org/blog/working-with-physicell-snapshots-in-matlab/). In addition, PhysiCell-X additionally stores a series of SVG files that graphically describe the position of each of the simulated cells, of great interest when the user needs to generate movies to visualize the full course of the simulation.
|
|
|
|
|
|
|
|
|
![Slice of heterogeneity sample cell culture. ](heterogeneity.png)
|
|
|
|
|
|
|
|
|
![Slice of heterogeneity sample cell culture. ](https://gitlab.bsc.es/gsaxena/physicell_x/-/blob/master/documentation/images/heterogeneity.png)
|
|
|
|
|
|
## Working on a cluster
|
|
|
|
|
|
In order to use the full computational capabilities of PhysiCell-X in a professional HPC environments, it is recommended to run PhysiCell-X through a queuing system, such as Slurm. This approach allows HPC facilities to efficiently manage the available computational resources, usually shared between different users.
|
|
|
If we want to launch a PhysiCell-X execution with Slurm, we will first need to create the corresponding batch file, where the user usually defines the specific resources that are required to properly run the simulation. To do this, we can create the file as follows:
|
|
|
In order to use the full computational capabilities of PhysiCell-X in a professional HPC environments, it is recommended to run PhysiCell-X through a queuing system, such as Slurm. This approach allows HPC facilities to efficiently manage the available computational resources, usually shared between different users. If we want to launch a PhysiCell-X execution with Slurm, we will first need to create the corresponding batch file, where the user usually defines the specific resources that are required to properly run the simulation. To do this, we can create the file as follows:
|
|
|
|
|
|
```
|
|
|
```plaintext
|
|
|
> vim batch_test
|
|
|
```
|
|
|
|
|
|
|
|
|
```
|
|
|
```plaintext
|
|
|
#!/bin/bash
|
|
|
#SBATCH -n 4
|
|
|
#SBATCH -t 60:00
|
... | ... | @@ -89,27 +81,25 @@ If we want to launch a PhysiCell-X execution with Slurm, we will first need to c |
|
|
./heterogeneity
|
|
|
```
|
|
|
|
|
|
|
|
|
In this case, we are requiring a node with 4 cores, with a maximum of execution of 60 minutes, having as standard and error output files "test.out" and "test.err" respectively. Once created, we can finally send the job by using the “sbatch” command.
|
|
|
|
|
|
```
|
|
|
```plaintext
|
|
|
> sbatch batch_test
|
|
|
```
|
|
|
|
|
|
Then, we can check the status of the simulation by using the following command.
|
|
|
|
|
|
```
|
|
|
```plaintext
|
|
|
> squeue
|
|
|
```
|
|
|
|
|
|
|
|
|
The PhysiCell-X tool integrates MPI technologies to implement distributed computing. In this case, we have to include additional fields into our batch test file to run the simulation as a MPI execution.
|
|
|
|
|
|
```
|
|
|
```plaintext
|
|
|
> vim batch_mpi_test
|
|
|
```
|
|
|
|
|
|
```
|
|
|
```plaintext
|
|
|
#!/bin/bash
|
|
|
#SBATCH --nodes=2
|
|
|
#SBATCH --ntasks-per-node=1
|
... | ... | @@ -125,17 +115,15 @@ mpiexec --map-by ppr:1:node:pe=4 ./heterogeneity |
|
|
|
|
|
Once created, we can finally send the job:
|
|
|
|
|
|
```
|
|
|
```plaintext
|
|
|
> sbatch batch_mpi_test
|
|
|
```
|
|
|
|
|
|
|
|
|
## How to continue learning
|
|
|
|
|
|
The following links redirect the users to interesting tutorials where they can learn how to design a simulation with PhysiCell’ ecosystem tools.
|
|
|
|
|
|
|
|
|
- [Building and running the standard PhysiCell sample projects](http://www.mathcancer.org/blog/physicell-sample-projects/)
|
|
|
- [Loading and viewing PhysiCell digital snapshots in Matlab](http://www.mathcancer.org/blog/working-with-physicell-snapshots-in-matlab/)
|
|
|
- [User-defined model parameters in PhysiCell XML configuration files](http://www.mathcancer.org/blog/user-parameters-in-physicell/)
|
|
|
- [Setting up the microenvironment with the XML configuration file](http://mathcancer.org/blog/setting-up-the-physicell-microenvironment-with-xml) |
|
|
\ No newline at end of file |
|
|
* [Building and running the standard PhysiCell sample projects](http://www.mathcancer.org/blog/physicell-sample-projects/)
|
|
|
* [Loading and viewing PhysiCell digital snapshots in Matlab](http://www.mathcancer.org/blog/working-with-physicell-snapshots-in-matlab/)
|
|
|
* [User-defined model parameters in PhysiCell XML configuration files](http://www.mathcancer.org/blog/user-parameters-in-physicell/)
|
|
|
* [Setting up the microenvironment with the XML configuration file](http://mathcancer.org/blog/setting-up-the-physicell-microenvironment-with-xml) |
|
|
\ No newline at end of file |