Implement the gRPC APIs for the job stats

Add the job stats APIs in the rdc_api_service at the server side rdcd
Add the job stats APIs for the RdcStandaloneHandler at the client side
Make the load librdc.so and librdc_client.so thread safe.
Impelement async update all fields in RdcEmbeddedHandler.

Change-Id: I659d91efb32d1094d3b7f0f2cec39518cd7336ce
This commit is contained in:
Bill(Shuzhou) Liu
2020-04-15 12:20:22 -04:00
committed by Chris Freehill
parent a547dc7efd
commit fe3e75edfa
13 changed files with 495 additions and 66 deletions
+77
View File
@@ -196,6 +196,24 @@ service RdcAPI {
// rdc_status_t rdc_group_field_all_ids(rdc_field_grp_t field_group_id_list[], uint32_t* count)
rpc GetFieldGroupAllIds(Empty) returns (GetFieldGroupAllIdsResponse) {}
// JOB API
// rdc_status_t rdc_job_start_stats(rdc_gpu_group_t groupId,
// char job_id[64], uint64_t update_freq)
rpc StartJobStats(StartJobStatsRequest) returns (StartJobStatsResponse) {}
// rdc_status_t rdc_job_get_stats(char jobId[64],
// rdc_job_info_t* p_job_info)
rpc GetJobStats(GetJobStatsRequest) returns (GetJobStatsResponse) {}
// rdc_status_t rdc_job_stop_stats(char job_id[64])
rpc StopJobStats(StopJobStatsRequest) returns (StopJobStatsResponse) {}
// rdc_status_t rdc_job_remove(char job_id[64])
rpc RemoveJob(RemoveJobRequest) returns (RemoveJobResponse) {}
// rdc_status_t rdc_job_remove_all()
rpc RemoveAllJob(Empty) returns (RemoveAllJobResponse) {}
}
message Empty {
@@ -377,3 +395,62 @@ message GetFieldGroupAllIdsResponse {
uint32 status = 1;
repeated uint32 field_group_ids = 2;
}
message StartJobStatsRequest {
uint32 group_id = 1;
string job_id = 2;
uint64 update_freq = 3;
}
message StartJobStatsResponse {
uint32 status = 1;
}
message GetJobStatsRequest {
string job_id = 1;
}
message JobStatsSummary {
uint64 max_value = 1;
uint64 min_value = 2;
uint64 average = 3;
}
message GpuUsageInfo {
uint32 gpu_id = 1;
uint64 start_time = 2;
uint64 end_time = 3;
uint64 energy_consumed = 4;
JobStatsSummary power_usage = 5;
JobStatsSummary gpu_clock = 6;
JobStatsSummary gpu_utilization = 7;
uint64 max_gpu_memory_used = 8;
JobStatsSummary memory_utilization = 9;
}
message GetJobStatsResponse {
uint32 status = 1;
uint32 num_gpus = 2;
GpuUsageInfo summary = 3;
repeated GpuUsageInfo gpus = 4;
}
message StopJobStatsRequest {
string job_id = 1;
}
message StopJobStatsResponse {
uint32 status = 1;
}
message RemoveJobRequest {
string job_id = 1;
}
message RemoveJobResponse {
uint32 status = 1;
}
message RemoveAllJobResponse {
uint32 status = 1;
}