Getting an error with an uploaded Powersim model

#1

When I start on the interface builder page I get the following error. Any fixes? I’m importing a model from Powersim Studio 10 Premium. Its a pretty complex model (23MB, simulation and probabilistic modes, linked Excel inputs and outputs, and 521 variables). Maybe its too large?

8:14:17 PMCOMError: (-2147024809, ‘The parameter is incorrect.’, ("‘DEMO’ could not be found.", ‘PsSimEng.SimulationEngine.1’, None, 0, None))

https://api.forio.com/v2/run/directory_name/
500: Internal Server Error
Type: python

The following error then follows that one:

8:14:44 PMModel initiation for run(000001609b67c8d1f60e90e94cab5beedf4b) exceeded its grace period(30) seconds

https://api.forio.com/v2/run/directory_name/
400: Bad Request
Type: com.forio.epicenter.grid.transformer.ModelInitiationException

0 Likes

#2

Hello,

My name is David, I’m a software engineer with Forio, and I’ll try to help you with your problem. The error your getting is coming straight from the Powersim engine, and generally means that there is a ‘variable’ named ‘DEMO’ that is being reported in your model, but who’s history can’t be retrieved. This could be an error in how we’re interfacing with the Powersim software (which I think is the most likely cause), or could be a problem with the Powersim engine itself. Either way, I’ll attempt to diagnose the issue and provide a fix. I should get back to you within the next 24 hours with an update.

Thank you for contacting Forio,

David Berkman

0 Likes

#3

Thanks David for the reply. In this case, “DEMO” was the name of the Powersim file. Perhaps the file itself did not upload correctly because of its size? I can’t get the sftp to work using Filezilla so I haven’t tried uploading it that way.

-Bill

0 Likes

#4

I have a diagnosis for you…

The first problem is that you need to load the model by it’s full name which is, ‘SGBIM_BAWSCA_DEMO.sip’, including the extension. I noticed you were using Interface Builder. The model name is entered in the simulation in the file “index.html”. You can change this by editing the file directly.

  • Click the Interface tab
  • Click index.html
  • Click Edit
  • Look for the attribute “data-f-model” in the “body” tag and make sure it has the correct model name.

However, even if the model name is corrected, your model is still not going to load. There are some different rules for the Powersim Engine, as opposed to the Powersim Studio. In order to have access to a variable’s history of values over time, something we’re definitely interested in, we need to tell the engine to load each of those variables before we do anything else. This tells the engine to track the history from then on. Something I don’t think the desktop-based studio needs to do internally, but I know the engine does. There are 2 ways we could handle this. The first is to make you list each variable you’ll want access to in a separate configuration file, what we call a model ‘context’ file, which would have the name SGBIM_BAWSCA_DEMO.ctx. Then we could know which specific variables to pre-load in the engine. We do not currently do this. Instead, we ask the engine for the name of every variable in your model and pre-load all of them for you so you have access to everything. This is easier for most people and acceptable because the model sizes are not huge and the number of variables has been in the hundreds at most. Your model has 900,000 objects to load, and by the time the engine can manage this it’s taken so long that the front end has decided something has gone wrong that could not be reported and times out the operation. That’s usually the right thing to do since most people are not going to wait longer then the timeout period in any case. You can, again via the model context file, provide for a longer timeout for models which you know are going to take a while to load. Your model takes several minutes, and may fall within the longest time we allow, but doing that may not provide the client experience you’re looking for.

What’s probably best is to allow a ‘switch’ that tells our system to either load all variables (the default), or load only the variables listed, which would allow you to control that behavior and have the system pre-load only those variables you’re going to display in your web application (via model context file again). Hopefully that number would be small enough to allow for quick loading of your model. If the number was in the hundreds your model should load in seconds. However, to provide for this capability does mean a bit of work on our side. We’ll need to create that capability, test it, put it through QA, schedule it for release, and push it live. I’m willing to do that work if you think this is a solution for you, but it’s probably going to take a couple of weeks to get this out on our systems where you can use it.

Best,
David Berkman

0 Likes

#5

Hello David,

Thank you for the in-depth diagnosis. I’ve taken care of the naming issue. I also tried stripping my model bare (removing the probabilistic clone, reducing the number of time steps by 90%, etc.) and I’m still not able to load the model. It seems as though the config file approach would be the only way to load these bigger files. Most of our models have this similar complexity, so we’d need the more robust solution to handle them. Can you start in on that process to be able to specify through the config file which variables I need access to? I’d be happy to help test the beta if you’d like. I really appreciate the attention to this issue!

Happy New Year!
-Bill

0 Likes

#6

David,

To give you another data point, I tried uploading a small model (one stock and two flows) and I got the same error

COMError: (-2147024809, ‘The parameter is incorrect.’, ("‘upload’ could not be found.", ‘PsSimEng.SimulationEngine.1’, None, 0, None))

Seems as though this isn’t an issue with size, at least with this model. Perhaps my version of Powersim is not compatible? I am running Powersim Studio 10 Premium (10.14.555.6) 64-bit version, Service Release 6a with Feature Pack 1.

Thanks,
-Bill

0 Likes

#7

Did you set the model’s name to be the entire file name, including the extension?

0 Likes

#8

I’m working on an update to try and accommodate your large model which I expect can go live soon. In the meantime, please engage this advice…

The first problem is that you need to load the model by it’s full name which is, ‘SGBIM_BAWSCA_DEMO.sip’, including the extension. I noticed you were using Interface Builder. The model name is entered in the simulation in the file “index.html”. You can change this by editing the file directly.

  • Click the Interface tab
  • Click index.html
  • Click Edit
  • Look for the attribute “data-f-model” in the “body” tag and make sure it has the correct model name.

We do have Powersim models which currently run, so it does work. If you’ve tried the above and are still having a problem with your smaller model, please let me know.

David

0 Likes

#9

Thanks David. The naming fix - including the extension in the model name - worked for the very simple model I was testing. Success! Now I need the update you mention for the larger models. Thanks again!

0 Likes

#10

I’m glad using the full model name has worked. We in process testing the options for larger models. I’ll keep you informed.

Best,
David

0 Likes

#11

Hey David,

Any update on the large model version? Thanks!

-Bill

0 Likes

#12

Yes, there’s now a method for handling larger models. You’ll need to provide a model context file…

https://forio.com/epicenter/docs/public/model_code/context/

…for your project. Only variables which are listed in that context file will have their historical values over time made available. In order to turn this mode on you’ll need to add this attribute to the context file’s json object…

“control”: {“powrsim”:{“minimizeMemoryFootprint”: true}}

Also be aware that you’re the first user of this option and this feature is in beta, which means you may encounter problems and I’ll work with you to resolve any issues.

Best,
David

0 Likes