# calc

`Usage: ./calc <run> [<combo> [<needssams>]] [<host> <username> <pass> <datadb> <outputdb>]`

This program calculates the total resource usage and exceeds for one or many combinations of racks. It is the main part of PLUM; the part that actually does the utilization modeling.

Calc can be run in two different modes. One mode runs a single combination; the other runs many combinations that were selected and placed in the database by combogen. The first mode completes in about a second, the second mode should take about one second for every 36 combinations, for an approximate runtime of 15 minutes for a full-up (1000 combos for 33 points) run.

Parameters:

- run: The idx of the run that calc is running. Even needed for single combo.
- combo: A string of 1s and 0s that makes up the combination for single combination mode.
- needssams: 1 if the combination needs SAMS, 0 otherwise.
- host: The machine the database server is running on.
- username: The username for the database server.
- pass: The password for the database server.
- datadb: The name of the database that has the rack data in it.
- outputdb: The name of the database that is being used for PLUM run output.