Skip to content

A basic command line tool to configure, execute and analyze FLAME models

Notifications You must be signed in to change notification settings

dkohlweyer/no-fuss-flame

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

No Fuss Flame

No Fuss Flame is a basic command line tool to configure, execute and analyze FLAME models. It automatically parses, builds and runs a FLAME model, reads the output data and creates plots and tables, as specified by the user in a configuration file. It is written in Python and can be used as a wrapper to access data generated by FLAME in any Python project.

System Requirements

  • Existing FLAME installation (xparser+libmboard)
  • Python 3
  • SciPi-Stack
  • pyyaml
  • PTable

1. Install FLAME

wget https://github.com/FLAME-HPC/libmboard/archive/master.zip
unzip master.zip
cd libmboard-master/
bash ./autogen.sh
./configure --disable-parallel --disable-tests
make
sudo make install
cd ../
wget https://github.com/FLAME-HPC/xparser/archive/0.17.1.zip
unzip 0.17.1.zip
cd xparser-0.17.1/
make
cd ../

2. Install Pyton 3 and required packages

sudo apt-get install python3
sudo apt-get install python3-pip
sudo apt-get install python3-tk
sudo apt-get install python3-setuptools
python3 -m pip install --user numpy scipy matplotlib ipython jupyter pandas sympy nose
python3 -m pip install --user pyyaml
python3 -m pip install --user PTable

The configuration file

The configuration file specifies which parameters will be used, what data will be captured and what plots/tables will be generated when executing the model. The configuration file is written in YAML. A minimal working example is the following:

model_path: /home/my_model/		# Path to model folder
model_xml: /home/my_model/model.xml 	# Path to model.xml file
xparser_path: /home/xparser-0.17.1-clean/ 	# Path to xparser folder
base_xml: /home/my_model/0.xml 	# 0.xml file (initial state)
workspace: /home/results/ 	# No Fuss Flame will store all data and results here

iterations: 3000	# Number of iterations per run
output_frequency: 20	# Specifies at which frequency data is captured
runs: 4		# Number of runs per parameter setting

experiments:	# Specify one one more experiments
    my_exp1:
        param1: 1.618
        param2: 42

time_series:	# Specify data output
    Agent1:
        - interesting_variable

There are more options. See the example_config.yaml file for details.

Run a configuration

To run a configuration/model use the following command:

python3 nff-auto.py <config-file>

By default No Fuss Flame uses all available CPUs. The number of CPUs used can be limited by the -n flag. For more options run No Fuss Flame with --help.

Use in a Python project

Import pyflame to your project in order to run FLAME models and analyze output data in Python:

import pyflame

session = pyflame.FlameSession("config_file.yaml")
session.parse_model()
session.compile_model()
session.modify_xml()
session.simulate_model()
session.load_simulated_data()
data = session.disaggregated_data()

About

A basic command line tool to configure, execute and analyze FLAME models

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages