increasing performance of FEMM under LINUX/wine

Questions about Wine on Linux
Locked
KlausStadlbauer
Newbie
Newbie
Posts: 2
Joined: Wed May 25, 2016 9:31 am

increasing performance of FEMM under LINUX/wine

Post by KlausStadlbauer »

Is there a possibility to increase the performance of the FEM-programm FEMM under wine?
I tested it on the same machine under Windows 7 and under Ubuntu14.04 / wine1.9.10.
There is seemingly a difference of a factor of up to 7 regarding time (i.e. it is up to seven times slower than in windows).

I tried several things like changing/adding entries in the registry with regedit, ... but without success.
I even don't know how to look for the bottleneck.

thx in advance for replies,
Klaus
User avatar
Bob Wya
Level 12
Level 12
Posts: 3068
Joined: Sat Oct 16, 2010 7:40 pm

Re: increasing performance of FEMM under LINUX/wine

Post by Bob Wya »

KlausStadlbauer wrote:Is there a possibility to increase the performance of the FEM-programm FEMM under wine?
I tested it on the same machine under Windows 7 and under Ubuntu14.04 / wine1.9.10.
There is seemingly a difference of a factor of up to 7 regarding time (i.e. it is up to seven times slower than in windows).

I tried several things like changing/adding entries in the registry with regedit, ... but without success.
I even don't know how to look for the bottleneck.

thx in advance for replies,
Klaus
This is a basic introduction to tuning Wine performance...
  1. Can you post up a sample dataset (since the program is open-source) or are you plugging it into another sci-application?
  2. Is the application CPU bound or I/O bound?
  3. Have you compared performance in a 32-bit Wineprefix (32-bit version of Femm) vs a 64-bit Wineprefix (64-bit version of Femm)?
  4. Does using the Wine-Staging package make any difference?
  5. What is your system setup for Linux (filesystem, kernel version, etc.)?
  6. Have you done any filesystem tuning under Linux?
  7. What about the system hardware?
You could post up the console output from your running application - to see if anything obviously problematic turns up, e.g. ...

Code: Select all

cd "${WINEPREFIX}/drive_c/femm42/bin/"
wine femm.exe &>console_log.txt
You can test disabling all console output:

Code: Select all

export WINEDEBUG=-all
cd "${WINEPREFIX}/drive_c/femm42/bin/"
wine femm.exe
This potentially can reduce the process I/O bottleneck (e.g. if your program happens to be spamming the console with a lot of output).

Controversially I felt that some games I've tested - have run with smoother FPS by increasing the priority of the wine process (this was not shared by other users). You'd need to mess with your /etc/security/limits.conf.

Code: Select all

cd "${WINEPREFIX}/drive_c/femm42/bin/"
nice -n -10 wine femm.exe
Wine does run entirely in user space - so increasing the priority may give it slight bump over other OS (background) user-space services.

Additionally you could try using a custom / newer Linux kernel. Depends on where your system bottleneck is located of course...

I presume you are unable to use xfemm for your use case?

Bob
KlausStadlbauer
Newbie
Newbie
Posts: 2
Joined: Wed May 25, 2016 9:31 am

Re: increasing performance of FEMM under LINUX/wine

Post by KlausStadlbauer »

First of all I want to say thank you for your kind and extensive answer. Here my reply:

1. I'm using it standalone now but intending to couple it to another program later on.
2. I think both: solving a lot of equations but also writing data to the disk. It seems that later is the bottle neck because compared to windows there it works much faster. And calculation can be seen with a progress bar.
3. I have compared 32 with 64 Bit - there seems to be no difference.
4. I'm not familiar with wine staging. It seems there are over 700 patches one could use with wine - I'm not sure how to find a relevant patch which could improve my problem.
5. Ubuntu 14.04, 64Bit; Intel Core i7CPU [email protected]; kernel: 3.16.0-71-generic; file system: ext4
6. I have no idea how to tune my file system ???
7. please look at point 5

I tried your suggestions about WINEDEBUG=-all and nice -n -10 without any increase in performance. The log file shows a lot of stubs:

fixme:msvcrt:__clean_type_info_names_internal (0x78a5efb8) stub
fixme:msvcrt:__clean_type_info_names_internal (0x78a5efb8) stub
....

thanks for your hint for xfemm. Seems to be very useful under Linux but unfortunately it is in beta stage and there is no good tutorial how to use it. So for example I don't know how to start a lua script on command line.....

thanks again,
Klaus
User avatar
Bob Wya
Level 12
Level 12
Posts: 3068
Joined: Sat Oct 16, 2010 7:40 pm

Re: increasing performance of FEMM under LINUX/wine

Post by Bob Wya »

I'm not sure my answer was really all that useful! But thanks 8)
KlausStadlbauer wrote:I have no idea how to tune my file system ???
With ext4 it's pretty much a "done deal" (with the default mount flags) - but you can always test using the noatime flag, test using a newer kernel (probably won't help with such a stable FS though), etc.
See some old ext4 tests at Phoronix
The Phoronix Test Suite is an easy way to get hold of benchmarking suites (and iozone, etc.).
KlausStadlbauer wrote:Ubuntu 14.04, 64Bit; Intel Core i7CPU [email protected]; kernel: 3.16.0-71-generic; file system: ext4
Okay then. Have you compared multi-threading performance between Wine and Windows - for FEMM? That's going to be really significant on your CPU!
KlausStadlbauer wrote:I tried your suggestions about WINEDEBUG=-all and nice -n -10 without any increase in performance. The log file shows a lot of stubs ...
You can test by enabling very verbose console output:

Code: Select all

export WINEDEBUG=+relay
cd "${WINEPREFIX}/drive_c/femm42/bin/"
wine femm.exe &>relay_log.txt
See WineHQ Debug Channels. You get very verbose logs with +relay! But although you don't get profiling information - you will get details of all function entry and exit points. It's easy enough to sort the resulting log by call/return frequency (and pick the top 10 - see the WineHQ Debug Channels link - pull out that little grep pipeline/script that's actually suggested to exclude the top 10 calls!!)

I haven't previously investigated Wine profiling so I'll have a dig about and see if there are any "easy to use" tools to this!

Bob
User avatar
Bob Wya
Level 12
Level 12
Posts: 3068
Joined: Sat Oct 16, 2010 7:40 pm

Re: increasing performance of FEMM under LINUX/wine

Post by Bob Wya »

Klaus,

I've had a chat on the #winehackers irc channel...

You might want to try running your full dataset with:

Code: Select all

export WINEDEBUG=+relay,+tid,+timestamp
cd "${WINEPREFIX}/drive_c/femm42/bin/"
wine femm.exe &>femm_console_log.txt
That gives you:
[millisecond timestamp]:[thread number]:[normal debug output]
in the text log file.

You might have trouble posting that log to a pastebin site (hint: it'll be a huge file!!) But it shouldn't be too hard to knock up an awk script to parse it locally on your machine. I can give you hand with that if you want. It'd probably be an enough to sort the functions which wine spends the most time executing - to determine the bottleneck.

Like I said it'd also be useful just to check whether all your CPU cores are being comparatively loaded, when processing a data-set, comparing Windows to Wine. Just an arm-waving visual comparison of the loading graphs would be enough (if the performance factor difference is so high). Process Explorer is going to better than the build in Task Manager on Windows 7 - for this task!! Anything - e.g. htop will suffice on Ubuntu.

Bob
Locked