fix the same bug when expanding smsgs buffer at dynamic setup.
authorGengbin Zheng <gzheng@illinois.edu>
Wed, 28 Dec 2011 05:48:59 +0000 (21:48 -0800)
committerGengbin Zheng <gzheng@illinois.edu>
Wed, 28 Dec 2011 05:48:59 +0000 (21:48 -0800)
src/arch/gemini_gni/machine.c

index 7308062b6eff3d701b06bcd6fe66a57675243b8c..ca8aa834aeb1ec19c7512570c38c0470d63d8ee6 100644 (file)
@@ -756,8 +756,9 @@ static void alloc_smsg_attr( gni_smsg_attr_t *local_smsg_attr)
         new_mailbox_entry = (dynamic_smsg_mailbox_t*)malloc(sizeof(dynamic_smsg_mailbox_t));
 
         new_mailbox_entry = (dynamic_smsg_mailbox_t*)malloc(sizeof(dynamic_smsg_mailbox_t));
-        new_mailbox_entry->mailbox_base = malloc(SMSG_MAX_MSG*AVG_SMSG_CONNECTION);
-        new_mailbox_entry->size = SMSG_MAX_MSG*AVG_SMSG_CONNECTION;
+        new_mailbox_entry->mailbox_base = malloc(smsg_memlen*AVG_SMSG_CONNECTION);
+        bzero(mailbox_list->mailbox_base, smsg_memlen*AVG_SMSG_CONNECTION);
+        new_mailbox_entry->size = smsg_memlen*AVG_SMSG_CONNECTION;
         new_mailbox_entry->offset = 0;
         
         status = GNI_MemRegister(nic_hndl, (uint64_t)new_mailbox_entry->mailbox_base,