I would use the ibportstate command for each required port:
ibportstate <switch lid> <switch port> mtu <mtu enum>
examples:
1K mtu:
ibportstate 1 13 mtu 3
2K mtu:
ibportstate 1 13 mtu 4
4K mtu:
ibportstate 1 13 mtu 5
for an entire switch (with lid ==1):
for port in {1..36} ; do ibportstate 1 $port mtu 4 ; done
you can verify with:
smpquery pi <switch lid> <switch port> | grep NeighborMTU