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

Fix unnecessary indentation in test.

parent 8f931485
No related branches found
No related tags found
2 merge requests!34Version 2.2.0,!13Consolidation with CDI-PIO (develop)
......@@ -338,28 +338,26 @@ modelRun(struct model_config setup, MPI_Comm comm)
if (rank == 0 && setup.compute_checksum)
{
FILE *tablefp;
{
composeFilename(&filename, fname_prefix, tfID, "cksum");
if (!(tablefp = fopen(filename, "w")))
{
perror("failed to open table file");
exit(EXIT_FAILURE);
}
for (size_t i = 0; i < nVars; ++i)
{
uint32_t cksum;
int code;
cksum = memcrc_finish(&varDesc[i].checksum_state,
(off_t) ((varDesc[i].size * sizeof(var[0]) + sizeof(int) * 2) * (size_t) setup.nts));
code = vlistInqVarCode(vlistID, varDesc[i].id);
if (fprintf(tablefp, "%08lx %d\n", (unsigned long) cksum, code) < 0)
{
perror("failed to write table file");
exit(EXIT_FAILURE);
}
}
fclose(tablefp);
}
composeFilename(&filename, fname_prefix, tfID, "cksum");
if (!(tablefp = fopen(filename, "w")))
{
perror("failed to open table file");
exit(EXIT_FAILURE);
}
for (size_t i = 0; i < nVars; ++i)
{
uint32_t cksum;
int code;
cksum = memcrc_finish(&varDesc[i].checksum_state,
(off_t) ((varDesc[i].size * sizeof(var[0]) + sizeof(int) * 2) * (size_t) setup.nts));
code = vlistInqVarCode(vlistID, varDesc[i].id);
if (fprintf(tablefp, "%08lx %d\n", (unsigned long) cksum, code) < 0)
{
perror("failed to write table file");
exit(EXIT_FAILURE);
}
}
fclose(tablefp);
}
}
Free(varslice);
......
......@@ -266,30 +266,28 @@ modelRun(struct model_config setup, MPI_Comm comm)
if (rank == 0 && setup.compute_checksum)
{
FILE *tablefp;
{
composeFilename(&filename, fname_prefix, tfID, "cksum");
if (!(tablefp = fopen(filename, "w")))
{
perror("failed to open table file");
exit(EXIT_FAILURE);
}
for (size_t i = 0; i < (size_t) nVars; ++i)
{
uint32_t cksum = memcrc_finish(&varDesc[i].checksum_state,
(off_t) ((varDesc[i].size * sizeof(var[0]) + sizeof(int) * 2) * (size_t) setup.nts));
int code = vlistInqVarCode(vlistID, varDesc[i].id);
if (fprintf(tablefp, "%08lx %d\n", (unsigned long) cksum, code) < 0)
{
perror("failed to write table file");
exit(EXIT_FAILURE);
}
}
if (fclose(tablefp) != 0)
{
perror("failed to close table file");
exit(EXIT_FAILURE);
}
}
composeFilename(&filename, fname_prefix, tfID, "cksum");
if (!(tablefp = fopen(filename, "w")))
{
perror("failed to open table file");
exit(EXIT_FAILURE);
}
for (size_t i = 0; i < (size_t) nVars; ++i)
{
uint32_t cksum = memcrc_finish(&varDesc[i].checksum_state,
(off_t) ((varDesc[i].size * sizeof(var[0]) + sizeof(int) * 2) * (size_t) setup.nts));
int code = vlistInqVarCode(vlistID, varDesc[i].id);
if (fprintf(tablefp, "%08lx %d\n", (unsigned long) cksum, code) < 0)
{
perror("failed to write table file");
exit(EXIT_FAILURE);
}
}
if (fclose(tablefp) != 0)
{
perror("failed to close table file");
exit(EXIT_FAILURE);
}
}
}
Free(varslice);
......
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