<javac srcdir="${src.dir}" destdir="${build.dir}" classpathref="project.classpath" debug="true" deprecation="true" includeantruntime="false" />\r
</target>\r
\r
- <target name="run-generator-A" depends="compile" description="Run Group GUI (JMS).">\r
+ <target name="run-generator-A" depends="compile" description="Compile project">\r
<java classname="at.ac.tuwien.lsdc.JobGenerator" fork="true" classpathref="project.classpath">\r
<assertions refid="project.assertions" />\r
<arg value="A" />\r
</java>\r
</target>\r
\r
- <target name="run-generator" depends="compile, input-runargs" description="Run Group GUI (JMS).">\r
+ <target name="run-generator" depends="compile, input-runargs" description="Run generator with user defined arguments">\r
<java classname="at.ac.tuwien.lsdc.JobGenerator" fork="true" classpathref="project.classpath">\r
<assertions refid="project.assertions" />\r
<arg value="${args}" />\r
</java>\r
</target>\r
\r
- <target name="run-scheduler" depends="compile, input-runargs" description="Run Group GUI (JMS).">\r
+ <target name="run-scheduler" depends="compile, input-runargs" description="Run scheduler with user defined arguments">\r
<java classname="at.ac.tuwien.lsdc.SchedSimulator" fork="true" classpathref="project.classpath">\r
<assertions refid="project.assertions" />\r
<arg value="${args}" />\r
</java>\r
</target>\r
\r
- <target name="run-scheduler-A-A" depends="compile" description="Run Group GUI (JMS).">\r
+ <target name="run-scheduler-A-A" depends="compile" description="Run scheduler A on scenario A">\r
<java classname="at.ac.tuwien.lsdc.SchedSimulator" fork="true" classpathref="project.classpath">\r
<assertions refid="project.assertions" />\r
<arg value="A" />\r
</java>\r
</target>\r
\r
- <target name="run-scheduler-A-B" depends="compile" description="Run Group GUI (JMS).">\r
+ <target name="run-scheduler-A-B" depends="compile" description="Run scheduler B on scenario A">\r
<java classname="at.ac.tuwien.lsdc.SchedSimulator" fork="true" classpathref="project.classpath">\r
<assertions refid="project.assertions" />\r
<arg value="A" />\r
</java>\r
</target>\r
\r
- <target name="run-scheduler-A-C" depends="compile" description="Run Group GUI (JMS).">\r
+ <target name="run-scheduler-A-C" depends="compile" description="Run scheduler C on scenario A">\r
<java classname="at.ac.tuwien.lsdc.SchedSimulator" fork="true" classpathref="project.classpath">\r
<assertions refid="project.assertions" />\r
<arg value="A" />\r
*/
public class SchedSimulator {
- private static final String USAGE = "SchedSimulator needs exactly 5 parameters: scenario, scheduler, inputFile, logFilePath, schedulerLogPath";
+ private static final String USAGE = "SchedSimulator needs exactly 7 parameters: scenario, scheduler, numPMS, numCloudPartners, inputFile, generalLogPath, schedulerLogPath";
private static final Logger log = LoggerFactory
.getLogger(SchedSimulator.class);
* Commandline arguments parsed (mandatory):
* - type of scenario
* - type of scheduler
+ * - number of available PMs
+ * - number of cloud partners
* - scenario input file with applications
* - general output file for all schedulers
* - specific output file for this scheduler/scenario combination
String numPMsStr = args[2];
String numCloudPartnersStr = args[3];
String inputFileStr = args[4];
- String schedulerLogStr = args[5];
- String scenarioLogFileStr = args[6];
+ String generalLogStr = args[5];
+ String schedulerLogStr = args[6];
+
try {
scenario = ScenarioType.valueOf(scenarioStr);
schedulerType = SchedulerType.valueOf(schedulerTypeStr);
numPMs = Integer.parseInt(numPMsStr);
numCloudPartners = Integer.parseInt(numCloudPartnersStr);
inputFile = new File(inputFileStr);
+
if (!inputFile.canRead())
throw new IOException("Can not read input file");
- generalLog = new File(schedulerLogStr);
- boolean logFileOK = false;
+ generalLog = new File(generalLogStr);
+ boolean generalLogOK = false;
if ( generalLog.canWrite() ) {
- logFileOK = true;
+ generalLogOK = true;
}
else if (!generalLog.exists()) {
generalLog.createNewFile();
- logFileOK = true;
+ generalLogOK = true;
}
- if (!logFileOK)
- throw new IOException("Can not write to scheduler log file");
- boolean fileWriteOK = false;
- schedulerLog = new File(scenarioLogFileStr);
+ if (!generalLogOK)
+ throw new IOException("Can not write to general log file");
+
+ boolean schedulerLogOK = false;
+ schedulerLog = new File(schedulerLogStr);
if (schedulerLog.exists()) {
- fileWriteOK = schedulerLog.canWrite();
+ schedulerLogOK = schedulerLog.canWrite();
schedulerLog.delete();
schedulerLog.createNewFile();
} else {
schedulerLog.createNewFile();
- fileWriteOK = true;
+ schedulerLogOK = true;
}
- if (!fileWriteOK)
- throw new IOException("Can not write to Scenario Log File "
- + scenarioLogFileStr);
+ if (!schedulerLogOK)
+ throw new IOException("Can not write to scheduler log file "
+ + schedulerLogStr);
} catch (Exception e) {
e.printStackTrace();
log.info(USAGE);