Skip to content

Commit

Permalink
Merge pull request #1823 from LBNL-UCB-STI/revert-1791-art/develop-to…
Browse files Browse the repository at this point in the history
…-master-u1-4ci

Revert "Merge develop to master"
  • Loading branch information
wrashid authored May 18, 2019
2 parents 1c6aa89 + e9f1b02 commit 58011e3
Show file tree
Hide file tree
Showing 59 changed files with 540 additions and 1,414 deletions.
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,4 @@ test/input/siouxfalls/*.csv
!/test/input/siouxfalls/r5/siouxareametro-sd-us.zip
physsim-network.xml
src/main/scala/beam/sandbox
test/scala/beam/sandbox
log-path_IS_UNDEFINED/
test/scala/beam/sandbox
4 changes: 0 additions & 4 deletions aws/src/main/python/beam_lambda/lambda_function.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,10 @@
- cd /home/ubuntu/git/beam
- ln -sf /var/log/cloud-init-output.log ./cloud-init-output.log
- /home/ubuntu/git/glip.sh -i "http://icons.iconarchive.com/icons/uiconstock/socialmedia/32/AWS-icon.png" -a "Run Started" -b "Run Name** $TITLED** \\n Instance ID $(ec2metadata --instance-id) \\n Instance type **$(ec2metadata --instance-type)** \\n Host name **$(ec2metadata --public-hostname)** \\n Web browser **http://$(ec2metadata --public-hostname):8000** \\n Region $REGION \\n Batch $UID \\n Branch **$BRANCH** \\n Commit $COMMIT"
- curl -X POST -H 'Content-type: application/json' --data '{"text":"Run Started \\n Run Name** $TITLED** \\n Instance ID $(ec2metadata --instance-id) \\n Instance type **$(ec2metadata --instance-type)** \\n Host name **$(ec2metadata --public-hostname)** \\n Web browser **http://$(ec2metadata --public-hostname):8000** \\n Region $REGION \\n Batch $UID \\n Branch **$BRANCH** \\n Commit $COMMIT"}' https://hooks.slack.com/services/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
- echo "notification sent..."
- echo '0 * * * * /home/ubuntu/git/glip.sh -i "http://icons.iconarchive.com/icons/uiconstock/socialmedia/32/AWS-icon.png" -a "$(ec2metadata --instance-type) instance $(ec2metadata --instance-id) running..." -b "Batch [$UID] completed and instance of type $(ec2metadata --instance-type) is still running in $REGION since last $(($(($(date +%s) - $(cat /tmp/.starttime))) / 3600)) Hour $(($(($(date +%s) - $(cat /tmp/.starttime))) / 60)) Minute."' > /tmp/glip_notification
- echo '0 * * * * curl -X POST -H "Content-type: application/json" --data '"'"'{"$(ec2metadata --instance-type) instance $(ec2metadata --instance-id) running... \\n Batch [$UID] completed and instance of type $(ec2metadata --instance-type) is still running in $REGION since last $(($(($(date +%s) - $(cat /tmp/.starttime))) / 3600)) Hour $(($(($(date +%s) - $(cat /tmp/.starttime))) / 60)) Minute."}'"'"'' > /tmp/slack_notification
- echo "notification saved..."
- crontab /tmp/glip_notification
- crontab /tmp/slack_notification
- crontab -l
- echo "notification scheduled..."
- git fetch
Expand Down Expand Up @@ -82,7 +79,6 @@
- s3glip="\\n S3 output url ${s3p#","}"
- fi
- /home/ubuntu/git/glip.sh -i "http://icons.iconarchive.com/icons/uiconstock/socialmedia/32/AWS-icon.png" -a "Run Completed" -b "Run Name** $TITLED** \\n Instance ID $(ec2metadata --instance-id) \\n Instance type **$(ec2metadata --instance-type)** \\n Host name **$(ec2metadata --public-hostname)** \\n Web browser **http://$(ec2metadata --public-hostname):8000** \\n Region $REGION \\n Batch $UID \\n Branch **$BRANCH** \\n Commit $COMMIT $s3glip \\n Shutdown in $SHUTDOWN_WAIT minutes"
- curl -X POST -H 'Content-type: application/json' --data '{"text":"Run Completed \\n Run Name** $TITLED** \\n Instance ID $(ec2metadata --instance-id) \\n Instance type **$(ec2metadata --instance-type)** \\n Host name **$(ec2metadata --public-hostname)** \\n Web browser **http://$(ec2metadata --public-hostname):8000** \\n Region $REGION \\n Batch $UID \\n Branch **$BRANCH** \\n Commit $COMMIT $s3glip \\n Shutdown in $SHUTDOWN_WAIT minutes"}' https://hooks.slack.com/services/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
- $END_SCRIPT
- sudo shutdown -h +$SHUTDOWN_WAIT
'''))
Expand Down
24 changes: 5 additions & 19 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -62,24 +62,11 @@ sourceSets.main.java.srcDirs = []
sourceSets.test.java.srcDirs = []
sourceSets.test.scala.srcDirs = ["src/test/scala", "src/test/java"]

sourceSets {
main {
resources {
srcDir "src/main/resources"
}
}
test {
resources {
srcDir "src/test/resources"
}
}
}

if (project.hasProperty('env')) {
sourceSets {
main {
resources {
srcDirs "test/input/" + project.getProperty('env')
srcDirs "src/main/resources", "test/input/" + project.getProperty('env')
}
}
}
Expand Down Expand Up @@ -245,9 +232,6 @@ dependencies {
compile group: 'com.typesafe.akka', name: "akka-contrib_${scalaBinaryVersion}", version: akkaBinaryVersion
// compile group: 'org.iq80.leveldb', name: 'leveldb', version: '0.9'

compile group: 'com.typesafe.akka', name: "akka-http_${scalaBinaryVersion}", version: "10.1.8"
compile group: 'de.heikoseeberger', name: "akka-http-circe_${scalaBinaryVersion}", version: "1.25.2"

// TEST Akka //
testCompile group: 'com.typesafe.akka', name: "akka-testkit_${scalaBinaryVersion}", version: akkaBinaryVersion

Expand Down Expand Up @@ -308,12 +292,14 @@ build.dependsOn spec

task taggedTest(dependsOn: ['testClasses'], type: JavaExec) {
main = 'org.scalatest.tools.Runner'

args = ['-R', 'build/classes/scala/test', '-o', '-n'] << (project.findProperty('tags') ?: 'org.scalatest.Ignore')
classpath = sourceSets.test.runtimeClasspath
}

task specificTest(dependsOn: ['testClasses'], type: JavaExec) {
main = 'org.scalatest.tools.Runner'

args = ['-R', 'build/classes/scala/test', '-o', '-s'] << (project.findProperty('suite') ?: 'org.scalatest.Ignore')
classpath = sourceSets.test.runtimeClasspath
}
Expand All @@ -331,6 +317,7 @@ task periodicTest(dependsOn: ['testClasses'], type: JavaExec) {
'-Diterations=' + project.findProperty('iterations') : '')
jvmArgs = ['-javaagent:build/aspectjweaver-1.8.10.jar']
classpath = sourceSets.test.runtimeClasspath

doFirst() {
if (!project.file('build/aspectjweaver-1.8.10.jar').exists()) {
download {
Expand Down Expand Up @@ -562,8 +549,7 @@ def jfrWithMem = ["-XX:+UnlockCommercialFeatures", "-XX:+UnlockDiagnosticVMOptio

// UseParallelGC
applicationDefaultJvmArgs = ["-Xmx${myAvailableRam}g", "-Xms${myAvailableRam/2}g",
"-XX:+UseParallelGC", "-XX:+UseParallelOldGC", "-XX:MetaspaceSize=150M", "-Djava.awt.headless=true",
"-Dlogback.configurationFile=logback_prod.xml"] + logGC
"-XX:+UseParallelGC", "-XX:+UseParallelOldGC", "-XX:MetaspaceSize=150M"] + logGC

println(applicationDefaultJvmArgs)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ private void setEventsFileFormats() {
}

Set<String> getKeysToWrite(Event event, Map<String, String> eventAttributes) {
return eventAttributes.keySet();
return new HashSet<>(eventAttributes.keySet());
}

/**
Expand Down
17 changes: 4 additions & 13 deletions src/main/java/beam/analysis/physsim/PhyssimCalcLinkStats.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package beam.analysis.physsim;

import beam.sim.BeamConfigChangesObservable;
import beam.sim.config.BeamConfig;
import beam.utils.BeamCalcLinkStats;
import beam.utils.VolumesAnalyzerFixed;
Expand All @@ -20,14 +19,14 @@
import org.matsim.core.utils.misc.Time;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import scala.Tuple2;

import java.awt.*;
import java.io.File;
import java.io.IOException;
import java.util.*;
import java.util.List;

public class PhyssimCalcLinkStats implements Observer {
public class PhyssimCalcLinkStats {

private Logger log = LoggerFactory.getLogger(PhyssimCalcLinkStats.class);

Expand Down Expand Up @@ -60,7 +59,7 @@ public class PhyssimCalcLinkStats implements Observer {
private VolumesAnalyzer volumes;

public PhyssimCalcLinkStats(Network network, OutputDirectoryHierarchy controlerIO, BeamConfig beamConfig,
TravelTimeCalculatorConfigGroup ttcConfigGroup, BeamConfigChangesObservable beamConfigChangesObservable) {
TravelTimeCalculatorConfigGroup ttcConfigGroup) {
this.network = network;
this.controllerIO = controlerIO;
this.beamConfig = beamConfig;
Expand All @@ -74,7 +73,6 @@ public PhyssimCalcLinkStats(Network network, OutputDirectoryHierarchy controlerI
_noOfTimeBins = Math.floor(_noOfTimeBins);
noOfBins = _noOfTimeBins.intValue() + 1;
}
beamConfigChangesObservable.addObserver(this);

linkStats = new BeamCalcLinkStats(network, ttcConfigGroup);
}
Expand All @@ -101,8 +99,7 @@ private boolean isNotTestMode() {


private boolean writeLinkStats(int iterationNumber) {
int interval = beamConfig.beam().physsim().linkStatsWriteInterval();
return writeInIteration(iterationNumber, interval);
return writeInIteration(iterationNumber, beamConfig.beam().physsim().linkStatsWriteInterval());
}

private boolean writeInIteration(int iterationNumber, int interval) {
Expand Down Expand Up @@ -280,10 +277,4 @@ public void notifyIterationStarts(EventsManager eventsManager, TravelTimeCalcula
public void clean(){
this.linkStats.reset();
}

@Override
public void update(Observable observable, Object o) {
Tuple2 t = (Tuple2) o;
this.beamConfig = (BeamConfig) t._2;
}
}

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
public class VehicleMilesTraveledAnalysis implements IterationSummaryAnalysis {
private Map<String, Double> milesTraveledByVehicleType = new HashMap<>();
private Set<Id<BeamVehicleType>> vehicleTypes;
private String humanBodyVehicleType = BeamVehicleType.defaultHumanBodyBeamVehicleType().id().toString();
private String humanBodyVehicleType = BeamVehicleType.defaultHumanBodyBeamVehicleType().toString();

public VehicleMilesTraveledAnalysis(Set<Id<BeamVehicleType>> vehicleTypes) {
this.vehicleTypes = vehicleTypes;
Expand Down
Loading

0 comments on commit 58011e3

Please sign in to comment.