FWIW, we’ve enabled OpenMP builds for the GMT package on conda-forge (see https://github.com/conda-forge/gmt-feedstock/issues/262), and if you install build 14 or after for GMT 6.4.0, or get the GMT 6.5.0 devel version, that should allow you to use multiple cores. If you’re on Linux, that would mean an installation like this:
conda install gmt=6.4.0=hb5fd6f7_14
To double-check, run gmt-config --has-openmp on the command-line, and it should print yes.
With that, pygmt.grdfilter should work with the -x option. E.g.:
import pygmt
pygmt.grdfilter(
grid="@earth_relief_30m_g",
filter="m600",
distance="4",
region=[150, 250, 10, 40],
spacing=0.5,
outgrid="filtered_pacific.nc",
x=8, # set to number of cores
)
This is the same as the GMT command
gmt grdfilter @earth_relief_30m_g -Fm600 -D4 -R150/250/10/40 -I0.5 -Gfiltered_pacific.nc -x8
We should probably update the documentation of grdfilter in GMT to mention that multi-core -x can be used, because it doesn’t seem to be documented, though gmt grdfilter --help shows it.