Skip to content

Commit

Permalink
Rename Phase Two -> Parsec
Browse files Browse the repository at this point in the history
Update variable names, comments where "Phase Two" is
mentioned to reference PArSEC instead

Signed-off-by: Michael Maurer <[email protected]>
  • Loading branch information
maurermi authored and HalosGhost committed May 7, 2024
1 parent 9db8e5c commit 41ea652
Show file tree
Hide file tree
Showing 9 changed files with 31 additions and 31 deletions.
6 changes: 3 additions & 3 deletions common/normalizedtestrun.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ func (tr *TestRun) NormalizedConfigWithAgentData(
cpu,
SystemRoleAtomizerCliWatchtower,
SystemRoleTwoPhaseGen,
SystemRolePhaseTwoGen,
SystemRoleParsecGen,
),
)
trc.SentinelCPU = int(
Expand Down Expand Up @@ -198,7 +198,7 @@ func (tr *TestRun) NormalizedConfigWithAgentData(
ram,
SystemRoleAtomizerCliWatchtower,
SystemRoleTwoPhaseGen,
SystemRolePhaseTwoGen,
SystemRoleParsecGen,
) / 1024,
)
trc.SentinelRAM = int(
Expand Down Expand Up @@ -236,7 +236,7 @@ func (tr *TestRun) NormalizedConfigWithAgentData(
count,
SystemRoleAtomizerCliWatchtower,
SystemRoleTwoPhaseGen,
SystemRolePhaseTwoGen,
SystemRoleParsecGen,
)
trc.SentinelCount = getIntValueForAnyKey(
count,
Expand Down
10 changes: 5 additions & 5 deletions common/system.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const SystemRoleTwoPhaseGen SystemRole = "twophase-gen"
const SystemRoleAgent SystemRole = "agent"
const SystemRoleRuntimeLockingShard SystemRole = "runtime_locking_shard"
const SystemRoleTicketMachine SystemRole = "ticket_machine"
const SystemRolePhaseTwoGen SystemRole = "phasetwo_bench"
const SystemRoleParsecGen SystemRole = "parsec_bench"
const SystemRoleLoadGen SystemRole = "loadgen"

type SystemArchitectureRole struct {
Expand Down Expand Up @@ -223,8 +223,8 @@ var AvailableArchitectures = []SystemArchitecture{
},
},
{
ID: "phase-two",
Name: "Phase Two Programmability",
ID: "parsec",
Name: "PArSEC",
Roles: []SystemArchitectureRole{
{
Role: SystemRoleAgent,
Expand All @@ -242,7 +242,7 @@ var AvailableArchitectures = []SystemArchitecture{
ShortTitle: "Ticketer",
},
{
Role: SystemRolePhaseTwoGen,
Role: SystemRoleParsecGen,
Title: "Generator",
ShortTitle: "Gen",
},
Expand All @@ -261,7 +261,7 @@ var AvailableArchitectures = []SystemArchitecture{
RaftMaxBatch: 100000,
SnapshotDistance: 0,
ShardReplicationFactor: 3,
Architecture: "phase-two",
Architecture: "parsec",
SampleCount: 315,
LoadGenOutputCount: 2,
LoadGenInputCount: 2,
Expand Down
26 changes: 13 additions & 13 deletions coordinator/testruns/architecture_phase_two.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,20 @@ import (
"github.com/mit-dci/opencbdc-tctl/common"
)

func (t *TestRunManager) IsPhaseTwo(architectureID string) bool {
return strings.HasPrefix(architectureID, "phase-two")
func (t *TestRunManager) IsParsec(architectureID string) bool {
return strings.HasPrefix(architectureID, "parsec")
}

// RunBinariesPhaseTwo will orchestrate the running of all roles for a full
// cycle test with the phase two architecture
func (t *TestRunManager) RunBinariesPhaseTwo(
// RunBinariesParsec will orchestrate the running of all roles for a full
// cycle test with the PArSEC architecture
func (t *TestRunManager) RunBinariesParsec(
tr *common.TestRun,
envs map[int32][]byte,
cmd chan *common.ExecutedCommand,
failures chan *common.ExecutedCommand,
) error {
// Build the sequence of commands to start
startSequence := t.CreateStartSequencePhaseTwo(tr)
startSequence := t.CreateStartSequenceParsec(tr)

// Execute the sequence of commands to start
allCmds, terminated, err := t.executeStartSequence(
Expand Down Expand Up @@ -76,7 +76,7 @@ func (t *TestRunManager) RunBinariesPhaseTwo(
case <-time.After(timeout):
}

err = t.CleanupCommandsPhaseTwo(tr, allCmds, envs)
err = t.CleanupCommandsParsec(tr, allCmds, envs)
if err != nil {
return err
}
Expand All @@ -87,7 +87,7 @@ func (t *TestRunManager) RunBinariesPhaseTwo(
return nil
}

func (t *TestRunManager) CleanupCommandsPhaseTwo(
func (t *TestRunManager) CleanupCommandsParsec(
tr *common.TestRun,
allCmds []runningCommand,
envs map[int32][]byte,
Expand All @@ -109,7 +109,7 @@ func (t *TestRunManager) CleanupCommandsPhaseTwo(
t.WriteLog(tr, "Interrupting all loadgens")
err := t.BreakAllCmds(
tr,
t.FilterCommandsByRole(tr, allCmds, common.SystemRolePhaseTwoGen),
t.FilterCommandsByRole(tr, allCmds, common.SystemRoleParsecGen),
)
if err != nil {
return err
Expand All @@ -132,7 +132,7 @@ func (t *TestRunManager) CleanupCommandsPhaseTwo(
t.WriteLog(tr, "Terminating all loadgens")
err = t.TerminateAllCmds(
tr,
t.FilterCommandsByRole(tr, allCmds, common.SystemRolePhaseTwoGen),
t.FilterCommandsByRole(tr, allCmds, common.SystemRoleParsecGen),
)
if err != nil {
return err
Expand Down Expand Up @@ -183,11 +183,11 @@ func (t *TestRunManager) CleanupCommandsPhaseTwo(
return nil
}

// CreateStartSequencePhaseTwo uses the test run configuration to determine in
// CreateStartSequenceParsec uses the test run configuration to determine in
// which sequence the agent roles should be started, and returns an array of
// startSequenceEntry elements that are ordered in the sequence in which they
// should be started up.
func (t *TestRunManager) CreateStartSequencePhaseTwo(
func (t *TestRunManager) CreateStartSequenceParsec(
tr *common.TestRun,
) []startSequenceEntry {
// Determine the start sequence
Expand Down Expand Up @@ -236,7 +236,7 @@ func (t *TestRunManager) CreateStartSequencePhaseTwo(

// Start all load generators
startSequence = append(startSequence, startSequenceEntry{
roles: t.GetAllRolesSorted(tr, common.SystemRolePhaseTwoGen),
roles: t.GetAllRolesSorted(tr, common.SystemRoleParsecGen),
timeout: roleStartTimeout,
waitForPort: []PortIncrement{}, // Don't wait for anything - loadgens don't accept incoming
})
Expand Down
8 changes: 4 additions & 4 deletions coordinator/testruns/commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ var roleBinaries = map[common.SystemRole]string{
common.SystemRoleAgent: "sources/build/src/parsec/agent/agentd",
common.SystemRoleRuntimeLockingShard: "sources/build/src/parsec/runtime_locking_shard/runtime_locking_shardd",
common.SystemRoleTicketMachine: "sources/build/src/parsec/ticket_machine/ticket_machined",
common.SystemRolePhaseTwoGen: "sources/build/tools/bench/parsec/evm/evm_bench",
common.SystemRoleParsecGen: "sources/build/tools/bench/parsec/evm/evm_bench",
}

// roleParameters is a map from the system role to the parameters we have to
Expand Down Expand Up @@ -78,7 +78,7 @@ var roleParameters = map[common.SystemRole][]string{
"--loglevel=%LOGLEVEL%",
"--component_id=%IDX%",
},
common.SystemRolePhaseTwoGen: []string{
common.SystemRoleParsecGen: []string{
"--component_id=%IDX%",
"--loadgen_accounts=%ACCOUNTS%",
"--loadgen_agent_affinity=%LGAFFINITY%",
Expand Down Expand Up @@ -373,8 +373,8 @@ func (t *TestRunManager) RunBinaries(
return t.RunBinariesAtomizer(tr, envs, cmd, failures)
} else if t.Is2PC(tr.Architecture) {
return t.RunBinariesTwoPhase(tr, envs, cmd, failures)
} else if t.IsPhaseTwo(tr.Architecture) {
return t.RunBinariesPhaseTwo(tr, envs, cmd, failures)
} else if t.IsParsec(tr.Architecture) {
return t.RunBinariesParsec(tr, envs, cmd, failures)
}
return fmt.Errorf("unknown architecture: [%s]", tr.Architecture)
}
2 changes: 1 addition & 1 deletion coordinator/testruns/execute.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ func (t *TestRunManager) ExecuteTestRun(tr *common.TestRun) {
}
}

if !t.IsPhaseTwo(tr.Architecture) {
if !t.IsParsec(tr.Architecture) {
// Generate the configuration file the system needs based on the
// configured
// parameters in the UI
Expand Down
2 changes: 1 addition & 1 deletion coordinator/testruns/parameters.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ func (t *TestRunManager) SubstituteParameters(
fmt.Sprintf("%d", tr.LoadGenAccounts),
)
p = strings.ReplaceAll(p, "%LOGLEVEL%", t.RoleLogLevel(tr, r))
if r.Role == common.SystemRolePhaseTwoGen {
if r.Role == common.SystemRoleParsecGen {
p = strings.ReplaceAll(p, "%LGAFFINITY%", t.LoadGenAffinity(tr, r))
}
newParams = append(newParams, p)
Expand Down
4 changes: 2 additions & 2 deletions coordinator/testruns/roleconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ func (t *TestRunManager) writeTestRunConfigVariables(
numRoles := t.countRoles(tr)
numClis := 0
numClis += numRoles[common.SystemRoleAtomizerCliWatchtower]
numClis += numRoles[common.SystemRolePhaseTwoGen]
numClis += numRoles[common.SystemRoleParsecGen]
numClis += numRoles[common.SystemRoleTwoPhaseGen]

// Calculate target per role
Expand Down Expand Up @@ -355,7 +355,7 @@ func (t *TestRunManager) RoleTelLevel(
tellevel = tr.WatchtowerTelemetryLevel
case common.SystemRoleCoordinator:
tellevel = tr.CoordinatorTelemetryLevel
case common.SystemRolePhaseTwoGen:
case common.SystemRoleParsecGen:
fallthrough
case common.SystemRoleTwoPhaseGen:
fallthrough
Expand Down
2 changes: 1 addition & 1 deletion coordinator/testruns/roles.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ func (t *TestRunManager) NormalizeRole(
role = common.SystemRoleShard
} else if role == common.SystemRoleSentinelTwoPhase {
role = common.SystemRoleSentinel
} else if role == common.SystemRoleAtomizerCliWatchtower || role == common.SystemRolePhaseTwoGen || role == common.SystemRoleTwoPhaseGen {
} else if role == common.SystemRoleAtomizerCliWatchtower || role == common.SystemRoleParsecGen || role == common.SystemRoleTwoPhaseGen {
role = common.SystemRoleLoadGen
}
return role
Expand Down
2 changes: 1 addition & 1 deletion coordinator/testruns/transfer.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ var copyFiles = map[common.SystemRole][]string{
"tps_target_%IDX%.txt%%OPT",
"telemetry.bin%%OPT",
},
common.SystemRolePhaseTwoGen: {
common.SystemRoleParsecGen: {
"tx_samples_%IDX%.txt",
"telemetry.bin%%OPT",
},
Expand Down

0 comments on commit 41ea652

Please sign in to comment.