0

I am trying to query a larger system with UPPAAL SMC and it ends up with a "memory exhausted" error message. By nature, UPPAAL SMC should not result in a state space explosion that's why I am asking if it is possible to query with SMC without getting a state space explosion.

If i try to execute the following with a lots of states:

UppaalSystem system = engine.getSystem(document, problems);
engine.query(system, "", "E[<=100; 100](max: sum(i : id_t) Device(i).edge1)", queryListener);

I get following error message:

<html>Memory exhausted. See <br>http://bugsy.grid.aau.dk/bugzilla3/show_bug.cgi?id=63 <br>for more information.</html>

at com.uppaal.engine.Engine.getSystem(Engine.java:352)

Is it possible to query Uppaal SMC without calling the memory intensive engine.getSystem()?

Here is the uppaal model of my "device" template

  • `getSystem` compiles the document into a model -- it cannot do anything without this step. It could be that your model uses many arrays, or template instantiations which basically runs out of memory when instantiated, or it could be some bug with memory leak (I would be curious to know). Something is wrong with your `query` statement: the closing quote is missing. – mariusm May 02 '19 at 14:52
  • @mariusm Of course the closing quote was missing - i edited it in the post. I tried the compiling task (`getSystem`) with several test cases, but with more than 20 template instantiations i get the memory exhausted error message. I will upload my "device" template to the question above. – Michael Eder May 02 '19 at 15:09
  • 20 processes is not much, I would be more suspicious about the arrays, especially multidimensional. What are the ranges? Can you share your model file? – mariusm May 02 '19 at 15:22
  • 1
    I uploaded my uppaal system here: https://ufile.io/iax8aj30 I generate this system with two templates automatically, because i want to show that model checking can help in a real time environment (e.g., cloud/edge computing). The "generator" simulates a random workload. This is working and tested with small examples, but if the example reach the size as shown in the example uppaal raises the memory exhausted error. Thank you very much. I really apprechiate it. – Michael Eder May 02 '19 at 16:43
  • The bottleneck is in the Generator process: it uses select statement on 20 boolean variables, which generate 2^20=1048576 edges, each edge takes up some memory (need to check how much), but it seems that it multiplies beyond 4GB. If you use just SMC, then it would be more efficient to use random function to enumerate all possibilities, like: `uint32_t n = fint(random(1<> i) & 1;` – mariusm May 03 '19 at 09:51
  • I have "optimized" your model, take a look: http://people.cs.aau.dk/~marius/generatedmodel-mm.xml – mariusm May 03 '19 at 10:03
  • Thanks for editing and uploading my system. Uppaal SMC is a really nice tool. I will follow your further work in this research area. – Michael Eder May 06 '19 at 22:48

1 Answers1

1

The issue is in the different template: the bottleneck is with the select statement which generates 2^20 = 1048576 edges.

exponential explosion of edges

For SMC it is better to use random function to generate all possibilities on one edge:

enter image description here

where randomInit looks like the following:

typedef int[0,(1<<DEVICE_SIZE)-1] uint20_t;

void randomInit(bool& test[DEVICE_SIZE])
{
    uint20_t number = fint(random(1<<DEVICE_SIZE));
    for (i: id_t)
       test[i] = (number >> i) & 1;
}

Note that symbolic queries like E<> and A[] will not work on such models due to the use of random and fint!

mariusm
  • 1,483
  • 1
  • 11
  • 26
  • Thanks your help @mariusm. I tried fint() a few months ago (see https://stackoverflow.com/questions/54460545/how-to-cast-a-double-value-to-a-integer-value-in-uppaal), but happily this feature works since UPPAAL version 4.1.22. I like the resource efficient away of generating the random numbers with the right and left bitwise shift. With your professional help my prototyp is ready for evaluation respectively for further improvements. :-) – Michael Eder May 06 '19 at 22:44