| 123456789101112131415161718192021222324252627282930 |
- #include <string>
- #include <stdio.h>
- #include <stdlib.h>
- #include <unistd.h>
- #include <string.h>
- #include "worker.h"
- // Used to prefix output from this process
- std::string output_prefix;
- int main(int argc, char **argv)
- {
- if (argc != 4) {
- fprintf(stderr, "Usage: %s controller_host controller_port cuda_dev_id\n", argv[0]);
- return 1;
- }
- unsigned short controller_port = strtoul(argv[2], NULL, 10);
- // Initialize the output prefix
- char prefix[300];
- gethostname(prefix, 256);
- strcat(prefix, "-");
- strcat(prefix, argv[3]);
- output_prefix = std::string(prefix);
- return worker_main(argv[1], controller_port, strtol(argv[3], NULL, 10));
- }
|