Browse Source

RPC: Deprecate all cpu* and gpu* commands, and remove CPU/GPU counts from 'devs' response

Luke Dashjr 12 years ago
parent
commit
e530385c84
2 changed files with 21 additions and 61 deletions
  1. 21 49
      README.RPC
  2. 0 12
      api.c

+ 21 - 49
README.RPC

@@ -66,11 +66,11 @@ response, otherwise it replies with text formatted as described further below.
 The JSON request format required is '{"command":"CMD","parameter":"PARAM"}'
 (though of course parameter is not required for all requests)
 where "CMD" is from the "Request" column below and "PARAM" would be e.g.
-the CPU/GPU number if required.
+the device number if required.
 
-An example request in both formats to set GPU 0 fan to 80%:
-  gpufan|0,80
-  {"command":"gpufan","parameter":"0,80"}
+An example request in both formats to set device 0 fan to 80%:
+  pgaset|0,fan,80
+  {"command":"pgaset","parameter":"0,fan,80"}
 
 The format of each reply (unless stated otherwise) is a STATUS section
 followed by an optional detail section.
@@ -150,9 +150,7 @@ The list of requests - a (*) means it requires privileged access - and replies:
                               API=API version
 
  config        CONFIG         Some miner configuration information:
-                              GPU Count=N, <- the number of GPUs
                               PGA Count=N, <- the number of PGAs
-                              CPU Count=N, <- the number of CPUs
                               Pool Count=N, <- the number of Pools
                               ADL=X, <- Y or N if ADL is compiled in the code
                               ADL in use=X, <- Y or N if any GPU has ADL
@@ -172,15 +170,13 @@ The list of requests - a (*) means it requires privileged access - and replies:
  pools         POOLS          The status of each pool e.g.
                               Pool=0,URL=http://pool.com:6311,Status=Alive,...|
 
- devs          DEVS           Each available GPU, PGA and CPU with their status
-                              e.g. GPU=0,Accepted=NN,MHS av=NNN,...,Intensity=D|
+ devs          DEVS           Each available device with their status
+                              e.g. PGA=0,Accepted=NN,MHS av=NNN,...,Intensity=D|
                               Last Share Time=NNN, <- standard long time in sec
                                (or 0 if none) of last accepted share
                               Last Share Pool=N, <- pool number (or -1 if none)
                               Last Valid Work=NNN, <- standand long time in sec
                                of last work returned that wasn't an HW:
-                              Will not report PGAs if PGA mining is disabled
-                              Will not report CPUs if CPU mining is disabled
 
  procs         DEVS           The details of each processor in the same format
                               and details as for DEVS
@@ -189,9 +185,6 @@ The list of requests - a (*) means it requires privileged access - and replies:
                               the same format as the --scan-serial command line
                               option
 
- gpu|N         GPU            The details of a single GPU number N in the same
-                              format and details as for DEVS
-
  pga|N         PGA            The details of a single PGA number N in the same
                               format and details as for DEVS
                               This is only available if PGA mining is enabled
@@ -201,21 +194,11 @@ The list of requests - a (*) means it requires privileged access - and replies:
  proc|N        PGA            The details of a single processor number N in the
                               same format and details as for DEVS
 
- cpu|N         CPU            The details of a single CPU number N in the same
-                              format and details as for DEVS
-                              This is only available if CPU mining is enabled
-                              Use 'cpucount' or 'config' first to see if there are any
-
- gpucount      GPUS           Count=N| <- the number of GPUs
-
  pgacount      PGAS           Count=N| <- the number of PGAs
                               Always returns 0 if PGA mining is disabled
 
  proccount     PGAS           Count=N| <- the number of processors
 
- cpucount      CPUS           Count=N| <- the number of CPUs
-                              Always returns 0 if CPU mining is disabled
-
  switchpool|N (*)
                none           There is no reply section just the STATUS section
                               stating the results of switching pool N to the
@@ -254,30 +237,6 @@ The list of requests - a (*) means it requires privileged access - and replies:
                               The Msg includes the pool URL
                               N.B. all details for the pool will be lost
 
- cpuenable|N (*)
-               none           There is no reply section just the STATUS section
-                              stating the results of the enable request
-
- cpudisable|N (*)
-               none           There is no reply section just the STATUS section
-                              stating the results of the disable request
-
- cpurestart|N (*)
-               none           There is no reply section just the STATUS section
-                              stating the results of the restart request
-
- gpuenable|N (*)
-               none           There is no reply section just the STATUS section
-                              stating the results of the enable request
-
- gpudisable|N (*)
-               none           There is no reply section just the STATUS section
-                              stating the results of the disable request
-
- gpurestart|N (*)
-               none           There is no reply section just the STATUS section
-                              stating the results of the restart request
-
  save|filename (*)
                none           There is no reply section just the STATUS section
                               stating success or failure saving the BFGMiner
@@ -432,8 +391,8 @@ The list of requests - a (*) means it requires privileged access - and replies:
                               is shown on the BFGMiner display like is normally
                               displayed on exit.
 
-When you enable, disable or restart a GPU or PGA, you will also get Thread
-messages in the BFGMiner status window.
+When you enable, disable or restart a device, you will also get Thread messages
+in the BFGMiner status window.
 
 The 'poolpriority' command can be used to reset the priority order of multiple
 pools with a single command - 'switchpool' only sets a single pool to first
@@ -490,7 +449,20 @@ CPU and OpenCL devices are now included as "PGAs", to enable migration to a simp
 Added API commands:
  'pgarestart'
 
+Modified API command:
+ 'devs' - remove 'GPU Count' and 'CPU Count'
+
 Deprecated API commands:
+ 'cpu'
+ 'cpucount'
+ 'cpuenable'
+ 'cpudisable'
+ 'cpurestart'
+ 'gpu'
+ 'gpucount'
+ 'gpuenable'
+ 'gpudisable'
+ 'gpurestart'
  'gpuintensity'
  'gpumem'
  'gpuengine'

+ 0 - 12
api.c

@@ -1307,9 +1307,7 @@ static void minerconfig(struct io_data *io_data, __maybe_unused SOCKETTYPE c, __
 	char buf[TMPBUFSIZ];
 	bool io_open;
 	struct driver_registration *reg, *regtmp;
-	int gpucount = 0;
 	int pgacount = 0;
-	int cpucount = 0;
 	char *adlinuse = (char *)NO;
 #ifdef HAVE_ADL
 	const char *adl = YES;
@@ -1326,24 +1324,14 @@ static void minerconfig(struct io_data *io_data, __maybe_unused SOCKETTYPE c, __
 	const char *adl = NO;
 #endif
 
-#ifdef HAVE_OPENCL
-	gpucount = nDevs;
-#endif
-
 #ifdef HAVE_AN_FPGA
 	pgacount = numpgas();
 #endif
 
-#ifdef WANT_CPUMINE
-	cpucount = opt_n_threads > 0 ? num_processors : 0;
-#endif
-
 	message(io_data, MSG_MINECONFIG, 0, NULL, isjson);
 	io_open = io_add(io_data, isjson ? COMSTR JSON_MINECONFIG : _MINECONFIG COMSTR);
 
-	root = api_add_int(root, "GPU Count", &gpucount, false);
 	root = api_add_int(root, "PGA Count", &pgacount, false);
-	root = api_add_int(root, "CPU Count", &cpucount, false);
 	root = api_add_int(root, "Pool Count", &total_pools, false);
 	root = api_add_const(root, "ADL", (char *)adl, false);
 	root = api_add_string(root, "ADL in use", adlinuse, false);