рефакторинг. подготовка к переводу регионов на json
This commit is contained in:
12
.idea/workspace.xml
generated
12
.idea/workspace.xml
generated
@@ -7,17 +7,17 @@
|
||||
</component>
|
||||
<component name="ChangeListManager">
|
||||
<list default="true" id="e42177c3-2328-4b27-8a01-35779b2beb99" name="Default Changelist" comment="">
|
||||
<change afterPath="$PROJECT_DIR$/src/_VisualDVM/ProjectData/SapforData/Regions/FileRegionLinesJson.java" afterDir="false" />
|
||||
<change afterPath="$PROJECT_DIR$/src/_VisualDVM/ProjectData/SapforData/Regions/RegionLinesJson.java" afterDir="false" />
|
||||
<change afterPath="$PROJECT_DIR$/src/_VisualDVM/ProjectData/SapforData/Regions/RegionsJson.java" afterDir="false" />
|
||||
<change afterPath="$PROJECT_DIR$/src/_VisualDVM/ProjectData/SapforData/Arrays/AlignRuleWidthJson.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/properties" beforeDir="false" afterPath="$PROJECT_DIR$/properties" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/Passes/All/SPF_ModifyArrayDistribution.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/Passes/All/SPF_ModifyArrayDistribution.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/ProjectData/Project/db_project_info.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/ProjectData/Project/db_project_info.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/ProjectData/SapforData/Arrays/Distribution/AlignRule.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/ProjectData/SapforData/Arrays/Distribution/AlignRule.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/ProjectData/SapforData/Arrays/Distribution/DataDirective.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/ProjectData/SapforData/Arrays/Distribution/DataDirective.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/ProjectData/SapforData/Arrays/Distribution/AlignRule.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/ProjectData/SapforData/Arrays/AlignRule.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/ProjectData/SapforData/Arrays/Distribution/DataDirective.java" beforeDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/ProjectData/SapforData/Arrays/Distribution/Dimension.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/ProjectData/SapforData/Arrays/Dimension.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/ProjectData/SapforData/Arrays/Distribution/Directive.java" beforeDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/ProjectData/SapforData/Arrays/ProjectArray.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/ProjectData/SapforData/Arrays/ProjectArray.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/ProjectData/SapforData/Regions/ParallelRegion.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/ProjectData/SapforData/Regions/ParallelRegion.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/ProjectData/SapforData/Regions/RegionLinesJson.java" beforeDir="false" />
|
||||
</list>
|
||||
<option name="SHOW_DIALOG" value="false" />
|
||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||
|
||||
@@ -3,7 +3,7 @@ import Common.Visual.Windows.Dialog.DBObjectDialog;
|
||||
import _VisualDVM.Global;
|
||||
import _VisualDVM.Passes.PassCode;
|
||||
import _VisualDVM.Passes.Sapfor.SapforModification;
|
||||
import _VisualDVM.ProjectData.SapforData.Arrays.Distribution.Dimension;
|
||||
import _VisualDVM.ProjectData.SapforData.Arrays.Dimension;
|
||||
import _VisualDVM.ProjectData.SapforData.Arrays.ProjectArray;
|
||||
import _VisualDVM.ProjectData.SapforData.Regions.ParallelRegion;
|
||||
import _VisualDVM.ProjectData.SapforData.Regions.UI.ArrayAlignmentBar;
|
||||
|
||||
@@ -505,8 +505,8 @@ public class db_project_info extends DBObject {
|
||||
if (templates.size() > 0) {
|
||||
for (ParallelRegion p : parallelRegions.Data.values()) {
|
||||
DefaultMutableTreeNode pn = new DefaultMutableTreeNode(p);
|
||||
p.dataDirectives.genRules(p.arraysMap);
|
||||
for (String r : p.dataDirectives.rules)
|
||||
p.genRules(p.arraysMap);
|
||||
for (String r : p.rules)
|
||||
pn.add(new DefaultMutableTreeNode(r));
|
||||
maxdim = Math.max(maxdim, p.maxdim);
|
||||
align_rules_root.add(pn);
|
||||
|
||||
@@ -1,17 +1,25 @@
|
||||
package _VisualDVM.ProjectData.SapforData.Arrays.Distribution;
|
||||
package _VisualDVM.ProjectData.SapforData.Arrays;
|
||||
import Common.Utils.Index;
|
||||
import Common.Utils.IntegerPairJson;
|
||||
import Common.Utils.Pair;
|
||||
import _VisualDVM.ProjectData.SapforData.Arrays.ProjectArray;
|
||||
import _VisualDVM.ProjectData.SapforData.Regions.ParallelRegion;
|
||||
import com.google.gson.annotations.Expose;
|
||||
|
||||
import java.math.BigInteger;
|
||||
import java.util.Vector;
|
||||
public class AlignRule {
|
||||
@Expose
|
||||
public String packed_alignArray_address;
|
||||
@Expose
|
||||
public String packed_alignWith_address;
|
||||
@Expose
|
||||
public Vector<IntegerPairJson> alignRule;
|
||||
@Expose
|
||||
public Vector<AlignRuleWidthJson> alignRuleWith = new Vector<>();
|
||||
//----
|
||||
public BigInteger alignArray_address;
|
||||
public BigInteger alignWith_address;
|
||||
public ParallelRegion parent_region = null;
|
||||
public Vector<Pair<Integer, Integer>> alignRule;
|
||||
public Vector<Pair<Integer, Pair<Integer, Integer>>> alignRuleWith = new Vector<>();
|
||||
public AlignRule(String[] splited, Index idx) {
|
||||
alignArray_address = new BigInteger((splited[idx.Inc()]));
|
||||
alignWith_address = new BigInteger(splited[idx.Inc()]);
|
||||
@@ -20,17 +28,27 @@ public class AlignRule {
|
||||
for (int i = 0; i < alignRule_size; ++i) {
|
||||
int first = Integer.parseInt(splited[idx.Inc()]);
|
||||
int second = Integer.parseInt(splited[idx.Inc()]);
|
||||
alignRule.add(new Pair<>(first, second));
|
||||
alignRule.add(new IntegerPairJson(first, second));
|
||||
}
|
||||
int alignRuleWith_size = Integer.parseInt(splited[idx.Inc()]);
|
||||
alignRuleWith = new Vector<>(alignRuleWith_size);
|
||||
for (int i = 0; i < alignRuleWith_size; ++i) {
|
||||
int first = Integer.parseInt(splited[idx.Inc()]);
|
||||
int first_ = Integer.parseInt(splited[idx.Inc()]);
|
||||
int second_ = Integer.parseInt(splited[idx.Inc()]);
|
||||
alignRuleWith.add(new Pair<>(first, new Pair<>(first_, second_)));
|
||||
for (int k = 0; k < alignRuleWith_size; ++k) {
|
||||
int dimNum = Integer.parseInt(splited[idx.Inc()]);
|
||||
int a = Integer.parseInt(splited[idx.Inc()]);
|
||||
int b = Integer.parseInt(splited[idx.Inc()]);
|
||||
alignRuleWith.add(new AlignRuleWidthJson(dimNum, a, b));
|
||||
}
|
||||
}
|
||||
public void Init(){
|
||||
//--
|
||||
if (packed_alignArray_address!=null)
|
||||
alignArray_address = new BigInteger(packed_alignArray_address);
|
||||
if (packed_alignWith_address!=null)
|
||||
alignWith_address = new BigInteger(packed_alignWith_address);
|
||||
//--
|
||||
packed_alignArray_address = null;
|
||||
packed_alignWith_address = null;
|
||||
}
|
||||
private static Pair<String, String> convertDigitToPositive(int digit) {
|
||||
String buf = "";
|
||||
String sign = " + ";
|
||||
@@ -48,25 +66,25 @@ public class AlignRule {
|
||||
public ProjectArray getAlignWith() {
|
||||
return parent_region.arraysMap.get(alignWith_address);
|
||||
}
|
||||
String genStringExpr(String letter, Pair<Integer, Integer> expr) {
|
||||
String genStringExpr(String letter, int a, int b) {
|
||||
String retVal = "";
|
||||
if (expr.getKey() == 0 && expr.getValue() == 0)
|
||||
if (a == 0 && b == 0)
|
||||
retVal = "*";
|
||||
else if (expr.getValue() == 0) {
|
||||
if (expr.getKey() == 1)
|
||||
else if (b == 0) {
|
||||
if (a == 1)
|
||||
retVal = letter;
|
||||
else {
|
||||
Pair<String, String> digit2 = convertDigitToPositive(expr.getKey());
|
||||
Pair<String, String> digit2 = convertDigitToPositive(a);
|
||||
if (digit2.getKey() == " - ")
|
||||
retVal = "(-" + digit2.getValue() + ")" + " * " + letter;
|
||||
else retVal = digit2.getValue() + " * " + letter;
|
||||
}
|
||||
} else {
|
||||
Pair<String, String> digit1 = convertDigitToPositive(expr.getValue());
|
||||
if (expr.getKey() == 1)
|
||||
Pair<String, String> digit1 = convertDigitToPositive(b);
|
||||
if (a == 1)
|
||||
retVal = letter + digit1.getKey() + digit1.getValue();
|
||||
else {
|
||||
Pair<String, String> digit2 = convertDigitToPositive(expr.getKey());
|
||||
Pair<String, String> digit2 = convertDigitToPositive(a);
|
||||
if (digit2.getKey() == " - ")
|
||||
retVal = "(-" + digit2.getValue() + ")" + " * " + letter + digit1.getKey() + digit1.getValue();
|
||||
else
|
||||
@@ -79,7 +97,7 @@ public class AlignRule {
|
||||
String val = "";
|
||||
val += getAlignArray().shortName + "(";
|
||||
for (int i = 0; i < alignRule.size(); ++i) {
|
||||
val += genStringExpr(ProjectArray.alignNames[i], alignRule.get(i));
|
||||
val += genStringExpr(ProjectArray.alignNames[i], alignRule.get(i).getKey(), alignRule.get(i).getValue());
|
||||
if (i != alignRule.size() - 1)
|
||||
val += ",";
|
||||
}
|
||||
@@ -99,7 +117,7 @@ public class AlignRule {
|
||||
retVal += getAlignArray().TypeString() + " ";
|
||||
arrayString += getAlignArray().shortName + "(";
|
||||
for (int i = 0; i < alignRule.size(); ++i) {
|
||||
arrayString += genStringExpr(ProjectArray.alignNames[i], alignRule.get(i));
|
||||
arrayString += genStringExpr(ProjectArray.alignNames[i], alignRule.get(i).getKey(),alignRule.get(i).getValue() );
|
||||
if (i != alignRule.size() - 1)
|
||||
arrayString += ",";
|
||||
}
|
||||
@@ -124,13 +142,14 @@ public class AlignRule {
|
||||
for (int i = 0; i < alignEachDim.capacity(); ++i)
|
||||
alignEachDim.add("*");
|
||||
for (int i = 0; i < alignRuleWith.size(); ++i) {
|
||||
if (alignRuleWith.get(i).getKey() != -1) {
|
||||
alignEachDim.set(alignRuleWith.get(i).getKey(), genStringExpr(ProjectArray.alignNames[i], alignRuleWith.get(i).getValue()));
|
||||
if (alignRuleWith.get(i).getDimNum() != -1) {
|
||||
alignEachDim.set(alignRuleWith.get(i).getDimNum(),
|
||||
genStringExpr(ProjectArray.alignNames[i], alignRuleWith.get(i).getA(),alignRuleWith.get(i).getB() ));
|
||||
//коэццициенты находятся здесь!!------------------------------------------------------------------->>
|
||||
getAlignArray().ac_current.put(i,
|
||||
new Dimension(i,
|
||||
alignRuleWith.get(i).getValue().getKey(),
|
||||
alignRuleWith.get(i).getValue().getValue()
|
||||
alignRuleWith.get(i).getA(),
|
||||
alignRuleWith.get(i).getB()
|
||||
));
|
||||
} else getAlignArray().ac_current.put(i, new Dimension(i));
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package _VisualDVM.ProjectData.SapforData.Arrays;
|
||||
import com.google.gson.annotations.Expose;
|
||||
public class AlignRuleWidthJson {
|
||||
@Expose
|
||||
public int dimNum;
|
||||
@Expose
|
||||
public int a;
|
||||
@Expose
|
||||
public int b;
|
||||
//dim -> a * dim_t + b
|
||||
public int getDimNum(){
|
||||
return dimNum;
|
||||
}
|
||||
public int getA(){
|
||||
return a;
|
||||
}
|
||||
public int getB(){
|
||||
return b;
|
||||
}
|
||||
public AlignRuleWidthJson(){
|
||||
|
||||
}
|
||||
public AlignRuleWidthJson(int i_in, int a_in, int b_in){
|
||||
dimNum = i_in;
|
||||
a = a_in;
|
||||
b = b_in;
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,5 @@
|
||||
package _VisualDVM.ProjectData.SapforData.Arrays.Distribution;
|
||||
package _VisualDVM.ProjectData.SapforData.Arrays;
|
||||
import Common.Database.Objects.DBObject;
|
||||
import _VisualDVM.ProjectData.SapforData.Arrays.ProjectArray;
|
||||
public class Dimension extends DBObject {
|
||||
//--------------------------------------
|
||||
public int num; //номер измерения.
|
||||
@@ -1,31 +0,0 @@
|
||||
package _VisualDVM.ProjectData.SapforData.Arrays.Distribution;
|
||||
import Common.Utils.Pair;
|
||||
import _VisualDVM.ProjectData.SapforData.Arrays.ArrayLocation;
|
||||
import _VisualDVM.ProjectData.SapforData.Arrays.ProjectArray;
|
||||
|
||||
import java.math.BigInteger;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Vector;
|
||||
public class DataDirective extends Directive {
|
||||
public Vector<AlignRule> alignRules;
|
||||
public String rules_ = "";
|
||||
public Vector<String> rules = new Vector<>();
|
||||
public void genRules(LinkedHashMap<BigInteger, ProjectArray> Arrays) {
|
||||
rules.clear();
|
||||
int maxLen = 0;
|
||||
for (AlignRule a : alignRules)
|
||||
maxLen = Math.max(maxLen, a.GetLenString());
|
||||
LinkedHashMap<String, Vector<String>> toPrint = new LinkedHashMap<>();
|
||||
for (AlignRule a : alignRules) {
|
||||
if (Arrays.get(a.alignArray_address).getLocation() != ArrayLocation.parameter) {
|
||||
Pair<String, String> result = a.GenRule(maxLen);
|
||||
if (!toPrint.containsKey(result.getKey()))
|
||||
toPrint.put(result.getKey(), new Vector<>());
|
||||
toPrint.get(result.getKey()).add(result.getValue());
|
||||
}
|
||||
}
|
||||
for (Vector<String> v : toPrint.values())
|
||||
for (String r : v)
|
||||
rules.add(r);
|
||||
}
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
package _VisualDVM.ProjectData.SapforData.Arrays.Distribution;
|
||||
import _VisualDVM.ProjectData.LanguageName;
|
||||
public class Directive {
|
||||
public LanguageName langType = LanguageName.fortran;
|
||||
public String file = "";
|
||||
public int line = -1;
|
||||
public int col = -1;
|
||||
}
|
||||
@@ -7,7 +7,6 @@ import _VisualDVM.Global;
|
||||
import _VisualDVM.Passes.PassCode;
|
||||
import _VisualDVM.ProjectData.DBArray.DBArray;
|
||||
import _VisualDVM.ProjectData.Files.DBProjectFile;
|
||||
import _VisualDVM.ProjectData.SapforData.Arrays.Distribution.Dimension;
|
||||
import _VisualDVM.ProjectData.SapforData.Arrays.Templates.TemplateDimension;
|
||||
import _VisualDVM.ProjectData.SapforData.Arrays.Templates.TemplateDimensionState;
|
||||
import _VisualDVM.ProjectData.SapforData.Arrays.Templates.TemplateLink;
|
||||
@@ -57,9 +56,24 @@ public class ProjectArray extends DBObject {
|
||||
//--
|
||||
//----------------------------------------------------------------------
|
||||
public static final String[] alignNames = {"i", "j", "k", "l", "m", "n", "q", "r", "s", "t", "u", "w", "x", "y", "z"};
|
||||
//json-------------------
|
||||
public String UniqKey;
|
||||
public BigInteger address;
|
||||
//только для шаблонов. для ФИЛЬТРА управления распределением измерений.
|
||||
//<editor-fold desc="Функционал шаблона">
|
||||
public Vector<BigInteger> regIDs;
|
||||
public Vector<TemplateDimension> dimensions;
|
||||
public LinkedHashMap<Long, ProjectArray> links;
|
||||
public ProjectArray align_template = null; //ссылка на шаблон на который идет выравнивание.
|
||||
public String spaces_shift = ""; //смещение из пробелов
|
||||
public ParallelRegion parent_region = null; //родительяская область распараллеливания.
|
||||
//ИЗМЕНЕНИЕ РАСПРЕДЕЛЕНИЯ
|
||||
//текущие
|
||||
public LinkedHashMap<Integer, Dimension> ac_current;
|
||||
//кандидаты на замену.
|
||||
public LinkedHashMap<Integer, Dimension> ac_new;
|
||||
//https://stackoverflow.com/questions/4941372/how-to-insert-image-into-jtable-cell
|
||||
public ArrayAlignmentBar bar = null;
|
||||
//------
|
||||
public void print() {
|
||||
Vector<String> res = new Vector<>();
|
||||
res.add(">");
|
||||
@@ -87,27 +101,7 @@ public class ProjectArray extends DBObject {
|
||||
public ArrayLocation getLocation() {
|
||||
return ArrayLocation.fromInt(location);
|
||||
}
|
||||
//только для шаблонов. для ФИЛЬТРА управления распределением измерений.
|
||||
public Vector<TemplateDimension> dimensions = new Vector<>();
|
||||
//------
|
||||
public ParallelRegion parent_region = null; //родительяская область распараллеливания.
|
||||
//связи->
|
||||
public LinkedHashMap<Long, ProjectArray> links = new LinkedHashMap<>();
|
||||
//------>
|
||||
public ProjectArray align_template = null; //ссылка на шаблон на который идет выравнивание.
|
||||
public String spaces_shift = ""; //смещение из пробелов
|
||||
//ИЗМЕНЕНИЕ РАСПРЕДЕЛЕНИЯ
|
||||
//------------------------------------------------------------------------------------------------------>
|
||||
//текущие
|
||||
public LinkedHashMap<Integer, Dimension> ac_current = new LinkedHashMap<>();
|
||||
//кандидаты на замену.
|
||||
public LinkedHashMap<Integer, Dimension> ac_new = new LinkedHashMap<>();
|
||||
//https://stackoverflow.com/questions/4941372/how-to-insert-image-into-jtable-cell
|
||||
public ArrayAlignmentBar bar = null;
|
||||
//------------------------------------------------------------------------------------------------------>
|
||||
//<editor-fold desc="Функционал шаблона">
|
||||
public Vector<BigInteger> regIDs = new Vector<>();
|
||||
//--
|
||||
public ProjectArray(String[] infoF, Index idx, BigInteger address_in) {
|
||||
id = Integer.parseInt(infoF[idx.Inc()]); //+
|
||||
name = infoF[idx.Inc()]; //+
|
||||
@@ -130,7 +124,6 @@ public class ProjectArray extends DBObject {
|
||||
sizes_size = Integer.parseInt(infoF[idx.Inc()]);
|
||||
for (int i = 0; i < sizes_size; ++i)
|
||||
mappedDims.add(Integer.parseInt(infoF[idx.Inc()])); //+
|
||||
|
||||
//todo удалить после перехода на json
|
||||
int templateInfo_size = Integer.parseInt(infoF[idx.Inc()]);
|
||||
for (int i = 0; i < templateInfo_size; ++i) {
|
||||
@@ -158,11 +151,18 @@ public class ProjectArray extends DBObject {
|
||||
Init();
|
||||
}
|
||||
public void Init() {
|
||||
// address = packed_address !=null ? new BigInteger(packed_address):BigInteger.ONE;
|
||||
//короткое имя+ функция/модуль/комон+ размерность
|
||||
UniqKey = shortName + locName + dimSize;
|
||||
if (packed_address != null) address = new BigInteger(packed_address);
|
||||
for (ArrayDecl arrayDecl : declPlaces)
|
||||
arrayDecl.file = Utils_.toW(arrayDecl.file);
|
||||
//-- полей нет в json поэтому они null
|
||||
regIDs = new Vector<>();
|
||||
dimensions = new Vector<>();
|
||||
links = new LinkedHashMap<>();
|
||||
ac_current = new LinkedHashMap<>();
|
||||
ac_new = new LinkedHashMap<>();
|
||||
//--
|
||||
}
|
||||
public static String fill_binary(int d, String binary) {
|
||||
int delta = Math.abs(binary.length() - d);
|
||||
|
||||
@@ -6,8 +6,8 @@ import Common.Utils.Pair;
|
||||
import Common.Utils.Utils_;
|
||||
import _VisualDVM.Global;
|
||||
import _VisualDVM.ProjectData.Files.DBProjectFile;
|
||||
import _VisualDVM.ProjectData.SapforData.Arrays.Distribution.AlignRule;
|
||||
import _VisualDVM.ProjectData.SapforData.Arrays.Distribution.DataDirective;
|
||||
import _VisualDVM.ProjectData.SapforData.Arrays.AlignRule;
|
||||
import _VisualDVM.ProjectData.SapforData.Arrays.ArrayLocation;
|
||||
import _VisualDVM.ProjectData.SapforData.Arrays.ProjectArray;
|
||||
import com.google.gson.annotations.Expose;
|
||||
|
||||
@@ -22,21 +22,41 @@ public class ParallelRegion extends DBObject {
|
||||
@Expose
|
||||
public String originalName;
|
||||
@Expose
|
||||
public List<ProjectArray> arrays=new Vector<>();
|
||||
public List<ProjectArray> packed_arrays;
|
||||
@Expose
|
||||
public RegionLinesJson packed_lines;
|
||||
public List<FileRegionLinesJson> regionsLines;
|
||||
@Expose
|
||||
public Vector<AlignRule> alignRules;
|
||||
//----
|
||||
public Vector<String> rules = new Vector<>();
|
||||
public void genRules(LinkedHashMap<BigInteger, ProjectArray> Arrays) {
|
||||
rules.clear();
|
||||
int maxLen = 0;
|
||||
for (AlignRule a : alignRules)
|
||||
maxLen = Math.max(maxLen, a.GetLenString());
|
||||
LinkedHashMap<String, Vector<String>> toPrint = new LinkedHashMap<>();
|
||||
for (AlignRule a : alignRules) {
|
||||
if (Arrays.get(a.alignArray_address).getLocation() != ArrayLocation.parameter) {
|
||||
Pair<String, String> result = a.GenRule(maxLen);
|
||||
if (!toPrint.containsKey(result.getKey()))
|
||||
toPrint.put(result.getKey(), new Vector<>());
|
||||
toPrint.get(result.getKey()).add(result.getValue());
|
||||
}
|
||||
}
|
||||
for (Vector<String> v : toPrint.values())
|
||||
for (String r : v)
|
||||
rules.add(r);
|
||||
}
|
||||
//--
|
||||
public BigInteger regionId;
|
||||
//name in program
|
||||
|
||||
// file -> <start, end> lines
|
||||
public LinkedHashMap<String, List<IntegerPairJson>> lines;
|
||||
public LinkedHashMap<String, List<IntegerPairJson>> lines; //+
|
||||
//ключ - адрес. меняем
|
||||
public LinkedHashMap<BigInteger, ProjectArray> arraysMap;
|
||||
public LinkedHashMap<BigInteger, ProjectArray> arraysMap; //+
|
||||
//for directive creating
|
||||
public DataDirective dataDirectives;
|
||||
public int maxdim = 0;
|
||||
public Vector<String> fragments = new Vector<>();
|
||||
public Vector<String> fragments; //+
|
||||
public int lines_count = 0;
|
||||
public int loops_count = 0;
|
||||
public int arrays_count = 0;
|
||||
@@ -48,7 +68,8 @@ public class ParallelRegion extends DBObject {
|
||||
String[] localSplited = splited[idx.Inc()].split("\\|");
|
||||
int lines_size = Integer.parseInt(localSplited[0]);
|
||||
lines = new LinkedHashMap<>(lines_size);
|
||||
//распаковка Lines -----------------------------------------------
|
||||
fragments = new Vector<>();
|
||||
//распаковка Lines -ArrayALignmentBar-----------
|
||||
//---------------------------------------------------------------
|
||||
for (int i = 0; i < lines_size; ++i) {
|
||||
String line_file = Utils_.toW(localSplited[1]);
|
||||
@@ -79,12 +100,11 @@ public class ParallelRegion extends DBObject {
|
||||
} else if (new_array.isLoopArrayFlag != 1) arrays_count++;
|
||||
}
|
||||
int dataDirectives_alignRules_size = Integer.parseInt(splited[idx.Inc()]);
|
||||
dataDirectives = new DataDirective();
|
||||
dataDirectives.alignRules = new Vector<>(dataDirectives_alignRules_size);
|
||||
alignRules = new Vector<>(dataDirectives_alignRules_size);
|
||||
for (int i = 0; i < dataDirectives_alignRules_size; ++i)
|
||||
dataDirectives.alignRules.add(new AlignRule(splited, idx));
|
||||
for (int i = 0; i < dataDirectives.alignRules.size(); ++i)
|
||||
dataDirectives.alignRules.get(i).parent_region = this;
|
||||
alignRules.add(new AlignRule(splited, idx));
|
||||
for (int i = 0; i < alignRules.size(); ++i)
|
||||
alignRules.get(i).parent_region = this;
|
||||
//--------------------------------------------------------------
|
||||
lines_count = 0;
|
||||
loops_count = 0;
|
||||
@@ -99,7 +119,32 @@ public class ParallelRegion extends DBObject {
|
||||
fd_count += f.FragmentFunctionDeclsCount(L.getKey(), L.getValue());
|
||||
}
|
||||
}
|
||||
//--------------------------------------------------
|
||||
}
|
||||
public void Init() {
|
||||
arraysMap = new LinkedHashMap<>();
|
||||
lines = new LinkedHashMap<>();
|
||||
fragments = new Vector<>();
|
||||
//--
|
||||
if (packed_region_id != null)
|
||||
regionId = new BigInteger(packed_region_id);
|
||||
for (ProjectArray array : packed_arrays) {
|
||||
array.Init();//имена и адреса.
|
||||
arraysMap.put(array.address, array);
|
||||
}
|
||||
//---
|
||||
for (FileRegionLinesJson fr : regionsLines) {
|
||||
lines.put(fr.file, fr.lines);
|
||||
for (IntegerPairJson l : fr.lines) {
|
||||
fragments.add(fr.file + ": " + l.getKey() + "-" + l.getKey());
|
||||
}
|
||||
}
|
||||
//--
|
||||
packed_region_id = null;
|
||||
packed_arrays.clear();
|
||||
packed_arrays = null;
|
||||
regionsLines.clear();
|
||||
regionsLines = null;
|
||||
//--
|
||||
}
|
||||
public boolean ArrayBelongsToRegion(long id) {
|
||||
return arraysMap.values().stream().anyMatch(array -> array.id == id);
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
package _VisualDVM.ProjectData.SapforData.Regions;
|
||||
import com.google.gson.annotations.Expose;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Vector;
|
||||
public class RegionLinesJson {
|
||||
@Expose
|
||||
public List<FileRegionLinesJson> allLines = new Vector<>();
|
||||
}
|
||||
Reference in New Issue
Block a user