Avoid stdout/stderr clutter from nrnivmodl and nrnivmodl-core
Overview of the feature
This is follow-up from the discussion in https://github.com/neuronsimulator/nrn/pull/1661#discussion_r822042348.
Currently when we do nrnivmodl or nrnivmodl-core, we end-up with unnecessary messages that clutter stdout/stderr.
For example, in case of normal CPU build:
$ ./install/bin/nrnivmodl -coreneuron ../test/coreneuron/mod/
/gpfs/bbp.cscs.ch/home/kumbhar/workarena/systems/bbpv/repos/bbp/nrn/build_gpu
Mod files: "../test/coreneuron/mod/bacur.mod" "../test/coreneuron/mod/banocur.mod" "../test/coreneuron/mod/fornetcon.mod" "../test/coreneuron/mod/invlfire.mod" "../test/coreneuron/mod/netmove.mod" "../test/coreneuron/mod/sample.mod" "../test/coreneuron/mod/watchrange.mod"
Creating x86_64 directory for .o files.
COBJS=''
[INFO] Running: make -j4 -f /gpfs/bbp.cscs.ch/home/kumbhar/workarena/systems/bbpv/repos/bbp/nrn/build_gpu/install/share/coreneuron/nrnivmodl_core_makefile ROOT=/gpfs/bbp.cscs.ch/home/kumbhar/workarena/systems/bbpv/repos/bbp/nrn/build_gpu/install MODS_PATH=x86_64/corenrn/mod2c BUILD_TYPE=STATIC NRN_PRCELLSTATE=0
Default NMODL flags:
Translating x86_64/corenrn/mod2c/banocur.mod into x86_64/corenrn/mod2c//banocur.cpp
Translating x86_64/corenrn/mod2c/exp2syn.mod into x86_64/corenrn/mod2c//exp2syn.cpp
Notice: This mechanism cannot be used with CVODE
cvode_emit=0 cvode_not_allowed=1
Translating x86_64/corenrn/mod2c/bacur.mod into x86_64/corenrn/mod2c//bacur.cpp
cvode_emit=0 cvode_not_allowed=0
Thread Safe
Warning: v undefined. (declared within VERBATIM?)
Thread Safe
cvode_emit=0 cvode_not_allowed=0
Thread Safe
diff: x86_64/corenrn/mod2c/_mod_func.cpp: No such file or directory
Translating x86_64/corenrn/mod2c/expsyn.mod into x86_64/corenrn/mod2c//expsyn.cpp
cvode_emit=0 cvode_not_allowed=0
Thread Safe
Translating x86_64/corenrn/mod2c/fornetcon.mod into x86_64/corenrn/mod2c//fornetcon.cpp
Translating x86_64/corenrn/mod2c/hh.mod into x86_64/corenrn/mod2c//hh.cpp
cvode_emit=0 cvode_not_allowed=0
cvode_emit=0 cvode_not_allowed=0
Thread Safe
Thread Safe
Translating x86_64/corenrn/mod2c/invlfire.mod into x86_64/corenrn/mod2c//invlfire.cpp
cvode_emit=0 cvode_not_allowed=0
Thread Safe
Translating x86_64/corenrn/mod2c/netmove.mod into x86_64/corenrn/mod2c//netmove.cpp
cvode_emit=0 cvode_not_allowed=0
Thread Safe
Translating x86_64/corenrn/mod2c/netstim.mod into x86_64/corenrn/mod2c//netstim.cpp
Translating x86_64/corenrn/mod2c/passive.mod into x86_64/corenrn/mod2c//passive.cpp
cvode_emit=0 cvode_not_allowed=0
Thread Safe
cvode_emit=0 cvode_not_allowed=0
Notice: ARTIFICIAL_CELL is a synonym for POINT_PROCESS which hints that it
only affects and is affected by discrete events. As such it is not
located in a section and is not associated with an integrator
Thread Safe
Translating x86_64/corenrn/mod2c/pattern.mod into x86_64/corenrn/mod2c//pattern.cpp
cvode_emit=0 cvode_not_allowed=0
Notice: ARTIFICIAL_CELL is a synonym for POINT_PROCESS which hints that it
only affects and is affected by discrete events. As such it is not
located in a section and is not associated with an integrator
Thread Safe
Translating x86_64/corenrn/mod2c/sample.mod into x86_64/corenrn/mod2c//sample.cpp
cvode_emit=0 cvode_not_allowed=0
Thread Safe
Translating x86_64/corenrn/mod2c/stim.mod into x86_64/corenrn/mod2c//stim.cpp
cvode_emit=0 cvode_not_allowed=0
Thread Safe
Translating x86_64/corenrn/mod2c/svclmp.mod into x86_64/corenrn/mod2c//svclmp.cpp
cvode_emit=0 cvode_not_allowed=0
Thread Safe
Translating x86_64/corenrn/mod2c/watchrange.mod into x86_64/corenrn/mod2c//watchrange.cpp
cvode_emit=0 cvode_not_allowed=0
Thread Safe
NVC++-W-1053-External and Static variables are not supported in acc routine - _ZN10coreneuron11nrn_threadsE (x86_64/corenrn/mod2c/exp2syn.cpp: 393)
NVC++-W-1053-External and Static variables are not supported in acc routine - _ZN10coreneuron11nrn_threadsE (x86_64/corenrn/mod2c/expsyn.cpp: 375)
NVC++-W-1053-External and Static variables are not supported in acc routine - _ZN10coreneuron11nrn_threadsE (x86_64/corenrn/mod2c/fornetcon.cpp: 389)
NVC++/x86-64 Linux 22.2-0: compilation completed with warnings
NVC++/x86-64 Linux 22.2-0: compilation completed with warnings
NVC++/x86-64 Linux 22.2-0: compilation completed with warnings
NVC++-W-1053-External and Static variables are not supported in acc routine - _ZN10coreneuron11nrn_threadsE (x86_64/corenrn/mod2c/netmove.cpp: 445)
NVC++/x86-64 Linux 22.2-0: compilation completed with warnings
NVC++-W-1053-External and Static variables are not supported in acc routine - _ZN10coreneuron11nrn_threadsE (x86_64/corenrn/mod2c/watchrange.cpp: 455)
NVC++/x86-64 Linux 22.2-0: compilation completed with warnings
/gpfs/bbp.cscs.ch/home/kumbhar/workarena/systems/bbpv/repos/bbp/nrn/build_gpu
=> Binary creating x86_64/special-core
/gpfs/bbp.cscs.ch/home/kumbhar/workarena/systems/bbpv/repos/bbp/nrn/build_gpu/install/share/coreneuron/coreneuron.cpp:
[INFO] MOD files built successfully for CoreNEURON
-> Compiling mod_func.cpp
-> NMODL ../../test/coreneuron/mod//banocur.mod
-> NMODL ../../test/coreneuron/mod//bacur.mod
-> NMODL ../../test/coreneuron/mod//fornetcon.mod
Translating banocur.mod into /gpfs/bbp.cscs.ch/home/kumbhar/workarena/systems/bbpv/repos/bbp/nrn/build_gpu/x86_64/banocur.c
Translating fornetcon.mod into /gpfs/bbp.cscs.ch/home/kumbhar/workarena/systems/bbpv/repos/bbp/nrn/build_gpu/x86_64/fornetcon.c
Notice: This mechanism cannot be used with CVODE
Translating bacur.mod into /gpfs/bbp.cscs.ch/home/kumbhar/workarena/systems/bbpv/repos/bbp/nrn/build_gpu/x86_64/bacur.c
Thread Safe
Thread Safe
Warning: v undefined. (declared within VERBATIM?)
Thread Safe
-> NMODL ../../test/coreneuron/mod//invlfire.mod
-> NMODL ../../test/coreneuron/mod//netmove.mod
-> NMODL ../../test/coreneuron/mod//sample.mod
Translating invlfire.mod into /gpfs/bbp.cscs.ch/home/kumbhar/workarena/systems/bbpv/repos/bbp/nrn/build_gpu/x86_64/invlfire.c
Thread Safe
-> NMODL ../../test/coreneuron/mod//watchrange.mod
Translating sample.mod into /gpfs/bbp.cscs.ch/home/kumbhar/workarena/systems/bbpv/repos/bbp/nrn/build_gpu/x86_64/sample.c
Translating netmove.mod into /gpfs/bbp.cscs.ch/home/kumbhar/workarena/systems/bbpv/repos/bbp/nrn/build_gpu/x86_64/netmove.c
Thread Safe
Thread Safe
Translating watchrange.mod into /gpfs/bbp.cscs.ch/home/kumbhar/workarena/systems/bbpv/repos/bbp/nrn/build_gpu/x86_64/watchrange.c
Thread Safe
-> Compiling bacur.c
-> Compiling banocur.c
-> Compiling fornetcon.c
-> Compiling invlfire.c
-> Compiling netmove.c
-> Compiling sample.c
-> Compiling watchrange.c
=> LINKING shared library ./libnrnmech.so
=> LINKING executable ./special LDFLAGS are: -lreadline -lcurses -lform /gpfs/bbp.cscs.ch/ssd/apps/bsd/2022-01-10/stage_externals/install_gcc-11.2.0-skylake/python-3.9.7-yj5alh/lib/libpython3.9.so -Wl,-rpath,/gpfs/bbp.cscs.ch/ssd/apps/bsd/2022-01-10/stage_externals/install_gcc-11.2.0-skylake/python-3.9.7-yj5alh/lib -lpthread /gpfs/bbp.cscs.ch/ssd/apps/bsd/2022-01-10/stage_externals/install_gcc-11.2.0-skylake/hpe-mpi-2.25.hmpt-4ukyxt/lib/libmpi.so -Wl,-rpath,/gpfs/bbp.cscs.ch/ssd/apps/bsd/2022-01-10/stage_externals/install_gcc-11.2.0-skylake/hpe-mpi-2.25.hmpt-4ukyxt/lib
/gpfs/bbp.cscs.ch/home/kumbhar/workarena/systems/bbpv/repos/bbp/nrn/build_gpu/install/share/nrn/nrnmain.cpp:
Successfully created x86_64/special
And for GPU wheel additionally adds:
-> Compiling fornetcon.c
/gpfs/bbp.cscs.ch/home/kumbhar/workarena/systems/bbpv/repos/bbp/nrn/build_gpu/install/lib:/gpfs/bbp.cscs.ch/ssd/apps/bsd/2022-01-10/stage_externals/install_gcc-11.2.0-skylake/python-3.9.7-yj5alh/lib:/gpfs/bbp.cscs.ch/ssd/apps/bsd/2022-01-10/stage_externals/install_gcc-11.2.0-skylake/hpe-mpi-2.25.hmpt-4ukyxt/lib:/gpfs/bbp.cscs.ch/ssd/apps/bsd/2022-01-10/stage_externals/install_gcc-11.2.0-skylake/nvhpc-22.2-gou6qx/Linux_x86_64/22.2/compilers/lib:/gpfs/bbp.cscs.ch/ssd/apps/bsd/2022-01-10/stage_compilers/install_gcc-4.8.5-haswell/gcc-11.2.0-suikmu/lib/gcc/x86_64-pc-linux-gnu/11.2.0/../../../../lib64
linux-vdso.so.1 => (0x00007fffedb02000)
libreadline.so.6 => /lib64/libreadline.so.6 (0x00007fffecef4000)
libncurses.so.5 => /lib64/libncurses.so.5 (0x00007fffecccd000)
libtinfo.so.5 => /lib64/libtinfo.so.5 (0x00007fffecaa3000)
libform.so.5 => /lib64/libform.so.5 (0x00007fffec893000)
libpython3.9.so.1.0 => /gpfs/bbp.cscs.ch/ssd/apps/bsd/2022-01-10/stage_externals/install_gcc-11.2.0-skylake/python-3.9.7-yj5alh/lib/libpython3.9.so.1.0 (0x00007fffec4e2000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x00007fffec2c6000)
libmpi.so => /gpfs/bbp.cscs.ch/ssd/apps/bsd/2022-01-10/stage_externals/install_gcc-11.2.0-skylake/hpe-mpi-2.25.hmpt-4ukyxt/lib/libmpi.so (0x00007fffebe95000)
libatomic.so.1 => /gpfs/bbp.cscs.ch/ssd/apps/bsd/2022-01-10/stage_compilers/install_gcc-4.8.5-haswell/gcc-11.2.0-suikmu/lib/gcc/x86_64-pc-linux-gnu/11.2.0/../../../../lib64/libatomic.so.1 (0x00007fffedad5000)
libnvhpcatm.so => /gpfs/bbp.cscs.ch/ssd/apps/bsd/2022-01-10/stage_externals/install_gcc-11.2.0-skylake/nvhpc-22.2-gou6qx/Linux_x86_64/22.2/compilers/lib/libnvhpcatm.so (0x00007fffebc8a000)
libstdc++.so.6 => /gpfs/bbp.cscs.ch/ssd/apps/bsd/2022-01-10/stage_compilers/install_gcc-4.8.5-haswell/gcc-11.2.0-suikmu/lib/gcc/x86_64-pc-linux-gnu/11.2.0/../../../../lib64/libstdc++.so.6 (0x00007fffeba76000)
libnvomp.so => /gpfs/bbp.cscs.ch/ssd/apps/bsd/2022-01-10/stage_externals/install_gcc-11.2.0-skylake/nvhpc-22.2-gou6qx/Linux_x86_64/22.2/compilers/lib/libnvomp.so (0x00007fffead74000)
libdl.so.2 => /lib64/libdl.so.2 (0x00007fffeab70000)
libnvcpumath.so => /gpfs/bbp.cscs.ch/ssd/apps/bsd/2022-01-10/stage_externals/install_gcc-11.2.0-skylake/nvhpc-22.2-gou6qx/Linux_x86_64/22.2/compilers/lib/libnvcpumath.so (0x00007fffea72f000)
libnvc.so => /gpfs/bbp.cscs.ch/ssd/apps/bsd/2022-01-10/stage_externals/install_gcc-11.2.0-skylake/nvhpc-22.2-gou6qx/Linux_x86_64/22.2/compilers/lib/libnvc.so (0x00007fffea4ce000)
libc.so.6 => /lib64/libc.so.6 (0x00007fffea100000)
libgcc_s.so.1 => /gpfs/bbp.cscs.ch/ssd/apps/bsd/2022-01-10/stage_compilers/install_gcc-4.8.5-haswell/gcc-11.2.0-suikmu/lib/gcc/x86_64-pc-linux-gnu/11.2.0/../../../../lib64/libgcc_s.so.1 (0x00007fffedab7000)
libm.so.6 => /lib64/libm.so.6 (0x00007fffe9dfe000)
libcrypt.so.1 => /lib64/libcrypt.so.1 (0x00007fffe9bc7000)
libintl.so.8 => /gpfs/bbp.cscs.ch/ssd/apps/bsd/2022-01-10/stage_externals/install_gcc-11.2.0-skylake/gettext-0.21-i2x2t4/lib/libintl.so.8 (0x00007fffedaa8000)
libutil.so.1 => /lib64/libutil.so.1 (0x00007fffe99c4000)
/lib64/ld-linux-x86-64.so.2 (0x00007fffed8e3000)
librt.so.1 => /lib64/librt.so.1 (0x00007fffe97bc000)
libfreebl3.so => /lib64/libfreebl3.so (0x00007fffe95b9000)
libiconv.so.2 => /gpfs/bbp.cscs.ch/ssd/apps/bsd/2022-01-10/stage_externals/install_gcc-11.2.0-skylake/libiconv-1.16-hxxlex/lib/libiconv.so.2 (0x00007fffed9a7000)
-> Compiling invlfire.c
-> Compiling netmove.c
-> Compiling sample.c
-> Compiling watchrange.c
=> LINKING shared library ./libnrnmech.so
These logs get bigger and bigger when there are large number of mod files. As part of this ticket, we should remove unnecessary messages from nrnivmodl -coreneuron output.
Proposal
Here is just a quick list of what kind of messages could be removed from the nrnivmodl output (@nrnhines can help to refine this further). I am copying one line for each type of message:
Creating x86_64 directory for .o files.
COBJS=''
[INFO] Running: make -j4 -f
/gpfs/bbp.cscs.ch/home/kumbhar/workarena/systems/bbpv/repos/bbp/nrn/build_gpu/install/share/coreneuron/nrnivmodl_core_makefile ROOT=/gpfs/bbp.cscs.ch/home/kumbhar/workarena/systems/bbpv/repos/bbp/nrn/build_gpu/install MODS_PATH=x86_64/corenrn/mod2c BUILD_TYPE=STATIC NRN_PRCELLSTATE=0
Default NMODL flags:
Translating x86_64/corenrn/mod2c/banocur.mod into x86_64/corenrn/mod2c//banocur.cpp
cvode_emit=0 cvode_not_allowed=1
Thread Safe
diff: x86_64/corenrn/mod2c/_mod_func.cpp: No such file or directory
NVC++-W-1053-External and Static variables are not supported in acc routine - _ZN10coreneuron11nrn_threadsE (x86_64/corenrn/mod2c/exp2syn.cpp: 393)
NVC++/x86-64 Linux 22.2-0: compilation completed with warnings
[INFO] MOD files built successfully for CoreNEURON
-> Compiling mod_func.cpp
-> NMODL ../../test/coreneuron/mod//banocur.mod
Translating banocur.mod into /gpfs/bbp.cscs.ch/home/kumbhar/workarena/systems/bbpv/repos/bbp/nrn/build_gpu/x86_64/banocur.c
Thread Safe
-> Compiling banocur.c
=> LINKING executable ./special LDFLAGS are: -lreadline -lcurses -lform /gpfs/bbp.cscs.ch/ssd/apps/bsd/2022-01-10/stage_externals/install_gcc-11.2.0-skylake/python-3.9.7-yj5alh/lib/libpython3.9.so -Wl,-rpath,/gpfs/bbp.cscs.ch/ssd/apps/bsd/2022-01-10/stage_externals/install_gcc-11.2.0-skylake/python-3.9.7-yj5alh/lib -lpthread /gpfs/bbp.cscs.ch/ssd/apps/bsd/2022-01-10/stage_externals/install_gcc-11.2.0-skylake/hpe-mpi-2.25.hmpt-4ukyxt/lib/libmpi.so -Wl,-rpath,/gpfs/bbp.cscs.ch/ssd/apps/bsd/2022-01-10/stage_externals/install_gcc-11.2.0-skylake/hpe-mpi-2.25.hmpt-4ukyxt/lib
/gpfs/bbp.cscs.ch/home/kumbhar/workarena/systems/bbpv/repos/bbp/nrn/build_gpu/install/share/nrn/nrnmain.cpp:
ldd special output
(Some of the above are known nvhpc warnings and could be possibly suppressed)
Further enhancement
In some cases users or developers would like to have extra information to aid in debugging. In this case we can think about adding extra environmental like NEURON_DEBUG=1 that could print extra verbose output.
Foreseeable Impact
Cleaner, useful and actionable output from nrnivmodl.
I wonder if the best compromise would be:
- always write a log file that is more verbose (and buffered so that output from concurrent build jobs is not interleaved)
- print much less to stderr (ideally print the verbose output on failure)
This might be easier to implement if nrnivmodl was a wrapper for running cmake and ninja.