Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

most or all parallel I/O tests not really running #155

Closed
edhartnett opened this issue Mar 2, 2019 · 1 comment
Closed

most or all parallel I/O tests not really running #155

edhartnett opened this issue Mar 2, 2019 · 1 comment

Comments

@edhartnett
Copy link
Contributor

edhartnett commented Mar 2, 2019

In nf_test/f90tst_parallel.f90 and f90tst_parallel2.f90 we have code that looks like this:

#ifdef NF_HAS_PNETCDF
  mode_flag = IOR(nf90_clobber, nf90_mpiio)
  call parallel_io(mode_flag)
#endif

#ifdef NF_HAS_PARALLEL4
  mode_flag = IOR(nf90_netcdf4, nf90_classic_model)
  mode_flag = IOR(mode_flag, nf90_mpiposix)
  mode_flag = IOR(mode_flag, nf90_clobber)
  call parallel_io(mode_flag)
#endif

The code in these ifdef blocks will never run, because we produce a config.h (and an nfconfig.inc) by using AC_CONFIG_HEADERS() in the configure.ac. This causes defines to end up in the configure file (typically config.h but in this case also nfconfig.inc) instead of as -D defines on the compile command line. But this include file is not included by the test.

This can be seen from the compile of the test:

ed@mikado:~/tmp/netcdf-fortran/nf_test$ make f90tst_parallel2
mpifort -DHAVE_CONFIG_H -I. -I.. -I../libsrc  -I../fortran -I../fortran -I/usr/local/netcdf-c-4.6.2_mpich-3.2/include -I../fortran  -g -Wall -c -o f90tst_parallel2.o f90tst_parallel2.F90
f90tst_parallel2.F90:47:22:

   integer :: mode_flag
                      1
Warning: Unused variable ‘mode_flag’ declared at (1) [-Wunused-variable]
f90tst_parallel2.F90:95:0:

   subroutine parallel_io(mode_flag)
 
Warning: ‘parallel_io’ defined but not used [-Wunused-function]
/bin/bash ../libtool  --tag=FC   --mode=link mpifort -I../fortran  -g -Wall  -L/usr/local/netcdf-c-4.6.2_mpich-3.2/lib -o f90tst_parallel2 f90tst_parallel2.o ../fortran/libnetcdff.la -lnetcdf -ldl -lz -lcurl -lm 
libtool: link: mpifort -I../fortran -g -Wall -o .libs/f90tst_parallel2 f90tst_parallel2.o  -L/usr/local/netcdf-c-4.6.2_mpich-3.2/lib ../fortran/.libs/libnetcdff.so /usr/local/netcdf-c-4.6.2_mpich-3.2/lib/libnetcdf.so -ldl -lz /usr/lib/x86_64-linux-gnu/libcurl-nss.so -lm -pthread -Wl,-rpath -Wl,/home/ed/test_fortran/lib -Wl,-rpath -Wl,/usr/local/netcdf-c-4.6.2_mpich-3.2/lib

(Note the warning, which lead me to this problem. Since the ifdefs don't get defined, the parallel_io() test function is never being run.)

I will fix the problem of the defines not being correctly handled and make sure this test actually passes. Unfortunately just putting in an include of nfconfig.inc causes all kinds of compile errors. I will circle around to this again after dealing with all the easy warnings. ;-)

@edhartnett
Copy link
Contributor Author

This problem also affects f90tst_parallel3.F90 and f90tst_nc4_par.F90. So it looks like most or all of our parallel I/O tests are not really running. ;-(

@edhartnett edhartnett changed the title in nf_test/f90tst_parallel.f90 and f90tst_parallel2.f90 code counts of pre-processor defines that are never defined in nf_test/f90tst_parallel.f90 and f90tst_parallel2.f90 code depends on pre-processor defines that are never defined Mar 2, 2019
@edhartnett edhartnett changed the title in nf_test/f90tst_parallel.f90 and f90tst_parallel2.f90 code depends on pre-processor defines that are never defined most or all parallel I/O tests not really running Mar 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant