-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #126 from gvallee/issue116
Addresses #116 - tool to make it easier to get a trace
- Loading branch information
Showing
5 changed files
with
64 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
// | ||
// Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. | ||
// | ||
// See LICENSE.txt for license information | ||
// | ||
|
||
package main | ||
|
||
import ( | ||
"fmt" | ||
"os" | ||
"os/exec" | ||
"path/filepath" | ||
"runtime" | ||
|
||
"github.com/gvallee/go_exec/pkg/advexec" | ||
) | ||
|
||
func main() { | ||
_, filename, _, _ := runtime.Caller(0) | ||
codeBaseDir := filepath.Join(filepath.Dir(filename), "..", "..", "..") | ||
|
||
libraries := []string{"liballtoallv_counts.so", "liballtoallv_backtrace.so", "liballtoallv_exec_timings.so", "liballtoallv_late_arrival.so", "liballtoallv_location.so"} | ||
for _, lib := range libraries { | ||
cmdArgs := os.Args[1:] | ||
libPath := filepath.Join(codeBaseDir, "src", "alltoallv", lib) | ||
cmdArgs = append([]string{"-x", "LD_PRELOAD=" + libPath}, cmdArgs...) | ||
var cmd advexec.Advcmd | ||
mpirunPath, err := exec.LookPath("mpirun") | ||
if err != nil { | ||
fmt.Printf("unable to find mpirun: %s\n", err) | ||
os.Exit(1) | ||
} | ||
cmd.BinPath = mpirunPath | ||
cmd.CmdArgs = cmdArgs | ||
cmd.Env = os.Environ() | ||
fmt.Printf("Executing: %s %s\n", cmd.BinPath, cmd.CmdArgs) | ||
res := cmd.Run() | ||
if res.Err != nil { | ||
fmt.Printf("Unable to run the command: %s - stdout: %s - stderr: %s\n", res.Err, res.Stdout, res.Stderr) | ||
os.Exit(1) | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
github.com/gomarkdown/markdown v0.0.0-20200609195525-3f9352745725 h1:X6sZdr+t2E2jwajTy/FfXbmAKPFTYxEq9hiFgzMiuPQ= | ||
github.com/gomarkdown/markdown v0.0.0-20200609195525-3f9352745725/go.mod h1:aii0r/K0ZnHv7G0KF7xy1v0A7s2Ljrb5byB7MO5p6TU= | ||
github.com/gvallee/go_util v1.0.0 h1:N1Op0Nscjv0mht2NJfGfMDe+2+ptfH1lKseb52jQkbY= | ||
github.com/gvallee/go_util v1.0.0/go.mod h1:fTexpwdH/n05Ziu0TXJIQsr7E+46QpBxNdeOOsyC0/s= | ||
github.com/gvallee/go_exec v0.0.4 h1:6xJ9iMMGP7gWFLWET6XpIdzov/9SqpZ9zpjHczSH24Q= | ||
github.com/gvallee/go_exec v0.0.4/go.mod h1:4AwegK9oPhkgwkd0rjlTwxRw//8cW4pPcCSFLZ6+LZg= | ||
github.com/gvallee/go_util v1.0.1 h1:Ch/PpAlHrHNmL2Upaxif/Nt4CqtaazDyTXh5fIhutJo= | ||
github.com/gvallee/go_util v1.0.1/go.mod h1:fTexpwdH/n05Ziu0TXJIQsr7E+46QpBxNdeOOsyC0/s= | ||
golang.org/dl v0.0.0-20190829154251-82a15e2f2ead/go.mod h1:IUMfjQLJQd4UTqG1Z90tenwKoCX93Gn3MAQJMOSBsDQ= |