1 /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
4 * (C) 2003 by Argonne National Laboratory.
5 * See COPYRIGHT in top-level directory.
12 static char MTEST_Descrip[] = "Simple test that alloc_mem and free_mem work together";
15 int main(int argc, char *argv[])
21 MTest_Init(&argc, &argv);
23 MPI_Errhandler_set(MPI_COMM_WORLD, MPI_ERRORS_RETURN);
24 for (count = 1; count < 128000; count *= 2) {
26 err = MPI_Alloc_mem(count, MPI_INFO_NULL, &ap);
29 /* An error of MPI_ERR_NO_MEM is allowed */
30 MPI_Error_class(err, &errclass);
31 if (errclass != MPI_ERR_NO_MEM) {
38 /* Access all of this memory */
39 for (j = 0; j < count; j++) {
40 ap[j] = (char) (j & 0x7f);