diff --git a/Geo/GModel.cpp b/Geo/GModel.cpp
index 968e8106a3381c384a3b3f5c34e09cbda5f621ce..f0f93e71e5c76508bcf93ba2c52d7eae9c62ef50 100644
--- a/Geo/GModel.cpp
+++ b/Geo/GModel.cpp
@@ -871,6 +871,7 @@ int GModel::partitionMesh(int numPart)
 #if defined(HAVE_MESH) && (defined(HAVE_METIS) || defined(HAVE_CHACO))
   opt_mesh_partition_num(0, GMSH_SET, numPart);
   PartitionMesh(this, CTX::instance()->partitionOptions);
+  return 1;
 #else
   Msg::Error("Mesh module not compiled");
   return 0;