Running the example_BTB.exe example reveals a number of memory issues
mpirun -np 4 valgrind --track-origins=yes --leak-check=full ./example_BTB.exe 10 10 10 0 0 1 10 2>&1 | tee CA3DMM_BTB_Mem.txt
Some of the errors seem to be because buffers of size (max_MAT_blk_size) are alloc'd, and the entire buffer is sent during the send, so if the buffer isn't entirely filled, uninitialized values can get sent.
https://github.com/huanghua1994/CA3DMM/blob/912005261c8dc5c6aa70b9749f9bb6d70c23f518/src/cannon.c#L91
https://github.com/huanghua1994/CA3DMM/blob/912005261c8dc5c6aa70b9749f9bb6d70c23f518/src/cannon.c#L116
https://github.com/huanghua1994/CA3DMM/blob/912005261c8dc5c6aa70b9749f9bb6d70c23f518/src/cannon.c#L268
CA3DMM_BTB_Mem.txt
Running the
example_BTB.exeexample reveals a number of memory issuesmpirun -np 4 valgrind --track-origins=yes --leak-check=full ./example_BTB.exe 10 10 10 0 0 1 10 2>&1 | tee CA3DMM_BTB_Mem.txtSome of the errors seem to be because buffers of size (max_MAT_blk_size) are alloc'd, and the entire buffer is sent during the send, so if the buffer isn't entirely filled, uninitialized values can get sent.
https://github.com/huanghua1994/CA3DMM/blob/912005261c8dc5c6aa70b9749f9bb6d70c23f518/src/cannon.c#L91
https://github.com/huanghua1994/CA3DMM/blob/912005261c8dc5c6aa70b9749f9bb6d70c23f518/src/cannon.c#L116
https://github.com/huanghua1994/CA3DMM/blob/912005261c8dc5c6aa70b9749f9bb6d70c23f518/src/cannon.c#L268
CA3DMM_BTB_Mem.txt