nudles commented on a change in pull request #468: Distributted module
URL: https://github.com/apache/incubator-singa/pull/468#discussion_r299963415
##########
File path: include/singa/dist/communicator.h
##########
@@ -0,0 +1,66 @@
+#ifndef SINGA_DIST_COMMUNICATOR_H_
+#define SINGA_DIST_COMMUNICATOR_H_
+
+#include <iostream>
+#include <cstdint>
+#include <unistd.h>
+
+#include <cuda_runtime.h>
+#include <nccl.h>
+#include <mpi.h>
+#include "singa/core/tensor.h"
+
+namespace singa{
+
+#define MPICHECK(cmd) do { \
+ int e = cmd; \
+ if( e != MPI_SUCCESS ) { \
+ printf("Failed: MPI error %s:%d '%d'\n", \
+ __FILE__,__LINE__, e); \
+ exit(EXIT_FAILURE); \
+ } \
+} while(0)
+
+
+#define CUDACHECK(cmd) do { \
Review comment:
there is a cuda check function
https://github.com/apache/incubator-singa/blob/master/include/singa/utils/cuda_utils.h#L79
can reuse it?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services