⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 createf90.f90

📁 mpi并行计算的c++代码 可用vc或gcc编译通过 可以用来搭建并行计算试验环境
💻 F90
字号:
!  !  (C) 2004 by Argonne National Laboratory.!      See COPYRIGHT in top-level directory.!        program main        use mpi        integer ierr        integer errs        integer nints, nadds, ndtypes, combiner        integer nparms(2), dummy(1)        integer ntype1, nsize, ntype2!!       Test the Type_create_f90_xxx routines!        errs = 0        call mpi_init( ierr )! integers with upto 9 are 4 bytes integers; r of 4 are 2 byte,! and r of 2 is 1 byte        call mpi_type_create_integer( 9, ntype1, ierr )!!       Check with get contents and envelope...        call mpi_type_get_envelope( ntype1, nints, nadds, ndtypes, &                                    combiner, ierr )        if (nadds .ne. 0) then           errs = errs + 1           print *, "There should be no addresses on created type (r=9)"        endif        if (ndtypes .ne. 0) then           errs = errs + 1           print *, "There should be no datatypes on created type (r=9)"        endif        if (nints .ne. 1) then           errs = errs + 1           print *, "There should be exactly 1 integer on create type (r=9)"        endif        if (combiner .ne. MPI_COMBINER_F90_INTEGER) then           errs = errs + 1           print *, "The combiner should be INTEGER, not ", combiner        endif        if (nints .eq. 1) then           call mpi_type_get_contents( ntype1, 1, 0, 0, &                                       nparms, dummy, dummy, ierr )           if (nparms(1) .ne. 9) then              errs = errs + 1              print *, "parameter was ", nparms(1), " should be 9"           endif        endif                   call mpi_type_create_integer( 8, ntype2, ierr )        if (ntype1 .eq. ntype2) then           errs = errs + 1           print *, "Types with r = 8 and r = 9 are the same, ", &                "should be distinct"        endif        call mpi_finalize( ierr )        end

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -