[Paraview] How to use multiprocessing in pvpython?

Sha Mo mosha at ntu.edu.sg
Thu Jul 9 00:07:38 EDT 2015


Thanks Cory for your reply.

My developing environment is Ubuntu 14.04 + Paraview 4.3.
This issue will occur when I run those code in both Paraview Python Shell under GUI and pvpython command line.

I am attempting to implement a python script filter to handle my CFD in paraview pipeline, and my machine has multi-core cpu, meanwhile the filter has large part of separated calculation. So I think I can separate them into parts and use multi-processing to handle them.

For now, my script just use one core cpu, it’s slow and wasted.

Thank you.


在 2015年7月9日,上午11:52,Cory Quammen <cory.quammen at kitware.com<mailto:cory.quammen at kitware.com>> 写道:

It looks like all threads are attempting to open a display on an xserver but Xlib has not been initialized to use multiple threads.

Interestingly, I can execute your code in my development build of pvpython just fine under Ubuntu 14.04.

May I ask what you are planning to do with the multiprocessing package? Maybe there is another way you can accomplish it without the multiprocessing package?

- Cory

On Wed, Jul 8, 2015 at 10:05 PM, Sha Mo <mosha at ntu.edu.sg<mailto:mosha at ntu.edu.sg>> wrote:
In order to use multi-core cpu well, I want to use multiprocessing module in paraview python script. But following error was occurred when I try to run following code on Paraview Python Shell:

import multiprocessing
pool = multiprocessing.Pool(processes=4)

paraview version 4.3.1
Process PoolWorker-1:
Traceback (most recent call last):
Process PoolWorker-2:
paraview: Fatal IO error 2 (No such file or directory) on X server :0.
  File "/usr/lib/python2.7/multiprocessing/process.py", line 249, in _bootstrap
Process PoolWorker-3:
paraview: Fatal IO error 11 (Resource temporarily unavailable) on X server :0.
paraview: Fatal IO error 11 (Resource temporarily unavailable) on X server :0.
Process PoolWorker-4:
paraview: Fatal IO error 2 (No such file or directory) on X server :0.
Process PoolWorker-5:
paraview: Fatal IO error 11 (Resource temporarily unavailable) on X server :0.
Process PoolWorker-6:
paraview: Fatal IO error 2 (No such file or directory) on X server :0.
Process PoolWorker-8:
Process PoolWorker-7:
paraview: Fatal IO error 2 (No such file or directory) on X server :0.
paraview: Fatal IO error 2 (No such file or directory) on X server :0.
[xcb] Unknown sequence number while processing queue
[xcb] Most likely this is a multi-threaded client and XInitThreads has not been called
[xcb] Aborting, sorry about that.
paraview: ../../src/xcb_io.c:274: poll_for_event: Assertion `!xcb_xlib_threads_sequence_lost' failed.
Aborted (core dumped)

I wonder whether it is wrong way to use parallel programming on pvpython?
[SG50]
________________________________
CONFIDENTIALITY: This email is intended solely for the person(s) named and may be confidential and/or privileged. If you are not the intended recipient, please delete it, notify us and do not copy, use, or disclose its contents.
Towards a sustainable earth: Print only when necessary. Thank you.
_______________________________________________
Powered by www.kitware.com<http://www.kitware.com/>

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView

Search the list archives at: http://markmail.org/search/?q=ParaView

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/paraview



--
Cory Quammen
R&D Engineer
Kitware, Inc.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/paraview/attachments/20150709/b2f3b904/attachment.html>


More information about the ParaView mailing list