Skip to content
Snippets Groups Projects
Commit fb0161fc authored by Thomas Jahns's avatar Thomas Jahns :cartwheel:
Browse files

Extend tests for advance decomposition setting

parent 3ef8e865
No related branches found
No related tags found
No related merge requests found
......@@ -188,6 +188,7 @@ parse_long_option(struct model_config *restrict setup,
uuidCreateOptionStr[] = "no-create-uuid",
useDistGridOptionStr[] = "no-use-dist-grid",
batchedRmaOptionStr[] = "no-batch-rma",
presetDecoOptionStr[] = "no-preset-decomposition",
datatypeOptionStr[] = "datatype",
taxistypeOptionStr[] = "taxis-type",
taxisunitOptionStr[] = "taxis-unit";
......@@ -335,6 +336,18 @@ parse_long_option(struct model_config *restrict setup,
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)
{
......
......@@ -18,11 +18,14 @@ 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,
};
......
......@@ -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@ \
......
......@@ -85,6 +85,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
......@@ -114,6 +115,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;
......@@ -182,6 +187,8 @@ modelRun(struct model_config setup, MPI_Comm comm)
.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);
......@@ -201,7 +208,12 @@ modelRun(struct model_config setup, MPI_Comm comm)
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;
......@@ -357,6 +369,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