This GitLab instance reached the end of its service life. It won't be possible to create new users or projects.

Please read the deprecation notice for more information concerning the deprecation timeline

Visit migration.git.tu-berlin.de (internal network only) to import your old projects to the new GitLab platform 📥

CoupledSimulationFlinkBenchmark.scala 3.88 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
package de.bbisping.coupledsim.flink

import org.apache.flink.api.scala.ExecutionEnvironment
import scala.collection.Seq


/**
 * Runs the coupled simulation flink algorithm on a number of VLTS samples
 */
object CoupledSimulationFlinkBenchmark {
  
  val smallSamples = Seq(
    "shared/src/test/assets/csv/alphabet.csv",
    "shared/src/test/assets/csv/bug1.csv",
    "shared/src/test/assets/csv/bug2.csv",
    "shared/src/test/assets/csv/contra-sim-1.csv",
    "shared/src/test/assets/csv/coupled-sim-1b.csv",
    "shared/src/test/assets/csv/coupled-sim-2.csv",
    "shared/src/test/assets/csv/coupled-sim-phil.csv",
    "shared/src/test/assets/csv/diamond.csv",
    "shared/src/test/assets/csv/ltbts.csv",
    "shared/src/test/assets/csv/sim-1.csv",
    "shared/src/test/assets/csv/weak-bisim-1.csv",
    "shared/src/test/assets/csv/weak-bisim-2.csv",
    "shared/src/test/assets/csv/weak-bisim-2b.csv"
  )
  
  val vltsSamplesSmall = Seq(
    "shared/src/test/assets/vlts/vasy_0_1.csv" //   289,   1224,  no tau,  2
  )
    
  val vltsSamplesMedium = Seq(
    "shared/src/test/assets/vlts/vasy_1_4.csv", //  1183,   4464,    1213,  6
    "shared/src/test/assets/vlts/vasy_5_9.csv",
    "shared/src/test/assets/vlts/cwi_1_2.csv", //  1952,   2387,    2215, 26
    "shared/src/test/assets/vlts/cwi_3_14.csv",//  3996,  14552,   14551,  2
    "shared/src/test/assets/vlts/vasy_8_24.csv",
    "shared/src/test/assets/vlts/vasy_8_38.csv",
    "shared/src/test/assets/vlts/vasy_10_56.csv",
//    "shared/src/test/assets/vlts/vasy_18_73.csv" // memory ran out (in discovery)
    "shared/src/test/assets/vlts/vasy_25_25.csv"
42 43 44 45 46
  //  "shared/src/test/assets/vlts/vasy_40_60.csv"
      /*
        transitive closure on vasy_40_60 takes forever (also 15 secs in the optimized [BGR2016] implementation);
        weak bisim result probably wrong due to hash collisions
      */
47 48
  )
  
49 50
  def runSizeMark(cfgPreminimization: String, cfgOverApproximation: String): Unit = {
    val samples = // List("shared/src/test/assets/vlts/vasy_40_60.csv")
51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87
      smallSamples ++
      vltsSamplesSmall ++
      vltsSamplesMedium
    
    val env = ExecutionEnvironment.getExecutionEnvironment
    env.getConfig.disableSysoutLogging()
    
    for (s <- samples) {
      
      val begin = System.currentTimeMillis()
      
      val csResult = CoupledSimulationFlink.executeAlgorithm(env,
          cfgPath = s,
          cfgPreminimization = cfgPreminimization,
          cfgOverApproximation = cfgOverApproximation,
          cfgBenchmarkSizes = true,
          cfgReturnPartitionRelation = true)
          
      val time = System.currentTimeMillis() - begin
      val benchmark = csResult.benchmarkSizes.withDefaultValue("")
      val (csPart, csRel) = csResult.partitionRelation
      val csPartitionCount = csPart.values.toSet.size
      
      println(s + ", " + 
          benchmark("systemStates") + ", " +
          benchmark("systemTransitions") + ", " +
          benchmark("systemWeakTransitions") + ", " +
          benchmark("minimizedStates") + ", " +
          benchmark("minimizedTransitions") + ", " +
          benchmark("gameNodes") + ", " +
          benchmark("gameMoves") + ", " +
          csPartitionCount + ", " +
          csRel.size + ", " +
          time)
    }
  }
  
88
  def runTimeMark(cfgPreminimization: String, cfgOverApproximation: String): Unit = {
89 90 91 92 93 94 95 96 97 98 99 100 101
    val samples = 
      smallSamples ++ // warmup
      smallSamples ++ 
      vltsSamplesSmall ++
      vltsSamplesMedium
    
    val env = ExecutionEnvironment.getExecutionEnvironment
    env.getConfig.disableSysoutLogging()
    
    for (s <- samples) {
      
      val begin = System.currentTimeMillis()
      
102
      CoupledSimulationFlink.executeAlgorithm(env,
103 104 105 106 107 108 109 110 111 112 113
          cfgPath = s,
          cfgPreminimization = cfgPreminimization,
          cfgOverApproximation = cfgOverApproximation)
          
      val time = System.currentTimeMillis() - begin
      
      println(s + ", " + time)
    }
  }
  
}