F2F demo with 3 nodes, 2 apps, 2 workers/node, printing commsCost

parent 9e4f0951
HOST=172.16.102.26 HOST=10.0.2.15
TCPPORT=11034 TCPPORT=11034
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.ikerlan.dataclay</groupId>
<artifactId>nfrtool-comms</artifactId>
<version>0.0.1-SNAPSHOT</version>
<build>
<finalName>nfrtool</finalName>
<plugins>
<plugin>
<artifactId>maven-shade-plugin</artifactId>
<version>3.2.2</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<transformers>
<transformer>
<mainClass>nfrTool.NFRTool</mainClass>
</transformer>
</transformers>
<artifactSet>
<excludes>
<exclude>classworlds:classworlds</exclude>
<exclude>junit:junit</exclude>
<exclude>jmock:*</exclude>
<exclude>*:xml-apis</exclude>
<exclude>org.apache.maven:lib:tests</exclude>
<exclude>log4j:log4j:jar:</exclude>
</excludes>
</artifactSet>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<properties>
<maven.compiler.release>8</maven.compiler.release>
<maven.compiler.target>8</maven.compiler.target>
<maven.compiler.source>8</maven.compiler.source>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
</project>
#
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0x00007f01fb3b2401, pid=13209, tid=13224
#
# JRE version: OpenJDK Runtime Environment (11.0.7+10) (build 11.0.7+10-post-Ubuntu-2ubuntu218.04)
# Java VM: OpenJDK 64-Bit Server VM (11.0.7+10-post-Ubuntu-2ubuntu218.04, mixed mode, sharing, tiered, compressed oops, g1 gc, linux-amd64)
# Problematic frame:
# C [libjimage.so+0x2401]
#
# Core dump will be written. Default location: Core dumps may be processed with "/usr/share/apport/apport %p %s %c %d %P %E" (or dumping to /home/jjvmelastic/src/nfrtool-comms/app/core.13209)
#
# If you would like to submit a bug report, please visit:
# https://bugs.launchpad.net/ubuntu/+source/openjdk-lts
#
--------------- S U M M A R Y ------------
Command Line: -agentlib:jdwp=transport=dt_socket,suspend=y,address=localhost:41387 -javaagent:/home/jjvmelastic/eclipse/jee/configuration/org.eclipse.osgi/405/0/.cp/lib/javaagent-shaded.jar -Dfile.encoding=UTF-8 nfrTool.NFRTool
Host: Intel(R) Core(TM) i7-6600U CPU @ 2.60GHz, 2 cores, 3G,
\ No newline at end of file
...@@ -25,19 +25,19 @@ ...@@ -25,19 +25,19 @@
<version>2.1</version> <version>2.1</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.fasterxml.jackson.dataformat</groupId> <groupId>com.fasterxml.jackson.dataformat</groupId>
<artifactId>jackson-dataformat-yaml</artifactId> <artifactId>jackson-dataformat-yaml</artifactId>
<version>2.10.3</version> <version>2.10.3</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.fasterxml.jackson.core</groupId> <groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId> <artifactId>jackson-databind</artifactId>
<version>2.10.3</version> <version>2.10.3</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.yaml</groupId> <groupId>org.yaml</groupId>
<artifactId>snakeyaml</artifactId> <artifactId>snakeyaml</artifactId>
<version>1.21</version> <version>1.21</version>
</dependency> </dependency>
</dependencies> </dependencies>
<build> <build>
......
...@@ -16,7 +16,7 @@ public class NetMonitor extends ResourceManager { ...@@ -16,7 +16,7 @@ public class NetMonitor extends ResourceManager {
public NetMonitor(ElasticSystem elasticSystem) { public NetMonitor(ElasticSystem elasticSystem) {
super(elasticSystem); super(elasticSystem);
this.hardwareInfo = new HardwareInfo(); this.hardwareInfo = new HardwareInfo("enp0s3");
//this.node = getNodeByIP("10.0.2.15"); //TODO: get IP as I should //this.node = getNodeByIP("10.0.2.15"); //TODO: get IP as I should
} }
......
...@@ -35,8 +35,9 @@ public class CommsMonitoringTask extends TimerTask { ...@@ -35,8 +35,9 @@ public class CommsMonitoringTask extends TimerTask {
@Override @Override
public void run() { public void run() {
this.resourceManager.getConfig(Constants.CONFIG_FILE_PATH); this.resourceManager.getConfig(Constants.CONFIG_FILE_PATH);
this.netMonitor.setLinksRTT(this.resourceManager.getNodeByIP("192.168.137.17")); this.netMonitor.setLinksRTT(this.resourceManager.getNodeByIP("10.0.2.15"));
this.resourceManager.getCosts(this.resourceManager.getNodeByIP("192.168.137.17")); this.resourceManager.getCosts(this.resourceManager.getNodeByIP("10.0.2.15"));
System.out.println();
/*Map<String, Integer> intResultsMap = this.resourceManager /*Map<String, Integer> intResultsMap = this.resourceManager
.checkThresholds(hardWareInfo.getTelemetry(), Arrays.asList("devLevel", "rttmax"), Arrays.asList("devLevel", "pllmax")); .checkThresholds(hardWareInfo.getTelemetry(), Arrays.asList("devLevel", "rttmax"), Arrays.asList("devLevel", "pllmax"));
......
...@@ -46,35 +46,36 @@ public class NFRTool { ...@@ -46,35 +46,36 @@ public class NFRTool {
// Node 1 definition: // Node 1 definition:
String ipWifi = "182.168.137.17"; String ipWifi = "182.168.137.17";
String ipLte = "172.10.0.2"; String ipLte = "172.10.0.2";
String ipEth = "192.168.137.10"; // TODO: check value //String ipEth = "192.168.137.17"; // TODO: check value
String ipEth = "10.0.2.15"; // TODO: check value
float cpuThreshold = 0; float cpuThreshold = 0;
float energyThreshold = 0; float energyThreshold = 0;
float signalWifi = -30; float signalWifi = -30;
int numCores = 4; int numCores = 4;
Node node1 = new Node(ipWifi, ipLte, ipEth, cpuThreshold, energyThreshold, signalWifi, numCores); Node node1 = new Node(ipWifi, ipEth, ipLte, cpuThreshold, energyThreshold, signalWifi, numCores);
// Node 2 definition: // Node 2 definition:
ipWifi = "182.168.137.20"; ipWifi = "182.168.137.179";
ipLte = "172.10.0.4"; ipLte = "172.10.0.4";
ipEth = "192.168.137.20"; // TODO: check value ipEth = "192.168.137.179"; // TODO: check value
cpuThreshold = 0; cpuThreshold = 0;
energyThreshold = 0; energyThreshold = 0;
signalWifi = -30; signalWifi = -30;
numCores = 4; numCores = 4;
Node node2 = new Node(ipWifi, ipLte, ipEth, cpuThreshold, energyThreshold, signalWifi, numCores); Node node2 = new Node(ipWifi, ipEth, ipLte, cpuThreshold, energyThreshold, signalWifi, numCores);
// Node 3 definition: // Node 3 definition:
ipWifi = "182.168.137.1"; ipWifi = "182.168.137.1";
ipLte = "172.10.0.6"; ipLte = "172.10.0.6";
ipEth = "192.168.137.30"; // TODO: check value ipEth = "192.168.137.17"; // TODO: check value
cpuThreshold = 0; cpuThreshold = 0;
energyThreshold = 0; energyThreshold = 0;
signalWifi = -30; signalWifi = -30;
numCores = 4; numCores = 4;
Node node3 = new Node(ipWifi, ipLte, ipEth, cpuThreshold, energyThreshold, signalWifi, numCores); Node node3 = new Node(ipWifi, ipEth, ipLte, cpuThreshold, energyThreshold, signalWifi, numCores);
///////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////////
// Worker 1A definition: // Worker 1A definition:
...@@ -139,7 +140,7 @@ public class NFRTool { ...@@ -139,7 +140,7 @@ public class NFRTool {
Worker worker3A = new Worker(node3, pid3A, active3A, appA, cpuUsage3A, computingUnits3A, node3.getIpEth(), Worker worker3A = new Worker(node3, pid3A, active3A, appA, cpuUsage3A, computingUnits3A, node3.getIpEth(),
communicationCost3A); communicationCost3A);
// Attach worker to Node and COMPSsApplication // Attach worker to Node and COMPSsApplication
node1.addWorker(worker3A); node3.addWorker(worker3A);
appA.addWorker(worker3A); appA.addWorker(worker3A);
// Worker 3B definition: // Worker 3B definition:
......
...@@ -138,6 +138,7 @@ public class ResourceManagerComms extends ResourceManager { ...@@ -138,6 +138,7 @@ public class ResourceManagerComms extends ResourceManager {
- (Math.log(Math.max(0, 1 - (workerLinks.get(ll).getDelayRtt() / rttmax)))); - (Math.log(Math.max(0, 1 - (workerLinks.get(ll).getDelayRtt() / rttmax))));
} }
} }
System.out.println("Worker.setCommunicationCost(" + String.valueOf(commsCost) + ")");
worker.setCommunicationCost((float) commsCost); worker.setCommunicationCost((float) commsCost);
/*Double obj = new Double(commsCost); /*Double obj = new Double(commsCost);
float f = obj.floatValue();*/ float f = obj.floatValue();*/
......
...@@ -87,6 +87,8 @@ public class HardwareInfo { ...@@ -87,6 +87,8 @@ public class HardwareInfo {
try { try {
//TODO: the netInterfaceName should be obtained from dataClay's infoNature attributes instead of passing it as an argument to HardwareInfo //TODO: the netInterfaceName should be obtained from dataClay's infoNature attributes instead of passing it as an argument to HardwareInfo
String cmdStr = "ping -c 1 -w 1 -W 1 -I " + this.netInterfaceName + " " + ip; String cmdStr = "ping -c 1 -w 1 -W 1 -I " + this.netInterfaceName + " " + ip;
//String cmdStr = "ping -c 1 -w 1 -W 1 -I " + "enp0s3" + " " + ip; //TODO: get netInterfaceName
//System.out.println(cmdStr);
Process process = Runtime.getRuntime().exec(cmdStr, env); Process process = Runtime.getRuntime().exec(cmdStr, env);
StringBuilder output = new StringBuilder(); StringBuilder output = new StringBuilder();
StringBuilder outputErr = new StringBuilder(); StringBuilder outputErr = new StringBuilder();
...@@ -115,13 +117,14 @@ public class HardwareInfo { ...@@ -115,13 +117,14 @@ public class HardwareInfo {
Matcher m = r.matcher(pingText); Matcher m = r.matcher(pingText);
if (m.find()) { if (m.find()) {
String rtt = m.group(1); String rtt = m.group(1);
System.out.println("Found value: " + rtt); System.out.println("Monitored RTT to target IP \t" + ip + "\t: " + rtt + "ms");
return Float.parseFloat(rtt); return Float.parseFloat(rtt);
} }
else else
System.out.println(output.toString()); System.out.println(output.toString());
} else { } else {
// TODO: GESTION EXCEPCION ICMP TIMEOUT // TODO: GESTION EXCEPCION ICMP TIMEOUT
System.out.println("ICMP error");
process.destroy(); process.destroy();
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment