WineHQ
Wine Forums

Board index » WineHQ » Wine Help




 Page 1 of 1 [ 5 posts ] 



 
Author Message
 Post Posted: Mon Feb 18, 2019 8:20 pm 
Offline
Newbie
Newbie

Joined: Mon Feb 18, 2019 8:10 pm
Posts: 2
Hello!
I have been using an windows simulation application for quite some time now. I would have to simulate the model multiple times with necessary perturbations. In order to make this process automatic I have been using vbscript which would make the necessary changes within the model on that application and run and record the output. Because of the necessity of a large number of simulations requirement, I am trying to run the model on a centos server through WINE. So far, I have been able to run the application on the server through wine. Can I use a vb script to automate the process like it was possible on windows?
Thanks,
Reza


Top 
 Post Posted: Tue Feb 19, 2019 6:48 am 
Offline
Level 12
Level 12
User avatar

Joined: Sat Oct 16, 2010 7:40 pm
Posts: 2740
Location: Cambridge
@Reza

You may find it's more optimal to automate the cloning of a number of identical WINEPREFIX's, with different datasets, and run these in parallel (e.g. with a native Linux python,BASH,etc. script).
Each WINEPREFIX will have it's own dedicated wineserver process then.

This is because wineserver can quickly become a bottleneck, as all your Wine threads communicate via this central process.
The wine-esync patchset was developed to mitigate some of the wineserver overheads (for synchronisation primitives anyway).

But VB scripting should be fine, to automate this process. Especially if raw performance isn't a primary concern.

Bob


Top 
 Post Posted: Mon Feb 25, 2019 6:23 pm 
Offline
Newbie
Newbie

Joined: Mon Feb 18, 2019 8:10 pm
Posts: 2
I can use vbs to run the program now. Here is a sample of the vb script.
Code:
Function Sleep(sec)
WScript.Sleep (sec * 1000)
End Function


'Part 1: open the model
Set W = CreateObject("WEAP.WEAPApplication")
W.ActiveArea = "TRWD system operation_daily TS_quarterly forecast model"
' Make sure WEAP is fully started
While Not W.ProgramStarted
Sleep (1)
Wend
'Part 2: ensuring Current accounts is the active scenario
IF NOT W.ActiveScenario = "Current Accounts" THEN
W.ActiveScenario = "Current Accounts"
END IF
'Part 3: Change input as necessary
'14. sensitivity to benbrook pumping threshold
W.Branch("Key\BB\BB flood pumping\Flood pumping threshold").Variables("Annual Activity Level").Expression =  arrFields(1)
'Part 4: load and export results
W.LoadFavorite ("Unmet Demand")
CALL W.ExportResults ("C:\Research\WEAP results\sensitivity analysis\trial\1\Unmet_Demand.csv", , , TRUE)

This script runs without any issues on windows. However, when run on wine it does everything except the last line where it is calling the required function to export the results from the application. On this line, it shows 'Type mismatch error'. Can anyone here kindly help me with this?
Thanks


Top 
 Post Posted: Fri Mar 01, 2019 10:05 am 
Offline
Level 7
Level 7

Joined: Thu Aug 27, 2009 6:23 am
Posts: 822
Maybe there's a bug in wine. Could you try the last line with only the filename, e.g. "Demand.csv" (instead of the full path), to make sure, that wine doesn't have issues with the path, e.g. "\" might get lost, maybe it would work with "\\", but that's just a guess. And maybe insert values for all parameters (",,,"), if there are reasonable values.

Did you install WSH with winetricks, e.g. "winetricks wsh57"?

Anyways, you should file a bug report with all your findings.


Top 
 Post Posted: Mon Mar 04, 2019 4:40 pm 
Offline
Level 12
Level 12
User avatar

Joined: Sat Oct 16, 2010 7:40 pm
Posts: 2740
Location: Cambridge
lahmbi5678 wrote:
... Could you try the last line with only the filename, e.g. "Demand.csv" (instead of the full path), to make sure, that wine doesn't have issues with the path, e.g. "\" might get lost, maybe it would work with "\\", but that's just a guess. ...


I don't think the forward slashes will need escaping in the context of a VB script.
Although a quick run with strace, or enabling debugging for Wine's path / file handling, could be checked by OP.

Bob


Top 
Display posts from previous:  Sort by  
 
 Page 1 of 1 [ 5 posts ] 




Board index » WineHQ » Wine Help


Who is online

Users browsing this forum: Bing [Bot] and 10 guests

 
 

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: