运行和验证

操作步骤

  1. 使用PuTTY工具,以root用户登录服务器。
  2. 执行以下命令设置ARPS执行文件的环境变量。

    export PATH=/path/to/ARPS/arps5.3.4/bin:$PATH

  3. 执行以下命令进入测试目录。

    cd /path/to/ARPS/arps5.3.4/sounding

  4. 执行以下命令运行串行ARPS。

    { time -p arps ../input/arps.input arps.output ; } 2>&1 | tee -a arps.log

  5. 修改输入文件“arps.input”。

    sed -i '211s/nproc_x = 1/nproc_x = 8/g' ../input/arps.input
    sed -i '212s/nproc_y = 1/nproc_y = 16/g' ../input/arps.input

    “nproc_x”表示x方向进程数,“nproc_y”表示y方向进程数,nproc_x、nproc_y的乘积应与6中的np数相等。

  6. 执行以下命令运行并行ARPS。

    { time -p mpirun --allow-run-as-root -mca pml ucx -mca btl ^vader,tcp,openib,uct -x UCX_TLS=self,sm --bind-to core --map-by socket --rank-by core -x UCX_BUILTIN_ALLREDUCE_ALGORITHM=8 -np 128 arps_mpi ../input/arps.input arps.output ; } 2>&1 | tee -a arps_mpi_128.log

    -np参数为使用的总进程数。

  7. 运行完成后执行以下命令查看“arps.log”或“arps_mpi_128.log”文件的最后一行“real”,数值越小性能越优。

    vi arps.log

    vi arps_mpi_128.log
    Note: The following floating-point exceptions are signalling: IEEE_UNDERFLOW_FLAG
    Note: The following floating-point exceptions are signalling: IEEE_UNDERFLOW_FLAG
    real 11.96
    user 1195.39
    sys 145.14