Documentation ¶
Index ¶
- type Driver
- func (d *Driver) CopyRestartToSolution() error
- func (d *Driver) EraseDoneFiles() error
- func (d *Driver) IsComputed(stat Status) bool
- func (d *Driver) Load() error
- func (d *Driver) LoadFrom(reader io.Reader) error
- func (d *Driver) MoveSolutionToOld() error
- func (d *Driver) Run(su2call Syscaller) error
- func (d *Driver) Status() Status
- type Parallel
- type Serial
- type Slurm
- type Status
- type Syscaller
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Driver ¶
type Driver struct { Name string // Identifier for the case Options *config.Options // OptionList for the case Config string // Name of the config filename (relative to working directory) Wd string // Working directory of SU2 Stdout string // Where to redict Stdout (relative to working directory). Will be set to Stdout if =="" Stderr string // Where to redirct Stderr (relative to working directory). Will be set to Stderr if =="" OptionList map[config.Option]bool // Which options to print to the config file FancyName string // Longer name (can be used for plot legends or something) }
Driver specifies a case for running SU2.
func (*Driver) CopyRestartToSolution ¶
CopyRestartToSolution copies the restart file to the solution file
func (*Driver) EraseDoneFiles ¶
EraseDoneFiles deletes the solution file and crash file
func (*Driver) IsComputed ¶
IsComputed returns true if the status indicates that the solution has been computed
func (*Driver) Load ¶
Load reads in the config file from the config file listed in the driver structure. Sets the Options and the OptionList.
func (*Driver) LoadFrom ¶
LoadFrom reads a config file from the reader and sets the Options and OptionList fields.
func (*Driver) MoveSolutionToOld ¶
MoveSolutionToOld moves the solution file to d.Options.SolutionFlowFilename + This can be useful for automated tools. (In case of error, the old solution file) is not lost
func (*Driver) Run ¶
Run executes SU2 with the given Syscaller. Run writes the config file (as specified by driver.Config and driver.Wd), uses the Syscaller to get the arguments to exec.Command, and calls exec.Cmd.Run with the provided working directory, stdout, and stderr. If run has an error, an error file will be written.
type Parallel ¶
type Parallel struct {
Cores int
}
Parallel runs SU2 in parallel with the specified number of cores. SU2 must be compiled with MPI
type Slurm ¶
type Slurm struct {
Cores int
}
Slurm runs SU2 via a call to Slurm. This does not work at present.
type Status ¶
type Status int
Status is a type that represents if the computation specified by the driver has been computed, and if not, why not. Note that this is not the status during a call to Driver.Run, but rather used for checking if this config file has already been successfully been completed
type Syscaller ¶
type Syscaller interface { Syscall(d *Driver) (string, []string) // Returns the exec name and the arguments to be called by exec.Command NumCores() int // How many cores does it want }
Syscaller is a provides the system call to execute a Driver. The returned arguments will be passed directly to exec.Cmd