-
Notifications
You must be signed in to change notification settings - Fork 0
/
ConfigMethods.chpl
66 lines (59 loc) · 2.13 KB
/
ConfigMethods.chpl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
use ParameterSet;
use FileSystem;
use Spawn;
class Config{
var ProjectPath:string;
var hostname: string;
var hostID:int;
proc init(EFProjectPath:string){
this.ProjectPath = EFProjectPath;
this.hostname = here.hostname;
this.hostID = here.id;
}
proc addMeasurementContext(){
var success =false;
var command = "dotnet run GetMeasurementDB";
var input = " ".join(command, hostname, "--project", ProjectPath);
var MeasCommand = spawnshell(input, stdout=PIPE);
var line:string;
var measdbPath: string;
while MeasCommand.stdout.readline(line) {
measdbPath = line;
}
measdbPath = "/home/yang_host/Documents/SingleObjectiveDDS/MeasurementDBSingle.db";
MeasCommand.wait();
if FileSystem.isFile(measdbPath) {
var arg1 = "dotnet ef dbcontext scaffold";
var arg2 = "'Data source =";
var arg3 = "Microsoft.EntityFrameworkCore.Sqlite";
var arg4 = "--context-dir";
var arg5 = "--context MeasurementDBContext --force";
var FinalCommand = " ".join(arg1, arg2, measdbPath, "'", arg3, arg4, ProjectPath, arg5);
var scaffold = spawnshell(FinalCommand, stdout=PIPE);
var line:string;
writeln(FinalCommand);
while scaffold.stdout.readline(line) {
if (line.find("Build succeeded.") != -1){
success = true;
break;
}
}
scaffold.wait();
}
if (success == false){
writeln("Errors in Scaffold command for Measurement Database on Locale %s", here.hostname);
}
return success;
}
proc setIntelVars(){
var command = " bash /home/yang_host/Documents/SingleObjectiveDDS/oneapi.sh";
var Intel = spawnshell(command, stdout=PIPE);
var line:string;
while Intel.stdout.readline(line) {
writeln(line);
}
Intel.wait();
}
proc SendISland(){
}
}