Skip to content

Commit bea2ec1

Browse files
authored
Merge pull request #75 from gvallee/mpi_manifest
Finish support for Manifest and base images from the library
2 parents 365331a + 5b89e85 commit bea2ec1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+705
-745
lines changed

README.syvalidate.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ The tool achieves this by installing a specific version of MPI on the host and a
5555
(currently based on Ubuntu) with a specific version of MPI that will run certain MPI programs within it to test the comptibility.
5656

5757
The version of a given MPI implementation to be used throughout an experiment is defined in a configuration file. For example, a
58-
default configuration file for Open MPI is available in `etc/openmpi.conf` and a default configuration file for MPICH is available
59-
in `etc/mpich.conf`. Users *must* specify the configuration file on the command line when running the tool (see examples).
58+
default configuration file for Open MPI is available in `etc/sympi_openmpi.conf` and a default configuration file for MPICH is available
59+
in `etc/sympi_mpich.conf`. Users *must* specify the configuration file on the command line when running the tool (see examples).
6060

6161
Once the tool has completed, view the ``openmpi-results.txt``/``mpich-results.txt`` to view results of various combinations of the
6262
versions and pick the host-container version combination most suitable to you.
@@ -71,39 +71,39 @@ At the moment, we support two tests:
7171

7272
## Run the tool with the default Open MPI versions and a simple helloworld test
7373

74-
``syvalidate -configfile `pwd`/etc/openmpi.conf``
74+
``syvalidate -configfile `pwd`/etc/sympi_openmpi.conf``
7575

7676
## Run the tool with the default Open MPI versions and Netpipe
7777

78-
``syvalidate -configfile `pwd`/etc/openmpi.conf -netpipe``
78+
``syvalidate -configfile `pwd`/etc/sympi_openmpi.conf -netpipe``
7979

8080
## Run the tool with the default Open MPI versions and IMB
8181

82-
``syvalidate -configfile `pwd`/etc/openmpi.conf -imb``
82+
``syvalidate -configfile `pwd`/etc/sympi_openmpi.conf -imb``
8383

8484
## Run the tool with the default MPICH versions and a simple helloworld test
8585

86-
``syvalidate -configfile `pwd`/etc/mpich.conf``
86+
``syvalidate -configfile `pwd`/etc/sympi_mpich.conf``
8787

8888
## Run the tool with the default MPICH versions and Netpipe
8989

90-
``syvalidate -configfile `pwd`/etc/mpich.conf -netpipe``
90+
``syvalidate -configfile `pwd`/etc/sympi_mpich.conf -netpipe``
9191

9292
## Run the tool with the default MPICH versions and IMB
9393

94-
``syvalidate -configfile `pwd`/etc/mpich.conf -imb``
94+
``syvalidate -configfile `pwd`/etc/sympi_mpich.conf -imb``
9595

9696
## Run the tool with the default Intel MPI versions and a simple helloworld test
9797

98-
``syvalidate -configfile `pwd`/etc/intel.conf``
98+
``syvalidate -configfile `pwd`/etc/sympi_intel.conf``
9999

100100
## Run the tool with the default Intel MPI versions and Netpipe
101101

102-
``syvalidate -configfile `pwd`/etc/intel.conf -netpipe``
102+
``syvalidate -configfile `pwd`/etc/sympi_intel.conf -netpipe``
103103

104104
## Run the tool with the default Intel MPI versions and collective operation test
105105

106-
``syvalidate -configfile `pwd`/etc/intel.conf -imb``
106+
``syvalidate -configfile `pwd`/etc/sympi_intel.conf -imb``
107107

108108
These commands will run various MPI programs to test the compatibility between different versions:
109109
- a basic HelloWorld test,

cmd/sycontainerize/sycontainerize.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@ import (
1313
"os"
1414
"strconv"
1515

16+
"github.com/gvallee/go_util/pkg/util"
17+
"github.com/gvallee/kv/pkg/kv"
1618
"github.com/sylabs/singularity-mpi/internal/pkg/checker"
17-
"github.com/sylabs/singularity-mpi/internal/pkg/kv"
1819
"github.com/sylabs/singularity-mpi/internal/pkg/launcher"
1920
"github.com/sylabs/singularity-mpi/internal/pkg/sy"
2021
"github.com/sylabs/singularity-mpi/internal/pkg/sys"
21-
util "github.com/sylabs/singularity-mpi/internal/pkg/util/file"
22-
"github.com/sylabs/singularity-mpi/pkg/containizer"
22+
"github.com/sylabs/singularity-mpi/pkg/containerizer"
2323
)
2424

2525
func main() {
@@ -92,7 +92,7 @@ func main() {
9292
}
9393

9494
log.Println("* Creating container for your application...")
95-
_, err = containizer.ContainerizeApp(&sysCfg)
95+
_, err = containerizer.ContainerizeApp(&sysCfg)
9696
if err != nil {
9797
log.Fatalf("failed to create container for app: %s", err)
9898
}

cmd/sympi/sympi.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,16 @@ import (
1616
"regexp"
1717
"strings"
1818

19+
"github.com/gvallee/go_util/pkg/util"
20+
"github.com/gvallee/kv/pkg/kv"
1921
"github.com/sylabs/singularity-mpi/internal/pkg/buildenv"
2022
"github.com/sylabs/singularity-mpi/internal/pkg/builder"
2123
"github.com/sylabs/singularity-mpi/internal/pkg/checker"
2224
"github.com/sylabs/singularity-mpi/internal/pkg/implem"
23-
"github.com/sylabs/singularity-mpi/internal/pkg/kv"
2425
"github.com/sylabs/singularity-mpi/internal/pkg/manifest"
2526
"github.com/sylabs/singularity-mpi/internal/pkg/sy"
2627
"github.com/sylabs/singularity-mpi/internal/pkg/sympierr"
2728
"github.com/sylabs/singularity-mpi/internal/pkg/sys"
28-
util "github.com/sylabs/singularity-mpi/internal/pkg/util/file"
2929
"github.com/sylabs/singularity-mpi/pkg/sympi"
3030
)
3131

@@ -367,7 +367,7 @@ func installSingularity(id string, params []string, sysCfg *sys.Config) error {
367367

368368
func listAvail(sysCfg *sys.Config) error {
369369
fmt.Println("The following versions of Singularity can be installed:")
370-
cfgFile := filepath.Join(sysCfg.EtcDir, "singularity.conf")
370+
cfgFile := filepath.Join(sysCfg.EtcDir, "sympi_singularity.conf")
371371
kvs, err := kv.LoadKeyValueConfig(cfgFile)
372372
if err != nil {
373373
return fmt.Errorf("failed to load configuration from %s: %s", cfgFile, err)
@@ -377,7 +377,7 @@ func listAvail(sysCfg *sys.Config) error {
377377
}
378378

379379
fmt.Println("The following versions of Open MPI can be installed:")
380-
cfgFile = filepath.Join(sysCfg.EtcDir, "openmpi.conf")
380+
cfgFile = filepath.Join(sysCfg.EtcDir, sys.GetMPIConfigFileName("openmpi"))
381381
kvs, err = kv.LoadKeyValueConfig(cfgFile)
382382
if err != nil {
383383
return fmt.Errorf("failed to load configuration from %s: %s", cfgFile, err)
@@ -387,7 +387,7 @@ func listAvail(sysCfg *sys.Config) error {
387387
}
388388

389389
fmt.Println("The following versions of MPICH can be installed:")
390-
cfgFile = filepath.Join(sysCfg.EtcDir, "mpich.conf")
390+
cfgFile = filepath.Join(sysCfg.EtcDir, sys.GetMPIConfigFileName("mpich"))
391391
kvs, err = kv.LoadKeyValueConfig(cfgFile)
392392
if err != nil {
393393
return fmt.Errorf("failed to load configuration from %s: %s", cfgFile, err)

cmd/syrun/syrun.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import (
1010
"log"
1111
"os"
1212

13-
util "github.com/sylabs/singularity-mpi/internal/pkg/util/file"
13+
"github.com/gvallee/go_util/pkg/util"
1414
"github.com/sylabs/singularity-mpi/pkg/sympi"
1515
)
1616

cmd/syvalidate/syvalidate.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,19 @@ import (
1515
"path/filepath"
1616
"strconv"
1717

18+
"github.com/gvallee/go_util/pkg/util"
19+
"github.com/gvallee/kv/pkg/kv"
1820
"github.com/sylabs/singularity-mpi/internal/pkg/app"
1921
"github.com/sylabs/singularity-mpi/internal/pkg/buildenv"
2022
"github.com/sylabs/singularity-mpi/internal/pkg/checker"
2123
"github.com/sylabs/singularity-mpi/internal/pkg/configparser"
2224
cfg "github.com/sylabs/singularity-mpi/internal/pkg/configparser"
2325
"github.com/sylabs/singularity-mpi/internal/pkg/container"
24-
"github.com/sylabs/singularity-mpi/internal/pkg/kv"
2526
"github.com/sylabs/singularity-mpi/internal/pkg/launcher"
2627
"github.com/sylabs/singularity-mpi/internal/pkg/results"
2728
"github.com/sylabs/singularity-mpi/internal/pkg/sy"
2829
"github.com/sylabs/singularity-mpi/internal/pkg/syexec"
2930
"github.com/sylabs/singularity-mpi/internal/pkg/sys"
30-
util "github.com/sylabs/singularity-mpi/internal/pkg/util/file"
3131
exp "github.com/sylabs/singularity-mpi/pkg/experiments"
3232
)
3333

@@ -161,7 +161,7 @@ func run(experiments []exp.Config, sysCfg *sys.Config, syConfig *sy.MPIToolConfi
161161
log.Printf("Running experiment %d/%d with host MPI %s and container MPI %s\n", i+1, sysCfg.Nrun, e.HostMPI.Version, e.ContainerMPI.Version)
162162
newRes, err = runExperiment(e, sysCfg, syConfig)
163163
if err != nil {
164-
log.Fatalf("failure during the execution of experiment: %s", err)
164+
log.Printf("[ERROR] failure during the execution of experiment: %s", err)
165165
}
166166
newResults = append(newResults, newRes)
167167

@@ -261,7 +261,7 @@ func main() {
261261
}
262262

263263
/* Argument parsing */
264-
configFile := flag.String("configfile", sysCfg.EtcDir+"/openmpi.conf", "Path to the configuration file specifying which versions of a given implementation of MPI to test")
264+
configFile := flag.String("configfile", sysCfg.EtcDir+"/sympi_openmpi.conf", "Path to the configuration file specifying which versions of a given implementation of MPI to test")
265265
outputFile := flag.String("outputFile", "", "Full path to the output file")
266266
verbose := flag.Bool("v", false, "Enable verbose mode")
267267
netpipe := flag.Bool("netpipe", false, "Run NetPipe as test")
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

etc/sympi_ubuntu.conf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
eoan library://vallee/ubuntu/19.10:latest
2+
disco library://vallee/ubuntu/19.04:latest
3+
bionic library://vallee/ubuntu/18.04:latest
4+
xenial library://vallee/ubuntu/16.04:latest

go.mod

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
11
module github.com/sylabs/singularity-mpi
22

3-
go 1.13
3+
go 1.11
4+
5+
require (
6+
github.com/gvallee/go_util v1.0.0
7+
github.com/gvallee/kv v1.0.0
8+
)

go.sum

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
github.com/gvallee/go_util v1.0.0 h1:N1Op0Nscjv0mht2NJfGfMDe+2+ptfH1lKseb52jQkbY=
2+
github.com/gvallee/go_util v1.0.0/go.mod h1:fTexpwdH/n05Ziu0TXJIQsr7E+46QpBxNdeOOsyC0/s=
3+
github.com/gvallee/kv v1.0.0 h1:QE3Ua8JewroqJqc+J9RWtL7KUu7rQmfLfxlBVY5t1ko=
4+
github.com/gvallee/kv v1.0.0/go.mod h1:sfSclfFfLV+Y+9e9FayIbBUOtvbt1779S6q52bSSU5E=

internal/pkg/app/app.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,18 @@ type Info struct {
2121

2222
// InstallCmd is the command to use to install the application
2323
InstallCmd string
24+
25+
// ExpectedRankOutput specifies what is the expected output from EACH rank
26+
// A few keyword can be used for runtime-specific parameters
27+
// Use '#NP' to specify the job size
28+
// Use '#RANK' to specify the rank number
29+
ExpectedRankOutput string
30+
31+
// ExpectedNote specifies what is the expected note from an application
32+
//
33+
// A note is the result of an application-specific parsing/analysis of the
34+
// application's output that is specific to this framework. For instance,
35+
// for netpipe, the expected note is something like 'max bandwidth: 44.773 Gbps; latency: 50.609 nsecs'
36+
// todo: should support regexp here
37+
ExpectedNote string
2438
}

internal/pkg/app/helloworld.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,6 @@ func GetHelloworld(sysCfg *sys.Config) Info {
1919
hw.Name = "helloworld"
2020
hw.BinPath = "/opt/mpitest"
2121
hw.Source = "file://" + filepath.Join(sysCfg.TemplateDir, "mpitest.c")
22+
hw.ExpectedRankOutput = "Hello, I am rank #RANK/#NP"
2223
return hw
2324
}

internal/pkg/app/netpipe.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,6 @@ func GetNetpipe(sysCfg *sys.Config) Info {
1717
netpipe.BinPath = "/opt/NetPIPE-5.1.4/NPmpi"
1818
netpipe.Source = "http://netpipe.cs.ksu.edu/download/NetPIPE-5.1.4.tar.gz"
1919
netpipe.InstallCmd = "make mpi"
20+
netpipe.ExpectedNote = "max bandwidth: "
2021
return netpipe
2122
}

internal/pkg/autotools/autotools.go

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@
66
package autotools
77

88
import (
9-
"bytes"
109
"fmt"
1110
"log"
12-
"os/exec"
1311
"path/filepath"
12+
"strings"
1413

15-
util "github.com/sylabs/singularity-mpi/internal/pkg/util/file"
14+
"github.com/gvallee/go_util/pkg/util"
15+
"github.com/sylabs/singularity-mpi/internal/pkg/syexec"
1616
)
1717

1818
// Config represents the configuration of the autotools-compliant software to configure/compile/install
@@ -45,17 +45,18 @@ func Configure(cfg *Config) error {
4545
}
4646

4747
log.Printf("-> Running 'configure': %s %s\n", configurePath, cmdArgs)
48-
var stdout, stderr bytes.Buffer
49-
cmd := exec.Command(configurePath)
48+
var cmd syexec.SyCmd
49+
cmd.BinPath = "./configure"
50+
cmd.ManifestName = "configure"
51+
cmd.ManifestDir = cfg.Install
5052
if len(cmdArgs) > 0 {
51-
cmd = exec.Command(configurePath, cmdArgs...)
53+
cmd.ManifestData = []string{strings.Join(cmdArgs, " ")}
54+
cmd.CmdArgs = cmdArgs
5255
}
53-
cmd.Dir = cfg.Source
54-
cmd.Stderr = &stderr
55-
cmd.Stdout = &stdout
56-
err := cmd.Run()
57-
if err != nil {
58-
return fmt.Errorf("command failed: %s - stdout: %s - stderr: %s", err, stdout.String(), stderr.String())
56+
cmd.ExecDir = cfg.Source
57+
res := cmd.Run()
58+
if res.Err != nil {
59+
return fmt.Errorf("command failed: %s - stdout: %s - stderr: %s", res.Err, res.Stdout, res.Stderr)
5960
}
6061

6162
return nil

0 commit comments

Comments
 (0)