Commit 42dc9f8c authored by Richard Angersbach's avatar Richard Angersbach
Browse files

IR_PrintXdmf: Separate format-related functionality from logic.

parent 3b3b2f9b
......@@ -22,8 +22,8 @@ case class IR_PrintXdmfNNF(
var filename : IR_Expression,
level : Int,
ioMethod : IR_Expression,
binaryFpp : Boolean,
var resolveId : Int) extends IR_PrintXdmf(ioMethod, binaryFpp) with IR_PrintVisualizationNS with IR_PrintFieldAsciiNS {
var binaryFpp : Boolean,
var resolveId : Int) extends IR_PrintXdmf(ioMethod) with IR_PrintVisualizationNS with IR_PrintFieldAsciiNS {
// check if cell field conforms grid dims
conformsGridDimensions(someCellField)
......
......@@ -21,8 +21,8 @@ case class IR_PrintXdmfNS(
var filename : IR_Expression,
level : Int,
ioMethod : IR_Expression,
binaryFpp : Boolean,
var resolveId : Int) extends IR_PrintXdmf(ioMethod, binaryFpp) with IR_PrintVisualizationNS with IR_PrintFieldAsciiNS {
var binaryFpp : Boolean,
var resolveId : Int) extends IR_PrintXdmf(ioMethod) with IR_PrintVisualizationNS with IR_PrintFieldAsciiNS {
// check if cell field conforms grid dims
conformsGridDimensions(someCellField)
......
......@@ -24,11 +24,11 @@ case class IR_PrintXdmfSWE(
var filename : IR_Expression,
level : Int,
ioMethod : IR_Expression,
binaryFpp : Boolean,
var binaryFpp : Boolean,
var resolveId : Int,
var nodalFieldCollection : ListBuffer[IR_Field],
var discFieldCollection : ListBuffer[ListBuffer[IR_Field]]
) extends IR_PrintXdmf(ioMethod, binaryFpp) with IR_PrintVisualizationSWE with IR_PrintFieldsAsciiSWE {
) extends IR_PrintXdmf(ioMethod) with IR_PrintVisualizationSWE with IR_PrintFieldsAsciiSWE {
// check if cell field conforms grid dims
conformsGridDimensions(someCellField)
......
......@@ -4,12 +4,10 @@ import scala.collection.mutable.ListBuffer
import exastencils.base.ir.IR_ImplicitConversion._
import exastencils.base.ir._
import exastencils.baseExt.ir._
import exastencils.config._
import exastencils.core.Duplicate
import exastencils.datastructures.Transformation.OutputType
import exastencils.globals.ir.IR_GlobalCollection
import exastencils.grid.ir._
import exastencils.io.ir._
import exastencils.logger.Logger
import exastencils.optimization.ir.IR_SimplifyExpression
......@@ -21,11 +19,8 @@ import exastencils.visualization.ir.postprocessing.IR_PrintVisualization
// to be used in combination with parallel I/O methods: MPI I/O, HDF5, file-per-process
// to be implemented as specific printer in exastencils.application.ir or field.ir
abstract class IR_PrintXdmf(ioMethod : IR_Expression, binaryFpp : Boolean) extends IR_Statement with IR_Expandable with IR_PrintVisualization {
abstract class IR_PrintXdmf(ioMethod : IR_Expression) extends IR_Statement with IR_Expandable with IR_PrintVisualization with IR_XdmfFormat {
// declarations
val endianness = IR_VariableDeclaration(IR_StringDatatype, "endianness",
IR_TernaryCondition(IR_FunctionCall(IR_ExternalFunctionReference("htonl"), 47) EqEq 47, "\"Big\"", "\"Little\"")) // determine endianness in target code
// accesses
val curRank = IR_VariableAccess("curRank", IR_IntegerDatatype)
val filenamePieceFpp = IR_VariableAccess(IR_FileAccess.declareVariable("fnPiece"), IR_StringDatatype)
......@@ -55,127 +50,10 @@ abstract class IR_PrintXdmf(ioMethod : IR_Expression, binaryFpp : Boolean) exten
}
}
def fmt : String = ioInterface match {
case "mpiio" => "Binary"
case "hdf5" => "HDF"
case "fpp" => if (binaryFpp) "Binary" else "XML"
}
// overloaded helper methods to write xdmf elements
def printXdmfElement(stream : IR_VariableAccess, str : String*) : IR_Statement = IR_Print(stream, str.map(s => IR_StringConstant(s)).to[ListBuffer] :+ IR_Print.newline)
def printXdmfElement(stream : IR_VariableAccess, expr : IR_Expression*)(implicit d : DummyImplicit) : IR_Statement = IR_Print(stream, expr.to[ListBuffer] :+ IR_Print.newline)
// xml elements used in xdmf
def xmlHeader = "<?xml version=\\\"1.0\\\" encoding=\\\"utf-8\\\"?>"
def XInclude(href : IR_Expression, xpath : IR_Expression*) : ListBuffer[IR_Expression] = {
ListBuffer(
IR_StringConstant("\t\t\t<xi:include href=\\\""), href, IR_StringConstant("\\\" "), // reference file
IR_StringConstant("xpointer=\\\"xpointer(")) ++ xpath.to[ListBuffer] :+ IR_StringConstant(")\\\"/>") // reference specific elements in the file
}
def XInclude(href : ListBuffer[IR_Expression], xpath : IR_Expression*) : ListBuffer[IR_Expression] = {
(IR_StringConstant("\t\t\t<xi:include href=\\\"") +: href :+ IR_StringConstant("\\\" ")) ++
(IR_StringConstant("xpointer=\\\"xpointer(") +: xpath.to[ListBuffer] :+ IR_StringConstant(")\\\"/>"))
}
def XPath(grid : ListBuffer[IR_Expression], elem : String) : ListBuffer[IR_Expression] = {
IR_StringConstant("/Xdmf/Domain/") +: grid :+ IR_StringConstant("/" + elem)
}
def attributeType(gridDatatype : IR_Datatype) : String = gridDatatype match {
case _ : IR_ScalarDatatype => "Scalar"
case _ : IR_VectorDatatype => "Vector"
case matrix : IR_MatrixDatatype if matrix.sizeN == 1 || matrix.sizeM == 1 => "Vector"
case matrix : IR_MatrixDatatype if matrix.sizeN == 1 && matrix.sizeM == 1 => "Scalar"
case _ => Logger.error("Unsupported datatype for IR_PrintXdmf: " + gridDatatype.prettyprint)
}
def centeringType(localization : IR_Localization) : String = localization match {
case IR_AtNode => "Node"
case IR_AtCellCenter => "Cell"
// according to the docs ("https://www.xdmf.org/index.php/XDMF_Model_and_Format"), face centered variables are supported but do not map well for vis. systems (e.g. ParaView)
case IR_AtFaceCenter(_) => "Cell" // values are interpolated
case _ => Logger.error("Unsupported localization for IR_PrintXdmf!")
}
// table from: https://www.xdmf.org/index.php/XDMF_Model_and_Format
def numberType(dt : IR_Datatype) : String = dt match {
case IR_FloatDatatype | IR_DoubleDatatype | IR_RealDatatype => "Float"
case IR_IntegerDatatype => "Int"
case IR_CharDatatype => "Char"
case IR_SpecialDatatype("unsigned int") => "UInt"
case IR_SpecialDatatype("unsigned char") => "UChar"
}
def separator = IR_StringConstant(" ")
def separateSequence(dims : ListBuffer[IR_Expression]) : ListBuffer[IR_Expression] = dims
.reverse // KJI order
.flatMap(List(_, separator))
.dropRight(1)
def separateSequenceAndFilter(dims : ListBuffer[IR_Expression]) : ListBuffer[IR_Expression] = separateSequence(
dims.filter(d => d != IR_IntegerConstant(1) || d != IR_IntegerConstant(0)) // remove unnecessary dim specifications
)
// open xdmf elements
def openXdmf : String = {
"<Xdmf xmlns:xi=\\\"http://www.w3.org/2001/XInclude\\\" Version=\\\"3.0\\\">"
}
def openDomain : String = {
"\t<Domain>"
}
def openGrid(name : IR_Expression, tpe : String) : ListBuffer[IR_Expression] = {
ListBuffer(IR_StringConstant("\t\t<Grid Name=\\\""), name, IR_StringConstant(s"""\\\" GridType=\\\"$tpe\\\">"""))
}
def openGeometry(tpe : String) : String = {
s"""\t\t\t<Geometry GeometryType=\\\"$tpe\\\">"""
}
def openTopology(tpe : String, dims : ListBuffer[IR_Expression], npe : Option[String] = None) : ListBuffer[IR_Expression] = {
ListBuffer(IR_StringConstant(
"\t\t\t<Topology Dimensions=\\\"")) ++ separateSequenceAndFilter(dims) :+ IR_StringConstant(s"""\\\" Type=\\\"$tpe\\\"""") :+
(if (npe.isDefined) IR_StringConstant(s""" NodesPerElement=\\\"${ npe.get }\\\">""") else IR_StringConstant(">"))
}
def openAttribute(name : String, tpe : String, ctr : String) : String = {
s"""\t\t\t<Attribute Center=\\\"$ctr\\\" AttributeType=\\\"$tpe\\\" Name=\\\"$name\\\">"""
}
def openDataItem(dt : IR_Datatype, dims : ListBuffer[IR_Expression], seekp : IR_Expression = 0, name : String = "", altFmt : Option[String] = None) : ListBuffer[IR_Expression] = {
ListBuffer(IR_StringConstant(
s"""\t\t\t\t<DataItem Name=\\\"${ name }\\\" DataType=\\\"${ numberType(dt) }\\\" Precision=\\\"${ dt.typicalByteSize }\\\" Dimensions=\\\"""")) ++ separateSequenceAndFilter(dims) :+
IR_StringConstant(s"""\\\" Format=\\\"${ altFmt getOrElse fmt }\\\" Endian=\\\"""") :+ IR_VariableAccess(endianness) :+
IR_StringConstant("\\\" Seek=\\\"") :+ seekp :+ IR_StringConstant("\\\">")
}
def openDataItemFunction(dims : ListBuffer[IR_Expression], function : String) : ListBuffer[IR_Expression] =
ListBuffer(IR_StringConstant(
s"""\t\t\t\t<DataItem ItemType=\\\"Function\\\" Function=\\\"$function\\\" Dimensions=\\\"""")) ++ separateSequenceAndFilter(dims) :+ IR_StringConstant("\\\">")
// hyperslabs DataItems consist of two other DataItems: the selection and the source
def openDataItemHyperslab(dims : ListBuffer[IR_Expression]) : ListBuffer[IR_Expression] = {
ListBuffer(IR_StringConstant(
s"""\t\t\t\t<DataItem ItemType=\\\"HyperSlab\\\" Dimensions=\\\"""")) ++ separateSequenceAndFilter(dims) :+
IR_StringConstant(s"""\\\" Type=\\\"HyperSlab\\\">""")
}
def dataItemHyperslabSelection(start : ListBuffer[IR_Expression], stride : ListBuffer[IR_Expression], count : ListBuffer[IR_Expression]) : ListBuffer[IR_Expression] = {
var buffer : ListBuffer[IR_Expression] = ListBuffer()
buffer ++= IR_StringConstant(s"""\t\t\t\t\t<DataItem Dimensions=\\\"3 ${ start.length }\\\" Format=\\\"XML\\\">""") :: IR_Print.newline :: Nil
buffer ++= IR_StringConstant("\t" + indentData.value) +: separateSequence(start) :+ IR_Print.newline
buffer ++= IR_StringConstant("\t" + indentData.value) +: separateSequence(stride) :+ IR_Print.newline
buffer ++= IR_StringConstant("\t" + indentData.value) +: separateSequence(count) :+ IR_Print.newline
buffer += IR_StringConstant("\t" + closeDataItem)
buffer
}
def dataItemHyperslabSource(dt : IR_Datatype, dims : ListBuffer[IR_Expression], printFilename : IR_Print, seekp : IR_Expression) : ListBuffer[IR_Expression] = {
var buffer : ListBuffer[IR_Expression] = ListBuffer()
buffer ++= IR_StringConstant("\t") +: openDataItem(dt, dims, seekp) :+ IR_Print.newline
buffer ++= IR_StringConstant("\t") +: printFilename.toPrint
buffer += IR_StringConstant("\t" + closeDataItem)
buffer
}
// close xdmf elements
def closeXdmf = "</Xdmf>"
def closeDomain = "\t</Domain>"
def closeGrid = "\t\t</Grid>"
def closeGeometry = "\t\t\t</Geometry>"
def closeTopology = "\t\t\t</Topology>"
def closeAttribute = "\t\t\t</Attribute>"
def closeDataItem = "\t\t\t\t</DataItem>"
// helpers to construct filenames
def buildFilenamePiece(noPath : Boolean, rank : IR_Expression) : IR_BuildString = IR_BuildString(filenamePieceFpp.name,
ListBuffer(basename(noPath), IR_StringConstant("_rank"), rank, if (binaryFpp) IR_StringConstant(".bin") else ext))
......@@ -188,8 +66,6 @@ abstract class IR_PrintXdmf(ioMethod : IR_Expression, binaryFpp : Boolean) exten
// specifies "fragment dimension" (i.e. how many fragments are written to a file)
def dimFrags(global : Boolean) : IR_Expression = if (global) numFrags else numFragsPerBlock
def indentData = IR_StringConstant("\t\t\t\t\t")
// writes the path to the "heavy data" file (incl. dataset for hdf5) to the xdmf file
def printFilename(stream : IR_VariableAccess, dataset : String) : IR_Print = {
val refFile = if (binaryFpp) buildFilenamePiece(noPath = true, curRank).toPrint else ListBuffer(buildFilenameData(noPath = true))
......
......@@ -24,7 +24,7 @@ case class IR_PrintXdmfMeshless(
var includeGhostLayers : Boolean,
var dataset : IR_Expression,
var binaryFpp : Boolean,
var resolveId : Int) extends IR_PrintXdmf(ioMethod, binaryFpp) {
var resolveId : Int) extends IR_PrintXdmf(ioMethod) {
def datasetCoords : ListBuffer[IR_Expression] = (0 until numDimsGrid).map(d => IR_StringConstant("/constants/" + ('X' + d).toChar.toString) : IR_Expression).to[ListBuffer]
......
......@@ -20,7 +20,7 @@ case class IR_PrintXdmfNonUniform_AA(
var dataset : IR_Expression,
var binaryFpp : Boolean,
var canonicalFileLayout : Boolean,
var resolveId : Int) extends IR_PrintXdmfStructured(ioMethod, binaryFpp) with IR_Iostream {
var resolveId : Int) extends IR_PrintXdmfStructured(ioMethod) with IR_Iostream {
def datasetCoords : ListBuffer[IR_Expression] = (0 until numDimsGrid).map(d => IR_StringConstant("/constants/" + ('X' + d).toChar.toString) : IR_Expression).to[ListBuffer]
......
......@@ -20,7 +20,7 @@ case class IR_PrintXdmfNonUniform_NonAA(
var dataset : IR_Expression,
var binaryFpp : Boolean,
var canonicalFileLayout : Boolean,
var resolveId : Int) extends IR_PrintXdmfStructured(ioMethod, binaryFpp) {
var resolveId : Int) extends IR_PrintXdmfStructured(ioMethod) {
def datasetCoords : ListBuffer[IR_Expression] = (0 until numDimsGrid).map(d => IR_StringConstant("/constants/" + ('X' + d).toChar.toString) : IR_Expression).to[ListBuffer]
......
......@@ -17,10 +17,7 @@ import exastencils.logger.Logger
import exastencils.parallelization.api.mpi.MPI_Gather
import exastencils.util.ir.IR_Print
abstract class IR_PrintXdmfStructured(
ioMethod : IR_Expression,
binaryFpp : Boolean
) extends IR_PrintXdmf(ioMethod, binaryFpp) {
abstract class IR_PrintXdmfStructured(ioMethod : IR_Expression) extends IR_PrintXdmf(ioMethod) {
var filename : IR_Expression
var field : IR_Field
......
......@@ -31,7 +31,7 @@ case class IR_PrintXdmfUniform(
var dataset : IR_Expression,
var binaryFpp : Boolean,
var canonicalFileLayout : Boolean,
var resolveId : Int) extends IR_PrintXdmfStructured(ioMethod, binaryFpp) {
var resolveId : Int) extends IR_PrintXdmfStructured(ioMethod) {
override def numDimsGrid : Int = field.layout.numDimsGrid
override def numFields : Int = 1
......
package exastencils.visualization.ir.postprocessing.xdmf
import scala.collection.mutable.ListBuffer
import exastencils.base.ir._
import exastencils.base.ir.IR_ImplicitConversion._
import exastencils.baseExt.ir._
import exastencils.grid.ir._
import exastencils.logger.Logger
import exastencils.util.ir.IR_Print
trait IR_XdmfFormat {
val indentData : IR_StringConstant = IR_StringConstant("\t\t\t\t\t")
val endianness : IR_VariableDeclaration = IR_VariableDeclaration(IR_StringDatatype, "endianness",
IR_TernaryCondition(IR_FunctionCall(IR_ExternalFunctionReference("htonl"), 47) EqEq 47, "\"Big\"", "\"Little\"")) // determine endianness in target code
// to be implemented:
def ioInterface : String
def binaryFpp : Boolean
/* special xml elements for referencing in xdmf */
def xmlHeader = "<?xml version=\\\"1.0\\\" encoding=\\\"utf-8\\\"?>"
def XInclude(href : IR_Expression, xpath : IR_Expression*) : ListBuffer[IR_Expression] = {
ListBuffer(
IR_StringConstant("\t\t\t<xi:include href=\\\""), href, IR_StringConstant("\\\" "), // reference file
IR_StringConstant("xpointer=\\\"xpointer(")) ++ xpath.to[ListBuffer] :+ IR_StringConstant(")\\\"/>") // reference specific elements in the file
}
def XInclude(href : ListBuffer[IR_Expression], xpath : IR_Expression*) : ListBuffer[IR_Expression] = {
(IR_StringConstant("\t\t\t<xi:include href=\\\"") +: href :+ IR_StringConstant("\\\" ")) ++
(IR_StringConstant("xpointer=\\\"xpointer(") +: xpath.to[ListBuffer] :+ IR_StringConstant(")\\\"/>"))
}
def XPath(grid : ListBuffer[IR_Expression], elem : String) : ListBuffer[IR_Expression] = {
IR_StringConstant("/Xdmf/Domain/") +: grid :+ IR_StringConstant("/" + elem)
}
/* open xdmf elements */
def openXdmf : String = {
"<Xdmf xmlns:xi=\\\"http://www.w3.org/2001/XInclude\\\" Version=\\\"3.0\\\">"
}
def openDomain : String = {
"\t<Domain>"
}
def openGrid(name : IR_Expression, tpe : String) : ListBuffer[IR_Expression] = {
ListBuffer(IR_StringConstant("\t\t<Grid Name=\\\""), name, IR_StringConstant(s"""\\\" GridType=\\\"$tpe\\\">"""))
}
def openGeometry(tpe : String) : String = {
s"""\t\t\t<Geometry GeometryType=\\\"$tpe\\\">"""
}
def openTopology(tpe : String, dims : ListBuffer[IR_Expression], npe : Option[String] = None) : ListBuffer[IR_Expression] = {
ListBuffer(IR_StringConstant(
"\t\t\t<Topology Dimensions=\\\"")) ++ separateSequenceAndFilter(dims) :+ IR_StringConstant(s"""\\\" Type=\\\"$tpe\\\"""") :+
(if (npe.isDefined) IR_StringConstant(s""" NodesPerElement=\\\"${ npe.get }\\\">""") else IR_StringConstant(">"))
}
def openAttribute(name : String, tpe : String, ctr : String) : String = {
s"""\t\t\t<Attribute Center=\\\"$ctr\\\" AttributeType=\\\"$tpe\\\" Name=\\\"$name\\\">"""
}
def openDataItem(dt : IR_Datatype, dims : ListBuffer[IR_Expression], seekp : IR_Expression = 0, name : String = "", altFmt : Option[String] = None) : ListBuffer[IR_Expression] = {
ListBuffer(IR_StringConstant(
s"""\t\t\t\t<DataItem Name=\\\"${ name }\\\" DataType=\\\"${ numberType(dt) }\\\" Precision=\\\"${ dt.typicalByteSize }\\\" Dimensions=\\\"""")) ++ separateSequenceAndFilter(dims) :+
IR_StringConstant(s"""\\\" Format=\\\"${ altFmt getOrElse fmt }\\\" Endian=\\\"""") :+ IR_VariableAccess(endianness) :+
IR_StringConstant("\\\" Seek=\\\"") :+ seekp :+ IR_StringConstant("\\\">")
}
def openDataItemFunction(dims : ListBuffer[IR_Expression], function : String) : ListBuffer[IR_Expression] =
ListBuffer(IR_StringConstant(
s"""\t\t\t\t<DataItem ItemType=\\\"Function\\\" Function=\\\"$function\\\" Dimensions=\\\"""")) ++ separateSequenceAndFilter(dims) :+ IR_StringConstant("\\\">")
// hyperslabs DataItems consist of two other DataItems: the selection and the source
def openDataItemHyperslab(dims : ListBuffer[IR_Expression]) : ListBuffer[IR_Expression] = {
ListBuffer(IR_StringConstant(
s"""\t\t\t\t<DataItem ItemType=\\\"HyperSlab\\\" Dimensions=\\\"""")) ++ separateSequenceAndFilter(dims) :+
IR_StringConstant(s"""\\\" Type=\\\"HyperSlab\\\">""")
}
/* close xdmf elements */
def closeXdmf = "</Xdmf>"
def closeDomain = "\t</Domain>"
def closeGrid = "\t\t</Grid>"
def closeGeometry = "\t\t\t</Geometry>"
def closeTopology = "\t\t\t</Topology>"
def closeAttribute = "\t\t\t</Attribute>"
def closeDataItem = "\t\t\t\t</DataItem>"
/* helper functions */
def fmt : String = ioInterface match {
case "mpiio" => "Binary"
case "hdf5" => "HDF"
case "fpp" => if (binaryFpp) "Binary" else "XML"
}
// separate dim arrays
def separator = IR_StringConstant(" ")
def separateSequence(dims : ListBuffer[IR_Expression]) : ListBuffer[IR_Expression] = dims
.reverse // KJI order
.flatMap(List(_, separator))
.dropRight(1)
def separateSequenceAndFilter(dims : ListBuffer[IR_Expression]) : ListBuffer[IR_Expression] = separateSequence(
dims.filter(d => d != IR_IntegerConstant(1) || d != IR_IntegerConstant(0)) // remove unnecessary dim specifications
)
// xdmf type conversion tables
def attributeType(gridDatatype : IR_Datatype) : String = gridDatatype match {
case _ : IR_ScalarDatatype => "Scalar"
case _ : IR_VectorDatatype => "Vector"
case matrix : IR_MatrixDatatype if matrix.sizeN == 1 || matrix.sizeM == 1 => "Vector"
case matrix : IR_MatrixDatatype if matrix.sizeN == 1 && matrix.sizeM == 1 => "Scalar"
case _ => Logger.error("Unsupported datatype for IR_PrintXdmf: " + gridDatatype.prettyprint)
}
def centeringType(localization : IR_Localization) : String = localization match {
case IR_AtNode => "Node"
case IR_AtCellCenter => "Cell"
// according to the docs ("https://www.xdmf.org/index.php/XDMF_Model_and_Format"), face centered variables are supported but do not map well for vis. systems (e.g. ParaView)
case IR_AtFaceCenter(_) => "Cell" // values are interpolated
case _ => Logger.error("Unsupported localization for IR_PrintXdmf!")
}
// table from: https://www.xdmf.org/index.php/XDMF_Model_and_Format
def numberType(dt : IR_Datatype) : String = dt match {
case IR_FloatDatatype | IR_DoubleDatatype | IR_RealDatatype => "Float"
case IR_IntegerDatatype => "Int"
case IR_CharDatatype => "Char"
case IR_SpecialDatatype("unsigned int") => "UInt"
case IR_SpecialDatatype("unsigned char") => "UChar"
}
// hyperslab helpers
def dataItemHyperslabSelection(start : ListBuffer[IR_Expression], stride : ListBuffer[IR_Expression], count : ListBuffer[IR_Expression]) : ListBuffer[IR_Expression] = {
var buffer : ListBuffer[IR_Expression] = ListBuffer()
buffer ++= IR_StringConstant(s"""\t\t\t\t\t<DataItem Dimensions=\\\"3 ${ start.length }\\\" Format=\\\"XML\\\">""") :: IR_Print.newline :: Nil
buffer ++= IR_StringConstant("\t" + indentData.value) +: separateSequence(start) :+ IR_Print.newline
buffer ++= IR_StringConstant("\t" + indentData.value) +: separateSequence(stride) :+ IR_Print.newline
buffer ++= IR_StringConstant("\t" + indentData.value) +: separateSequence(count) :+ IR_Print.newline
buffer += IR_StringConstant("\t" + closeDataItem)
buffer
}
def dataItemHyperslabSource(dt : IR_Datatype, dims : ListBuffer[IR_Expression], printFilename : IR_Print, seekp : IR_Expression) : ListBuffer[IR_Expression] = {
var buffer : ListBuffer[IR_Expression] = ListBuffer()
buffer ++= IR_StringConstant("\t") +: openDataItem(dt, dims, seekp) :+ IR_Print.newline
buffer ++= IR_StringConstant("\t") +: printFilename.toPrint
buffer += IR_StringConstant("\t" + closeDataItem)
buffer
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment