1
1

Introduce the MCA framework system. This formalizes the interface frameworks must provide.

Other changes:
 - Added a flag to the MCA variable system to indicate a variable should go away
   when its group does. Both mca_base_framework_var_register() and
   mca_base_component_var_register() set this flag.

Notes:
 - mca_base_components_open is deprecated. It will be removed in a future commit.
 - All frameworks should use MCA_BASE_FRAMEWORK_DECLARE to declare their
   framework structure.
 - All calls to framework open/close functions should be changed to use the
   mca_base_framework_* functions.
 - Instead of special-casing installdirs a flag was added to prevent calling
   into the variable system when opening a framework.
 - Ralph: Clarify the functional definition of the "register" function in the
   MCA framework object - it had the same name as another function that does a
   totally different thing.
 - As per discussion with Ralph the behavior of mca_base_framework_register()
   is to always call mca_base_framework_components_register() if the framework's
   register function was successful. This removed the need for frameworks to
   have to call this function directly.

This commit was SVN r28237.
Этот коммит содержится в:
Nathan Hjelm 2013-03-27 21:10:18 +00:00
родитель cf377db823
Коммит 020b9991a4
11 изменённых файлов: 1738 добавлений и 481 удалений

705
.gitignore поставляемый Обычный файл
Просмотреть файл

@ -0,0 +1,705 @@
# Automatically generated by build-gitignore.pl; edits may be lost!
.libs
.deps
.libs
.svn
*.la
*.lo
*.o
*.so
*.a
.dirstamp
*.dSYM
*.S
*.loT
*.orig
*.rej
*.class
*.xcscheme
*.plist
*~
Makefile
Makefile.in
static-components.h
*\\#
config.cache
aclocal.m4
autom4te.cache
config.log
config.status
configure
libtool
doxygen
bin
lib
cscope.*
etags
.cdt*
.project
.gdb*
GRTAGS
GSYMS
GTAGS
GPATH
vc70.pdb
.hgrc
.hgignore
.hg
.hgignore_local
aclocal.m4
autom4te.cache
config.log
config.status
configure
libtool
config/ylwrap
config/config.guess
config/config.sub
config/depcomp
config/compile
config/install-sh
config/ltmain.sh
config/ltmain.sh.orig
config/missing
config/mkinstalldirs
config/mca_no_configure_components.m4
config/mca_m4_config_include.m4
config/ext_no_configure_components.m4
config/ext_m4_config_include.m4
config/libtool.m4
config/libtool.m4.orig
config/libtool.m4.rej
config/lt~obsolete.m4
config/ltdl.m4
config/argz.m4
config/ltsugar.m4
config/ltversion.m4
config/ltoptions.m4
config/project_list.m4
config/autogen_found_items.m4
config/opal_get_version.sh
config/test-driver
contrib/build-mca-comps-outside-of-tree/btl_tcp2_config.h
contrib/build-mca-comps-outside-of-tree/btl_tcp2_config.h.in
contrib/build-mca-comps-outside-of-tree/autom4te.cache
contrib/build-mca-comps-outside-of-tree/config
contrib/build-mca-comps-outside-of-tree/aclocal.m4
contrib/build-mca-comps-outside-of-tree/configure
contrib/build-mca-comps-outside-of-tree/config.log
contrib/build-mca-comps-outside-of-tree/config.status
contrib/build-mca-comps-outside-of-tree/stamp-h?
contrib/build-mca-comps-outside-of-tree/libtool
contrib/scaling/orte_no_op
contrib/scaling/mpi_no_op
contrib/scaling/mpi_barrier
examples/hello_c
examples/hello_cxx
examples/hello_mpifh
examples/hello_usempi
examples/hello_usempif08
examples/ring_c
examples/ring_cxx
examples/ring_mpifh
examples/ring_usempi
examples/ring_usempif08
examples/connectivity_c
ompi/libltdl
ompi/GPATH
ompi/GRTAGS
ompi/GYSMS
ompi/GTAGS
ompi/GSYMS
ompi/contrib/vt/vt/aclocal.m4
ompi/contrib/vt/vt/autom4te.cache
ompi/contrib/vt/vt/config.h
ompi/contrib/vt/vt/config.h.in
ompi/contrib/vt/vt/config.log
ompi/contrib/vt/vt/config.status
ompi/contrib/vt/vt/configure
ompi/contrib/vt/vt/libtool
ompi/contrib/vt/vt/stamp-h1
ompi/contrib/vt/vt/config/compile
ompi/contrib/vt/vt/config/config.guess
ompi/contrib/vt/vt/config/config.sub
ompi/contrib/vt/vt/config/depcomp
ompi/contrib/vt/vt/config/install-sh
ompi/contrib/vt/vt/config/ltmain.sh
ompi/contrib/vt/vt/config/ltmain.sh.orig
ompi/contrib/vt/vt/config/missing
ompi/contrib/vt/vt/config/m4/libtool.m4
ompi/contrib/vt/vt/config/m4/lt~obsolete.m4
ompi/contrib/vt/vt/config/m4/ltoptions.m4
ompi/contrib/vt/vt/config/m4/ltsugar.m4
ompi/contrib/vt/vt/config/m4/ltversion.m4
ompi/contrib/vt/vt/config/mpigen/mk_c_wrapper.sh
ompi/contrib/vt/vt/config/mpigen/mk_fortran_wrapper.sh
ompi/contrib/vt/vt/config/mpigen/mk_registry.sh
ompi/contrib/vt/vt/extlib/otf/aclocal.m4
ompi/contrib/vt/vt/extlib/otf/autom4te.cache
ompi/contrib/vt/vt/extlib/otf/config.h
ompi/contrib/vt/vt/extlib/otf/config.h.in
ompi/contrib/vt/vt/extlib/otf/config.log
ompi/contrib/vt/vt/extlib/otf/config.status
ompi/contrib/vt/vt/extlib/otf/configure
ompi/contrib/vt/vt/extlib/otf/libtool
ompi/contrib/vt/vt/extlib/otf/stamp-h1
ompi/contrib/vt/vt/extlib/otf/config/config.guess
ompi/contrib/vt/vt/extlib/otf/config/config.sub
ompi/contrib/vt/vt/extlib/otf/config/depcomp
ompi/contrib/vt/vt/extlib/otf/config/install-sh
ompi/contrib/vt/vt/extlib/otf/config/ltmain.sh
ompi/contrib/vt/vt/extlib/otf/config/ltmain.sh.orig
ompi/contrib/vt/vt/extlib/otf/config/missing
ompi/contrib/vt/vt/extlib/otf/config/py-compile
ompi/contrib/vt/vt/extlib/otf/config/m4/libtool.m4
ompi/contrib/vt/vt/extlib/otf/config/m4/lt~obsolete.m4
ompi/contrib/vt/vt/extlib/otf/config/m4/ltoptions.m4
ompi/contrib/vt/vt/extlib/otf/config/m4/ltsugar.m4
ompi/contrib/vt/vt/extlib/otf/config/m4/ltversion.m4
ompi/contrib/vt/vt/extlib/otf/otflib/OTF_inttypes_unix.h
ompi/contrib/vt/vt/extlib/otf/tests/generic_streams/otf_generic_streams
ompi/contrib/vt/vt/extlib/otf/tests/generic_streams-mpi/otf_generic_streams_mpi
ompi/contrib/vt/vt/extlib/otf/tests/hello/otf_hello
ompi/contrib/vt/vt/extlib/otf/tests/progress/otf_progress
ompi/contrib/vt/vt/extlib/otf/tests/read_from_buffer/otf_read_from_buffer
ompi/contrib/vt/vt/extlib/otf/tests/thumbnail/otf_thumbnail
ompi/contrib/vt/vt/extlib/otf/tools/otf2vtf/otf2vtf
ompi/contrib/vt/vt/extlib/otf/tools/otfaux/otfaux
ompi/contrib/vt/vt/extlib/otf/tools/otfcompress/otfcompress
ompi/contrib/vt/vt/extlib/otf/tools/otfconfig/otfconfig
ompi/contrib/vt/vt/extlib/otf/tools/otfdump/otfdump
ompi/contrib/vt/vt/extlib/otf/tools/otfdump/otfprint
ompi/contrib/vt/vt/extlib/otf/tools/otfinfo/otfinfo
ompi/contrib/vt/vt/extlib/otf/tools/otfmerge/otfmerge
ompi/contrib/vt/vt/extlib/otf/tools/otfmerge/mpi/otfmerge-mpi
ompi/contrib/vt/vt/extlib/otf/tools/otfmerge-mpi/otfmerge-mpi
ompi/contrib/vt/vt/extlib/otf/tools/otfprofile/otfprofile
ompi/contrib/vt/vt/extlib/otf/tools/otfprofile/mpi/otfprofile-mpi
ompi/contrib/vt/vt/extlib/otf/tools/otfprofile-mpi/otfprofile-mpi
ompi/contrib/vt/vt/extlib/otf/tools/otfshrink/otfshrink
ompi/contrib/vt/vt/extlib/otf/tools/vtf2otf/vtf2otf
ompi/contrib/vt/vt/include/vt_inttypes.h
ompi/contrib/vt/vt/tools/opari/tool/opari
ompi/contrib/vt/vt/tools/vtcpcavail/vtcpcavail
ompi/contrib/vt/vt/tools/vtdyn/vtdyn
ompi/contrib/vt/vt/tools/vtdyn/dynattlib/libvt-dynatt.*
ompi/contrib/vt/vt/tools/vtfilter/vtfilter
ompi/contrib/vt/vt/tools/vtfilter/mpi/vtfilter-mpi
ompi/contrib/vt/vt/tools/vtiofsl/vtiofsl-common
ompi/contrib/vt/vt/tools/vtiofsl/vtiofsl-start
ompi/contrib/vt/vt/tools/vtiofsl/vtiofsl-stop
ompi/contrib/vt/vt/tools/vtjava/vtjava
ompi/contrib/vt/vt/tools/vtlibwrapgen/vt_libwrapgen_defs.h
ompi/contrib/vt/vt/tools/vtlibwrapgen/vtlibwrapgen
ompi/contrib/vt/vt/tools/vtrun/vtrun
ompi/contrib/vt/vt/tools/vtsetup/vtsetup
ompi/contrib/vt/vt/tools/vtsetup/vtsetup-config.xml
ompi/contrib/vt/vt/tools/vtsetup/vtsetup-data.xml
ompi/contrib/vt/vt/tools/vtsetup/doc/ChangeLog
ompi/contrib/vt/vt/tools/vtsetup/doc/LICENSE
ompi/contrib/vt/vt/tools/vtunify/vtunify
ompi/contrib/vt/vt/tools/vtunify/mpi/vtunify-mpi
ompi/contrib/vt/vt/tools/vtwrapper/vtwrapper
ompi/contrib/vt/vt/tools/vtwrapper/vtcc-wrapper-data.txt
ompi/contrib/vt/vt/tools/vtwrapper/vtc++-wrapper-data.txt
ompi/contrib/vt/vt/tools/vtwrapper/vtfort-wrapper-data.txt
ompi/contrib/vt/vt/tools/vtwrapper/vtf77-wrapper-data.txt
ompi/contrib/vt/vt/tools/vtwrapper/vtf90-wrapper-data.txt
ompi/contrib/vt/vt/tools/vtwrapper/vtnvcc-wrapper-data.txt
ompi/contrib/vt/vt/util/installdirs_conf.h
ompi/contrib/vt/vt/vtlib/vt_fmpiwrap.gen.c
ompi/contrib/vt/vt/vtlib/vt_mpireg.gen.c
ompi/contrib/vt/vt/vtlib/vt_mpireg.gen.h
ompi/contrib/vt/vt/vtlib/vt_mpiwrap.gen.c
ompi/contrib/vt/wrappers/mpi*txt
ompi/debuggers/*.in
ompi/debuggers/dlopen_test
ompi/debuggers/predefined_gap_test
ompi/include/stamp-h*
ompi/include/ompi_config.h
ompi/include/mpi.h
ompi/include/mpif-config.h
ompi/include/mpif.h
ompi/include/mpif-common.h
ompi/include/mpi-ext.h
ompi/include/mpif-ext.h
ompi/include/mpif-handles.h
ompi/include/mpif-io-constants.h
ompi/include/mpif-constants.h
ompi/include/mpif-io-handles.h
ompi/include/ompi/version.h
ompi/mca/btl/openib/btl_openib_lex.c
ompi/mca/btl/udapl/*.in
ompi/mca/coll/basic/coll-basic-version.h*
ompi/mca/coll/demo/acinclude.m4
ompi/mca/coll/demo/aclocal.m4
ompi/mca/coll/demo/configure
ompi/mca/coll/demo/configure.ac
ompi/mca/coll/demo/config.log
ompi/mca/coll/demo/config.status
ompi/mca/coll/demo/config.guess
ompi/mca/coll/demo/config.sub
ompi/mca/coll/demo/config
ompi/mca/coll/demo/libtool
ompi/mca/coll/demo/autom4te.cache
ompi/mca/coll/demo/depcomp
ompi/mca/coll/demo/ltmain.sh
ompi/mca/coll/demo/missing
ompi/mca/coll/demo/install-sh
ompi/mca/coll/demo/*bak
ompi/mca/coll/demo/coll_demo_config.h*
ompi/mca/coll/demo/stamp-h1*
ompi/mca/coll/demo/.lam*
ompi/mca/coll/demo/coll-demo-version.h*
ompi/mca/coll/ml/coll_ml_lex.c
ompi/mca/coll/self/coll-self-version.h*
ompi/mca/coll/sm/coll-sm-version.h*
ompi/mca/crcp/ompi_crcp.7
ompi/mca/io/romio/acinclude.m4*
ompi/mca/io/romio/aclocal.m4
ompi/mca/io/romio/configure
ompi/mca/io/romio/configure.ac*
ompi/mca/io/romio/config.log
ompi/mca/io/romio/config.status
ompi/mca/io/romio/libtool
ompi/mca/io/romio/autom4te.cache
ompi/mca/io/romio/config.guess
ompi/mca/io/romio/config.sub
ompi/mca/io/romio/depcomp
ompi/mca/io/romio/install-sh
ompi/mca/io/romio/ltmain.sh
ompi/mca/io/romio/missing
ompi/mca/io/romio/mkinstalldirs
ompi/mca/io/romio/stamp-h1
ompi/mca/io/romio/io-romio-version.h*
ompi/mca/io/romio/romio/config.log
ompi/mca/io/romio/romio/config.status
ompi/mca/io/romio/romio/autom4te.cache
ompi/mca/io/romio/romio/libtool
ompi/mca/io/romio/romio/lib
ompi/mca/io/romio/romio/configure
ompi/mca/io/romio/romio/aclocal.m4
ompi/mca/io/romio/romio/depcomp
ompi/mca/io/romio/romio/config.guess
ompi/mca/io/romio/romio/ltmain.sh
ompi/mca/io/romio/romio/config.sub
ompi/mca/io/romio/romio/missing
ompi/mca/io/romio/romio/install-sh
ompi/mca/io/romio/romio/localdefs
ompi/mca/io/romio/romio/adio/include/romioconf.h
ompi/mca/io/romio/romio/adio/include/romioconf.h.in
ompi/mca/io/romio/romio/adio/include/stamp-h1
ompi/mca/io/romio/romio/confdb/depcomp
ompi/mca/io/romio/romio/confdb/missing
ompi/mca/io/romio/romio/confdb/ltmain.sh
ompi/mca/io/romio/romio/confdb/config.guess
ompi/mca/io/romio/romio/confdb/config.sub
ompi/mca/io/romio/romio/confdb/install-sh
ompi/mca/io/romio/romio/confdb/.placeholder
ompi/mca/io/romio/romio/include/mpio.h
ompi/mca/io/romio/romio/include/mpiof.h
ompi/mca/io/romio/romio/mpi-io/glue/openmpi/io_romio_mpio_file.c
ompi/mca/io/romio/romio/mpi-io/glue/openmpi/io_romio_mpio_err.c
ompi/mca/io/romio/romio/test/runtests
ompi/mca/io/romio/romio/test/large_file.c
ompi/mca/io/romio/romio/test/misc.c
ompi/mca/io/romio/romio/test/fcoll_test.f
ompi/mca/io/romio/romio/test/fmisc.f
ompi/mca/io/romio/romio/test/fperf.f
ompi/mca/io/romio/romio/test/pfcoll_test.f
ompi/mca/io/romio/romio/test/status
ompi/mca/io/romio/romio/test/coll_test
ompi/mca/io/romio/romio/test/atomicity
ompi/mca/io/romio/romio/test/async-multiple
ompi/mca/io/romio/romio/test/i_noncontig
ompi/mca/io/romio/romio/test/noncontig_coll2
ompi/mca/io/romio/romio/test/large_file
ompi/mca/io/romio/romio/test/shared_fp
ompi/mca/io/romio/romio/test/misc
ompi/mca/io/romio/romio/test/perf
ompi/mca/io/romio/romio/test/noncontig
ompi/mca/io/romio/romio/test/split_coll
ompi/mca/io/romio/romio/test/psimple
ompi/mca/io/romio/romio/test/async
ompi/mca/io/romio/romio/test/large_array
ompi/mca/io/romio/romio/test/simple
ompi/mca/io/romio/romio/test/error
ompi/mca/io/romio/romio/test/file_info
ompi/mca/io/romio/romio/test/coll_perf
ompi/mca/io/romio/romio/test/aggregation1
ompi/mca/io/romio/romio/test/aggregation2
ompi/mca/io/romio/romio/test/excl
ompi/mca/io/romio/romio/test/noncontig_coll
ompi/mca/io/romio/romio/test/ordered_fp
ompi/mca/io/romio/romio/test/hindexed
ompi/mca/io/romio/romio/util/romioinstall
ompi/mca/io/romio/src/stamp-h1
ompi/mca/io/romio/src/romio_config.h
ompi/mca/io/romio/src/romio_config.h.in
ompi/mca/pml/v/autogen.vprotocols
ompi/mca/pml/v/mca_vprotocol_config_output
ompi/mca/rte/orte/ompi-ps.1
ompi/mca/rte/orte/ompi-clean.1
ompi/mca/rte/orte/mpiexec.1
ompi/mca/rte/orte/ompi-top.1
ompi/mca/rte/orte/ompi-server.1
ompi/mca/rte/orte/mpirun.1
ompi/mca/topo/unity/topo-unity-version.h*
ompi/mpi/c/profile/p*.c
ompi/mpi/fortran/configure-fortran-output.h
ompi/mpi/fortran/base/*.mod
ompi/mpi/fortran/mpiext/mpi-ext-module.F90
ompi/mpi/fortran/mpiext/mpi-f08-ext-module.F90
ompi/mpi/fortran/mpiext/*.mod
ompi/mpi/fortran/mpif-h/profile/p*.c
ompi/mpi/fortran/use-mpi-f08/constants.h
ompi/mpi/fortran/use-mpi-f08/*.mod
ompi/mpi/fortran/use-mpi-ignore-tkr/mpi-ignore-tkr-interfaces.h
ompi/mpi/fortran/use-mpi-ignore-tkr/mpi-ignore-tkr-file-interfaces.h
ompi/mpi/fortran/use-mpi-ignore-tkr/*.mod
ompi/mpi/fortran/use-mpi-tkr/fortran_kinds.sh
ompi/mpi/fortran/use-mpi-tkr/fortran_sizes.h
ompi/mpi/fortran/use-mpi-tkr/mpi_*.f90
ompi/mpi/fortran/use-mpi-tkr/mpi.mod
ompi/mpi/fortran/use-mpi-tkr/MPI.mod
ompi/mpi/fortran/use-mpi-tkr/mpi_kinds.mod
ompi/mpi/fortran/use-mpi-tkr/mpi_kinds.ompi_module
ompi/mpi/fortran/use-mpi-tkr/mpi-f90-interfaces.h
ompi/mpi/fortran/use-mpi-tkr/libmpi_f90.a
ompi/mpi/java/java/mpi
ompi/mpi/java/java/*.jar
ompi/mpi/java/java/*.h
ompi/mpi/man/man3/MPI*.3
ompi/mpi/man/man3/OpenMPI.3
ompi/mpi/man/man3/.dir-stamp
ompi/mpiext/affinity/c/OMPI_Affinity_str.3
ompi/mpiext/affinity/c/example
ompi/mpiext/example/tests/progress_c
ompi/mpiext/example/tests/progress_mpifh
ompi/mpiext/example/tests/progress_usempi
ompi/mpiext/example/tests/progress_usempif08
ompi/mpiext/example/use-mpi-f08/*.mod
ompi/tools/ompi_info/ompi_info
ompi/tools/ompi_info/*.ii
ompi/tools/ompi_info/*.ti
ompi/tools/ompi_info/ompi_info.1
ompi/tools/wrappers/mpic++-wrapper-data.txt
ompi/tools/wrappers/mpicc-wrapper-data.txt
ompi/tools/wrappers/mpifort-wrapper-data.txt
ompi/tools/wrappers/mpicc.1
ompi/tools/wrappers/mpic++.1
ompi/tools/wrappers/mpicxx.1
ompi/tools/wrappers/mpifort.1
ompi/tools/wrappers/ompi_wrapper_script
ompi/tools/wrappers/ompi.pc
ompi/tools/wrappers/ompi-c.pc
ompi/tools/wrappers/ompi-cxx.pc
ompi/tools/wrappers/ompi-fort.pc
ompi/tools/wrappers/mpijavac.pl
ompi/tools/wrappers/mpif90.1
ompi/tools/wrappers/mpif77.1
opal/libltdl
opal/vc70.pdb
opal/asm/atomic-asm.S
opal/asm/atomic-test
opal/asm/vc70.pdb
opal/asm/*.obj
opal/asm/generated/atomic-*.s
opal/class/*.obj
opal/include/opal_config.h
opal/include/opal_config.h.in
opal/include/stamp-h1
opal/include/opal/install_dirs.h
opal/include/opal/version.h
opal/include/opal/sys/powerpc/atomic-32.s
opal/include/opal/sys/powerpc/atomic-64.s
opal/include/opal/sys/powerpc/atomic-32-64.s
opal/mca/base/*.obj
opal/mca/base/mca_base_parse_paramfile_lex.c
opal/mca/base/vc70.pdb
opal/mca/crs/opal_crs.7
opal/mca/event/libevent2019/libevent/stamp-h1
opal/mca/event/libevent2019/libevent/autom4te.cache
opal/mca/event/libevent2019/libevent/libtool
opal/mca/event/libevent2019/libevent/config.log
opal/mca/event/libevent2019/libevent/config.status
opal/mca/event/libevent2019/libevent/config.h
opal/mca/event/libevent2019/libevent/libevent.pc
opal/mca/event/libevent2019/libevent/libevent_openssl.pc
opal/mca/event/libevent2019/libevent/libevent_pthreads.pc
opal/mca/event/libevent2019/libevent/compile
opal/mca/event/libevent2019/libevent/ltmain.sh
opal/mca/event/libevent2019/libevent/install-sh
opal/mca/event/libevent2019/libevent/missing
opal/mca/event/libevent2019/libevent/config.sub
opal/mca/event/libevent2019/libevent/config.guess
opal/mca/event/libevent2019/libevent/configure
opal/mca/event/libevent2019/libevent/depcomp
opal/mca/event/libevent2019/libevent/aclocal.m4
opal/mca/event/libevent2019/libevent/include/event2/event-config.h
opal/mca/event/libevent2019/libevent/m4/ltsugar.m4
opal/mca/event/libevent2019/libevent/m4/libtool.m4
opal/mca/event/libevent2019/libevent/m4/ltversion.m4
opal/mca/event/libevent2019/libevent/m4/lt~obsolete.m4
opal/mca/event/libevent2019/libevent/m4/ltoptions.m4
opal/mca/hwloc/hwloc151/hwloc/include/hwloc/autogen/stamp-h?
opal/mca/hwloc/hwloc151/hwloc/include/hwloc/autogen/config.h
opal/mca/hwloc/hwloc151/hwloc/include/private/autogen/stamp-h?
opal/mca/hwloc/hwloc151/hwloc/include/private/autogen/config.h
opal/mca/installdirs/config/install_dirs.h
opal/mca/memory/vc70.pdb
opal/mca/memory/base/*.obj
opal/mca/pstat/*.obj
opal/mca/pstat/base/*.obj
opal/mca/timer/vc70.pdb
opal/mca/timer/base/*.obj
opal/memoryhooks/*.obj
opal/runtime/*.obj
opal/threads/*.obj
opal/tools/opal-checkpoint/opal-checkpoint
opal/tools/opal-checkpoint/opal-checkpoint.1
opal/tools/opal-restart/opal-restart
opal/tools/opal-restart/opal-restart.1
opal/tools/wrappers/opalcc-wrapper-data.txt
opal/tools/wrappers/opalc++-wrapper-data.txt
opal/tools/wrappers/opalCC-wrapper-data.txt
opal/tools/wrappers/opal_wrapper
opal/tools/wrappers/opalcc.1
opal/tools/wrappers/opalc++.1
opal/tools/wrappers/generic_wrapper.1
opal/tools/wrappers/opal_wrapper.1
opal/tools/wrappers/opal.pc
opal/util/*.obj
opal/util/show_help_lex.c
opal/util/vc70.pdb
opal/util/keyval/keyval_lex.c
opal/win32/*.obj
orte/doxygen
orte/include/stamp-h*
orte/include/orte_config.h
orte/include/orte/version.h
orte/mca/dfs/vc70.pdb
orte/mca/dfs/base/*.obj
orte/mca/errmgr/vc70.pdb
orte/mca/errmgr/base/*.obj
orte/mca/filem/orte_filem.7
orte/mca/odls/default/.gdb_history
orte/mca/oob/tcp/acinclude.m4
orte/mca/oob/tcp/aclocal.m4
orte/mca/oob/tcp/configure
orte/mca/oob/tcp/configure.ac
orte/mca/oob/tcp/config.log
orte/mca/oob/tcp/config.status
orte/mca/oob/tcp/libtool
orte/mca/oob/tcp/autom4te.cache
orte/mca/oob/tcp/.lam*
orte/mca/rmaps/rank_file/rmaps_rank_file_lex.c
orte/mca/rmaps/rank_file/rankfile_lex.c
orte/mca/snapc/orte_snapc.7
orte/mca/sstore/orte_sstore.7
orte/test/mpi/abort
orte/test/mpi/accept
orte/test/mpi/bad_exit
orte/test/mpi/bcast_loop
orte/test/mpi/concurrent_spawn
orte/test/mpi/connect
orte/test/mpi/crisscross
orte/test/mpi/delayed_abort
orte/test/mpi/hello_barrier
orte/test/mpi/hello_nodename
orte/test/mpi/hello_output
orte/test/mpi/hello_show_help
orte/test/mpi/hello
orte/test/mpi/hello++
orte/test/mpi/loop_child
orte/test/mpi/loop_spawn
orte/test/mpi/mpi_barrier
orte/test/mpi/mpi_no_op
orte/test/mpi/mpi_spin
orte/test/mpi/multi_abort
orte/test/mpi/parallel_r8
orte/test/mpi/parallel_r64
orte/test/mpi/parallel_w8
orte/test/mpi/parallel_w64
orte/test/mpi/pubsub
orte/test/mpi/read_write
orte/test/mpi/reduce-hang
orte/test/mpi/segv
orte/test/mpi/simple_spawn
orte/test/mpi/slave
orte/test/mpi/spawn_multiple
orte/test/mpi/ziaprobe
orte/test/mpi/ziatest
orte/test/mpi/.gdb_history
orte/test/mpi/junk*
orte/test/mpi/sio
orte/test/mpi/sendrecv_blaster
orte/test/mpi/early_abort
orte/test/mpi/spawn_problem/ch_rec
orte/test/mpi/spawn_problem/output
orte/test/mpi/spawn_problem/start
orte/test/mpi/debugger
orte/test/mpi/server_port_name.txt
orte/test/mpi/singleton_client_server
orte/test/mpi/intercomm_create
orte/test/mpi/spawn_tree
orte/test/mpi/init-exit77
orte/test/mpi/mpi_info
orte/test/system/radix
orte/test/system/sigusr_trap
orte/test/system/orte_no_op
orte/test/system/no_op
orte/test/system/hello
orte/test/system/hello_nodename
orte/test/system/hello_null
orte/test/system/.gdb*
orte/test/system/spin
orte/test/system/orte_nodename
orte/test/system/orte_proc_subscribe
orte/test/system/orte_spawn
orte/test/system/orte_stage_gate
orte/test/system/orte_loop_spawn
orte/test/system/orte_loop_child
orte/test/system/orte_abort
orte/test/system/get_limits
orte/test/system/orte_ring
orte/test/system/spawn_child
orte/test/system/orte_tool
orte/test/system/binom
orte/test/system/iof_stress
orte/test/system/oob_stress
orte/test/system/iof_delay
orte/test/system/orte_barrier
orte/test/system/orte_mcast
orte/test/system/mcast
orte/test/system/mcast_recv
orte/test/system/opal_interface
orte/test/system/orte_spin
orte/test/system/segfault
orte/test/system/sysinfo
orte/test/system/orte_exit
orte/test/system/orte_db
orte/test/system/orte_state
orte/test/system/orte_sensor
orte/test/system/event-threads
orte/test/system/test-time
orte/test/system/psm_keygen
orte/test/system/regex
orte/test/system/orte_errors
orte/test/system/evthread-test
orte/test/system/evpri-test
orte/test/system/opal-evpri-test
orte/test/system/evpri-test2
orte/test/system/mapper
orte/test/system/reducer
orte/test/system/opal_hotel
orte/test/system/orte_dfs
orte/test/system/orte_allocate
orte/tools/orte-checkpoint/orte-checkpoint
orte/tools/orte-checkpoint/orte-checkpoint.1
orte/tools/orte-checkpoint/ompi-checkpoint.1
orte/tools/orte-clean/orte-clean
orte/tools/orte-clean/orte-clean.1
orte/tools/orte-info/orte-info
orte/tools/orte-info/*.exe
orte/tools/orte-info/orte-info.1
orte/tools/orte-migrate/orte-migrate
orte/tools/orte-migrate/orte-migrate.1
orte/tools/orte-migrate/ompi-migrate.1
orte/tools/orte-ps/orte-ps
orte/tools/orte-ps/orte-ps.1
orte/tools/orte-restart/orte-restart
orte/tools/orte-restart/orte-restart.1
orte/tools/orte-restart/ompi-restart.1
orte/tools/orte-server/orte-server
orte/tools/orte-server/orte-server.1
orte/tools/orte-top/orte-top
orte/tools/orte-top/orte-top.1
orte/tools/orted/orted
orte/tools/orted/orted.1
orte/tools/orted/.gdb_history
orte/tools/orted/*.exe
orte/tools/orterun/orterun
orte/tools/orterun/*.exe
orte/tools/orterun/orterun.1
orte/tools/wrappers/ortecc-wrapper-data.txt
orte/tools/wrappers/ortec++-wrapper-data.txt
orte/tools/wrappers/ortecc.1
orte/tools/wrappers/ortec++.1
orte/tools/wrappers/orte_wrapper_script
orte/tools/wrappers/orte.pc
orte/util/hostfile/hostfile_lex.c
orte/util/hostfile/orte_hosts.7
test/asm/.gdb_history
test/asm/atomic_math_noinline
test/asm/atomic_barrier
test/asm/atomic_cmpset_noinline
test/asm/atomic_math
test/asm/atomic_cmpset
test/asm/atomic_spinlock_noinline.c
test/asm/atomic_barrier_noinline.c
test/asm/atomic_math_noinline.c
test/asm/atomic_cmpset_noinline.c
test/asm/atomic_spinlock_noinline
test/asm/atomic_barrier_noinline
test/asm/atomic_spinlock
test/class/*.txt
test/class/*.exe
test/class/ompi_circular_buffer_fifo
test/class/ompi_bitmap_test_out.txt
test/class/ompi_fifo
test/class/opal_list
test/class/opal_hash_table
test/class/opal_value_array
test/class/ompi_rb_tree
test/class/ompi_bitmap
test/class/opal_pointer_array
test/class/opal_bitmap
test/class/opal_tree
test/datatype/ddt_test
test/datatype/ddt_pack
test/datatype/to_self
test/datatype/checksum
test/datatype/position
test/datatype/ddt_raw
test/datatype/opal_datatype_test
test/dss/dss_buffer
test/dss/dss_copy
test/dss/dss_size
test/dss/dss_cmp
test/dss/dss_release
test/dss/dss_payload
test/dss/dss_set_get
test/dss/dss_print
test/event/signal-test
test/event/event-test
test/event/time-test
test/mpi/environment/.gdb_history
test/mpi/environment/chello
test/runtime/.gdb_history
test/runtime/parse_context
test/runtime/sigchld
test/runtime/start_shut
test/runtime/opal_init_finalize
test/runtime/orte_init_finalize
test/threads/opal_condition
test/threads/opal_thread
test/util/aaa
test/util/test_session_dir_out
test/util/opal_os_path
test/util/opal_argv
test/util/opal_os_create_dirpath
test/util/opal_if
test/util/opal_error
test/util/opal_timer
test/util/orte_sys_info
test/util/orte_session_dir
test/util/orte_sys_info
test/util/orte_universe_setup_file_io
test/util/opal_basename
test/util/ompi_numtostr
test/util/ompi_pack
test/util/test-file
test/util/opal_sos
test/util/opal_path_nfs
test/util/opal_bit_ops

Просмотреть файл

@ -36,7 +36,8 @@ headers = \
mca_base_var_enum.h \
mca_base_vari.h \
mca_base_param.h \
mca_base_param_internal.h
mca_base_param_internal.h \
mca_base_framework.h
# Library
@ -56,7 +57,8 @@ libmca_base_la_SOURCES = \
mca_base_var.c \
mca_base_var_enum.c \
mca_base_parse_paramfile.c \
mca_base_components_register.c
mca_base_components_register.c \
mca_base_framework.c
# Conditionally install the header files

Просмотреть файл

@ -1,3 +1,4 @@
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
/*
* Copyright (c) 2004-2008 The Trustees of Indiana University and Indiana
* University Research and Technology
@ -10,6 +11,8 @@
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2009 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2013 Los Alamos National Security, LLC. All rights
* reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -31,6 +34,7 @@
#include "opal/mca/mca.h"
#include "opal/mca/base/mca_base_param.h"
#include "opal/mca/base/mca_base_var.h"
#include "opal/mca/base/mca_base_framework.h"
#include "opal/util/cmd_line.h"
BEGIN_C_DECLS
@ -61,11 +65,10 @@ OPAL_DECLSPEC OBJ_CLASS_DECLARATION(mca_base_component_priority_list_item_t);
* Public variables
*/
OPAL_DECLSPEC extern char *mca_base_component_path;
OPAL_DECLSPEC extern bool mca_base_opened;
OPAL_DECLSPEC extern char *mca_base_system_default_path;
OPAL_DECLSPEC extern char *mca_base_user_default_path;
OPAL_DECLSPEC extern bool mca_base_component_show_load_errors;
OPAL_DECLSPEC extern bool mca_base_component_disable_dlopen;
OPAL_DECLSPEC extern char *mca_base_system_default_path;
OPAL_DECLSPEC extern char *mca_base_user_default_path;
/*
* Public functions
@ -145,17 +148,45 @@ OPAL_DECLSPEC char * mca_base_component_to_string(const mca_base_component_t *a)
OPAL_DECLSPEC int mca_base_component_find(const char *directory, const char *type,
const mca_base_component_t *static_components[],
char **requested_component_names,
bool include_mode,
const char *requested_components,
opal_list_t *found_components,
bool open_dso_components);
/**
* Filter a list of components based on a comma-delimted list of names and/or
* a set of meta-data flags.
*
* @param[in,out] components List of components to filter
* @param[in] output_id Output id to write to for error/warning/debug messages
* @param[in] filter_names Comma delimited list of components to use. Negate with ^.
* May be NULL.
* @param[in] filter_flags Metadata flags components are required to have set (CR ready)
*
* @returns OPAL_SUCCESS On success
* @returns OPAL_ERR_NOT_FOUND If some component in {filter_names} is not found in
* {components}. Does not apply to negated filters.
* @returns opal error code On other error.
*
* This function closes and releases any components that do not match the filter_name and
* filter flags.
*/
OPAL_DECLSPEC int mca_base_components_filter (const char *framework_name, opal_list_t *components, int output_id,
const char *filter_names, uint32_t filter_flags);
/* Safely release some memory allocated by mca_base_component_find()
(i.e., is safe to call even if you never called
mca_base_component_find()). */
OPAL_DECLSPEC int mca_base_component_find_finalize(void);
/* mca_base_components_register.c */
OPAL_DECLSPEC int mca_base_framework_components_register (struct mca_base_framework_t *framework,
mca_base_register_flag_t flags);
/* mca_base_components_open.c */
OPAL_DECLSPEC int mca_base_framework_components_open (struct mca_base_framework_t *framework,
mca_base_open_flag_t flags);
OPAL_DECLSPEC int mca_base_components_open(const char *type_name, int output_id,
const mca_base_component_t **static_components,
@ -163,13 +194,22 @@ OPAL_DECLSPEC int mca_base_components_open(const char *type_name, int output_id,
bool open_dso_components);
/* mca_base_components_close.c */
int mca_base_component_release (int output_id, const mca_base_component_t *component,
bool opened);
/**
* Close and release a component.
*
* @param[in] component Component to close
* @param[in] output_id Output id for debugging output
*
* After calling this function the component may no longer be used.
*/
OPAL_DECLSPEC void mca_base_component_close (const mca_base_component_t *component, int output_id);
OPAL_DECLSPEC int mca_base_components_close(int output_id, opal_list_t *components_available,
const mca_base_component_t *skip);
OPAL_DECLSPEC int mca_base_framework_components_close (struct mca_base_framework_t *framework,
const mca_base_component_t *skip);
END_C_DECLS
#endif /* MCA_BASE_H */

Просмотреть файл

@ -1,3 +1,4 @@
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
/*
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
* University Research and Technology
@ -130,10 +131,28 @@ static char **found_filenames = NULL;
static char *last_path_to_use = NULL;
#endif /* OPAL_WANT_LIBLTDL */
static int component_find_check (const char *framework_name, char **requested_component_names, opal_list_t *components);
/*
* Dummy structure for casting for open_only logic
*/
struct mca_base_open_only_dummy_component_t {
/** MCA base component */
mca_base_component_t version;
/** MCA base data */
mca_base_component_data_t data;
};
typedef struct mca_base_open_only_dummy_component_t mca_base_open_only_dummy_component_t;
static char negate[] = "^";
static bool use_component(const bool include_mode,
const char **requested_component_names,
const char *component_name);
static int parse_requested (const char *requested, bool *include_mode,
char ***requested_component_names);
/*
* Function to find as many components of a given type as possible. This
@ -146,14 +165,20 @@ static bool use_component(const bool include_mode,
*/
int mca_base_component_find(const char *directory, const char *type,
const mca_base_component_t *static_components[],
char **requested_component_names,
bool include_mode,
const char *requested_components,
opal_list_t *found_components,
bool open_dso_components)
{
int i;
opal_list_item_t *item;
char **requested_component_names = NULL;
mca_base_component_list_item_t *cli;
bool include_mode;
int i, ret;
ret = parse_requested (requested_components, &include_mode,
&requested_component_names);
if (OPAL_SUCCESS != ret) {
return ret;
}
/* Find all the components that were statically linked in */
OBJ_CONSTRUCT(found_components, opal_list_t);
@ -164,7 +189,8 @@ int mca_base_component_find(const char *directory, const char *type,
static_components[i]->mca_component_name) ) {
cli = OBJ_NEW(mca_base_component_list_item_t);
if (NULL == cli) {
return OPAL_ERR_OUT_OF_RESOURCE;
ret = OPAL_ERR_OUT_OF_RESOURCE;
goto component_find_out;
}
cli->cli_component = static_components[i];
opal_list_append(found_components, (opal_list_item_t *) cli);
@ -184,33 +210,24 @@ int mca_base_component_find(const char *directory, const char *type,
}
#endif
/* Ensure that *all* requested components exist. Print a warning
and abort if they do not. */
for (i = 0; include_mode && NULL != requested_component_names &&
NULL != requested_component_names[i]; ++i) {
for (item = opal_list_get_first(found_components);
opal_list_get_end(found_components) != item;
item = opal_list_get_next(item)) {
cli = (mca_base_component_list_item_t*) item;
if (0 == strcmp(requested_component_names[i],
cli->cli_component->mca_component_name)) {
break;
}
if (include_mode) {
ret = component_find_check (type, requested_component_names, found_components);
} else {
ret = OPAL_SUCCESS;
}
if (opal_list_get_end(found_components) == item) {
char h[MAXHOSTNAMELEN];
gethostname(h, sizeof(h));
opal_show_help("help-mca-base.txt",
"find-available:not-valid", true,
h, type, requested_component_names[i]);
return OPAL_ERR_NOT_FOUND;
}
ret = OPAL_SUCCESS;
component_find_out:
if (NULL != requested_component_names) {
opal_argv_free(requested_component_names);
}
/* All done */
return OPAL_SUCCESS;
return ret;
}
int mca_base_component_find_finalize(void)
@ -228,6 +245,71 @@ int mca_base_component_find_finalize(void)
return OPAL_SUCCESS;
}
int mca_base_components_filter (const char *framework_name, opal_list_t *components, int output_id,
const char *filter_names, uint32_t filter_flags)
{
mca_base_component_list_item_t *cli, *next;
char **requested_component_names = NULL;
bool include_mode, can_use;
int ret;
assert (NULL != components);
if (0 == filter_flags && NULL == filter_names) {
return OPAL_SUCCESS;
}
ret = parse_requested (filter_names, &include_mode,
&requested_component_names);
if (OPAL_SUCCESS != ret) {
return ret;
}
OPAL_LIST_FOREACH_SAFE(cli, next, components, mca_base_component_list_item_t) {
const mca_base_component_t *component = cli->cli_component;
mca_base_open_only_dummy_component_t *dummy =
(mca_base_open_only_dummy_component_t *) cli->cli_component;
can_use = use_component (include_mode, (const char **) requested_component_names,
cli->cli_component->mca_component_name);
if (!can_use || (filter_flags & dummy->data.param_field) != filter_flags) {
if (can_use && (filter_flags & MCA_BASE_METADATA_PARAM_CHECKPOINT) &&
!(MCA_BASE_METADATA_PARAM_CHECKPOINT & dummy->data.param_field)) {
opal_output_verbose(10, output_id,
"mca: base: components_filter: "
"(%s) Component %s is *NOT* Checkpointable - Disabled",
component->reserved,
component->mca_component_name);
}
opal_list_remove_item (components, &cli->super);
mca_base_component_close (component, output_id);
OBJ_RELEASE(cli);
} else if (filter_flags & MCA_BASE_METADATA_PARAM_CHECKPOINT) {
opal_output_verbose(10, output_id,
"mca: base: components_filter: "
"(%s) Component %s is Checkpointable",
component->reserved,
component->mca_component_name);
}
}
if (include_mode) {
ret = component_find_check (framework_name, requested_component_names, components);
} else {
ret = OPAL_SUCCESS;
}
if (NULL != requested_component_names) {
opal_argv_free (requested_component_names);
}
return ret;
}
#if OPAL_WANT_LIBLTDL
/*
@ -246,7 +328,7 @@ static void find_dyn_components(const char *path, const char *type_name,
opal_list_t *found_components)
{
int i, len;
char *path_to_use, *dir, *end;
char *path_to_use = NULL, *dir, *end;
component_file_item_t *file;
opal_list_item_t *cur;
char prefix[32 + MCA_BASE_MAX_TYPE_NAME_LEN], *basename;
@ -443,6 +525,7 @@ static int open_component(component_file_item_t *target_file,
opal_output_verbose(40, 0, "mca: base: component_find: examining dyanmic %s MCA component \"%s\"",
target_file->type, target_file->name);
opal_output_verbose(40, 0, "mca: base: component_find: %s", target_file->filename);
vl = mca_base_component_show_load_errors ? 0 : 40;
/* Was this component already loaded (e.g., via dependency)? */
@ -903,11 +986,72 @@ static bool use_component(const bool include_mode,
* As xor is a binary operator let's implement it manually before
* a compiler screws it up.
*/
if ( (include_mode && found) || !(include_mode || found) ) {
return true;
} else {
return false;
return (include_mode && found) || !(include_mode || found);
}
/* Ensure that *all* requested components exist. Print a warning
and abort if they do not. */
static int component_find_check (const char *framework_name, char **requested_component_names, opal_list_t *components)
{
mca_base_component_list_item_t *cli;
int i;
for (i = 0; NULL != requested_component_names &&
NULL != requested_component_names[i]; ++i) {
bool found = false;
OPAL_LIST_FOREACH(cli, components, mca_base_component_list_item_t) {
if (0 == strcmp(requested_component_names[i],
cli->cli_component->mca_component_name)) {
found = true;
break;
}
}
if (!found) {
char h[MAXHOSTNAMELEN];
gethostname(h, sizeof(h));
opal_show_help("help-mca-base.txt",
"find-available:not-valid", true,
h, framework_name, requested_component_names[i]);
return OPAL_ERR_NOT_FOUND;
}
}
return OPAL_SUCCESS;
}
static int parse_requested (const char *requested, bool *include_mode,
char ***requested_component_names)
{
const char *requested_orig = requested;
*requested_component_names = NULL;
*include_mode = true;
/* See if the user requested anything */
if (NULL == requested || 0 == strlen (requested)) {
return OPAL_SUCCESS;
}
/* Are we including or excluding? We only allow the negate
character to be the *first* character of the value (but be nice
and allow any number of negate characters in the beginning). */
requested += strspn (requested, negate);
/* Double check to ensure that the user did not specify the negate
character anywhere else in the value. */
if (NULL != strstr (requested, negate)) {
opal_show_help("help-mca-base.txt",
"framework-param:too-many-negates",
true, requested_orig);
return OPAL_ERROR;
}
/* Split up the value into individual component names */
*requested_component_names = opal_argv_split(requested, ',');
/* All done */
return OPAL_SUCCESS;
}

Просмотреть файл

@ -1,3 +1,4 @@
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
/*
* Copyright (c) 2004-2006 The Trustees of Indiana University and Indiana
* University Research and Technology
@ -9,6 +10,8 @@
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2006 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2013 Los Alamos National Security, LLC. All rights
* reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -25,13 +28,12 @@
#include "opal/mca/base/mca_base_component_repository.h"
#include "opal/constants.h"
int mca_base_component_release (int output_id, const mca_base_component_t *component,
bool opened)
void mca_base_component_close (const mca_base_component_t *component, int output_id)
{
int group_id;
int ret;
/* Close */
if (opened && NULL != component->mca_close_component) {
if (NULL != component->mca_close_component) {
component->mca_close_component();
opal_output_verbose(10, output_id,
"mca: base: close: component %s closed",
@ -39,52 +41,47 @@ int mca_base_component_release (int output_id, const mca_base_component_t *compo
}
/* Unload */
/* Deregister this group before the component goes away */
group_id = mca_base_var_group_find (NULL, component->mca_type_name,
component->mca_component_name);
mca_base_var_group_deregister (group_id);
opal_output_verbose(10, output_id,
"mca: base: close: unloading component %s",
component->mca_component_name);
mca_base_component_repository_release((mca_base_component_t *) component);
return OPAL_SUCCESS;
/* XXX -- TODO -- Replace reserved by mca_project_name for 1.9 */
ret = mca_base_var_group_find (component->reserved, component->mca_type_name,
component->mca_component_name);
if (0 <= ret) {
mca_base_var_group_deregister (ret);
}
int mca_base_components_close(int output_id,
opal_list_t *components_available,
mca_base_component_repository_release((mca_base_component_t *) component);
}
int mca_base_framework_components_close (mca_base_framework_t *framework,
const mca_base_component_t *skip)
{
opal_list_item_t *item;
mca_base_component_priority_list_item_t *pcli, *skipped_pcli = NULL;
const mca_base_component_t *component;
return mca_base_components_close (framework->framework_output,
&framework->framework_components,
skip);
}
int mca_base_components_close(int output_id, opal_list_t *components,
const mca_base_component_t *skip)
{
mca_base_component_list_item_t *cli, *next;
/* Close and unload all components in the available list, except the
"skip" item. This is handy to close out all non-selected
components. It's easier to simply remove the entire list and
then simply re-add the skip entry when done. */
for (item = opal_list_remove_first(components_available);
NULL != item;
item = opal_list_remove_first(components_available)) {
pcli = (mca_base_component_priority_list_item_t *) item;
component = pcli->super.cli_component;
if (component != skip) {
mca_base_component_release (output_id, component, true);
free(pcli);
} else {
skipped_pcli = pcli;
}
OPAL_LIST_FOREACH_SAFE(cli, next, components, mca_base_component_list_item_t) {
if (skip == cli->cli_component) {
continue;
}
/* If we found it, re-add the skipped component to the available
list (see above comment) */
mca_base_component_close (cli->cli_component, output_id);
opal_list_remove_item (components, &cli->super);
if (NULL != skipped_pcli) {
opal_list_append(components_available, (opal_list_item_t *) skipped_pcli);
OBJ_RELEASE(cli);
}
/* All done */

Просмотреть файл

@ -1,3 +1,4 @@
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
/*
* Copyright (c) 2004-2008 The Trustees of Indiana University and Indiana
* University Research and Technology
@ -10,7 +11,7 @@
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2008-2012 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2011-2012 Los Alamos National Security, LLC.
* Copyright (c) 2011-2013 Los Alamos National Security, LLC.
* All rights reserved.
* $COPYRIGHT$
*
@ -28,129 +29,104 @@
#include "opal/class/opal_list.h"
#include "opal/util/argv.h"
#include "opal/util/output.h"
#include "opal/util/show_help.h"
#include "opal/mca/mca.h"
#include "opal/mca/base/base.h"
#include "opal/mca/base/mca_base_component_repository.h"
#include "opal/constants.h"
struct component_name_t {
opal_list_item_t super;
char mn_name[MCA_BASE_MAX_COMPONENT_NAME_LEN];
};
typedef struct component_name_t component_name_t;
/*
* Dummy structure for casting for open_only logic
*/
struct mca_base_open_only_dummy_component_t {
/** MCA base component */
mca_base_component_t version;
/** MCA base data */
mca_base_component_data_t data;
};
typedef struct mca_base_open_only_dummy_component_t mca_base_open_only_dummy_component_t;
/*
* Local variables
*/
static bool show_errors = false;
static const char negate = '^';
/*
* Local functions
*/
static int parse_requested(int mca_param, bool *include_mode,
char ***requested_component_names);
static int open_components(const char *type_name, int output_id,
opal_list_t *src, opal_list_t *dest);
static int open_components(mca_base_framework_t *framework);
struct mca_base_dummy_framework_list_item_t {
opal_list_item_t super;
mca_base_framework_t framework;
};
/**
* Function for finding and opening either all MCA components, or the
* one that was specifically requested via a MCA parameter.
*/
int mca_base_framework_components_open (mca_base_framework_t *framework,
mca_base_open_flag_t flags)
{
/* Open flags are not used at this time. Suppress compiler warning. */
if (flags & MCA_BASE_OPEN_FIND_COMPONENTS) {
/* Find and load requested components */
int ret = mca_base_component_find(NULL, framework->framework_name,
framework->framework_static_components,
framework->framework_selection,
&framework->framework_components, true);
if (OPAL_SUCCESS != ret) {
return ret;
}
}
/* Open all registered components */
return open_components (framework);
}
int mca_base_components_open (const char *type_name, int output_id,
const mca_base_component_t **static_components,
opal_list_t *components_available,
bool open_dso_components)
{
int ret, param;
/* create a dummy framework -- this leaks -- i know -- but it is temporary */
mca_base_register_flag_t register_flags;
mca_base_framework_t *dummy_framework;
opal_list_item_t *item;
opal_list_t components_found;
char **requested_component_names;
int param_verbose = -1;
int param_type = -1;
int verbose_level;
char *str;
bool include_mode;
#if (OPAL_ENABLE_FT == 1) && (OPAL_ENABLE_FT_CR == 1)
opal_list_item_t *next;
uint32_t open_only_flags = MCA_BASE_METADATA_PARAM_NONE;
const mca_base_component_t *component;
#endif
int ret;
/* Register MCA parameters */
/* Check to see if it exists first */
if( 0 > (param_type = mca_base_param_find(type_name, NULL, NULL) ) ) {
asprintf(&str, "Default selection set of components for the %s framework (<none>"
" means use all components that can be found)", type_name);
param_type =
mca_base_param_reg_string_name(type_name, NULL, str,
false, false, NULL, NULL);
free(str);
dummy_framework = calloc (1, sizeof(*dummy_framework));
dummy_framework->framework_static_components = static_components;
dummy_framework->framework_output = output_id;
dummy_framework->framework_name = strdup(type_name);
if (open_dso_components) {
register_flags = MCA_BASE_REGISTER_STATIC_ONLY;
} else {
register_flags = MCA_BASE_REGISTER_DEFAULT;
}
param = mca_base_param_find("mca", NULL, "component_show_load_errors");
mca_base_param_lookup_int(param, &ret);
show_errors = OPAL_INT_TO_BOOL(ret);
/* Setup verbosity for this MCA type */
asprintf(&str, "Verbosity level for the %s framework (0 = no verbosity)", type_name);
param_verbose =
mca_base_param_reg_int_name(type_name, "base_verbose",
str, false, false, 0, NULL);
free(str);
mca_base_param_lookup_int(param_verbose, &verbose_level);
if (output_id != 0) {
opal_output_set_verbosity(output_id, verbose_level);
}
opal_output_verbose(10, output_id,
"mca: base: components_open: Looking for %s components",
type_name);
ret = parse_requested(param_type, &include_mode, &requested_component_names);
ret = mca_base_framework_components_register (dummy_framework, register_flags);
if (OPAL_SUCCESS != ret) {
free (dummy_framework);
return ret;
}
/* Find and load requested components */
if (OPAL_SUCCESS != (ret =
mca_base_component_find(NULL, type_name, static_components,
requested_component_names, include_mode,
&components_found, open_dso_components)) ) {
ret = mca_base_framework_components_open (dummy_framework, 0);
if (OPAL_SUCCESS != ret) {
(void) mca_base_framework_components_close (dummy_framework, NULL);
free (dummy_framework);
return ret;
}
#if (OPAL_ENABLE_FT == 1) && (OPAL_ENABLE_FT_CR == 1)
{
int param_id = -1;
int param_val = 0;
OBJ_CONSTRUCT(components_available, opal_list_t);
while (NULL != (item = opal_list_remove_first(&dummy_framework->framework_components))) {
opal_list_append(components_available, item);
}
OBJ_DESTRUCT(&dummy_framework->framework_components);
return OPAL_SUCCESS;
}
/*
* Extract supported mca parameters for selection contraints
* Supported Options:
* - mca_base_component_distill_checkpoint_ready = Checkpoint Ready
* Traverse the entire list of found components (a list of
* mca_base_component_t instances). If the requested_component_names
* array is empty, or the name of each component in the list of found
* components is in the requested_components_array, try to open it.
* If it opens, add it to the components_available list.
*/
param_id = mca_base_param_reg_int_name("mca", "base_component_distill_checkpoint_ready",
"Distill only those components that are Checkpoint Ready",
false, false,
0, &param_val);
if( 0 != param_val ) { /* Select Checkpoint Ready */
open_only_flags |= MCA_BASE_METADATA_PARAM_CHECKPOINT;
}
}
#endif /* (OPAL_ENABLE_FT == 1) && (OPAL_ENABLE_FT_CR == 1) */
static int open_components(mca_base_framework_t *framework)
{
opal_list_t *components = &framework->framework_components;
uint32_t open_only_flags = MCA_BASE_METADATA_PARAM_NONE;
int output_id = framework->framework_output;
mca_base_component_list_item_t *cli, *next;
int ret;
/*
* Pre-process the list with parameter constraints
@ -161,277 +137,48 @@ int mca_base_components_open(const char *type_name, int output_id,
* functionality. If other component constraint options are
* added, then this logic can be used for all contraint
* options.
*
* NTH: Logic moved to mca_base_components_filter.
*/
#if (OPAL_ENABLE_FT == 1) && (OPAL_ENABLE_FT_CR == 1)
if( !(MCA_BASE_METADATA_PARAM_NONE & open_only_flags) ) {
if( MCA_BASE_METADATA_PARAM_CHECKPOINT & open_only_flags) {
opal_output_verbose(10, output_id,
"mca: base: components_open: "
"including only %s components that are checkpoint enabled", type_name);
}
/*
* Check all the components to make sure they adhere to the user
* expressed requirements.
*/
for(item = opal_list_get_first(&components_found);
item != opal_list_get_end(&components_found);
item = next ) {
mca_base_open_only_dummy_component_t *dummy;
mca_base_component_list_item_t *cli = (mca_base_component_list_item_t *) item;
dummy = (mca_base_open_only_dummy_component_t*) cli->cli_component;
component = cli->cli_component;
next = opal_list_get_next(item);
/*
* If the user asked for a checkpoint enabled run
* then only load checkpoint enabled components.
*/
if( MCA_BASE_METADATA_PARAM_CHECKPOINT & open_only_flags) {
if( MCA_BASE_METADATA_PARAM_CHECKPOINT & dummy->data.param_field) {
opal_output_verbose(10, output_id,
"mca: base: components_open: "
"(%s) Component %s is Checkpointable",
type_name,
dummy->version.mca_component_name);
}
else {
opal_output_verbose(10, output_id,
"mca: base: components_open: "
"(%s) Component %s is *NOT* Checkpointable - Disabled",
type_name,
dummy->version.mca_component_name);
opal_list_remove_item(&components_found, item);
/* Make sure to release the component since we are not
* opening it */
mca_base_component_repository_release(component);
}
}
}
if (mca_base_component_distill_checkpoint_ready) {
open_only_flags |= MCA_BASE_METADATA_PARAM_CHECKPOINT;
}
#endif /* (OPAL_ENABLE_FT == 1) && (OPAL_ENABLE_FT_CR == 1) */
/* Open all remaining components */
ret = open_components(type_name, output_id,
&components_found, components_available);
/* Free resources */
for (item = opal_list_remove_first(&components_found); NULL != item;
item = opal_list_remove_first(&components_found)) {
OBJ_RELEASE(item);
}
OBJ_DESTRUCT(&components_found);
if (NULL != requested_component_names) {
opal_argv_free(requested_component_names);
}
/* All done */
/* If mca_base_framework_register_components was called with the MCA_BASE_COMPONENTS_ALL flag
we need to trim down and close any extra components we do not want open */
ret = mca_base_components_filter (framework->framework_name, &framework->framework_components,
framework->framework_output, framework->framework_selection,
open_only_flags);
if (OPAL_SUCCESS != ret) {
return ret;
}
int mca_base_is_component_required(opal_list_t *components_available,
mca_base_component_t *component,
bool exclusive,
bool *is_required)
{
opal_list_item_t *item = NULL;
mca_base_component_list_item_t *cli = NULL;
mca_base_component_t *comp = NULL;
/* Sanity check */
if( NULL == components_available ||
NULL == component) {
return OPAL_ERR_BAD_PARAM;
}
*is_required = false;
/*
* Look through the components available for opening
*/
if( exclusive ) {
/* Must be the -only- component in the list */
if( 1 == opal_list_get_size(components_available) ) {
item = opal_list_get_first(components_available);
cli = (mca_base_component_list_item_t *) item;
comp = (mca_base_component_t *) cli->cli_component;
if( 0 == strncmp(comp->mca_component_name,
component->mca_component_name,
strlen(component->mca_component_name)) ) {
*is_required = true;
return OPAL_SUCCESS;
}
}
}
else {
/* Must be one of the components in the list */
for (item = opal_list_get_first(components_available);
item != opal_list_get_end(components_available);
item = opal_list_get_next(item) ) {
cli = (mca_base_component_list_item_t *) item;
comp = (mca_base_component_t *) cli->cli_component;
if( 0 == strncmp(comp->mca_component_name,
component->mca_component_name,
strlen(component->mca_component_name)) ) {
*is_required = true;
return OPAL_SUCCESS;
}
}
}
return OPAL_SUCCESS;
}
static int parse_requested(int mca_param, bool *include_mode,
char ***requested_component_names)
{
int i;
char *requested, *requested_orig;
*requested_component_names = NULL;
*include_mode = true;
/* See if the user requested anything */
if (0 > mca_base_param_lookup_string(mca_param, &requested)) {
return OPAL_ERROR;
}
if (NULL == requested || 0 == strlen(requested)) {
return OPAL_SUCCESS;
}
requested_orig = requested;
/* Are we including or excluding? We only allow the negate
character to be the *first* character of the value (but be nice
and allow any number of negate characters in the beginning). */
while (negate == requested[0] && '\0' != requested[0]) {
*include_mode = false;
++requested;
}
/* Double check to ensure that the user did not specify the negate
character anywhere else in the value. */
i = 0;
while ('\0' != requested[i]) {
if (negate == requested[i]) {
opal_show_help("help-mca-base.txt",
"framework-param:too-many-negates",
true, requested_orig);
free(requested_orig);
return OPAL_ERROR;
}
++i;
}
/* Split up the value into individual component names */
*requested_component_names = opal_argv_split(requested, ',');
/* All done */
free(requested_orig);
return OPAL_SUCCESS;
}
/*
* Traverse the entire list of found components (a list of
* mca_base_component_t instances). If the requested_component_names
* array is empty, or the name of each component in the list of found
* components is in the requested_components_array, try to open it.
* If it opens, add it to the components_available list.
*/
static int open_components(const char *type_name, int output_id,
opal_list_t *src, opal_list_t *dest)
{
int ret;
opal_list_item_t *item;
const mca_base_component_t *component;
mca_base_component_list_item_t *cli;
bool called_open;
bool opened;
/* Announce */
opal_output_verbose(10, output_id,
"mca: base: components_open: opening %s components",
type_name);
framework->framework_name);
/* Traverse the list of found components */
/* Traverse the list of components */
OPAL_LIST_FOREACH_SAFE(cli, next, components, mca_base_component_list_item_t) {
const mca_base_component_t *component = cli->cli_component;
OBJ_CONSTRUCT(dest, opal_list_t);
for (item = opal_list_get_first(src);
opal_list_get_end(src) != item;
item = opal_list_get_next(item)) {
cli = (mca_base_component_list_item_t *) item;
component = cli->cli_component;
opened = called_open = false;
opal_output_verbose(10, output_id,
"mca: base: components_open: found loaded component %s",
component->mca_component_name);
/* Call the component's MCA parameter registration function */
if (NULL == component->mca_register_component_params) {
opal_output_verbose(10, output_id,
"mca: base: components_open: "
"component %s has no register function",
component->mca_component_name);
} else {
ret = component->mca_register_component_params();
if (OPAL_SUCCESS == ret) {
opal_output_verbose(10, output_id,
"mca: base: components_open: "
"component %s register function successful",
component->mca_component_name);
} else if (OPAL_ERR_NOT_AVAILABLE != ret) {
/* If the component returns OPAL_ERR_NOT_AVAILABLE,
it's a cue to "silently ignore me" -- it's not a
failure, it's just a way for the component to say
"nope!".
Otherwise, however, display an error. We may end
up displaying this twice, but it may go to separate
streams. So better to be redundant than to not
display the error in the stream where it was
expected. */
if (show_errors) {
opal_output(0, "mca: base: components_open: "
"component %s / %s register function failed",
component->mca_type_name,
component->mca_component_name);
}
opal_output_verbose(10, output_id,
"mca: base: components_open: "
"component %s register function failed",
component->mca_component_name);
}
}
if (NULL == component->mca_open_component) {
opened = true;
opal_output_verbose(10, output_id,
"mca: base: components_open: "
"component %s has no open function",
component->mca_component_name);
} else {
called_open = true;
if (NULL != component->mca_open_component) {
/* Call open if register didn't call it already */
ret = component->mca_open_component();
if (OPAL_SUCCESS == ret) {
opened = true;
opal_output_verbose(10, output_id,
"mca: base: components_open: "
"component %s open function successful",
component->mca_component_name);
} else if (OPAL_ERR_NOT_AVAILABLE != ret) {
} else {
if (OPAL_ERR_NOT_AVAILABLE != ret) {
/* If the component returns OPAL_ERR_NOT_AVAILABLE,
it's a cue to "silently ignore me" -- it's not a
failure, it's just a way for the component to say
@ -443,7 +190,7 @@ static int open_components(const char *type_name, int output_id,
display the error in the stream where it was
expected. */
if (show_errors) {
if (mca_base_component_show_load_errors) {
opal_output(0, "mca: base: components_open: "
"component %s / %s open function failed",
component->mca_type_name,
@ -454,23 +201,13 @@ static int open_components(const char *type_name, int output_id,
"component %s open function failed",
component->mca_component_name);
}
mca_base_component_close (component, output_id);
opal_list_remove_item (components, &cli->super);
OBJ_RELEASE(cli);
}
/* If it didn't open, close it out and get rid of it */
if (!opened) {
mca_base_component_release (output_id, component, called_open);
continue;
}
/* Not all components register a priority. Do not register one here. */
cli = OBJ_NEW(mca_base_component_list_item_t);
if (NULL == cli) {
return OPAL_ERR_OUT_OF_RESOURCE;
}
cli->cli_component = component;
opal_list_append(dest, (opal_list_item_t *) cli);
}
/* All done */

178
opal/mca/base/mca_base_components_register.c Обычный файл
Просмотреть файл

@ -0,0 +1,178 @@
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
/*
* Copyright (c) 2004-2008 The Trustees of Indiana University and Indiana
* University Research and Technology
* Corporation. All rights reserved.
* Copyright (c) 2004-2012 The University of Tennessee and The University
* of Tennessee Research Foundation. All rights
* reserved.
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2008-2012 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2011-2013 Los Alamos National Security, LLC.
* All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
#include "opal_config.h"
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include "opal/class/opal_list.h"
#include "opal/util/argv.h"
#include "opal/util/output.h"
#include "opal/util/show_help.h"
#include "opal/mca/mca.h"
#include "opal/mca/base/base.h"
#include "opal/mca/base/mca_base_framework.h"
#include "opal/mca/base/mca_base_component_repository.h"
#include "opal/constants.h"
/*
* Local functions
*/
static int register_components(const char *project_name, const char *type_name,
int output_id, opal_list_t *src, opal_list_t *dest);
/**
* Function for finding and opening either all MCA components, or the
* one that was specifically requested via a MCA parameter.
*/
int mca_base_framework_components_register (mca_base_framework_t *framework,
mca_base_register_flag_t flags)
{
bool open_dso_components = !(flags & MCA_BASE_REGISTER_STATIC_ONLY);
bool ignore_requested = !!(flags & MCA_BASE_REGISTER_ALL);
opal_list_t components_found;
int ret;
/* Find and load requested components */
ret = mca_base_component_find(NULL, framework->framework_name,
framework->framework_static_components,
ignore_requested ? NULL : framework->framework_selection,
&components_found, open_dso_components);
if (OPAL_SUCCESS != ret) {
return ret;
}
/* Register all remaining components */
ret = register_components(framework->framework_project, framework->framework_name,
framework->framework_output, &components_found,
&framework->framework_components);
OBJ_DESTRUCT(&components_found);
/* All done */
return ret;
}
/*
* Traverse the entire list of found components (a list of
* mca_base_component_t instances). If the requested_component_names
* array is empty, or the name of each component in the list of found
* components is in the requested_components_array, try to open it.
* If it opens, add it to the components_available list.
*/
static int register_components(const char *project_name, const char *type_name,
int output_id, opal_list_t *src, opal_list_t *dest)
{
int ret;
opal_list_item_t *item;
mca_base_component_t *component;
mca_base_component_list_item_t *cli;
/* Announce */
opal_output_verbose(10, output_id,
"mca: base: components_register: registering %s components",
type_name);
/* Traverse the list of found components */
OBJ_CONSTRUCT(dest, opal_list_t);
while (NULL != (item = opal_list_remove_first (src))) {
cli = (mca_base_component_list_item_t *) item;
component = (mca_base_component_t *)cli->cli_component;
opal_output_verbose(10, output_id,
"mca: base: components_register: found loaded component %s",
component->mca_component_name);
/* Call the component's MCA parameter registration function (or open if register doesn't exist) */
if (NULL == component->mca_register_component_params) {
opal_output_verbose(10, output_id,
"mca: base: components_register: "
"component %s has no register or open function",
component->mca_component_name);
ret = OPAL_SUCCESS;
} else {
ret = component->mca_register_component_params();
}
if (OPAL_SUCCESS != ret) {
if (OPAL_ERR_NOT_AVAILABLE != ret) {
/* If the component returns OPAL_ERR_NOT_AVAILABLE,
it's a cue to "silently ignore me" -- it's not a
failure, it's just a way for the component to say
"nope!".
Otherwise, however, display an error. We may end
up displaying this twice, but it may go to separate
streams. So better to be redundant than to not
display the error in the stream where it was
expected. */
if (mca_base_component_show_load_errors) {
opal_output(0, "mca: base: components_register: "
"component %s / %s register function failed",
component->mca_type_name,
component->mca_component_name);
}
opal_output_verbose(10, output_id,
"mca: base: components_register: "
"component %s register function failed",
component->mca_component_name);
}
mca_base_component_close (component, output_id);
/* Release this list item */
OBJ_RELEASE(cli);
continue;
}
if (NULL != component->mca_register_component_params) {
opal_output_verbose (10, output_id, "mca: base: components_register: "
"component %s register function successful",
component->mca_component_name);
}
/* Register this component's version */
mca_base_var_register (project_name, type_name, component->mca_component_name, "major_version",
NULL, MCA_BASE_VAR_TYPE_INT, NULL, 0, MCA_BASE_VAR_FLAG_DEFAULT_ONLY |
MCA_BASE_VAR_FLAG_INTERNAL, OPAL_INFO_LVL_9, MCA_BASE_VAR_SCOPE_CONSTANT,
&component->mca_component_major_version);
mca_base_var_register (project_name, type_name, component->mca_component_name, "minor_version",
NULL, MCA_BASE_VAR_TYPE_INT, NULL, 0, MCA_BASE_VAR_FLAG_DEFAULT_ONLY |
MCA_BASE_VAR_FLAG_INTERNAL, OPAL_INFO_LVL_9, MCA_BASE_VAR_SCOPE_CONSTANT,
&component->mca_component_minor_version);
mca_base_var_register (project_name, type_name, component->mca_component_name, "release_version",
NULL, MCA_BASE_VAR_TYPE_INT, NULL, 0, MCA_BASE_VAR_FLAG_DEFAULT_ONLY |
MCA_BASE_VAR_FLAG_INTERNAL, OPAL_INFO_LVL_9, MCA_BASE_VAR_SCOPE_CONSTANT,
&component->mca_component_release_version);
opal_list_append(dest, item);
}
/* All done */
return OPAL_SUCCESS;
}

201
opal/mca/base/mca_base_framework.c Обычный файл
Просмотреть файл

@ -0,0 +1,201 @@
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
/*
* Copyright (c) 2012-2013 Los Alamos National Security, LLC. All rights
* reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
#include "opal/include/opal_config.h"
#include "opal/include/opal/constants.h"
#include "mca_base_framework.h"
#include "mca_base_var.h"
#include "opal/mca/base/base.h"
static bool framework_is_registered (struct mca_base_framework_t *framework)
{
return !!(framework->framework_flags & MCA_BASE_FRAMEWORK_FLAG_REGISTERED);
}
static void framework_open_output (struct mca_base_framework_t *framework)
{
if (0 < framework->framework_verbose) {
if (-1 == framework->framework_output) {
framework->framework_output = opal_output_open (NULL);
}
opal_output_set_verbosity(framework->framework_output,
framework->framework_verbose);
} else if (-1 != framework->framework_output) {
opal_output_close (framework->framework_output);
framework->framework_output = -1;
}
}
static void framework_close_output (struct mca_base_framework_t *framework)
{
if (-1 != framework->framework_output) {
opal_output_close (framework->framework_output);
framework->framework_output = -1;
}
}
int mca_base_framework_register (struct mca_base_framework_t *framework,
mca_base_register_flag_t flags)
{
char *desc;
int ret;
assert (NULL != framework);
if (framework_is_registered (framework)) {
return OPAL_SUCCESS;
}
if (!(MCA_BASE_FRAMEWORK_FLAG_NOREGISTER & framework->framework_flags)) {
/* register this framework with the MCA variable system */
ret = mca_base_var_group_register (framework->framework_project,
framework->framework_name,
NULL, framework->framework_description);
if (0 > ret) {
return ret;
}
asprintf (&desc, "Default selection set of components for the %s framework (<none>"
" means use all components that can be found)", framework->framework_name);
ret = mca_base_var_register (framework->framework_project, framework->framework_name,
NULL, NULL, desc, MCA_BASE_VAR_TYPE_STRING, NULL, 0,
MCA_BASE_VAR_FLAG_SETTABLE, OPAL_INFO_LVL_2,
MCA_BASE_VAR_SCOPE_ALL_EQ, &framework->framework_selection);
free (desc);
if (0 > ret) {
return ret;
}
/* register a verbosity variable for this framework */
asprintf (&desc, "Verbosity level for the %s framework (0 = no verbosity)",
framework->framework_name);
ret = mca_base_framework_var_register (framework, "verbose", desc,
MCA_BASE_VAR_TYPE_INT, NULL, 0,
MCA_BASE_VAR_FLAG_SETTABLE,
OPAL_INFO_LVL_8,
MCA_BASE_VAR_SCOPE_LOCAL,
&framework->framework_verbose);
free(desc);
if (0 > ret) {
return ret;
}
/* check the initial verbosity and open the output if necessary. we
will recheck this on open */
framework_open_output (framework);
/* register framework variables */
if (NULL != framework->framework_register) {
ret = framework->framework_register (flags);
if (OPAL_SUCCESS != ret) {
return ret;
}
}
/* register components variables */
ret = mca_base_framework_components_register (framework, flags);
if (OPAL_SUCCESS != ret) {
return ret;
}
}
framework->framework_flags |= MCA_BASE_FRAMEWORK_FLAG_REGISTERED;
/* framework did not provide a register function */
return OPAL_SUCCESS;
}
int mca_base_framework_open (struct mca_base_framework_t *framework,
mca_base_open_flag_t flags) {
int ret;
assert (NULL != framework);
/* check if this framework is already open */
if (framework->framework_refcnt++) {
return OPAL_SUCCESS;
}
/* register this framework before opening it */
ret = mca_base_framework_register (framework, MCA_BASE_REGISTER_DEFAULT);
if (OPAL_SUCCESS != ret) {
return ret;
}
if (MCA_BASE_FRAMEWORK_FLAG_NOREGISTER & framework->framework_flags) {
flags |= MCA_BASE_OPEN_FIND_COMPONENTS;
}
/* lock all of this frameworks's variables */
ret = mca_base_var_group_find (framework->framework_project,
framework->framework_name,
NULL);
mca_base_var_group_set_var_flag (ret, MCA_BASE_VAR_FLAG_SETTABLE, false);
/* check the verbosity level and open (or close) the output */
framework_open_output (framework);
if (NULL != framework->framework_open) {
ret = framework->framework_open (flags);
} else {
ret = mca_base_framework_components_open (framework, flags);
}
if (OPAL_SUCCESS != ret) {
framework->framework_refcnt = 0;
}
return ret;
}
int mca_base_framework_close (struct mca_base_framework_t *framework) {
bool is_open = !!framework->framework_refcnt;
int ret, group_id;
assert (NULL != framework);
if (!framework_is_registered (framework) && 0 == framework->framework_refcnt) {
return OPAL_SUCCESS;
}
if (framework->framework_refcnt && --framework->framework_refcnt) {
return OPAL_SUCCESS;
}
/* find and deregister all component groups and variables */
group_id = mca_base_var_group_find (framework->framework_project,
framework->framework_name, NULL);
if (0 <= group_id) {
ret = mca_base_var_group_deregister (group_id);
framework->framework_flags &= ~MCA_BASE_FRAMEWORK_FLAG_REGISTERED;
}
/* close the framework and all of its components */
if (is_open) {
if (NULL != framework->framework_close) {
ret = framework->framework_close ();
} else {
ret = mca_base_framework_components_close (framework, NULL);
}
if (OPAL_SUCCESS != ret) {
return ret;
}
} else {
ret = OPAL_SUCCESS;
}
framework_close_output (framework);
return ret;
}

214
opal/mca/base/mca_base_framework.h Обычный файл
Просмотреть файл

@ -0,0 +1,214 @@
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
/*
* Copyright (c) 2012-2013 Los Alamos National Security, LLC. All rights
* reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
#if !defined(OPAL_MCA_BASE_FRAMEWORK_H)
#define OPAL_MCA_BASE_FRAMEWORK_H
#include "opal/mca/mca.h"
#include "opal/class/opal_list.h"
/*
* Register and open flags
*/
enum mca_base_register_flag_t {
MCA_BASE_REGISTER_DEFAULT = 0,
/** Register all components (ignore selection MCA variables) */
MCA_BASE_REGISTER_ALL = 1,
/** Do not register DSO components */
MCA_BASE_REGISTER_STATIC_ONLY = 2
};
typedef enum mca_base_register_flag_t mca_base_register_flag_t;
enum mca_base_open_flag_t {
MCA_BASE_OPEN_DEFAULT = 0,
/** Find components in mca_base_components_find. Used by
mca_base_framework_open() when NOREGISTER is specified
by the framework */
MCA_BASE_OPEN_FIND_COMPONENTS = 1,
};
typedef enum mca_base_open_flag_t mca_base_open_flag_t;
/**
* Register the MCA framework parameters
*
* @param[in] flags Registration flags (see mca/base/base.h)
*
* @retval OPAL_SUCCESS on success
* @retval opal error code on failure
*
* This function registers all framework MCA parameters. This
* function should not call mca_base_framework_components_register().
*
* Frameworks are NOT required to provide this function. It
* may be NULL.
*/
typedef int (*mca_base_framework_register_params_fn_t) (mca_base_register_flag_t flags);
/**
* Initialize the MCA framework
*
* @retval OPAL_SUCCESS Upon success
* @retval OPAL_ERROR Upon failure
*
* This must be the first function invoked in the MCA framework.
* It initializes the MCA framework, finds and opens components,
* populates the components list, etc.
*
* This function is invoked during opal_init() and during the
* initialization of the special case of the ompi_info command.
*
* This function fills in the components framework value, which
* is a list of all components that were successfully opened.
* This variable should \em only be used by other framework base
* functions or by ompi_info -- it is not considered a public
* interface member -- and is only mentioned here for completeness.
*
* Any resources allocated by this function must be freed
* in the framework close function.
*
* Frameworks are NOT required to provide this function. It may
* be NULL. If a framework does not provide an open function the
* default behavior of mca_base_framework_open() is to call
* mca_base_framework_components_open(). If a framework provides
* an open function it will need to call mca_base_framework_components_open()
* if it needs to open any components.
*/
typedef int (*mca_base_framework_open_fn_t) (mca_base_open_flag_t flags);
/**
* Shut down the MCA framework.
*
* @retval OPAL_SUCCESS Always
*
* This function should shut downs everything in the MCA
* framework, and is called during opal_finalize() and the
* special case of the ompi_info command.
*
* It must be the last function invoked on the MCA framework.
*
* Frameworks are NOT required to provide this function. It may
* be NULL. If a framework does not provide a close function the
* default behavior of mca_base_framework_close() is to call
* mca_base_framework_components_close(). If a framework provide
* a close function it will need to call mca_base_framework_components_close()
* if any components were opened.
*/
typedef int (*mca_base_framework_close_fn_t) (void);
typedef enum {
MCA_BASE_FRAMEWORK_FLAG_DEFAULT = 0,
/** Don't register any variables for this framework */
MCA_BASE_FRAMEWORK_FLAG_NOREGISTER = 1,
/** Internal. Don't set outside mca_base_framework.h */
MCA_BASE_FRAMEWORK_FLAG_REGISTERED = 2,
/**
* The upper 16 bits are reserved for project specific flags.
*/
} mca_base_framework_flags_t;
typedef struct mca_base_framework_t {
/** Project name for this component (ex "opal") */
char *framework_project;
/** Framework name */
char *framework_name;
/** Description of this framework or NULL */
const char *framework_description;
/** Framework register function or NULL if the framework
and all its components have nothing to register */
mca_base_framework_register_params_fn_t framework_register;
/** Framework open function or NULL */
mca_base_framework_open_fn_t framework_open;
/** Framework close function or NULL */
mca_base_framework_close_fn_t framework_close;
/** Framework flags (future use) set to 0 */
mca_base_framework_flags_t framework_flags;
/** Framework open count */
int framework_refcnt;
/** List of static components */
const mca_base_component_t **framework_static_components;
/** Component selection. This will be registered with the MCA
variable system and should be either NULL (all components) or
a heap allocated, comma-delimited list of components. */
char *framework_selection;
/** Verbosity level (0-100) */
int framework_verbose;
/** Opal output for this framework (or -1) */
int framework_output;
/** List of selected components (filled in by mca_base_framework_register()
or mca_base_framework_open() */
opal_list_t framework_components;
} mca_base_framework_t;
/**
* Register a framework with MCA.
*
* @param[in] framework framework to register
*
* @retval OPAL_SUCCESS Upon success
* @retval OPAL_ERROR Upon failure
*
* Call a framework's register function.
*/
OPAL_DECLSPEC int mca_base_framework_register (mca_base_framework_t *framework,
mca_base_register_flag_t flags);
/**
* Open a framework
*
* @param[in] framework framework to open
*
* @retval OPAL_SUCCESS Upon success
* @retval OPAL_ERROR Upon failure
*
* Call a framework's open function.
*/
OPAL_DECLSPEC int mca_base_framework_open (mca_base_framework_t *framework,
mca_base_open_flag_t flags);
/**
* Close a framework
*
* @param[in] framework framework to close
*
* @retval OPAL_SUCCESS Upon success
* @retval OPAL_ERROR Upon failure
*
* Call a framework's close function.
*/
OPAL_DECLSPEC int mca_base_framework_close (mca_base_framework_t *framework);
/**
* Macro to declare an MCA framework
*
* Example:
* MCA_BASE_FRAMEWORK_DECLARE(opal, foo, NULL, opal_foo_open, opal_foo_close, MCA_BASE_FRAMEWORK_FLAG_LAZY)
*/
#define MCA_BASE_FRAMEWORK_DECLARE(project, name, description, registerfn, openfn, closefn, static_components, flags) \
mca_base_framework_t project##_##name##_base_framework = { \
.framework_project = #project, \
.framework_name = #name, \
.framework_description = description, \
.framework_register = registerfn, \
.framework_open = openfn, \
.framework_close = closefn, \
.framework_flags = flags, \
.framework_refcnt = 0, \
.framework_static_components = static_components, \
.framework_selection = NULL, \
.framework_verbose = 0, \
.framework_output = -1}
#endif /* OPAL_MCA_BASE_FRAMEWORK_H */

Просмотреть файл

@ -526,6 +526,13 @@ int mca_base_var_group_deregister (int group_index)
params = OPAL_VALUE_ARRAY_GET_BASE(&group->group_vars, int);
for (i = 0 ; i < size ; ++i) {
mca_base_var_t *var;
ret = var_get(params[i], &var, false);
if (OPAL_SUCCESS != ret || !(var->mbv_flags & MCA_BASE_VAR_FLAG_DWG)) {
continue;
}
(void) mca_base_var_deregister (params[i]);
}
OBJ_DESTRUCT(&group->group_vars);
@ -1536,7 +1543,21 @@ int mca_base_component_var_register (const mca_base_component_t *component,
return mca_base_var_register (NULL, component->mca_type_name,
component->mca_component_name,
variable_name, description, type, enumerator,
bind, flags, info_lvl, scope, storage);
bind, flags | MCA_BASE_VAR_FLAG_DWG,
info_lvl, scope, storage);
}
int mca_base_framework_var_register (const mca_base_framework_t *framework,
const char *variable_name,
const char *help_msg, mca_base_var_type_t type,
mca_base_var_enum_t *enumerator, int bind,
mca_base_var_flag_t flags,
mca_base_var_info_lvl_t info_level,
mca_base_var_scope_t scope, void *storage)
{
return mca_base_var_register (framework->framework_project, framework->framework_name,
"base", variable_name, help_msg, type, enumerator, bind,
flags | MCA_BASE_VAR_FLAG_DWG, info_level, scope, storage);
}
int mca_base_var_register_synonym (int synonym_for, const char *project_name,

Просмотреть файл

@ -64,6 +64,7 @@
#include "opal/class/opal_list.h"
#include "opal/class/opal_value_array.h"
#include "opal/mca/base/mca_base_var_enum.h"
#include "opal/mca/base/mca_base_framework.h"
#include "opal/mca/mca.h"
/**
@ -169,7 +170,10 @@ typedef enum {
/** Variable has been overridden */
MCA_BASE_VAR_FLAG_OVERRIDE = 0x0010,
/** Variable may not be set from a file */
MCA_BASE_VAR_FLAG_ENVIRONMENT_ONLY = 0x0020
MCA_BASE_VAR_FLAG_ENVIRONMENT_ONLY = 0x0020,
/** Variable should be deregistered when the group
is deregistered */
MCA_BASE_VAR_FLAG_DWG = 0x0040
} mca_base_var_flag_t;
@ -514,6 +518,20 @@ OPAL_DECLSPEC int mca_base_component_var_register (const mca_base_component_t *c
mca_base_var_info_lvl_t info_lvl,
mca_base_var_scope_t scope, void *storage);
/**
* Convinience function for registering a variable associated with a framework. This
* function is equivalent to mca_base_var_register with component_name = "base" and
* with the MCA_BASE_VAR_FLAG_DWG set. See mca_base_var_register().
*/
OPAL_DECLSPEC int mca_base_framework_var_register (const mca_base_framework_t *framework,
const char *variable_name,
const char *help_msg, mca_base_var_type_t type,
mca_base_var_enum_t *enumerator, int bind,
mca_base_var_flag_t flags,
mca_base_var_info_lvl_t info_level,
mca_base_var_scope_t scope, void *storage);
/**
* Register a synonym name for an MCA variable.
*