Skip to content

Commit

Permalink
more codacy fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
edhartnett committed Mar 27, 2019
1 parent 2c58077 commit c13e689
Showing 1 changed file with 10 additions and 13 deletions.
23 changes: 10 additions & 13 deletions tests/cunit/test_async_multi2.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,8 @@ int main(int argc, char **argv)
{
int my_rank; /* Zero-based rank of processor. */
int ntasks; /* Number of processors involved in current execution. */
int iosysid[COMPONENT_COUNT]; /* The ID for the parallel I/O system. */
int num_iotypes; /* Number of PIO netCDF iotypes in this build. */
int iotype[NUM_IOTYPES]; /* iotypes for the supported netCDF IO iotypes. */
int num_procs[COMPONENT_COUNT] = {1, 1}; /* Num procs for IO and computation. */
int io_proc_list[NUM_IO_PROCS] = {0};
int comp_proc_list1[NUM_COMP_PROCS] = {1};
int comp_proc_list2[NUM_COMP_PROCS] = {2};
int *proc_list[COMPONENT_COUNT] = {comp_proc_list1, comp_proc_list2};
MPI_Comm test_comm;
int verbose = 0;
int ret; /* Return code. */

/* Initialize test. */
Expand All @@ -55,6 +47,14 @@ int main(int argc, char **argv)
/* Only do something on TARGET_NTASKS tasks. */
if (my_rank < TARGET_NTASKS)
{
int iosysid[COMPONENT_COUNT]; /* The ID for the parallel I/O system. */
int iotype[NUM_IOTYPES]; /* iotypes for the supported netCDF IO iotypes. */
int num_procs[COMPONENT_COUNT] = {1, 1}; /* Num procs for IO and computation. */
int io_proc_list[NUM_IO_PROCS] = {0};
int comp_proc_list1[NUM_COMP_PROCS] = {1};
int comp_proc_list2[NUM_COMP_PROCS] = {2};
int *proc_list[COMPONENT_COUNT] = {comp_proc_list1, comp_proc_list2};

/* Figure out iotypes. */
if ((ret = get_iotypes(&num_iotypes, iotype)))
ERR(ret);
Expand All @@ -65,9 +65,6 @@ int main(int argc, char **argv)
if ((ret = PIOc_init_async(test_comm, NUM_IO_PROCS, io_proc_list, COMPONENT_COUNT,
num_procs, (int **)proc_list, NULL, NULL, PIO_REARR_BOX, iosysid)))
ERR(ERR_INIT);
if (verbose)
for (int c = 0; c < COMPONENT_COUNT; c++)
printf("my_rank %d cmp %d iosysid[%d] %d\n", my_rank, c, c, iosysid[c]);

/* All the netCDF calls are only executed on the computation
* tasks. */
Expand All @@ -89,12 +86,12 @@ int main(int argc, char **argv)

/* Create sample file. */
if ((ret = create_nc_sample_4(iosysid[my_comp_idx], iotype[i], my_rank, my_comp_idx,
filename, TEST_NAME, verbose, num_types)))
filename, TEST_NAME, 0, num_types)))
ERR(ret);

/* Check the file for correctness. */
if ((ret = check_nc_sample_4(iosysid[my_comp_idx], iotype[i], my_rank, my_comp_idx,
filename, verbose, num_types)))
filename, 0, num_types)))
ERR(ret);

/* Free the decompositions. */
Expand Down

0 comments on commit c13e689

Please sign in to comment.