# Changing Splitting

**URL:** <https://gpusph.discourse.group/t/changing-splitting/202>\
**Category:** Development\
**Created:** [March 25, 2024, 8:12am UTC](https://gpusph.discourse.group/t/changing-splitting/202 "2024-03-25T08:12:21Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![AlirezaZarei](https://avatars.discourse-cdn.com/v4/letter/a/b5ac83/32.png) [@AlirezaZarei](https://gpusph.discourse.group/u/AlirezaZarei)\
**Post date:** [March 25, 2024, 8:12am UTC](https://gpusph.discourse.group/t/changing-splitting/202/1 "2024-03-25T08:12:21Z")

</div>

Hi Giuseppe,

Is “fillDeviceMapByAxisBalanced” the most recent function for changing splitting? I want to split my flume in the transverse direction (y direction) to use the maximum capability of the GPUs because when I use 4 GPUs and its splitter in the x direction, the last GPU has fewer particles than other GPUs.

Regards,  
Alireza

---

<div class="post-metadata">

**Author:** ![giuseppe.bilotta](https://yyz2.discourse-cdn.com/free1/user_avatar/gpusph.discourse.group/giuseppe.bilotta/32/72_2.png) [@giuseppe.bilotta](https://gpusph.discourse.group/u/giuseppe.bilotta)\
**Post date:** [March 27, 2024, 5:40am UTC](https://gpusph.discourse.group/t/changing-splitting/202/2 "2024-03-27T05:40:09Z")

</div>

Hello @AlirezaZarei

both `fillDeviceMapByAxis` and `fillDeviceMapByAxisBalanced` work in the same way, splitting the domain in the direction you pass as argument. The difference between the two is that `fillDeviceMapByAxis` tries to divide the _cells_ equally, while `fillDeviceMapByAxisBalanced` tries to divide the (initial distribution of) _particles_ equally. There are also other splitting rules available (e.g. `fillDeviceMapByRegularGrid`), and it’s also possible to define splitting rules manually.

Keep in mind that even though the existing `fillDevice*` functions try to do an initially balanced split, there are some constraints they have to stick to, and depending on the problem geometry and particle distribution it may be inevitable that the distribution will leave some GPUs underused. For example, if in the split direction you have 63 cells and split with 4 GPUs, it’s unavoidable that 3 GPUs will get 16 slices, but the last one will only have 15.

Normally this is not too much of an issue, although it may have a negative effect on scaling. It may also be indicative that you’re using “too many GPUs” for your problem/geometry/resolution. Testing is the only way to see if using one GPU more or one GPU less is better.
