# file parallelism with obj/stl

**URL:** https://discourse.paraview.org/t/file-parallelism-with-obj-stl/3075
**Category:** ParaView Support
**Created:** [November 29, 2019, 11:34am UTC](https://discourse.paraview.org/t/file-parallelism-with-obj-stl/3075 "2019-11-29T11:34:37Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![gilcu2](https://discourse.paraview.org/user_avatar/discourse.paraview.org/gilcu2/32/2183_2.png) [@gilcu2](https://discourse.paraview.org/u/gilcu2)
#### Post date: [November 29, 2019, 11:34am UTC](https://discourse.paraview.org/t/file-parallelism-with-obj-stl/3075/1 "2019-11-29T11:34:37Z")

</div>

I have a python script that read obj/mtl files and shows the right material. it uses the obj\_mtl\_importer.py shared here.  
When I run it under mpi/pvbatch doesn’t escalate. I think because of the way to applying the material to the data is sequential  
I am thinking of load the files, do the mtl mapping and render in parallel and merge the rendering in some way. I have read that paraview/vtk can do something like this but I don’t catch how to do.  
Can some give some light or point to some example of how to do this?  
Thanks

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [November 29, 2019, 12:05pm UTC](https://discourse.paraview.org/t/file-parallelism-with-obj-stl/3075/2 "2019-11-29T12:05:22Z")

</div>

@jourdain

---

<div class="post-metadata">

### Author: ![jourdain](https://discourse.paraview.org/user_avatar/discourse.paraview.org/jourdain/32/11_2.png) [@jourdain](https://discourse.paraview.org/u/jourdain)
#### Post date: [November 29, 2019, 4:20pm UTC](https://discourse.paraview.org/t/file-parallelism-with-obj-stl/3075/3 "2019-11-29T16:20:56Z")

</div>

I’m guessing what you were hoping was to load a file per mpi process?  
Moreover in the case of pvbatch, the script should guard which action should be done on which process. The scripts don’t do that as they assume local + serial execution.

---

<div class="post-metadata">

### Author: ![gilcu2](https://discourse.paraview.org/user_avatar/discourse.paraview.org/gilcu2/32/2183_2.png) [@gilcu2](https://discourse.paraview.org/u/gilcu2)
#### Post date: [December 1, 2019, 8:51am UTC](https://discourse.paraview.org/t/file-parallelism-with-obj-stl/3075/4 "2019-12-01T08:51:21Z")

</div>

Hi, yes. I want to load one obj/mtl file per mpi process, do the mapping using the mtl definition and render in a common view. How can I do this in a python script? Do you have some script that load the geometry and do the mapping for it and later render in a common view?  
Thanks  
Reynaldo

---

<div class="post-metadata">

### Author: ![jourdain](https://discourse.paraview.org/user_avatar/discourse.paraview.org/jourdain/32/11_2.png) [@jourdain](https://discourse.paraview.org/u/jourdain)
#### Post date: [December 2, 2019, 11:50am UTC](https://discourse.paraview.org/t/file-parallelism-with-obj-stl/3075/5 "2019-12-02T11:50:29Z")

</div>

It will be tricky to do but possible. You will have to create a trivial producer per material then load the data using the proper vtk reader while dealing with which file should belong to which MPI rank and bind the reader output dataset to the correct trivial producer.

Then map the material to the representation of each trivial producer.

Also you should run pvbacth in symmetric mode unless you guard the proxy interaction to just process 0.

---

<div class="post-metadata">

### Author: ![gilcu2](https://discourse.paraview.org/user_avatar/discourse.paraview.org/gilcu2/32/2183_2.png) [@gilcu2](https://discourse.paraview.org/u/gilcu2)
#### Post date: [December 2, 2019, 11:54am UTC](https://discourse.paraview.org/t/file-parallelism-with-obj-stl/3075/6 "2019-12-02T11:54:37Z")

</div>

Thanks, I can think about. Can you give a link to any python mpi example that load data from file and save the final result?
