Browse Source

enable to choose node during running

tags/v1.2.0-rc1
yelihua 4 years ago
parent
commit
74a0ca403b
6 changed files with 1742 additions and 9 deletions
  1. +4
    -3
      mindinsight/debugger/debugger_grpc_server.py
  2. +2
    -2
      mindinsight/debugger/debugger_server.py
  3. +0
    -1
      tests/st/func/debugger/expect_results/restful_results/retrieve_empty_tensor_history.json
  4. +0
    -1
      tests/st/func/debugger/expect_results/restful_results/retrieve_full_tensor_history.json
  5. +1736
    -1
      tests/st/func/debugger/expect_results/restful_results/retrieve_single_watchpoint_hit.json
  6. +0
    -1
      tests/ut/debugger/expected_results/debugger_server/retrieve_tensor_history.json

+ 4
- 3
mindinsight/debugger/debugger_grpc_server.py View File

@@ -1,4 +1,4 @@
# Copyright 2020 Huawei Technologies Co., Ltd
# Copyright 2020-2021 Huawei Technologies Co., Ltd
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.
@@ -266,8 +266,9 @@ class DebuggerGrpcServer(grpc_server_base.EventListenerServicer):
""" """
log.info("Start to wait for command.") log.info("Start to wait for command.")
if self._status != ServerStatus.MISMATCH: if self._status != ServerStatus.MISMATCH:
self._cache_store.get_stream_handler(Streams.METADATA).state = ServerStatus.WAITING.value
self._cache_store.put_data({'metadata': {'state': 'waiting'}})
metadata_stream = self._cache_store.get_stream_handler(Streams.METADATA)
metadata_stream.state = ServerStatus.WAITING.value
self._cache_store.put_data(metadata_stream.get())
event = None event = None
while event is None and self._status not in [ServerStatus.RUNNING, ServerStatus.PENDING]: while event is None and self._status not in [ServerStatus.RUNNING, ServerStatus.PENDING]:
log.debug("Wait for %s-th command", self._pos) log.debug("Wait for %s-th command", self._pos)


+ 2
- 2
mindinsight/debugger/debugger_server.py View File

@@ -1,4 +1,4 @@
# Copyright 2020 Huawei Technologies Co., Ltd
# Copyright 2020-2021 Huawei Technologies Co., Ltd
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.
@@ -375,7 +375,7 @@ class DebuggerServer:
watchpoint_hit_stream = self.cache_store.get_stream_handler(Streams.WATCHPOINT_HIT) watchpoint_hit_stream = self.cache_store.get_stream_handler(Streams.WATCHPOINT_HIT)
watchpoint_hit_stream.update_tensor_history(tensor_history) watchpoint_hit_stream.update_tensor_history(tensor_history)
# add metadata # add metadata
metadata = self.cache_store.get_stream_handler(Streams.METADATA).get(['state', 'step'])
metadata = self.cache_store.get_stream_handler(Streams.METADATA).get(['step'])
tensor_history.update(metadata) tensor_history.update(metadata)
return tensor_history return tensor_history




+ 0
- 1
tests/st/func/debugger/expect_results/restful_results/retrieve_empty_tensor_history.json View File

@@ -16,7 +16,6 @@
} }
], ],
"metadata": { "metadata": {
"state": "waiting",
"step": 1 "step": 1
} }
} }

+ 0
- 1
tests/st/func/debugger/expect_results/restful_results/retrieve_full_tensor_history.json View File

@@ -32,7 +32,6 @@
} }
], ],
"metadata": { "metadata": {
"state": "waiting",
"step": 1 "step": 1
} }
} }

+ 1736
- 1
tests/st/func/debugger/expect_results/restful_results/retrieve_single_watchpoint_hit.json
File diff suppressed because it is too large
View File


+ 0
- 1
tests/ut/debugger/expected_results/debugger_server/retrieve_tensor_history.json View File

@@ -32,7 +32,6 @@
} }
], ],
"metadata": { "metadata": {
"state": "waiting",
"step": 0 "step": 0
} }
} }

Loading…
Cancel
Save