MCPcopy Index your code
hub / github.com/dmlc/dgl / DistGraphServer

Class DistGraphServer

python/dgl/distributed/dist_graph.py:481–638  ·  view source on GitHub ↗

The DistGraph server. This DistGraph server loads the graph data and sets up a service so that trainers and samplers can read data of a graph partition (graph structure, node data and edge data) from remote machines. A server is responsible for one graph partition. Currently, each

Source from the content-addressed store, hash-verified

479
480
481class DistGraphServer(KVServer):
482 """The DistGraph server.
483
484 This DistGraph server loads the graph data and sets up a service so that trainers and
485 samplers can read data of a graph partition (graph structure, node data and edge data)
486 from remote machines. A server is responsible for one graph partition.
487
488 Currently, each machine runs only one main server with a set of backup servers to handle
489 clients' requests. The main server and the backup servers all handle the requests for the same
490 graph partition. They all share the partition data (graph structure and node/edge data) with
491 shared memory.
492
493 By default, the partition data is shared with the DistGraph clients that run on
494 the same machine. However, a user can disable shared memory option. This is useful for the case
495 that a user wants to run the server and the client on different machines.
496
497 Parameters
498 ----------
499 server_id : int
500 The server ID (start from 0).
501 ip_config : str
502 Path of IP configuration file.
503 num_servers : int
504 Server count on each machine.
505 num_clients : int
506 Total number of client nodes.
507 part_config : string
508 The path of the config file generated by the partition tool.
509 disable_shared_mem : bool
510 Disable shared memory.
511 graph_format : str or list of str
512 The graph formats.
513 use_graphbolt : bool
514 Whether to load GraphBolt partition. Default: False.
515 """
516
517 def __init__(
518 self,
519 server_id,
520 ip_config,
521 num_servers,
522 num_clients,
523 part_config,
524 disable_shared_mem=False,
525 graph_format=("csc", "coo"),
526 use_graphbolt=False,
527 ):
528 super(DistGraphServer, self).__init__(
529 server_id=server_id,
530 ip_config=ip_config,
531 num_servers=num_servers,
532 num_clients=num_clients,
533 )
534 self.ip_config = ip_config
535 self.num_servers = num_servers
536 self.use_graphbolt = use_graphbolt
537 # Load graph partition data.
538 if self.is_backup_server():

Callers 5

run_serverFunction · 0.90
run_serverFunction · 0.90
start_serverFunction · 0.90
start_serverFunction · 0.90
initializeFunction · 0.85

Calls

no outgoing calls

Tested by 4

run_serverFunction · 0.72
run_serverFunction · 0.72
start_serverFunction · 0.72
start_serverFunction · 0.72