+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *
+ * (C) 2012 by Argonne National Laboratory.
+ * See COPYRIGHT in top-level directory.
+ */
+
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
{
int i, type_size;
MPI_Datatype type = MPI_DATATYPE_NULL;
- int *buf = NULL;
+ char *buf = NULL;
int wrank, wsize;
MPI_Init(&argc, &argv);
/* a random non-zero sized buffer */
#define NELEM (10)
- buf = malloc(NELEM*sizeof(int));
+ buf = malloc(NELEM * sizeof(int));
assert(buf!=NULL);
for (i = 0; i < NELEM; i++) {
assert(buf[i] == wrank * NELEM + i);
}
+ free(buf);
+
MPI_Type_free(&type);
MPI_Finalize();