Run wine in parallel with gnu-parallel - needs {%} slot substitution to work

浪尽此生 提交于 2019-12-02 21:09:27

问题


I have been running wine/dos commands in parallel in ubuntu with gnu-parallel. I can and have done this successfully with simple commands without problem.

However, some more complex problems can result in interference between components within wine.

Thus, to solve this I'd like to restrict one job at a time to specific named "wine prefix" instance using the {%} as queried in this question. The trouble is: the {%} substition doesnt seem to work.

I'd eventually like to be able to run something like the following

parallel -j4 'WINEPREFIX=$HOME/slot{%} wine cmd /c @echo {%} 2>/dev/null' ::: A B C D

Unfortunately a single new wine prefix slot{%} is created and used rather than the extant slot1, slot2, slot3, and slot4 prefix directories.

Following the manual I tried:

 parallel -j 2 echo {%} ::: A B C

but instead of returning something like:

1
2
1

it returns:

{%} A
{%} B
{%} C

So I dont think the problem is wine, but something else: Does the {%} substitution need to be enabled somehow? Perhaps it not available in my version? Maybe I copied the example usage incorrectly? I can find no other example of this problem anywhere but it happens every time to me.

As a weak workaround I've been applying the bash modulo operator to the {#} jobs substitution but this is not perfect because I still get occasional slot-slot collisions and subsiquent crashes.

FYI1: lsb_release -a returns

Distributor ID: Ubuntu
Description:    Ubuntu 14.04.3 LTS
Release:        14.04
Codename:       trusty

parallel --version returns

GNU parallel 20130922

回答1:


Your version of parallel appears to be too old.

Do you see {%} in the documentation that shipped with your version or just online?

The release notes for GNU Parallel 20140522 indicate:

  • {%} introduced as job slot replacement string. It has known bugs.

and the release notes for GNU Parallel 20140622 indicate:

  • {%} works as job slot.


来源:https://stackoverflow.com/questions/32706088/run-wine-in-parallel-with-gnu-parallel-needs-slot-substitution-to-work

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!