Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CHECKPOINT BUILD FOR TRAVIS - DO NOT MERGE #37

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,6 @@ public class ProtoBufSearchSpaceBundle extends GenericSearchSpaceBundle {
*/
public ProtoBufSearchSpaceBundle(final ProgramConfiguration.JvmSearchSpace protoSpace,
final boolean requireAll) throws InvalidConfigurationException {

// initial param check - the rest of the CommandLineArgs will be checked
// their entry is instantiated
if (protoSpace.getGcModeCount() == 0 && requireAll) {
throw new InvalidConfigurationException("no gc mode specified");
}

/*
* Run through all the different enums
*
Expand Down Expand Up @@ -139,34 +132,17 @@ public ProtoBufSearchSpaceBundle(final ProgramConfiguration.JvmSearchSpace proto
protoSpace.hasSoftRefLruPolicyMsPerMb(), protoSpace.getSoftRefLruPolicyMsPerMb(),
requireAll);

/*
* Finally deal with GC Mode
*
* We have a repeated list here so that we can select multiple gc modes over which to search.
* However, squashing these down to boolean values seems wrong.
*
* TODO(team): Really, we want to return a set of the available gc modes but need to
* understand implications on hypothesizer and the GA in general to see if that makes sense.
* Not for mach1.
*/
if (protoSpace.getGcModeCount() == 0) {
// use the 'full' (it is boolean) search step to look over each gcmode
for (JvmFlag gcModeArg : JvmFlag.getGcModeArguments()) {
makeBoolEntry(gcModeArg, false, false, false);
}
} else {
/*
* this list is puny so we can do contains() searches on it even if we have a dumb user who
* puts lots of duplicates in their config....
*
* Essentially, we say we have a value to pin to - true if it is present, false otherwise.
*/
List<ProgramConfiguration.JvmSearchSpace.GcMode> gcModes = protoSpace.getGcModeList();
for (ProgramConfiguration.JvmSearchSpace.GcMode mode :
ProgramConfiguration.JvmSearchSpace.GcMode.values()) {
makeBoolEntry(JvmFlag.getGcModeArgument(mode), true, gcModes.contains(mode), false);
}
}
makeBoolEntry(JvmFlag.USE_SERIAL_GC,
protoSpace.hasUseSerialGc(), protoSpace.getUseSerialGc(), requireAll);
makeBoolEntry(JvmFlag.USE_PARALLEL_GC,
protoSpace.hasUseParallelGc(), protoSpace.getUseParallelGc(), requireAll);
makeBoolEntry(JvmFlag.USE_PARALLEL_OLD_GC,
protoSpace.hasUseParallelOldGc(), protoSpace.getUseParallelOldGc(), requireAll);
makeBoolEntry(JvmFlag.USE_PAR_NEW_GC,
protoSpace.hasUseParNewGc(), protoSpace.getUseParNewGc(), requireAll);
makeBoolEntry(JvmFlag.USE_CONC_MARK_SWEEP_GC,
protoSpace.hasUseConcurrentMarkSweepGc(), protoSpace.getUseConcurrentMarkSweepGc(),
requireAll);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableList.Builder;

import org.arbeitspferde.groningen.experimentdb.jvmflags.GcMode;
import org.arbeitspferde.groningen.experimentdb.jvmflags.JvmFlag;
import org.arbeitspferde.groningen.experimentdb.jvmflags.JvmFlagSet;

Expand Down Expand Up @@ -218,27 +217,6 @@ public boolean getUseSerialGC() {
return getValue(JvmFlag.USE_SERIAL_GC) == 1;
}

/**
* Returns the garbage collection mode chosen in this command line.
*
* @return GC mode.
* @throws RuntimeException If no GC mode is chosen.
*/
public GcMode getGcMode() {
if (getUseConcMarkSweepGC()) {
return GcMode.CMS;
} else if (getUseParallelGC()) {
return GcMode.PARALLEL;
} else if (getUseParallelOldGC()) {
return GcMode.PARALLEL_OLD;
} else if (getUseSerialGC()) {
return GcMode.SERIAL;
} else {
// TODO(team): more debug info.
throw new IllegalStateException("No GC mode found.");
}
}

/**
* Convert this command line object into a JVM settings string.
*
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,9 @@ public enum JvmFlag {

USE_PARALLEL_OLD_GC("UseParallelOldGC", HotSpotFlagType.UNSTABLE),

USE_SERIAL_GC("UseSerialGC", HotSpotFlagType.UNSTABLE);
USE_SERIAL_GC("UseSerialGC", HotSpotFlagType.UNSTABLE),

USE_PAR_NEW_GC("UseParNewGC", HotSpotFlagType.UNSTABLE); // XXX: ENSURE LINKED IN EVERYWHERE!

/**
* The human-readable flag name that excludes the flag-specific argument
Expand Down Expand Up @@ -156,13 +158,6 @@ public enum JvmFlag {
*/
private final Range<Long> acceptableValueRange;

private static final ImmutableSortedSet<JvmFlag> GC_MODE_FLAGS = ImmutableSortedSet.<JvmFlag>naturalOrder()
.add(USE_CONC_MARK_SWEEP_GC)
.add(USE_PARALLEL_GC)
.add(USE_PARALLEL_OLD_GC)
.add(USE_SERIAL_GC)
.build();

/**
* Construct a new boolean flag.
*
Expand Down Expand Up @@ -279,50 +274,4 @@ public String asAcceptableValuesString() {
public void validate(final Long proposedValue) throws IllegalArgumentException {
getFormatter().validate(this, proposedValue);
}

/**
* Returns the GC mode {@link JvmFlag} instances.
*
* @return List of GC modes.
*/
public static ImmutableSortedSet<JvmFlag> getGcModeArguments() {
return GC_MODE_FLAGS;
}

/**
* Returns the GC mode command-line argument for the given GC mode.
*/
public static JvmFlag getGcModeArgument(final GcMode gcMode) {
Preconditions.checkNotNull(gcMode, "gcMode should not be null.");

switch (gcMode) {
case CMS:
return USE_CONC_MARK_SWEEP_GC;
case PARALLEL:
return USE_PARALLEL_GC;
case PARALLEL_OLD:
return USE_PARALLEL_OLD_GC;
case SERIAL:
return USE_SERIAL_GC;
default:
throw new IllegalArgumentException("Invalid GC mode: " + gcMode);
}
}

public static JvmFlag getGcModeArgument(final GroningenConfigProto.ProgramConfiguration.JvmSearchSpace.GcMode mode) {
Preconditions.checkNotNull(mode, "mode should not be null.");
// initialize the enum mappings
switch (mode) {
case USE_CONC_MARK_SWEEP:
return USE_CONC_MARK_SWEEP_GC;
case USE_PARALLEL:
return USE_PARALLEL_GC;
case USE_PARALLEL_OLD:
return USE_PARALLEL_OLD_GC;
case USE_SERIAL:
return USE_SERIAL_GC;
default:
throw new IllegalArgumentException("Invalid GC mode: " + mode);
}
}
}
Loading