diff --git a/src/engine.c b/src/engine.c
index 83f0b8bc956e4bfb114c90dde06b8b88eac7d017..9f7e4445de6d814ca901365a01022fc74506a066 100644
--- a/src/engine.c
+++ b/src/engine.c
@@ -541,8 +541,13 @@ void engine_repartition ( struct engine *e ) {
         }
         
     /* Broadcast the result of the partition. */
+#if IDXTYPEWIDTH==32
     if ( MPI_Bcast( nodeIDs , nr_cells , MPI_INT , 0 , MPI_COMM_WORLD ) != MPI_SUCCESS )
         error( "Failed to bcast the node IDs." );
+#else
+    if ( MPI_Bcast( nodeIDs , nr_cells , MPI_LONG_LONG_INT , 0 , MPI_COMM_WORLD ) != MPI_SUCCESS )
+        error( "Failed to bcast the node IDs." );
+#endif
         
     /* Set the cell nodeIDs and clear any non-local parts. */
     for ( k = 0 ; k < nr_cells ; k++ ) {