diff --git a/mpistalls.c b/mpistalls.c
index 2506f515b69fbb85e5933c68f30446fa04f1d04a..11296a8dfdbc213325a4c0b6be231667512e1066 100644
--- a/mpistalls.c
+++ b/mpistalls.c
@@ -166,7 +166,6 @@ static int cmp_logs(const void *p1, const void *p2) {
  * sends and recvs. */
 static void pick_logs(void) {
   size_t nlogs = mpiuse_nr_logs();
-  int nranks = mpiuse_nr_ranks();
 
   /* Duplicate of logs. XXX could loop twice to reduce memory use if needed. */
   reqs_queue = (struct mpiuse_log_entry **)