Рефакторинг конструкторов объектов тестирования.
This commit is contained in:
@@ -7,96 +7,12 @@ import TestingSystem.Common.Configuration.Configuration;
|
||||
import java.util.Vector;
|
||||
//конфгурация тестирования ДВМ
|
||||
public class DVMConfiguration extends Configuration {
|
||||
//компиляция.
|
||||
public String flags = "\n";
|
||||
public int c_maxtime = 40;
|
||||
//матрица
|
||||
public int cube = 0; //
|
||||
public int max_proc_count = 4;
|
||||
public int min_dim_proc_count = 1;
|
||||
public int max_dim_proc_count = 4;
|
||||
//запуск
|
||||
public String environments="\n";
|
||||
public String usr_par = "";
|
||||
//-
|
||||
//под флагами понимается в данном случае набор цепочек флагов запакованных через энтер.
|
||||
// скорее всего будет лишь одна цепочка. с окружением похожая ситуация.
|
||||
@Override
|
||||
public String getFlags() {
|
||||
return flags;
|
||||
}
|
||||
@Override
|
||||
public Vector<String> getFlagsArray() {
|
||||
return Utils.unpackStrings(flags);
|
||||
}
|
||||
//-
|
||||
public Vector<String> getEnvironments() {
|
||||
return Utils.unpackStrings(environments);
|
||||
}
|
||||
public Vector<String> getParams() {
|
||||
return Utils.unpackStrings(usr_par);
|
||||
}
|
||||
public Vector<String> getMatrixes(int testDim) {
|
||||
Vector<Vector<Integer>> res_ = new Vector<>();
|
||||
Vector<String> res = new Vector<>();
|
||||
if ((max_proc_count==0) || (min_dim_proc_count == 0 && max_dim_proc_count == 0)) {
|
||||
res.add("");
|
||||
} else {
|
||||
if (testDim > 0) {
|
||||
Vector<String> min_border = new Vector<>();
|
||||
Vector<String> max_border = new Vector<>();
|
||||
for (int i = 1; i <= testDim; ++i) {
|
||||
min_border.add(String.valueOf(min_dim_proc_count));
|
||||
max_border.add(String.valueOf(max_dim_proc_count));
|
||||
}
|
||||
Vector<Integer> from = RunConfiguration.getBounds(String.join(" ", min_border));
|
||||
Vector<Integer> to = RunConfiguration.getBounds(String.join(" ", max_border));
|
||||
if (from.size() != to.size()) {
|
||||
return res;
|
||||
}
|
||||
if (from.size() != testDim) {
|
||||
return res;
|
||||
}
|
||||
//1 стадия. заполнение.
|
||||
for (int j = from.get(0); j <= to.get(0); ++j) {
|
||||
Vector<Integer> m = new Vector<>();
|
||||
res_.add(m);
|
||||
m.add(j);
|
||||
}
|
||||
//---
|
||||
if (testDim > 1) RunConfiguration.gen_rec(from, to, res_, 1, testDim, cube == 1);
|
||||
for (Vector<Integer> m : res_) {
|
||||
Vector<String> ms = new Vector<>();
|
||||
int proc = 1;
|
||||
for (int i : m) {
|
||||
ms.add(String.valueOf(i));
|
||||
proc *= i;
|
||||
}
|
||||
if (proc <= max_proc_count)
|
||||
res.add(String.join(" ", ms));
|
||||
}
|
||||
} else res.add("");
|
||||
}
|
||||
return res;
|
||||
}
|
||||
public String getParamsText() {
|
||||
Vector<String> params = getParams();
|
||||
if ((params.size() == 1) && params.get(0).isEmpty()) return "";
|
||||
return String.join("\n", params);
|
||||
}
|
||||
//-
|
||||
@Override
|
||||
public void SynchronizeFields(DBObject src) {
|
||||
super.SynchronizeFields(src);
|
||||
DVMConfiguration c = (DVMConfiguration) src;
|
||||
flags = c.flags;
|
||||
c_maxtime=c.c_maxtime;
|
||||
cube= c.cube;
|
||||
max_proc_count=c.max_proc_count;
|
||||
min_dim_proc_count=c.min_dim_proc_count;
|
||||
max_dim_proc_count=c.max_dim_proc_count;
|
||||
environments=c.environments;
|
||||
usr_par=c.usr_par;
|
||||
}
|
||||
public DVMConfiguration(DVMConfiguration src){
|
||||
this.SynchronizeFields(src);
|
||||
|
||||
@@ -2,17 +2,11 @@ package TestingSystem.DVM.DVMConfiguration;
|
||||
import Common.Current;
|
||||
import Common.Database.DBObject;
|
||||
import Common.Database.iDBTable;
|
||||
import Common.Global;
|
||||
import Common.UI.DataSetControlForm;
|
||||
import Common.UI.Tables.DBObjectSelector;
|
||||
import Common.UI.Tables.TableEditors;
|
||||
import Common.UI.Tables.TableRenderers;
|
||||
import Common.UI.VisualCache.ConfigurationCache;
|
||||
import Common.UI.VisualCache.VisualCache;
|
||||
import Common.UI.VisualCache.VisualCaches;
|
||||
import Common.UI.VisualiserStringList;
|
||||
import Common.UI.Windows.Dialog.DBObjectDialog;
|
||||
import Common.Utils.Utils;
|
||||
import TestingSystem.DVM.DVMConfiguration.UI.ConfigurationFields;
|
||||
public class DVMConfigurationDBTable extends iDBTable<DVMConfiguration> {
|
||||
public DVMConfigurationDBTable() {
|
||||
@@ -39,11 +33,8 @@ public class DVMConfigurationDBTable extends iDBTable<DVMConfiguration> {
|
||||
}
|
||||
@Override
|
||||
protected void AdditionalInitColumns() {
|
||||
columns.get(5).setRenderer(TableRenderers.RendererMultiline);
|
||||
columns.get(5).setMaxWidth(500);
|
||||
columns.get(7).setRenderer(TableRenderers.RendererMultiline);
|
||||
columns.get(8).setRenderer(TableRenderers.RendererMultiline);
|
||||
columns.get(15).setRenderer(TableRenderers.RendererMultiline);
|
||||
columns.get(6).setRenderer(TableRenderers.RendererMultiline);
|
||||
columns.get(6).setMaxWidth(500);
|
||||
}
|
||||
};
|
||||
}
|
||||
@@ -53,17 +44,11 @@ public class DVMConfigurationDBTable extends iDBTable<DVMConfiguration> {
|
||||
"имя",
|
||||
"автор",
|
||||
"ядра",
|
||||
"параметры",
|
||||
"группы",
|
||||
"тестов",
|
||||
"флаги",
|
||||
"окружение",
|
||||
"c_time",
|
||||
"куб",
|
||||
"max",
|
||||
"min dim",
|
||||
"max dim",
|
||||
"r_time",
|
||||
"usr.par"
|
||||
"компиляция(с)",
|
||||
"запуск(с)"
|
||||
};
|
||||
}
|
||||
@Override
|
||||
@@ -76,32 +61,16 @@ public class DVMConfigurationDBTable extends iDBTable<DVMConfiguration> {
|
||||
return object.sender_name;
|
||||
case 4:
|
||||
return object.kernels;
|
||||
|
||||
case 5:
|
||||
return cache.groupsSummary;
|
||||
return cache.settingsSummary;
|
||||
case 6:
|
||||
return cache.getTestsCount();
|
||||
//todo упростить. и флаги и окружение будут просто одной строкой. мульти не актуально.
|
||||
return cache.groupsSummary;
|
||||
case 7:
|
||||
return Utils.unpackStrings(object.flags, true);
|
||||
return cache.getTestsCount();
|
||||
case 8:
|
||||
return Utils.unpackStrings(object.environments, true);
|
||||
//------------------------------------------------------------------------------------
|
||||
|
||||
case 9:
|
||||
return object.c_maxtime;
|
||||
case 10:
|
||||
return object.cube;
|
||||
case 11:
|
||||
return object.max_proc_count;
|
||||
case 12:
|
||||
return object.min_dim_proc_count;
|
||||
case 13:
|
||||
return object.max_dim_proc_count;
|
||||
case 14:
|
||||
case 9:
|
||||
return object.maxtime;
|
||||
case 15:
|
||||
return Utils.unpackStrings(object.usr_par, true);
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
@@ -111,70 +80,32 @@ public class DVMConfigurationDBTable extends iDBTable<DVMConfiguration> {
|
||||
return new DBObjectDialog<DVMConfiguration, ConfigurationFields>(ConfigurationFields.class) {
|
||||
@Override
|
||||
public int getDefaultHeight() {
|
||||
return 480;
|
||||
return 300;
|
||||
}
|
||||
@Override
|
||||
public int getDefaultWidth() {
|
||||
return 1000;
|
||||
}
|
||||
@Override
|
||||
public void validateFields() {
|
||||
int min = (int) fields.sMinDimProc.getValue();
|
||||
int max = (int) fields.sMaxDimProc.getValue();
|
||||
if (max < min)
|
||||
Log.Writeln_("Некорректный диапазон размерностей: максимум меньше минимума");
|
||||
if ((min == 0) && (max != 0) || (min != 0) && (max == 0))
|
||||
Log.Writeln_("Некорректный диапазон размерностей. " +
|
||||
"'0' допускается только одновременно на обеих границах,\n" +
|
||||
"и подразумевает единственный запуск без решётки");
|
||||
return 500;
|
||||
}
|
||||
@Override
|
||||
public void fillFields() {
|
||||
fields.tfName.setText(Result.description);
|
||||
//------->>>>
|
||||
((VisualiserStringList) (fields.flagsList)).fill(Result.getFlagsArray());
|
||||
((VisualiserStringList) (fields.environmentsList)).fill(Result.getEnvironments());
|
||||
((VisualiserStringList) (fields.parList)).fill(Result.getParams());
|
||||
//------->>>>
|
||||
fields.sCompilationMaxtime.setValue(Result.c_maxtime);
|
||||
//-
|
||||
fields.sMinDimProc.setValue(Result.min_dim_proc_count);
|
||||
fields.sMaxDimProc.setValue(Result.max_dim_proc_count);
|
||||
fields.cbCube.setSelected(Result.cube == 1);
|
||||
fields.sRunMaxtime.setValue(Result.maxtime);
|
||||
//-
|
||||
fields.sMaxProc.setValue(Result.max_proc_count);
|
||||
fields.sKernels.setValue(Result.kernels);
|
||||
}
|
||||
@Override
|
||||
public void ProcessResult() {
|
||||
Result.description = fields.tfName.getText();
|
||||
Result.c_maxtime = (int) fields.sCompilationMaxtime.getValue();
|
||||
Result.min_dim_proc_count = (int) fields.sMinDimProc.getValue();
|
||||
Result.max_dim_proc_count = (int) fields.sMaxDimProc.getValue();
|
||||
Result.cube = fields.cbCube.isSelected() ? 1 : 0;
|
||||
Result.max_proc_count = (int) fields.sMaxProc.getValue();
|
||||
Result.maxtime = (int) fields.sRunMaxtime.getValue();
|
||||
Result.flags = ((VisualiserStringList) (fields.flagsList)).pack();
|
||||
Result.environments = ((VisualiserStringList) (fields.environmentsList)).pack();
|
||||
Result.usr_par = ((VisualiserStringList) (fields.parList)).pack();
|
||||
Result.kernels= (int)fields.sKernels.getValue();
|
||||
Result.kernels = (int) fields.sKernels.getValue();
|
||||
}
|
||||
@Override
|
||||
public void SetReadonly() {
|
||||
fields.tfName.setEnabled(false);
|
||||
fields.sCompilationMaxtime.setEnabled(false);
|
||||
fields.sRunMaxtime.setEnabled(false);
|
||||
fields.sMinDimProc.setEnabled(false);
|
||||
fields.sMaxDimProc.setEnabled(false);
|
||||
fields.cbCube.setEnabled(false);
|
||||
fields.sMaxProc.setEnabled(false);
|
||||
fields.bAddFlags.setEnabled(false);
|
||||
fields.bDeleteFlags.setEnabled(false);
|
||||
fields.bAddEnvironments.setEnabled(false);
|
||||
fields.bDeleteEnvironment.setEnabled(false);
|
||||
fields.bAddPar.setEnabled(false);
|
||||
fields.bDeletePar.setEnabled(false);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -3,420 +3,103 @@
|
||||
<grid id="27dc6" binding="content" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||
<margin top="0" left="0" bottom="0" right="0"/>
|
||||
<constraints>
|
||||
<xy x="20" y="20" width="877" height="400"/>
|
||||
<xy x="20" y="20" width="467" height="163"/>
|
||||
</constraints>
|
||||
<properties/>
|
||||
<border type="none"/>
|
||||
<children>
|
||||
<splitpane id="78a2d" binding="SC1">
|
||||
<grid id="5bf8c" layout-manager="GridLayoutManager" row-count="5" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||
<margin top="0" left="0" bottom="0" right="0"/>
|
||||
<constraints>
|
||||
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false">
|
||||
<preferred-size width="200" height="200"/>
|
||||
</grid>
|
||||
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<dividerLocation value="500"/>
|
||||
<dividerSize value="3"/>
|
||||
</properties>
|
||||
<properties/>
|
||||
<border type="none"/>
|
||||
<children>
|
||||
<grid id="ee2fd" layout-manager="GridLayoutManager" row-count="9" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||
<margin top="0" left="0" bottom="0" right="0"/>
|
||||
<component id="18f5c" class="javax.swing.JLabel">
|
||||
<constraints>
|
||||
<splitpane position="left"/>
|
||||
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="2" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<font name="Times New Roman" size="16" style="2"/>
|
||||
<text value="название"/>
|
||||
</properties>
|
||||
</component>
|
||||
<vspacer id="68a9">
|
||||
<constraints>
|
||||
<grid row="4" column="0" row-span="1" col-span="1" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
</vspacer>
|
||||
<component id="fdaa3" class="javax.swing.JTextField" binding="tfName" custom-create="true">
|
||||
<constraints>
|
||||
<grid row="0" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
|
||||
<minimum-size width="200" height="30"/>
|
||||
<preferred-size width="238" height="30"/>
|
||||
<maximum-size width="200" height="30"/>
|
||||
</grid>
|
||||
</constraints>
|
||||
<properties/>
|
||||
<border type="none"/>
|
||||
<children>
|
||||
<component id="259d7" class="javax.swing.JLabel">
|
||||
<constraints>
|
||||
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="2" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<font name="Times New Roman" size="16" style="2"/>
|
||||
<text value="название"/>
|
||||
</properties>
|
||||
</component>
|
||||
<vspacer id="264c1">
|
||||
<constraints>
|
||||
<grid row="8" column="0" row-span="1" col-span="1" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
</vspacer>
|
||||
<component id="6795f" class="javax.swing.JTextField" binding="tfName" custom-create="true">
|
||||
<constraints>
|
||||
<grid row="0" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
|
||||
<minimum-size width="200" height="30"/>
|
||||
<preferred-size width="238" height="30"/>
|
||||
<maximum-size width="200" height="30"/>
|
||||
</grid>
|
||||
</constraints>
|
||||
<properties/>
|
||||
</component>
|
||||
<component id="9219f" class="javax.swing.JSpinner" binding="sMinDimProc">
|
||||
<constraints>
|
||||
<grid row="3" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
|
||||
<minimum-size width="100" height="30"/>
|
||||
<preferred-size width="100" height="30"/>
|
||||
<maximum-size width="100" height="30"/>
|
||||
</grid>
|
||||
</constraints>
|
||||
<properties/>
|
||||
</component>
|
||||
<component id="5686a" class="javax.swing.JLabel">
|
||||
<constraints>
|
||||
<grid row="3" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="2" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<font name="Times New Roman" size="16" style="2"/>
|
||||
<text value="мин. число процессоров по измерению"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="79cbe" class="javax.swing.JLabel">
|
||||
<constraints>
|
||||
<grid row="4" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="2" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<font name="Times New Roman" size="16" style="2"/>
|
||||
<text value="макс. число процессоров по измерению"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="33803" class="javax.swing.JSpinner" binding="sMaxDimProc">
|
||||
<constraints>
|
||||
<grid row="4" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
|
||||
<minimum-size width="100" height="30"/>
|
||||
<preferred-size width="100" height="30"/>
|
||||
<maximum-size width="100" height="30"/>
|
||||
</grid>
|
||||
</constraints>
|
||||
<properties/>
|
||||
</component>
|
||||
<component id="9b066" class="javax.swing.JLabel">
|
||||
<constraints>
|
||||
<grid row="6" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="2" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<font name="Times New Roman" size="16" style="2"/>
|
||||
<text value="макс. время компиляции, сек"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="d706b" class="javax.swing.JSpinner" binding="sCompilationMaxtime">
|
||||
<constraints>
|
||||
<grid row="6" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
|
||||
<minimum-size width="100" height="30"/>
|
||||
<preferred-size width="238" height="30"/>
|
||||
<maximum-size width="100" height="30"/>
|
||||
</grid>
|
||||
</constraints>
|
||||
<properties/>
|
||||
</component>
|
||||
<component id="a3108" class="javax.swing.JLabel">
|
||||
<constraints>
|
||||
<grid row="7" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="2" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<font name="Times New Roman" size="16" style="2"/>
|
||||
<text value="макс. время выполнения, сек"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="22d31" class="javax.swing.JSpinner" binding="sRunMaxtime">
|
||||
<constraints>
|
||||
<grid row="7" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
|
||||
<minimum-size width="100" height="30"/>
|
||||
<preferred-size width="100" height="30"/>
|
||||
<maximum-size width="100" height="30"/>
|
||||
</grid>
|
||||
</constraints>
|
||||
<properties/>
|
||||
</component>
|
||||
<component id="cda3" class="javax.swing.JCheckBox" binding="cbCube">
|
||||
<constraints>
|
||||
<grid row="5" column="0" row-span="1" col-span="2" vsize-policy="3" hsize-policy="3" anchor="8" fill="0" indent="2" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<font name="Times New Roman" size="16" style="2"/>
|
||||
<horizontalAlignment value="0"/>
|
||||
<icon value="icons/NotPick.png"/>
|
||||
<selectedIcon value="icons/Pick.png"/>
|
||||
<text value="кубические решётки"/>
|
||||
<toolTipText value="матрица с одинаковым размером измерений"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="a79b8" class="javax.swing.JLabel">
|
||||
<constraints>
|
||||
<grid row="2" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="2" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<font name="Times New Roman" size="16" style="2"/>
|
||||
<text value="макс. число процессоров"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="a6c17" class="javax.swing.JSpinner" binding="sMaxProc">
|
||||
<constraints>
|
||||
<grid row="2" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
|
||||
<minimum-size width="100" height="30"/>
|
||||
<preferred-size width="100" height="30"/>
|
||||
<maximum-size width="100" height="30"/>
|
||||
</grid>
|
||||
</constraints>
|
||||
<properties/>
|
||||
</component>
|
||||
<component id="9c982" class="javax.swing.JLabel">
|
||||
<constraints>
|
||||
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="2" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<font name="Times New Roman" size="16" style="2"/>
|
||||
<text value="ядра"/>
|
||||
<toolTipText value="количество ядер, задействованное при тестировани"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="91540" class="javax.swing.JSpinner" binding="sKernels">
|
||||
<constraints>
|
||||
<grid row="1" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
|
||||
<minimum-size width="100" height="30"/>
|
||||
<preferred-size width="100" height="30"/>
|
||||
<maximum-size width="100" height="30"/>
|
||||
</grid>
|
||||
</constraints>
|
||||
<properties/>
|
||||
</component>
|
||||
</children>
|
||||
</grid>
|
||||
<grid id="f79b4" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||
<margin top="0" left="0" bottom="0" right="0"/>
|
||||
</component>
|
||||
<component id="1a85a" class="javax.swing.JLabel">
|
||||
<constraints>
|
||||
<splitpane position="right"/>
|
||||
<grid row="2" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="2" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<font name="Times New Roman" size="16" style="2"/>
|
||||
<text value="макс. время компиляции, сек"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="fbc6d" class="javax.swing.JSpinner" binding="sCompilationMaxtime">
|
||||
<constraints>
|
||||
<grid row="2" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
|
||||
<minimum-size width="100" height="30"/>
|
||||
<preferred-size width="238" height="30"/>
|
||||
<maximum-size width="100" height="30"/>
|
||||
</grid>
|
||||
</constraints>
|
||||
<properties/>
|
||||
<border type="none"/>
|
||||
<children>
|
||||
<splitpane id="bd8be" binding="SC2">
|
||||
<constraints>
|
||||
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false">
|
||||
<preferred-size width="200" height="200"/>
|
||||
</grid>
|
||||
</constraints>
|
||||
<properties>
|
||||
<dividerLocation value="180"/>
|
||||
<dividerSize value="3"/>
|
||||
<orientation value="0"/>
|
||||
</properties>
|
||||
<border type="none"/>
|
||||
<children>
|
||||
<grid id="a9834" layout-manager="BorderLayout" hgap="0" vgap="0">
|
||||
<constraints>
|
||||
<splitpane position="left"/>
|
||||
</constraints>
|
||||
<properties/>
|
||||
<border type="none"/>
|
||||
<children>
|
||||
<toolbar id="4f6a1" binding="flagsTools">
|
||||
<constraints border-constraint="North"/>
|
||||
<properties>
|
||||
<floatable value="false"/>
|
||||
</properties>
|
||||
<border type="none"/>
|
||||
<children>
|
||||
<component id="566f4" class="javax.swing.JLabel">
|
||||
<constraints/>
|
||||
<properties>
|
||||
<font name="Times New Roman" size="16" style="2"/>
|
||||
<foreground color="-16777216"/>
|
||||
<text value="флаги"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="79287" class="javax.swing.JButton" binding="bAddFlags">
|
||||
<constraints/>
|
||||
<properties>
|
||||
<borderPainted value="false"/>
|
||||
<icon value="icons/Menu/Regions.png"/>
|
||||
<maximumSize width="30" height="30"/>
|
||||
<minimumSize width="30" height="30"/>
|
||||
<preferredSize width="30" height="30"/>
|
||||
<text value=""/>
|
||||
<toolTipText value="Добавить флаги"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="1cb75" class="javax.swing.JButton" binding="bDeleteFlags">
|
||||
<constraints/>
|
||||
<properties>
|
||||
<borderPainted value="false"/>
|
||||
<icon value="icons/Delete.png"/>
|
||||
<maximumSize width="30" height="30"/>
|
||||
<minimumSize width="30" height="30"/>
|
||||
<preferredSize width="30" height="30"/>
|
||||
<text value=""/>
|
||||
<toolTipText value="Удалить флаги"/>
|
||||
</properties>
|
||||
</component>
|
||||
</children>
|
||||
</toolbar>
|
||||
<scrollpane id="99ead">
|
||||
<constraints border-constraint="Center"/>
|
||||
<properties/>
|
||||
<border type="none"/>
|
||||
<children>
|
||||
<component id="c0373" class="javax.swing.JList" binding="flagsList" custom-create="true">
|
||||
<constraints/>
|
||||
<properties/>
|
||||
</component>
|
||||
</children>
|
||||
</scrollpane>
|
||||
</children>
|
||||
</grid>
|
||||
<grid id="b9287" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||
<margin top="0" left="0" bottom="0" right="0"/>
|
||||
<constraints>
|
||||
<splitpane position="right"/>
|
||||
</constraints>
|
||||
<properties/>
|
||||
<border type="none"/>
|
||||
<children>
|
||||
<splitpane id="53277" binding="SC3">
|
||||
<constraints>
|
||||
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false">
|
||||
<preferred-size width="200" height="200"/>
|
||||
</grid>
|
||||
</constraints>
|
||||
<properties>
|
||||
<dividerLocation value="85"/>
|
||||
<dividerSize value="3"/>
|
||||
<orientation value="0"/>
|
||||
</properties>
|
||||
<border type="none"/>
|
||||
<children>
|
||||
<grid id="3d5c8" layout-manager="BorderLayout" hgap="0" vgap="0">
|
||||
<constraints>
|
||||
<splitpane position="right"/>
|
||||
</constraints>
|
||||
<properties/>
|
||||
<border type="none"/>
|
||||
<children>
|
||||
<toolbar id="612de" binding="parTools">
|
||||
<constraints border-constraint="North"/>
|
||||
<properties>
|
||||
<floatable value="false"/>
|
||||
</properties>
|
||||
<border type="none"/>
|
||||
<children>
|
||||
<component id="4a428" class="javax.swing.JLabel">
|
||||
<constraints/>
|
||||
<properties>
|
||||
<font name="Times New Roman" size="16" style="2"/>
|
||||
<foreground color="-16777216"/>
|
||||
<text value="usr par"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="1d160" class="javax.swing.JButton" binding="bAddPar">
|
||||
<constraints/>
|
||||
<properties>
|
||||
<borderPainted value="false"/>
|
||||
<icon value="icons/RedAdd.png"/>
|
||||
<maximumSize width="30" height="30"/>
|
||||
<minimumSize width="30" height="30"/>
|
||||
<preferredSize width="30" height="30"/>
|
||||
<text value=""/>
|
||||
<toolTipText value="Добавить параметр DVM системы"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="61ba8" class="javax.swing.JButton" binding="bDeletePar">
|
||||
<constraints/>
|
||||
<properties>
|
||||
<borderPainted value="false"/>
|
||||
<icon value="icons/Delete.png"/>
|
||||
<maximumSize width="30" height="30"/>
|
||||
<minimumSize width="30" height="30"/>
|
||||
<preferredSize width="30" height="30"/>
|
||||
<text value=""/>
|
||||
<toolTipText value="Удалить параметр DVM системы"/>
|
||||
</properties>
|
||||
</component>
|
||||
</children>
|
||||
</toolbar>
|
||||
<scrollpane id="d0f3b">
|
||||
<constraints border-constraint="Center"/>
|
||||
<properties/>
|
||||
<border type="none"/>
|
||||
<children>
|
||||
<component id="7cdd5" class="javax.swing.JList" binding="parList" custom-create="true">
|
||||
<constraints/>
|
||||
<properties/>
|
||||
</component>
|
||||
</children>
|
||||
</scrollpane>
|
||||
</children>
|
||||
</grid>
|
||||
<grid id="4c856" layout-manager="BorderLayout" hgap="0" vgap="0">
|
||||
<constraints>
|
||||
<splitpane position="left"/>
|
||||
</constraints>
|
||||
<properties/>
|
||||
<border type="none"/>
|
||||
<children>
|
||||
<toolbar id="81953" binding="environmentsTools">
|
||||
<constraints border-constraint="North"/>
|
||||
<properties>
|
||||
<floatable value="false"/>
|
||||
</properties>
|
||||
<border type="none"/>
|
||||
<children>
|
||||
<component id="cec3c" class="javax.swing.JLabel">
|
||||
<constraints/>
|
||||
<properties>
|
||||
<font name="Times New Roman" size="16" style="2"/>
|
||||
<foreground color="-16777216"/>
|
||||
<text value="окружение"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="1e835" class="javax.swing.JButton" binding="bAddEnvironments">
|
||||
<constraints/>
|
||||
<properties>
|
||||
<borderPainted value="false"/>
|
||||
<icon value="icons/Menu/Regions.png"/>
|
||||
<maximumSize width="30" height="30"/>
|
||||
<minimumSize width="30" height="30"/>
|
||||
<preferredSize width="30" height="30"/>
|
||||
<text value=""/>
|
||||
<toolTipText value="Добавить набор переменных окружения"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="b9e9d" class="javax.swing.JButton" binding="bDeleteEnvironment">
|
||||
<constraints/>
|
||||
<properties>
|
||||
<borderPainted value="false"/>
|
||||
<icon value="icons/Delete.png"/>
|
||||
<maximumSize width="30" height="30"/>
|
||||
<minimumSize width="30" height="30"/>
|
||||
<preferredSize width="30" height="30"/>
|
||||
<text value=""/>
|
||||
<toolTipText value="Удалить переменную окружения"/>
|
||||
</properties>
|
||||
</component>
|
||||
</children>
|
||||
</toolbar>
|
||||
<scrollpane id="f94f5">
|
||||
<constraints border-constraint="Center"/>
|
||||
<properties/>
|
||||
<border type="none"/>
|
||||
<children>
|
||||
<component id="951ed" class="javax.swing.JList" binding="environmentsList" custom-create="true">
|
||||
<constraints/>
|
||||
<properties/>
|
||||
</component>
|
||||
</children>
|
||||
</scrollpane>
|
||||
</children>
|
||||
</grid>
|
||||
</children>
|
||||
</splitpane>
|
||||
</children>
|
||||
</grid>
|
||||
</children>
|
||||
</splitpane>
|
||||
</children>
|
||||
</grid>
|
||||
</component>
|
||||
<component id="30c43" class="javax.swing.JLabel">
|
||||
<constraints>
|
||||
<grid row="3" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="2" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<font name="Times New Roman" size="16" style="2"/>
|
||||
<text value="макс. время выполнения, сек"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="69368" class="javax.swing.JSpinner" binding="sRunMaxtime">
|
||||
<constraints>
|
||||
<grid row="3" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
|
||||
<minimum-size width="100" height="30"/>
|
||||
<preferred-size width="100" height="30"/>
|
||||
<maximum-size width="100" height="30"/>
|
||||
</grid>
|
||||
</constraints>
|
||||
<properties/>
|
||||
</component>
|
||||
<component id="15871" class="javax.swing.JLabel">
|
||||
<constraints>
|
||||
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="2" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<font name="Times New Roman" size="16" style="2"/>
|
||||
<text value="ядра"/>
|
||||
<toolTipText value="количество ядер, задействованное при тестировани"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="bd4cb" class="javax.swing.JSpinner" binding="sKernels">
|
||||
<constraints>
|
||||
<grid row="1" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
|
||||
<minimum-size width="100" height="30"/>
|
||||
<preferred-size width="100" height="30"/>
|
||||
<maximum-size width="100" height="30"/>
|
||||
</grid>
|
||||
</constraints>
|
||||
<properties/>
|
||||
</component>
|
||||
</children>
|
||||
</splitpane>
|
||||
</grid>
|
||||
</children>
|
||||
</grid>
|
||||
</form>
|
||||
|
||||
@@ -14,29 +14,10 @@ import java.awt.event.ActionEvent;
|
||||
import java.awt.event.ActionListener;
|
||||
public class ConfigurationFields implements DialogFields {
|
||||
public JTextField tfName;
|
||||
public JSpinner sMinDimProc;
|
||||
public JSpinner sMaxDimProc;
|
||||
public JSpinner sCompilationMaxtime;
|
||||
public JSpinner sRunMaxtime;
|
||||
public JCheckBox cbCube;
|
||||
public JSpinner sMaxProc;
|
||||
public JList<String> flagsList;
|
||||
public JList<String> environmentsList;
|
||||
public JList<String> parList;
|
||||
//-
|
||||
private JPanel content;
|
||||
private JSplitPane SC1;
|
||||
private JSplitPane SC2;
|
||||
private JToolBar flagsTools;
|
||||
public JButton bAddFlags;
|
||||
public JButton bDeleteFlags;
|
||||
private JSplitPane SC3;
|
||||
private JToolBar parTools;
|
||||
public JButton bAddPar;
|
||||
public JButton bDeletePar;
|
||||
private JToolBar environmentsTools;
|
||||
public JButton bAddEnvironments;
|
||||
public JButton bDeleteEnvironment;
|
||||
public JSpinner sKernels;
|
||||
@Override
|
||||
public Component getContent() {
|
||||
@@ -45,64 +26,14 @@ public class ConfigurationFields implements DialogFields {
|
||||
private void createUIComponents() {
|
||||
// TODO: place custom component creation code here
|
||||
tfName = new StyledTextField();
|
||||
//-
|
||||
flagsList = new VisualiserStringList();
|
||||
environmentsList = new VisualiserStringList();
|
||||
parList = new VisualiserStringList();
|
||||
}
|
||||
public ConfigurationFields(){
|
||||
sMinDimProc.setModel(new SpinnerNumberModel(1, 0, 128, 1));
|
||||
sMaxDimProc.setModel(new SpinnerNumberModel(1, 0, 128, 1));
|
||||
sMaxProc.setModel(new SpinnerNumberModel(0, 0, 128, 1));
|
||||
sCompilationMaxtime.setModel(new SpinnerNumberModel(40,
|
||||
5, 3600, 1
|
||||
));
|
||||
sRunMaxtime.setModel(new SpinnerNumberModel(40,
|
||||
5, 3600, 1
|
||||
));
|
||||
bAddFlags.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
Pass_2021 pass = Pass_2021.passes.get(PassCode_2021.PickCompilerOptions);
|
||||
if (pass.Do(Current.getCompiler()))
|
||||
((VisualiserStringList) flagsList).addElement((String) pass.target);
|
||||
}
|
||||
});
|
||||
bDeleteFlags.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
((VisualiserStringList) flagsList).removeElement(flagsList.getSelectedValue());
|
||||
}
|
||||
});
|
||||
bAddEnvironments.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
Pass_2021 pass = Pass_2021.passes.get(PassCode_2021.PickCompilerEnvironmentsForTesting);
|
||||
if (pass.Do(Current.getCompiler()))
|
||||
((VisualiserStringList) environmentsList).addElement((String) pass.target);
|
||||
}
|
||||
});
|
||||
bDeleteEnvironment.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
((VisualiserStringList) environmentsList).removeElement(environmentsList.getSelectedValue());
|
||||
}
|
||||
});
|
||||
bDeletePar.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
((VisualiserStringList) parList).removeElement(parList.getSelectedValue());
|
||||
}
|
||||
});
|
||||
bAddPar.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
Pass_2021 pass = Pass_2021.passes.get(PassCode_2021.AddDVMParameterForTesting);
|
||||
if (pass.Do()) {
|
||||
((VisualiserStringList) parList).addElement((String) pass.target);
|
||||
}
|
||||
}
|
||||
});
|
||||
sKernels.setModel(new SpinnerNumberModel(1, 1,
|
||||
Utils.getTestingMaxKernels(),
|
||||
1));
|
||||
|
||||
@@ -3,13 +3,19 @@ import Common.Constants;
|
||||
import Common.Current;
|
||||
import Common.Database.DBObject;
|
||||
import Common.Global;
|
||||
import Common.UI.VisualCache.DVMConfigurationCache;
|
||||
import Common.UI.VisualCache.VisualCaches;
|
||||
import GlobalData.Account.Account;
|
||||
import GlobalData.Compiler.Compiler;
|
||||
import GlobalData.Machine.Machine;
|
||||
import GlobalData.Machine.MachineType;
|
||||
import GlobalData.User.User;
|
||||
import TestingSystem.Common.Group.Group;
|
||||
import TestingSystem.Common.TasksPackageState;
|
||||
import TestingSystem.Common.Test.Test;
|
||||
import TestingSystem.Common.TestingPackage.TestingPackage;
|
||||
import TestingSystem.DVM.DVMConfiguration.DVMConfiguration;
|
||||
import TestingSystem.DVM.DVMSettings.DVMSettings;
|
||||
import TestingSystem.DVM.DVMTasks.DVMCompilationTask;
|
||||
import TestingSystem.DVM.DVMTasks.DVMRunTask;
|
||||
|
||||
@@ -27,7 +33,12 @@ public class DVMPackage extends TestingPackage<DVMPackage_json> {
|
||||
//---
|
||||
public DVMPackage() {
|
||||
}
|
||||
public DVMPackage(Account account, Machine machine, User user, Compiler compiler, int kernels_in){
|
||||
public DVMPackage(Account account,
|
||||
Machine machine,
|
||||
User user,
|
||||
Compiler compiler,
|
||||
Vector<DVMConfiguration> configurations,
|
||||
int neeedsEmail_in) {
|
||||
id = Constants.Nan;
|
||||
//-
|
||||
sender_name = account.name;
|
||||
@@ -44,12 +55,29 @@ public class DVMPackage extends TestingPackage<DVMPackage_json> {
|
||||
drv = compiler.call_command;
|
||||
version = compiler.getVersionInfo();
|
||||
//-
|
||||
kernels = kernels_in; //Global.properties.TestingKernels;
|
||||
needsEmail = Global.properties.EmailOnTestingProgress ? 1 : 0;
|
||||
//--
|
||||
package_json = new DVMPackage_json();
|
||||
needsEmail = neeedsEmail_in;
|
||||
//--
|
||||
state = TasksPackageState.Queued;
|
||||
//--
|
||||
for (DVMConfiguration configuration : configurations)
|
||||
kernels = Math.max(configuration.kernels, kernels);
|
||||
//-
|
||||
tasksCount = 0;
|
||||
Vector<DVMCompilationTask> compilationTasks = new Vector<DVMCompilationTask>();
|
||||
for (DVMConfiguration configuration : configurations) {
|
||||
DVMConfigurationCache cache = (DVMConfigurationCache) VisualCaches.GetCache(configuration);
|
||||
for (Group group : cache.getGroups()) {
|
||||
for (Test test : cache.getGroupTests(group)) {
|
||||
for (DVMSettings dvmSettings : cache.getSettings()) {
|
||||
DVMCompilationTask compilationTask = new DVMCompilationTask(configuration, dvmSettings, group, test, kernels);
|
||||
compilationTasks.add(compilationTask);
|
||||
tasksCount += compilationTask.runTasks.size();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
package_json = new DVMPackage_json(compilationTasks);
|
||||
saveConfigurationsAsJson(configurations);
|
||||
}
|
||||
@Override
|
||||
public Class getJsonClass() {
|
||||
@@ -83,25 +111,8 @@ public class DVMPackage extends TestingPackage<DVMPackage_json> {
|
||||
}
|
||||
@Override
|
||||
public boolean isVisible() {
|
||||
return (!DVMPackageDBTable.filterMyOnly || Current.getAccount().email.equals(sender_address))&&
|
||||
(!DVMPackageDBTable.filterActive || state.isActive() );
|
||||
}
|
||||
public void saveTasks(Vector<DVMCompilationTask> tasks, int allTasksCount){
|
||||
tasksCount=allTasksCount;
|
||||
//--
|
||||
package_json=new DVMPackage_json();
|
||||
DVMPackage_json json = package_json;
|
||||
//инициализируем идентификаторы задач.
|
||||
for (DVMCompilationTask compilationTask : tasks) {
|
||||
//--
|
||||
compilationTask.id = json.getMaxTaskId();
|
||||
//-
|
||||
for (DVMRunTask runTask : compilationTask.runTasks) {
|
||||
runTask.id = json.getMaxTaskId();
|
||||
runTask.dvmcompilationtask_id = compilationTask.id;
|
||||
}
|
||||
}
|
||||
json.compilationTasks.addAll(tasks);
|
||||
return (!DVMPackageDBTable.filterMyOnly || Current.getAccount().email.equals(sender_address)) &&
|
||||
(!DVMPackageDBTable.filterActive || state.isActive());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package TestingSystem.DVM.DVMPackage;
|
||||
import TestingSystem.DVM.DVMTasks.DVMCompilationTask;
|
||||
import TestingSystem.DVM.DVMTasks.DVMRunTask;
|
||||
import com.google.gson.annotations.Expose;
|
||||
|
||||
import java.io.Serializable;
|
||||
@@ -13,5 +14,16 @@ public class DVMPackage_json implements Serializable {
|
||||
public int getMaxTaskId() {
|
||||
return max_task_id++;
|
||||
}
|
||||
|
||||
public DVMPackage_json(){}
|
||||
public DVMPackage_json(List<DVMCompilationTask> tasks){
|
||||
for (DVMCompilationTask compilationTask : tasks) {
|
||||
compilationTask.id = getMaxTaskId();
|
||||
//-
|
||||
for (DVMRunTask runTask : compilationTask.runTasks) {
|
||||
runTask.id = getMaxTaskId();
|
||||
runTask.dvmcompilationtask_id = compilationTask.id;
|
||||
}
|
||||
}
|
||||
compilationTasks.addAll(tasks);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,88 @@
|
||||
package TestingSystem.DVM.DVMSettings;
|
||||
import Common.Database.DBObject;
|
||||
import GlobalData.RunConfiguration.RunConfiguration;
|
||||
import TestingSystem.Common.Settings.Settings;
|
||||
import TestingSystem.DVM.DVMConfiguration.DVMConfiguration;
|
||||
import com.sun.org.glassfish.gmbal.Description;
|
||||
|
||||
import java.util.Vector;
|
||||
public class DVMSettings extends Settings {
|
||||
//todo.хранить флаги и окружение в json чтобы можно было в форме их видеть.
|
||||
public String environments="";
|
||||
@Description("DEFAULT 0")
|
||||
public int Is_DVM_STAT= 0; //флаг вмест usr par, которые не использовались.
|
||||
// public String usr_par = "";
|
||||
//---
|
||||
public int cube = 0; //
|
||||
public int max_proc_count = 4;
|
||||
public int min_dim_proc_count = 1;
|
||||
public int max_dim_proc_count = 4;
|
||||
//
|
||||
public DVMSettings(){}
|
||||
public DVMSettings(DVMSettings src){
|
||||
this.SynchronizeFields(src);
|
||||
}
|
||||
@Override
|
||||
public void SynchronizeFields(DBObject src) {
|
||||
super.SynchronizeFields(src);
|
||||
DVMSettings c = (DVMSettings) src;
|
||||
environments=c.environments;
|
||||
Is_DVM_STAT = c.Is_DVM_STAT;
|
||||
// usr_par=c.usr_par;
|
||||
//-
|
||||
cube= c.cube;
|
||||
max_proc_count=c.max_proc_count;
|
||||
min_dim_proc_count=c.min_dim_proc_count;
|
||||
max_dim_proc_count=c.max_dim_proc_count;
|
||||
}
|
||||
public String printUsrPar(){
|
||||
return "Is_DVM_STAT="+Is_DVM_STAT;
|
||||
}
|
||||
public Vector<String> getMatrixes(int testDim) {
|
||||
Vector<Vector<Integer>> res_ = new Vector<>();
|
||||
Vector<String> res = new Vector<>();
|
||||
if ((max_proc_count==0) || (min_dim_proc_count == 0 && max_dim_proc_count == 0)) {
|
||||
res.add("");
|
||||
} else {
|
||||
if (testDim > 0) {
|
||||
Vector<String> min_border = new Vector<>();
|
||||
Vector<String> max_border = new Vector<>();
|
||||
for (int i = 1; i <= testDim; ++i) {
|
||||
min_border.add(String.valueOf(min_dim_proc_count));
|
||||
max_border.add(String.valueOf(max_dim_proc_count));
|
||||
}
|
||||
Vector<Integer> from = RunConfiguration.getBounds(String.join(" ", min_border));
|
||||
Vector<Integer> to = RunConfiguration.getBounds(String.join(" ", max_border));
|
||||
if (from.size() != to.size()) {
|
||||
return res;
|
||||
}
|
||||
if (from.size() != testDim) {
|
||||
return res;
|
||||
}
|
||||
//1 стадия. заполнение.
|
||||
for (int j = from.get(0); j <= to.get(0); ++j) {
|
||||
Vector<Integer> m = new Vector<>();
|
||||
res_.add(m);
|
||||
m.add(j);
|
||||
}
|
||||
//---
|
||||
if (testDim > 1) RunConfiguration.gen_rec(from, to, res_, 1, testDim, cube == 1);
|
||||
for (Vector<Integer> m : res_) {
|
||||
Vector<String> ms = new Vector<>();
|
||||
int proc = 1;
|
||||
for (int i : m) {
|
||||
ms.add(String.valueOf(i));
|
||||
proc *= i;
|
||||
}
|
||||
if (proc <= max_proc_count)
|
||||
res.add(String.join(" ", ms));
|
||||
}
|
||||
} else res.add("");
|
||||
}
|
||||
return res;
|
||||
}
|
||||
public String getParamsText() {
|
||||
return "Is_DVM_STAT="+Is_DVM_STAT;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
149
src/TestingSystem/DVM/DVMSettings/DVMSettingsDBTable.java
Normal file
149
src/TestingSystem/DVM/DVMSettings/DVMSettingsDBTable.java
Normal file
@@ -0,0 +1,149 @@
|
||||
package TestingSystem.DVM.DVMSettings;
|
||||
import Common.Current;
|
||||
import Common.Database.DBObject;
|
||||
import Common.Database.iDBTable;
|
||||
import Common.UI.DataSetControlForm;
|
||||
import Common.UI.VisualiserStringList;
|
||||
import Common.UI.Windows.Dialog.DBObjectDialog;
|
||||
import TestingSystem.DVM.DVMConfiguration.DVMConfiguration;
|
||||
import TestingSystem.DVM.DVMConfiguration.UI.ConfigurationFields;
|
||||
import TestingSystem.DVM.DVMSettings.UI.DVMSettingsFields;
|
||||
public class DVMSettingsDBTable extends iDBTable<DVMSettings> {
|
||||
public DVMSettingsDBTable() {
|
||||
super(DVMSettings.class);
|
||||
}
|
||||
@Override
|
||||
public Current CurrentName() {
|
||||
return Current.DVMSettings;
|
||||
}
|
||||
@Override
|
||||
public String getSingleDescription() {
|
||||
return "параметры тестирования DVM системы";
|
||||
}
|
||||
@Override
|
||||
public String getPluralDescription() {
|
||||
return "параметры тестирования DVM системы";
|
||||
}
|
||||
//--
|
||||
@Override
|
||||
public String[] getUIColumnNames() {
|
||||
return new String[]{
|
||||
"имя",
|
||||
"автор",
|
||||
"флаги",
|
||||
"окружение",
|
||||
"usr.par",
|
||||
"куб",
|
||||
"max",
|
||||
"min dim",
|
||||
"max dim"
|
||||
};
|
||||
}
|
||||
//--
|
||||
@Override
|
||||
public Object getFieldAt(DVMSettings object, int columnIndex) {
|
||||
switch (columnIndex) {
|
||||
case 2:
|
||||
return object.description;
|
||||
case 3:
|
||||
return object.sender_name;
|
||||
case 4:
|
||||
return object.flags;
|
||||
case 5:
|
||||
return object.environments;
|
||||
case 6:
|
||||
return object.printUsrPar();
|
||||
case 7:
|
||||
return object.cube;
|
||||
case 8:
|
||||
return object.max_proc_count;
|
||||
case 9:
|
||||
return object.min_dim_proc_count;
|
||||
case 10:
|
||||
return object.max_dim_proc_count;
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
//-
|
||||
@Override
|
||||
protected DataSetControlForm createUI() {
|
||||
return new DataSetControlForm(this) {
|
||||
@Override
|
||||
public boolean hasCheckBox() {
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
protected void AdditionalInitColumns() {
|
||||
/*
|
||||
columns.get(5).setRenderer(TableRenderers.RendererMultiline);
|
||||
columns.get(5).setMaxWidth(500);
|
||||
columns.get(7).setRenderer(TableRenderers.RendererMultiline);
|
||||
columns.get(8).setRenderer(TableRenderers.RendererMultiline);
|
||||
columns.get(15).setRenderer(TableRenderers.RendererMultiline);
|
||||
*/
|
||||
}
|
||||
};
|
||||
}
|
||||
@Override
|
||||
public DBObjectDialog<DVMSettings, DVMSettingsFields> getDialog() {
|
||||
return new DBObjectDialog<DVMSettings, DVMSettingsFields>(DVMSettingsFields.class) {
|
||||
@Override
|
||||
public int getDefaultHeight() {
|
||||
return 400;
|
||||
}
|
||||
@Override
|
||||
public int getDefaultWidth() {
|
||||
return 800;
|
||||
}
|
||||
@Override
|
||||
public void validateFields() {
|
||||
int min = (int) fields.sMinDimProc.getValue();
|
||||
int max = (int) fields.sMaxDimProc.getValue();
|
||||
if (max < min)
|
||||
Log.Writeln_("Некорректный диапазон размерностей: максимум меньше минимума");
|
||||
if ((min == 0) && (max != 0) || (min != 0) && (max == 0))
|
||||
Log.Writeln_("Некорректный диапазон размерностей. " +
|
||||
"'0' допускается только одновременно на обеих границах,\n" +
|
||||
"и подразумевает единственный запуск без решётки");
|
||||
}
|
||||
@Override
|
||||
public void fillFields() {
|
||||
fields.tfName.setText(Result.description);
|
||||
//------->>>
|
||||
fields.tfFlags.setText(Result.flags);
|
||||
fields.tfEnvironments.setText(Result.environments);
|
||||
//------->>>
|
||||
fields.sMinDimProc.setValue(Result.min_dim_proc_count);
|
||||
fields.sMaxDimProc.setValue(Result.max_dim_proc_count);
|
||||
fields.cbCube.setSelected(Result.cube == 1);
|
||||
//-
|
||||
fields.sMaxProc.setValue(Result.max_proc_count);
|
||||
fields.cbDvmStat.setSelected(Result.Is_DVM_STAT!=0);
|
||||
}
|
||||
@Override
|
||||
public void ProcessResult() {
|
||||
Result.description = fields.tfName.getText();
|
||||
Result.min_dim_proc_count = (int) fields.sMinDimProc.getValue();
|
||||
Result.max_dim_proc_count = (int) fields.sMaxDimProc.getValue();
|
||||
Result.cube = fields.cbCube.isSelected() ? 1 : 0;
|
||||
Result.max_proc_count = (int) fields.sMaxProc.getValue();
|
||||
Result.flags = fields.tfFlags.getText();
|
||||
Result.environments = fields.tfEnvironments.getText();
|
||||
Result.Is_DVM_STAT = fields.cbDvmStat.isSelected()?1:0;
|
||||
}
|
||||
@Override
|
||||
public void SetReadonly() {
|
||||
fields.tfName.setEnabled(false);
|
||||
fields.sMinDimProc.setEnabled(false);
|
||||
fields.sMaxDimProc.setEnabled(false);
|
||||
fields.cbCube.setEnabled(false);
|
||||
fields.sMaxProc.setEnabled(false);
|
||||
}
|
||||
};
|
||||
}
|
||||
@Override
|
||||
public boolean ShowEditObjectDialog(DBObject object) {
|
||||
return (Current.getAccount().CheckAccessRights(((DVMSettings) object).sender_address, null)) ? super.ShowEditObjectDialog(object) : ViewObject(object);
|
||||
}
|
||||
}
|
||||
13
src/TestingSystem/DVM/DVMSettings/UI/DVMSettingsBar.java
Normal file
13
src/TestingSystem/DVM/DVMSettings/UI/DVMSettingsBar.java
Normal file
@@ -0,0 +1,13 @@
|
||||
package TestingSystem.DVM.DVMSettings.UI;
|
||||
import Common.UI.Menus_2023.DataMenuBar;
|
||||
import Visual_DVM_2021.Passes.PassCode_2021;
|
||||
public class DVMSettingsBar extends DataMenuBar {
|
||||
public DVMSettingsBar() {
|
||||
super("параметры тестированя",
|
||||
|
||||
PassCode_2021.PublishDVMSettings,
|
||||
PassCode_2021.EditDVMSettings,
|
||||
PassCode_2021.DeleteDVMSettings
|
||||
);
|
||||
}
|
||||
}
|
||||
227
src/TestingSystem/DVM/DVMSettings/UI/DVMSettingsFields.form
Normal file
227
src/TestingSystem/DVM/DVMSettings/UI/DVMSettingsFields.form
Normal file
@@ -0,0 +1,227 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="TestingSystem.DVM.DVMSettings.UI.DVMSettingsFields">
|
||||
<grid id="27dc6" binding="content" layout-manager="BorderLayout" hgap="0" vgap="0">
|
||||
<constraints>
|
||||
<xy x="20" y="20" width="777" height="400"/>
|
||||
</constraints>
|
||||
<properties/>
|
||||
<border type="none"/>
|
||||
<children>
|
||||
<grid id="e9baf" layout-manager="GridLayoutManager" row-count="9" column-count="4" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||
<margin top="0" left="0" bottom="0" right="0"/>
|
||||
<constraints border-constraint="Center"/>
|
||||
<properties/>
|
||||
<border type="none"/>
|
||||
<children>
|
||||
<component id="8f4d9" class="javax.swing.JLabel">
|
||||
<constraints>
|
||||
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="2" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<font name="Times New Roman" size="16" style="2"/>
|
||||
<text value="название"/>
|
||||
</properties>
|
||||
</component>
|
||||
<vspacer id="2176d">
|
||||
<constraints>
|
||||
<grid row="8" column="0" row-span="1" col-span="1" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
</vspacer>
|
||||
<component id="c61a7" class="javax.swing.JTextField" binding="tfName" custom-create="true">
|
||||
<constraints>
|
||||
<grid row="0" column="3" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
|
||||
<minimum-size width="200" height="30"/>
|
||||
<preferred-size width="238" height="30"/>
|
||||
<maximum-size width="200" height="30"/>
|
||||
</grid>
|
||||
</constraints>
|
||||
<properties/>
|
||||
</component>
|
||||
<component id="a1d86" class="javax.swing.JSpinner" binding="sMinDimProc">
|
||||
<constraints>
|
||||
<grid row="5" column="3" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
|
||||
<minimum-size width="100" height="30"/>
|
||||
<preferred-size width="100" height="30"/>
|
||||
<maximum-size width="100" height="30"/>
|
||||
</grid>
|
||||
</constraints>
|
||||
<properties/>
|
||||
</component>
|
||||
<component id="deae5" class="javax.swing.JLabel">
|
||||
<constraints>
|
||||
<grid row="5" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="2" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<font name="Times New Roman" size="16" style="2"/>
|
||||
<text value="мин. число процессоров по измерению"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="61ffc" class="javax.swing.JLabel">
|
||||
<constraints>
|
||||
<grid row="6" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="2" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<font name="Times New Roman" size="16" style="2"/>
|
||||
<text value="макс. число процессоров по измерению"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="380de" class="javax.swing.JSpinner" binding="sMaxDimProc">
|
||||
<constraints>
|
||||
<grid row="6" column="3" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
|
||||
<minimum-size width="100" height="30"/>
|
||||
<preferred-size width="100" height="30"/>
|
||||
<maximum-size width="100" height="30"/>
|
||||
</grid>
|
||||
</constraints>
|
||||
<properties/>
|
||||
</component>
|
||||
<component id="9b010" class="javax.swing.JCheckBox" binding="cbCube">
|
||||
<constraints>
|
||||
<grid row="7" column="0" row-span="1" col-span="4" vsize-policy="3" hsize-policy="3" anchor="8" fill="0" indent="2" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<font name="Times New Roman" size="16" style="2"/>
|
||||
<horizontalAlignment value="0"/>
|
||||
<icon value="icons/NotPick.png"/>
|
||||
<selectedIcon value="icons/Pick.png"/>
|
||||
<text value="кубические решётки"/>
|
||||
<toolTipText value="матрица с одинаковым размером измерений"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="bd5c7" class="javax.swing.JLabel">
|
||||
<constraints>
|
||||
<grid row="4" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="2" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<font name="Times New Roman" size="16" style="2"/>
|
||||
<text value="макс. число процессоров"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="ad38a" class="javax.swing.JSpinner" binding="sMaxProc">
|
||||
<constraints>
|
||||
<grid row="4" column="3" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
|
||||
<minimum-size width="100" height="30"/>
|
||||
<preferred-size width="100" height="30"/>
|
||||
<maximum-size width="100" height="30"/>
|
||||
</grid>
|
||||
</constraints>
|
||||
<properties/>
|
||||
</component>
|
||||
<component id="4d47b" class="javax.swing.JLabel">
|
||||
<constraints>
|
||||
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="2" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<font name="Times New Roman" size="16" style="2"/>
|
||||
<text value="флаги"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="45943" class="javax.swing.JLabel">
|
||||
<constraints>
|
||||
<grid row="2" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="2" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<font name="Times New Roman" size="16" style="2"/>
|
||||
<text value="окружение"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="decc3" class="javax.swing.JTextField" binding="tfFlags">
|
||||
<constraints>
|
||||
<grid row="1" column="3" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
|
||||
<minimum-size width="400" height="30"/>
|
||||
<preferred-size width="400" height="30"/>
|
||||
<maximum-size width="400" height="30"/>
|
||||
</grid>
|
||||
</constraints>
|
||||
<properties>
|
||||
<editable value="false"/>
|
||||
<font size="10"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="f6927" class="javax.swing.JTextField" binding="tfEnvironments">
|
||||
<constraints>
|
||||
<grid row="2" column="3" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
|
||||
<minimum-size width="400" height="30"/>
|
||||
<preferred-size width="400" height="30"/>
|
||||
<maximum-size width="400" height="30"/>
|
||||
</grid>
|
||||
</constraints>
|
||||
<properties>
|
||||
<editable value="false"/>
|
||||
<font size="10"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="265bb" class="javax.swing.JButton" binding="bAddFlags">
|
||||
<constraints>
|
||||
<grid row="1" column="1" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="0" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<borderPainted value="false"/>
|
||||
<icon value="icons/Menu/Regions.png"/>
|
||||
<maximumSize width="30" height="30"/>
|
||||
<minimumSize width="30" height="30"/>
|
||||
<preferredSize width="30" height="30"/>
|
||||
<text value=""/>
|
||||
<toolTipText value="Редактировать флаги"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="77de1" class="javax.swing.JButton" binding="bAddEnvironments">
|
||||
<constraints>
|
||||
<grid row="2" column="1" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="0" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<borderPainted value="false"/>
|
||||
<icon value="icons/Menu/Regions.png"/>
|
||||
<maximumSize width="30" height="30"/>
|
||||
<minimumSize width="30" height="30"/>
|
||||
<preferredSize width="30" height="30"/>
|
||||
<text value=""/>
|
||||
<toolTipText value="Добавить набор переменных окружения"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="7682" class="javax.swing.JButton" binding="bDeleteFlags">
|
||||
<constraints>
|
||||
<grid row="1" column="2" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="0" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<borderPainted value="false"/>
|
||||
<icon value="icons/Delete.png"/>
|
||||
<maximumSize width="30" height="30"/>
|
||||
<minimumSize width="30" height="30"/>
|
||||
<preferredSize width="30" height="30"/>
|
||||
<text value=""/>
|
||||
<toolTipText value="Удалить флаги"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="6c384" class="javax.swing.JButton" binding="bDeleteEnvironment">
|
||||
<constraints>
|
||||
<grid row="2" column="2" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="0" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<borderPainted value="false"/>
|
||||
<icon value="icons/Delete.png"/>
|
||||
<maximumSize width="30" height="30"/>
|
||||
<minimumSize width="30" height="30"/>
|
||||
<preferredSize width="30" height="30"/>
|
||||
<text value=""/>
|
||||
<toolTipText value="Удалить переменную окружения"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="3f04c" class="javax.swing.JCheckBox" binding="cbDvmStat">
|
||||
<constraints>
|
||||
<grid row="3" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="8" fill="0" indent="2" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<font name="Times New Roman" size="16" style="2"/>
|
||||
<horizontalAlignment value="0"/>
|
||||
<icon value="icons/NotPick.png"/>
|
||||
<selectedIcon value="icons/Pick.png"/>
|
||||
<text value="Is_DVM_STAT"/>
|
||||
<toolTipText value="сбор статистики DVM после запуска"/>
|
||||
</properties>
|
||||
</component>
|
||||
</children>
|
||||
</grid>
|
||||
</children>
|
||||
</grid>
|
||||
</form>
|
||||
68
src/TestingSystem/DVM/DVMSettings/UI/DVMSettingsFields.java
Normal file
68
src/TestingSystem/DVM/DVMSettings/UI/DVMSettingsFields.java
Normal file
@@ -0,0 +1,68 @@
|
||||
package TestingSystem.DVM.DVMSettings.UI;
|
||||
import Common.Current;
|
||||
import Common.UI.TextField.StyledTextField;
|
||||
import Common.UI.Windows.Dialog.DialogFields;
|
||||
import Visual_DVM_2021.Passes.PassCode_2021;
|
||||
import Visual_DVM_2021.Passes.Pass_2021;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.ActionListener;
|
||||
public class DVMSettingsFields implements DialogFields {
|
||||
private JPanel content;
|
||||
public JTextField tfName;
|
||||
public JSpinner sMinDimProc;
|
||||
public JSpinner sMaxDimProc;
|
||||
public JSpinner sMaxProc;
|
||||
public JCheckBox cbCube;
|
||||
public JTextField tfFlags;
|
||||
public JTextField tfEnvironments;
|
||||
private JButton bAddFlags;
|
||||
private JButton bAddEnvironments;
|
||||
private JButton bDeleteFlags;
|
||||
private JButton bDeleteEnvironment;
|
||||
public JCheckBox cbDvmStat;
|
||||
@Override
|
||||
public Component getContent() {
|
||||
return content;
|
||||
}
|
||||
private void createUIComponents() {
|
||||
// TODO: place custom component creation code here
|
||||
tfName = new StyledTextField();
|
||||
}
|
||||
public DVMSettingsFields(){
|
||||
sMinDimProc.setModel(new SpinnerNumberModel(1, 0, 128, 1));
|
||||
sMaxDimProc.setModel(new SpinnerNumberModel(1, 0, 128, 1));
|
||||
sMaxProc.setModel(new SpinnerNumberModel(0, 0, 128, 1));
|
||||
bAddFlags.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
Pass_2021 pass = Pass_2021.passes.get(PassCode_2021.PickCompilerOptions);
|
||||
if (pass.Do(Current.getCompiler())) {
|
||||
tfFlags.setText((String)pass.target);
|
||||
}
|
||||
}
|
||||
});
|
||||
bAddEnvironments.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
Pass_2021 pass = Pass_2021.passes.get(PassCode_2021.PickCompilerEnvironmentsForTesting);
|
||||
if (pass.Do(Current.getCompiler()))
|
||||
tfEnvironments.setText((String)pass.target);
|
||||
}
|
||||
});
|
||||
bDeleteFlags.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
tfFlags.setText("");
|
||||
}
|
||||
});
|
||||
bDeleteEnvironment.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
tfEnvironments.setText("");
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,9 @@
|
||||
package TestingSystem.DVM.DVMTasks;
|
||||
import Common.Utils.Utils;
|
||||
import TestingSystem.Common.Group.Group;
|
||||
import TestingSystem.Common.Test.Test;
|
||||
import TestingSystem.DVM.DVMConfiguration.DVMConfiguration;
|
||||
import TestingSystem.DVM.DVMSettings.DVMSettings;
|
||||
import com.google.gson.annotations.Expose;
|
||||
|
||||
import java.util.List;
|
||||
@@ -10,14 +12,6 @@ public class DVMCompilationTask extends DVMTask {
|
||||
@Expose
|
||||
public List<DVMRunTask> runTasks = new Vector<>();
|
||||
//-
|
||||
public DVMCompilationTask(DVMConfiguration configuration,
|
||||
Group group,
|
||||
Test test,
|
||||
String flags_in
|
||||
) {
|
||||
super(configuration, group, test, flags_in);
|
||||
maxtime = configuration.c_maxtime;
|
||||
}
|
||||
public DVMCompilationTask() {
|
||||
|
||||
}
|
||||
@@ -30,4 +24,51 @@ public class DVMCompilationTask extends DVMTask {
|
||||
res.add(arg.toString().replace("\n", "|")); //4
|
||||
return res;
|
||||
}
|
||||
//--
|
||||
public static String checkFlags(String flags_in) {
|
||||
if (!flags_in.contains("-shared-dvm")) {
|
||||
if (flags_in.isEmpty())
|
||||
return "-shared-dvm";
|
||||
else return flags_in + " -shared-dvm";
|
||||
} else
|
||||
return flags_in;
|
||||
}
|
||||
public static String checkEnvironments(String environmentsSet_in) {
|
||||
if (!environmentsSet_in.contains("DVMH_NO_DIRECT_COPY")) {
|
||||
if (environmentsSet_in.isEmpty())
|
||||
return "DVMH_NO_DIRECT_COPY=" + Utils.DQuotes("1");
|
||||
else
|
||||
return environmentsSet_in + " " + "DVMH_NO_DIRECT_COPY=" + Utils.DQuotes("1");
|
||||
} else
|
||||
return environmentsSet_in;
|
||||
}
|
||||
//--
|
||||
public DVMCompilationTask(DVMConfiguration configuration, DVMSettings dvmSettings, Group group, Test test, int kernels_in){
|
||||
super (configuration, group, test,checkFlags(dvmSettings.flags));
|
||||
Vector<String> matrixes = dvmSettings.getMatrixes(test.max_dim);
|
||||
String checkedEnvironments = checkEnvironments(dvmSettings.environments);
|
||||
if (dvmSettings.flags.trim().equalsIgnoreCase("-s")) {
|
||||
runTasks.add(new DVMRunTask(
|
||||
configuration,
|
||||
dvmSettings,
|
||||
group,
|
||||
test,
|
||||
"",
|
||||
flags,
|
||||
checkedEnvironments,
|
||||
kernels_in
|
||||
));
|
||||
} else
|
||||
for (String matrix : matrixes) {
|
||||
runTasks.add(new DVMRunTask(
|
||||
configuration,
|
||||
dvmSettings,
|
||||
group,
|
||||
test,
|
||||
matrix,
|
||||
flags,
|
||||
checkedEnvironments,
|
||||
kernels_in));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@ import TestingSystem.Common.Group.Group;
|
||||
import TestingSystem.Common.Test.Test;
|
||||
import TestingSystem.Common.Test.TestType;
|
||||
import TestingSystem.DVM.DVMConfiguration.DVMConfiguration;
|
||||
import TestingSystem.DVM.DVMSettings.DVMSettings;
|
||||
import com.google.gson.annotations.Expose;
|
||||
|
||||
import java.io.File;
|
||||
@@ -40,11 +41,10 @@ public class DVMRunTask extends DVMTask {
|
||||
public TaskState compilation_state = TaskState.Waiting;
|
||||
@Expose
|
||||
public double compilation_time = 0.0;
|
||||
public DVMRunTask(DVMConfiguration configuration,
|
||||
public DVMRunTask(DVMConfiguration configuration, DVMSettings settings,
|
||||
Group group, Test test,
|
||||
String matrix_in, String flags_in,
|
||||
String environments_in,
|
||||
String par_in,
|
||||
int kernels_in
|
||||
) {
|
||||
super(configuration, group, test, flags_in);
|
||||
@@ -53,12 +53,12 @@ public class DVMRunTask extends DVMTask {
|
||||
compilation_maxtime = configuration.c_maxtime;
|
||||
compilation_state = TaskState.Waiting;
|
||||
//инфа о запуске
|
||||
cube = configuration.cube;
|
||||
min_dim = configuration.max_dim_proc_count;
|
||||
max_dim = configuration.max_dim_proc_count;
|
||||
cube = settings.cube;
|
||||
min_dim = settings.max_dim_proc_count;
|
||||
max_dim = settings.max_dim_proc_count;
|
||||
maxtime = configuration.maxtime;
|
||||
environments = environments_in;
|
||||
usr_par = par_in;
|
||||
usr_par = settings.getParamsText();
|
||||
args = test.args;
|
||||
//---------
|
||||
matrix = matrix_in;
|
||||
|
||||
Reference in New Issue
Block a user