|
@@ -1,5 +1,4 @@
|
|
|
#include "aes.h"
|
|
|
-#include <glog/logging.h>
|
|
|
#include <mpi.h>
|
|
|
#include <stdio.h>
|
|
|
#include <stdlib.h>
|
|
@@ -7,7 +6,10 @@
|
|
|
|
|
|
#define BUFFER_SIZE 4096
|
|
|
#define PACKAGE_NUM 4096
|
|
|
+#define GLOG_ON false
|
|
|
|
|
|
+#if GLOG_ON
|
|
|
+#include <glog/logging.h>
|
|
|
// pipeline macros
|
|
|
#define PIPELINE_SEND(idx) \
|
|
|
LOG(INFO) << "Proc" << rank << ": Isend started, idx:" << idx; \
|
|
@@ -31,6 +33,25 @@
|
|
|
MPI_Wait(&recv_request, MPI_STATUS_IGNORE); \
|
|
|
LOG(INFO) << "Proc" << rank << ": recv wait finished";
|
|
|
// end pipeline macros
|
|
|
+#else
|
|
|
+// pipeline macros
|
|
|
+#define PIPELINE_SEND(idx) \
|
|
|
+ MPI_Isend(send_buffer[(idx) % 2], BUFFER_SIZE, MPI_UINT8_T, rank + 1, idx, \
|
|
|
+ MPI_COMM_WORLD, &send_request); \
|
|
|
+
|
|
|
+#define PIPELINE_SEND_WAIT() \
|
|
|
+ MPI_Wait(&send_request, MPI_STATUS_IGNORE); \
|
|
|
+
|
|
|
+#define PIPELINE_RECV(idx) \
|
|
|
+ MPI_Irecv(recv_buffer[(idx) % 2], BUFFER_SIZE, MPI_UINT8_T, rank - 1, idx, \
|
|
|
+ MPI_COMM_WORLD, &recv_request); \
|
|
|
+
|
|
|
+#define PIPELINE_RECV_WAIT() \
|
|
|
+ MPI_Wait(&recv_request, MPI_STATUS_IGNORE); \
|
|
|
+// end pipeline macros
|
|
|
+#endif
|
|
|
+
|
|
|
+
|
|
|
|
|
|
// aes variables
|
|
|
#define AES_ONCE 16
|