disease control system dicon
play

Disease Control System DiCon Sebastian Goll, Ned Dimitrov - PowerPoint PPT Presentation

Disease Control System DiCon Sebastian Goll, Ned Dimitrov University of Texas at Austin November 24, 2009 Goll, Dimitrov (Texas) November 24, 2009 1 / 14 Introduction DiCon What is DiCon? DiCon is the Disease Control System. Procedure


  1. Disease Control System DiCon Sebastian Goll, Ned Dimitrov University of Texas at Austin November 24, 2009 Goll, Dimitrov (Texas) November 24, 2009 1 / 14

  2. Introduction DiCon What is DiCon? DiCon is the Disease Control System. Procedure Use any disease simulator. Define policy/set of parameters. (e. g., when or where to distribute antivirals) Simulate for different policies and find best one. Distributed system DiCon runs on computer clusters. Many simulator instances work in parallel. Optimization algorithm picks policies to simulate next. Goll, Dimitrov (Texas) November 24, 2009 2 / 14

  3. Introduction Policy What is a policy? Policy describes parameters to optimize. Set of parameters that influence simulation outcome. (e. g., how many antivirals to distribute at each month) Each simulation returns a reward value, between 0 and 1. Optimizer finds policy that gives best average reward value. Stochastic simulation Simulations can be stochastic. (i. e., return different reward value each time they are run) Best policy according to average return value over all runs. Goll, Dimitrov (Texas) November 24, 2009 3 / 14

  4. Introduction Policy Tree structure For best performance, policy should have tree structure. Tree structure comes naturally for many policies. Every list is a candidate for tree structure. Examples 15 — Month 1 City 1 0 1 10 A B C D 15 14 5 A B C D Month 2 0 1 10 0 1 10 0 1 City 2 B C D E C D E D E E 15 14 5 14 13 4 5 4 A,B A,C A,D A,E B,C B,D B,E C,D C,E D,E Select [A,B] [A,C] [A,D] [A,E] [B,C] [B,D] [B,E] [C,D] [C,E] [D,E] Goll, Dimitrov (Texas) November 24, 2009 4 / 14

  5. Introduction Goals Design goals The following goals were followed during development of DiCon. Ease of use Easy to manage; single configuration file; intuitive. Flexibility Custom simulators & optimizers; simple interface. Performance Little overhead; advantage of parallel computing. Simplicity Easy to modify when necessary; documentation. Source code ≈ 12 , 000 lines of code (C++). Heavy use of Boost C++ Libraries, also Google’s Protocol Buffers and GNU MP Bignum Library. Works on any cluster with Message Passing Interface (MPI). Goll, Dimitrov (Texas) November 24, 2009 5 / 14

  6. Tutorial Simulator Scheme Write simulator. Define policy space. Run DiCon optimizer. Plaything Let k and n be fixed positive integers ( k , n ∈ N ). Policy is a k -ary decimal number with n digits. (e. g., “0.123” with k = 4, n = 3) Policy space is set of numbers between 0 and 1. (e. g., “0.000” through “0.333”, k = 4, n = 3) Simulator is deterministic; returns number. Goal: Find “0.333” ( k = 4, n = 3). Goll, Dimitrov (Texas) November 24, 2009 6 / 14

  7. Tutorial Simulator Simulator Simulator provides both policy space and simulation. Methods Simulator defines three simple methods. children Gets series of policy elements and returns node children. simulate Gets policy and returns reward value, between 0 and 1. display Gets policy and returns human-readable interpretation. Policy: List of policy elements pointing to leaf node in policy tree. Goll, Dimitrov (Texas) November 24, 2009 7 / 14

  8. Tutorial Simulator Python code 1 from simulator import Simulator 2 3 base = 4 # That ’ s k. 4 depth = 3 # That ’ s n. 5 class Plaything( Simulator ) : 6 def children ( self , path ) : 7 len (path) < depth : 8 i f return range( 0, base ) 9 else : 10 return [ ] 11 12 def simulate ( self , policy ) : 13 value = 0.0 14 factor = 1.0 15 16 for digit in policy : 17 factor /= base 18 value + = digit ∗ factor 19 20 return value 21 22 def display ( self , policy ) : 23 return str ( policy ) 24 25 i f name = = ” main ” : 26 Plaything () .main() 27 Goll, Dimitrov (Texas) November 24, 2009 8 / 14

  9. Tutorial Simulator C++ code #include ” ../ simulator .hpp” double factor = 1; 1 29 #include < boost/foreach .hpp 2 > 30 #include < boost/lexical cast .hpp BOOSTFOREACH( int digit , policy ) { 3 > 31 factor /= base ; 4 32 static const size t base = 4; // That ’ s k. value + = digit ∗ factor ; 5 33 static const size t depth = 3; // That ’ s n. } 6 34 7 35 class Plaything return value ; 8 36 : public Simulator < int > } 9 37 { 10 38 public : virtual 11 39 virtual std : : string 12 40 std : : vector < int > display ( const std : : vector < int > &policy ) { 13 41 children ( const std : : vector < int > &path) { std : : string res ; 14 42 std : : vector < int > res ; 15 43 BOOSTFOREACH( int digit , policy ) { 16 44 i f (path . size () < depth) { i f (! res .empty() ) res + = ” , ” ; 17 45 for ( size t i = 0; i < base ; + +i ) res + = boost : : lexical cast < std : : string 18 46 res . push back( i ) ; > (digit ) ; 19 } } 20 47 21 48 return res ; return ’ [ ’ + res + ’ ] ’ ; 22 49 } } 23 50 } ; 24 51 virtual 25 52 26 double 53 int main() { 27 simulate ( const std : : vector < int > &policy ) { 54 Plaything () .main() ; 28 double value = 0; 55 } Goll, Dimitrov (Texas) November 24, 2009 9 / 14

  10. Tutorial Invocation Invocation DiCon executable gets name of working directory. Directory initially contains only main config file. Gets filled with results as DiCon is running. Example $ mpirun -np 4 ./dicon demo Goll, Dimitrov (Texas) November 24, 2009 10 / 14

  11. Tutorial Invocation Config file 1 ; Sample DiCon configuration f i l e . 28 node log level =debug 2 ; 29 job log level =debug 3 ; Lines starting with ‘; ‘ are comments. 30 4 ; The options below show default values . 31 [ job − 1 ] 5 32 ; max sims=0 6 [ global ] 33 ; max nodes=0 7 ; main logfile=log/main. log 34 ; job backlog=1 ; main log level=info ; node backlog=1 8 35 ; node logfile=log/node %04u. log ; checkpoint secs=14400 9 36 ; node log level=info ; checkpoint sims=0 10 37 ; max jobs=1000000 ; checkpoints= 11 38 ; job dir=job − % u ; optimizer= 12 39 ; arg dir=argument − %05u ; simulator= 13 40 ; job logfile=job . log ; opt args[1]= 14 41 ; job log level=info ; sim args[1]= 15 42 ; checkpoint=checkpoint .xml 16 43 ; opt logfile=log/optimizer − node %04u. log max nodes =0 17 44 ; sim logfile=log/simulator − node %04u. log job backlog =1 18 45 ; optimizer map file= dump/%012u optmap. bin node backlog =1 19 46 − ; optimizer lib file= dump/%012u − optlib . bin checkpoint secs =0 20 47 ; policy bin dumpfile= dump/%012u − policy . bin checkpoint sims =0 21 48 ; policy txt dumpfile= dump/%012u − policy . txt optimizer =../optimizer/exhaustive . so 22 49 ; policy count=10 simulator =../simulator/python/ 23 50 ; policy bin result=result − policy . bin simple simulator . py 24 ; policy txt result=result − policy . txt 25 51 [ job − 2 ] 26 52 main log level =debug ; Some other job set here . 27 53 Goll, Dimitrov (Texas) November 24, 2009 11 / 14

  12. Tutorial Invocation Results When DiCon finishes, working directory might look like this. demo | - - job -1 // (one directory per job section in config f i l e ) | ‘ - - argument-00001 // (one sub- directory per argument combination) | | - - checkpoint .xml // ( f i l e describing most recent checkpoint) | | - - dump // ( directory with checkpoint f i l e s ) | | | - - 000000000025- optlib . bin | | | - - 000000000025-optmap. bin | | | - - 000000000025- policy . bin | | ‘ - - 000000000025- policy . txt | | - - job . log // ( general log f i l e for the current job) | | - - log // (output from optimizer and simulators ) | | | - - optimizer -node 0001 . log | | | - - simulator -node 0001 . log | | | - - simulator -node 0002 . log | | ‘ - - simulator -node 0003 . log | | - - result - policy . bin // (best policy found , binary ) | ‘ - - result - policy . txt // (best policy , human- readable ) | - - log // ( general system-wide log f i l e s ) | | - - main. log | | - - node 0001 . log | | - - node 0002 . log | ‘ - - node 0003 . log ‘ - - main. conf // ( i n i t i a l configuration f i l e ) Goll, Dimitrov (Texas) November 24, 2009 12 / 14

  13. Tutorial Invocation Checkpoints DiCon automatically takes checkpoints. Contain state dump of each optimizer. Can be resumed after interruption. Useful Checkpointing is necessary on some clusters. Jobs may be allowed to run only some time (48 hours). Resuming is easy: just start DiCon with same directory. DiCon automatically recognizes jobs with checkpoints. Goll, Dimitrov (Texas) November 24, 2009 13 / 14

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend