# CES Adapted slurm_simulator_tools This repo provides a tweaked and adapted version of BSC-RM's [slurm_simulator_tools](https://github.com/BSC-RM/slurm_simulator) with user support as seen at [UBCCR's simulator](https://github.com/ubccr-slurm-simulator/slurm_simulator). An associated [Docker Image](https://earth.bsc.es/gitlab/mgimenez/docker-ubuntu-ces-slurm-sim) was developed, which is meant to work out of the box. Regardless, if you prefer to installit manually, we provide the dependencies. BSC-CNS - Earth Sciences - Computational Earth Sciences group Manuel Giménez de Castro Marciani ([manuel.gimenez@bsc.es](mailto:manuel.gimenez@bsc.es)) ## Dependencies This is a comprehensive list of dependencies. Assuming you are installing to ubuntu (debian): - make (4.2.1-1.2) - automake (1:1.16.1-4ubuntu6) - autoconf (2.69-11.1) - gcc (4:9.3.0-1ubuntu2) - g++ (4:9.3.0-1ubuntu2) - libcurl4 (7.68.0-1ubuntu2.18) - debianutils (4.9.1) - libglib2.0-dev (2.64.6-1~ubuntu20.04.4) - libgtk2.0-dev (2.24.32-4ubuntu4) - mariadb-server (1:10.3.38-0ubuntu0.20.04.1) - mariadb-client (10.3.38-0ubuntu0.20.04.1) - libmariadbd-dev (1:10.3.38-0ubuntu0.20.04.1) - libpam0g-dev (1.3.1-5ubuntu4.6) - bzip2 (1.0.8-2) - libtool (2.4.6-14) - libncurses-dev (6.2-0ubuntu2) - libgdm1 (3.36.3-0ubuntu0.20.04.4) - libffi7 (3.3-4) - zlib1g-dev (1:1.2.11.dfsg-2ubuntu1.5) - zlib1g (1:1.2.11.dfsg-2ubuntu1.5) - locales (2.31-0ubuntu9.9) - python (3.8.2-0ubuntu2) Moreover, there is one python dependency - pandas (2.0.1) ## Installation To install the Simulator: - Install dependencies - Run: ./install_slurm_sim.sh - Restart the machine ## Configuration This simulator is adapted from [the original](https://github.com/BSC-RM/slurm_simulator) because we add user accounting. In order to do so, we need to create and configure the database. Launch your sql server (either mysql or mariadb) and ```sql CREATE DATABASE slurm_acct_db; GRANT USAGE ON *.* to 'root'@'localhost'; GRANT ALL PRIVILEGES on slurm_acct_db.* to 'root'@'localhost'; FLUSH PRIVILEGES; ``` WARNING: Since this repo is prepared to be ran in a docker image, it is ran by `root`. ## Input This simulator uses SWF input, which is a [workload format](https://www.cs.huji.ac.il/labs/parallel/workload/swf.html) proposed by prof. Dror Feitelson. ## Output Script `install/slurm_varios/trace.sh.template` is launched everytime a job has ended in slurm, and it handles the output format. By the original developers, the output format is: ``` JobId=$JOBID UserId=$UID GroupId=$GID Name=$JOBNAME JobState=$JOBSTATE Partition=$PARTITION TimeLimit=$LIMIT SubmitTime=$SUBMIT StartTime=$START EndTime=$END NodeList=$NODES NodeCnt=$NODECNT ProcCnt=$PROCS WorkDir=$WORK_DIR Backfilled=$BACKFILLED" ``` Feel free to change it however you prefer. ## Running the simulation Once everything is configured, the whole simulation is handled by the script `run_simulation.py`, which is comprised of - starting `slurmdbd` - configuring simulated users - adapting swf format to binary to feed `sim_mgr` process - configuring each folder where the simulation will be held In order to run a simulation run ```bash python3 run_simulation.py ``` ## Acknowledgement If you use this software on a paper, cite the [original authors](https://github.com/BSC-RM/slurm_simulator) of it: "Evaluating SLURM Simulator with Real-Machine SLURM and Vice Versa", Ana Jokanovic, Marco D'Amico, Julita Corbalan, Performance Modeling, Benchmarking and Simulation of High Performance Computer Systems (PMBS18)At: ACM/IEEE Supercomputing 2018 (SC18), Dallas, TX, USA