JUBE & eocoe_perf Deployment
============================

In the framework of EoCoE, a automatic procedure for performance evaluation has been settled and Metalwalls can benefit from it. The framework has to be installed in the first place. It is a good idea to install all the required material in a shared directory such that all the group can access it.

The procedure in a nutshell:
1. Define a shared directory, that will be referenced as /path/to/shared/dir later on
2. Install [JUBE](http://www.fz-juelich.de/ias/jsc/EN/Expertise/Support/Software/JUBE/JUBE2/_node.html)
3. Install [eocoe_perf](https://gitlab.maisondelasimulation.fr/EOCOE/perf_eval)
4. Create modules for these two tools

**JUBE Installation**

Fetch the latest version. Load the python module you want to use to run JUBE (if needed) and install it in /path/to/shared/dir/JUBE/version
```bash
module load python #Use the appropriate module name
python setup.py install --prefix /path/to/shared/dir/JUBE/version
```
You will get an error because the directory you want to install JUBE into is not part of your PYTHONPATH. Just add the proposed path temporarily to your PYTHONPATH.
```bash
export PYTHONPATH=/path/to/shared/dir/JUBE/version/lib/python2.7/site-packages/
python setup.py install --prefix /path/to/shared/dir/JUBE/version
```
Extract the [archive custom_platforms](/uploads/746628962b2c831c5b1a4fbe7ddf14ab/platform.tgz) in /path/to/shared/dir/JUBE/version/platform directory. It will make available the template job script as well as default parameters for systems that are not part of the official JUBE release.

**eocoe_perf Installation**
```bash
git clone git@gitlab.maisondelasimulation.fr:EOCOE/perf_eval.git
mkdir /path/to/shared/dir/eocoe_perf
cp -r perf_eval/extraction/ /path/to/shared/dir/eocoe_perf/version
```

**Module file for JUBE**
```bash
mkdir -p /path/to/shared/dir/my_modules/JUBE
```
Put the following content in a file whose name is the version number (e.g. /path/to/shared/dir/my_modules/JUBE/2.1.4). Adjust the loaded modules and the current_platform.
```tcl
module-whatis "jube: implements simple worklows to improve reproducibility"

proc ModulesHelp { } {
  puts stderr "-  \$PYTHONPATH modified\n"
  puts stderr "-  \$PATH modified\n"
  puts stderr "-  \$JUBE_INCLUDE_PATH modified\n"
  puts stderr "-  Python module loaded\n"
}

proc ModulesDisplay {} {
}

set jube_path /path/to/shared/dir/JUBE/version

if { [ file exists "$jube_path" ] } {
    prepend-path PYTHONPATH $jube_path/lib
    prepend-path PATH $jube_path/bin
    prepend-path JUBE_INCLUDE_PATH $jube_path/platform/current_platform
    module load python
} else {
    puts stderr "Error:  The directory $jube_path could not be found."
    break
}
```

**Module file for eocoe_perf**
```bash
mkdir /path/to/shared/dir/my_modules/eocoe_perf
```
Put the following content in a file whose name is the version number (e.g. /path/to/shared/dir/my_modules/eocoe_perf/0.3)

```tcl
module-whatis "eocoe_perf: set of jube and python scripts that automates the performance evaluation process"

proc ModulesHelp { } {
  puts stderr "-  \$PATH modified\n"
  puts stderr "-  \$JUBE_INCLUDE_PATH modified\n"
}

proc ModulesDisplay {} {
}

set eocoe_perf_path /path/to/shared/dir/eocoe_perf/version

if { [ file exists "$eocoe_perf_path" ] } {
    prepend-path PATH $eocoe_perf_path
    prepend-path JUBE_INCLUDE_PATH $eocoe_perf_path
    module load JUBE
} else {
    puts stderr "Error:  The directory $eocoe_perf_path could not be found."
    break
```
