Macos 运行时pc mac gfortran要慢得多
我正在MacBookPro 10.9.5、2.3GHz、8GB内存和Dell Latitude E6400 Windows 7、@.26GHz、4GB内存上编译fortran代码。代码在mac上运行约12.2分钟,在pc上运行约32.6分钟。我在mac上使用gfortran 4.9.0,在pc上使用4.10.0。我的make文件是: { }Macos 运行时pc mac gfortran要慢得多,macos,performance,windows-7,gfortran,Macos,Performance,Windows 7,Gfortran,我正在MacBookPro 10.9.5、2.3GHz、8GB内存和Dell Latitude E6400 Windows 7、@.26GHz、4GB内存上编译fortran代码。代码在mac上运行约12.2分钟,在pc上运行约32.6分钟。我在mac上使用gfortran 4.9.0,在pc上使用4.10.0。我的make文件是: { } 有没有人对为什么pc版运行得这么慢有什么建议?-O0,-g?如果你想做基准测试,至少让编译器优化一下。。。另外,您的程序使用/需要多少ram?我已经尝试过优
有没有人对为什么pc版运行得这么慢有什么建议?-O0,-g?如果你想做基准测试,至少让编译器优化一下。。。另外,您的程序使用/需要多少ram?我已经尝试过优化级别(从O0到Oast),但在速度上几乎没有差异。删除-g链接选项也不会影响运行时。我不知道我的程序使用/需要多少ram。代码产生多少输出-I/O系统差别很大。
# Makefile for NRMMII
F95 = gfortran
#FINCLUD=
#OBJPATH=./objG95/
# .F90 invokes the fpp preprocessor whereas .f90 does not
# the preprocessor expands source code "macros" and symbolic definitions prior to compilation
# it makes no difference with nrmm30
# compiler flags
#FLAGSC = -ffree-form -fall-intrinsics -fcheck=all -m64 -c
FLAGSC = -std=f95 -v -ffree-form -O0 -fall-intrinsics -fcheck=all -march=native -flto \
-funroll-loops -fno-protect-parens -fstack-arrays -c
# link flags
FLAGSL = -g
#-static Only for windows machines
OBJS = module_nrmmdefs.f90 module_nrmmcntc.f90 module_nrmmdevc.f90 \
module_nrmmdrvc.f90 module_nrmmploc.f90 module_nrmmprdc.f90 \
module_nrmmscnc.f90 module_nrmmstsc.f90 module_nrmmsumc.f90 \
module_nrmmterc.f90 module_nrmmtppc.f90 module_nrmmvehc.f90 \
module_nrmmvers.f90 module_nrmmvppc.f90 module_nrmm_global.f90 \
module_nrmmpbuffs.f90 module_nrmmxmlc.f90 \
main.f90 areal.f90 auxout.f90 crlsno.f90 diag.f90 histogram.f90\
input.f90 miscg95.f90 plow.f90 road.f90 summary.f90 terrain.f90\
vpp.f90 spclxml2.f90 nrmmxml.f90
# special files in nrmmii_misc
# module_spclapfc.f90 spclapf.f90 module_spclresc.f90 spclres.f90 \
# spcljody.f90 spclnode.f90 spclnode1.f90 spclnull.f90 spcltrfs.f90\
# module_nrmmxmlc.f90 nrmmxml.f90 spclxml2.f90 spcltrav.f90
# This defines the compile rules
.SUFFIXES: .o .f90
.f90.o:
$(F95) $(FLAGSC) $*.f90
nrmm30:
$(F95) $(FLAGSL) -o $@ $(OBJS)