Skip to content

Commit a530581

Browse files
committed
added GPU params
1 parent 3a5303f commit a530581

File tree

12 files changed

+59
-11
lines changed

12 files changed

+59
-11
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,3 @@ test-output
88
*~
99
config.properties
1010
dependency-reduced-pom.xml
11-
deploy.sh

cloud/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<parent>
55
<groupId>cz.metacentrum</groupId>
66
<artifactId>accounting-parent</artifactId>
7-
<version>3.35</version>
7+
<version>3.36</version>
88
</parent>
99

1010
<artifactId>cloud</artifactId>

metaacct/deploy.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
echo "deploying"
2+
scp target/metaacct.war [email protected]:/var/lib/tomcat9/webapps/
3+

metaacct/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<parent>
88
<groupId>cz.metacentrum</groupId>
99
<artifactId>accounting-parent</artifactId>
10-
<version>3.35</version>
10+
<version>3.36</version>
1111
</parent>
1212

1313
<artifactId>metaacct</artifactId>

metaacct/src/main/java/cz/cesnet/meta/accounting/server/data/PBSMessage.java

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ public class PBSMessage implements Serializable {
3434
private int usedCpupercent;
3535
private long softWalltime;
3636

37+
private int usedGpupercent;
38+
private int usedGpuMemMaxPercent;
39+
private float usedGpuPowerUsage;
40+
3741
private List<PBSHost> execHosts;
3842
private List<NodeSpec> nodesSpecs;
3943

@@ -218,7 +222,31 @@ public void setSoftWalltime(long softWalltime) {
218222
this.softWalltime = softWalltime;
219223
}
220224

221-
@Override
225+
public int getUsedGpupercent() {
226+
return usedGpupercent;
227+
}
228+
229+
public void setUsedGpupercent(int usedGpupercent) {
230+
this.usedGpupercent = usedGpupercent;
231+
}
232+
233+
public int getUsedGpuMemMaxPercent() {
234+
return usedGpuMemMaxPercent;
235+
}
236+
237+
public void setUsedGpuMemMaxPercent(int usedGpuMemMaxPercent) {
238+
this.usedGpuMemMaxPercent = usedGpuMemMaxPercent;
239+
}
240+
241+
public float getUsedGpuPowerUsage() {
242+
return usedGpuPowerUsage;
243+
}
244+
245+
public void setUsedGpuPowerUsage(float usedGpuPowerUsage) {
246+
this.usedGpuPowerUsage = usedGpuPowerUsage;
247+
}
248+
249+
@Override
222250
public String toString() {
223251
return "PBSMessage{" +
224252
"user='" + user + '\'' +

metaacct/src/main/java/cz/cesnet/meta/accounting/server/service/PbsRecordManagerImpl.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,9 @@ private static Map<String, Object> prepareJobParams(Map<String, Long> allUsers,
294294
params.put("used_walltime", r.getMessageText().getUsedWalltime());
295295
params.put("used_cputime", r.getMessageText().getUsedCputime());
296296
params.put("used_cpupercent", r.getMessageText().getUsedCpupercent());
297+
params.put("used_gpupercent", r.getMessageText().getUsedGpupercent());
298+
params.put("used_gpumemmaxpercent", r.getMessageText().getUsedGpuMemMaxPercent());
299+
params.put("used_gpupowerusage", r.getMessageText().getUsedGpuPowerUsage());
297300
}
298301
return params;
299302
}

metaacct/src/main/java/cz/cesnet/meta/accounting/server/util/PBSReader.java

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,17 @@ public static List<PBSRecord> readPBSFile(InputStream is, Date limitForStartedJo
113113
String vmem = s.substring(s.indexOf('=') + 1);
114114
pbsMessage.setUsedVmem(StringUtils.parsePbsLogSizeFormat(vmem));
115115
} else if (s.startsWith("resources_used.cpupercent=")) {
116-
String ncpus = s.substring(s.indexOf('=') + 1);
117-
pbsMessage.setUsedCpupercent(Integer.parseInt(ncpus));
116+
String cpupercent = s.substring(s.indexOf('=') + 1);
117+
pbsMessage.setUsedCpupercent(Integer.parseInt(cpupercent));
118+
} else if (s.startsWith("resources_used.gpupercent=")) {
119+
String gpupercent = s.substring(s.indexOf('=') + 1);
120+
pbsMessage.setUsedGpupercent(Integer.parseInt(gpupercent));
121+
} else if (s.startsWith("resources_used.gpumemmaxpercent=")) {
122+
String gpumemmaxpercent = s.substring(s.indexOf('=') + 1);
123+
pbsMessage.setUsedGpuMemMaxPercent(Integer.parseInt(gpumemmaxpercent));
124+
} else if (s.startsWith("resources_used.gpupowerusage=")) {
125+
String gpupowerusage = s.substring(s.indexOf('=') + 1);
126+
pbsMessage.setUsedGpuPowerUsage(Float.parseFloat(gpupowerusage));
118127
} else if (s.startsWith("Resource_List.walltime=")) {
119128
String walltime = s.substring(s.indexOf('=') + 1);
120129
pbsMessage.setReqWalltime(StringUtils.parsePbsLogTimeFormat(walltime));

metaacct_cmd/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<groupId>cz.metacentrum</groupId>
77
<artifactId>accounting-parent</artifactId>
8-
<version>3.35</version>
8+
<version>3.36</version>
99
</parent>
1010

1111
<artifactId>metaacct_cmd</artifactId>

pbsmon/deploy.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/usr/bin/env bash
2+
3+
#echo "compiling"
4+
#mvn clean package
5+
echo "deploying"
6+
scp target/pbsmon2.war [email protected]:/var/lib/tomcat9/webapps/

pbsmon/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<parent>
55
<groupId>cz.metacentrum</groupId>
66
<artifactId>accounting-parent</artifactId>
7-
<version>3.35</version>
7+
<version>3.36</version>
88
</parent>
99

1010
<artifactId>pbsmon</artifactId>

0 commit comments

Comments
 (0)