Skip to content

Commit ce9d13b

Browse files
Fixed alloca usage for Linux environment
1 parent de765d8 commit ce9d13b

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src_c/IMB_bandwidth.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,12 @@ EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
5252

5353
#include "IMB_prototypes.h"
5454

55+
#ifdef WIN_IMB
56+
#define IMB_alloca(X) _alloca(X)
57+
#else
58+
#define IMB_alloca(X) alloca(X)
59+
#endif
60+
5561
/*************************************************************************/
5662

5763
void IMB_uni_bandwidth(struct comm_info* c_info, int size, struct iter_schedule* ITERATIONS,
@@ -95,7 +101,7 @@ Output variables:
95101
int dest, source;
96102
MPI_Status stat;
97103
MPI_Request *requests = NULL;
98-
MPI_Status *statuses = (MPI_Status*)_alloca((c_info->max_win_size) * sizeof(MPI_Status));
104+
MPI_Status *statuses = (MPI_Status*)IMB_alloca((c_info->max_win_size) * sizeof(MPI_Status));
99105

100106
int ws, peers;
101107
char ack;
@@ -204,7 +210,7 @@ Output variables:
204210
int dest, source;
205211
MPI_Status stat;
206212
MPI_Request *requests = NULL;
207-
MPI_Status *statuses = (MPI_Status*)_alloca((2 * c_info->max_win_size) * sizeof(MPI_Status));
213+
MPI_Status *statuses = (MPI_Status*)IMB_alloca((2 * c_info->max_win_size) * sizeof(MPI_Status));
208214

209215
int ws, peers;
210216
char ack;

0 commit comments

Comments
 (0)