# Running SPECFEM2D on multiple processors

**URL:** <https://community.geodynamics.org/t/running-specfem2d-on-multiple-processors/848>\
**Category:** SPECFEM\
**Tags:** specfem2d\
**Created:** [October 19, 2019, 11:50pm UTC](https://community.geodynamics.org/t/running-specfem2d-on-multiple-processors/848 "2019-10-19T23:50:19Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![pasansherath](https://avatars.discourse-cdn.com/v4/letter/p/d2c977/32.png) [@pasansherath](https://community.geodynamics.org/u/pasansherath)\
**Post date:** [October 19, 2019, 11:50pm UTC](https://community.geodynamics.org/t/running-specfem2d-on-multiple-processors/848/1 "2019-10-19T23:50:19Z")

</div>

Hi all,

I have been trying to run SPECFEM2D on multiple processors. I changed the NPROC parameter in the Par\_file to 16. But the xspecfem2D run crashes with the following error. Can someone help me with this?

_**application called MPI\_Abort(MPI\_COMM\_WORLD, 30) - process 0**_  
_**[unset]: write\_line error; fd=-1 buf=:cmd=abort exitcode=30**_  
_ **:** _  
_ **system msg for write\_line failure : Bad file descriptor** _

_ **Error: number of processors supposed to run on: 16** _  
**Error: number of MPI processors actually run on: 1**

_ **wrong number of MPI processes, must always have NPROC == nproc\_read\_from\_database** _  
_ **Error detected, aborting MPI… proc 0** _

---

<div class="post-metadata">

**Author:** ![pasansherath](https://avatars.discourse-cdn.com/v4/letter/p/d2c977/32.png) [@pasansherath](https://community.geodynamics.org/u/pasansherath)\
**Post date:** [April 29, 2020, 1:02am UTC](https://community.geodynamics.org/t/running-specfem2d-on-multiple-processors/848/2 "2020-04-29T01:02:02Z")

</div>

Hi there,

You should use **“mpiexec -n #number\_of\_processors xmeshfem2D”** and **“mpiexec -n #number\_of\_processors xspecfem2D”** in your terminal.

If you are running on 16 processors, it is **mpiexec -n 16 xmeshfem2D**
