GenSymIO

Usage

use GenSymIO;

or

import GenSymIO;
const gsLogger = new Logger(logLevel, logChannel)
config const NULL_STRINGS_VALUE = 0: uint(8)
proc arrayMsg(cmd: string, msgArgs: borrowed MessageArgs, ref data: bytes, st: borrowed SymTab, param nd: int): MsgTuple throws
  • Creates a pdarray server-side and returns the SymTab name used to

  • retrieve the pdarray from the SymTab.

proc segmentedCalcOffsets(values: [] uint(8), valuesDom): [] int throws
  • For creating the Strings/SegString object we can calculate the offsets array on the server

  • by finding the null terminators given the values/bytes array which should have already been

  • converted to uint8

proc tondarrayMsg(cmd: string, msgArgs: borrowed MessageArgs, st: borrowed SymTab, param nd: int): bytes throws
  • Outputs the pdarray as a Numpy ndarray in the form of a

  • Chapel Bytes object

proc checkCast(c: string, type toType): bool
  • Utility proc to test casting a string to a specified type

  • arg c

    String to cast

  • type c

    string

  • arg toType

    the type to cast into

  • type toType

    type

  • returns

    bool true if the cast was successful, false otherwise

proc buildReadAllMsgJson(rnames: list((string, ObjType, string)), allowErrors: bool, fileErrorCount: int, fileErrors: list(string), st: borrowed SymTab): string throws
proc jsonToMap(json: string): map(string, string) throws
  • Simple JSON parser to allow creating a map(string, string) for properly formatted JSON string.

  • REQUIRES THAT DATA DOES NOT CONTAIN : or “. This will only work on JSON that is not nested.