Skip to content

Commit

Permalink
laghos
Browse files Browse the repository at this point in the history
Signed-off-by: vsoch <vsoch@users.noreply.github.com>
  • Loading branch information
vsoch committed Sep 20, 2023
1 parent 412217a commit c5e0938
Show file tree
Hide file tree
Showing 12 changed files with 393 additions and 99 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ jobs:
#["io-ior", "ghcr.io/converged-computing/metric-ior:latest", 120],
## ["network-chatterbug", "ghcr.io/converged-computing/metric-chatterbug:latest", 120],
#["app-nekbone", "ghcr.io/converged-computing/metric-nekbone:latest", 120],
# ["app-ldms", "ghcr.io/converged-computing/metric-ovis-hpc:latest", 120],
["app-ldms", "ghcr.io/converged-computing/metric-ovis-hpc:latest", 120],
["app-amg", "ghcr.io/converged-computing/metric-amg:latest", 120],
["app-kripke", "ghcr.io/converged-computing/metric-kripke:latest", 120],
#["app-pennant", "ghcr.io/converged-computing/metric-pennant:latest", 120],
Expand Down
19 changes: 14 additions & 5 deletions docs/_static/data/metrics.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,40 +3,49 @@
"name": "app-amg",
"description": "parallel algebraic multigrid solver for linear systems arising from problems on unstructured grids",
"family": "solver",
"type": "",
"image": "ghcr.io/converged-computing/metric-amg:latest",
"url": "https://github.com/LLNL/AMG"
},
{
"name": "app-bdas",
"description": "The big data analytic suite contains the K-Means observation label, PCA, and SVM benchmarks.",
"family": "machine-learning",
"type": "",
"image": "ghcr.io/converged-computing/metric-bdas:latest",
"url": "https://asc.llnl.gov/sites/asc/files/2020-09/BDAS_Summary_b4bcf27_0.pdf"
},
{
"name": "app-hpl",
"description": "High-Performance Linpack (HPL)",
"family": "solver",
"type": "",
"image": "ghcr.io/converged-computing/metric-hpl-spack:latest",
"url": "https://www.netlib.org/benchmark/hpl/"
},
{
"name": "app-kripke",
"description": "parallel algebraic multigrid solver for linear systems arising from problems on unstructured grids",
"family": "solver",
"type": "",
"image": "ghcr.io/converged-computing/metric-kripke:latest",
"url": "https://github.com/LLNL/Kripke"
},
{
"name": "app-laghos",
"description": "LAGrangian High-Order Solver",
"family": "solver",
"image": "ghcr.io/converged-computing/metric-laghos:latest",
"url": "https://github.com/CEED/Laghos"
},
{
"name": "app-lammps",
"description": "LAMMPS molecular dynamic simulation",
"family": "simulation",
"type": "",
"image": "ghcr.io/converged-computing/metric-lammps:latest",
"url": "https://www.lammps.org/"
},
{
"name": "app-ldms",
"description": "provides LDMS, a low-overhead, low-latency framework for collecting, transferring, and storing metric data on a large distributed computer system.",
"family": "performance",
"image": "ghcr.io/converged-computing/metric-ovis-hpc:latest",
"url": "https://github.com/ovis-hpc/ovis"
}
]
2 changes: 0 additions & 2 deletions docs/_static/data/table.html
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,6 @@
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Family</th>
<th>Description</th>
<th>Container</th>
Expand All @@ -440,7 +439,6 @@
}
return "<a href='" + row['url'] + "' target='_blank'>" + data +"</a>";},
},
{ data: "type"},
{ data: "family"},
{ data: "description"},
{ data: "image",
Expand Down
Empty file modified docs/make.bat
100644 → 100755
Empty file.
1 change: 0 additions & 1 deletion hack/docs-gen/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ type MetricOutput struct {
Name string `json:"name"`
Description string `json:"description"`
Family string `json:"family"`
Type string `json:"type"`
Image string `json:"image"`
Url string `json:"url"`
}
Expand Down
94 changes: 47 additions & 47 deletions pkg/metrics/app/hpl.go
Original file line number Diff line number Diff line change
Expand Up @@ -271,63 +271,63 @@ func (m HPL) PrepareContainers(
memoryCmd := `awk '/MemFree/ { printf "%.3f \n", $2/1024/1024 }' /proc/meminfo`

preBlock := `
# Source spack environment
. /opt/spack-environment/activate.sh
# Source spack environment
. /opt/spack-environment/activate.sh
# Calculate memory, if not defined
memory=%d
if [[ $memory -eq 0 ]]; then
memory=$(%s)
fi
# Calculate memory, if not defined
memory=%d
if [[ $memory -eq 0 ]]; then
memory=$(%s)
fi
echo "Memory is ${memory}"
echo "Memory is ${memory}"
np=%d
pods=%d
# Tasks per node, not total
tasks=$(nproc)
if [[ $np -eq 0 ]]; then
np=$(( $pods*$tasks ))
fi
np=%d
pods=%d
# Tasks per node, not total
tasks=$(nproc)
if [[ $np -eq 0 ]]; then
np=$(( $pods*$tasks ))
fi
echo "Number of tasks (nproc on one node) is $tasks"
echo "Number of tasks total (across $pods nodes) is $np"
echo "Number of tasks (nproc on one node) is $tasks"
echo "Number of tasks total (across $pods nodes) is $np"
blocksize=%d
ratio=%s
blocksize=%d
ratio=%s
# This calculates the compute value - retrieved from tutorials in /opt/view/bin
compute_script="compute_N -m ${memory} -NB ${blocksize} -r ${ratio} -N ${pods}"
echo $compute_script
# This is the size, variable "N" in the hpl.dat (not confusing or anything)
size=$(${compute_script})
echo "Compute size is ${size}"
# This calculates the compute value - retrieved from tutorials in /opt/view/bin
compute_script="compute_N -m ${memory} -NB ${blocksize} -r ${ratio} -N ${pods}"
echo $compute_script
# This is the size, variable "N" in the hpl.dat (not confusing or anything)
size=$(${compute_script})
echo "Compute size is ${size}"
# Define rest of envars we need for template
row_or_colmajor_pmapping=%d
pfact=%d
nbmin=%d
ndiv=%d
rfact=%d
bcast=%d
depth=%d
swap=%d
swapping_threshold=%d
L1_transposed=%d
U_transposed=%d
mem_alignment=%d
# Define rest of envars we need for template
row_or_colmajor_pmapping=%d
pfact=%d
nbmin=%d
ndiv=%d
rfact=%d
bcast=%d
depth=%d
swap=%d
swapping_threshold=%d
L1_transposed=%d
U_transposed=%d
mem_alignment=%d
# Write the input file (this parses environment variables too)
cat <<EOF > ./hpl.dat
%s
EOF
# Write the input file (this parses environment variables too)
cat <<EOF > ./hpl.dat
%s
EOF
cp ./hostlist.txt ./hostnames.txt
rm ./hostlist.txt
%s
cp ./hostlist.txt ./hostnames.txt
rm ./hostlist.txt
%s
echo "%s"
# This is in /root/hpl/bin/linux/xhpl
echo "%s"
# This is in /root/hpl/bin/linux/xhpl
`

postBlock := `
Expand Down
129 changes: 129 additions & 0 deletions pkg/metrics/app/laghos.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
/*
Copyright 2023 Lawrence Livermore National Security, LLC
(c.f. AUTHORS, NOTICE.LLNS, COPYING)
SPDX-License-Identifier: MIT
*/

package application

import (
"fmt"

api "github.com/converged-computing/metrics-operator/api/v1alpha1"
"k8s.io/apimachinery/pkg/util/intstr"

"github.com/converged-computing/metrics-operator/pkg/metadata"
metrics "github.com/converged-computing/metrics-operator/pkg/metrics"
"github.com/converged-computing/metrics-operator/pkg/specs"
)

type Laghos struct {
metrics.LauncherWorker

// Custom Options
command string
prefix string
}

// I think this is a simulation?
func (m Laghos) Family() string {
return metrics.SolverFamily
}

func (m Laghos) Url() string {
return "https://github.com/CEED/Laghos"
}

// Set custom options / attributes for the metric
func (m *Laghos) SetOptions(metric *api.Metric) {
m.ResourceSpec = &metric.Resources
m.AttributeSpec = &metric.Attributes

// Set user defined values or fall back to defaults
m.prefix = "/bin/bash"
m.command = "mpirun -np 4 --hostfile ./hostlist.txt ./laghos"
m.Workdir = "/workflow/laghos"

// This could be improved :)
command, ok := metric.Options["command"]
if ok {
m.command = command.StrVal
}
workdir, ok := metric.Options["workdir"]
if ok {
m.Workdir = workdir.StrVal
}
prefix, ok := metric.Options["prefix"]
if ok {
m.prefix = prefix.StrVal
}
}

// Exported options and list options
func (m Laghos) Options() map[string]intstr.IntOrString {
return map[string]intstr.IntOrString{
"command": intstr.FromString(m.command),
"prefix": intstr.FromString(m.prefix),
"workdir": intstr.FromString(m.Workdir),
}
}

func (m Laghos) PrepareContainers(
spec *api.MetricSet,
metric *metrics.Metric,
) []*specs.ContainerSpec {

// Metadata to add to beginning of run
meta := metrics.Metadata(spec, metric)
hosts := m.GetHostlist(spec)
prefix := m.GetCommonPrefix(meta, m.command, hosts)

preBlock := `
echo "%s"
`

postBlock := `
echo "%s"
%s
`
command := fmt.Sprintf("%s ./problem.sh", m.prefix)
interactive := metadata.Interactive(spec.Spec.Logging.Interactive)
preBlock = prefix + fmt.Sprintf(preBlock, metadata.Separator)
postBlock = fmt.Sprintf(postBlock, metadata.CollectionEnd, interactive)

// Entrypoint for the launcher
launcherEntrypoint := specs.EntrypointScript{
Name: specs.DeriveScriptKey(m.LauncherScript),
Path: m.LauncherScript,
Pre: preBlock,
Command: command,
Post: postBlock,
}

// Entrypoint for the worker
workerEntrypoint := specs.EntrypointScript{
Name: specs.DeriveScriptKey(m.WorkerScript),
Path: m.WorkerScript,
Pre: prefix,
Command: "sleep infinity",
}

// Container spec for the launcher
launcherContainer := m.GetLauncherContainerSpec(launcherEntrypoint)
workerContainer := m.GetWorkerContainerSpec(workerEntrypoint)

// Return the script templates for each of launcher and worker
return []*specs.ContainerSpec{&launcherContainer, &workerContainer}
}

func init() {
launcher := metrics.LauncherWorker{
Identifier: "app-laghos",
Summary: "LAGrangian High-Order Solver",
Container: "ghcr.io/converged-computing/metric-laghos:latest",
}

Laghos := Laghos{LauncherWorker: launcher}
metrics.Register(&Laghos)
}
Loading

0 comments on commit c5e0938

Please sign in to comment.