/********************************************************************* * * Copyright (C) 2017, Northwestern University and Argonne National Laboratory * See COPYRIGHT notice in top-level directory. * *********************************************************************/ /* $Id$ */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * This program is to test * * large number of dimensions per variable * large number of dimensions per file * large number of attributes per file * large number of variables per file * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include #include #include /* strcpy() */ #include /* basename() */ #include #include #include #define LARGE_NUM 102400 static int test_io(const char *out_path, const char *in_path, /* ignored */ int format, int coll_io, /* ignored */ MPI_Info info) { char str[32]; int i, rank, nprocs, color, err, nerrs=0; int ncid, *varid, *dimids, intBuf[1]; MPI_Comm comm=MPI_COMM_NULL; MPI_Comm_rank(MPI_COMM_WORLD, &rank); MPI_Comm_size(MPI_COMM_WORLD, &nprocs); color = 1; if (nprocs > 2) { /* run on 2 ranks only, as this test allocates memory > 4GB per rank */ /* split MPI_COMM_WORLD based on 'color' and use the same rank order */ color = (rank < 2) ? 1 : 0; MPI_Comm_split(MPI_COMM_WORLD, color, rank, &comm); } else comm = MPI_COMM_WORLD; if (!color) goto err_out; dimids = (int*) malloc(sizeof(int) * LARGE_NUM); varid = (int*) malloc(sizeof(int) * LARGE_NUM); /* Set file format */ err = ncmpi_set_default_format(format, NULL); CHECK_ERR /* create a new file for writing ----------------------------------------*/ err = ncmpi_create(comm, out_path, NC_CLOBBER, info, &ncid); CHECK_ERR for (i=0; i