Persistent Wrapper

From WaterWiki

Jump to: navigation, search

PERSISTENT PARALLEL EPANET WRAPPER FOR SOURCE IDENTIFICATION PROBLEM


INTRODUCTION:


'pepanet' is the simulation component in our Simulation-Optimization framework. The communication between components is done through files. This program enables us to run water quality simulations using source characteristics from an input file and returns the results through an output file. The program is persistent in that it doesn't exit between different instantiations. So it processes a series of input files and delivers corresponding output files. After processing one input file, the wrapper waits for the next file. When it detects that the next file is created, it continues processing and so on till termination.

Thus, the optimization component (mga) creates an input file, the simulation component(pepanet) waits for the input file, processes it and generates the output file. 'mga' then reads the output file, generates the next input file for 'pepanet' to process and so on.



ARGUMENTS:


Command line arguments:

   InfilePrefix OutfilePrefix TimeLimit(in seconds) StartCount EndCount
   Eg. ./pepanet input output 300 1 5
  • The prefixes for input and output files are useful for processing a sequence of input files. Eg. input1.txt, input2.txt etc...
  • The starting count will be used to look for the first file. Eg.if start count is 1, then first file will be input1.txt
  • The end counter is used as a terminating condition. Eg. if end count is 100, the wrapper exits after evaluating input100.txt
  • The wallclock time limit is also used as a terminating condition. If the time expires, then the wrapper exits.

Hence the terminating condition is an either-or condition where the wrapper exits when time expires or after evaluating the last input file.



BUILD:


Modify the makefile if needed with the appropriate compiler in your environment.

Run 'make' or 'make pepanet'.



RUN:


Teragrid: Modify tg.pbs and use 'qsub tg.pbs'.

IMPORTANT: In your job script, use the wall clock limit requested as the command-line argument for 'pepanet' and the start and end counts are taken from the Optimization component.

Ensure that the correct directory of 'pepanet' is noted in variable 'FILEPATH' in the script epanet.sh(in current dir).


Method:


It first calculates the concentration values at the observation nodes for each timestep using the correct source(s) characteristics. Then it calculates the concentration values at the observation nodes for each timestep using the trial source parameters from the input file. During any such trial, the program calculates the difference(delta) between the current and expected concentration values for each observation well for every timestep.

From every trial, the maximum value(maxDelta) of such delta is chosen. This maxDelta value for each trial is written to the output file. The goal is to minimize that maxDelta so that the error moves closer to zero.

In case you are interested, this is the input file format.


Personal tools
Navigation