Skip to content
Snippets Groups Projects
Commit b97e519e authored by Thomas Jahns's avatar Thomas Jahns :cartwheel: Committed by Sergey Kosukhin
Browse files

Extend tests for advance decomposition setting

parent e938b326
No related branches found
No related tags found
No related merge requests found
......@@ -184,7 +184,8 @@ parse_long_option(struct model_config *restrict setup, int pioConfHandle, pioRol
static const char cacheRedistStr[] = "no-cache-redists", pioRoleSchemeOptionStr[] = "pio-role-scheme",
curvilinearGridOptionStr[] = "no-create-curvilinear-grid", uuidCreateOptionStr[] = "no-create-uuid",
useDistGridOptionStr[] = "no-use-dist-grid", batchedRmaOptionStr[] = "no-batch-rma",
datatypeOptionStr[] = "datatype", taxistypeOptionStr[] = "taxis-type", taxisunitOptionStr[] = "taxis-unit";
presetDecoOptionStr[] = "no-preset-decomposition", datatypeOptionStr[] = "datatype",
taxistypeOptionStr[] = "taxis-type", taxisunitOptionStr[] = "taxis-unit";
static const struct string2int datatypeArgMap[] = {
{ "pack", CDI_DATATYPE_PACK }, { "pack1", CDI_DATATYPE_PACK1 }, { "pack2", CDI_DATATYPE_PACK2 },
{ "pack3", CDI_DATATYPE_PACK3 }, { "pack4", CDI_DATATYPE_PACK4 }, { "pack5", CDI_DATATYPE_PACK5 },
......@@ -276,6 +277,15 @@ parse_long_option(struct model_config *restrict setup, int pioConfHandle, pioRol
{
setup->flags = (setup->flags & ~PIO_WRITE_CONFIG_CREATE_UUID_FLAG) | (bop.value << PIO_WRITE_CONFIG_CREATE_UUID_BIT);
}
else if ((bop = parseBooleanLongOption(sizeof(presetDecoOptionStr), presetDecoOptionStr, str)).matched)
{
#ifdef USE_MPI
setup->flags
= (setup->flags & ~PIO_WRITE_CONFIG_PRESET_DECOMPOSITION_FLAG) | (bop.value << PIO_WRITE_CONFIG_PRESET_DECOMPOSITION_BIT);
#else
invalidOptionDie("CDI-PIO option -q%s unavailable in non-MPI mode\n", presetDecoOptionStr + (bop.invert ? 0 : 3));
#endif
}
else if ((bop = parseBooleanLongOption(sizeof(batchedRmaOptionStr), batchedRmaOptionStr, str)).matched)
{
#ifdef USE_MPI
......
......@@ -19,10 +19,12 @@ enum
PIO_WRITE_CONFIG_CREATE_UUID_BIT,
PIO_WRITE_CONFIG_CREATE_CURVILINEAR_GRID_BIT,
PIO_WRITE_CONFIG_USE_DIST_GRID_BIT,
PIO_WRITE_CONFIG_PRESET_DECOMPOSITION_BIT,
PIO_WRITE_CONFIG_CHECKSUM_FLAG = 1 << PIO_WRITE_CONFIG_CHECKSUM_BIT,
PIO_WRITE_CONFIG_CREATE_UUID_FLAG = 1 << PIO_WRITE_CONFIG_CREATE_UUID_BIT,
PIO_WRITE_CONFIG_CREATE_CURVILINEAR_GRID_FLAG = 1 << PIO_WRITE_CONFIG_CREATE_CURVILINEAR_GRID_BIT,
PIO_WRITE_CONFIG_USE_DIST_GRID_FLAG = 1 << PIO_WRITE_CONFIG_USE_DIST_GRID_BIT,
PIO_WRITE_CONFIG_PRESET_DECOMPOSITION_FLAG = 1 << PIO_WRITE_CONFIG_PRESET_DECOMPOSITION_BIT,
};
struct model_config
......
......@@ -8,14 +8,14 @@ fi
mpi_task_num="${mpi_task_num-4}"
suffix="${suffix-grb}"
if [ "@USE_MPI@" = yes ]; then
variations="-qno-batch-rma -qcache-redists -qcreate-curvilinear-grid"
variations="-qno-batch-rma -qcache-redists -qcreate-curvilinear-grid -qpreset-decomposition=true"
else
variations="-qcreate-curvilinear-grid"
fi
test_variation()
{
exec 5>&1 6>&2 >"$LOG" 2>&1
echo "creating data" >&2
echo "creating data with $1" >&2
variation=$1
../libtool --mode=execute \
@MPI_LAUNCH@ \
......
......@@ -86,6 +86,7 @@ modelRun(struct model_config setup, MPI_Comm comm)
size_t varslice_size = 0, varsliceF_size = 0;
#if USE_MPI
int *chunks = NULL, *displs = NULL, comm_size = 1;
Xt_idxlist *partDescPreset = NULL;
#endif
#if USE_MPI
......@@ -113,6 +114,10 @@ modelRun(struct model_config setup, MPI_Comm comm)
vlistID = vlistCreate();
varDesc = (struct varDesc_t *) Malloc(nVars * sizeof(varDesc[0]));
#if USE_MPI
if (setup.flags & PIO_WRITE_CONFIG_PRESET_DECOMPOSITION_FLAG)
partDescPreset = (Xt_idxlist *) Malloc(nVars * sizeof(*partDescPreset));
#endif
for (size_t varIdx = 0; varIdx < nVars; varIdx++)
{
int varLevs = (int) cdi_repeatable_random() % 4;
......@@ -167,6 +172,7 @@ modelRun(struct model_config setup, MPI_Comm comm)
varDesc[varIdx].partDesc = xt_idxstripes_new(&(struct Xt_stripe){ .start = start, .nstrides = chunkSize, .stride = 1 }, 1);
partDescriptionSet:;
}
if (setup.flags & PIO_WRITE_CONFIG_PRESET_DECOMPOSITION_FLAG) partDescPreset[varIdx] = varDesc[varIdx].partDesc;
#endif
varDesc[varIdx].code = GRIB_USERDEF + (int) varIdx;
vlistDefVarCode(vlistID, varDesc[varIdx].id, varDesc[varIdx].code);
......@@ -183,7 +189,12 @@ modelRun(struct model_config setup, MPI_Comm comm)
for (size_t varIdx = 0; varIdx < nVars; ++varIdx) varDesc[varIdx].checksum_state = 0;
int streamID = composeStream(&filename, fname_prefix, tfID, setup.suffix, setup.filetype);
streamDefVlist(streamID, vlistID);
#ifdef USE_MPI
if (partDescPreset)
cdiPioStreamDefDecomposedVlist(streamID, vlistID, partDescPreset);
else
#endif
streamDefVlist(streamID, vlistID);
vdate = 19850101;
vtime = 120000;
......@@ -322,6 +333,7 @@ modelRun(struct model_config setup, MPI_Comm comm)
}
gridDestroy(gridID);
#if USE_MPI
Free(partDescPreset);
Free(displs);
Free(chunks);
Free(var);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment