#!/usr/bin/env ruby
#
# 表題  DCPAM6 benchmark 結果の描画
#
# 履歴  2025/10/04  竹広真一
#
require "numru/dcl"
include NumRu

filelst=["dcpam_hs94_bench_T85L20_OMP1NPV1.log",\
         "dcpam_hs94_bench_T85L20_OMP2NPV1.log",\
         "dcpam_hs94_bench_T85L20_OMP4NPV1.log",\
         "dcpam_hs94_bench_T85L20_OMP1NPV2.log",\
         "dcpam_hs94_bench_T85L20_OMP1NPV4.log",\
         "dcpam5_hs94_bench_T85L20_OMP1NPV1.log"]

index=[1,2,3,1,1,3]
type=[13,13,13,23,43,23]

DCL.gropn(1)
DCL.grfrm
DCL.grsvpt( 0.2, 0.8, 0.2, 0.8 )
DCL.grswnd( 0.5, 64.0, 100.0, 2000.0 )
DCL.grstrn(4)
DCL.grstrf
DCL.ussttl( '#core', '', 'elapsed time','s')
DCL.usdaxs

i=0
filelst.each do |file|
  omp=[]
  mpi=[]
  core=[]
  etime=[]

  File.open(file){|f|
    f.each_line{|line|
      if line[0] != "#" then
        ary = line.chomp.split
        if ary[0] != nil then
          omp.push(ary[0].to_i)
          mpi.push(ary[1].to_i)
          core.push(ary[1].to_i*ary[0].to_i)
          etime.push(ary[2].to_f)
        end
      end
    }
  }
  # p omp
  # p mpi
  # p etime

  DCL.uulinz( core, etime, index[i], type[i] )
  i=i+1
end

DCL.grcls

