public synchronized GpuDeviceInformation parseXml(String xmlContent)
      throws YarnException {
    InputSource inputSource = new InputSource(new StringReader(xmlContent));
    SAXSource source = new SAXSource(xmlReader, inputSource);
    try {
      return (GpuDeviceInformation) unmarshaller.unmarshal(source);
    } catch (JAXBException e) {
      String msg = "Failed to parse XML output of " +
          GPU_SCRIPT_REFERENCE + "!";
      LOG.error(msg, e);
      throw new YarnException(msg, e);
    }
  }
@Test
  public void testParseMissingTags() throws IOException, YarnException {
    File f = new File("src/test/resources/nvidia-smi-output-missing-tags.xml");
    String s = FileUtils.readFileToString(f, StandardCharsets.UTF_8);

    GpuDeviceInformationParser parser = new GpuDeviceInformationParser();
    GpuDeviceInformation info = parser.parseXml(s);

    assertEquals("375.66", info.getDriverVersion());
    assertEquals(1, info.getGpus().size());

    PerGpuDeviceInformation gpu = info.getGpus().get(0);
    assertEquals("N/A", gpu.getProductName());
    assertEquals("N/A", gpu.getUuid());
    assertEquals(-1, gpu.getMinorNumber());
    assertNull(gpu.getGpuMemoryUsage());
    assertNull(gpu.getTemperature());
    assertNull(gpu.getGpuUtilizations());
  }