我在把write_data ${sample_id}.data写进if-else的判断里以后疯狂报错:

double free or corruption (!prev)
[peachPC:317364] *** Process received signal ***
[peachPC:317364] Signal: Aborted (6)
[peachPC:317364] Signal code:  (-6)
[peachPC:317364] [ 0] /lib/x86_64-linux-gnu/libc.so.6(+0x3d1a0)[0x7f091c0591a0]
[peachPC:317364] [ 1] /lib/x86_64-linux-gnu/libc.so.6(+0x8b0fc)[0x7f091c0a70fc]
[peachPC:317364] [ 2] /lib/x86_64-linux-gnu/libc.so.6(raise+0x12)[0x7f091c059102]
[peachPC:317364] [ 3] /lib/x86_64-linux-gnu/libc.so.6(abort+0xd3)[0x7f091c0424f2]
[peachPC:317364] [ 4] /lib/x86_64-linux-gnu/libc.so.6(+0x2735b)[0x7f091c04335b]
[peachPC:317364] [ 5] /lib/x86_64-linux-gnu/libc.so.6(+0x94a65)[0x7f091c0b0a65]
[peachPC:317364] [ 6] /lib/x86_64-linux-gnu/libc.so.6(+0x9697c)[0x7f091c0b297c]
[peachPC:317364] [ 7] /lib/x86_64-linux-gnu/libc.so.6(+0x96c79)[0x7f091c0b2c79]
[peachPC:317364] [ 8] /lib/x86_64-linux-gnu/libc.so.6(free+0x6f)[0x7f091c0b531f]
[peachPC:317364] [ 9] lmp4kkh(+0x208c5bc)[0x55c3e5c5e5bc]
[peachPC:317364] [10] lmp4kkh(+0x208cc44)[0x55c3e5c5ec44]
[peachPC:317364] [11] lmp4kkh(+0x52c19f)[0x55c3e40fe19f]
[peachPC:317364] [12] lmp4kkh(+0x49f351)[0x55c3e4071351]
[peachPC:317364] [13] lmp4kkh(+0x29e4e3)[0x55c3e3e704e3]
[peachPC:317364] [14] lmp4kkh(+0x29f2e7)[0x55c3e3e712e7]
[peachPC:317364] [15] lmp4kkh(+0x28bead)[0x55c3e3e5dead]
[peachPC:317364] [16] /lib/x86_64-linux-gnu/libc.so.6(+0x27b8a)[0x7f091c043b8a]
[peachPC:317364] [17] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0x85)[0x7f091c043c45]
[peachPC:317364] [18] lmp4kkh(+0x291d81)[0x55c3e3e63d81]
[peachPC:317364] *** End of error message ***
double free or corruption (!prev)
[peachPC:317363] *** Process received signal ***
[peachPC:317363] Signal: Aborted (6)
[peachPC:317363] Signal code:  (-6)
[peachPC:317363] [ 0] /lib/x86_64-linux-gnu/libc.so.6(+0x3d1a0)[0x7f1a8d4591a0]
[peachPC:317363] [ 1] /lib/x86_64-linux-gnu/libc.so.6(+0x8b0fc)[0x7f1a8d4a70fc]
[peachPC:317363] [ 2] /lib/x86_64-linux-gnu/libc.so.6(raise+0x12)[0x7f1a8d459102]
[peachPC:317363] [ 3] /lib/x86_64-linux-gnu/libc.so.6(abort+0xd3)[0x7f1a8d4424f2]
[peachPC:317363] [ 4] /lib/x86_64-linux-gnu/libc.so.6(+0x2735b)[0x7f1a8d44335b]
[peachPC:317363] [ 5] /lib/x86_64-linux-gnu/libc.so.6(+0x94a65)[0x7f1a8d4b0a65]
[peachPC:317363] [ 6] /lib/x86_64-linux-gnu/libc.so.6(+0x9697c)[0x7f1a8d4b297c]
[peachPC:317363] [ 7] /lib/x86_64-linux-gnu/libc.so.6(+0x96c79)[0x7f1a8d4b2c79]
[peachPC:317363] [ 8] /lib/x86_64-linux-gnu/libc.so.6(free+0x6f)[0x7f1a8d4b531f]
[peachPC:317363] [ 9] lmp4kkh(+0x208c5bc)[0x562bac0f35bc]
[peachPC:317363] [10] lmp4kkh(+0x208cc44)[0x562bac0f3c44]
[peachPC:317363] [11] lmp4kkh(+0x52c19f)[0x562baa59319f]
[peachPC:317363] [12] lmp4kkh(+0x49f351)[0x562baa506351]
[peachPC:317363] [13] lmp4kkh(+0x29e4e3)[0x562baa3054e3]
[peachPC:317363] [14] lmp4kkh(+0x29f2e7)[0x562baa3062e7]
[peachPC:317363] [15] lmp4kkh(+0x28bead)[0x562baa2f2ead]
[peachPC:317363] [16] /lib/x86_64-linux-gnu/libc.so.6(+0x27b8a)[0x7f1a8d443b8a]
[peachPC:317363] [17] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0x85)[0x7f1a8d443c45]
[peachPC:317363] [18] lmp4kkh(+0x291d81)[0x562baa2f8d81]
[peachPC:317363] *** End of error message ***
free(): invalid next size (normal)
[peachPC:317367] *** Process received signal ***
[peachPC:317367] Signal: Aborted (6)
[peachPC:317367] Signal code:  (-6)
[peachPC:317367] [ 0] /lib/x86_64-linux-gnu/libc.so.6(+0x3d1a0)[0x7fb1740591a0]
[peachPC:317367] [ 1] /lib/x86_64-linux-gnu/libc.so.6(+0x8b0fc)[0x7fb1740a70fc]
[peachPC:317367] [ 2] /lib/x86_64-linux-gnu/libc.so.6(raise+0x12)[0x7fb174059102]
[peachPC:317367] [ 3] /lib/x86_64-linux-gnu/libc.so.6(abort+0xd3)[0x7fb1740424f2]
[peachPC:317367] [ 4] /lib/x86_64-linux-gnu/libc.so.6(+0x2735b)[0x7fb17404335b]
[peachPC:317367] [ 5] /lib/x86_64-linux-gnu/libc.so.6(+0x94a65)[0x7fb1740b0a65]
[peachPC:317367] [ 6] /lib/x86_64-linux-gnu/libc.so.6(+0x9693c)[0x7fb1740b293c]
[peachPC:317367] [ 7] /lib/x86_64-linux-gnu/libc.so.6(+0x96c79)[0x7fb1740b2c79]
[peachPC:317367] [ 8] /lib/x86_64-linux-gnu/libc.so.6(free+0x6f)[0x7fb1740b531f]
[peachPC:317367] [ 9] lmp4kkh(+0x208c5bc)[0x5577ab7045bc]
[peachPC:317367] [10] lmp4kkh(+0x208cc44)[0x5577ab704c44]
[peachPC:317367] [11] lmp4kkh(+0x52c19f)[0x5577a9ba419f]
[peachPC:317367] [12] lmp4kkh(+0x49f351)[0x5577a9b17351]
[peachPC:317367] [13] lmp4kkh(+0x29e4e3)[0x5577a99164e3]
[peachPC:317367] [14] lmp4kkh(+0x29f2e7)[0x5577a99172e7]
[peachPC:317367] [15] lmp4kkh(+0x28bead)[0x5577a9903ead]
[peachPC:317367] [16] /lib/x86_64-linux-gnu/libc.so.6(+0x27b8a)[0x7fb174043b8a]
[peachPC:317367] [17] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0x85)[0x7fb174043c45]
[peachPC:317367] [18] lmp4kkh(+0x291d81)[0x5577a9909d81]
[peachPC:317367] *** End of error message ***
--------------------------------------------------------------------------
prterun noticed that process rank 3 with PID 317364 on node peachPC exited on
signal 6 (Aborted).
--------------------------------------------------------------------------

也试着在超算上算了算,也有很大概率算不下去,少数能输出一些结果。

虽然不知道为什么,但把write_data命令移出if-else结构就好了