{"id":150,"date":"2020-02-24T10:20:32","date_gmt":"2020-02-24T02:20:32","guid":{"rendered":"https:\/\/www.yemeng.site\/?p=150"},"modified":"2020-02-26T12:00:17","modified_gmt":"2020-02-26T04:00:17","slug":"small-box-fft%e5%ad%a6%e4%b9%a0%e7%ac%94%e8%ae%b0%ef%bc%88%e4%b8%89%ef%bc%89%ef%bc%9a%e6%a0%bc%e5%ad%90%e7%9a%84%e6%95%b0%e6%8d%ae%e7%bb%93%e6%9e%84","status":"publish","type":"post","link":"https:\/\/ru.yemeng.site\/?p=150","title":{"rendered":"Small Box FFT\u5b66\u4e60\u7b14\u8bb0\uff08\u4e09\uff09\uff1a\u7f51\u683c\u7684\u6570\u636e\u7ed3\u6784"},"content":{"rendered":"\n<p>\u672c\u6587\u662fSBFFT\u5b66\u4e60\u7b14\u8bb0\u7684\u7b2c\u4e09\u7bc7\uff0c\u8fd9\u4e00\u7bc7\u4e2d\u4e3b\u8981\u4ecb\u7ecd\u5728\u8fd9\u4e00\u7b97\u6cd5\u4e2d\u7528\u5230\u7684\u5404\u79cd\u7f51\u683c\u6240\u4f7f\u7528\u7684\u6570\u636e\u7ed3\u6784\uff0c\u4ee5\u53ca\u4e0e\u4e0d\u540c\u7f51\u683c\u6570\u636e\u76f8\u4e92\u8f6c\u6362\u7684\u5b50\u7a0b\u5e8f\u3002<\/p>\n\n\n\n<p>\u6839\u636e\u672c\u7cfb\u5217<a href=\"?p=80\">\u7b2c\u4e00\u7bc7<\/a>\u4e2d\u7684\u76f8\u5173\u7406\u8bba\uff0c\u5728\u8ba1\u7b97\u4e2d\u9700\u8981\u7528\u5230\u56db\u79cd\u7f51\u683c\uff0c\u5168\u5c40\u7684\u7a20\u5bc6\u7f51\u683c\uff08DGBX\uff09\u3001\u5c0f\u5757\u7684\u7a20\u5bc6\u7f51\u683c\uff08DSBX\uff09\u3001\u5168\u5c40\u7684\u7a00\u758f\u7f51\u683c\uff08SGBX\uff09\u548c\u5c0f\u5757\u7684\u7a00\u758f\u7f51\u683c\uff08SSBX\uff09\u3002\u5728\u5177\u4f53\u4ee3\u7801\u5b9e\u73b0\u4e2d\u5b9a\u4e49\u4e86\u4e00\u4e2aBOX\u6570\u636e\u7c7b\u578b\uff08BOX.f90\u6587\u4ef6\u4e2d\u7684SetupBOX\u6a21\u5757\uff09\uff0c\u6765\u5b9e\u73b0\u5bf9\u4e8e\u8fd9\u56db\u79cd\u7f51\u683c\u7684\u5c01\u88c5\uff0c\u5177\u4f53\u7684\u6570\u636e\u7ed3\u6784\u5b9a\u4e49\u5982\u4e0b\uff1a<\/p>\n\n\n\n<pre title=\"\" class=\"wp-block-code\"><code lang=\"fortran\" class=\"language-fortran line-numbers\">type :: BOX\n\t! \u57fa\u672c\u4fe1\u606f \n\tcharacter(len=4) \t\t\t\t\tid \t\t\t\t\t! \u6807\u8bb0\u56db\u79cd\u7c7b\u578b\u7684\u7f51\u683c\uff0c\u53ef\u80fd\u7684\u503c\u4e3a\"DGBX\"\u3001\"DSBX\"\u3001\"SGBX\"\u3001\"SSBX\"\n\tinteger \t\t\t\t\t\t\tlevel \t\t\t\t! \u6807\u8bb0\u662f\u5426\u4f7f\u7528\uff1a0\u8868\u793a\u672a\u4f7f\u7528\uff0c1\u8868\u793a\u5df2\u521d\u59cb\u5316\n\tinteger \t\t\t\t\t\t\tindbox \t\t\t\t! \u5f53\u524d\u5c0f\u5757\u7684\u4e00\u7ef4\u7f16\u53f7\uff0c\u7528\u4e8e MPI_SPLIT\n\tinteger, dimension( 3 ) \t\t\tindbox3d \t\t\t! \u5f53\u524d\u5c0f\u5757\u7684\u5728\u5404\u4e2a\u65b9\u5411\u4e0a\u7684\u5e8f\u53f7\n\tinteger, dimension( 3 ) \t\t\tnbox \t\t\t\t! \u6bcf\u4e2a\u65b9\u5411\u4e0a\u5c0f\u5757\u7684\u6570\u76ee\n\tinteger, dimension( 3 ) \t\t\tbuff \t\t\t\t! \u5404\u65b9\u5411\u4e0a\u7f13\u51b2\u533a\u7684\u683c\u70b9\u6570\n\tinteger \t\t\t\t\t\t\tnproc \t\t\t\t! \u5f53\u524d\u5c0f\u5757\u4f7f\u7528\u7684\u6838\u6570\n\tinteger \t\t\t\t\t\t\tnproc_c \t\t\t! \u5f53\u524d\u5c0f\u5757\u6838\u5fc3\u533a\u57df\u4f7f\u7528\u7684\u6838\u6570\n\tinteger \t\t\t\t\t\t\tnptot \t\t\t\t! \u8ba1\u7b97\u4f7f\u7528\u7684\u603b\u6838\u6570\n\t! \u6838\u5fc3\u533a\u548c\u7f13\u51b2\u533a\n\tinteger \t\t\t\t\t\t\tn1, n2, n3 \t\t\t! \u5f53\u524d\u6838\u4f7f\u7528\u7684\u5404\u65b9\u5411\u683c\u70b9\u6570\u76ee\n\tinteger \t\t\t\t\t\t\tn123 \t\t\t\t! n123 = n1 * n2 * n3\n\tinteger \t\t\t\t\t\t\tn1off, n2off, n3off ! \u5404\u65b9\u5411\u4e0a\u7684\u4f4d\u79fb\u503c\n\tinteger \t\t\t\t\t\t\tm1, m2, m3 \t\t\t! \u5404\u65b9\u5411\u4e0a\u7684\u603b\u683c\u70b9\u6570\n\t! \u5012\u7a7a\u95f4 \n\tinteger \t\t\t\t\t\t\tk1, k2, k3 \t\t\t! \u5f53\u524d\u6838\u4f7f\u7528\u7684\u5012\u7a7a\u95f4\u7f51\u683c\u5404\u65b9\u5411\u683c\u70b9\u6570\n\tinteger \t\t\t\t\t\t\tk123= \t\t\t\t! k123 = k1 * k2 * k3\n\tinteger \t\t\t\t\t\t\tk3off \t\t\t\t! Gz\u65b9\u5411\u4e0a\u7684\u4f4d\u7f6e\n\t! \u6838\u5fc3\u533a\u57df\n\tinteger \t\t\t\t\t\t\tc1, c2, c3 \t\t\t! \u5f53\u524d\u6838\u4f7f\u7528\u7684\u5404\u65b9\u5411\u683c\u70b9\u6570\u76ee\uff08\u6838\u5fc3\u533a\u57df\uff09\n\tinteger \t\t\t\t\t\t\tc123=0 \t\t\t\t! c123 = c1 * c2 * c3\n\tinteger \t\t\t\t\t\t\tc10, c11 \t\t\t! \u5f53\u524d\u6838\u7684\u7f51\u683c\u4e2d\u6838\u5fc3\u533a\u57df\u683c\u70b9\u5728x\u65b9\u5411\u7684\u8d77\u59cb\u548c\u7ed3\u675f\u4f4d\u7f6e\n\tinteger \t\t\t\t\t\t\tc20, c21 \t\t\t! \u5f53\u524d\u6838\u7684\u7f51\u683c\u4e2d\u6838\u5fc3\u533a\u57df\u683c\u70b9\u5728y\u65b9\u5411\u7684\u8d77\u59cb\u548c\u7ed3\u675f\u4f4d\u7f6e\n\tinteger \t\t\t\t\t\t\tc30, c31 \t\t\t! \u5f53\u524d\u6838\u7684\u7f51\u683c\u4e2d\u6838\u5fc3\u533a\u57df\u683c\u70b9\u5728\u6574\u4e2a\u5757\u4e2d\u7684\u8d77\u59cb\u548c\u7ed3\u675f\u4f4d\u7f6e\n\tinteger \t\t\t\t\t\t\tb1, b2, b3\t\t\t! \u5f53\u524d\u5c0f\u5757\u4e2d\u6838\u5fc3\u533a\u57df\u5404\u65b9\u5411\u683c\u70b9\u6570\u76ee\n\tinteger \t\t\t\t\t\t\tb123 \t\t\t\t! \u6838\u5fc3\u533a\u7684\u603b\u683c\u70b9\u6570\n\tinteger \t\t\t\t\t\t\tb1off, b2off \t\t! \u5f53\u524d\u5c0f\u5757\u4e2d\u6838\u5fc3\u533a\u57df\u5728\u7f51\u683c\u4e2d\u4e0bx,y\u65b9\u5411\u7684\u4f4d\u7f6e\n\tinteger \t\t\t\t\t\t\tb3off \t\t\t\t! \u5f53\u524d\u5c0f\u5757\u4e2d\u6838\u5fc3\u533a\u57df\u5728\u7f51\u683c\u4e2d\u7684\u4f4d\u7f6e\n\t! \u7a00\u758f\u5ea6\n\tinteger \t\t\t\t\t\t\tsparX, sparY, sparZ ! \u5404\u4e2a\u65b9\u5411\u7684\u7a00\u758f\u5ea6\uff0c1\u8868\u793a\u662f\u7a20\u5bc6\u7f51\u683c\n\t! MPI\n\tinteger \t\t\t\t\t\t\tMPI_INTRA_WORLD \t! \u5f53\u524d\u5c0f\u5757\u4f7f\u7528\u7684MPI\u7f51\u7edc\n\tinteger \t\t\t\t\t\t\trankBox \t\t\t! \u5f53\u524d\u6838\u5728\u5f53\u524d\u5c0f\u5757MPI\u7f51\u7edc\u4e2d\u7684\u7f16\u53f7\n\tinteger \t\t\t\t\t\t\trankBox0, rankBox1\t! \u6838\u5fc3\u533a\u57df\u4f7f\u7528\u6838\u7684\u7f16\u53f7\u7684\u4e0b\u754c\u548c\u4e0a\u754c\n\tinteger \t\t\t\t\t\t\tMPI_CORE_WORLD \t\t! \u6240\u6709\u8ba1\u7b97\u6838\u5fc3\u533a\u57df\u7684\u6709\u6838\u6784\u6210\u7684MPI\u7f51\u7edc\n\tinteger \t\t\t\t\t\t\trankCore \t\t\t! \u5728\u4e0a\u4e00\u7f51\u7edc\u4e2d\u7684\u7f16\u53f7\n\ttype(FFT_CONFIG) \t\t\t\t\tFFT_STATE \t\t\t! FFT\u76f8\u5173\u4fe1\u606f\n\tlogical \t\t\t\t\t\t\tactive_proc \t\t! \u53ea\u6709\u5728\u7b2c\u4e00\u4e2a\u5c0f\u5757\u4f7f\u7528\u7684\u6838\u88ab\u6807\u8bb0\u4e3aactive\n\tlogical \t\t\t\t\t\t\tbuffer_proc \t\t! \u4e3a.TRUE.\u8868\u793a\u5f53\u524d\u6838\u5904\u7406\u7f13\u51b2\u533a\n\tlogical \t\t\t\t\t\t\tcore_proc \t\t\t! \u4e3a.TRUE.\u8868\u793a\u5f53\u524d\u6838\u5904\u7406\u6838\u5fc3\u533a\n\t! \u7535\u8377\u5bc6\u5ea6\n\treal*8, dimension( *, *, * ) \t\trhoC \t\t\t\t! \u6838\u5fc3\u533a\u57df\u7684\u7535\u8377\u5bc6\u5ea6 \n\treal*8, dimension( *, *, * ) \t\tqTable \t\t\t\t! q\u5411\u91cf\u7684\u957f\u5ea6\n\treal*8, dimension( *, *, * , * ) \tqVectors \t\t\t! \u5b9e\u9645\u7684q\u5411\u91cf\n\tlogical, dimension( *, * , * ) \t\tqMask \t\t\t\t! mask\u51fd\u6570\n\t! \u5757\u7684\u51e0\u4f55\u53c2\u6570 \n\treal*8, dimension( 3, 3 ) \t\t\tcellReal \t\t\t! \u5f53\u524d\u5757\u7684\u683c\u77e2\uff0c\u4ee5Bohr\u4e3a\u5355\u4f4d\n\treal*8, dimension( 3, 3 ) \t\t\tcellRecip \t\t\t! \u5f53\u524d\u5757\u7684\u5012\u683c\u77e2\n\treal*8, dimension( 3 ) \t\t\t\tlength \t\t\t\t! \u5f53\u524d\u5757\u4e09\u4e2a\u683c\u77e2\u7684\u957f\u5ea6\n\treal*8, dimension( 3 ) \t\t\t\tecut\t\t\t\t! \u5404\u65b9\u5411\u7684\u622a\u65ad\u80fd\nend type BOX<\/code><\/pre>\n\n\n\n<p>\u5728\u7a0b\u5e8f\u4e2d\u4f7f\u7528\u4e86\u56db\u4e2aBOX\u7c7b\u578b\u7684\u53d8\u91cfDGBX\u3001DSBX\u3001SGBX\u548cSSBX\uff0c\u5206\u522b\u5bf9\u5e94\u8ba1\u7b97\u4f7f\u7528\u7684\u56db\u4e2a\u7f51\u683c\u3002\u7a0b\u5e8f\u4e2d\u9996\u5148\u4f7f\u7528Inputs\u4e2d\u7684ReadOptions\u5b50\u7a0b\u5e8f\uff08Inputs.f90\u6587\u4ef6\uff09\u8bfb\u53d6\u8f93\u5165\u53c2\u6570\u540e\u5bf9\u8fd9\u51e0\u4e2a\u53d8\u91cf\u7684\u7f51\u683c\u5927\u5c0f\u7b49\u53c2\u6570\u8fdb\u884c\u8d4b\u503c\uff08\u76f8\u5173\u6587\u4ef61244-1319\uff09\uff0c\u518d\u8c03\u7528SetupBOX\u6a21\u5757\u4e2dInitBOX\u5b50\u7a0b\u5e8f\u5bf9\u8fd9\u4e9b\u53d8\u91cf\u8fdb\u884c\u521d\u59cb\u5316<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"fortran\" class=\"language-fortran\">call InitBOX(box, m1G, m2G, m3G, cellRealIn)<\/code><\/pre>\n\n\n\n<p>\u8fd9\u91ccbx\u662f\u9700\u8981\u521d\u59cb\u5316\u7684BOX\u7c7b\u578b\u53d8\u91cf\uff0cm1G\u3001m2G\u3001m3G\u4e09\u4e2a\u6574\u6570\u8868\u793ax\u3001y\u3001z\u4e09\u4e2a\u65b9\u5411\u5168\u5c40\u7f51\u683c\u957f\u5ea6\uff0ccellRealIn\u5bf9\u5e94bx%cellReal\u8868\u793a\u683c\u77e2\u3002\u5173\u4e8e\u5177\u4f53\u7684\u8c03\u7528\uff0c\u53ef\u4ee5\u53c2\u8003SYS\u6a21\u5757\u4e2dSetupAllBoxes\u5b50\u7a0b\u5e8f\uff08System.f90\u6587\u4ef6\u4e2d\uff09\u3002<\/p>\n\n\n\n<p>\u7531\u4e8e\u8ba1\u7b97\u8fc7\u7a0b\u4e2d\u6d89\u53ca\u5230\u6d89\u53ca\u5230\u4e0d\u540c\u7c7b\u578b\u7f51\u683c\u7684\u6570\u636e\u8f6c\u6362\uff0c\u5728\u7a0b\u5e8f\u4e2d\u7528\u5230\u4e86\u56db\u79cd\u5b9e\u7a7a\u95f4\u4e2d\u7f51\u683c\u8f6c\u6362\u7684\u5b50\u7a0b\u5e8f\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>DGBX_2_DSBX<\/li><li>DSBX_2_DGBX<\/li><li>DSBX_2_SGBX<\/li><li>SGBX_2_SSBX<\/li><\/ul>\n\n\n\n<p>\u8fd9\u4e9b\u5b50\u7a0b\u5e8f\u5bf9\u5e94<a href=\"?p=80#sec-3\">\u8ba1\u7b97\u6d41\u7a0b<\/a>\u4e2d\u7684\u8d4b\u503c\u548c\u62fc\u5408\u64cd\u4f5c\uff0c\u53ea\u6d89\u53ca\u5230\u6570\u636e\u7684\u4f20\u9012\uff08\u4f7f\u7528MPI_ISend\u548cMPI_IRecv\uff09\uff0c\u56e0\u6b64\u6ca1\u6709\u4ece\u7a00\u758f\u7f51\u683c\u5230\u7a20\u5bc6\u7f51\u683c\u8f6c\u6362\u7684\u5b50\u7a0b\u5e8f\uff08\u5bf9\u5e94\u63d2\u503c\u64cd\u4f5c\uff09\u3002\u8fd9\u4e9b\u5b50\u7a0b\u5e8f\u7684\u8c03\u7528\u65b9\u5f0f\u662f\u7c7b\u4f3c\u7684\uff0c\u4ee5DGBX_2_DSBX\u4e3a\u4f8b\uff0c\u5176\u4f4d\u4e8eDataExchange_DG2DS.f90\u7684\u540c\u540d\u6a21\u5757\u4e2d\uff0c\u5176\u5b9a\u4e49\u4e3a\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"fortran\" class=\"language-fortran\">subroutine DGBX_2_DSBX(\n\treal*8, dimension( *, *, * ) \tarray_DG,\n\treal*8, dimension( *, *, * ) \tarray_DS\n\t)<\/code><\/pre>\n\n\n\n<p>\u6b64\u5916\u5728DataExchange_SS2DS.f90\u6587\u4ef6\u7684\u540c\u540d\u6a21\u5757\u4e2d\u5b9a\u4e49\u7684SSBX_2_DSBX\u5b50\u7a0b\u5e8f\uff0c\u5bf9\u5e94\u7684\u662f\u5728\u5012\u7a7a\u95f4\u800c\u975e\u5b9e\u7a7a\u95f4\u4e2d\u7684\u6570\u636e\u8f6c\u6362\uff0c\u8fd9\u91cc\u4ece\u7a00\u758f\u7f51\u683c\u5230\u7a20\u5bc6\u7f51\u683c\u7684\u53d8\u6362\u53ea\u662f\u5728\u9ad8\u9891\u90e8\u5206\u52a0\u4e0a0\uff0c\u5176\u5b9a\u4e49\u4e3a\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"fortran\" class=\"language-fortran\">subroutine SSBX_2_DSBX(\n\tcomplex*16, dimension( *, *, * ) \tarray_SS,\n\tcomplex*16, dimension( *, *, * ) \tarray_DS\n\t)<\/code><\/pre>\n\n\n\n<p>\u8fd9\u4e9b\u5b50\u7a0b\u5e8f\u7684\u5b9e\u73b0\u7ec6\u8282\u6bd4\u8f83\u7410\u788e\uff0c\u8fd8\u9700\u8981\u53c2\u8003\u5176\u6e90\u4ee3\u7801\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u672c\u6587\u662fSBFFT\u5b66\u4e60\u7b14\u8bb0\u7684\u7b2c\u4e09\u7bc7\uff0c\u8fd9\u4e00\u7bc7\u4e2d\u4e3b\u8981\u4ecb\u7ecd\u5728\u8fd9\u4e00\u7b97\u6cd5\u4e2d\u7528\u5230\u7684\u5404\u79cd\u7f51\u683c\u6240\u4f7f\u7528\u7684\u6570\u636e\u7ed3\u6784\uff0c\u4ee5\u53ca\u4e0e\u4e0d\u540c\u7f51\u683c\u6570 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7,9,6],"tags":[8,5],"class_list":["post-150","post","type-post","status-publish","format-standard","hentry","category-7","category-9","category-6","tag-fortran","tag-small-box-fft"],"_links":{"self":[{"href":"https:\/\/ru.yemeng.site\/index.php?rest_route=\/wp\/v2\/posts\/150","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ru.yemeng.site\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ru.yemeng.site\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ru.yemeng.site\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ru.yemeng.site\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=150"}],"version-history":[{"count":11,"href":"https:\/\/ru.yemeng.site\/index.php?rest_route=\/wp\/v2\/posts\/150\/revisions"}],"predecessor-version":[{"id":215,"href":"https:\/\/ru.yemeng.site\/index.php?rest_route=\/wp\/v2\/posts\/150\/revisions\/215"}],"wp:attachment":[{"href":"https:\/\/ru.yemeng.site\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=150"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ru.yemeng.site\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=150"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ru.yemeng.site\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=150"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}