Skip to content

Commit 35d7549

Browse files
committed
Fix warnings for gcc 13
1 parent a7ae170 commit 35d7549

9 files changed

+18
-17
lines changed

src_c/IMB_bandwidth.c

+6-7
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ Output variables:
9595
int dest, source;
9696
MPI_Status stat;
9797
MPI_Request *requests = NULL;
98+
MPI_Status *statuses = (MPI_Status*)_alloca((c_info->max_win_size) * sizeof(MPI_Status));
9899

99100
int ws, peers;
100101
char ack;
@@ -134,8 +135,7 @@ Output variables:
134135
s_tag,
135136
c_info->communicator,
136137
&requests[ws]));
137-
138-
MPI_Waitall(c_info->max_win_size, &requests[0], MPI_STATUSES_IGNORE);
138+
MPI_Waitall(c_info->max_win_size, &requests[0], statuses);
139139
MPI_Recv(&ack, 1, MPI_CHAR, dest, r_tag, c_info->communicator, &stat);
140140
}
141141
}
@@ -150,8 +150,7 @@ Output variables:
150150
r_tag,
151151
c_info->communicator,
152152
&requests[ws]));
153-
154-
MPI_Waitall(c_info->max_win_size, &requests[0], MPI_STATUSES_IGNORE);
153+
MPI_Waitall(c_info->max_win_size, &requests[0], statuses);
155154
MPI_Send(&ack, 1, MPI_CHAR, source, s_tag, c_info->communicator);
156155
}
157156
}
@@ -204,8 +203,8 @@ Output variables:
204203
int s_tag, r_tag;
205204
int dest, source;
206205
MPI_Status stat;
207-
const int max_win_size2 = 2 * c_info->max_win_size;
208206
MPI_Request *requests = NULL;
207+
MPI_Status *statuses = (MPI_Status*)_alloca((2 * c_info->max_win_size) * sizeof(MPI_Status));
209208

210209
int ws, peers;
211210
char ack;
@@ -255,7 +254,7 @@ Output variables:
255254
c_info->communicator,
256255
&requests[ws + c_info->max_win_size]));
257256

258-
MPI_Waitall(max_win_size2, &requests[0], MPI_STATUSES_IGNORE);
257+
MPI_Waitall(2 * c_info->max_win_size, &requests[0], statuses);
259258
MPI_Recv(&ack, 1, MPI_CHAR, dest, r_tag, c_info->communicator, &stat);
260259
}
261260
}
@@ -279,7 +278,7 @@ Output variables:
279278
c_info->communicator,
280279
&requests[ws + c_info->max_win_size]));
281280

282-
MPI_Waitall(max_win_size2, &requests[0], MPI_STATUSES_IGNORE);
281+
MPI_Waitall(2 * c_info->max_win_size, &requests[0], statuses);
283282
MPI_Send(&ack, 1, MPI_CHAR, source, s_tag, c_info->communicator);
284283
}
285284
}

src_c/IMB_cuda.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ For more documentation than found here, see
5252
#include "IMB_prototypes.h"
5353

5454
#define CUDA_CHKERR_EXPL_FINALLY(f, fin, a) { cudaError_t _cuda_chkerr_err; \
55-
if ((_cuda_chkerr_err=(f), (fin), _cuda_chkerr_err) != cudaSuccess) { \
55+
if ((_cuda_chkerr_err = (f), (void)(fin), _cuda_chkerr_err) != cudaSuccess) { \
5656
fprintf(stderr, "ERROR: 0x%x returned from %s\n", _cuda_chkerr_err, #f); \
5757
a; \
5858
} \

src_c/IMB_exchange.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ Output variables:
107107
int s_num = 0,
108108
r_num = 0;
109109
int s_tag, r_tag;
110-
int left, right;
110+
int left = 0, right = 0;
111111
MPI_Status stat[2];
112112
MPI_Request request[2];
113113

src_c/IMB_output.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ Input variables:
139139
3 numbers (min/max/average)
140140
141141
*/
142-
double scaled_time[MAX_TIME_ID];
142+
double scaled_time[MAX_TIME_ID] = {0};
143143

144144
int i, i_gr;
145145
int out_format;

src_c/P2P/imb_p2p_stencil2d.c

+3-2
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ void imb_p2p_stencil2d(void) {
9999
}
100100
for (msg_size_index = 0; msg_size_index < imb_p2p_config.messages.length; msg_size_index++) {
101101
MPI_Request requests[NUMBER_OF_NEIGHBORS * 2];
102+
MPI_Status statuses[NUMBER_OF_NEIGHBORS * 2];
102103
size_t size = imb_p2p_config.messages.array[msg_size_index];
103104
size_t iteration, number_of_iterations, number_of_warm_up_iterations;
104105
double time;
@@ -116,7 +117,7 @@ void imb_p2p_stencil2d(void) {
116117
for (i = 0; i < NUMBER_OF_NEIGHBORS; i++) {
117118
MPI_Isend(send_buffers[i], size, MPI_BYTE, neighbours[i], 0, MPI_COMM_WORLD, &requests[NUMBER_OF_NEIGHBORS + i]);
118119
}
119-
MPI_Waitall((NUMBER_OF_NEIGHBORS * 2), requests, MPI_STATUSES_IGNORE);
120+
MPI_Waitall((NUMBER_OF_NEIGHBORS * 2), requests, statuses);
120121
for (i = 0; i < NUMBER_OF_NEIGHBORS; i++) {
121122
touch_recv_buff(size, recv_buffers[i]);
122123
}
@@ -133,7 +134,7 @@ void imb_p2p_stencil2d(void) {
133134
for (i = 0; i < NUMBER_OF_NEIGHBORS; i++) {
134135
MPI_Isend(send_buffers[i], size, MPI_BYTE, neighbours[i], 0, MPI_COMM_WORLD, &requests[NUMBER_OF_NEIGHBORS + i]);
135136
}
136-
MPI_Waitall((NUMBER_OF_NEIGHBORS * 2), requests, MPI_STATUSES_IGNORE);
137+
MPI_Waitall((NUMBER_OF_NEIGHBORS * 2), requests, statuses);
137138
for (i = 0; i < NUMBER_OF_NEIGHBORS; i++) {
138139
touch_recv_buff(size, recv_buffers[i]);
139140
}

src_c/P2P/imb_p2p_stencil3d.c

+3-2
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ void imb_p2p_stencil3d(void) {
125125
}
126126
for (msg_size_index = 0; msg_size_index < imb_p2p_config.messages.length; msg_size_index++) {
127127
MPI_Request requests[NUMBER_OF_NEIGHBORS * 2];
128+
MPI_Status statuses[NUMBER_OF_NEIGHBORS * 2];
128129
size_t size = imb_p2p_config.messages.array[msg_size_index];
129130
size_t iteration, number_of_iterations, number_of_warm_up_iterations;
130131
double time;
@@ -142,7 +143,7 @@ void imb_p2p_stencil3d(void) {
142143
for (i = 0; i < NUMBER_OF_NEIGHBORS; i++) {
143144
MPI_Isend(send_buffers[i], size, MPI_BYTE, neighbours[i], 0, MPI_COMM_WORLD, &requests[NUMBER_OF_NEIGHBORS + i]);
144145
}
145-
MPI_Waitall((NUMBER_OF_NEIGHBORS * 2), requests, MPI_STATUSES_IGNORE);
146+
MPI_Waitall((NUMBER_OF_NEIGHBORS * 2), requests, statuses);
146147
for (i = 0; i < NUMBER_OF_NEIGHBORS; i++) {
147148
touch_recv_buff(size, recv_buffers[i]);
148149
}
@@ -159,7 +160,7 @@ void imb_p2p_stencil3d(void) {
159160
for (i = 0; i < NUMBER_OF_NEIGHBORS; i++) {
160161
MPI_Isend(send_buffers[i], size, MPI_BYTE, neighbours[i], 0, MPI_COMM_WORLD, &requests[NUMBER_OF_NEIGHBORS + i]);
161162
}
162-
MPI_Waitall((NUMBER_OF_NEIGHBORS * 2), requests, MPI_STATUSES_IGNORE);
163+
MPI_Waitall((NUMBER_OF_NEIGHBORS * 2), requests, statuses);
163164
for (i = 0; i < NUMBER_OF_NEIGHBORS; i++) {
164165
touch_recv_buff(size, recv_buffers[i]);
165166
}

src_cpp/helpers/helper_IMB_functions.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,7 @@ struct Bmark_descr {
377377
{
378378

379379
/* IMB 3.1 << */
380-
size_t s_len, r_len, s_alloc, r_alloc;
380+
size_t s_len = 0, r_len = 0, s_alloc, r_alloc;
381381
int init_size, irep, i_s, i_r, x_sample;
382382
int asize = (int) sizeof(assign_type);
383383

src_cpp/helpers/original_benchmark.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ class OriginalBenchmark : public Benchmark {
134134
int np = item.np;
135135
int imod = *(item.extra_fields.as<int>());
136136
double t;
137-
MPI_Datatype base_s_dt, base_r_dt, base_red_dt;
137+
MPI_Datatype base_s_dt = 0, base_r_dt = 0, base_red_dt = 0;
138138
if (!initialized)
139139
return;
140140
if (descr->stop_iterations)

src_cpp/utils.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ namespace set_operations {
7272
transform(list.begin(), list.end(), inserter(tmp, tmp.end()), to_lower);
7373
list = tmp;
7474
}
75-
struct case_insens_cmp : public std::binary_function<std::string, std::string, bool> {
75+
struct case_insens_cmp {
7676
bool operator()(const std::string &lhs, const std::string &rhs) const {
7777
#ifdef WIN_IMB
7878
return stricmp(lhs.c_str(), rhs.c_str()) < 0;

0 commit comments

Comments
 (0)