更新时间:2021-03-18 GMT+08:00
分享

编排配置示例

Graph创建配置文件(graph.prototxt)为proto格式,其示例如下(该示例同时创建两个Graph,每个Graph创建多个Engine并配置映射关系)。

如果用户想要传送文件,必须满足下列条件,否则系统会默认传递的是字符串或数字:

  • Linux环境下,文件要包含相对路径或者绝对路径,例如:“/home/1.txt”或者“../test/2.txt”。注意如果字符串中使用了"\"或"/"符号可能会被误判为文件,请避免使用。
  • Windows环境下,文件要包含相对路径或者绝对路径,例如:“c:\1.txt”,或者“..\test\2.txt”。注意如果字符串中使用了\"或"/"符号可能会被误判为文件,请避免使用
graphs {
  graph_id: 100
  device_id: "0"
  priority: 1
  engines {
    id: 1000
    engine_name: "SrcEngine"
    side: HOST
    thread_num: 1
  }
  engines {
    id: 1001
    engine_name: "HelloWorldEngine"
    so_name: "./libhelloworld.so"
    side: DEVICE
    thread_num: 1
  }
  engines {
    id: 1002
    engine_name: "DestEngine"
    side: HOST
    thread_num: 1
  }
  connects {
    src_engine_id: 1000
    src_port_id: 0
    target_engine_id: 1001
    target_port_id: 0
  }
  connects {
    src_engine_id: 1001
    src_port_id: 0
    target_engine_id: 1002
    target_port_id: 0
  }
}
graphs {
  graph_id: 200
  device_id: "1"
  priority: 1
  engines {
    id: 1000
    engine_name: "SrcEngine"
    side: HOST
    thread_num: 1
  }
  engines {
    id: 1001
    engine_name: "HelloWorldEngine"
    internal_so_name: "/lib64/libhelloworld.so"
    side: DEVICE
    thread_num: 1
  }
  engines {
    id: 1002
    engine_name: "DestEngine"
    side: HOST
    thread_num: 1
  }
  connects {
    src_engine_id: 1000
    src_port_id: 0
    target_engine_id: 1001
    target_port_id: 0
  }
  connects {
    src_engine_id: 1001
    src_port_id: 0
    target_engine_id: 1002
    target_port_id: 0
  }
}
分享:

    相关文档

    相关产品