1
1

* results from initial merge of the tim branch into the trunk. Compiles and

ompi_info works, but that's all that has been tested.

This commit was SVN r4827.
Этот коммит содержится в:
Brian Barrett 2005-03-14 20:57:21 +00:00
родитель 97cb8ac2fe
Коммит 6822a519bb
653 изменённых файлов: 46058 добавлений и 31365 удалений

864
RTE_MERGE_README Обычный файл
Просмотреть файл

@ -0,0 +1,864 @@
This file contains information on merging the branches/tim tree into the
trunk.
INITIAL MERGE:
svn merge -r3853:4821 svn+ssh://svn.open-mpi.org/l/svn/ompi/branches/tim .
CONFLICTS FROM INITIAL MERGE:
C src/event/event.c RESOLVED, BWB
C src/dynamic-mca/Makefile.am RESOLVED, BWB
C src/include/Makefile.am RESOLVED, BWB
C src/runtime/ompi_progress.c RESOLVED, BWB
C src/mpi/runtime/ompi_mpi_init.c RESOLVED, BWB
C src/threads/condition.h RESOLVED, BWB
C src/tools/console/Makefile.am RESOLVED, BWB
C src/tools/wrappers/Makefile.am RESOLVED, BWB
C src/tools/Makefile.am RESOLVED, BWB
C src/mca/oob/oob.h RESOLVED, BWB
C src/mca/oob/tcp/oob_tcp.c RESOLVED, BWB
C src/mca/oob/tcp/oob_tcp_msg.c RESOLVED, BWB
C src/mca/oob/base/base.h RESOLVED, BWB
C src/mca/ns/replica/src/ns_replica.c RESOLVED, BWB
C src/mca/ns/replica/src/ns_replica_component.c RESOLVED, BWB
C src/mca/ns/replica/src/ns_replica.h RESOLVED, BWB
C src/mca/ns/proxy/src/ns_proxy.c RESOLVED, BWB
C src/mca/ns/proxy/src/ns_proxy_component.c RESOLVED, BWB
C src/mca/ns/proxy/src/ns_proxy.h RESOLVED, BWB
C src/mca/ns/ns.h RESOLVED, BWB
C src/mca/ns/base/base.h RESOLVED, BWB
C src/mca/ns/base/ns_base_local_fns.c RESOLVED, BWB
C src/mca/ns/base/ns_base_open.c RESOLVED, BWB
C src/mca/gpr/replica/gpr_replica.h RESOLVED, BWB
C src/mca/gpr/proxy/gpr_proxy.h RESOLVED, BWB
C src/mca/gpr/proxy/gpr_proxy_compound_cmd.c RESOLVED, BWB
C src/mca/gpr/base/base.h RESOLVED, BWB
C src/mca/ptl/gm/src/ptl_gm.h RESOLVED, BWB
C src/mca/io/base/io_base_component_list.c RESOLVED, BWB
C src/mca/Makefile.am RESOLVED, BWB
C src/mca/base/mca_base_param.c RESOLVED, BWB
C src/mca/base/mca_base_param.h RESOLVED, BWB
C src/communicator/comm_publish.c RESOLVED, BWB
C src/communicator/comm_dyn.c RESOLVED, BWB
C src/communicator/communicator.h RESOLVED, BWB
C src/Makefile.am RESOLVED, BWB
C configure.ac RESOLVED, BWB
C config/ompi_mca.m4 RESOLVED, BWB
CHANGES AFTER RESOLUTION FROM INITIAL MERGE:
M .
M test/mca/ns/test_ns_replica.c
M test/mca/gpr
A + test/mca/gpr/gpr_test_trigs.c
A + test/mca/gpr/gpr_test.c
M test/mca/gpr/Makefile.am
A + test/mca/gpr/gpr_test_proxy.c
A + test/mca/rds
A + test/mca/rds/test_rds_resfile.c
A + test/mca/rds/Makefile.am
A + test/runtime
A + test/runtime/parse_context.c
A + test/runtime/Makefile.am
A + test/plsnds
A + test/plsnds/plsnds_test.c
A + test/plsnds/Makefile.am
A + test/dps
A + test/dps/dps_test.c
A + test/dps/Makefile.am
A + include/orte_config.h
A RTE_MERGE_README
M src/event/signal.c
M src/event/event.c
M src/event/event.h
D src/dynamic-mca/pcm
D src/dynamic-mca/pcm/Makefile.am
D src/dynamic-mca/one
D src/dynamic-mca/one/Makefile.am
A + src/dynamic-mca/rmaps
A + src/dynamic-mca/rmaps/Makefile.am
D src/dynamic-mca/llm
D src/dynamic-mca/llm/Makefile.am
A + src/dynamic-mca/ras
A + src/dynamic-mca/ras/Makefile.am
A + src/dynamic-mca/rds
A + src/dynamic-mca/rds/Makefile.am
A + src/dynamic-mca/rml
A + src/dynamic-mca/rml/Makefile.am
D src/dynamic-mca/svc
D src/dynamic-mca/svc/Makefile.am
A + src/dynamic-mca/pls
A + src/dynamic-mca/pls/Makefile.am
A + src/dynamic-mca/rmgr
A + src/dynamic-mca/rmgr/Makefile.am
M src/dynamic-mca/Makefile.am
D src/dynamic-mca/pcmclient
D src/dynamic-mca/pcmclient/Makefile.am
D src/runtime/ompi_rte_finalize.c
A + src/runtime/orte_abort.c
A + src/runtime/orte_wait.h
D src/runtime/ompi_rte_parse_environ.c
D src/runtime/ompi_rte_init_cleanup.c
M src/runtime/runtime_types.h
D src/runtime/ompi_rte_pcm.c
A + src/runtime/orte_restart.c
A + src/runtime/orte_monitor.c
D src/runtime/ompi_rte_vm_status.c
M src/runtime/runtime_internal.h
D src/runtime/ompi_rte_wait_startup_shutdown_msg.c
D src/runtime/ompi_rte_monitor.c
D src/runtime/ompi_init.c
M src/runtime/runtime.h
M src/runtime/ompi_progress.c
A + src/runtime/orte_finalize.c
M src/runtime/ompi_progress.h
D src/runtime/universe_exists.c
D src/runtime/ompi_rte_init.c
D src/runtime/ompi_rte_wait.c
D src/runtime/ompi_rte_parse_cmd_line.c
D src/runtime/ompi_rte_job_shutdown.c
D src/runtime/ompi_rte_wait.h
D src/runtime/ompi_rte_process_status.c
D src/runtime/ompi_rte_llm.c
D src/runtime/ompi_rte_parse_daemon_cmd_line.c
D src/runtime/ompi_finalize.c
A + src/runtime/orte_universe_exists.c
M src/runtime/Makefile.am
D src/runtime/ompi_rte_cmd_line_setup.c
A + src/runtime/orte_schema.c
D src/runtime/ompi_rte_job_startup.c
D src/runtime/ompi_abort.c
A + src/runtime/orte_init.c
A + src/runtime/orte_wait.c
A + src/include/orte_schema.h
M src/include/constants.h
A + src/include/orte_types.h
M src/include/Makefile.am
A + src/include/orte_constants.h
M src/mpi/c/comm_accept.c
M src/mpi/c/comm_spawn_multiple.c
M src/mpi/c/comm_join.c
M src/mpi/c/comm_spawn.c
M src/mpi/c/comm_connect.c
M src/mpi/runtime/ompi_mpi_abort.c
M src/mpi/runtime/Makefile.am
M src/mpi/runtime/ompi_mpi_finalize.c
M src/mpi/runtime/ompi_mpi_init.c
M src/mpi/runtime/ompi_mpi_params.c
A + src/dps
A + src/dps/dps_types.h
A + src/dps/dps_pack.c
A + src/dps/orte_dps_open_close.c
A + src/dps/dps_load_unload.c
A + src/dps/dps_internal.h
A + src/dps/dps_unpack.c
A + src/dps/Makefile.am
A + src/dps/dps_internal_functions.c
A + src/dps/dps_peek.c
A + src/dps/dps.h
A + src/threads/condition.c
M src/threads/Makefile.am
M src/threads/condition.h
M src/threads/condition_spinlock.h
D src/mca/pcm
D src/mca/pcm/rms
D src/mca/pcm/rms/configure.params
D src/mca/pcm/rms/.ompi_ignore
D src/mca/pcm/rms/src
D src/mca/pcm/rms/src/help-mca-pcm-rms.txt
D src/mca/pcm/rms/src/pcm_rms.c
D src/mca/pcm/rms/src/pcm_rms_component.c
D src/mca/pcm/rms/src/pcm_rms.h
D src/mca/pcm/rms/src/Makefile.am
D src/mca/pcm/rms/Makefile.am
D src/mca/pcm/rms/configure.stub
D src/mca/pcm/slurm
D src/mca/pcm/slurm/configure.params
D src/mca/pcm/slurm/.ompi_ignore
D src/mca/pcm/slurm/src
D src/mca/pcm/slurm/src/pcm_slurm.c
D src/mca/pcm/slurm/src/pcm_slurm_component.c
D src/mca/pcm/slurm/src/pcm_slurm.h
D src/mca/pcm/slurm/src/Makefile.am
D src/mca/pcm/slurm/Makefile.am
D src/mca/pcm/slurm/configure.stub
D src/mca/pcm/bproc
D src/mca/pcm/bproc/configure.params
D src/mca/pcm/bproc/.ompi_ignore
D src/mca/pcm/bproc/src
D src/mca/pcm/bproc/src/pcm_bproc_control.c
D src/mca/pcm/bproc/src/pcm_bproc_component.c
D src/mca/pcm/bproc/src/pcm_bproc_allocate.c
D src/mca/pcm/bproc/src/Makefile.am
D src/mca/pcm/bproc/src/pcm_bproc.h
D src/mca/pcm/bproc/src/pcm_bproc_monitor.c
D src/mca/pcm/bproc/src/pcm_bproc_spawn.c
D src/mca/pcm/bproc/Makefile.am
D src/mca/pcm/bproc/configure.stub
D src/mca/pcm/pcm.h
D src/mca/pcm/ompid
D src/mca/pcm/ompid/configure.params
D src/mca/pcm/ompid/pcm_ompid.c
D src/mca/pcm/ompid/Makefile.am
D src/mca/pcm/ompid/pcm_ompid_component.c
D src/mca/pcm/ompid/pcm_ompid.h
D src/mca/pcm/Makefile.am
D src/mca/pcm/base
D src/mca/pcm/base/pcm_base_close.c
D src/mca/pcm/base/base_kill_track.h
D src/mca/pcm/base/pcm_base_data_store.c
D src/mca/pcm/base/base.h
D src/mca/pcm/base/pcm_base_comm.c
D src/mca/pcm/base/base_data_store.h
D src/mca/pcm/base/pcm_base_util.c
D src/mca/pcm/base/pcm_base_kill_track.c
D src/mca/pcm/base/pcm_base_select.c
D src/mca/pcm/base/Makefile.am
D src/mca/pcm/base/pcm_base_open.c
D src/mca/pcm/rsh
D src/mca/pcm/rsh/pcm_rsh_allocate.c
D src/mca/pcm/rsh/pcm_rsh.h
D src/mca/pcm/rsh/configure.params
D src/mca/pcm/rsh/pcm_rsh_spawn.c
D src/mca/pcm/rsh/pcm_rsh_kill.c
D src/mca/pcm/rsh/Makefile.am
D src/mca/pcm/rsh/help-mca-pcm-rsh.txt
D src/mca/pcm/rsh/pcm_rsh_component.c
D src/mca/pcm/rsh/pcm_rsh_ioexecvp.c
D src/mca/pcm/wmi
D src/mca/pcm/wmi/configure.params
D src/mca/pcm/wmi/.ompi_ignore
D src/mca/pcm/wmi/src
D src/mca/pcm/wmi/src/pcm_wmi.h
D src/mca/pcm/wmi/src/Makefile.am
D src/mca/pcm/wmi/src/pcm_wmi.c
D src/mca/pcm/wmi/src/pcm_wmi_component.c
D src/mca/pcm/wmi/Makefile.am
D src/mca/pcm/wmi/configure.stub
M src/mca/oob/oob.h
M src/mca/oob/tcp/oob_tcp_send.c
M src/mca/oob/tcp/oob_tcp_addr.c
M src/mca/oob/tcp/oob_tcp_peer.c
M src/mca/oob/tcp/oob_tcp_msg.h
M src/mca/oob/tcp/oob_tcp_ping.c
M src/mca/oob/tcp/oob_tcp_addr.h
M src/mca/oob/tcp/oob_tcp_recv.c
M src/mca/oob/tcp/oob_tcp.c
M src/mca/oob/tcp/oob_tcp_peer.h
M src/mca/oob/tcp/oob_tcp_hdr.h
M src/mca/oob/tcp/oob_tcp.h
M src/mca/oob/tcp/oob_tcp_msg.c
A + src/mca/oob/oob_types.h
M src/mca/oob/base/base.h
M src/mca/oob/base/oob_base_barrier.c
M src/mca/oob/base/oob_base_send_nb.c
M src/mca/oob/base/oob_base_send.c
M src/mca/oob/base/oob_base_ping.c
M src/mca/oob/base/oob_base_recv_nb.c
M src/mca/oob/base/oob_base_recv.c
M src/mca/oob/base/oob_base_xcast.c
M src/mca/oob/base/oob_base_init.c
M src/mca/ns/replica/src/ns_replica.c
M src/mca/ns/replica/src/ns_replica_component.c
M src/mca/ns/replica/src/ns_replica.h
M src/mca/ns/proxy/src/ns_proxy.c
M src/mca/ns/proxy/src/ns_proxy_component.c
M src/mca/ns/proxy/src/ns_proxy.h
M src/mca/ns/ns.h
M src/mca/ns/Makefile.am
A + src/mca/ns/base/ns_base_nds.c
M src/mca/ns/base/base.h
M src/mca/ns/base/ns_base_close.c
A + src/mca/ns/base/ns_base_nds.h
A + src/mca/ns/base/ns_base_nds_env.c
M src/mca/ns/base/Makefile.am
M src/mca/ns/base/ns_base_select.c
M src/mca/ns/base/ns_base_local_fns.c
M src/mca/ns/base/ns_base_open.c
A + src/mca/ns/base/ns_base_nds_pipe.c
A + src/mca/ns/ns_types.h
D src/mca/one
D src/mca/one/one.h
D src/mca/one/Makefile.am
D src/mca/one/base
D src/mca/one/base/Makefile.am
A + src/mca/rmaps
A + src/mca/rmaps/round_robin
A + src/mca/rmaps/round_robin/configure.params
A + src/mca/rmaps/round_robin/rmaps_rr.c
A + src/mca/rmaps/round_robin/rmaps_rr_component.c
A + src/mca/rmaps/round_robin/Makefile.am
A + src/mca/rmaps/round_robin/rmaps_rr.h
A + src/mca/rmaps/rmaps.h
A + src/mca/rmaps/Makefile.am
A + src/mca/rmaps/base
A + src/mca/rmaps/base/rmaps_base_map.h
A + src/mca/rmaps/base/base.h
A + src/mca/rmaps/base/rmaps_base_close.c
A + src/mca/rmaps/base/Makefile.am
A + src/mca/rmaps/base/rmaps_base_map.c
A + src/mca/rmaps/base/rmaps_base_select.c
A + src/mca/rmaps/base/rmaps_base_open.c
A + src/mca/rmaps/rmaps_types.h
D src/mca/llm
D src/mca/llm/Makefile.am
D src/mca/llm/base
D src/mca/llm/base/base.h
D src/mca/llm/base/llm_base_open.c
D src/mca/llm/base/help-llm-base.txt
D src/mca/llm/base/llm_base_collapse.c
D src/mca/llm/base/llm_base_parse_hostfile_lex.h
D src/mca/llm/base/llm_base_close.c
D src/mca/llm/base/llm_base_parse_hostfile.c
D src/mca/llm/base/llm_base_parse_hostfile_lex.l
D src/mca/llm/base/Makefile.am
D src/mca/llm/base/llm_base_util.c
D src/mca/llm/base/base_internal.h
D src/mca/llm/base/llm_base_map.c
D src/mca/llm/base/llm_base_select.c
D src/mca/llm/llm.h
D src/mca/llm/hostfile
D src/mca/llm/hostfile/configure.params
D src/mca/llm/hostfile/VERSION
D src/mca/llm/hostfile/src
D src/mca/llm/hostfile/src/llm_hostfile_deallocate.c
D src/mca/llm/hostfile/src/llm_hostfile_component.c
D src/mca/llm/hostfile/src/llm_hostfile_allocate.c
D src/mca/llm/hostfile/src/llm_hostfile.h
D src/mca/llm/hostfile/src/Makefile.am
D src/mca/llm/hostfile/Makefile.am
D src/mca/llm/bjs
D src/mca/llm/bjs/configure.params
D src/mca/llm/bjs/llm_bjs.c
D src/mca/llm/bjs/VERSION
D src/mca/llm/bjs/llm_bjs_component.c
D src/mca/llm/bjs/llm_bjs.h
D src/mca/llm/bjs/Makefile.am
A + src/mca/ras
A + src/mca/ras/ras_types.h
A + src/mca/ras/tm
A + src/mca/ras/tm/configure.params
A + src/mca/ras/tm/VERSION
A + src/mca/ras/tm/src
A + src/mca/ras/tm/src/ras_tm_component.c
A + src/mca/ras/tm/src/Makefile.am
A + src/mca/ras/tm/src/ras_tm_module.c
A + src/mca/ras/tm/src/ras_tm.h
A + src/mca/ras/tm/Makefile.am
A + src/mca/ras/tm/configure.stub
A + src/mca/ras/Makefile.am
A + src/mca/ras/lsf_bproc
A + src/mca/ras/lsf_bproc/ras_lsf_bproc.c
A + src/mca/ras/lsf_bproc/ras_lsf_bproc_component.c
A + src/mca/ras/lsf_bproc/configure.params
A + src/mca/ras/lsf_bproc/ras_lsf_bproc.h
A + src/mca/ras/lsf_bproc/Makefile.am
A + src/mca/ras/lsf_bproc/configure.stub
A + src/mca/ras/base
A + src/mca/ras/base/ras_base_select.c
A + src/mca/ras/base/base.h
A + src/mca/ras/base/ras_base_open.c
A + src/mca/ras/base/ras_base_close.c
A + src/mca/ras/base/ras_base_node.c
A + src/mca/ras/base/Makefile.am
A + src/mca/ras/base/ras_base_node.h
A + src/mca/ras/base/ras_base_alloc.c
A + src/mca/ras/ras.h
A + src/mca/ras/host
A + src/mca/ras/host/ras_host.c
A + src/mca/ras/host/configure.params
A + src/mca/ras/host/ras_host_component.c
A + src/mca/ras/host/ras_host.h
A + src/mca/ras/host/Makefile.am
A + src/mca/ras/bjs
A + src/mca/ras/bjs/configure.params
A + src/mca/ras/bjs/ras_bjs.c
A + src/mca/ras/bjs/ras_bjs_component.c
A + src/mca/ras/bjs/ras_bjs.h
A + src/mca/ras/bjs/Makefile.am
A + src/mca/ras/bjs/configure.stub
M src/mca/mca.h
M src/mca/mpool/sm/mpool_sm_component.c
M src/mca/common/sm/common_sm_mmap.c
M src/mca/pml/base/pml_base_select.c
D src/mca/gpr/replica/gpr_replica_cleanup.c
D src/mca/gpr/replica/gpr_replica_recv_proxy_msgs.c
D src/mca/gpr/replica/gpr_replica_del_index.c
D src/mca/gpr/replica/gpr_replica_xmit_alerts.c
D src/mca/gpr/replica/gpr_replica_test_internals.c
A + src/mca/gpr/replica/transition_layer
A + src/mca/gpr/replica/transition_layer/gpr_replica_segment_tl.c
A + src/mca/gpr/replica/transition_layer/Makefile.am
A + src/mca/gpr/replica/transition_layer/gpr_replica_dict_tl.c
A + src/mca/gpr/replica/transition_layer/gpr_replica_tl.h
A + src/mca/gpr/replica/communications
A + src/mca/gpr/replica/communications/gpr_replica_recv_proxy_msgs.c
A + src/mca/gpr/replica/communications/gpr_replica_arithmetic_ops_cm.c
A + src/mca/gpr/replica/communications/gpr_replica_del_index_cm.c
A + src/mca/gpr/replica/communications/gpr_replica_subscribe_cm.c
A + src/mca/gpr/replica/communications/gpr_replica_comm.h
A + src/mca/gpr/replica/communications/Makefile.am
A + src/mca/gpr/replica/communications/gpr_replica_remote_msg.c
A + src/mca/gpr/replica/communications/gpr_replica_cmd_processor.c
A + src/mca/gpr/replica/communications/gpr_replica_dump_cm.c
A + src/mca/gpr/replica/communications/gpr_replica_cleanup_cm.c
A + src/mca/gpr/replica/communications/gpr_replica_put_get_cm.c
D src/mca/gpr/replica/gpr_replica_internals_segment_ops.c
R + src/mca/gpr/replica/gpr_replica_component.c
D src/mca/gpr/replica/gpr_replica_internals_trigger_ops.c
D src/mca/gpr/replica/gpr_replica_internals.h
D src/mca/gpr/replica/gpr_replica_dump.c
D src/mca/gpr/replica/gpr_replica_mode_ops.c
A + src/mca/gpr/replica/functional_layer
A + src/mca/gpr/replica/functional_layer/gpr_replica_dump_fn.c
A + src/mca/gpr/replica/functional_layer/gpr_replica_fn.h
A + src/mca/gpr/replica/functional_layer/gpr_replica_trig_ops_fn.c
A + src/mca/gpr/replica/functional_layer/gpr_replica_put_get_fn.c
A + src/mca/gpr/replica/functional_layer/gpr_replica_cleanup_fn.c
A + src/mca/gpr/replica/functional_layer/gpr_replica_arithmetic_ops_fn.c
A + src/mca/gpr/replica/functional_layer/gpr_replica_del_index_fn.c
A + src/mca/gpr/replica/functional_layer/gpr_replica_messaging_fn.c
A + src/mca/gpr/replica/functional_layer/Makefile.am
A + src/mca/gpr/replica/functional_layer/gpr_replica_subscribe_fn.c
A + src/mca/gpr/replica/functional_layer/gpr_replica_segment_fn.c
A + src/mca/gpr/replica/functional_layer/gpr_replica_dict_fn.c
D src/mca/gpr/replica/gpr_replica_put_get.c
D src/mca/gpr/replica/gpr_replica_compound_cmd.c
M src/mca/gpr/replica/configure.params
D src/mca/gpr/replica/gpr_replica_messaging.c
A + src/mca/gpr/replica/api_layer
A + src/mca/gpr/replica/api_layer/gpr_replica_subscribe_api.c
A + src/mca/gpr/replica/api_layer/gpr_replica_segment_ops_api.c
A + src/mca/gpr/replica/api_layer/gpr_replica_dump_api.c
A + src/mca/gpr/replica/api_layer/gpr_replica_api.h
A + src/mca/gpr/replica/api_layer/gpr_replica_compound_cmd_api.c
A + src/mca/gpr/replica/api_layer/gpr_replica_cleanup_api.c
A + src/mca/gpr/replica/api_layer/gpr_replica_put_get_api.c
A + src/mca/gpr/replica/api_layer/Makefile.am
A + src/mca/gpr/replica/api_layer/gpr_replica_arithmetic_ops_api.c
A + src/mca/gpr/replica/api_layer/gpr_replica_del_index_api.c
A + src/mca/gpr/replica/api_layer/gpr_replica_messaging_api.c
M src/mca/gpr/replica/Makefile.am
D src/mca/gpr/replica/gpr_replica_subscribe.c
D src/mca/gpr/replica/gpr_replica_internals_dict_ops.c
M src/mca/gpr/replica/gpr_replica.h
D src/mca/gpr/replica/gpr_replica_synchro.c
D src/mca/gpr/proxy/gpr_proxy_synchro.c
M src/mca/gpr/proxy/gpr_proxy.h
M src/mca/gpr/proxy/gpr_proxy_cleanup.c
M src/mca/gpr/proxy/gpr_proxy_del_index.c
D src/mca/gpr/proxy/gpr_proxy_xmit_alerts.c
M src/mca/gpr/proxy/gpr_proxy_internals.c
M src/mca/gpr/proxy/gpr_proxy_component.c
M src/mca/gpr/proxy/gpr_proxy_dump.c
D src/mca/gpr/proxy/gpr_proxy_mode_ops.c
M src/mca/gpr/proxy/gpr_proxy_put_get.c
M src/mca/gpr/proxy/gpr_proxy_compound_cmd.c
A + src/mca/gpr/proxy/gpr_proxy_arithmetic_ops.c
M src/mca/gpr/proxy/gpr_proxy_messaging.c
M src/mca/gpr/proxy/Makefile.am
A + src/mca/gpr/proxy/gpr_proxy_general_operations.c
M src/mca/gpr/proxy/gpr_proxy_subscribe.c
A + src/mca/gpr/gpr_types.h
D src/mca/gpr/base/gpr_base_pack_test_internals.c
D src/mca/gpr/base/gpr_base_unpack_del_index.c
D src/mca/gpr/base/gpr_base_unpack_test_internals.c
M src/mca/gpr/base/gpr_base_open.c
D src/mca/gpr/base/gpr_base_pack_mode_ops.c
D src/mca/gpr/base/gpr_base_pack_dump.c
D src/mca/gpr/base/gpr_base_pack_put_get.c
M src/mca/gpr/base/gpr_base_close.c
A + src/mca/gpr/base/unpack_api_response
A + src/mca/gpr/base/unpack_api_response/gpr_base_unpack_del_index.c
A + src/mca/gpr/base/unpack_api_response/gpr_base_dump_notify.c
A + src/mca/gpr/base/unpack_api_response/gpr_base_print_dump.c
A + src/mca/gpr/base/unpack_api_response/gpr_base_unpack_subscribe.c
A + src/mca/gpr/base/unpack_api_response/Makefile.am
A + src/mca/gpr/base/unpack_api_response/gpr_base_unpack_cleanup.c
A + src/mca/gpr/base/unpack_api_response/gpr_base_unpack_put_get.c
A + src/mca/gpr/base/unpack_api_response/gpr_base_unpack_arithmetic_ops.c
A + src/mca/gpr/base/unpack_api_response/gpr_base_decode_startup_msg.c
D src/mca/gpr/base/gpr_base_pack_startup_msg.c
D src/mca/gpr/base/gpr_base_unpack_mode_ops.c
A + src/mca/gpr/base/pack_api_cmd
A + src/mca/gpr/base/pack_api_cmd/gpr_base_pack_subscribe.c
A + src/mca/gpr/base/pack_api_cmd/gpr_base_pack_dump.c
A + src/mca/gpr/base/pack_api_cmd/gpr_base_pack_cleanup.c
A + src/mca/gpr/base/pack_api_cmd/gpr_base_pack_put_get.c
A + src/mca/gpr/base/pack_api_cmd/Makefile.am
A + src/mca/gpr/base/pack_api_cmd/gpr_base_pack_arithmetic_ops.c
A + src/mca/gpr/base/pack_api_cmd/gpr_base_pack_del_index.c
D src/mca/gpr/base/gpr_base_unpack_put_get.c
D src/mca/gpr/base/gpr_base_unpack_startup_msg.c
M src/mca/gpr/base/base.h
M src/mca/gpr/base/gpr_base_select.c
D src/mca/gpr/base/gpr_base_pack_subscribe.c
D src/mca/gpr/base/gpr_base_print_dump.c
D src/mca/gpr/base/gpr_base_unpack_subscribe.c
D src/mca/gpr/base/gpr_base_pack_synchro.c
D src/mca/gpr/base/gpr_base_pack_cleanup.c
M src/mca/gpr/base/Makefile.am
D src/mca/gpr/base/gpr_base_unpack_synchro.c
D src/mca/gpr/base/gpr_base_pack_del_index.c
M src/mca/gpr/gpr.h
A + src/mca/rds
A + src/mca/rds/rds_types.h
A + src/mca/rds/resfile
A + src/mca/rds/resfile/rds_resfile.c
A + src/mca/rds/resfile/configure.params
A + src/mca/rds/resfile/rds_resfile_component.c
A + src/mca/rds/resfile/rds_resfile.h
A + src/mca/rds/resfile/Makefile.am
A + src/mca/rds/resfile/configure.stub
A + src/mca/rds/Makefile.am
A + src/mca/rds/base
A + src/mca/rds/base/base.h
A + src/mca/rds/base/rds_base_select.c
A + src/mca/rds/base/rds_base_open.c
A + src/mca/rds/base/rds_base_close.c
A + src/mca/rds/base/rds_base_query.c
A + src/mca/rds/base/Makefile.am
A + src/mca/rds/hostfile
A + src/mca/rds/hostfile/rds_hostfile_lex.h
A + src/mca/rds/hostfile/configure.params
A + src/mca/rds/hostfile/rds_hostfile.c
A + src/mca/rds/hostfile/rds_hostfile_lex.l
A + src/mca/rds/hostfile/rds_hostfile_component.c
A + src/mca/rds/hostfile/Makefile.am
A + src/mca/rds/hostfile/rds_hostfile.h
A + src/mca/rds/rds.h
M src/mca/soh/soh.h
A + src/mca/soh/soh_types.h
M src/mca/soh/bproc
A + src/mca/soh/bproc/soh_bproc_control.c
A + src/mca/soh/bproc/soh_bproc_monitor.c
A + src/mca/soh/base/soh_base_get_proc_soh.c
M src/mca/soh/base/base.h
M src/mca/soh/base/soh_base_select.c
M src/mca/soh/base/soh_base_open.c
M src/mca/soh/base/soh_base_local_functions.c
M src/mca/soh/base/Makefile.am
M src/mca/soh/base/soh_base_close.c
A + src/mca/soh/base/soh_base_set_proc_soh.c
A + src/mca/rml
A + src/mca/rml/oob
A + src/mca/rml/oob/rml_oob.h
A + src/mca/rml/oob/configure.params
A + src/mca/rml/oob/Makefile.am
A + src/mca/rml/oob/rml_oob.c
A + src/mca/rml/oob/rml_oob_component.c
A + src/mca/rml/rml.h
A + src/mca/rml/rml_types.h
A + src/mca/rml/Makefile.am
A + src/mca/rml/base
A + src/mca/rml/base/base.h
A + src/mca/rml/base/rml_base_select.c
A + src/mca/rml/base/rml_base_open.c
A + src/mca/rml/base/Makefile.am
A + src/mca/rml/base/rml_base_close.c
D src/mca/svc
D src/mca/svc/svc.h
D src/mca/svc/Makefile.am
D src/mca/svc/base
D src/mca/svc/base/base.h
D src/mca/svc/base/svc_base_open.c
D src/mca/svc/base/svc_base_init.c
D src/mca/svc/base/Makefile.am
D src/mca/svc/base/svc_base_close.c
M src/mca/errmgr/errmgr.h
A + src/mca/errmgr/base/errmgr_base_fns.c
M src/mca/errmgr/base/base.h
M src/mca/errmgr/base/errmgr_base_select.c
M src/mca/errmgr/base/Makefile.am
M src/mca/errmgr/base/errmgr_base_open.c
M src/mca/errmgr/base/errmgr_base_close.c
A + src/mca/pls
A + src/mca/pls/tm
A + src/mca/pls/tm/configure.params
A + src/mca/pls/tm/VERSION
A + src/mca/pls/tm/src
A + src/mca/pls/tm/src/pls_tm_component.c
A + src/mca/pls/tm/src/pls_tm_module.c
A + src/mca/pls/tm/src/pls_tm.h
A + src/mca/pls/tm/src/pls_tm_registry.c
A + src/mca/pls/tm/src/Makefile.am
A + src/mca/pls/tm/Makefile.am
A + src/mca/pls/tm/configure.stub
A + src/mca/pls/fork
A + src/mca/pls/fork/pls_fork_component.c
A + src/mca/pls/fork/configure.params
A + src/mca/pls/fork/VERSION
A + src/mca/pls/fork/pls_fork.h
A + src/mca/pls/fork/pls_fork_module.c
A + src/mca/pls/fork/Makefile.am
A + src/mca/pls/proxy
A + src/mca/pls/proxy/pls_proxy.c
A + src/mca/pls/proxy/pls_proxy_component.c
A + src/mca/pls/proxy/configure.params
A + src/mca/pls/proxy/pls_proxy.h
A + src/mca/pls/proxy/VERSION
A + src/mca/pls/proxy/Makefile.am
A + src/mca/pls/slurm
A + src/mca/pls/slurm/pls_slurm_component.c
A + src/mca/pls/slurm/configure.params
A + src/mca/pls/slurm/.ompi_ignore
A + src/mca/pls/slurm/VERSION
A + src/mca/pls/slurm/pls_slurm.h
A + src/mca/pls/slurm/pls_slurm_module.c
A + src/mca/pls/slurm/.ompi_unignore
A + src/mca/pls/slurm/Makefile.am
A + src/mca/pls/poe
A + src/mca/pls/poe/configure.params
A + src/mca/pls/poe/pls_poe_component.c
A + src/mca/pls/poe/VERSION
A + src/mca/pls/poe/.ompi_ignore
A + src/mca/pls/poe/pls_poe_module.c
A + src/mca/pls/poe/pls_poe.h
A + src/mca/pls/poe/.ompi_unignore
A + src/mca/pls/poe/Makefile.am
A + src/mca/pls/daemon
A + src/mca/pls/daemon/configure.params
A + src/mca/pls/daemon/pls_daemon_component.c
A + src/mca/pls/daemon/.ompi_ignore
A + src/mca/pls/daemon/VERSION
A + src/mca/pls/daemon/pls_daemon.h
A + src/mca/pls/daemon/pls_daemon_module.c
A + src/mca/pls/daemon/.ompi_unignore
A + src/mca/pls/daemon/Makefile.am
A + src/mca/pls/pls.h
A + src/mca/pls/bproc_seed
A + src/mca/pls/bproc_seed/configure.params
A + src/mca/pls/bproc_seed/pls_bproc_seed.c
A + src/mca/pls/bproc_seed/pls_bproc_seed_component.c
A + src/mca/pls/bproc_seed/pls_bproc_seed.h
A + src/mca/pls/bproc_seed/Makefile.am
A + src/mca/pls/bproc_seed/configure.stub
A + src/mca/pls/bproc_seed/pls_bproc_seed_config.h
A + src/mca/pls/bproc_proxy
A + src/mca/pls/bproc_proxy/pls_bproc_proxy_config.h
A + src/mca/pls/bproc_proxy/configure.params
A + src/mca/pls/bproc_proxy/pls_bproc_proxy.c
A + src/mca/pls/bproc_proxy/pls_bproc_proxy_component.c
A + src/mca/pls/bproc_proxy/Makefile.am
A + src/mca/pls/bproc_proxy/pls_bproc_proxy.h
A + src/mca/pls/bproc_proxy/configure.stub
A + src/mca/pls/Makefile.am
A + src/mca/pls/base
A + src/mca/pls/base/base.h
A + src/mca/pls/base/pls_base_select.c
A + src/mca/pls/base/Makefile.am
A + src/mca/pls/base/pls_base_state.c
A + src/mca/pls/base/pls_base_open.c
A + src/mca/pls/base/pls_base_close.c
A + src/mca/pls/rsh
A + src/mca/pls/rsh/pls_rsh_module.c
A + src/mca/pls/rsh/pls_rsh.h
A + src/mca/pls/rsh/configure.params
A + src/mca/pls/rsh/VERSION
A + src/mca/pls/rsh/Makefile.am
A + src/mca/pls/rsh/pls_rsh_component.c
M src/mca/ptl/sm/src/ptl_sm.c
M src/mca/ptl/sm/src/ptl_sm_component.c
M src/mca/ptl/gm/src/ptl_gm.c
M src/mca/ptl/gm/src/ptl_gm_proc.h
M src/mca/ptl/tcp/src/ptl_tcp_peer.c
M src/mca/ptl/tcp/src/ptl_tcp_component.c
M src/mca/ptl/tcp/src/ptl_tcp_proc.c
M src/mca/ptl/tcp/src/ptl_tcp_proc.h
M src/mca/ptl/base/ptl_base_select.c
M src/mca/io/base/io_base_component_list.c
A + src/mca/rmgr
A + src/mca/rmgr/rmgr_types.h
A + src/mca/rmgr/urm
A + src/mca/rmgr/urm/rmgr_urm.h
A + src/mca/rmgr/urm/configure.params
A + src/mca/rmgr/urm/Makefile.am
A + src/mca/rmgr/urm/rmgr_urm.c
A + src/mca/rmgr/urm/rmgr_urm_component.c
A + src/mca/rmgr/Makefile.am
A + src/mca/rmgr/base
A + src/mca/rmgr/base/base.h
A + src/mca/rmgr/base/rmgr_base_select.c
A + src/mca/rmgr/base/rmgr_base_stubs.c
A + src/mca/rmgr/base/rmgr_base_open.c
A + src/mca/rmgr/base/rmgr_base_stage_gate.c
A + src/mca/rmgr/base/rmgr_base_context.c
A + src/mca/rmgr/base/rmgr_base_close.c
A + src/mca/rmgr/base/Makefile.am
A + src/mca/rmgr/rmgr.h
M src/mca/Makefile.am
M src/mca/base/mca_base_module_exchange.c
M src/mca/base/mca_base_param.c
M src/mca/base/mca_base_param_internal.h
M src/mca/base/base.h
M src/mca/base/mca_base_param.h
M src/mca/iof
M src/mca/iof/proxy
M src/mca/iof/proxy/iof_proxy.c
M src/mca/iof/proxy/iof_proxy_svc.h
M src/mca/iof/proxy/iof_proxy_component.c
M src/mca/iof/proxy/iof_proxy.h
M src/mca/iof/proxy/iof_proxy_svc.c
M src/mca/iof/iof.h
M src/mca/iof/base
M src/mca/iof/base/base.h
M src/mca/iof/base/iof_base_fragment.h
M src/mca/iof/base/iof_base_header.h
M src/mca/iof/base/iof_base_select.c
M src/mca/iof/base/iof_base_endpoint.c
M src/mca/iof/base/iof_base_open.c
M src/mca/iof/base/iof_base_flush.c
M src/mca/iof/base/iof_base_fragment.c
M src/mca/iof/base/iof_base_close.c
M src/mca/iof/base/iof_base_endpoint.h
M src/mca/iof/svc
M src/mca/iof/svc/iof_svc_proxy.h
M src/mca/iof/svc/iof_svc_publish.c
M src/mca/iof/svc/iof_svc_publish.h
M src/mca/iof/svc/iof_svc_subscript.c
M src/mca/iof/svc/iof_svc.c
M src/mca/iof/svc/iof_svc_proxy.c
M src/mca/iof/svc/iof_svc_component.c
M src/mca/iof/svc/iof_svc_subscript.h
M src/mca/iof/svc/iof_svc.h
D src/mca/op
D src/mca/op/op.h
D src/mca/op/base
D src/mca/pcmclient
D src/mca/pcmclient/seed
D src/mca/pcmclient/seed/pcmclient_seed.c
D src/mca/pcmclient/seed/pcmclient_seed_component.c
D src/mca/pcmclient/seed/configure.params
D src/mca/pcmclient/seed/pcmclient_seed.h
D src/mca/pcmclient/seed/VERSION
D src/mca/pcmclient/seed/Makefile.am
D src/mca/pcmclient/rms
D src/mca/pcmclient/rms/pcmclient_rms.c
D src/mca/pcmclient/rms/pcmclient_rms_component.c
D src/mca/pcmclient/rms/configure.params
D src/mca/pcmclient/rms/pcmclient_rms.h
D src/mca/pcmclient/rms/VERSION
D src/mca/pcmclient/rms/Makefile.am
D src/mca/pcmclient/singleton
D src/mca/pcmclient/singleton/pcmclient_singleton.c
D src/mca/pcmclient/singleton/configure.params
D src/mca/pcmclient/singleton/pcmclient_singleton_component.c
D src/mca/pcmclient/singleton/VERSION
D src/mca/pcmclient/singleton/pcmclient_singleton.h
D src/mca/pcmclient/singleton/Makefile.am
D src/mca/pcmclient/slurm
D src/mca/pcmclient/slurm/pcmclient_slurm.c
D src/mca/pcmclient/slurm/configure.params
D src/mca/pcmclient/slurm/pcmclient_slurm_component.c
D src/mca/pcmclient/slurm/VERSION
D src/mca/pcmclient/slurm/pcmclient_slurm.h
D src/mca/pcmclient/slurm/Makefile.am
D src/mca/pcmclient/pcmclient.h
D src/mca/pcmclient/bproc
D src/mca/pcmclient/bproc/configure.params
D src/mca/pcmclient/bproc/pcmclient_bproc.c
D src/mca/pcmclient/bproc/VERSION
D src/mca/pcmclient/bproc/pcmclient_bproc_component.c
D src/mca/pcmclient/bproc/Makefile.am
D src/mca/pcmclient/bproc/pcmclient_bproc.h
D src/mca/pcmclient/env
D src/mca/pcmclient/env/configure.params
D src/mca/pcmclient/env/VERSION
D src/mca/pcmclient/env/pcmclient_env.c
D src/mca/pcmclient/env/pcmclient_env_component.c
D src/mca/pcmclient/env/Makefile.am
D src/mca/pcmclient/env/pcmclient_env.h
D src/mca/pcmclient/Makefile.am
D src/mca/pcmclient/base
D src/mca/pcmclient/base/base.h
D src/mca/pcmclient/base/pcmclient_base_select.c
D src/mca/pcmclient/base/Makefile.am
D src/mca/pcmclient/base/pcmclient_base_open.c
D src/mca/pcmclient/base/pcmclient_base_close.c
M src/tools/ompi_info/ompi_info.cc
M src/tools/ompi_info/components.cc
? src/tools/console/ompiconsole
M src/tools/console
D src/tools/console/ompiconsole.c
M src/tools/console/Makefile.am
A + src/tools/console/orteconsole.c
D src/tools/bootproxy
D src/tools/bootproxy/bootproxy.c
D src/tools/bootproxy/help-bootproxy.txt
D src/tools/bootproxy/Makefile.am
M src/tools/openmpi/openmpi.c
D src/tools/ompid
D src/tools/ompid/ompid.c
D src/tools/ompid/Makefile.am
D src/tools/ompid/base
D src/tools/ompid/base/base.h
D src/tools/ompid/ompid.cc
D src/tools/ompid/ompid.h
M src/tools/Makefile.am
D src/tools/mpirun
D src/tools/mpirun/Makefile.am
D src/tools/mpirun/mpiboot
D src/tools/mpirun/mpirun.c
D src/tools/mpirun/help-mpirun.txt
A + src/tools/orted
A + src/tools/orted/orted.h
A + src/tools/orted/orted_bootproxy.c
A + src/tools/orted/Makefile.am
A + src/tools/orted/orted.c
A + src/tools/orterun
A + src/tools/orterun/orterun.c
A + src/tools/orterun/help-orterun.txt
A + src/tools/orterun/Makefile.am
M src/communicator/comm_publish.c
M src/communicator/comm_dyn.c
M src/communicator/communicator.h
M src/communicator/comm_cid.c
M src/communicator/comm.c
M src/attribute/attribute.h
M src/attribute/attribute_predefined.c
M src/proc/proc.c
M src/proc/proc.h
M src/class/ompi_proc_table.c
M src/class/ompi_list.c
A + src/class/orte_value_array.c
M src/class/ompi_proc_table.h
M src/class/ompi_list.h
A + src/class/orte_pointer_array.c
A + src/class/orte_value_array.h
A + src/class/orte_pointer_array.h
M src/class/Makefile.am
M src/Makefile.am
M src/util/argv.c
M src/util/output.c
A + src/util/univ_info.h
M src/util/proc_info.c
A + src/util/environ.c
M src/util/session_dir.c
M src/util/proc_info.h
A + src/util/environ.h
M src/util/session_dir.h
M src/util/daemon_init.c
M src/util/sys_info.c
M src/util/daemon_init.h
M src/util/os_path.c
M src/util/sys_info.h
M src/util/os_path.h
M src/util/universe_setup_file_io.c
M src/util/cmd_line.c
D src/util/bufpack.c
M src/util/universe_setup_file_io.h
M src/util/os_create_dirpath.c
M src/util/cmd_line.h
D src/util/bufpack.h
M src/util/os_create_dirpath.h
M src/util/stacktrace.c
M src/util/Makefile.am
M src/util/stacktrace.h
A + src/util/univ_info.c
M configure.ac
? config/compile
M config
M config/ompi_mca.m4
A + etc/lanl_resources.xml
M autogen.sh

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

@ -860,7 +860,6 @@ MCA_soh_NO_CONFIGURE_SUBDIRS=""
MCA_allocator_NO_CONFIGURE_SUBDIRS=""
MCA_coll_NO_CONFIGURE_SUBDIRS=""
MCA_io_NO_CONFIGURE_SUBDIRS=""
MCA_one_NO_CONFIGURE_SUBDIRS=""
MCA_pml_NO_CONFIGURE_SUBDIRS=""
MCA_ptl_NO_CONFIGURE_SUBDIRS=""
MCA_topo_NO_CONFIGURE_SUBDIRS=""

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

@ -65,7 +65,7 @@ fi
# The list of MCA types (it's fixed)
AC_MSG_CHECKING([for MCA types])
found_types="common allocator coll errmgr gpr io iof llm mpool ns one oob op pcm pcmclient pml ptl soh svc topo"
found_types="common allocator coll errmgr gpr io iof mpool ns oob pls pml ptl ras rds rmaps rmgr rml soh topo"
AC_MSG_RESULT([$found_types])
# Get the list of all the non-configure MCA components that were found by
@ -322,22 +322,17 @@ AC_SUBST(MCA_common_STATIC_SUBDIRS)
AC_SUBST(MCA_common_DSO_SUBDIRS)
AC_SUBST(MCA_common_STATIC_LTLIBS)
# OMPI types
# ORTE types
AC_SUBST(MCA_oob_ALL_SUBDIRS)
AC_SUBST(MCA_oob_STATIC_SUBDIRS)
AC_SUBST(MCA_oob_DSO_SUBDIRS)
AC_SUBST(MCA_oob_STATIC_LTLIBS)
AC_SUBST(MCA_pcm_ALL_SUBDIRS)
AC_SUBST(MCA_pcm_STATIC_SUBDIRS)
AC_SUBST(MCA_pcm_DSO_SUBDIRS)
AC_SUBST(MCA_pcm_STATIC_LTLIBS)
AC_SUBST(MCA_pcmclient_ALL_SUBDIRS)
AC_SUBST(MCA_pcmclient_STATIC_SUBDIRS)
AC_SUBST(MCA_pcmclient_DSO_SUBDIRS)
AC_SUBST(MCA_pcmclient_STATIC_LTLIBS)
AC_SUBST(MCA_errmgr_ALL_SUBDIRS)
AC_SUBST(MCA_errmgr_STATIC_SUBDIRS)
AC_SUBST(MCA_errmgr_DSO_SUBDIRS)
AC_SUBST(MCA_errmgr_STATIC_LTLIBS)
AC_SUBST(MCA_errmgr_ALL_SUBDIRS)
AC_SUBST(MCA_errmgr_STATIC_SUBDIRS)
@ -349,16 +344,36 @@ AC_SUBST(MCA_gpr_STATIC_SUBDIRS)
AC_SUBST(MCA_gpr_DSO_SUBDIRS)
AC_SUBST(MCA_gpr_STATIC_LTLIBS)
AC_SUBST(MCA_llm_ALL_SUBDIRS)
AC_SUBST(MCA_llm_STATIC_SUBDIRS)
AC_SUBST(MCA_llm_DSO_SUBDIRS)
AC_SUBST(MCA_llm_STATIC_LTLIBS)
AC_SUBST(MCA_ns_ALL_SUBDIRS)
AC_SUBST(MCA_ns_STATIC_SUBDIRS)
AC_SUBST(MCA_ns_DSO_SUBDIRS)
AC_SUBST(MCA_ns_STATIC_LTLIBS)
AC_SUBST(MCA_ras_ALL_SUBDIRS)
AC_SUBST(MCA_ras_STATIC_SUBDIRS)
AC_SUBST(MCA_ras_DSO_SUBDIRS)
AC_SUBST(MCA_ras_STATIC_LTLIBS)
AC_SUBST(MCA_rds_ALL_SUBDIRS)
AC_SUBST(MCA_rds_STATIC_SUBDIRS)
AC_SUBST(MCA_rds_DSO_SUBDIRS)
AC_SUBST(MCA_rds_STATIC_LTLIBS)
AC_SUBST(MCA_rmaps_ALL_SUBDIRS)
AC_SUBST(MCA_rmaps_STATIC_SUBDIRS)
AC_SUBST(MCA_rmaps_DSO_SUBDIRS)
AC_SUBST(MCA_rmaps_STATIC_LTLIBS)
AC_SUBST(MCA_rmgr_ALL_SUBDIRS)
AC_SUBST(MCA_rmgr_STATIC_SUBDIRS)
AC_SUBST(MCA_rmgr_DSO_SUBDIRS)
AC_SUBST(MCA_rmgr_STATIC_LTLIBS)
AC_SUBST(MCA_pls_ALL_SUBDIRS)
AC_SUBST(MCA_pls_STATIC_SUBDIRS)
AC_SUBST(MCA_pls_DSO_SUBDIRS)
AC_SUBST(MCA_pls_STATIC_LTLIBS)
# MPI types
AC_SUBST(MCA_allocator_ALL_SUBDIRS)
@ -386,11 +401,6 @@ AC_SUBST(MCA_mpool_STATIC_SUBDIRS)
AC_SUBST(MCA_mpool_DSO_SUBDIRS)
AC_SUBST(MCA_mpool_STATIC_LTLIBS)
AC_SUBST(MCA_one_ALL_SUBDIRS)
AC_SUBST(MCA_one_STATIC_SUBDIRS)
AC_SUBST(MCA_one_DSO_SUBDIRS)
AC_SUBST(MCA_one_STATIC_LTLIBS)
AC_SUBST(MCA_pml_ALL_SUBDIRS)
AC_SUBST(MCA_pml_STATIC_SUBDIRS)
AC_SUBST(MCA_pml_DSO_SUBDIRS)
@ -401,6 +411,11 @@ AC_SUBST(MCA_ptl_STATIC_SUBDIRS)
AC_SUBST(MCA_ptl_DSO_SUBDIRS)
AC_SUBST(MCA_ptl_STATIC_LTLIBS)
AC_SUBST(MCA_rml_ALL_SUBDIRS)
AC_SUBST(MCA_rml_STATIC_SUBDIRS)
AC_SUBST(MCA_rml_DSO_SUBDIRS)
AC_SUBST(MCA_rml_STATIC_LTLIBS)
AC_SUBST(MCA_soh_ALL_SUBDIRS)
AC_SUBST(MCA_soh_STATIC_SUBDIRS)
AC_SUBST(MCA_soh_DSO_SUBDIRS)

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

@ -937,8 +937,8 @@ AC_DEFINE_UNQUOTED(OMPI_RANGE_F90_COMPLEX32, $OMPI_RANGE_F90_COMPLEX32,
ompi_show_title "Header file tests"
AC_CHECK_HEADERS([alloca.h aio.h arpa/inet.h dirent.h dlfcn.h execinfo.h \
fcntl.h inttypes.h libgen.h net/if.h netdb.h netinet/in.h netinet/tcp.h \
sys/stat.h poll.h pthread.h pwd.h sched.h stdint.h string.h strings.h stropts.h \
fcntl.h sys/fcntl.h inttypes.h libgen.h net/if.h netdb.h netinet/in.h netinet/tcp.h \
sys/stat.h poll.h pthread.h pwd.h sched.h stdint.h string.hstrings.h stropts.h \
sys/types.h sys/ipc.h sys/mman.h sys/resource.h sys/select.h sys/socket.h \
sys/ioctl.h err.h sys/statvfs.h sys/time.h sys/uio.h sys/utsname.h sys/wait.h \
syslog.h termios.h ulimit.h unistd.h sys/param.h sys/tree.h sys/queue.h])
@ -1038,6 +1038,8 @@ AC_DEFINE_UNQUOTED(OMPI_HAVE_UNDERSCORE_VA_COPY, $OMPI_HAVE_UNDERSCORE_VA_COPY,
AC_CHECK_DECLS(__func__)
AC_CHECK_LIB([m], [ceil])
##################################
# System-specific tests
@ -1498,6 +1500,7 @@ AC_CONFIG_FILES([
src/include/sys/win32/Makefile
src/class/Makefile
src/dps/Makefile
src/runtime/Makefile
src/threads/Makefile
src/util/Makefile
@ -1523,65 +1526,70 @@ AC_CONFIG_FILES([
src/mca/base/Makefile
src/mca/common/Makefile
src/mca/errmgr/Makefile
src/mca/errmgr/base/Makefile
src/mca/iof/Makefile
src/mca/iof/base/Makefile
src/mca/gpr/Makefile
src/mca/gpr/base/Makefile
src/mca/gpr/base/pack_api_cmd/Makefile
src/mca/gpr/base/unpack_api_response/Makefile
src/mca/ns/Makefile
src/mca/ns/base/Makefile
src/mca/oob/Makefile
src/mca/oob/base/Makefile
src/mca/pcm/Makefile
src/mca/pcm/base/Makefile
src/mca/pcmclient/Makefile
src/mca/pcmclient/base/Makefile
src/mca/llm/Makefile
src/mca/llm/base/Makefile
src/mca/pls/Makefile
src/mca/pls/base/Makefile
src/mca/ras/Makefile
src/mca/ras/base/Makefile
src/mca/rds/Makefile
src/mca/rds/base/Makefile
src/mca/rmaps/Makefile
src/mca/rmaps/base/Makefile
src/mca/rmgr/Makefile
src/mca/rmgr/base/Makefile
src/mca/soh/Makefile
src/mca/soh/base/Makefile
src/mca/svc/Makefile
src/mca/svc/base/Makefile
src/mca/allocator/Makefile
src/mca/allocator/base/Makefile
src/mca/coll/Makefile
src/mca/coll/base/Makefile
src/mca/errmgr/Makefile
src/mca/errmgr/base/Makefile
src/mca/gpr/Makefile
src/mca/gpr/base/Makefile
src/mca/io/Makefile
src/mca/io/base/Makefile
src/mca/iof/Makefile
src/mca/iof/base/Makefile
src/mca/mpool/Makefile
src/mca/mpool/base/Makefile
src/mca/one/Makefile
src/mca/one/base/Makefile
src/mca/pml/Makefile
src/mca/pml/base/Makefile
src/mca/ptl/Makefile
src/mca/ptl/base/Makefile
src/mca/rml/Makefile
src/mca/rml/base/Makefile
src/mca/topo/Makefile
src/mca/topo/base/Makefile
src/mca/ns/Makefile
src/mca/ns/base/Makefile
src/dynamic-mca/common/Makefile
src/dynamic-mca/errmgr/Makefile
src/dynamic-mca/iof/Makefile
src/dynamic-mca/gpr/Makefile
src/dynamic-mca/ns/Makefile
src/dynamic-mca/oob/Makefile
src/dynamic-mca/pcm/Makefile
src/dynamic-mca/pcmclient/Makefile
src/dynamic-mca/llm/Makefile
src/dynamic-mca/pls/Makefile
src/dynamic-mca/ras/Makefile
src/dynamic-mca/rds/Makefile
src/dynamic-mca/rmaps/Makefile
src/dynamic-mca/rmgr/Makefile
src/dynamic-mca/soh/Makefile
src/dynamic-mca/svc/Makefile
src/dynamic-mca/Makefile
src/dynamic-mca/allocator/Makefile
src/dynamic-mca/coll/Makefile
src/dynamic-mca/errmgr/Makefile
src/dynamic-mca/gpr/Makefile
src/dynamic-mca/io/Makefile
src/dynamic-mca/iof/Makefile
src/dynamic-mca/mpool/Makefile
src/dynamic-mca/one/Makefile
src/dynamic-mca/ns/Makefile
src/dynamic-mca/pml/Makefile
src/dynamic-mca/ptl/Makefile
src/dynamic-mca/rml/Makefile
src/dynamic-mca/topo/Makefile
src/mpi/Makefile
@ -1597,14 +1605,24 @@ AC_CONFIG_FILES([
src/mpi/runtime/Makefile
src/tools/Makefile
src/tools/bootproxy/Makefile
src/tools/console/Makefile
src/tools/mpirun/Makefile
src/tools/ompi_info/Makefile
src/tools/ompid/Makefile
src/tools/orted/Makefile
src/tools/orterun/Makefile
src/tools/openmpi/Makefile
src/tools/wrappers/Makefile
src/asm/test/Makefile
test/support/Makefile
test/util/Makefile
test/class/Makefile
test/include/Makefile
test/rte/Makefile
test/dps/Makefile
test/mca/gpr/Makefile
test/mca/ns/Makefile
test/mca/rds/Makefile
test/runtime/Makefile
])
AC_OUTPUT

496
etc/lanl_resources.xml Обычный файл
Просмотреть файл

@ -0,0 +1,496 @@
<?xml version="1.0" encoding="UTF-8"?>
<site-resources>
<site-name>lanl</site-name>
<resource>
<name>pink</name>
<type>cluster</type>
<front-end>
<name>pfe1.lanl.gov</name>
<tmp-dir>/net/scratch1</tmp-dir>
</front-end>
<front-end>pfe2.lanl.gov</front-end>
<compute-domains>
<num-domains>1</num-domains>
<nodes-per-domain>1024</nodes-per-domain>
</compute-domains>
<os>
<type>linux</type>
<vendor>Red Hat</vendor>
<version>9.0</version>
</os>
<filesystem>
<type>panasys</type>
<home-root>/users</home-root>
<scratch>
<root>/net/scratch1</root>
<filesystem-size>15.0</filesystem-size> <!--given in terabytes-->
</scratch>
<scratch>
<root>/net/scratch2</root>
<filesystem-size>15.0</filesystem-size>
</scratch>
<give-root>/net/scratch1/givedir</give-root>
</filesystem>
<allocator>lsf</allocator>
<launcher>bproc</launcher>
<node-arch>
<cpus-per-node>2</cpus-per-node>
<cpu-type>xeon</cpu-type>
<cpu-vendor>intel</cpu-vendor>
<cpu-speed>2400</cpu-speed> <!--given in MHz-->
<interconnect>
<type>myrinet</type>
</interconnect>
<memory-per-node>1.0</memory-per-node> <!--given in gigabytes-->
</node-arch>
</resource>
<resource>
<name>lightning</name>
<type>cluster</type>
<front-end>
<name>ll-1.lanl.gov</name>
<tmp-dir>/net/scratch1</tmp-dir>
</front-end>
<front-end>
<name>ll-2.lanl.gov</name>
<tmp-dir>/net/scratch1</tmp-dir>
</front-end>
<front-end>
<name>ll-3.lanl.gov</name>
<tmp-dir>/net/scratch1</tmp-dir>
</front-end>
<front-end>
<name>ll-4.lanl.gov</name>
<tmp-dir>/net/scratch1</tmp-dir>
</front-end>
<front-end>
<name>ll-5.lanl.gov</name>
<tmp-dir>/net/scratch1</tmp-dir>
</front-end>
<front-end>
<name>ll-6.lanl.gov</name>
<tmp-dir>/net/scratch1</tmp-dir>
</front-end>
<os>
<type>linux</type>
<vendor>Red Hat</vendor>
<version>9.0</version>
</os>
<compute-domains>
<num-domains>6</num-domains>
<nodes-per-domain>256</nodes-per-domain>
</compute-domains>
<filesystem>
<type>panasys</type>
<home-root>/users</home-root>
<scratch>
<root>/net/scratch1</root>
<filesystem-size>15.0</filesystem-size> <!--given in terabytes-->
</scratch>
<scratch>
<root>/net/scratch2</root>
<filesystem-size>15.0</filesystem-size>
</scratch>
<give-root>/net/scratch1/givedir</give-root>
</filesystem>
<allocator>lsf</allocator>
<launcher>bproc</launcher>
<node-arch>
<cpus-per-node>2</cpus-per-node>>
<cpu-type>opteron</cpu-type>
<cpu-vendor>amd</cpu-vendor>
<cpu-speed>2000</cpu-speed>
<interconnect>
<type>myrinet</type>
</interconnect>
<memory-per-node>2.0</memory-per-node> <!--given in gigabytes-->
</node-arch>
</resource>
<resource>
<name>flash</name>
<type>cluster</type>
<front-end>
<name>ffe1.lanl.gov</name>
<tmp-dir>/net/scratch1</tmp-dir>
</front-end>
<front-end><name>ffe2.lanl.gov</name>
<tmp-dir>/net/scratch1</tmp-dir>
</front-end>
<os>
<type>linux</type>
<vendor>Red Hat</vendor>
<version>9.0</version>
</os>
<filesystem>
<type>panasys</type>
<home-root>/users</home-root>
<scratch>
<root>/net/scratch1</root>
<filesystem-size>15.0</filesystem-size> <!--given in terabytes-->
</scratch>
<scratch>
<root>/net/scratch2</root>
<filesystem-size>15.0</filesystem-size>
</scratch>
</filesystem>
<allocator>lsf</allocator>
<launcher>bproc</launcher>
<arch>
<num-nodes>510</num-nodes>
<cpus-per-node>2</cpus-per-node>
<memory-per-node>4.0</memory-per-node>
<interconnect>
<type>myrinet</type>
</interconnect>
<cpu-speed>2000</cpu-speed>
<cpu-type>opteron</cpu-type>
<cpu-vendor>amd</cpu-vendor>
</arch>
<compute-domains>
<num-domains>1</num-domains>
<nodes-per-domain>510</nodes-per-domain>
</compute-domains>
</resource>
<resource>
<name>QA</name>
<type>cluster</type>
<front-end>
<name>qafe.lanl.gov</name>
</front-end>
<allocator>lsf</allocator>
<launcher>rms</launcher>
<arch>
<num-nodes>1024</num-nodes>
<cpus-per-node>4</cpus-per-node>
<memory-per-node>8.0</memory-per-node>
<cache>16.0</cache> <!--given in megabytes-->
<interconnect>
<type>quadrics</type>
<num-rails>2</num-rails>
<sw>qsnet</sw>
</interconnect>
<cpu-speed>1250</cpu-speed>
<cpu-type>alpha-ev68</cpu-type>
<cpu-vendor>compaq</cpu-vendor>
</arch>
<filesystem>
<type>trucluster</type>
<fs-domains>32</fs-domains>
<nodes-per-domain>32</nodes-per-domain>
<home-root>/users</home-root>
<scratch>
<root>/scratch1</root>
</scratch>
<scratch>
<root>/scratch2</root>
</scratch>
<give-root>/givedir</give-root>
</filesystem>
<os>
<type>tru64</type>
</os>
</resource>
<resource>
<name>QB</name>
<type>cluster</type>
<front-end>
<name>qbfe.lanl.gov</name>
</front-end>
<allocator>lsf</allocator>
<launcher>rms</launcher>
<arch>
<num-nodes>1024</num-nodes>
<cpus-per-node>4</cpus-per-node>
<memory-per-node>8.0</memory-per-node>
<cache>16.0</cache> <!--given in megabytes-->
<interconnect>
<type>quadrics</type>
<num-rails>2</num-rails>
<sw>qsnet</sw>
</interconnect>
<cpu-speed>1250</cpu-speed>
<cpu-type>alpha-ev68</cpu-type>
<cpu-vendor>compaq</cpu-vendor>
</arch>
<filesystem>
<type>trucluster</type>
<fs-domains>32</fs-domains>
<nodes-per-domain>32</nodes-per-domain>
<home-root>/users</home-root>
<scratch>
<root>/scratch1</root>
</scratch>
<scratch>
<root>/scratch2</root>
</scratch>
<give-root>/givedir</give-root>
</filesystem>
<os>
<type>tru64</type>
</os>
</resource>
<resource>
<name>CA</name>
<type>cluster</type>
<front-end>
<name>cfe1.lanl.gov</name>
<tmp-dir>/scratch1</tmp-dir>
</front-end>
<allocator>lsf</allocator>
<launcher>lsf</launcher>
<arch>
<num-nodes>120</num-nodes>
<cpus-per-node>4</cpus-per-node>
<memory-per-node>4.0</memory-per-node>
<cache>16.0</cache> <!--given in megabytes-->
<interconnect>
<type>quadrics</type>
<num-rails>1</num-rails>
<sw>qsnet</sw>
</interconnect>
<cpu-speed>1250</cpu-speed>
<cpu-type>alpha-ev68</cpu-type>
<cpu-vendor>compaq</cpu-vendor>
</arch>
<filesystem>
<type>trucluster</type>
<fs-domains>4</fs-domains>
<nodes-per-domain>30</nodes-per-domain>
<home-root>/users</home-root>
<scratch>
<root>/scratch1</root>
</scratch>
<give-root>/givedir</give-root>
</filesystem>
<os>
<type>tru64</type>
</os>
</resource>
<resource>
<name>CB</name>
<type>cluster</type>
<front-end>
<name>cfe1.lanl.gov</name>
<tmp-dir>/scratch1</tmp-dir>
</front-end>
<allocator>lsf</allocator>
<launcher>lsf</launcher>
<arch>
<num-nodes>120</num-nodes>
<cpus-per-node>4</cpus-per-node>
<memory-per-node>4.0</memory-per-node>
<cache>16.0</cache> <!--given in megabytes-->
<interconnect>
<type>quadrics</type>
<num-rails>1</num-rails>
<sw>qsnet</sw>
</interconnect>
<cpu-speed>1250</cpu-speed>
<cpu-type>alpha-ev68</cpu-type>
<cpu-vendor>compaq</cpu-vendor>
</arch>
<filesystem>
<type>trucluster</type>
<fs-domains>4</fs-domains>
<nodes-per-domain>30</nodes-per-domain>
<home-root>/users</home-root>
<scratch>
<root>/scratch1</root>
</scratch>
<give-root>/givedir</give-root>
</filesystem>
<os>
<type>tru64</type>
</os>
</resource>
<resource>
<name>CC</name>
<type>cluster</type>
<front-end>
<name>cfe1.lanl.gov</name>
<tmp-dir>/scratch1</tmp-dir>
</front-end>
<allocator>lsf</allocator>
<launcher>lsf</launcher>
<arch>
<num-nodes>120</num-nodes>
<cpus-per-node>4</cpus-per-node>
<memory-per-node>4.0</memory-per-node>
<cache>16.0</cache> <!--given in megabytes-->
<interconnect>
<type>quadrics</type>
<num-rails>1</num-rails>
<sw>qsnet</sw>
</interconnect>
<cpu-speed>1250</cpu-speed>
<cpu-type>alpha-ev68</cpu-type>
<cpu-vendor>compaq</cpu-vendor>
</arch>
<filesystem>
<type>trucluster</type>
<fs-domains>4</fs-domains>
<nodes-per-domain>30</nodes-per-domain>
<home-root>/users</home-root>
<scratch>
<root>/scratch1</root>
</scratch>
<give-root>/givedir</give-root>
</filesystem>
<os>
<type>tru64</type>
</os>
</resource>
<resource>
<name>lambda</name>
<type>cluster</type>
<front-end>
<name>lambda.lanl.gov</name>
<tmp-dir>/scratch</tmp-dir>
</front-end>
<allocator>lsf</allocator>
<launcher>bproc</launcher>
<arch>
<num-nodes>164</num-nodes>
<cpus-per-node>2</cpus-per-node>
<memory-per-node>1.0</memory-per-node>
<interconnect>
<type>gige</type>
<sw>tcp-ip</sw>
</interconnect>
<cpu-speed>1000</cpu-speed>
<cpu-type>pentium-3</cpu-type>
<cpu-vendor>intel</cpu-vendor>
</arch>
<filesystem>
<home-root>/users</home-root>
<scratch>
<root>/scratch</root>
</scratch>
<give-root>/scratch/tmp</give-root>
</filesystem>
<os>
<type>linux</type>
<vendor>Red Hat</vendor>
</os>
</resource>
<resource>
<name>QSC</name>
<type>cluster</type>
<front-end>
<name>qscfe1.lanl.gov</name>
</front-end>
<allocator>lsf</allocator>
<launcher>lsf</launcher>
<os>
<type>tru64</type>
</os>
<arch>
<num-nodes>256</num-nodes>
<cpus-per-node>4</cpus-per-node>
<memory-per-node>16.0</memory-per-node>
<interconnect>
<type>quadrics</type>
</interconnect>
<cpu-speed>1250</cpu-speed>
<cpu-type>alpha-ev6</cpu-type>
<cpu-vendor>compaq</cpu-vendor>
</arch>
<filesystem>
<home-root>/users</home-root>
<scratch>
<root>/scratch1</root>
<filesystem-size>12.0</filesystem-size>
</scratch>
<scratch>
<root>/scratch2</root>
<filesystem-size>12.0</filesystem-size>
</scratch>
<give-root>/givedir</give-root>
</filesystem>
</resource>
<resource>
<name>CX</name>
<type>cluster</type>
<front-end>
<name>cxfe.lanl.gov</name>
<tmp-dir>/scratch1</tmp-dir>
</front-end>
<allocator>lsf</allocator>
<launcher>lsf</launcher>
<arch>
<num-nodes>32</num-nodes>
<cpus-per-node>4</cpus-per-node>
<memory-per-node>4.0</memory-per-node>
<node-arch>
<name>cx0</name>
<memory-per-node>16.0</memory-per-node>
</node-arch>
<node-arch>
<name>cx1</name>
<memory-per-node>16.0</memory-per-node>
</node-arch>
<interconnect>
<type>quadrics</type>
<num-rails>1</num-rails>
<sw>qsnet</sw>
</interconnect>
<cpu-speed>1250</cpu-speed>
<cpu-type>alpha-ev68</cpu-type>
<cpu-vendor>compaq</cpu-vendor>
</arch>
<filesystem>
<type>trucluster</type>
<fs-domains>1</fs-domains>
<nodes-per-domain>32</nodes-per-domain>
<home-root>/users</home-root>
<scratch>
<root>/scratch</root>
</scratch>
<give-root>/givedir</give-root>
</filesystem>
<os>
<type>tru64</type>
</os>
</resource>
<resource>
<name>mauve</name>
<type>smp</type>
<front-end>
<name>mauve.lanl.gov</name>
<tmp-dir>/scratch</tmp-dir>
</front-end>
<allocator>lsf</allocator>
<launcher>lsf</launcher>
<arch>
<num-nodes>256</num-nodes>
<cpus-per-node>1</cpus-per-node>
<shared-memory>1000</shared-memory>
<cpu-speed>1300</cpu-speed>
<cpu-type>itanium-2</cpu-type>
<cpu-vendor>intel</cpu-vendor>
</arch>
<filesystem>
<home-root>/users</home-root>
<scratch>
<root>/scratch</root>
<filesystem-size>50.0</filesystem-size>
</scratch>
</filesystem>
<os>
<type>altix</type>
</os>
</resource>
</site-resources>

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

@ -1,15 +1,24 @@
/*
/* -*- c -*-
*
* Copyright (c) 2004-2005 The Trustees of Indiana University.
* All rights reserved.
* Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
* All rights reserved.
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
* University of Stuttgart. All rights reserved.
* $COPYRIGHT$
*
*
* Additional copyrights may follow
*
*
* $HEADER$
*
* Function: - OS, CPU and compiler dependent configuration
*/
/* Nothing to see here; move along... */
#ifndef ORTE_CONFIG_H_
#define ORTE_CONFIG_H_
#include "ompi_config.h"
#define ORTE_DECLSPEC OMPI_DECLSPEC
#endif

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

@ -109,6 +109,7 @@ SUBDIRS = \
attribute \
communicator \
datatype \
dps \
errhandler \
event \
file \
@ -139,6 +140,7 @@ libmpi_la_LIBADD = \
class/liblfc.la \
communicator/libcommunicator.la \
datatype/libdatatype.la \
dps/libdps.la \
errhandler/liberrhandler.la \
event/libevent.la \
file/libfile.la \
@ -148,23 +150,29 @@ libmpi_la_LIBADD = \
mca/allocator/base/libmca_allocator_base.la $(MCA_allocator_STATIC_LTLIBS) \
mca/coll/base/libmca_coll_base.la $(MCA_coll_STATIC_LTLIBS) \
$(MCA_common_STATIC_LTLIBS) \
mca/errmgr/base/libmca_errmgr_base.la \
mca/gpr/base/pack_api_cmd/libmca_gpr_base_pack.la \
mca/gpr/base/unpack_api_response/libmca_gpr_base_unpack.la \
mca/gpr/base/libmca_gpr_base.la $(MCA_gpr_STATIC_LTLIBS) \
mca/io/base/libmca_io_base.la $(MCA_io_STATIC_LTLIBS) \
mca/iof/base/libmca_iof_base.la $(MCA_iof_STATIC_LTLIBS) \
mca/llm/base/libmca_llm_base.la $(MCA_llm_STATIC_LTLIBS) \
mca/mpool/base/libmca_mpool_base.la $(MCA_mpool_STATIC_LTLIBS) \
mca/ns/base/libmca_ns_base.la $(MCA_ns_STATIC_LTLIBS) \
mca/oob/base/libmca_oob_base.la $(MCA_oob_STATIC_LTLIBS) \
mca/pcm/base/libmca_pcm_base.la $(MCA_pcm_STATIC_LTLIBS) \
mca/pcmclient/base/libmca_pcmclient_base.la $(MCA_pcmclient_STATIC_LTLIBS) \
mca/pls/base/libmca_pls_base.la $(MCA_pls_STATIC_LTLIBS) \
mca/pml/base/libmca_pml_base.la $(MCA_pml_STATIC_LTLIBS) \
mca/ptl/base/libmca_ptl_base.la $(MCA_ptl_STATIC_LTLIBS) \
mca/ras/base/libmca_ras_base.la $(MCA_ras_STATIC_LTLIBS) \
mca/rds/base/libmca_rds_base.la $(MCA_rds_STATIC_LTLIBS) \
mca/rmaps/base/libmca_rmaps_base.la $(MCA_rmaps_STATIC_LTLIBS) \
mca/rmgr/base/libmca_orte_rmgr_base.la $(MCA_rmgr_STATIC_LTLIBS) \
mca/rml/base/libmca_rml_base.la $(MCA_rml_STATIC_LTLIBS) \
mca/soh/base/libmca_soh_base.la $(MCA_soh_STATIC_LTLIBS) \
mca/topo/base/libmca_topo_base.la $(MCA_topo_STATIC_LTLIBS) \
mpi/c/libmpi_c.la $(c_mpi_lib) $(c_pmpi_lib) \
$(f77_base_lib) $(f77_mpi_lib) $(f77_pmpi_lib) \
$(f90_lib) $(cxx_lib) \
mpi/runtime/libmpiruntime.la \
mpi/runtime/libmpiruntime.la \
op/libop.la \
proc/libproc.la \
request/librequest.la \

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

@ -29,7 +29,7 @@
#include "class/ompi_object.h"
#include "class/ompi_bitmap.h"
#include "class/ompi_hash_table.h"
#include "mca/gpr/base/base.h"
#include "mca/gpr/gpr_types.h"
#define ATTR_HASH_SIZE 10
@ -300,7 +300,7 @@ int ompi_attr_create_predefined(void);
* @returns Nothing
*/
void ompi_attr_create_predefined_callback(
ompi_registry_notify_message_t *msg,
orte_gpr_notify_data_t *data,
void *cbdata);

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

@ -15,16 +15,16 @@
#include "ompi_config.h"
#include "mpi.h"
#include "attribute/attribute.h"
#include "util/proc_info.h"
#include "util/bufpack.h"
#include "errhandler/errclass.h"
#include "communicator/communicator.h"
#include "util/proc_info.h"
#include "mca/ns/ns.h"
#include "mca/ns/base/base.h"
#include "mca/gpr/gpr.h"
#include "mca/gpr/base/base.h"
#include "runtime/runtime.h"
#include "mca/errmgr/errmgr.h"
/*
* Private functions
@ -63,37 +63,133 @@ static int attr_impi_host_color = 0;
int ompi_attr_create_predefined(void)
{
ompi_registry_notify_id_t rc;
orte_gpr_notify_id_t rc;
int ret;
orte_gpr_value_t trig, *trig1;
orte_gpr_subscription_t sub, *sub1;
orte_jobid_t job;
if (ORTE_SUCCESS != (ret = orte_ns.get_jobid(&job, orte_process_info.my_name))) {
ORTE_ERROR_LOG(ret);
return ret;
}
OBJ_CONSTRUCT(&sub, orte_gpr_subscription_t);
sub.addr_mode = ORTE_GPR_TOKENS_OR | ORTE_GPR_KEYS_OR;
sub.segment = strdup(ORTE_NODE_SEGMENT);
if (NULL == sub.segment) {
ORTE_ERROR_LOG(ORTE_ERR_OUT_OF_RESOURCE);
OBJ_DESTRUCT(&sub);
return ORTE_ERR_OUT_OF_RESOURCE;
}
sub.tokens = NULL; /* wildcard - look at all containers */
sub.num_tokens = 0;
sub.num_keys = 1;
sub.keys = (char**)malloc(sizeof(char*));
if (NULL == sub.keys) {
ORTE_ERROR_LOG(ORTE_ERR_OUT_OF_RESOURCE);
OBJ_DESTRUCT(&sub);
return ORTE_ERR_OUT_OF_RESOURCE;
}
sub.keys[0] = strdup(ORTE_NODE_SLOTS_KEY);
if (NULL == sub.keys[0]) {
ORTE_ERROR_LOG(ORTE_ERR_OUT_OF_RESOURCE);
OBJ_DESTRUCT(&sub);
return ORTE_ERR_OUT_OF_RESOURCE;
}
sub.cbfunc = ompi_attr_create_predefined_callback;
sub.user_tag = NULL;
/* setup the trigger information */
OBJ_CONSTRUCT(&trig, orte_gpr_value_t);
trig.addr_mode = ORTE_GPR_TOKENS_XAND;
if (ORTE_SUCCESS != (ret = orte_schema.get_job_segment_name(&(trig.segment), job))) {
ORTE_ERROR_LOG(ret);
OBJ_DESTRUCT(&sub);
OBJ_DESTRUCT(&trig);
return ret;
}
trig.tokens = (char**)malloc(sizeof(char*));
if (NULL == trig.tokens) {
ORTE_ERROR_LOG(ORTE_ERR_OUT_OF_RESOURCE);
OBJ_DESTRUCT(&sub);
OBJ_DESTRUCT(&trig);
return ORTE_ERR_OUT_OF_RESOURCE;
}
trig.tokens[0] = strdup(ORTE_JOB_GLOBALS);
trig.num_tokens = 1;
rc = ompi_registry.subscribe(
OMPI_REGISTRY_OR,
OMPI_REGISTRY_NOTIFY_ON_STARTUP|OMPI_REGISTRY_NOTIFY_INCLUDE_STARTUP_DATA,
OMPI_RTE_VM_STATUS_SEGMENT,
NULL,
ompi_attr_create_predefined_callback,
NULL);
if(rc == OMPI_REGISTRY_NOTIFY_ID_MAX) {
trig.cnt = 2;
trig.keyvals = (orte_gpr_keyval_t**)malloc(2*sizeof(orte_gpr_keyval_t*));
if (NULL == trig.keyvals) {
ORTE_ERROR_LOG(ORTE_ERR_OUT_OF_RESOURCE);
OBJ_DESTRUCT(&sub);
OBJ_DESTRUCT(&trig);
return ORTE_ERR_OUT_OF_RESOURCE;
}
trig.keyvals[0] = OBJ_NEW(orte_gpr_keyval_t);
if (NULL == trig.keyvals[0]) {
ORTE_ERROR_LOG(ORTE_ERR_OUT_OF_RESOURCE);
OBJ_DESTRUCT(&sub);
OBJ_DESTRUCT(&trig);
return ORTE_ERR_OUT_OF_RESOURCE;
}
trig.keyvals[0]->key = strdup(ORTE_JOB_SLOTS_KEY);
trig.keyvals[0]->type = ORTE_NULL;
trig.keyvals[1] = OBJ_NEW(orte_gpr_keyval_t);
if (NULL == trig.keyvals[1]) {
ORTE_ERROR_LOG(ORTE_ERR_OUT_OF_RESOURCE);
OBJ_DESTRUCT(&sub);
OBJ_DESTRUCT(&trig);
return ORTE_ERR_OUT_OF_RESOURCE;
}
trig.keyvals[1]->key = strdup(ORTE_PROC_NUM_AT_STG1);
trig.keyvals[1]->type = ORTE_NULL;
/* do the subscription */
sub1 = &sub;
trig1 = &trig;
ret = orte_gpr.subscribe(
ORTE_GPR_TRIG_CMP_LEVELS | ORTE_GPR_TRIG_MONITOR_ONLY |
ORTE_GPR_TRIG_ONE_SHOT,
1, &sub1,
1, &trig1,
&rc);
if(ORTE_SUCCESS != ret) {
ompi_output(0, "ompi_attr_create_predefined: subscribe failed");
OBJ_DESTRUCT(&sub);
OBJ_DESTRUCT(&trig);
return OMPI_ERROR;
}
OBJ_DESTRUCT(&sub);
OBJ_DESTRUCT(&trig);
return OMPI_SUCCESS;
}
void ompi_attr_create_predefined_callback(
ompi_registry_notify_message_t *msg,
void *cbdata)
orte_gpr_notify_data_t *data,
void *cbdata)
{
int err;
ompi_list_item_t *item;
ompi_registry_value_t *reg_value;
ompi_rte_vm_status_t *vm_stat;
int32_t i, j;
orte_gpr_keyval_t **keyval;
orte_gpr_value_t **value;
orte_jobid_t job;
/* Set some default values */
attr_appnum = (int) ompi_name_server.get_jobid(ompi_rte_get_self());
if (ORTE_SUCCESS != orte_ns.get_jobid(&job, orte_process_info.my_name)) {
return;
}
/* Query the registry to find out how many CPUs there will be.
/* Per conversation between Jeff, Edgar, and Ralph - this needs
* to be fixed to properly determine the appnum
*/
attr_appnum = (int)job;
/* Query the gpr to find out how many CPUs there will be.
This will only return a non-empty list in a persistent
universe. If we don't have a persistent universe, then just
default to the size of MPI_COMM_WORLD.
@ -105,7 +201,7 @@ void ompi_attr_create_predefined_callback(
where the master is supposed to SPAWN the other processes.
Perhaps need some integration with the LLM here...? [shrug] */
/* RHC: Needed to change this code so it wouldn't issue a registry.get
/* RHC: Needed to change this code so it wouldn't issue a gpr.get
* during the compound command phase of mpi_init. Since all you need
* is to have the data prior to dtypes etc., and since this function
* is called right before we send the compound command, I've changed
@ -115,24 +211,23 @@ void ompi_attr_create_predefined_callback(
*/
attr_universe_size = 0;
if (0 == ompi_list_get_size(&msg->data)) {
if (0 == data->cnt) { /* no data returned */
attr_universe_size = ompi_comm_size(MPI_COMM_WORLD);
} else {
for (item = ompi_list_remove_first(&msg->data);
NULL != item;
item = ompi_list_remove_first(&msg->data)) {
reg_value = (ompi_registry_value_t *) item;
vm_stat = ompi_rte_unpack_vm_status(reg_value);
/* Process slot count */
attr_universe_size += vm_stat->num_cpus;
/* Discard the rest */
free(vm_stat);
OBJ_RELEASE(item);
value = data->values;
for (i=0; i < data->cnt; i++) {
if (0 < value[i]->cnt) { /* make sure some data was returned here */
keyval = value[i]->keyvals;
for (j=0; j < value[i]->cnt; j++) {
if (ORTE_UINT32 == keyval[j]->type) { /* make sure we don't get confused */
/* Process slot count */
attr_universe_size += keyval[j]->value.ui32;
}
}
}
}
}
OBJ_RELEASE(msg);
OBJ_RELEASE(data);
/* DO NOT CHANGE THE ORDER OF CREATING THESE KEYVALS! This order
strictly adheres to the order in mpi.h. If you change the

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

@ -30,7 +30,9 @@ headers = \
ompi_pointer_array.h \
ompi_proc_table.h \
ompi_value_array.h \
ompi_rb_tree.h
ompi_rb_tree.h \
orte_pointer_array.h \
orte_value_array.h
liblfc_la_SOURCES = \
$(headers) \
@ -42,7 +44,9 @@ liblfc_la_SOURCES = \
ompi_proc_table.c \
ompi_bitmap.c \
ompi_value_array.c \
ompi_rb_tree.c
ompi_rb_tree.c \
orte_pointer_array.c \
orte_value_array.c
# Conditionally install the header files

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

@ -14,6 +14,7 @@
#include "ompi_config.h"
#include "include/constants.h"
#include "class/ompi_list.h"
/*
@ -189,3 +190,32 @@ ompi_list_splice(ompi_list_t *thislist, ompi_list_item_t *pos,
}
}
int ompi_list_sort(ompi_list_t* list, ompi_list_item_compare_fn_t compare)
{
ompi_list_item_t* item;
ompi_list_item_t** items;
size_t i, index=0;
if (0 == list->ompi_list_length) {
return OMPI_SUCCESS;
}
items = (ompi_list_item_t**)malloc(sizeof(ompi_list_item_t*) *
list->ompi_list_length);
if (NULL == items) {
return OMPI_ERR_OUT_OF_RESOURCE;
}
while(NULL != (item = ompi_list_remove_first(list))) {
items[index++] = item;
}
qsort(items, index, sizeof(ompi_list_item_t*),
(int(*)(const void*,const void*))compare);
for (i=0; i<index; i++) {
ompi_list_append(list,items[i]);
}
free(items);
return OMPI_SUCCESS;
}

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

@ -582,6 +582,67 @@ static inline void ompi_list_insert_pos(ompi_list_t *list, ompi_list_item_t *pos
ompi_list_t *xlist, ompi_list_item_t *first,
ompi_list_item_t *last);
/**
* Comparison function for ompi_list_sort(), below.
*
* @param a Pointer to a pointer to an ompi_list_item_t.
* Explanation below.
* @param b Pointer to a pointer to an ompi_list_item_t.
* Explanation below.
* @retval 1 if \em a is greater than \em b
* @retval 0 if \em a is equal to \em b
* @retval 11 if \em a is less than \em b
*
* This function is invoked by qsort(3) from within
* ompi_list_sort(). It is important to understand what
* ompi_list_sort() does before invoking qsort, so go read that
* documentation first.
*
* The important thing to realize here is that a and b will be \em
* double pointers to the items that you need to compare. Here's
* a sample compare function to illustrate this point:
*
* \verb
* static int compare(ompi_list_item_t **a, ompi_list_item_t **b)
* {
* orte_pls_base_cmp_t *aa = *((orte_pls_base_cmp_t **) a);
* orte_pls_base_cmp_t *bb = *((orte_pls_base_cmp_t **) b);
*
* if (bb->priority > aa->priority) {
* return 1;
* } else if (bb->priority == aa->priority) {
* return 0;
* } else {
* return -1;
* }
* }
* \endverb
*/
typedef int (*ompi_list_item_compare_fn_t)(ompi_list_item_t **a,
ompi_list_item_t **b);
/**
* Sort a list with a provided compare function.
*
* @param list The list to sort
* @param compare Compare function
*
* Put crassly, this function's complexity is O(N) + O(log(N)).
* Its algorithm is:
*
* - remove every item from the list and put the corresponding
* (ompi_list_item_t*)'s in an array
* - call qsort(3) with that array and your compare function
* - re-add every element of the now-sorted array to the list
*
* The resulting list is now ordered. Note, however, that since
* an array of pointers is sorted, the comparison function must do
* a double de-reference to get to the actual ompi_list_item_t (or
* whatever the underlying type is). See the documentation of
* ompi_list_item_compare_fn_t for an example).
*/
int ompi_list_sort(ompi_list_t* list, ompi_list_item_compare_fn_t compare);
#if defined(c_plusplus) || defined(__cplusplus)
}
#endif

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

@ -23,13 +23,13 @@
/*
* ompi_process_name_hash_node_t
* orte_process_name_hash_node_t
*/
struct ompi_proc_hash_node_t
{
ompi_list_item_t super;
ompi_process_name_t hn_key;
orte_process_name_t hn_key;
void *hn_value;
};
typedef struct ompi_proc_hash_node_t ompi_proc_hash_node_t;
@ -42,7 +42,7 @@ static OBJ_CLASS_INSTANCE(
void* ompi_hash_table_get_proc(ompi_hash_table_t* ht,
const ompi_process_name_t* proc)
const orte_process_name_t* proc)
{
uint32_t key = (proc->cellid << 24) + (proc->jobid << 16) + proc->vpid;
ompi_list_t* list = ht->ht_table + (key & ht->ht_mask);
@ -58,7 +58,7 @@ void* ompi_hash_table_get_proc(ompi_hash_table_t* ht,
for(node = (ompi_proc_hash_node_t*)ompi_list_get_first(list);
node != (ompi_proc_hash_node_t*)ompi_list_get_end(list);
node = (ompi_proc_hash_node_t*)ompi_list_get_next(node)) {
if (memcmp(&node->hn_key,proc,sizeof(ompi_process_name_t)) == 0) {
if (memcmp(&node->hn_key,proc,sizeof(orte_process_name_t)) == 0) {
return node->hn_value;
}
}
@ -68,7 +68,7 @@ void* ompi_hash_table_get_proc(ompi_hash_table_t* ht,
int ompi_hash_table_set_proc(
ompi_hash_table_t* ht,
const ompi_process_name_t* proc,
const orte_process_name_t* proc,
void* value)
{
uint32_t key = (proc->cellid << 24) + (proc->jobid << 16) + proc->vpid;
@ -85,7 +85,7 @@ int ompi_hash_table_set_proc(
for(node = (ompi_proc_hash_node_t*)ompi_list_get_first(list);
node != (ompi_proc_hash_node_t*)ompi_list_get_end(list);
node = (ompi_proc_hash_node_t*)ompi_list_get_next(node)) {
if (memcmp(&node->hn_key,proc,sizeof(ompi_process_name_t)) == 0) {
if (memcmp(&node->hn_key,proc,sizeof(orte_process_name_t)) == 0) {
node->hn_value = value;
return OMPI_SUCCESS;
}
@ -107,7 +107,7 @@ int ompi_hash_table_set_proc(
int ompi_hash_table_remove_proc(
ompi_hash_table_t* ht,
const ompi_process_name_t* proc)
const orte_process_name_t* proc)
{
uint32_t key = (proc->cellid << 24) + (proc->jobid << 16) + proc->vpid;
ompi_list_t* list = ht->ht_table + (key & ht->ht_mask);
@ -123,7 +123,7 @@ int ompi_hash_table_remove_proc(
for(node = (ompi_proc_hash_node_t*)ompi_list_get_first(list);
node != (ompi_proc_hash_node_t*)ompi_list_get_end(list);
node = (ompi_proc_hash_node_t*)ompi_list_get_next(node)) {
if (memcmp(&node->hn_key,proc,sizeof(ompi_process_name_t)) == 0) {
if (memcmp(&node->hn_key,proc,sizeof(orte_process_name_t)) == 0) {
ompi_list_remove_item(list, (ompi_list_item_t*)node);
ompi_list_append(&ht->ht_nodes, (ompi_list_item_t*)node);
ht->ht_size--;

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

@ -15,14 +15,14 @@
/** @file
*
* A hash table indexed by ompi_process_name_t.
* A hash table indexed by orte_process_name_t.
*/
#ifndef OMPI_PROC_TABLE_H
#define OMPI_PROC_TABLE_H
#include "class/ompi_hash_table.h"
#include "mca/ns/ns.h"
#include "mca/ns/ns_types.h"
#if defined(c_plusplus) || defined(__cplusplus)
extern "C" {
@ -30,7 +30,7 @@ extern "C" {
/**
* Retrieve value via ompi_process_name_t key.
* Retrieve value via orte_process_name_t key.
*
* @param table The input hash table (IN).
* @param key The input key (IN).
@ -40,7 +40,7 @@ extern "C" {
OMPI_DECLSPEC void *ompi_hash_table_get_proc(
ompi_hash_table_t* table,
const ompi_process_name_t* key);
const orte_process_name_t* key);
/**
* Set value based on uint32_t key.
@ -54,7 +54,7 @@ OMPI_DECLSPEC void *ompi_hash_table_get_proc(
OMPI_DECLSPEC int ompi_hash_table_set_proc(
ompi_hash_table_t* table,
const ompi_process_name_t*,
const orte_process_name_t*,
void* value);
/**
@ -68,7 +68,7 @@ OMPI_DECLSPEC int ompi_hash_table_set_proc(
OMPI_DECLSPEC int ompi_hash_table_remove_proc(
ompi_hash_table_t* table,
const ompi_process_name_t* key);
const orte_process_name_t* key);
#if defined(c_plusplus) || defined(__cplusplus)

389
src/class/orte_pointer_array.c Обычный файл
Просмотреть файл

@ -0,0 +1,389 @@
/*
* Copyright (c) 2004-2005 The Trustees of Indiana University.
* All rights reserved.
* Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
* All rights reserved.
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
* University of Stuttgart. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
#include "orte_config.h"
#include <stdlib.h>
#include <stdio.h>
#include <assert.h>
#include "include/orte_constants.h"
#include "class/orte_pointer_array.h"
#include "util/output.h"
static void orte_pointer_array_construct(orte_pointer_array_t *);
static void orte_pointer_array_destruct(orte_pointer_array_t *);
static bool grow_table(orte_pointer_array_t *table);
OBJ_CLASS_INSTANCE(orte_pointer_array_t, ompi_object_t,
orte_pointer_array_construct,
orte_pointer_array_destruct);
/*
* orte_pointer_array constructor
*/
void orte_pointer_array_construct(orte_pointer_array_t *array)
{
OBJ_CONSTRUCT(&array->lock, ompi_mutex_t);
array->lowest_free = 0;
array->number_free = 0;
array->size = 0;
array->max_size = 0;
array->block_size = 0;
array->addr = 0;
}
/*
* orte_pointer_array destructor
*/
void orte_pointer_array_destruct(orte_pointer_array_t *array)
{
/* free table */
if( NULL != array->addr) {
free(array->addr);
}
OBJ_DESTRUCT(&array->lock);
}
/**
* initialize an array object
*/
int orte_pointer_array_init(orte_pointer_array_t **array,
int initial_allocation,
int max_size, int block_size)
{
size_t num_bytes;
/* check for errors */
if (NULL == array || max_size < block_size) {
return ORTE_ERR_BAD_PARAM;
}
*array = OBJ_NEW(orte_pointer_array_t);
if (NULL == *array) {
return ORTE_ERR_OUT_OF_RESOURCE;
}
(*array)->max_size = max_size;
(*array)->block_size = block_size;
if (0 < initial_allocation) {
num_bytes = initial_allocation * sizeof(void*);
(*array)->number_free = initial_allocation;
(*array)->size = initial_allocation;
} else {
num_bytes = block_size * sizeof(void*);
(*array)->number_free = block_size;
(*array)->size = block_size;
}
(*array)->addr = (void *)malloc(num_bytes);
if (NULL == (*array)->addr) { /* out of memory */
OBJ_RELEASE(*array);
return ORTE_ERR_OUT_OF_RESOURCE;
}
/* init the array elements to NULL */
memset((*array)->addr, 0, num_bytes);
return ORTE_SUCCESS;
}
/**
* add a pointer to dynamic pointer table
*
* @param table Pointer to orte_pointer_array_t object (IN)
* @param ptr Pointer to be added to table (IN)
*
* @return Array index where ptr is inserted or OMPI_ERROR if it fails
*/
int orte_pointer_array_add(orte_pointer_array_t *table, void *ptr)
{
int i;
int index;
if (0) {
ompi_output(0,"orte_pointer_array_add: IN: "
" table %p (size %ld, lowest free %ld, number free %ld)"
" ptr = %p\n",
table, table->size, table->lowest_free, table->number_free,
ptr);
}
assert(table != NULL);
OMPI_THREAD_LOCK(&(table->lock));
if (table->number_free == 0) {
/* need to grow table */
if (!grow_table(table)) {
OMPI_THREAD_UNLOCK(&(table->lock));
return ORTE_ERR_OUT_OF_RESOURCE;
}
}
assert(table->addr != NULL);
assert(table->size > 0);
assert(table->lowest_free >= 0);
assert(table->lowest_free < table->size);
assert(table->number_free > 0);
assert(table->number_free <= table->size);
/*
* add pointer to table, and return the index
*/
index = table->lowest_free;
assert(table->addr[index] == NULL);
table->addr[index] = ptr;
table->number_free--;
if (table->number_free > 0) {
for (i = table->lowest_free + 1; i < table->size; i++) {
if (table->addr[i] == NULL) {
table->lowest_free = i;
break;
}
}
}
else {
table->lowest_free = table->size;
}
if (0) {
ompi_output(0,"orte_pointer_array_add: OUT: "
" table %p (size %ld, lowest free %ld, number free %ld)"
" addr[%d] = %p\n",
table, table->size, table->lowest_free, table->number_free,
index, ptr);
}
OMPI_THREAD_UNLOCK(&(table->lock));
return index;
}
/**
* free a slot in dynamic pointer table for reuse
*
*
* @param table Pointer to orte_pointer_array_t object (IN)
* @param ptr Pointer to be added to table (IN)
*
* @return Error code
*
* Assumption: NULL element is free element.
*/
int orte_pointer_array_set_item(orte_pointer_array_t *table, int index,
void * value)
{
assert(table != NULL);
#if 0
ompi_output(0,"orte_pointer_array_set_item: IN: "
" table %p (size %ld, lowest free %ld, number free %ld)"
" addr[%d] = %p\n",
table, table->size, table->lowest_free, table->number_free,
index, table->addr[index]);
#endif
/* expand table if required to set a specific index */
OMPI_THREAD_LOCK(&(table->lock));
if (table->size <= index) {
if (!grow_table(table)) {
OMPI_THREAD_UNLOCK(&(table->lock));
return ORTE_ERROR;
}
}
/*
* allow a specific index to be changed.
*/
if ( NULL == table->addr[index] ) {
table->addr[index] = value;
/* mark element as free, if NULL element */
if( NULL == value ) {
if (index < table->lowest_free) {
table->lowest_free = index;
}
}
else {
table->number_free--;
/* Reset lowest_free if required */
if ( index == table->lowest_free ) {
int i;
table->lowest_free=table->size;
for ( i=index; i<table->size; i++) {
if ( NULL == table->addr[i] ){
table->lowest_free = i;
break;
}
}
}
}
}
else {
table->addr[index] = value;
/* mark element as free, if NULL element */
if( NULL == value ) {
if (index < table->lowest_free) {
table->lowest_free = index;
}
table->number_free++;
}
else {
/* Reset lowest_free if required */
if ( index == table->lowest_free ) {
int i;
table->lowest_free=table->size;
for ( i=index; i<table->size; i++) {
if ( NULL == table->addr[i] ){
table->lowest_free = i;
break;
}
}
}
}
}
#if 0
ompi_output(0,"orte_pointer_array_set_item: OUT: "
" table %p (size %ld, lowest free %ld, number free %ld)"
" addr[%d] = %p\n",
table, table->size, table->lowest_free, table->number_free,
index, table->addr[index]);
#endif
OMPI_THREAD_UNLOCK(&(table->lock));
return ORTE_SUCCESS;
}
/**
* Test whether a certain element is already in use. If not yet
* in use, reserve it.
*
* @param array Pointer to array (IN)
* @param index Index of element to be tested (IN)
* @param value New value to be set at element index (IN)
*
* @return true/false True if element could be reserved
* False if element could not be reserved (e.g.in use).
*
* In contrary to array_set, this function does not allow to overwrite
* a value, unless the previous value is NULL ( equiv. to free ).
*/
bool orte_pointer_array_test_and_set_item (orte_pointer_array_t *table,
int index, void *value)
{
assert(table != NULL);
assert(index >= 0);
#if 0
ompi_output(0,"orte_pointer_array_test_and_set_item: IN: "
" table %p (size %ld, lowest free %ld, number free %ld)"
" addr[%d] = %p\n",
table, table->size, table->lowest_free, table->number_free,
index, table->addr[index]);
#endif
/* expand table if required to set a specific index */
OMPI_THREAD_LOCK(&(table->lock));
if ( index < table->size && table->addr[index] != NULL ) {
/* This element is already in use */
OMPI_THREAD_UNLOCK(&(table->lock));
return false;
}
/* Do we need to grow the table? */
if (table->size <= index) {
if (!grow_table(table)) {
OMPI_THREAD_UNLOCK(&(table->lock));
return false;
}
}
/*
* allow a specific index to be changed.
*/
table->addr[index] = value;
table->number_free--;
/* Reset lowest_free if required */
if ( index == table->lowest_free ) {
int i;
table->lowest_free = table->size;
for ( i=index; i<table->size; i++) {
if ( NULL == table->addr[i] ){
table->lowest_free = i;
break;
}
}
}
#if 0
ompi_output(0,"orte_pointer_array_test_and_set_item: OUT: "
" table %p (size %ld, lowest free %ld, number free %ld)"
" addr[%d] = %p\n",
table, table->size, table->lowest_free, table->number_free,
index, table->addr[index]);
#endif
OMPI_THREAD_UNLOCK(&(table->lock));
return true;
}
static bool grow_table(orte_pointer_array_t *table)
{
int new_size;
int i;
void *p;
/* Ensure that we have room to grow -- stay less than
* specified maximum
*/
if (table->size >= table->max_size) {
return false;
}
if (table->block_size > (table->max_size - table->size)) { /* not enough space for a full block */
new_size = table->max_size;
} else {
new_size = table->size + table->block_size;
}
p = (void **) realloc(table->addr, new_size * sizeof(void *));
if (p == NULL) {
return false;
}
/* Adjust structure counters and pointers */
table->number_free += new_size - table->size;
table->addr = p;
for (i = table->size; i < new_size; ++i) {
table->addr[i] = NULL;
}
table->size = new_size;
return true;
}

212
src/class/orte_pointer_array.h Обычный файл
Просмотреть файл

@ -0,0 +1,212 @@
/*
* Copyright (c) 2004-2005 The Trustees of Indiana University.
* All rights reserved.
* Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
* All rights reserved.
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
* University of Stuttgart. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
/** @file
*
* Utility functions to manage fortran <-> c opaque object
* translation. Note that since MPI defines fortran handles as
* [signed] int's, we use int everywhere in here where you would
* normally expect int. There's some code that makes sure indices
* don't go above FORTRAN_HANDLE_MAX (which is min(INT_MAX, fortran
* INTEGER max)), just to be sure.
*/
#ifndef ORTE_POINTER_ARRAY_H
#define ORTE_POINTER_ARRAY_H
#include "orte_config.h"
#include "threads/mutex.h"
#include "class/ompi_object.h"
#if defined(c_plusplus) || defined(__cplusplus)
extern "C" {
#endif
/**
* dynamic pointer array
*/
struct orte_pointer_array_t {
/** base class */
ompi_object_t super;
/** synchronization object */
ompi_mutex_t lock;
/** Index of lowest free element. NOTE: This is only an
optimization to know where to search for the first free slot.
It does \em not necessarily imply indices all above this index
are not taken! */
int lowest_free;
/** number of free elements in the list */
int number_free;
/** size of list, i.e. number of elements in addr */
int size;
/** maximum size list is allowed to reach */
int max_size;
/** growth steps for list */
int block_size;
/** pointer to array of pointers */
void **addr;
};
/**
* Convenience typedef
*/
typedef struct orte_pointer_array_t orte_pointer_array_t;
/**
* Class declaration
*/
OMPI_DECLSPEC OBJ_CLASS_DECLARATION(orte_pointer_array_t);
/**
* Initialize the pointer array
*
* @param array Address of the pointer array object to be initialized
* @param initial_alloc The initial number of elements to be allocated
* @param max_size Maximum size the array is allowed to reach
* @param block_size Number of array elements to be added when increase required
*
* @retval ORTE_SUCCESS Initialization successful
* @retval ORTE_ERROR(s) Appropriate error code
*
*/
OMPI_DECLSPEC int orte_pointer_array_init(orte_pointer_array_t **array,
int initial_allocation,
int max_size, int block_size);
/**
* Add a pointer to the array (Grow the array, if need be)
*
* @param array Pointer to array (IN)
* @param ptr Pointer value (IN)
*
* @return Index of inserted array element. Return value of
* (-1) indicates an error.
*/
OMPI_DECLSPEC int orte_pointer_array_add(orte_pointer_array_t *array, void *ptr);
/**
* Set the value of an element in array
*
* @param array Pointer to array (IN)
* @param index Index of element to be reset (IN)
* @param value New value to be set at element index (IN)
*
* @return Error code. (-1) indicates an error.
*/
OMPI_DECLSPEC int orte_pointer_array_set_item(orte_pointer_array_t *array,
int index, void *value);
/**
* Get the value of an element in array
*
* @param array Pointer to array (IN)
* @param index Index of element to be returned (IN)
*
* @return Error code. NULL indicates an error.
*/
static inline void *orte_pointer_array_get_item(orte_pointer_array_t *table,
int index)
{
void *p;
OMPI_THREAD_LOCK(&(table->lock));
p = table->addr[index];
OMPI_THREAD_UNLOCK(&(table->lock));
return p;
}
/**
* Get the size of the pointer array
*
* @param array Pointer to array (IN)
*
* @returns size Size of the array
*
* Simple inline function to return the size of the array in order to
* hide the member field from external users.
*/
static inline int orte_pointer_array_get_size(orte_pointer_array_t *array)
{
return array->size;
}
/**
* Clear the pointer array
*
* @param array Pointer to array (IN)
*
* @returns void
*
* Simple inline function to clear the pointer array and reset all
* counters.
*/
static inline void orte_pointer_array_clear(orte_pointer_array_t *array)
{
int i;
OMPI_THREAD_LOCK(&(array->lock));
for (i=0; i < array->size; i++) {
array->addr[i] = NULL;
}
array->lowest_free = 0;
array->number_free = array->size;
OMPI_THREAD_UNLOCK(&(array->lock));
}
/**
* Clear the pointer array, freeing any storage
*
* @param array Pointer to array (IN)
*
* @returns void
*
* Simple inline function to clear the pointer array and reset all
* counters.
*/
static inline void orte_pointer_array_free_clear(orte_pointer_array_t *array)
{
int i;
OMPI_THREAD_LOCK(&(array->lock));
for (i=0; i < array->size; i++) {
if (NULL != array->addr[i]) free(array->addr[i]);
array->addr[i] = NULL;
}
array->lowest_free = 0;
array->number_free = array->size;
OMPI_THREAD_UNLOCK(&(array->lock));
}
/**
* Test whether a certain element is already in use. If not yet
* in use, reserve it.
*
* @param array Pointer to array (IN)
* @param index Index of element to be tested (IN)
* @param value New value to be set at element index (IN)
*
* @return true/false True if element could be reserved
* False if element could not be reserved (e.g., in use).
*
* In contrary to array_set, this function does not allow to overwrite
* a value, unless the previous value is NULL ( equiv. to free ).
*/
OMPI_DECLSPEC bool orte_pointer_array_test_and_set_item (orte_pointer_array_t *table,
int index,
void *value);
#if defined(c_plusplus) || defined(__cplusplus)
}
#endif
#endif /* OMPI_POINTER_ARRAY_H */

63
src/class/orte_value_array.c Обычный файл
Просмотреть файл

@ -0,0 +1,63 @@
/*
* Copyright (c) 2004-2005 The Trustees of Indiana University.
* All rights reserved.
* Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
* All rights reserved.
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
* University of Stuttgart. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
#include "orte_config.h"
#include "include/orte_constants.h"
#include "class/orte_value_array.h"
static void orte_value_array_construct(orte_value_array_t* array)
{
array->array_items = NULL;
array->array_size = 0;
array->array_item_sizeof = 0;
array->array_alloc_size = 0;
}
static void orte_value_array_destruct(orte_value_array_t* array)
{
if (NULL != array->array_items)
free(array->array_items);
}
ompi_class_t orte_value_array_t_class = {
"orte_value_array_t",
OBJ_CLASS(ompi_object_t),
(ompi_construct_t)orte_value_array_construct,
(ompi_destruct_t)orte_value_array_destruct
};
int orte_value_array_set_size(orte_value_array_t* array, size_t size)
{
#if OMPI_ENABLE_DEBUG
if(array->array_item_sizeof == 0) {
ompi_output(0, "orte_value_array_set_size: item size must be initialized");
return ORTE_ERR_BAD_PARAM;
}
#endif
if(size > array->array_alloc_size) {
while(array->array_alloc_size < size)
array->array_alloc_size <<= 1;
array->array_items = (unsigned char *)realloc(array->array_items,
array->array_alloc_size * array->array_item_sizeof);
if (NULL == array->array_items)
return ORTE_ERR_OUT_OF_RESOURCE;
}
array->array_size = size;
return ORTE_SUCCESS;
}

278
src/class/orte_value_array.h Обычный файл
Просмотреть файл

@ -0,0 +1,278 @@
/*
* Copyright (c) 2004-2005 The Trustees of Indiana University.
* All rights reserved.
* Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
* All rights reserved.
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
* University of Stuttgart. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
#ifndef ORTE_VALUE_ARRAY_H
#define ORTE_VALUE_ARRAY_H
#include <string.h>
#include "orte_config.h"
#include "include/orte_constants.h"
#include "include/orte_types.h"
#include "class/ompi_object.h"
#if OMPI_ENABLE_DEBUG
#include "util/output.h"
#endif
/*
* @file Array of elements maintained by value.
*/
#if defined(c_plusplus) || defined(__cplusplus)
extern "C" {
#endif
OMPI_DECLSPEC extern ompi_class_t orte_value_array_t_class;
struct orte_value_array_t
{
ompi_object_t super;
unsigned char* array_items;
size_t array_item_sizeof;
size_t array_size;
size_t array_alloc_size;
};
typedef struct orte_value_array_t orte_value_array_t;
/**
* Initialize the array to hold items by value. This routine must
* be called prior to using the array.
*
* @param array The array to initialize (IN).
* @param item_size The sizeof each array element (IN).
* @return ORTE error code
*
* Note that there is no corresponding "finalize" function -- use
* OBJ_DESTRUCT (for stack arrays) or OBJ_RELEASE (for heap arrays) to
* delete it.
*/
static inline int orte_value_array_init(orte_value_array_t *array, size_t item_sizeof)
{
array->array_item_sizeof = item_sizeof;
array->array_alloc_size = 1;
array->array_size = 0;
array->array_items = (unsigned char*)realloc(array->array_items, item_sizeof * array->array_alloc_size);
return (NULL != array->array_items) ? ORTE_SUCCESS : ORTE_ERR_OUT_OF_RESOURCE;
}
/**
* Reserve space in the array for new elements, but do not change the size.
*
* @param array The input array (IN).
* @param size The anticipated size of the array (IN).
* @return ORTE error code.
*/
static inline int orte_value_array_reserve(orte_value_array_t* array, size_t size)
{
if(size > array->array_alloc_size) {
array->array_items = (unsigned char*)realloc(array->array_items, array->array_item_sizeof * size);
if(NULL == array->array_items) {
array->array_size = 0;
array->array_alloc_size = 0;
return ORTE_ERR_OUT_OF_RESOURCE;
}
array->array_alloc_size = 1;
}
return ORTE_SUCCESS;
}
/**
* Retreives the number of elements in the array.
*
* @param array The input array (IN).
* @return The number of elements currently in use.
*/
static inline size_t orte_value_array_get_size(orte_value_array_t* array)
{
return array->array_size;
}
/**
* Set the number of elements in the array.
*
* @param array The input array (IN).
* @param size The new array size.
*
* @return ORTE error code.
*
* Note that resizing the array to a smaller size may not change
* the underlying memory allocated by the array. However, setting
* the size larger than the current allocation will grow it. In either
* case, if the routine is successful, orte_value_array_get_size() will
* return the new size.
*/
int orte_value_array_set_size(orte_value_array_t* array, size_t size);
/**
* Macro to retrieve an item from the array by value.
*
* @param array The input array (IN).
* @param item_type The C datatype of the array item (IN).
* @param item_index The array index (IN).
*
* @returns item The requested item.
*
* Note that this does not change the size of the array - this macro is
* strictly for performance - the user assumes the responsibility of
* ensuring the array index is valid (0 <= item index < array size).
*/
#define ORTE_VALUE_ARRAY_GET_ITEM(array, item_type, item_index) \
((item_type*)((array)->array_items))[item_index]
/**
* Retrieve an item from the array by reference.
*
* @param array The input array (IN).
* @param index The array index (IN).
*
* @return ptr Pointer to the requested item.
*
* Note that if the specified index is larger than the current
* array size, the array is grown to satisfy the request.
*/
static inline void* orte_value_array_get_item(orte_value_array_t *array, size_t index)
{
if(index >= array->array_size && orte_value_array_set_size(array, index+1) != ORTE_SUCCESS)
return NULL;
return array->array_items + (index * array->array_item_sizeof);
}
/**
* Macro to set an array element by value.
*
* @param array The input array (IN).
* @param item_type The C datatype of the array item (IN).
* @param item_index The array index (IN).
* @param item_value The new value for the specified index (IN).
*
* Note that this does not change the size of the array - this macro is
* strictly for performance - the user assumes the responsibility of
* ensuring the array index is valid (0 <= item index < array size).
*
* It is safe to free the item after returning from this call; it is
* copied into the array by value.
*/
#define ORTE_VALUE_ARRAY_SET_ITEM(array, item_type, item_index, item_value) \
(((item_type*)((array)->array_items))[item_index] = item_value)
/**
* Set an array element by value.
*
* @param array The input array (IN).
* @param item_index The array index (IN).
* @param item_value A pointer to the item, which is copied into
* the array.
*
* @return ORTE error code.
*
* It is safe to free the item after returning from this call; it is
* copied into the array by value.
*/
static inline int orte_value_array_set_item(orte_value_array_t *array, size_t index, const void* item)
{
int rc;
if(index >= array->array_size &&
(rc = orte_value_array_set_size(array, index+1)) != ORTE_SUCCESS)
return rc;
memcpy(array->array_items + (index * array->array_item_sizeof), item, array->array_item_sizeof);
return ORTE_SUCCESS;
}
/**
* Appends an item to the end of the array.
*
* @param array The input array (IN).
* @param item A pointer to the item to append, which is copied
* into the array.
*
* @return ORTE error code
*
* This will grow the array if it is not large enough to contain the
* item. It is safe to free the item after returning from this call;
* it is copied by value into the array.
*/
static inline int orte_value_array_append_item(orte_value_array_t *array, const void *item)
{
return orte_value_array_set_item(array, array->array_size, item);
}
/**
* Remove a specific item from the array.
*
* @param array The input array (IN).
* @param index The index to remove, which must be less than
* the current array size (IN).
*
* @return ORTE error code.
*
* All elements following this index are shifted down.
*/
static inline int orte_value_array_remove_item(orte_value_array_t *array, size_t index)
{
#if OMPI_ENABLE_DEBUG
if (index >= array->array_size) {
ompi_output(0, "orte_value_array_remove_item: invalid index %d\n", index);
return ORTE_ERR_BAD_PARAM;
}
#endif
memmove(array->array_items+(array->array_item_sizeof * index),
array->array_items+(array->array_item_sizeof * (index+1)),
array->array_item_sizeof * (array->array_size - index - 1));
array->array_size--;
return ORTE_SUCCESS;
}
/**
* Get the base pointer of the underlying array.
*
* @param array The input array (IN).
* @param array_type The C datatype of the array (IN).
*
* @returns ptr Pointer to the actual array.
*
* This function is helpful when you need to iterate through an
* entire array; simply get the base value of the array and use native
* C to iterate through it manually. This can have better performance
* than looping over ORTE_VALUE_ARRAY_GET_ITEM() and
* ORTE_VALUE_ARRAY_SET_ITEM() because it will [potentially] reduce the
* number of pointer dereferences.
*/
#define ORTE_VALUE_ARRAY_GET_BASE(array, item_type) \
((item_type*) ((array)->array_items))
#if defined(c_plusplus) || defined(__cplusplus)
}
#endif
#endif

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

@ -18,12 +18,14 @@
#include "mpi.h"
#include "include/constants.h"
#include "dps/dps.h"
#include "proc/proc.h"
#include "threads/mutex.h"
#include "util/bit_ops.h"
#include "util/output.h"
#include "mca/topo/topo.h"
#include "mca/topo/base/base.h"
#include "mca/ns/base/base.h"
#include "mca/ns/ns.h"
#include "attribute/attribute.h"
#include "communicator/communicator.h"
@ -742,7 +744,7 @@ ompi_proc_t **ompi_comm_get_rprocs ( ompi_communicator_t *local_comm,
ompi_communicator_t *bridge_comm,
int local_leader,
int remote_leader,
int tag,
orte_rml_tag_t tag,
int rsize)
{
@ -752,7 +754,7 @@ ompi_proc_t **ompi_comm_get_rprocs ( ompi_communicator_t *local_comm,
ompi_proc_t **rprocs=NULL;
char *rnamebuf=NULL;
int len, rlen;
ompi_buffer_t sbuf, rbuf;
orte_buffer_t *sbuf=NULL, *rbuf=NULL;
void *sendbuf;
char *recvbuf;
@ -760,14 +762,20 @@ ompi_proc_t **ompi_comm_get_rprocs ( ompi_communicator_t *local_comm,
local_size = ompi_comm_size (local_comm);
if (local_rank == local_leader) {
ompi_buffer_init(&sbuf, local_size*sizeof(ompi_process_name_t));
sbuf = OBJ_NEW(orte_buffer_t);
if (NULL == sbuf) {
rc = ORTE_ERROR;
goto err_exit;
}
rc = ompi_proc_get_namebuf (local_comm->c_local_group->grp_proc_pointers,
local_size, sbuf);
if ( OMPI_SUCCESS != rc ) {
goto err_exit;
}
ompi_buffer_get(sbuf, &sendbuf, &len);
if (ORTE_SUCCESS != (rc = orte_dps.unload(sbuf, &sendbuf, (size_t*)&len))) {
goto err_exit;
}
/* send the remote_leader the length of the buffer */
rc = mca_pml.pml_irecv (&rlen, 1, MPI_INT, remote_leader, tag,
@ -799,7 +807,16 @@ ompi_proc_t **ompi_comm_get_rprocs ( ompi_communicator_t *local_comm,
if ( NULL == recvbuf ) {
goto err_exit;
}
ompi_buffer_init_preallocated(&rbuf, recvbuf, rlen);
rbuf = OBJ_NEW(orte_buffer_t);
if (NULL == rbuf) {
rc = ORTE_ERROR;
goto err_exit;
}
if (ORTE_SUCCESS != (rc = orte_dps.load(rbuf, recvbuf, rlen))) {
goto err_exit;
}
if ( local_rank == local_leader ) {
/* local leader exchange name lists */
@ -818,7 +835,7 @@ ompi_proc_t **ompi_comm_get_rprocs ( ompi_communicator_t *local_comm,
goto err_exit;
}
ompi_buffer_free(sbuf);
OBJ_RELEASE(sbuf);
}
/* broadcast name list to all proceses in local_comm */
@ -830,7 +847,7 @@ ompi_proc_t **ompi_comm_get_rprocs ( ompi_communicator_t *local_comm,
/* decode the names into a proc-list */
rc = ompi_proc_get_proclist (rbuf, rsize, &rprocs );
ompi_buffer_free (rbuf);
OBJ_RELEASE(rbuf);
err_exit:
if ( NULL != rnamebuf) {
@ -839,12 +856,19 @@ ompi_proc_t **ompi_comm_get_rprocs ( ompi_communicator_t *local_comm,
/* rprocs isn't freed unless we have an error,
since it is used in the communicator */
if ( OMPI_SUCCESS !=rc ) {
printf("%d: Error in ompi_get_rprocs\n", local_rank);
ompi_output(0, "%d: Error in ompi_get_rprocs\n", local_rank);
if ( NULL != rprocs ) {
free ( rprocs );
rprocs=NULL;
}
}
/* make sure the buffers have been released */
if (NULL != sbuf) {
OBJ_RELEASE(sbuf);
}
if (NULL != rbuf) {
OBJ_RELEASE(rbuf);
}
return rprocs;
}
@ -885,7 +909,7 @@ int ompi_comm_determine_first ( ompi_communicator_t *intercomm, int high )
int scount=0;
int rc;
ompi_proc_t *ourproc, *theirproc;
ompi_ns_cmp_bitmask_t mask;
orte_ns_cmp_bitmask_t mask;
rank = ompi_comm_rank (intercomm);
rsize= ompi_comm_remote_size (intercomm);
@ -926,9 +950,8 @@ int ompi_comm_determine_first ( ompi_communicator_t *intercomm, int high )
ourproc = intercomm->c_local_group->grp_proc_pointers[0];
theirproc = intercomm->c_remote_group->grp_proc_pointers[0];
mask = OMPI_NS_CMP_CELLID | OMPI_NS_CMP_JOBID | OMPI_NS_CMP_VPID;
rc = ompi_name_server.compare (mask, &(ourproc->proc_name),
&(theirproc->proc_name));
mask = ORTE_NS_CMP_CELLID | ORTE_NS_CMP_JOBID | ORTE_NS_CMP_VPID;
rc = orte_ns.compare (mask, &(ourproc->proc_name), &(theirproc->proc_name));
if ( 0 > rc ) {
flag = true;
}
@ -949,25 +972,25 @@ int ompi_comm_dump ( ompi_communicator_t *comm )
ompi_list_t *list;
int i;
printf("Dumping information for comm_cid %d\n", comm->c_contextid);
printf(" f2c index:%d cube_dim: %d\n", comm->c_f_to_c_index,
ompi_output(0, "Dumping information for comm_cid %d\n", comm->c_contextid);
ompi_output(0," f2c index:%d cube_dim: %d\n", comm->c_f_to_c_index,
comm->c_cube_dim);
printf(" Local group: size = %d my_rank = %d\n",
ompi_output(0," Local group: size = %d my_rank = %d\n",
comm->c_local_group->grp_proc_count,
comm->c_local_group->grp_my_rank );
printf(" Communicator is:");
ompi_output(0," Communicator is:");
/* Display flags */
if ( OMPI_COMM_IS_INTER(comm) )
printf(" inter-comm,");
ompi_output(0," inter-comm,");
if ( OMPI_COMM_IS_CART(comm))
printf(" topo-cart,");
ompi_output(0," topo-cart,");
if ( OMPI_COMM_IS_GRAPH(comm))
printf(" topo-graph");
printf("\n");
ompi_output(0," topo-graph");
ompi_output(0,"\n");
if (OMPI_COMM_IS_INTER(comm)) {
printf(" Remote group size:%d\n", comm->c_remote_group->grp_proc_count);
ompi_output(0," Remote group size:%d\n", comm->c_remote_group->grp_proc_count);
}
@ -976,7 +999,7 @@ int ompi_comm_dump ( ompi_communicator_t *comm )
seq = (mca_ptl_sequence_t *) pml_comm->c_frags_cant_match;
for ( i = 0; i < comm->c_local_group->grp_proc_count; i++ ){
list = (ompi_list_t *)seq+i;
printf("%d: head->list_next:%p head->list_prev:%p"
ompi_output(0,"%d: head->list_next:%p head->list_prev:%p"
" tail->list_next:%p tail->list_next:%p\n",
i,
(char*)list->ompi_list_head.ompi_list_next,

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

@ -17,17 +17,20 @@
#include <stdio.h>
#include "mpi.h"
#include "dps/dps.h"
#include "mca/ns/ns_types.h"
#include "communicator/communicator.h"
#include "op/op.h"
#include "proc/proc.h"
#include "include/constants.h"
#include "class/ompi_pointer_array.h"
#include "class/ompi_list.h"
#include "mca/pcm/pcm.h"
#include "mca/pml/pml.h"
#include "mca/coll/coll.h"
#include "mca/coll/base/base.h"
#include "mca/oob/oob.h"
#include "mca/rml/rml.h"
#define OMPI_MAX_COMM 32768
@ -606,10 +609,10 @@ static int ompi_comm_allreduce_intra_oob (int *inbuf, int *outbuf,
int i;
int rc;
int local_leader, local_rank;
ompi_process_name_t *remote_leader=NULL;
orte_process_name_t *remote_leader=NULL;
local_leader = (*((int*)lleader));
remote_leader = (ompi_process_name_t*)rleader;
remote_leader = (orte_process_name_t*)rleader;
if ( &ompi_mpi_op_sum != op && &ompi_mpi_op_prod != op &&
&ompi_mpi_op_max != op && &ompi_mpi_op_min != op ) {
@ -630,24 +633,30 @@ static int ompi_comm_allreduce_intra_oob (int *inbuf, int *outbuf,
}
if (local_rank == local_leader ) {
ompi_buffer_t sbuf;
ompi_buffer_t rbuf;
orte_buffer_t *sbuf;
orte_buffer_t *rbuf;
ompi_buffer_init(&sbuf, count * sizeof(int));
ompi_pack(sbuf, tmpbuf, count, OMPI_INT32);
sbuf = OBJ_NEW(orte_buffer_t);
rbuf = OBJ_NEW(orte_buffer_t);
if (ORTE_SUCCESS != (rc = orte_dps.pack(sbuf, tmpbuf, count, ORTE_INT32))) {
goto exit;
}
if ( send_first ) {
rc = mca_oob_send_packed(remote_leader, sbuf, 0, 0);
rc = mca_oob_recv_packed (remote_leader, &rbuf, NULL);
rc = orte_rml.send_buffer(remote_leader, sbuf, 0, 0);
rc = orte_rml.recv_buffer(remote_leader, rbuf, 0);
}
else {
rc = mca_oob_recv_packed(remote_leader, &rbuf, NULL);
rc = mca_oob_send_packed(remote_leader, sbuf, 0, 0);
rc = orte_rml.recv_buffer(remote_leader, rbuf, 0);
rc = orte_rml.send_buffer(remote_leader, sbuf, 0, 0);
}
ompi_unpack(rbuf, outbuf, count, OMPI_INT32);
ompi_buffer_free(sbuf);
ompi_buffer_free(rbuf);
if (ORTE_SUCCESS != (rc = orte_dps.unpack(rbuf, outbuf, (size_t*)&count, ORTE_INT32))) {
goto exit;
}
OBJ_RELEASE(sbuf);
OBJ_RELEASE(rbuf);
if ( &ompi_mpi_op_max == op ) {
for ( i = 0 ; i < count; i++ ) {

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

@ -20,6 +20,7 @@
#endif
#include "mpi.h"
#include "dps/dps.h"
#include "communicator/communicator.h"
#include "datatype/datatype.h"
#include "errhandler/errhandler.h"
@ -29,36 +30,36 @@
#include "threads/mutex.h"
#include "util/proc_info.h"
#include "util/bit_ops.h"
#include "util/bufpack.h"
#include "util/argv.h"
#include "include/constants.h"
#include "mca/pcm/base/base.h"
#include "mca/pml/pml.h"
#include "mca/ns/base/base.h"
#include "mca/gpr/base/base.h"
#include "mca/ns/ns.h"
#include "mca/gpr/gpr.h"
#include "mca/oob/oob_types.h"
#include "mca/pml/pml.h"
#include "mca/oob/base/base.h"
#include "mca/rml/rml.h"
#include "runtime/runtime.h"
#include "util/printf.h"
extern char **environ;
int ompi_comm_connect_accept ( ompi_communicator_t *comm, int root,
ompi_process_name_t *port, int send_first,
ompi_communicator_t **newcomm, int tag )
orte_process_name_t *port, int send_first,
ompi_communicator_t **newcomm, orte_rml_tag_t tag )
{
int size, rsize, rank, rc;
int namebuflen, rnamebuflen;
size_t num_vals;
size_t namebuflen, rnamebuflen;
void *namebuf=NULL, *rnamebuf=NULL;
ompi_buffer_t sbuf;
ompi_buffer_t rbuf;
orte_buffer_t *sbuf;
orte_buffer_t *rbuf;
ompi_communicator_t *newcomp=MPI_COMM_NULL;
ompi_proc_t **rprocs=NULL;
ompi_group_t *group=comm->c_local_group;
ompi_process_name_t *rport=NULL;
ompi_buffer_t nbuf, nrbuf;
orte_process_name_t *rport=NULL;
orte_buffer_t *nbuf, *nrbuf;
size = ompi_comm_size ( comm );
rank = ompi_comm_rank ( comm );
@ -68,38 +69,58 @@ int ompi_comm_connect_accept ( ompi_communicator_t *comm, int root,
information of the remote process. Therefore, we have to
exchange that.
*/
if ( OMPI_COMM_JOIN_TAG != tag ) {
rport = ompi_comm_get_rport (port,send_first,
if ( OMPI_COMM_JOIN_TAG != (int)tag ) {
rport = ompi_comm_get_rport (port,send_first,
group->grp_proc_pointers[rank], tag);
}
else {
rport = port;
}
}
else {
rport = port;
}
/* Exchange number of processes and msg length on both sides */
ompi_buffer_init (&nbuf, size*sizeof(ompi_process_name_t));
nbuf = OBJ_NEW(orte_buffer_t);
if (NULL == nbuf) {
return ORTE_ERROR;
}
ompi_proc_get_namebuf (group->grp_proc_pointers, size, nbuf);
ompi_buffer_get(nbuf, &namebuf, &namebuflen);
if (ORTE_SUCCESS != (rc = orte_dps.unload(nbuf, &namebuf, (size_t*)&namebuflen))) {
goto exit;
}
ompi_buffer_init(&sbuf, 64);
ompi_pack(sbuf, &size, 1, OMPI_INT32);
ompi_pack(sbuf, &namebuflen, 1, OMPI_INT32);
sbuf = OBJ_NEW(orte_buffer_t);
rbuf = OBJ_NEW(orte_buffer_t);
if (NULL == sbuf || NULL == rbuf) {
rc = ORTE_ERROR;
goto exit;
}
if (ORTE_SUCCESS != (rc = orte_dps.pack(sbuf, &size, 1, ORTE_INT32))) {
goto exit;
}
if (ORTE_SUCCESS != (rc = orte_dps.pack(sbuf, &namebuflen, 1, ORTE_SIZE))) {
goto exit;
}
if ( send_first ) {
rc = mca_oob_send_packed(rport, sbuf, tag, 0);
rc = mca_oob_recv_packed (rport, &rbuf, &tag);
rc = orte_rml.send_buffer(rport, sbuf, tag, 0);
rc = orte_rml.recv_buffer(rport, rbuf, tag);
}
else {
rc = mca_oob_recv_packed(rport, &rbuf, &tag);
rc = mca_oob_send_packed(rport, sbuf, tag, 0);
rc = orte_rml.recv_buffer(rport, rbuf, tag);
rc = orte_rml.send_buffer(rport, sbuf, tag, 0);
}
ompi_unpack(rbuf, &rsize, 1, OMPI_INT32);
ompi_unpack(rbuf, &rnamebuflen, 1, OMPI_INT32);
num_vals = 1;
if (ORTE_SUCCESS != (rc = orte_dps.unpack(rbuf, &rsize, &num_vals, ORTE_INT32))) {
goto exit;
}
num_vals = 1;
if (ORTE_SUCCESS != (rc = orte_dps.unpack(rbuf, &rnamebuflen, &num_vals, ORTE_SIZE))) {
goto exit;
}
ompi_buffer_free(sbuf);
ompi_buffer_free(rbuf);
OBJ_RELEASE(sbuf);
OBJ_RELEASE(rbuf);
}
/* bcast the information to all processes in the local comm */
@ -112,27 +133,37 @@ int ompi_comm_connect_accept ( ompi_communicator_t *comm, int root,
goto exit;
}
nrbuf = OBJ_NEW(orte_buffer_t);
nbuf = OBJ_NEW(orte_buffer_t);
if (NULL == nrbuf || NULL == nbuf) {
rc = ORTE_ERROR;
goto exit;
}
if ( rank == root ) {
/* Exchange list of processes in the groups */
if ( send_first ) {
rc = mca_oob_send_packed(rport, nbuf, tag, 0);
rc = mca_oob_recv_packed (rport, &nrbuf, &tag);
rc = orte_rml.send_buffer(rport, nbuf, tag, 0);
rc = orte_rml.recv_buffer(rport, nrbuf, tag);
}
else {
rc = mca_oob_recv_packed(rport, &nrbuf, &tag);
rc = mca_oob_send_packed(rport, nbuf, tag, 0);
rc = orte_rml.recv_buffer(rport, nrbuf, tag);
rc = orte_rml.send_buffer(rport, nbuf, tag, 0);
}
ompi_buffer_get(nrbuf, &rnamebuf, &rnamebuflen);
if (ORTE_SUCCESS != (rc = orte_dps.unload(nrbuf, &rnamebuf, &rnamebuflen))) {
goto exit;
}
}
else {
/* non root processes need to allocate the buffer manually */
rnamebuf = (char *) malloc(rnamebuflen);
if ( NULL == rnamebuf ) {
rc = OMPI_ERR_OUT_OF_RESOURCE;
goto exit;
}
ompi_buffer_init_preallocated(&nrbuf, rnamebuf, rnamebuflen);
/* non root processes need to allocate the buffer manually */
rnamebuf = (char *) malloc(rnamebuflen);
if ( NULL == rnamebuf ) {
rc = OMPI_ERR_OUT_OF_RESOURCE;
goto exit;
}
if (ORTE_SUCCESS != (rc = orte_dps.load(nrbuf, rnamebuf, rnamebuflen))) {
goto exit;
}
}
/* bcast list of processes to all procs in local group
and reconstruct the data. Note that proc_get_proclist
@ -148,9 +179,10 @@ int ompi_comm_connect_accept ( ompi_communicator_t *comm, int root,
goto exit;
}
ompi_buffer_free (nrbuf);
OBJ_RELEASE(nrbuf);
OBJ_RELEASE(nbuf);
if ( rank == root ) {
ompi_buffer_free (nbuf);
OBJ_RELEASE(nbuf);
}
/* allocate comm-structure */
@ -233,31 +265,45 @@ int ompi_comm_connect_accept ( ompi_communicator_t *comm, int root,
* Therefore, the two root processes exchange this information at this point.
*
*/
ompi_process_name_t *ompi_comm_get_rport (ompi_process_name_t *port, int send_first,
ompi_proc_t *proc, int tag)
orte_process_name_t *ompi_comm_get_rport (orte_process_name_t *port, int send_first,
ompi_proc_t *proc, orte_rml_tag_t tag)
{
int rc;
ompi_process_name_t *rport, tbuf;
size_t num_vals;
orte_process_name_t *rport, tbuf;
ompi_proc_t *rproc=NULL;
bool isnew = false;
if ( send_first ) {
ompi_buffer_t sbuf;
orte_buffer_t *sbuf;
rproc = ompi_proc_find_and_add(port, &isnew);
ompi_buffer_init(&sbuf, sizeof(ompi_process_name_t));
ompi_pack(sbuf, &(proc->proc_name), 1, OMPI_NAME);
rc = mca_oob_send_packed(port, sbuf, tag, 0);
ompi_buffer_free(sbuf);
sbuf = OBJ_NEW(orte_buffer_t);
if (NULL == sbuf) {
return NULL;
}
if (ORTE_SUCCESS != orte_dps.pack(sbuf, &(proc->proc_name), 1, ORTE_NAME)) {
return NULL;
}
rc = orte_rml.send_buffer(port, sbuf, tag, 0);
OBJ_RELEASE(sbuf);
rport = port;
}
else {
ompi_buffer_t rbuf;
orte_buffer_t *rbuf;
rc = mca_oob_recv_packed(MCA_OOB_NAME_ANY, &rbuf, &tag);
ompi_unpack(rbuf, &tbuf, 1, OMPI_NAME);
ompi_buffer_free(rbuf);
rbuf = OBJ_NEW(orte_buffer_t);
if (NULL == rbuf) {
return NULL;
}
rc = orte_rml.recv_buffer(ORTE_RML_NAME_ANY, rbuf, tag);
num_vals = 1;
if (ORTE_SUCCESS != orte_dps.unpack(rbuf, &tbuf, &num_vals, ORTE_NAME)) {
return NULL;
}
OBJ_RELEASE(rbuf);
rproc = ompi_proc_find_and_add(&tbuf, &isnew);
rport = &(rproc->proc_name);
@ -280,7 +326,9 @@ ompi_comm_start_processes(int count, char **array_of_commands,
MPI_Info *array_of_info,
char *port_name)
{
mca_ns_base_jobid_t new_jobid;
#if 0
orte_jobid_t new_jobid;
int rc;
ompi_rte_node_schedule_t *sched;
ompi_rte_spawn_handle_t *spawn_handle;
ompi_list_t **nodelists = NULL;
@ -304,7 +352,9 @@ ompi_comm_start_processes(int count, char **array_of_commands,
*/
/* get the jobid for the new processes */
new_jobid = ompi_name_server.create_jobid();
if (ORTE_SUCCESS != (rc = orte_ns.create_jobid(&new_jobid))) {
return rc;
}
/* get the spawn handle to start spawning stuff */
requires = OMPI_RTE_SPAWN_FROM_MPI | OMPI_RTE_SPAWN_HIGH_QOS;
@ -471,7 +521,7 @@ ompi_comm_start_processes(int count, char **array_of_commands,
}
if (NULL != spawn_handle) OBJ_RELEASE(spawn_handle);
OBJ_DESTRUCT(&schedlist);
#endif
return OMPI_SUCCESS;
}
@ -480,12 +530,13 @@ ompi_comm_start_processes(int count, char **array_of_commands,
/**********************************************************************/
int ompi_comm_dyn_init (void)
{
uint32_t jobid;
orte_jobid_t jobid;
char *envvarname=NULL, *port_name=NULL;
char *oob_port=NULL;
int tag, root=0, send_first=1;
int root=0, send_first=1, rc;
orte_rml_tag_t tag;
ompi_communicator_t *newcomm=NULL;
ompi_process_name_t *port_proc_name=NULL;
orte_process_name_t *port_proc_name=NULL;
ompi_group_t *group = NULL;
ompi_errhandler_t *errhandler = NULL;
@ -495,7 +546,9 @@ int ompi_comm_dyn_init (void)
have to OBJ_RELEASE it as well. The global
ompi_proc_local_proc seemed to have been created for exactly
this kind of purpose, so I took the liberty of using it. */
jobid = ompi_name_server.get_jobid(&(ompi_proc_local_proc->proc_name));
if (ORTE_SUCCESS != (rc = orte_ns.get_jobid(&jobid, &(ompi_proc_local_proc->proc_name)))) {
return rc;
}
/* check for appropriate env variable */
@ -510,8 +563,10 @@ int ompi_comm_dyn_init (void)
/* split the content of the environment variable into
its pieces, which are : port_name and tag */
oob_port = ompi_parse_port (port_name, &tag);
port_proc_name = ompi_name_server.convert_string_to_process_name(oob_port);
if (ORTE_SUCCESS != (rc = orte_ns.convert_string_to_process_name(&port_proc_name, oob_port))) {
return rc;
}
ompi_comm_connect_accept (MPI_COMM_WORLD, root, port_proc_name,
send_first, &newcomm, tag );
/* Set the parent communicator */
@ -703,7 +758,7 @@ void ompi_comm_mark_dyncomm (ompi_communicator_t *comm)
int i, j, numjobids=0;
int size, rsize;
int found;
uint32_t jobids[OMPI_COMM_MAXJOBIDS], thisjobid;
orte_jobid_t jobids[OMPI_COMM_MAXJOBIDS], thisjobid;
ompi_group_t *grp=NULL;
/* special case for MPI_COMM_NULL */
@ -718,7 +773,9 @@ void ompi_comm_mark_dyncomm (ompi_communicator_t *comm)
of different jobids. */
grp = comm->c_local_group;
for (i=0; i< size; i++) {
thisjobid = ompi_name_server.get_jobid(&(grp->grp_proc_pointers[i]->proc_name));
if (ORTE_SUCCESS != orte_ns.get_jobid(&thisjobid, &(grp->grp_proc_pointers[i]->proc_name))) {
return;
}
found = 0;
for ( j=0; j<numjobids; j++) {
if ( thisjobid == jobids[j]) {
@ -735,7 +792,9 @@ void ompi_comm_mark_dyncomm (ompi_communicator_t *comm)
and count number of different jobids */
grp = comm->c_remote_group;
for (i=0; i< rsize; i++) {
thisjobid = ompi_name_server.get_jobid(&(grp->grp_proc_pointers[i]->proc_name));
if (ORTE_SUCCESS != orte_ns.get_jobid(&thisjobid, &(grp->grp_proc_pointers[i]->proc_name))) {
return;
}
found = 0;
for ( j=0; j<numjobids; j++) {
if ( thisjobid == jobids[j]) {

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

@ -18,24 +18,27 @@
#include "mpi.h"
#include "communicator/communicator.h"
#include "proc/proc.h"
#include "include/constants.h"
#include "mca/pcm/pcm.h"
#include "mca/errmgr/errmgr.h"
#include "mca/pml/pml.h"
#include "mca/ns/ns.h"
#include "mca/gpr/base/base.h"
#include "mca/gpr/gpr.h"
#include "mca/rml/rml_types.h"
static ompi_mutex_t ompi_port_lock;
static int port_id=MCA_OOB_TAG_USER;
#define OMPI_COMM_PORT_KEY "ompi-port-name"
int ompi_open_port(char *port_name)
{
ompi_proc_t **myproc=NULL;
char *name=NULL;
size_t size=0;
int lport_id=-1;
orte_rml_tag_t lport_id=0;
int rc;
/*
* The port_name is equal to the OOB-contact information
* and an integer. The reason for adding the integer is
@ -43,10 +46,14 @@ int ompi_open_port(char *port_name)
*/
myproc = ompi_proc_self (&size);
name = ompi_name_server.get_proc_name_string (&(myproc[0]->proc_name));
if (ORTE_SUCCESS != (rc = orte_ns.get_proc_name_string (&name, &(myproc[0]->proc_name)))) {
return rc;
}
OMPI_THREAD_LOCK(&ompi_port_lock);
lport_id = port_id++;
if (ORTE_SUCCESS != (rc = orte_ns.assign_rml_tag(&lport_id, NULL))) {
return rc;
}
OMPI_THREAD_UNLOCK(&ompi_port_lock);
sprintf (port_name, "%s:%d", name, lport_id);
@ -59,7 +66,7 @@ int ompi_open_port(char *port_name)
/* takes a port_name and separates it into the process_name
and the tag
*/
char *ompi_parse_port (char *port_name, int *tag )
char *ompi_parse_port (char *port_name, orte_rml_tag_t *tag)
{
char tmp_port[MPI_MAX_PORT_NAME], *tmp_string;
@ -70,7 +77,7 @@ char *ompi_parse_port (char *port_name, int *tag )
strncpy (tmp_port, port_name, MPI_MAX_PORT_NAME);
strncpy (tmp_string, strtok(tmp_port, ":"), MPI_MAX_PORT_NAME);
sscanf( strtok(NULL, ":"),"%d", tag);
sscanf( strtok(NULL, ":"),"%d", (int*)tag);
return tmp_string;
}
@ -82,38 +89,67 @@ char *ompi_parse_port (char *port_name, int *tag )
*/
int ompi_comm_namepublish ( char *service_name, char *port_name )
{
orte_gpr_value_t *value;
int rc;
char *key[2];
value = OBJ_NEW(orte_gpr_value_t);
if (NULL == value) {
ORTE_ERROR_LOG(ORTE_ERR_OUT_OF_RESOURCE);
return ORTE_ERR_OUT_OF_RESOURCE;
}
value->addr_mode = ORTE_GPR_TOKENS_AND | ORTE_GPR_OVERWRITE;
value->segment = strdup(OMPI_NAMESPACE_SEGMENT);
key[0] = service_name;
key[1] = NULL;
return ompi_registry.put(OMPI_REGISTRY_OVERWRITE, "ompi_name_publish",
key, port_name, (strlen(port_name)+1));
value->tokens = (char**)malloc(2*sizeof(char*));
if (NULL == value->tokens) {
ORTE_ERROR_LOG(ORTE_ERR_OUT_OF_RESOURCE);
return ORTE_ERR_OUT_OF_RESOURCE;
}
value->tokens[0] = strdup(service_name);
value->tokens[1] = NULL;
value->keyvals[0] = OBJ_NEW(orte_gpr_keyval_t);
if (NULL == value->keyvals[0]) {
ORTE_ERROR_LOG(ORTE_ERR_OUT_OF_RESOURCE);
OBJ_RELEASE(value);
return ORTE_ERR_OUT_OF_RESOURCE;
}
(value->keyvals[0])->key = strdup(OMPI_COMM_PORT_KEY);
(value->keyvals[0])->type = ORTE_STRING;
((value->keyvals[0])->value).strptr = strdup(port_name);
rc = orte_gpr.put(1, &value);
OBJ_RELEASE(value);
return rc;
}
char* ompi_comm_namelookup ( char *service_name )
{
char *key[2];
ompi_list_t *tmp=NULL;
ompi_registry_value_t *vtmp=NULL;
char *stmp=NULL, *stmp2=NULL;
key[0] = service_name;
char *token[2], *key[2];
orte_gpr_keyval_t **keyvals=NULL;
orte_gpr_value_t **values;
int cnt=0;
char *stmp=NULL;
int ret;
token[0] = service_name;
token[1] = NULL;
key[0] = strdup(OMPI_COMM_PORT_KEY);
key[1] = NULL;
tmp = ompi_registry.get(OMPI_REGISTRY_NONE, "ompi_name_publish", key);
if ( NULL != tmp ) {
vtmp = (ompi_registry_value_t *) ompi_list_get_first(tmp);
if (NULL != vtmp) {
stmp = (char *)vtmp->object;
if ( NULL != stmp) {
stmp2 = strdup(stmp);
OBJ_RELEASE(vtmp);
}
}
OBJ_RELEASE(tmp);
ret = orte_gpr.get(ORTE_GPR_TOKENS_AND, OMPI_NAMESPACE_SEGMENT,
token, key, &cnt, &values);
if (ORTE_SUCCESS != ret) {
return NULL;
}
if ( 0 < cnt && NULL != values[0] ) { /* should be only one, if any */
keyvals = values[0]->keyvals;
stmp = strdup(keyvals[0]->value.strptr);
OBJ_RELEASE(values[0]);
}
return (stmp2);
return (stmp);
}
/*
@ -124,8 +160,12 @@ char* ompi_comm_namelookup ( char *service_name )
*/
int ompi_comm_nameunpublish ( char *service_name )
{
char *key[2];
key[0] = service_name;
key[1] = NULL;
return ompi_registry.delete_object(OMPI_REGISTRY_NONE, "ompi_name_publish", key);
char *token[2];
token[0] = service_name;
token[1] = NULL;
return orte_gpr.delete_entries(ORTE_GPR_TOKENS_AND,
OMPI_NAMESPACE_SEGMENT,
token, NULL);
}

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

@ -19,13 +19,14 @@
#include "class/ompi_hash_table.h"
#include "errhandler/errhandler.h"
#include "threads/mutex.h"
#include "threads/mutex.h"
#include "util/output.h"
#include "mpi.h"
#include "group/group.h"
#include "mca/coll/coll.h"
#include "mca/topo/topo.h"
#include "mca/gpr/base/base.h"
#include "mca/gpr/gpr_types.h"
#include "mca/oob/oob_types.h"
#include "request/request.h"
#if defined(c_plusplus) || defined(__cplusplus)
@ -336,7 +337,7 @@ struct ompi_communicator_t {
ompi_communicator_t *bridge_comm,
int local_leader,
int remote_leader,
int tag,
orte_rml_tag_t tag,
int rsize);
@ -381,7 +382,7 @@ struct ompi_communicator_t {
* takes a port_name and returns the oob-contact information
* and the tag
*/
char * ompi_parse_port (char *port_name, int *tag ) ;
char * ompi_parse_port (char *port_name, orte_rml_tag_t *tag) ;
/**
* routines handling name publishing, lookup and unpublishing
@ -398,8 +399,8 @@ struct ompi_communicator_t {
sets the connection up between two independent applications.
*/
int ompi_comm_connect_accept ( ompi_communicator_t *comm, int root,
ompi_process_name_t *port, int send_first,
ompi_communicator_t **newcomm, int tag);
orte_process_name_t *port, int send_first,
ompi_communicator_t **newcomm, orte_rml_tag_t tag);
/* A helper routine for ompi_comm_connect_accept.
* This routine is necessary, since in the connect/accept case, the processes
@ -411,9 +412,9 @@ struct ompi_communicator_t {
* Therefore, the two root processes exchange this information at this point.
*
*/
ompi_process_name_t *ompi_comm_get_rport (ompi_process_name_t *port,
orte_process_name_t *ompi_comm_get_rport (orte_process_name_t *port,
int send_first, ompi_proc_t *proc,
int tag);
orte_rml_tag_t tag);

42
src/dps/Makefile.am Обычный файл
Просмотреть файл

@ -0,0 +1,42 @@
#
# Copyright (c) 2004-2005 The Trustees of Indiana University.
# All rights reserved.
# Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
# All rights reserved.
# Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
# University of Stuttgart. All rights reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
#
# $HEADER$
#
include $(top_srcdir)/config/Makefile.options
noinst_LTLIBRARIES = libdps.la
# Source code files
headers = \
dps.h \
dps_types.h \
dps_internal.h
libdps_la_SOURCES = \
$(headers) \
orte_dps_open_close.c \
dps_pack.c \
dps_unpack.c \
dps_peek.c \
dps_load_unload.c \
dps_internal_functions.c
# Conditionally install the header files
if WANT_INSTALL_HEADERS
ompidir = $(includedir)/openmpi/dps
ompi_HEADERS = $(headers)
else
ompidir = $(includedir)
endif

369
src/dps/dps.h Обычный файл
Просмотреть файл

@ -0,0 +1,369 @@
/* -*- C -*-
*
* Copyright (c) 2004-2005 The Trustees of Indiana University.
* All rights reserved.
* Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
* All rights reserved.
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
* University of Stuttgart. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
/**
* @file
*
* Resource Discovery & Allocation Subsystem (RDAS)
*
* The RDAS is responsible for discovering the resources available to the universe, and
* for allocating them to the requesting job.
*
*/
#ifndef ORTE_DPS_H_
#define ORTE_DPS_H_
#include "orte_config.h"
#include "include/orte_types.h"
#include "include/orte_constants.h"
#include "dps_types.h"
#if defined(c_plusplus) || defined(__cplusplus)
extern "C" {
#endif
/*
* DPS initialization function
* In dynamic libraries, declared objects and functions don't get loaded
* until called. We need to ensure that the orte_dps function structure
* gets loaded, so we provide an "open" call that is executed as part of
* the program startup. It simply checks for debug parameters - good enough
* to ensure that the DPS gets loaded!
*/
OMPI_DECLSPEC int orte_dps_open(void);
/*
* DPS finalize function
*/
OMPI_DECLSPEC int orte_dps_close(void);
/*
* DPS interface functions
*/
/*
* Pack one or more values into a buffer
* The pack function packs one or more values of a specified type into the specified buffer.
* The buffer must have already been initialized via an OBJ_NEW call -
* otherwise, the pack_value function will return an error. Providing an
* unsupported type flag will likewise be reported as an error.
*
* Note that any data to be packed that is not hard type cast (i.e., not type cast
* to a specific size) may lose precision when unpacked by a non-homogeneous recipient.
* The DPS will do its best to
* deal with heterogeneity issues between the packer and unpacker in such cases. Sending
* a number larger than can be handled by the recipient will return an error code (generated
* by the DPS upon unpacking) via the RML upon transmission - the DPS cannot detect
* such errors during packing.
*
* @param *buffer A pointer to the buffer into which the value is to be packed.
* @param *src A void* pointer to the data that is to be packed. Note that strings are
* to be passed as (char **) - i.e., the caller must pass the address of the pointer
* to the string as the void*. This allows the DPS to use a single interface function,
* but still allow the caller to pass multiple strings in a single call.
* @param num A size_t value indicating the number of values that are to be
* packed, beginning at the location pointed to by src. A string value is counted as a
* single value regardless of length. The values must be contiguous in memory. Arrays of
* pointers (e.g., string arrays) should be contiguous, although (obviously) the data
* pointed to need not be contiguous across array entries.
* @param type The type of the data to be packed - must be one of the DPS defined
* data types.
*
* @retval ORTE_SUCCESS The data was packed as requested.
* @retval ORTE_ERROR(s) An appropriate ORTE error code indicating the problem
* encountered. This error code should be handled appropriately.
*
* @code
* orte_buffer_t *buffer;
* int32_t src;
*
* status_code = orte_dps.pack(buffer, &src, 1, ORTE_INT32);
* @endcode
*/
typedef int (*orte_dps_pack_fn_t)(orte_buffer_t *buffer, void *src,
size_t num_values,
orte_data_type_t type);
/* Unpack one or more values from a buffer
* The unpack function unpacks one or more values of a specified type from the
* specified buffer.
* The buffer must have already been initialized via an OBJ_NEW call -
* otherwise, the unpack_value function will return an error. Providing an
* unsupported type flag will likewise be reported as an error, as will specifying a
* data type that DOES NOT match the type of the next item in the buffer. An attempt
* to read beyond the end of the stored data held in the buffer will also return
* an error.
*
* Unpacking values is a "destructive" process - i.e., the values are removed from
* the buffer, thus reducing the buffer size. It is therefore not possible for the
* caller to re-unpack a value from the same buffer.
*
* Warning: The caller is responsible for providing adequate memory storage for
* the requested data. The DPS peek_next_item function is provided to assist in
* meeting this requirement. The user can provide a max_num_values argument to ensure
* that memory overruns are prevented. If more values are present in the buffer, the
* unpack function will unpack as much as it can - and then return an error
* ORTE_UNPACK_READ_PAST_END_OF_BUFFER.
*
* Note that any data that was not hard type cast (i.e., not type cast
* to a specific size) when packed may lose precision when unpacked by a non-homogeneous recipient.
* The DPS will do its best to
* deal with heterogeneity issues between the packer and unpacker in such cases. Sending
* a number larger than can be handled by the recipient will return an error code (generated
* by the DPS upon unpacking) via the RML upon transmission - the DPS cannot detect
* such errors during packing.
*
* @param *buffer A pointer to the buffer from which the value will be extracted.
* @param *dest A void* pointer to the memory location into which the data is to be
* stored. Note that these values will be stored contiguously in memory. For strings,
* this pointer must be to (char **) to provide a means of supporting multiple string
* operations. The DPS unpack function will allocate memory for each string in the array -
* the caller must only provide adequate memory for the array of pointers.
* @param *num A pointer to a size_t value indicating the maximum number of values that are to be
* unpacked, beginning at the location pointed to by src. This is provided to help
* protect the caller from memory overrun - providing a value of "0" tells the DPS
* to unpack ALL of the values stored in this item. This should be used with caution
* as the caller must then be absolutely certain that adequate memory has been allocated
* for this operation. Note that a string value is counted as a single value regardless
* of length.
*
* @note The unpack function will return the actual number of values unpacked in
* this location.
*
* @param type The type of the data to be unpacked - must be one of the DPS defined
* data types.
*
* @retval *num The number of values actually unpacked. In most cases,
* this should match the maximum number provided in the parameters - but in no case
* will it exceed that parameter.
*
* @retval ORTE_SUCCESS The next item in the buffer was successfully unpacked.
*
* @retval ORTE_ERROR(s) The unpack function returns an error code under one of several
* conditions: (a) the number of values in the item exceeds the max num provided by the
* caller; (b) the type of the next item in the buffer does not match the type specified
* by the caller; or (c) the unpack failed due to either an error in the buffer or
* an attempt to read past the end of the buffer.
*
* @code
* orte_buffer_t *buffer;
* int32_t dest;
* char **string_array;
* size_t num_values;
*
* num_values = 1;
* status_code = orte_dps.unpack(buffer, (void*)&dest, &num_values, ORTE_INT32);
*
* num_values = 5;
* string_array = malloc(num_values*sizeof(char *));
* status_code = orte_dps.unpack(buffer, (void*)(string_array), &num_values, ORTE_STRING);
*
* @endcode
*
*/
typedef int (*orte_dps_unpack_fn_t)(orte_buffer_t *buffer, void *dest,
size_t *max_num_values,
orte_data_type_t type);
/*
* Pack a value into a non-buffer destination
* This function will translate host-ordered values into their network byte-ordered
* equivalents. The results are placed in the dest location and NOT into a buffer.
* The function is intended for use in areas where a buffer is not required, but data
* storage must still be prepared for heterogeneous operations (i.e., it may be sent
* at some later time). Primary use is in the packing of data placed on the registry.
*
* @param *dest (IN) A pointer to the destination. Must have memory backing it. Strings
* are handled by passing a char** pointer - the pack function will allocate memory
* in this case for each string. However, there must be adequate storage for the number
* of string pointers that will be required.
* @param *src (IN) A pointer to the src
* @param num_values (IN) The number of values to be packed - must be contiguous
* beginning at src. For strings, src is assumed to point to an array of character
* pointers (char**) - this number, therefore, would be the number of null-terminated
* strings (and not the total number of characters).
* @param type (IN) The data type to be converted
* @param *num_bytes (OUT) A pointer to a variable where the function can return
* the number of bytes moved from src to dest. Used by some functions to update
* the dest location.
*
* @retval ORTE_SUCCESS The value was successfully packed
* @retval ORTE_ERROR(s) An appropriate error code.
*/
typedef int (*orte_dps_pack_nobuffer_fn_t)(void *dest, void *src, size_t num_values,
orte_data_type_t type, size_t *num_bytes);
/*
* Unpack a value from a non-buffer location
* Converts a network byte-ordered value into its host-ordered equivalent.
*
* @param *dest (IN) A pointer to the destination. Must have memory backing it. Strings
* are handled by passing a char** pointer - the unpack function will allocate memory
* in this case.
* @param *src (IN) A pointer to the src
* @param num_values (IN) The number of values to be unpacked - must be contiguous
* beginning at src. For strings, src is assumed to point to an array of character
* pointers (char**) - this number, therefore, would be the number of null-terminated
* strings (and not the total number of characters).
* @param type (IN) The data type to be converted
* @param *max_bytes (IN/OUT) The max number of bytes in the src - will be returned
* as an updated value that reflects the number of bytes actually removed.
* @param *num_bytes (OUT) A pointer to a variable where the function can return
* the number of bytes moved from src to dest. Used by some functions to update
* the dest location.
*
* @retval ORTE_SUCCESS The value was successfully packed
* @retval ORTE_ERROR(s) An appropriate error code.
*/
typedef int (*orte_dps_unpack_nobuffer_fn_t)(void *dest, void *src, size_t num_values,
orte_data_type_t type,
size_t *max_bytes, size_t *num_bytes);
/*
* Get the type and number of values of the next item in the buffer
* The peek function looks at the next item in the buffer and returns both its
* type and the number of values in the item. This is a non-destructive function
* call that does not disturb the buffer, so it can be called multiple times if desired.
*
* @param buffer A pointer to the buffer in question.
* @param type A pointer to an orte_data_type_t variable where the type of the
* next item in the buffer is to be stored. Caller must have memory backing this
* location.
* @param number A pointer to a size_t variable where the number of data values
* in the next item is to be stored. Caller must have memory backing this location.
*
* @retval ORTE_SUCCESS Requested info was successfully returned.
* @retval ORTE_ERROR(s) An appropriate error code indicating the problem will be
* returned. This should be handled appropriately by the caller.
*
* For string types, the number of values corresponds to the length of the string.
*/
typedef int (*orte_dps_peek_next_item_fn_t)(orte_buffer_t *buffer,
orte_data_type_t *type,
size_t *number);
/*
* Unload the data payload from a buffer
* The unload function provides the caller with a pointer to the data payload within
* the buffer and the size of that payload. This allows the user to directly access
* the payload - typically used in the RML to unload the payload from the buffer
* for transmission.
*
* @note This is a destructive operation. While the payload is undisturbed, the function
* will clear the buffer's pointers to the payload. Thus, the buffer and the payload
* are completely separated, leaving the caller free to OBJ_RELEASE the buffer.
*
* @param buffer A pointer to the buffer whose payload is to be unloaded.
* @param payload The address to a void* pointer that is to be loaded with the address
* of the data payload in the buffer.
* @param size The size (in bytes) of the data payload in the buffer.
*
* @retval ORTE_SUCCESS The request was succesfully completed.
* @retval ORTE_ERROR(s) An appropriate error code indicating the problem will be
* returned. This should be handled appropriately by the caller.
*
* @code
* orte_buffer_t *buffer;
* uint8_t *bytes;
* size_t size;
*
* status_code = orte_dps.unload(buffer, (void**)(&bytes), &size);
* OBJ_RELEASE(buffer);
* @endcode
*/
typedef int (*orte_dps_unload_fn_t)(orte_buffer_t *buffer,
void **payload,
size_t *size);
/*
* Load a data payload into a buffer
* The load function allows the caller to replace the payload in a buffer with one
* provided by the caller. If a payload already exists in the buffer, the function will
* "free" the existing data to release it, and then replace the data payload with the
* one provided by the caller.
*
* @note The buffer must be allocated in advance via the OBJ_NEW function call - failing
* to do so will cause the load function to return an error code.
*
* @note The caller is responsible for pre-packing the provided payload - the load
* function cannot convert to network byte order any data contained in the provided
* payload.
*
* @param buffer A pointer to the buffer into which lthe payload is to be loaded.
* @param payload A void* pointer to the payload to be loaded into the buffer.
* @param size The size (in bytes) of the provided payload.
*
* @retval ORTE_SUCCESS The request was successfully completed
* @retval ORTE_ERROR(s) An appropriate error code indicating the problem will be
* returned. This should be handled appropriately by the caller.
*
* @code
* orte_buffer_t *buffer;
* uint8_t bytes;
* size_t size;
*
* buffer = OBJ_NEW(orte_buffer_t);
* status_code = orte_dps.load(buffer, (void*)(&bytes), size);
* @endcode
*/
typedef int (*orte_dps_load_fn_t)(orte_buffer_t *buffer,
void *payload,
size_t size);
/*
* Output the buffer's internals to the screen
* For debugging purposes, it can be useful to see the types of items
* stored in the buffer. This function outputs the type and number of
* elements in each item to the specified output id.
*
* @param *buffer A pointer to the buffer
* @param id The output id to use
*
* @retval ORTE_SUCCESS Operation successfully completed
* @retval ORTE_ERROR(s) Error code indicating problem with buffer
*/
typedef int (*orte_dps_dump_fn_t)(orte_buffer_t *buffer, int outid);
/**
* Base structure for the DPS
*
* Base module structure for the DPS - presents the required function
* pointers to the calling interface.
*/
struct orte_dps_t {
orte_dps_pack_fn_t pack;
orte_dps_unpack_fn_t unpack;
orte_dps_pack_nobuffer_fn_t pack_nobuffer;
orte_dps_unpack_nobuffer_fn_t unpack_nobuffer;
orte_dps_peek_next_item_fn_t peek;
orte_dps_unload_fn_t unload;
orte_dps_load_fn_t load;
orte_dps_dump_fn_t dump;
};
typedef struct orte_dps_t orte_dps_t;
#if defined(c_plusplus) || defined(__cplusplus)
}
#endif
OMPI_DECLSPEC extern orte_dps_t orte_dps; /* holds dps function pointers */
#endif /* ORTE_DPS_H */

84
src/dps/dps_internal.h Обычный файл
Просмотреть файл

@ -0,0 +1,84 @@
/* -*- C -*-
*
* Copyright (c) 2004-2005 The Trustees of Indiana University.
* All rights reserved.
* Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
* All rights reserved.
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
* University of Stuttgart. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*
*/
#ifndef ORTE_DPS_INTERNAL_H_
#define ORTE_DPS_INTERNAL_H_
#include "orte_config.h"
#include "include/orte_constants.h"
#include "dps.h"
#if defined(c_plusplus) || defined(__cplusplus)
extern "C" {
#endif
/*
* DEFINE THE DEFAULT PAGE SIZE FOR THE DPS BUFFERS - IN KILOBYTES
*/
#define ORTE_DPS_DEFAULT_PAGE_SIZE 1
/*
* globals needed within dps
*/
extern bool orte_dps_debug;
extern int orte_dps_page_size;
/*
* Implementations of API functions
*/
int orte_dps_pack(orte_buffer_t *buffer, void *src,
size_t num_vals,
orte_data_type_t type);
int orte_dps_unpack(orte_buffer_t *buffer, void *dest,
size_t *max_num_vals,
orte_data_type_t type);
int orte_dps_pack_nobuffer(void *dst, void *src, size_t num_vals,
orte_data_type_t type, size_t *num_bytes);
int orte_dps_unpack_nobuffer(void *dst, void *src, size_t num_values,
orte_data_type_t type,
size_t *mem_left, size_t *num_bytes);
int orte_dps_peek(orte_buffer_t *buffer,
orte_data_type_t *type,
size_t *number);
int orte_dps_unload(orte_buffer_t *buffer,
void **payload,
size_t *size);
int orte_dps_load(orte_buffer_t *buffer,
void *payload,
size_t size);
int orte_dps_dump_buffer_simple(orte_buffer_t *buffer, int outid);
int orte_dps_dump_buffer(orte_buffer_t *buffer, int outid);
/*
* Totally internal functions
*/
size_t orte_dps_memory_required(void *src, size_t num_vals, orte_data_type_t type);
int orte_dps_buffer_extend (orte_buffer_t *bptr, size_t mem_req);
#if defined(c_plusplus) || defined(__cplusplus)
}
#endif
#endif

465
src/dps/dps_internal_functions.c Обычный файл
Просмотреть файл

@ -0,0 +1,465 @@
/*
* Copyright (c) 2004-2005 The Trustees of Indiana University.
* All rights reserved.
* Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
* All rights reserved.
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
* University of Stuttgart. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
/** @file:
*
*/
#include "ompi_config.h"
#include <stdio.h>
#include <sys/types.h>
#include <math.h>
#include <unistd.h>
#include "util/output.h"
#include "mca/gpr/gpr_types.h"
#include "mca/ns/ns_types.h"
#include "mca/rmgr/rmgr_types.h"
#include "dps_internal.h"
#include <netinet/in.h>
/**
* Internal-use only functions
*/
/**
* Calculate the memory storage required for the requested operation
*/
size_t orte_dps_memory_required(void *src, size_t num_vals, orte_data_type_t type)
{
char **strptr=NULL;
size_t i=0, mem_req=0;
orte_byte_object_t *sbyteptr=NULL;
orte_gpr_keyval_t **keyval;
orte_gpr_value_t **values;
orte_app_context_t **app_context;
orte_app_context_map_t **app_context_map;
orte_gpr_subscription_t **subs;
orte_gpr_notify_data_t **data;
switch(type) {
case ORTE_DATA_TYPE:
case ORTE_NODE_STATE:
case ORTE_PROC_STATE:
case ORTE_EXIT_CODE:
case ORTE_BOOL:
case ORTE_BYTE:
case ORTE_INT8:
case ORTE_UINT8:
return num_vals;
case ORTE_NOTIFY_ACTION:
case ORTE_GPR_ADDR_MODE:
case ORTE_GPR_CMD:
case ORTE_INT16:
case ORTE_UINT16:
return (size_t)(num_vals * sizeof(uint16_t));
case ORTE_VPID:
case ORTE_JOBID:
case ORTE_CELLID:
case ORTE_GPR_NOTIFY_ID:
case ORTE_INT32:
case ORTE_UINT32:
return (size_t)(num_vals * sizeof(uint32_t));
case ORTE_INT64:
case ORTE_UINT64:
return (size_t)(num_vals * sizeof(uint64_t));
case ORTE_NULL:
return 0;
case ORTE_STRING:
strptr = (char **) src;
for (i=0; i<num_vals; i++) {
/* need to reserve sizeof(uint32_t) for length */
mem_req += sizeof(uint32_t);
mem_req += strlen(*strptr); /* string - null-terminator */
strptr++;
}
return mem_req;
case ORTE_NAME:
return (size_t)(num_vals * sizeof(orte_process_name_t));
case ORTE_BYTE_OBJECT:
sbyteptr = (orte_byte_object_t *) src;
for (i=0; i<num_vals; i++) {
mem_req += sizeof(uint32_t); /* length */
mem_req += sbyteptr->size; /* bytes */
sbyteptr++;
}
return mem_req;
case ORTE_KEYVAL:
mem_req = 0;
keyval = (orte_gpr_keyval_t**) src;
for (i=0; i < num_vals; i++) {
mem_req += orte_dps_memory_required(
(void*)(&(keyval[i]->key)), 1, ORTE_STRING);
mem_req += sizeof(orte_data_type_t); /* store data type */
mem_req += orte_dps_memory_required(
(void*)(&(keyval[i]->value)), 1, keyval[i]->type);
}
return mem_req;
case ORTE_GPR_VALUE:
mem_req = 0;
values = (orte_gpr_value_t**) src;
for (i=0; i<num_vals; i++) {
mem_req += orte_dps_memory_required(
(void*)(&(values[i]->addr_mode)), 1,
ORTE_GPR_ADDR_MODE);
mem_req += orte_dps_memory_required(
(void*)(&(values[i]->segment)), 1, ORTE_STRING);
mem_req += sizeof(int32_t); /* number of tokens */
mem_req += orte_dps_memory_required(
(void*)(values[i]->tokens), values[i]->num_tokens,
ORTE_STRING);
mem_req += sizeof(int32_t); /* number of keyvals */
mem_req += orte_dps_memory_required(
(void*)(values[i]->keyvals), values[i]->cnt,
ORTE_KEYVAL);
}
return mem_req;
case ORTE_APP_CONTEXT:
mem_req = 0;
app_context = (orte_app_context_t**) src;
for (i=0; i < num_vals; i++) {
mem_req += sizeof(int32_t); /* app index number */
mem_req += orte_dps_memory_required(
(void*)(&(app_context[i]->app)), 1, ORTE_STRING); /* application name */
mem_req += sizeof(int32_t); /* number or processes */
mem_req += sizeof(int32_t); /* number of argv entries */
mem_req += orte_dps_memory_required(
(void*)(app_context[i]->argv),
app_context[i]->argc, ORTE_STRING); /* length of all argvs */
mem_req += sizeof(int32_t); /* number of env entries */
mem_req += orte_dps_memory_required(
(void*)(app_context[i]->env),
app_context[i]->num_env, ORTE_STRING); /* length of all envs */
mem_req += orte_dps_memory_required(
(void*)(&(app_context[i]->cwd)), 1, ORTE_STRING); /* cwd string */
mem_req += sizeof(int32_t); /* number of maps */
mem_req += orte_dps_memory_required(
(void*)(app_context[i]->map_data),
app_context[i]->num_map, ORTE_APP_CONTEXT_MAP); /* proc map */
}
return mem_req;
case ORTE_APP_CONTEXT_MAP:
mem_req = 0;
app_context_map = (orte_app_context_map_t**) src;
for (i=0; i < num_vals; i++) {
mem_req += sizeof(uint8_t); /* map_type */
mem_req += orte_dps_memory_required(
(void*)(&(app_context_map[i]->map_data)), 1, ORTE_STRING); /* map data */
}
return mem_req;
case ORTE_GPR_SUBSCRIPTION:
mem_req = 0;
subs = (orte_gpr_subscription_t**) src;
for (i=0; i<num_vals; i++) {
mem_req += orte_dps_memory_required(
(void*)(&(subs[i]->addr_mode)), 1,
ORTE_GPR_ADDR_MODE);
mem_req += orte_dps_memory_required(
(void*)(&(subs[i]->segment)), 1, ORTE_STRING);
mem_req += sizeof(int32_t); /* number of tokens */
mem_req += orte_dps_memory_required(
(void*)(subs[i]->tokens), subs[i]->num_tokens,
ORTE_STRING);
mem_req += sizeof(int32_t); /* number of keys */
mem_req += orte_dps_memory_required(
(void*)(subs[i]->keys), subs[i]->num_keys,
ORTE_STRING);
/* don't store the cb_func and user_tag pointers, so
* don't reserve memory for them
*/
}
return mem_req;
case ORTE_GPR_NOTIFY_DATA:
mem_req = 0;
data = (orte_gpr_notify_data_t**) src;
for (i=0; i<num_vals; i++) {
mem_req += sizeof(int32_t); /* callback number */
mem_req += orte_dps_memory_required(
(void*)(&(data[i]->addr_mode)), 1,
ORTE_GPR_ADDR_MODE);
mem_req += orte_dps_memory_required(
(void*)(&(data[i]->segment)), 1, ORTE_STRING);
mem_req += sizeof(int32_t); /* number of values */
mem_req += orte_dps_memory_required(
(void*)(data[i]->values), data[i]->cnt,
ORTE_GPR_VALUE);
}
return mem_req;
default:
return 0; /* unrecognized type */
}
}
/**
* Internal function that resizes (expands) an inuse buffer...adds
* requested memory in units of memory pages to the current buffer.
*/
int orte_dps_buffer_extend(orte_buffer_t *bptr, size_t mem_req)
{
/* no buffer checking, we should know what we are doing in here */
size_t newsize;
int pages;
void* newbaseptr;
int num_pages;
float frac_pages;
ssize_t mdiff;
size_t sdiff; /* difference (increase) in space */
/* how many pages are required */
frac_pages = (float)mem_req/(float)orte_dps_page_size;
frac_pages = ceilf(frac_pages);
num_pages = (int)frac_pages;
/* push up page count */
pages = bptr->pages + num_pages;
newsize = (size_t)(pages*orte_dps_page_size);
sdiff = newsize - bptr->size; /* actual increase in space */
/* have to use relative change as no absolute without */
/* doing pointer maths for some counts such as space */
newbaseptr = realloc (bptr->base_ptr, newsize);
if (!newbaseptr) { return (ORTE_ERR_OUT_OF_RESOURCE); }
/* ok, we have new memory */
/* update all the pointers in the buffer */
/* first calc change in memory location */
mdiff = ((char*)newbaseptr) - ((char*)bptr->base_ptr);
bptr->base_ptr = newbaseptr;
bptr->data_ptr = ((char*)bptr->data_ptr) + mdiff;
bptr->from_ptr = ((char*)bptr->from_ptr) + mdiff;
/* now update all pointers & counters */
bptr->size = newsize;
bptr->space += sdiff;
bptr->pages = pages;
return (ORTE_SUCCESS);
}
int orte_dps_dump_buffer_simple (orte_buffer_t *buffer, int outid)
{
void *src;
size_t mem_left;
char* dptr;
char* sptr;
src = buffer->from_ptr;
mem_left = buffer->toend;
dptr = (char*) buffer->data_ptr;
sptr = (char*) buffer->base_ptr;
/* output buffer's vitals */
ompi_output(outid, "Buffer vitals:\n\tbase_ptr: %p\tdata_ptr %p\tfrom_ptr %p\n",
buffer->base_ptr, buffer->data_ptr, buffer->from_ptr);
ompi_output(outid, "\tpages %d\tsize %d\tlen %d\tspace %d\ttoend %d\n\n",
buffer->pages, buffer->size, buffer->len,
buffer->space, buffer->toend);
if ((size_t)buffer->len != (size_t)(dptr-sptr)) {
ompi_output(outid, "data_ptr - base_ptr = %ld length %ld diff %ld\n\n",
(dptr-sptr), buffer->len, buffer->len - (dptr-sptr));
return (ORTE_ERROR);
}
return (ORTE_SUCCESS);
}
int orte_dps_dump_buffer(orte_buffer_t *buffer, int outid)
{
void *src;
uint32_t *s32, *d32;
char *sstr;
uint8_t *sptr;
size_t num, nbytes, mem_left, i, len;
orte_data_type_t type;
src = buffer->from_ptr;
mem_left = buffer->toend;
/* output buffer's vitals */
ompi_output(outid, "Buffer vitals:\n\tbase_ptr: %p\tdata_ptr %p\tfrom_ptr %p\n",
buffer->base_ptr, buffer->data_ptr, buffer->from_ptr);
ompi_output(outid, "\tpages %d\tsize %d\tlen %d\tspace %d\ttoend %d\n\n",
buffer->pages, buffer->size, buffer->len,
buffer->space, buffer->toend);
if (buffer->len != ((char*)buffer->data_ptr - (char*)buffer->base_ptr)) {
ompi_output(outid, "data_ptr - base_ptr = %ld length %ld diff %ld\n\n",
((char*)buffer->data_ptr - (char*)buffer->base_ptr), buffer->len,
buffer->len - ((char*)buffer->data_ptr - (char*)buffer->base_ptr));
}
while (0 < mem_left) {
/* got enough for type? */
if (sizeof(uint32_t) > mem_left) {
ompi_output(outid, "Not enough memory for type");
return ORTE_ERR_UNPACK_FAILURE;
}
s32 = (uint32_t *) src;
type = (orte_data_type_t)ntohl(*s32);
s32++;
src = (void *)s32;
mem_left -= sizeof(uint32_t);
/* got enough left for num_vals? */
if (sizeof(uint32_t) > mem_left) { /* not enough memory */
ompi_output(outid, "Not enough memory for number of values");
return ORTE_ERR_UNPACK_FAILURE;
}
/* unpack the number of values */
s32 = (uint32_t *) src;
num = (size_t)ntohl(*s32);
s32++;
src = (void *)s32;
mem_left -= sizeof(uint32_t);
ompi_output(outid, "Item: type %d number %d", (int)type, (int)num);
switch(type) {
case ORTE_BYTE:
case ORTE_INT8:
case ORTE_UINT8:
mem_left -= num*sizeof(uint8_t);
src = ((char*) src) + num * sizeof(uint8_t);
break;
case ORTE_INT16:
case ORTE_UINT16:
mem_left -= num * sizeof(uint16_t);
src = ((char*) src) + num * sizeof(uint16_t);
break;
case ORTE_INT32:
case ORTE_UINT32:
mem_left -= num * sizeof(uint32_t);
src = ((char*) src) + num * sizeof(uint32_t);
break;
case ORTE_INT64:
case ORTE_UINT64:
case ORTE_FLOAT:
case ORTE_FLOAT4:
case ORTE_FLOAT8:
case ORTE_FLOAT12:
case ORTE_FLOAT16:
case ORTE_DOUBLE:
case ORTE_LONG_DOUBLE:
ompi_output(outid, "Attempt to unpack unimplemented type");
return ORTE_ERR_PACK_FAILURE;
break;
case ORTE_BOOL:
mem_left -= num * sizeof(uint8_t);
src = ((char*) src) + num * sizeof(uint8_t);
break;
case ORTE_NAME:
mem_left -= num * sizeof(orte_process_name_t);
src = ((char*) src) + num * sizeof(orte_process_name_t);
break;
case ORTE_STRING:
sstr = (char *) src;
for(i=0; i<num; i++) {
if(mem_left < sizeof(uint32_t)) {
ompi_output(outid, "Attempt to read past end of buffer");
return ORTE_UNPACK_READ_PAST_END_OF_BUFFER;
}
d32 = (uint32_t*)sstr;
len = ntohl(*d32);
d32++;
sstr= (char*)d32;
mem_left -= sizeof(uint32_t);
if(mem_left < len) {
ompi_output(outid, "Attempt to read past end of buffer");
return ORTE_UNPACK_READ_PAST_END_OF_BUFFER;
}
src = sstr = (char*)(sstr + len);
mem_left -= len;
}
break;
case ORTE_BYTE_OBJECT:
for(i=0; i<num; i++) {
if(mem_left < sizeof(uint32_t)) {
ompi_output(outid, "Attempt to read past end of buffer");
return ORTE_UNPACK_READ_PAST_END_OF_BUFFER;
}
d32 = (uint32_t*)src;
nbytes = (size_t)ntohl(*d32);
d32++;
sptr = (void*)d32;
mem_left -= sizeof(uint32_t);
if(mem_left < nbytes) {
ompi_output(outid, "Attempt to read past end of buffer");
return ORTE_UNPACK_READ_PAST_END_OF_BUFFER;
}
src = sptr = (void*)((uint8_t*)sptr + nbytes);
mem_left -= nbytes;
}
break;
case ORTE_NULL:
break;
default:
ompi_output(outid, "Attempt to unpack unknown type");
return ORTE_ERROR;
}
/* output buffer's vitals */
ompi_output(outid, "Buffer vitals:\n\tbase_ptr: %p\tdata_ptr %p\tfrom_ptr %p\n",
buffer->base_ptr, buffer->data_ptr, buffer->from_ptr);
ompi_output(outid, "\tpages %d\tsize %d\tlen %d\tspace %d\ttoend %d\n\n",
buffer->pages, buffer->size, buffer->len,
buffer->space, buffer->toend);
if (buffer->len != ((char*)buffer->data_ptr - (char*)buffer->base_ptr)) {
ompi_output(outid, "data_ptr - base_ptr = %ld length %ld diff %ld\n\n",
((char*)buffer->data_ptr - (char*)buffer->base_ptr), buffer->len,
buffer->len - ((char*)buffer->data_ptr - (char*)buffer->base_ptr));
}
}
return ORTE_SUCCESS;
}

109
src/dps/dps_load_unload.c Обычный файл
Просмотреть файл

@ -0,0 +1,109 @@
/*
* Copyright (c) 2004-2005 The Trustees of Indiana University.
* All rights reserved.
* Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
* All rights reserved.
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
* University of Stuttgart. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
/*
* DPS Buffer Operations
*/
/** @file:
*
*/
#include "orte_config.h"
#include <sys/types.h>
#include <netinet/in.h>
#include "mca/ns/base/base.h"
#include "dps_internal.h"
int orte_dps_unload(orte_buffer_t *buffer,
void **payload,
size_t *size)
{
/* check that buffer is not null */
if (!buffer) {
return ORTE_ERR_BAD_PARAM;
}
/* were we given someplace to point to the payload */
if (NULL == payload) {
return ORTE_ERR_BAD_PARAM;
}
/* anything in the buffer - if not, nothing to do */
if (NULL == buffer->base_ptr || 0 == buffer->len) {
*payload = NULL;
*size = 0;
return ORTE_SUCCESS;
}
/* okay, we have something to provide - pass it back
*/
*payload = buffer->base_ptr;
*size = buffer->len;
/* dereference everything in buffer */
buffer->base_ptr = NULL;
buffer->size = 0;
buffer->len = 0;
buffer->space = 0;
buffer->toend = 0;
return (OMPI_SUCCESS);
}
int orte_dps_load(orte_buffer_t *buffer,
void *payload,
size_t size)
{
/* check to see if the buffer has been initialized */
if (NULL == buffer) {
return ORTE_ERR_BAD_PARAM;
}
/* check that the payload is there */
if (NULL == payload || 0 >= size) {
return ORTE_SUCCESS;
}
/* check if buffer already has payload - free it if so */
if (NULL != buffer->base_ptr) {
free(buffer->base_ptr);
}
/* populate the buffer */
buffer->base_ptr = payload; /* set the start of the buffer */
/* set data pointer to END of the buffer */
buffer->data_ptr = ((char*)buffer->base_ptr) + size;
buffer->from_ptr = buffer->base_ptr; /* set the unpack start at start */
/* set counts for size and space */
buffer->size = size;
buffer->len = size; /* users buffer is expected to be full */
buffer->space = 0; /* ditto */
buffer->toend = size; /* ditto */
/* dereference the payload pointer to protect it */
payload = NULL;
return ORTE_SUCCESS;
}

656
src/dps/dps_pack.c Обычный файл
Просмотреть файл

@ -0,0 +1,656 @@
/*
* Copyright (c) 2004-2005 The Trustees of Indiana University.
* All rights reserved.
* Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
* All rights reserved.
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
* University of Stuttgart. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
/*
* DPS Buffer Operations
*/
/** @file:
*
*/
#include "orte_config.h"
#include <sys/types.h>
#include <netinet/in.h>
#include "include/orte_constants.h"
#include "include/orte_types.h"
#include "util/output.h"
#include "mca/gpr/gpr_types.h"
#include "mca/ns/ns_types.h"
#include "mca/rmgr/rmgr_types.h"
#include "dps_internal.h"
/**
* DPS_PACK_VALUE
*/
int orte_dps_pack(orte_buffer_t *buffer, void *src,
size_t num_vals,
orte_data_type_t type)
{
int rc;
void *dst;
int32_t op_size=0;
size_t num_bytes, hdr_bytes;
/* hdr_bytes = header for each packed type. */
/* num_bytes = packed size of data type. */
/* op_size = total size = (num_bytes+hdr_bytes) */
/* check for error */
if (!buffer || !src || 0 >= num_vals) { return (ORTE_ERROR); }
dst = buffer->data_ptr; /* get location in buffer */
/* change into to fixed size type for local size */
if (ORTE_INT == type || ORTE_UINT == type) {
switch(sizeof(int)) {
case 1:
type = (type == ORTE_INT) ? ORTE_INT8 : ORTE_UINT8;
break;
case 2:
type = (type == ORTE_INT) ? ORTE_INT16 : ORTE_UINT16;
break;
case 4:
type = (type == ORTE_INT) ? ORTE_INT32 : ORTE_UINT32;
break;
case 8:
type = (type == ORTE_INT) ? ORTE_INT64 : ORTE_UINT64;
break;
default:
return ORTE_ERR_NOT_IMPLEMENTED;
}
}
/* calculate the required memory size for this operation */
if (0 == (op_size = orte_dps_memory_required(src, num_vals, type))) { /* got error */
return ORTE_ERROR;
}
/* add in the correct space for the pack type */
hdr_bytes = orte_dps_memory_required(NULL, 1, ORTE_DATA_TYPE);
/* add in the space to store the number of values */
hdr_bytes += sizeof(uint32_t);
/* total space needed */
op_size += hdr_bytes;
/* check to see if current buffer has enough room */
if (op_size > buffer->space) { /* need to extend the buffer */
if (ORTE_SUCCESS != (rc = orte_dps_buffer_extend(buffer, op_size))) { /* got an error */
return rc;
}
dst = buffer->data_ptr; /* need to reset the dst since it could have moved */
}
/* check for size of generic data types so they can be properly packed
* NOTE we convert the generic data type flag to a hard type for storage
* to handle heterogeneity
*/
if (ORTE_SIZE == type) {
switch(sizeof(size_t)) {
case 1:
type = (type == ORTE_SIZE) ? ORTE_INT8 : ORTE_UINT8;
break;
case 2:
type = (type == ORTE_SIZE) ? ORTE_INT16 : ORTE_UINT16;
break;
case 4:
type = (type == ORTE_SIZE) ? ORTE_INT32 : ORTE_UINT32;
break;
case 8:
type = (type == ORTE_SIZE) ? ORTE_INT64 : ORTE_UINT64;
break;
default:
return ORTE_ERR_NOT_IMPLEMENTED;
}
}
/* store the data type */
if (ORTE_SUCCESS != (rc = orte_dps_pack_nobuffer(dst, &type, 1,
ORTE_DATA_TYPE, &num_bytes))) {
return rc;
}
dst = (void *)((char*)dst + num_bytes);
/* store the number of values as uint32_t */
if (ORTE_SUCCESS != (rc = orte_dps_pack_nobuffer(dst, &num_vals, 1,
ORTE_UINT32, &num_bytes))) {
return rc;
}
dst = (void *)((char*)dst + num_bytes);
/* pack the data */
if (ORTE_SUCCESS != (rc = orte_dps_pack_nobuffer(dst, src, num_vals,
type, &num_bytes))) {
return rc;
}
/* debugging */
if (num_bytes+sizeof(uint32_t)+orte_dps_memory_required(NULL, 1, ORTE_DATA_TYPE) != (size_t)op_size) {
fprintf(stderr,"orte_dps_pack: Ops, num_bytes %d + headers %d = %d, but op_size was %d?!\n",
(int)num_bytes, (int)hdr_bytes, (int)(num_bytes+hdr_bytes), (int)op_size);
}
/* fflush(stdout); fflush(stderr); */
/* fprintf(stderr,"packed total of %d bytes. Hdr %d datatype %d\n", op_size, hdr_bytes, num_bytes); */
/* fflush(stdout); fflush(stderr); */
/* ok, we managed to pack some more stuff, so update all ptrs/cnts */
buffer->data_ptr = (void*)((char*)dst + num_bytes);
buffer->len += op_size;
buffer->toend += op_size;
buffer->space -= op_size;
return ORTE_SUCCESS;
}
int orte_dps_pack_nobuffer(void *dst, void *src, size_t num_vals,
orte_data_type_t type, size_t *num_bytes)
{
size_t i, len, n;
uint16_t * d16;
uint16_t * s16;
uint32_t * d32;
uint32_t * s32;
bool *bool_src;
uint8_t *bool_dst;
uint8_t *dbyte;
char **str;
char *dstr;
orte_process_name_t *dn, *sn;
orte_byte_object_t *sbyteptr;
orte_gpr_keyval_t **keyval;
orte_gpr_value_t **values;
orte_app_context_t **app_context;
orte_app_context_map_t **app_context_map;
orte_gpr_subscription_t **subs;
orte_gpr_notify_data_t **data;
/* initialize the number of bytes */
*num_bytes = 0;
/* pack the data */
switch(type) {
case ORTE_DATA_TYPE:
case ORTE_NODE_STATE:
case ORTE_PROC_STATE:
case ORTE_EXIT_CODE:
case ORTE_BYTE:
case ORTE_INT8:
case ORTE_UINT8:
memcpy(dst, src, num_vals);
*num_bytes = num_vals;
break;
case ORTE_NOTIFY_ACTION:
case ORTE_GPR_ADDR_MODE:
case ORTE_GPR_CMD:
case ORTE_INT16:
case ORTE_UINT16:
d16 = (uint16_t *) dst;
s16 = (uint16_t *) src;
for (i=0; i<num_vals; i++) {
/* convert the host order to network order */
*d16 = htons(*s16);
d16++; s16++;
}
*num_bytes = num_vals * sizeof(uint16_t);
break;
case ORTE_VPID:
case ORTE_JOBID:
case ORTE_CELLID:
case ORTE_GPR_NOTIFY_ID:
case ORTE_INT32:
case ORTE_UINT32:
d32 = (uint32_t *) dst;
s32 = (uint32_t *) src;
for (i=0; i<num_vals; i++) {
/* convert the host order to network order */
*d32 = htonl(*s32);
d32++; s32++;
}
*num_bytes = num_vals * sizeof(uint32_t);
break;
case ORTE_INT64:
case ORTE_UINT64:
return ORTE_ERR_NOT_IMPLEMENTED;
break;
case ORTE_FLOAT:
case ORTE_FLOAT4:
case ORTE_FLOAT8:
case ORTE_FLOAT12:
case ORTE_FLOAT16:
case ORTE_DOUBLE:
case ORTE_LONG_DOUBLE:
return ORTE_ERR_NOT_IMPLEMENTED;
break;
case ORTE_BOOL:
bool_src = (bool *) src;
bool_dst = (uint8_t *) dst;
for (i=0; i<num_vals; i++) {
/* pack native bool as uint8_t */
*bool_dst = *bool_src ? (uint8_t)true : (uint8_t)false;
bool_dst++; bool_src++;
}
*num_bytes = num_vals * sizeof(uint8_t);
break;
case ORTE_STRING:
str = (char **) src;
d32 = (uint32_t *) dst;
for (i=0; i<num_vals; i++) {
len = strlen(str[i]); /* exclude the null terminator */
*d32 = htonl(len);
d32++;
dstr = (char *) d32;
memcpy(dstr, str[i], len);
d32 = (uint32_t *)(dstr + len);
*num_bytes += len + sizeof(uint32_t);
}
break;
case ORTE_NAME:
dn = (orte_process_name_t*) dst;
sn = (orte_process_name_t*) src;
for (i=0; i<num_vals; i++) {
dn->cellid = htonl(sn->cellid);
dn->jobid = htonl(sn->jobid);
dn->vpid = htonl(sn->vpid);
dn++; sn++;
}
*num_bytes = num_vals * sizeof(orte_process_name_t);
break;
case ORTE_BYTE_OBJECT:
sbyteptr = (orte_byte_object_t *) src;
dbyte = (uint8_t *) dst;
for (i=0; i<num_vals; i++) {
/* pack number of bytes */
d32 = (uint32_t*)dbyte;
*d32 = htonl(sbyteptr->size);
d32++;
dbyte = (void*)d32;
*num_bytes += sizeof(uint32_t);
/* pack actual bytes */
memcpy(dbyte, sbyteptr->bytes, sbyteptr->size);
dbyte = (uint8_t*)(dbyte + sbyteptr->size);
*num_bytes += sbyteptr->size;
sbyteptr++;
}
break;
case ORTE_KEYVAL:
/* array of pointers to keyval objects - need to pack the objects */
keyval = (orte_gpr_keyval_t**) src;
/* use temp count of bytes packed 'n'. Must add these to num_bytes at each stage */
for (i=0; i < num_vals; i++) {
/* pack the key */
n = 0;
if (ORTE_SUCCESS != orte_dps_pack_nobuffer(dst,
(void*)(&(keyval[i]->key)), 1, ORTE_STRING, &n)) {
return ORTE_ERROR;
}
dst = (void*)((char*)dst + n);
*num_bytes+=n;
/* pack the data type so we can read it for unpacking */
n = 0;
if (ORTE_SUCCESS != orte_dps_pack_nobuffer(dst, &(keyval[i]->type), 1,
ORTE_DATA_TYPE, &n)) {
return ORTE_ERROR;
}
dst = (void*)((char*)dst + n);
*num_bytes+=n;
/* pack the value */
n = 0;
if (ORTE_SUCCESS != orte_dps_pack_nobuffer(dst, &(keyval[i]->value), 1,
keyval[i]->type, &n)) {
return ORTE_ERROR;
}
dst = (void*)((char*)dst + n);
*num_bytes+=n;
}
break;
case ORTE_GPR_VALUE:
/* array of pointers to value objects - need to pack the objects */
values = (orte_gpr_value_t**) src;
for (i=0; i<num_vals; i++) {
/* pack the address mode */
n = 0;
if (ORTE_SUCCESS != orte_dps_pack_nobuffer(dst,
(void*)(&(values[i]->addr_mode)), 1, ORTE_GPR_ADDR_MODE, &n)) {
return ORTE_ERROR;
}
dst = (void*)((char*)dst + n);
*num_bytes+=n;
/* pack the segment name */
n = 0;
if (ORTE_SUCCESS != orte_dps_pack_nobuffer(dst,
(void*)(&(values[i]->segment)), 1, ORTE_STRING, &n)) {
return ORTE_ERROR;
}
dst = (void*)((char*)dst + n);
*num_bytes+=n;
/* pack the number of tokens so we can read it for unpacking */
n = 0;
if (ORTE_SUCCESS != orte_dps_pack_nobuffer(dst,
(void*)(&(values[i]->num_tokens)), 1, ORTE_INT32, &n)) {
return ORTE_ERROR;
}
dst = (void*)((char*)dst + n);
*num_bytes+=n;
/* if there are tokens, pack them */
if (0 < values[i]->num_tokens) {
n = 0;
if (ORTE_SUCCESS != orte_dps_pack_nobuffer(dst,
(void*)((values[i]->tokens)), values[i]->num_tokens, ORTE_STRING, &n)) {
return ORTE_ERROR;
}
dst = (void*)((char*)dst + n);
*num_bytes+=n;
}
/* pack the number of keyval pairs so we can read it for unpacking */
n = 0;
if (ORTE_SUCCESS != orte_dps_pack_nobuffer(dst,
(void*)(&(values[i]->cnt)), 1, ORTE_INT32, &n)) {
return ORTE_ERROR;
}
dst = (void*)((char*)dst + n);
*num_bytes+=n;
/* pack the keyval pairs */
n = 0;
if (ORTE_SUCCESS != orte_dps_pack_nobuffer(dst,
(void*)((values[i]->keyvals)), values[i]->cnt, ORTE_KEYVAL, &n)) {
return ORTE_ERROR;
}
dst = (void*)((char*)dst + n);
*num_bytes+=n;
}
break;
case ORTE_APP_CONTEXT:
/* array of pointers to orte_app_context objects - need to pack the objects a set of fields at a time */
app_context = (orte_app_context_t**) src;
for (i=0; i < num_vals; i++) {
n = 0; /* must always start count at zero! */
/* pack the application index (for multiapp jobs) */
if (ORTE_SUCCESS != orte_dps_pack_nobuffer(dst,
(void*)(&(app_context[i]->idx)), 1, ORTE_INT32, &n)) {
return ORTE_ERROR;
}
dst = (void*)((char*)dst + n);
*num_bytes+=n;
/* pack the application name */
n = 0;
if (ORTE_SUCCESS != orte_dps_pack_nobuffer(dst,
(void*)(&(app_context[i]->app)), 1, ORTE_STRING, &n)) {
return ORTE_ERROR;
}
dst = (void*)((char*)dst + n);
*num_bytes+=n;
/* pack the number of processes */
n = 0;
if (ORTE_SUCCESS != orte_dps_pack_nobuffer(dst,
(void*)(&(app_context[i]->num_procs)), 1, ORTE_INT32, &n)) {
return ORTE_ERROR;
}
dst = (void*)((char*)dst + n);
*num_bytes+=n;
/* pack the number of entries in the argv array */
n = 0;
if (ORTE_SUCCESS != orte_dps_pack_nobuffer(dst,
(void*)(&(app_context[i]->argc)), 1, ORTE_INT32, &n)) {
return ORTE_ERROR;
}
dst = (void*)((char*)dst + n);
*num_bytes+=n;
/* if there are entries, pack the argv entries */
if (0 < app_context[i]->argc) {
n = 0;
if (ORTE_SUCCESS != orte_dps_pack_nobuffer(dst,
(void*)(app_context[i]->argv), app_context[i]->argc, ORTE_STRING, &n)) {
return ORTE_ERROR;
}
dst = (void*)((char*)dst + n);
*num_bytes+=n;
}
/* pack the number of entries in the enviro array */
n = 0;
if (ORTE_SUCCESS != orte_dps_pack_nobuffer(dst,
(void*)(&(app_context[i]->num_env)), 1, ORTE_INT32, &n)) {
return ORTE_ERROR;
}
dst = (void*)((char*)dst + n);
*num_bytes+=n;
/* if there are entries, pack the enviro entries */
if (0 < app_context[i]->num_env) {
n = 0;
if (ORTE_SUCCESS != orte_dps_pack_nobuffer(dst,
(void*)(app_context[i]->env), app_context[i]->num_env, ORTE_STRING, &n)) {
return ORTE_ERROR;
}
dst = (void*)((char*)dst + n);
*num_bytes+=n;
}
/* pack the cwd */
n = 0;
if (ORTE_SUCCESS != orte_dps_pack_nobuffer(dst,
(void*)(&(app_context[i]->cwd)), 1, ORTE_STRING, &n)) {
return ORTE_ERROR;
}
dst = (void*)((char*)dst + n);
*num_bytes+=n;
/* Pack the map data */
n = 0;
if (ORTE_SUCCESS != orte_dps_pack_nobuffer(dst,
(void*)(&(app_context[i]->num_map)), 1, ORTE_INT32, &n)) {
return ORTE_ERROR;
}
dst = (void*)((char*)dst + n);
*num_bytes += n;
if (app_context[i]->num_map > 0) {
n = 0;
if (ORTE_SUCCESS != orte_dps_pack_nobuffer(dst,
(void*)(app_context[i]->map_data), app_context[i]->num_map, ORTE_APP_CONTEXT_MAP, &n)) {
return ORTE_ERROR;
}
dst = (void*)((char*)dst + n);
*num_bytes += n;
}
}
break;
case ORTE_APP_CONTEXT_MAP:
app_context_map = (orte_app_context_map_t**) src;
for (i=0; i < num_vals; i++) {
n = 0;
if (ORTE_SUCCESS != orte_dps_pack_nobuffer(dst,
(void*)(&(app_context_map[i]->map_type)), 1, ORTE_UINT8, &n)) {
return ORTE_ERROR;
}
dst = (void*)((char*)dst + n);
*num_bytes += n;
n = 0;
if (ORTE_SUCCESS != orte_dps_pack_nobuffer(dst,
(void*)(&(app_context_map[i]->map_data)), 1, ORTE_STRING, &n)) {
return ORTE_ERROR;
}
dst = (void*)((char*)dst + n);
*num_bytes += n;
}
break;
case ORTE_GPR_SUBSCRIPTION:
/* array of pointers to subscription objects - need to pack the objects */
subs = (orte_gpr_subscription_t**) src;
for (i=0; i<num_vals; i++) {
/* pack the address mode */
n = 0;
if (ORTE_SUCCESS != orte_dps_pack_nobuffer(dst,
(void*)(&(subs[i]->addr_mode)), 1, ORTE_GPR_ADDR_MODE, &n)) {
return ORTE_ERROR;
}
dst = (void*)((char*)dst + n);
*num_bytes+=n;
/* pack the segment name */
n = 0;
if (ORTE_SUCCESS != orte_dps_pack_nobuffer(dst,
(void*)(&(subs[i]->segment)), 1, ORTE_STRING, &n)) {
return ORTE_ERROR;
}
dst = (void*)((char*)dst + n);
*num_bytes+=n;
/* pack the number of tokens so we can read it for unpacking */
n = 0;
if (ORTE_SUCCESS != orte_dps_pack_nobuffer(dst,
(void*)(&(subs[i]->num_tokens)), 1, ORTE_INT32, &n)) {
return ORTE_ERROR;
}
dst = (void*)((char*)dst + n);
*num_bytes+=n;
/* if there are tokens, pack them */
if (0 < subs[i]->num_tokens) {
n = 0;
if (ORTE_SUCCESS != orte_dps_pack_nobuffer(dst,
(void*)((subs[i]->tokens)), subs[i]->num_tokens, ORTE_STRING, &n)) {
return ORTE_ERROR;
}
dst = (void*)((char*)dst + n);
*num_bytes+=n;
}
/* pack the number of keys so we can read it for unpacking */
n = 0;
if (ORTE_SUCCESS != orte_dps_pack_nobuffer(dst,
(void*)(&(subs[i]->num_keys)), 1, ORTE_INT32, &n)) {
return ORTE_ERROR;
}
dst = (void*)((char*)dst + n);
*num_bytes+=n;
/* if there are keys, pack them */
if (0 < subs[i]->num_keys) {
n = 0;
if (ORTE_SUCCESS != orte_dps_pack_nobuffer(dst,
(void*)((subs[i]->keys)), subs[i]->num_keys, ORTE_STRING, &n)) {
return ORTE_ERROR;
}
dst = (void*)((char*)dst + n);
*num_bytes+=n;
}
/* skip the pointers for cb_func and user_tag */
}
break;
case ORTE_GPR_NOTIFY_DATA:
/* array of pointers to notify data objects - need to pack the objects */
data = (orte_gpr_notify_data_t**) src;
for (i=0; i<num_vals; i++) {
/* pack the callback number */
n = 0;
if (ORTE_SUCCESS != orte_dps_pack_nobuffer(dst,
(void*)(&(data[i]->cb_num)), 1, ORTE_INT32, &n)) {
return ORTE_ERROR;
}
dst = (void*)((char*)dst + n);
*num_bytes+=n;
/* pack the address mode */
n = 0;
if (ORTE_SUCCESS != orte_dps_pack_nobuffer(dst,
(void*)(&(data[i]->addr_mode)), 1, ORTE_GPR_ADDR_MODE, &n)) {
return ORTE_ERROR;
}
dst = (void*)((char*)dst + n);
*num_bytes+=n;
/* pack the segment name */
n = 0;
if (ORTE_SUCCESS != orte_dps_pack_nobuffer(dst,
(void*)(&(data[i]->segment)), 1, ORTE_STRING, &n)) {
return ORTE_ERROR;
}
dst = (void*)((char*)dst + n);
*num_bytes+=n;
/* pack the number of values so we can read it for unpacking */
n = 0;
if (ORTE_SUCCESS != orte_dps_pack_nobuffer(dst,
(void*)(&(data[i]->cnt)), 1, ORTE_INT32, &n)) {
return ORTE_ERROR;
}
dst = (void*)((char*)dst + n);
*num_bytes+=n;
/* if there are values, pack the values */
if (0 < data[i]->cnt) {
n = 0;
if (ORTE_SUCCESS != orte_dps_pack_nobuffer(dst,
(void*)((data[i]->values)), data[i]->cnt, ORTE_GPR_VALUE, &n)) {
return ORTE_ERROR;
}
dst = (void*)((char*)dst + n);
*num_bytes+=n;
}
}
break;
case ORTE_NULL:
break;
default:
return ORTE_ERR_BAD_PARAM;
}
return ORTE_SUCCESS;
}

80
src/dps/dps_peek.c Обычный файл
Просмотреть файл

@ -0,0 +1,80 @@
/*
* Copyright (c) 2004-2005 The Trustees of Indiana University.
* All rights reserved.
* Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
* All rights reserved.
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
* University of Stuttgart. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
/*
* DPS Buffer Operations
*/
/** @file:
*
*/
#include "orte_config.h"
#include <sys/types.h>
#include <netinet/in.h>
#include "dps_internal.h"
int orte_dps_peek(orte_buffer_t *buffer,
orte_data_type_t *type,
size_t *number)
{
int rc=ORTE_SUCCESS;
size_t num_vals;
size_t mem_left;
size_t num_bytes, hdr_bytes;
void *src;
uint32_t * s32;
orte_data_type_t stored_type;
/* check for errors */
if (buffer == NULL) {
return (ORTE_ERR_BAD_PARAM);
}
num_bytes = 0; /* have not unpacked any yet */
hdr_bytes = 0;
src = buffer->from_ptr; /* get location in buffer */
mem_left = buffer->toend; /* how much data is left in buffer */
/* check to see if there is enough in the buffer to hold the pack type */
if (mem_left < sizeof(orte_data_type_t)) {
return ORTE_ERR_UNPACK_FAILURE;
}
/* first thing in the current buffer space must be the type */
if (ORTE_SUCCESS != (rc =orte_dps_unpack_nobuffer(&stored_type, src, 1,
ORTE_DATA_TYPE, &mem_left, &hdr_bytes))) {
return rc;
}
src = (void*)((char*)src + hdr_bytes);
/* got enough left for num_vals? */
if (sizeof(uint32_t) > mem_left) { /* not enough memory */
return ORTE_ERR_UNPACK_FAILURE;
}
/* unpack the number of values */
s32 = (uint32_t *) src;
num_vals = (size_t)ntohl(*s32);
if (type != NULL)
*type = stored_type;
if (number != NULL)
*number = num_vals;
return ORTE_SUCCESS;
}

64
src/dps/dps_types.h Обычный файл
Просмотреть файл

@ -0,0 +1,64 @@
/* -*- C -*-
*
* Copyright (c) 2004-2005 The Trustees of Indiana University.
* All rights reserved.
* Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
* All rights reserved.
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
* University of Stuttgart. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
/**
* @file
*
* Resource Discovery & Allocation Subsystem (RDAS)
*
* The RDAS is responsible for discovering the resources available to the universe, and
* for allocating them to the requesting job.
*
*/
#ifndef ORTE_DPS_TYPES_H_
#define ORTE_DPS_TYPES_H_
#include "orte_config.h"
#include "class/ompi_object.h"
#if defined(c_plusplus) || defined(__cplusplus)
extern "C" {
#endif
typedef struct orte_buffer_t {
/* first member must be the objects parent */
ompi_object_t parent;
void* base_ptr; /* start of my memory */
void* data_ptr; /* location of where next data will go */
void* from_ptr; /* location of where to get the next data from */
/* counters */
int32_t pages; /* number of orte_dps_size pages of memory used (pages) */
int32_t size; /* total size of this buffer (bytes) */
int32_t len; /* total amount already packed (bytes) */
int32_t space; /* how much space we have left (bytes) */
/* yep, size=len+space */
int32_t toend; /* how many bytes till the end when unpacking :) */
/* yep, toend is the opposite of len */
} orte_buffer_t;
/* formalise the declaration */
OMPI_DECLSPEC OBJ_CLASS_DECLARATION (orte_buffer_t);
#if defined(c_plusplus) || defined(__cplusplus)
}
#endif
#endif /* ORTE_DPS_TYPES_H */

788
src/dps/dps_unpack.c Обычный файл
Просмотреть файл

@ -0,0 +1,788 @@
/*
* Copyright (c) 2004-2005 The Trustees of Indiana University.
* All rights reserved.
* Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
* All rights reserved.
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
* University of Stuttgart. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
/*
* DPS Buffer Operations
*/
/** @file:
*
*/
#include "orte_config.h"
#include <sys/types.h>
#include <netinet/in.h>
#include "include/orte_constants.h"
#include "include/orte_types.h"
#include "mca/gpr/gpr_types.h"
#include "mca/ns/ns_types.h"
#include "mca/rmgr/rmgr_types.h"
#include "dps_internal.h"
/**
* DPS UNPACK VALUE
*/
int orte_dps_unpack(orte_buffer_t *buffer, void *dst,
size_t *max_num_vals,
orte_data_type_t type)
{
int rc=ORTE_SUCCESS;
size_t num_vals;
size_t mem_left;
size_t num_bytes, hdr_bytes;
void *src;
uint32_t * s32;
orte_data_type_t stored_type;
/* check for errors */
if (buffer == NULL || dst == NULL || max_num_vals == NULL) {
return (ORTE_ERR_BAD_PARAM);
}
num_bytes = 0; /* have not unpacked any yet */
hdr_bytes = 0;
src = buffer->from_ptr; /* get location in buffer */
mem_left = buffer->toend; /* how much data is left in buffer */
/* check to see if there is enough in the buffer to hold the pack type */
if (mem_left < sizeof(orte_data_type_t)) {
return ORTE_ERR_UNPACK_FAILURE;
}
/* first thing in the current buffer space must be the type */
if (ORTE_SUCCESS != (rc =orte_dps_unpack_nobuffer(&stored_type, src, 1,
ORTE_DATA_TYPE, &mem_left, &hdr_bytes))) {
return rc;
}
src = (void*)((char*)src + hdr_bytes);
if(type == ORTE_INT || type == ORTE_UINT) {
switch(sizeof(int)) {
case 1:
type = (type == ORTE_INT) ? ORTE_INT8 : ORTE_UINT8;
break;
case 2:
type = (type == ORTE_INT) ? ORTE_INT16 : ORTE_UINT16;
break;
case 4:
type = (type == ORTE_INT) ? ORTE_INT32 : ORTE_UINT32;
break;
case 8:
type = (type == ORTE_INT) ? ORTE_INT64 : ORTE_UINT64;
break;
default:
return ORTE_ERR_NOT_IMPLEMENTED;
}
}
/* check for type match - for now we require this to be an exact match -
* though we should probably support conversions when there is no loss
* of precision.
*/
if (stored_type != type) {
return ORTE_PACK_MISMATCH;
}
/* got enough left for num_vals? */
if (sizeof(uint32_t) > mem_left) { /* not enough memory */
return ORTE_ERR_UNPACK_FAILURE;
}
/* unpack the number of values */
s32 = (uint32_t *) src;
num_vals = (size_t)ntohl(*s32);
if (num_vals > *max_num_vals) { /* not enough space provided */
return ORTE_UNPACK_INADEQUATE_SPACE;
}
s32++;
src = (void *)s32;
mem_left -= sizeof(uint32_t); /* we do this here but this is normally a function of unpack_nobuffer */
hdr_bytes += sizeof(uint32_t);
/* will check to see if adequate storage in buffer prior
* to unpacking the item
*/
if (ORTE_SUCCESS != (rc = orte_dps_unpack_nobuffer(dst, src, num_vals,
stored_type, &mem_left, &num_bytes))) {
return rc;
}
/* fflush(stdout); fflush(stderr); */
/* fprintf(stderr,"unpacked total bytes %d, (hdr %d datatype %d)\n", num_bytes+hdr_bytes, hdr_bytes, num_bytes); */
/* fflush(stdout); fflush(stderr); */
/* ok, we managed to unpack some stuff, so update all ptrs/cnts */
buffer->from_ptr = (void*)((char*)src + num_bytes); /* move by data type size only as src is after the header */
buffer->toend = mem_left; /* closer to the end */
buffer->len -= (num_bytes+hdr_bytes); /* and less data left */
/* return the number of values unpacked */
*max_num_vals = num_vals;
return rc;
}
int orte_dps_unpack_nobuffer(void *dst, void *src, size_t num_vals,
orte_data_type_t type,
size_t *mem_left, size_t *num_bytes)
{
int rc;
size_t i;
size_t j;
size_t n;
uint16_t * d16;
uint32_t * d32;
uint16_t * s16;
uint32_t * s32;
uint8_t* bool_src;
bool *bool_dst;
char **dstr;
orte_process_name_t* dn;
orte_process_name_t* sn;
orte_byte_object_t* dbyteptr;
orte_gpr_keyval_t **keyval;
orte_gpr_value_t **values;
orte_app_context_t **app_context;
orte_app_context_map_t **app_context_map;
uint32_t len;
char *str, *sstr;
void *sptr;
orte_gpr_subscription_t **subs;
orte_gpr_notify_data_t **data;
/* defaults */
rc = ORTE_SUCCESS;
*num_bytes = 0;
switch(type) {
case ORTE_DATA_TYPE:
case ORTE_NODE_STATE:
case ORTE_PROC_STATE:
case ORTE_EXIT_CODE:
case ORTE_BYTE:
case ORTE_INT8:
case ORTE_UINT8:
if (num_vals > *mem_left) {
num_vals = *mem_left;
rc = ORTE_UNPACK_READ_PAST_END_OF_BUFFER;
}
memcpy(dst, src, num_vals);
*num_bytes = num_vals * sizeof(uint8_t);
break;
case ORTE_NOTIFY_ACTION:
case ORTE_GPR_ADDR_MODE:
case ORTE_GPR_CMD:
case ORTE_INT16:
case ORTE_UINT16:
if(num_vals * sizeof(uint16_t) > *mem_left) {
num_vals = *mem_left / sizeof(uint16_t);
rc = ORTE_UNPACK_READ_PAST_END_OF_BUFFER;
}
s16 = (uint16_t *) src;
d16 = (uint16_t *) dst;
for(i=0; i<num_vals; i++) {
/* convert the network order to host order */
*d16 = ntohs(*s16);
d16++; s16++;
}
*num_bytes = num_vals * sizeof(uint16_t);
break;
case ORTE_VPID:
case ORTE_JOBID:
case ORTE_CELLID:
case ORTE_GPR_NOTIFY_ID:
case ORTE_INT32:
case ORTE_UINT32:
if(num_vals * sizeof(uint32_t) > *mem_left) {
num_vals = *mem_left / sizeof(uint32_t);
rc = ORTE_UNPACK_READ_PAST_END_OF_BUFFER;
}
s32 = (uint32_t *) src;
d32 = (uint32_t *) dst;
for(i=0; i<num_vals; i++) {
/* convert the network order to host order */
*d32 = ntohl(*s32);
d32++; s32++;
}
*num_bytes = num_vals * sizeof(uint32_t);
break;
case ORTE_INT64:
case ORTE_UINT64:
return ORTE_ERR_NOT_IMPLEMENTED;
break;
case ORTE_FLOAT:
case ORTE_FLOAT4:
case ORTE_FLOAT8:
case ORTE_FLOAT12:
case ORTE_FLOAT16:
case ORTE_DOUBLE:
case ORTE_LONG_DOUBLE:
return ORTE_ERR_NOT_IMPLEMENTED;
break;
case ORTE_BOOL:
if(num_vals * sizeof(uint8_t) > *mem_left) {
num_vals = *mem_left / sizeof(uint8_t);
rc = ORTE_UNPACK_READ_PAST_END_OF_BUFFER;
}
bool_src = (uint8_t *) src;
bool_dst = (bool *) dst;
for(i=0; i<num_vals; i++) {
/* convert packed uint8_t to native bool */
*bool_dst = (*bool_src) ? true : false;
bool_dst++; bool_src++;
}
*num_bytes = num_vals * sizeof(uint8_t);
break;
case ORTE_STRING:
dstr = (char**)dst;
sstr = (char *) src;
for(i=0; i<num_vals; i++) {
if(*mem_left < sizeof(uint32_t)) {
return ORTE_UNPACK_READ_PAST_END_OF_BUFFER;
}
d32 = (uint32_t*)sstr;
len = ntohl(*d32);
d32++;
sstr= (char*)d32;
*num_bytes += sizeof(uint32_t);
*mem_left -= sizeof(uint32_t);
if(*mem_left < len) {
return ORTE_UNPACK_READ_PAST_END_OF_BUFFER;
}
if(NULL == (str = malloc(len+1)))
return ORTE_ERR_OUT_OF_RESOURCE;
memcpy(str,sstr,len);
str[len] = '\0';
dstr[i] = str;
sstr = (char*)(sstr + len);
*mem_left -= len;
*num_bytes += len;
}
return ORTE_SUCCESS;
break;
case ORTE_NAME:
dn = (orte_process_name_t*) dst;
sn = (orte_process_name_t*) src;
for (i=0; i<num_vals; i++) {
dn->cellid = ntohl(sn->cellid);
dn->jobid = ntohl(sn->jobid);
dn->vpid = ntohl(sn->vpid);
dn++; sn++;
}
*num_bytes = num_vals * sizeof(orte_process_name_t);
break;
case ORTE_BYTE_OBJECT:
dbyteptr = (orte_byte_object_t*)dst;
sptr = src; /* iterate from start of buffer */
for(i=0; i<num_vals; i++) {
if(*mem_left < sizeof(uint32_t)) {
return ORTE_UNPACK_READ_PAST_END_OF_BUFFER;
}
d32 = (uint32_t*)sptr;
dbyteptr->size = (size_t)ntohl(*d32);
d32++;
sptr = (void*)d32;
*mem_left -= sizeof(uint32_t);
*num_bytes += sizeof(uint32_t);
if(*mem_left < dbyteptr->size) {
return ORTE_UNPACK_READ_PAST_END_OF_BUFFER;
}
if(NULL == (dbyteptr->bytes = malloc(dbyteptr->size)))
return ORTE_ERR_OUT_OF_RESOURCE;
memcpy(dbyteptr->bytes,sptr,dbyteptr->size);
sptr = (void*)((uint8_t*)sptr + dbyteptr->size);
*mem_left -= dbyteptr->size;
*num_bytes += dbyteptr->size;
dbyteptr++;
}
return ORTE_SUCCESS;
break;
case ORTE_KEYVAL:
/* unpack into an array of keyval objects */
keyval = (orte_gpr_keyval_t**) dst;
/* use temp count of unpacked 'n' which we sum to produce correct value later */
for (i=0; i < num_vals; i++) {
keyval[i] = OBJ_NEW(orte_gpr_keyval_t);
if (NULL == keyval[i]) {
return ORTE_ERR_OUT_OF_RESOURCE;
}
n = 0;
if (ORTE_SUCCESS != (rc = orte_dps_unpack_nobuffer(&(keyval[i]->key),
src, 1, ORTE_STRING, mem_left, &n))) {
return rc;
}
src = (void*)((char*)src + n);
*num_bytes+=n;
n = 0;
if (ORTE_SUCCESS != (rc = orte_dps_unpack_nobuffer(&(keyval[i]->type),
src, 1, ORTE_DATA_TYPE, mem_left, &n))) {
return rc;
}
src = (void*)((char*)src + n);
*num_bytes+=n;
n = 0;
if (ORTE_SUCCESS != (rc = orte_dps_unpack_nobuffer(&(keyval[i]->value),
src, 1, keyval[i]->type, mem_left, &n))) {
return rc;
}
src = (void*)((char*)src + n);
*num_bytes+=n;
}
/* must return here for composite unpacks that change mem_left directly */
return ORTE_SUCCESS;
break;
case ORTE_GPR_VALUE:
/* unpack into array of value objects */
values = (orte_gpr_value_t**) dst;
for (i=0; i < num_vals; i++) {
/* create the value object */
values[i] = OBJ_NEW(orte_gpr_value_t);
if (NULL == values[i]) {
return ORTE_ERR_OUT_OF_RESOURCE;
}
/* unpack the address mode */
n = 0;
if (ORTE_SUCCESS != (rc = orte_dps_unpack_nobuffer(&(values[i]->addr_mode),
src, 1, ORTE_GPR_ADDR_MODE, mem_left, &n))) {
return rc;
}
src = (void*)((char*)src + n);
*num_bytes+=n;
/* unpack the segment name */
n = 0;
if (ORTE_SUCCESS != (rc = orte_dps_unpack_nobuffer(&(values[i]->segment),
src, 1, ORTE_STRING, mem_left, &n))) {
return rc;
}
src = (void*)((char*)src + n);
*num_bytes+=n;
/* get the number of tokens */
n = 0;
if (ORTE_SUCCESS != (rc = orte_dps_unpack_nobuffer(&(values[i]->num_tokens),
src, 1, ORTE_INT32, mem_left, &n))) {
return rc;
}
src = (void*)((char*)src + n);
*num_bytes+=n;
/* if there are tokens, allocate the required space for the char * pointers */
if (0 < values[i]->num_tokens) {
values[i]->tokens = (char **)malloc(values[i]->num_tokens * sizeof(char*));
if (NULL == values[i]->tokens) {
return ORTE_ERR_OUT_OF_RESOURCE;
}
/* and unpack them */
n = 0;
if (ORTE_SUCCESS != (rc = orte_dps_unpack_nobuffer(values[i]->tokens,
src, values[i]->num_tokens, ORTE_STRING, mem_left, &n))) {
return rc;
}
src = (void*)((char*)src + n);
*num_bytes+=n;
}
/* get the number of keyval pairs */
n = 0;
if (ORTE_SUCCESS != (rc = orte_dps_unpack_nobuffer(&(values[i]->cnt),
src, 1, ORTE_INT32, mem_left, &n))) {
return rc;
}
src = (void*)((char*)src + n);
*num_bytes+=n;
/* allocate the required space for the keyval object pointers */
if(values[i]->cnt) {
values[i]->keyvals = (orte_gpr_keyval_t**)malloc(values[i]->cnt * sizeof(orte_gpr_keyval_t*));
if (NULL == values[i]->keyvals) {
return ORTE_ERR_OUT_OF_RESOURCE;
}
/* unpack the keyval pairs */
n = 0;
if (ORTE_SUCCESS != (rc = orte_dps_unpack_nobuffer(values[i]->keyvals,
src, values[i]->cnt, ORTE_KEYVAL, mem_left, &n))) {
return rc;
}
src = (void*)((char*)src + n);
*num_bytes+=n;
}
}
/* must return here for composite unpacks that change mem_left directly */
return ORTE_SUCCESS;
break;
case ORTE_APP_CONTEXT:
/* unpack into array of app_context objects */
app_context = (orte_app_context_t**) dst;
for (i=0; i < num_vals; i++) {
/* create the app_context object */
app_context[i] = OBJ_NEW(orte_app_context_t);
if (NULL == app_context[i]) {
return ORTE_ERR_OUT_OF_RESOURCE;
}
/* get the app index number */
n = 0;
if (ORTE_SUCCESS != (rc = orte_dps_unpack_nobuffer(&(app_context[i]->idx),
src, 1, ORTE_INT32, mem_left, &n))) {
return rc;
}
src = (void*)((char*)src + n);
*num_bytes+=n;
/* unpack the application name */
n = 0;
if (ORTE_SUCCESS != (rc = orte_dps_unpack_nobuffer(&(app_context[i]->app),
src, 1, ORTE_STRING, mem_left, &n))) {
return rc;
}
src = (void*)((char*)src + n);
*num_bytes+=n;
/* get the number of processes */
n = 0;
if (ORTE_SUCCESS != (rc = orte_dps_unpack_nobuffer(&(app_context[i]->num_procs),
src, 1, ORTE_INT32, mem_left, &n))) {
return rc;
}
src = (void*)((char*)src + n);
*num_bytes+=n;
/* get the number of argv strings */
n = 0;
if (ORTE_SUCCESS != (rc = orte_dps_unpack_nobuffer(&(app_context[i]->argc),
src, 1, ORTE_INT32, mem_left, &n))) {
return rc;
}
src = (void*)((char*)src + n);
*num_bytes+=n;
/* if there are argv strings, allocate the required space for the char * pointers */
if (0 < app_context[i]->argc) {
app_context[i]->argv = (char **)malloc((app_context[i]->argc+1) * sizeof(char*));
if (NULL == app_context[i]->argv) {
return ORTE_ERR_OUT_OF_RESOURCE;
}
app_context[i]->argv[app_context[i]->argc] = NULL;
/* and unpack them */
n = 0;
if (ORTE_SUCCESS != (rc = orte_dps_unpack_nobuffer(app_context[i]->argv,
src, app_context[i]->argc, ORTE_STRING, mem_left, &n))) {
return rc;
}
src = (void*)((char*)src + n);
*num_bytes+=n;
}
/* get the number of env strings */
n = 0;
if (ORTE_SUCCESS != (rc = orte_dps_unpack_nobuffer(&(app_context[i]->num_env),
src, 1, ORTE_INT32, mem_left, &n))) {
return rc;
}
src = (void*)((char*)src + n);
*num_bytes+=n;
/* if there are env strings, allocate the required space for the char * pointers */
if (0 < app_context[i]->num_env) {
app_context[i]->env = (char **)malloc((app_context[i]->num_env+1) * sizeof(char*));
if (NULL == app_context[i]->env) {
return ORTE_ERR_OUT_OF_RESOURCE;
}
app_context[i]->env[app_context[i]->num_env] = NULL;
/* and unpack them */
n = 0;
if (ORTE_SUCCESS != (rc = orte_dps_unpack_nobuffer(app_context[i]->env,
src, app_context[i]->num_env, ORTE_STRING, mem_left, &n))) {
return rc;
}
src = (void*)((char*)src + n);
*num_bytes+=n;
}
/* unpack the cwd */
n = 0;
if (ORTE_SUCCESS != (rc = orte_dps_unpack_nobuffer(&app_context[i]->cwd,
src, 1, ORTE_STRING, mem_left, &n))) {
return rc;
}
src = (void*)((char*)src + n);
*num_bytes+=n;
/* unpack the map data */
n = 0;
if (ORTE_SUCCESS != (rc = orte_dps_unpack_nobuffer(&(app_context[i]->num_map),
src, 1, ORTE_INT32, mem_left, &n))) {
return rc;
}
src = (void*)((char*)src + n);
*num_bytes+=n;
if (app_context[i]->num_map > 0) {
app_context[i]->map_data = malloc(sizeof(orte_app_context_map_t*) * app_context[i]->num_map);
if (NULL == app_context[i]->map_data) {
return ORTE_ERR_OUT_OF_RESOURCE;
}
n = 0;
if (ORTE_SUCCESS != (rc = orte_dps_unpack_nobuffer(app_context[i]->map_data,
src, app_context[i]->num_map, ORTE_APP_CONTEXT_MAP, mem_left, &n))) {
return rc;
}
src = (void*)((char*)src + n);
*num_bytes += n;
}
}
/* must return here for composite unpacks that change mem_left directly */
return ORTE_SUCCESS;
break;
case ORTE_APP_CONTEXT_MAP:
/* unpack into array of app_context_map objects */
app_context_map = (orte_app_context_map_t**) dst;
for (i=0; i < num_vals; i++) {
/* create the app_context object */
app_context_map[i] = OBJ_NEW(orte_app_context_map_t);
if (NULL == app_context_map[i]) {
return ORTE_ERR_OUT_OF_RESOURCE;
}
/* map type */
n = 0;
if (ORTE_SUCCESS != (rc = orte_dps_unpack_nobuffer(&(app_context_map[i]->map_type),
src, 1, ORTE_UINT8, mem_left, &n))) {
return rc;
}
src = (void*)((char*)src + n);
*num_bytes+=n;
/* map data */
n = 0;
if (ORTE_SUCCESS != (rc = orte_dps_unpack_nobuffer(&(app_context_map[i]->map_data),
src, 1, ORTE_STRING, mem_left, &n))) {
return rc;
}
src = (void*)((char*)src + n);
*num_bytes+=n;
}
/* must return here for composite unpacks that change mem_left directly */
return ORTE_SUCCESS;
break;
case ORTE_GPR_SUBSCRIPTION:
/* unpack into array of subscription objects */
subs = (orte_gpr_subscription_t**) dst;
for (i=0; i < num_vals; i++) {
/* create the subscription object */
subs[i] = OBJ_NEW(orte_gpr_subscription_t);
if (NULL == subs[i]) {
return ORTE_ERR_OUT_OF_RESOURCE;
}
/* unpack the address mode */
n = 0;
if (ORTE_SUCCESS != (rc = orte_dps_unpack_nobuffer(&(subs[i]->addr_mode),
src, 1, ORTE_GPR_ADDR_MODE, mem_left, &n))) {
return rc;
}
src = (void*)((char*)src + n);
*num_bytes+=n;
/* unpack the segment name */
n = 0;
if (ORTE_SUCCESS != (rc = orte_dps_unpack_nobuffer(&(subs[i]->segment),
src, 1, ORTE_STRING, mem_left, &n))) {
return rc;
}
src = (void*)((char*)src + n);
*num_bytes+=n;
/* get the number of tokens */
n = 0;
if (ORTE_SUCCESS != (rc = orte_dps_unpack_nobuffer(&(subs[i]->num_tokens),
src, 1, ORTE_INT32, mem_left, &n))) {
return rc;
}
src = (void*)((char*)src + n);
*num_bytes+=n;
/* if there are tokens, allocate the required space for the char * pointers */
if (0 < subs[i]->num_tokens) {
subs[i]->tokens = (char **)malloc(subs[i]->num_tokens * sizeof(char*));
if (NULL == subs[i]->tokens) {
return ORTE_ERR_OUT_OF_RESOURCE;
}
/* and unpack them */
n = 0;
if (ORTE_SUCCESS != (rc = orte_dps_unpack_nobuffer(subs[i]->tokens,
src, subs[i]->num_tokens, ORTE_STRING, mem_left, &n))) {
return rc;
}
src = (void*)((char*)src + n);
*num_bytes+=n;
}
/* get the number of keys */
n = 0;
if (ORTE_SUCCESS != (rc = orte_dps_unpack_nobuffer(&(subs[i]->num_keys),
src, 1, ORTE_INT32, mem_left, &n))) {
return rc;
}
src = (void*)((char*)src + n);
*num_bytes+=n;
/* if there are keys, allocate the required space for the char * pointers */
if (0 < subs[i]->num_keys) {
subs[i]->keys = (char **)malloc(subs[i]->num_keys * sizeof(char*));
if (NULL == subs[i]->keys) {
return ORTE_ERR_OUT_OF_RESOURCE;
}
/* and unpack them */
n = 0;
if (ORTE_SUCCESS != (rc = orte_dps_unpack_nobuffer(subs[i]->keys,
src, subs[i]->num_keys, ORTE_STRING, mem_left, &n))) {
return rc;
}
src = (void*)((char*)src + n);
*num_bytes+=n;
}
/* the pointer fields for cb_func and user_tag were NOT packed
* so ignore them here as well
*/
}
/* must return here for composite unpacks that change mem_left directly */
return ORTE_SUCCESS;
break;
case ORTE_GPR_NOTIFY_DATA:
/* unpack into array of notify_data objects */
data = (orte_gpr_notify_data_t**) dst;
for (i=0; i < num_vals; i++) {
/* create the data object */
data[i] = OBJ_NEW(orte_gpr_notify_data_t);
if (NULL == data[i]) {
return ORTE_ERR_OUT_OF_RESOURCE;
}
/* unpack the callback number */
n = 0;
if (ORTE_SUCCESS != (rc = orte_dps_unpack_nobuffer(&(data[i]->cb_num),
src, 1, ORTE_INT32, mem_left, &n))) {
return rc;
}
src = (void*)((char*)src + n);
*num_bytes+=n;
/* unpack the address mode */
n = 0;
if (ORTE_SUCCESS != (rc = orte_dps_unpack_nobuffer(&(data[i]->addr_mode),
src, 1, ORTE_GPR_ADDR_MODE, mem_left, &n))) {
return rc;
}
src = (void*)((char*)src + n);
*num_bytes+=n;
/* unpack the segment name */
n = 0;
if (ORTE_SUCCESS != (rc = orte_dps_unpack_nobuffer(&(data[i]->segment),
src, 1, ORTE_STRING, mem_left, &n))) {
return rc;
}
src = (void*)((char*)src + n);
*num_bytes+=n;
/* get the number of values */
n = 0;
if (ORTE_SUCCESS != (rc = orte_dps_unpack_nobuffer(&(data[i]->cnt),
src, 1, ORTE_INT32, mem_left, &n))) {
return rc;
}
src = (void*)((char*)src + n);
*num_bytes+=n;
/* if there are values, allocate the required space for the value pointers */
if (0 < data[i]->cnt) {
data[i]->values = (orte_gpr_value_t**)malloc(data[i]->cnt * sizeof(orte_gpr_value_t*));
if (NULL == data[i]->values) {
return ORTE_ERR_OUT_OF_RESOURCE;
}
/* and unpack them */
n = 0;
if (ORTE_SUCCESS != (rc = orte_dps_unpack_nobuffer(data[i]->values,
src, data[i]->cnt, ORTE_GPR_VALUE, mem_left, &n))) {
return rc;
}
src = (void*)((char*)src + n);
*num_bytes+=n;
}
}
/* must return here for composite unpacks that change mem_left directly */
return ORTE_SUCCESS;
break;
case ORTE_NULL:
break;
default:
return ORTE_ERROR;
}
*mem_left -= *num_bytes;
return ORTE_SUCCESS;
}

99
src/dps/orte_dps_open_close.c Обычный файл
Просмотреть файл

@ -0,0 +1,99 @@
/*
* Copyright (c) 2004-2005 The Trustees of Indiana University.
* All rights reserved.
* Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
* All rights reserved.
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
* University of Stuttgart. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
/** @file:
*
*/
#include "orte_config.h"
#include "mca/base/mca_base_param.h"
#include "dps_internal.h"
/**
* globals
*/
bool orte_dps_debug;
int orte_dps_page_size;
orte_dps_t orte_dps = {
orte_dps_pack,
orte_dps_unpack,
orte_dps_pack_nobuffer,
orte_dps_unpack_nobuffer,
orte_dps_peek,
orte_dps_unload,
orte_dps_load,
orte_dps_dump_buffer
};
/**
* Object constructors, destructors, and instantiations
*/
static void orte_buffer_construct (orte_buffer_t* buffer)
{
/* allocate the initial data space */
buffer->base_ptr = (void *)malloc(orte_dps_page_size);
if (NULL == buffer->base_ptr) { /* got an error = can't init */
buffer->base_ptr = buffer->data_ptr = buffer->from_ptr = NULL;
buffer->pages = buffer->size = buffer->len = buffer-> space = buffer-> toend = 0;
} else {
buffer->data_ptr = buffer->base_ptr;
buffer->from_ptr = buffer->base_ptr;
buffer->pages = 1;
buffer->size = orte_dps_page_size;
buffer->space = orte_dps_page_size;
buffer->len = 0;
buffer->toend = 0;
}
}
static void orte_buffer_destruct (orte_buffer_t* buffer)
{
/* paranoid check */
if (NULL != buffer) {
if (NULL != buffer->base_ptr) free (buffer->base_ptr);
}
}
OBJ_CLASS_INSTANCE(orte_buffer_t,
ompi_object_t,
orte_buffer_construct,
orte_buffer_destruct);
int orte_dps_open(void)
{
char *enviro_val;
int id, page_size;
enviro_val = getenv("ORTE_dps_debug");
if (NULL != enviro_val) { /* debug requested */
orte_dps_debug = true;
} else {
orte_dps_debug = false;
}
/* setup the page size */
id = mca_base_param_register_int("dps", "page", "size", NULL, ORTE_DPS_DEFAULT_PAGE_SIZE);
mca_base_param_lookup_int(id, &page_size);
orte_dps_page_size = 1000*page_size; /* convert to bytes */
return ORTE_SUCCESS;
}
int orte_dps_close(void)
{
/* no idea what this would do right now - include it for completeness */
return ORTE_SUCCESS;
}

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

@ -19,18 +19,20 @@ SUBDIRS = \
allocator \
coll \
errmgr \
errmgr \
gpr \
io \
iof \
mpool \
llm \
ns \
one \
oob \
pcm \
pcmclient \
pls \
pml \
ptl \
rml \
ras \
rds \
rmaps \
rmgr \
soh \
svc \
topo

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

@ -14,7 +14,7 @@
include $(top_srcdir)/config/Makefile.options
SUBDIRS = $(MCA_llm_DSO_SUBDIRS)
SUBDIRS = $(MCA_pls_DSO_SUBDIRS)
DISTCLEANFILES = $(SUBDIRS)
# Every directory under here is a sym link to something in the main

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

@ -14,7 +14,7 @@
include $(top_srcdir)/config/Makefile.options
SUBDIRS = $(MCA_one_DSO_SUBDIRS)
SUBDIRS = $(MCA_ras_DSO_SUBDIRS)
DISTCLEANFILES = $(SUBDIRS)
# Every directory under here is a sym link to something in the main

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

@ -14,7 +14,7 @@
include $(top_srcdir)/config/Makefile.options
SUBDIRS = $(MCA_pcm_DSO_SUBDIRS)
SUBDIRS = $(MCA_rds_DSO_SUBDIRS)
DISTCLEANFILES = $(SUBDIRS)
# Every directory under here is a sym link to something in the main

24
src/dynamic-mca/rmaps/Makefile.am Обычный файл
Просмотреть файл

@ -0,0 +1,24 @@
#
# Copyright (c) 2004-2005 The Trustees of Indiana University.
# All rights reserved.
# Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
# All rights reserved.
# Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
# University of Stuttgart. All rights reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
#
# $HEADER$
#
include $(top_srcdir)/config/Makefile.options
SUBDIRS = $(MCA_rmaps_DSO_SUBDIRS)
DISTCLEANFILES = $(SUBDIRS)
# Every directory under here is a sym link to something in the main
# src/mca tree. Hence, we don't want to distribute anything under
# here.
DIST_SUBDIRS =

24
src/dynamic-mca/rmgr/Makefile.am Обычный файл
Просмотреть файл

@ -0,0 +1,24 @@
#
# Copyright (c) 2004-2005 The Trustees of Indiana University.
# All rights reserved.
# Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
# All rights reserved.
# Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
# University of Stuttgart. All rights reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
#
# $HEADER$
#
include $(top_srcdir)/config/Makefile.options
SUBDIRS = $(MCA_rmgr_DSO_SUBDIRS)
DISTCLEANFILES = $(SUBDIRS)
# Every directory under here is a sym link to something in the main
# src/mca tree. Hence, we don't want to distribute anything under
# here.
DIST_SUBDIRS =

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

@ -14,7 +14,7 @@
include $(top_srcdir)/config/Makefile.options
SUBDIRS = $(MCA_svc_DSO_SUBDIRS)
SUBDIRS = $(MCA_rml_DSO_SUBDIRS)
DISTCLEANFILES = $(SUBDIRS)
# Every directory under here is a sym link to something in the main

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

@ -140,6 +140,7 @@ static void ompi_event_queue_remove(struct ompi_event *, int);
static void ompi_timeout_process(void);
int ompi_event_haveevents(void);
bool ompi_event_progress_thread(void);
extern int ompi_evsignal_restart(void);
static RB_HEAD(ompi_event_tree, ompi_event) ompi_timetree;
static struct ompi_event_list ompi_activequeue;
@ -159,9 +160,9 @@ static int ompi_event_pipe_signalled;
bool ompi_event_progress_thread(void)
{
#if OMPI_ENABLE_PROGRESS_THREADS
return ompi_thread_self_compare(&ompi_event_thread);
return ompi_using_threads() ? ompi_thread_self_compare(&ompi_event_thread) : true;
#else
return false;
return true;
#endif
}
@ -206,6 +207,7 @@ static int ompi_timeout_next(struct timeval *tv)
}
#endif
/* run loop for dispatch thread */
static void* ompi_event_run(ompi_object_t* arg)
{
@ -224,14 +226,13 @@ static void* ompi_event_run(ompi_object_t* arg)
static void ompi_event_pipe_handler(int sd, short flags, void* user)
{
unsigned char byte;
if(read(sd, &byte, 1) != 1) {
if(read(sd, &byte, 1) < 0) {
ompi_output(0, "ompi_event_pipe: read failed with: errno=%d\n", errno);
ompi_event_del(&ompi_event_pipe_event);
}
}
#endif
int
ompi_event_init(void)
{
@ -259,20 +260,22 @@ ompi_event_init(void)
errx(1, "%s: no event mechanism available", __func__);
#if OMPI_ENABLE_PROGRESS_THREADS
if(pipe(ompi_event_pipe) != 0) {
ompi_output(0, "ompi_event_init: pipe() failed with errno=%d\n", errno);
return OMPI_ERROR;
}
if(ompi_using_threads()) {
if(pipe(ompi_event_pipe) != 0) {
ompi_output(0, "ompi_event_init: pipe() failed with errno=%d\n", errno);
return OMPI_ERROR;
}
ompi_event_pipe_signalled = 1;
ompi_event_set(
&ompi_event_pipe_event,
ompi_event_pipe[0],
OMPI_EV_READ|OMPI_EV_PERSIST,
ompi_event_pipe_handler,
0);
ompi_event_add_i(&ompi_event_pipe_event, 0);
ompi_event_pipe_signalled = 0;
ompi_event_pipe_signalled = 1;
ompi_event_set(
&ompi_event_pipe_event,
ompi_event_pipe[0],
OMPI_EV_READ|OMPI_EV_PERSIST,
ompi_event_pipe_handler,
0);
ompi_event_add_i(&ompi_event_pipe_event, 0);
ompi_event_pipe_signalled = 0;
}
#endif
ompi_event_enable();
@ -286,28 +289,44 @@ ompi_event_init(void)
int ompi_event_fini(void)
{
#if OMPI_ENABLE_PROGRESS_THREADS
if(--ompi_event_inited == 0)
ompi_event_disable();
if(ompi_using_threads()) {
OMPI_THREAD_LOCK(&ompi_event_lock);
if(ompi_event_inited > 0 && ompi_event_enabled) {
unsigned char byte = 0;
ompi_event_enabled = false;
write(ompi_event_pipe[1], &byte, 1);
OMPI_THREAD_UNLOCK(&ompi_event_lock);
ompi_thread_join(&ompi_event_thread, NULL);
ompi_event_pipe_signalled = 1;
} else {
OMPI_THREAD_UNLOCK(&ompi_event_lock);
}
}
#endif
ompi_event_inited--;
return OMPI_SUCCESS;
}
int ompi_event_disable(void)
{
#if OMPI_ENABLE_PROGRESS_THREADS
OMPI_THREAD_LOCK(&ompi_event_lock);
if(ompi_event_inited > 0 && ompi_event_enabled) {
ompi_event_enabled = false;
if(ompi_event_pipe_signalled == 0) {
unsigned char byte = 0;
if(write(ompi_event_pipe[1], &byte, 1) != 1)
ompi_output(0, "ompi_event_add: write() to ompi_event_pipe[1] failed with errno=%d\n", errno);
ompi_event_pipe_signalled++;
if(ompi_using_threads()) {
OMPI_THREAD_LOCK(&ompi_event_lock);
if(ompi_event_inited > 0 && ompi_event_enabled) {
ompi_event_enabled = false;
if(ompi_event_pipe_signalled == 0) {
unsigned char byte = 0;
if(write(ompi_event_pipe[1], &byte, 1) != 1)
ompi_output(0, "ompi_event_add: write() to ompi_event_pipe[1] failed with errno=%d\n", errno);
ompi_event_pipe_signalled++;
}
OMPI_THREAD_UNLOCK(&ompi_event_lock);
ompi_thread_join(&ompi_event_thread, NULL);
} else {
OMPI_THREAD_UNLOCK(&ompi_event_lock);
}
OMPI_THREAD_UNLOCK(&ompi_event_lock);
ompi_thread_join(&ompi_event_thread, NULL);
} else {
OMPI_THREAD_UNLOCK(&ompi_event_lock);
ompi_event_enabled = false;
}
#else
ompi_event_enabled = false;
@ -318,23 +337,40 @@ int ompi_event_disable(void)
int ompi_event_enable(void)
{
#if OMPI_ENABLE_PROGRESS_THREADS
int rc;
/* spin up a thread to dispatch events */
OMPI_THREAD_LOCK(&ompi_event_lock);
if(ompi_event_inited > 0 && ompi_event_enabled == false) {
OBJ_CONSTRUCT(&ompi_event_thread, ompi_thread_t);
if(ompi_using_threads()) {
int rc;
/* spin up a thread to dispatch events */
OMPI_THREAD_LOCK(&ompi_event_lock);
if(ompi_event_inited > 0 && ompi_event_enabled == false) {
OBJ_CONSTRUCT(&ompi_event_thread, ompi_thread_t);
ompi_event_enabled = true;
ompi_event_thread.t_run = ompi_event_run;
if((rc = ompi_thread_start(&ompi_event_thread)) != OMPI_SUCCESS) {
OMPI_THREAD_UNLOCK(&ompi_event_lock);
return rc;
}
}
OMPI_THREAD_UNLOCK(&ompi_event_lock);
} else {
ompi_event_enabled = true;
ompi_event_thread.t_run = ompi_event_run;
if((rc = ompi_thread_start(&ompi_event_thread)) != OMPI_SUCCESS)
return rc;
}
OMPI_THREAD_UNLOCK(&ompi_event_lock);
#else
ompi_event_enabled = true;
#endif
return OMPI_SUCCESS;
}
int ompi_event_restart(void)
{
int rc;
if((rc = ompi_event_enable()) != OMPI_SUCCESS)
return rc;
if((rc = ompi_evsignal_restart()) != 0)
return OMPI_ERROR;
return (OMPI_SUCCESS);
}
int ompi_event_haveevents(void)
{
return (RB_ROOT(&ompi_timetree) || TAILQ_FIRST(&ompi_eventqueue) ||
@ -521,7 +557,7 @@ ompi_event_add_i(struct ompi_event *ev, struct timeval *tv)
}
#if OMPI_ENABLE_PROGRESS_THREADS
if(ompi_event_pipe_signalled == 0) {
if(ompi_using_threads() && ompi_event_pipe_signalled == 0) {
unsigned char byte = 0;
if(write(ompi_event_pipe[1], &byte, 1) != 1)
ompi_output(0, "ompi_event_add: write() to ompi_event_pipe[1] failed with errno=%d\n", errno);
@ -558,7 +594,7 @@ int ompi_event_del_i(struct ompi_event *ev)
}
#if OMPI_ENABLE_PROGRESS_THREADS
if(ompi_event_pipe_signalled == 0) {
if(ompi_using_threads() && ompi_event_pipe_signalled == 0) {
unsigned char byte = 0;
if(write(ompi_event_pipe[1], &byte, 1) != 1)
ompi_output(0, "ompi_event_add: write() to ompi_event_pipe[1] failed with errno=%d\n", errno);

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

@ -151,8 +151,8 @@ struct ompi_eventop {
int (*dispatch)(void *, struct timeval *);
};
#define OMPI_TIMEOUT_DEFAULT {10, 0}
#define OMPI_EVLOOP_ONCE 0x01
#define OMPI_TIMEOUT_DEFAULT {1, 0}
#define OMPI_EVLOOP_ONCE 0x01
#define OMPI_EVLOOP_NONBLOCK 0x02
@ -163,6 +163,7 @@ OMPI_DECLSPEC int ompi_event_loop(int);
OMPI_DECLSPEC int ompi_event_enable(void);
OMPI_DECLSPEC int ompi_event_disable(void);
OMPI_DECLSPEC bool ompi_event_progress_thread(void);
OMPI_DECLSPEC int ompi_event_restart(void);
#define ompi_evtimer_add(ev, tv) ompi_event_add(ev, tv)
#define ompi_evtimer_set(ev, cb, arg) ompi_event_set(ev, -1, 0, cb, arg)

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

@ -46,6 +46,7 @@
#endif
#include <errno.h>
#include <err.h>
#include <fcntl.h>
#ifdef USE_LOG
#include "log.h"
@ -64,18 +65,17 @@ static short ompi_evsigcaught[NSIG];
static int ompi_needrecalc;
static int ompi_event_signal_pipe[2];
static ompi_event_t ompi_event_signal_pipe_event;
static int ompi_event_signal_count = 0;
volatile sig_atomic_t ompi_event_signal_count = 0;
static bool initialized = false;
volatile sig_atomic_t ompi_evsignal_caught = 0;
static void ompi_event_signal_pipe_handler(int sd, short flags, void* user)
{
unsigned char byte;
if(read(sd, &byte, 1) != 1) {
ompi_output(0, "ompi_event_signal_pipe: read failed with: errno=%d\n", errno);
ompi_event_del(&ompi_event_signal_pipe_event);
ompi_output(0, "ompi_event_signal_pipe_handler: %d\n", ompi_event_signal_count);
while(ompi_event_signal_count-- > 0) {
char byte;
read(ompi_event_signal_pipe[0], &byte, 1);
}
ompi_event_signal_count = 0;
}
void ompi_evsignal_handler(int sig);
@ -83,13 +83,6 @@ void ompi_evsignal_handler(int sig);
void
ompi_evsignal_init(sigset_t *evsigmask)
{
if (pipe(ompi_event_signal_pipe) != 0) {
ompi_output(0, "ompi_evsignal_init: pipe() failed with errno=%d\n",
errno);
return;
}
ompi_event_signal_count = 0;
sigemptyset(evsigmask);
}
@ -100,15 +93,18 @@ ompi_evsignal_add(sigset_t *evsigmask, struct ompi_event *ev)
int evsignal;
if (!initialized) {
int i;
/* Must delay the event add until after init() because
it may trigger poll events that are not yet setup
to be triggered. */
pipe(ompi_event_signal_pipe);
ompi_event_set(&ompi_event_signal_pipe_event,
ompi_event_signal_pipe[0],
OMPI_EV_READ|OMPI_EV_PERSIST,
ompi_event_signal_pipe_handler,
0);
ompi_event_add_i(&ompi_event_signal_pipe_event, 0);
ompi_event_signal_count = 0;
initialized = true;
}
@ -116,10 +112,29 @@ ompi_evsignal_add(sigset_t *evsigmask, struct ompi_event *ev)
errx(1, "%s: OMPI_EV_SIGNAL incompatible use", __func__);
evsignal = OMPI_EVENT_SIGNAL(ev);
sigaddset(evsigmask, evsignal);
return (0);
}
int
ompi_evsignal_restart(void)
{
if(initialized) {
int rc;
ompi_event_del_i(&ompi_event_signal_pipe_event);
if ((rc = pipe(ompi_event_signal_pipe)) != 0) {
return rc;
}
ompi_event_set(&ompi_event_signal_pipe_event,
ompi_event_signal_pipe[0],
OMPI_EV_READ|OMPI_EV_PERSIST,
ompi_event_signal_pipe_handler,
0);
ompi_event_signal_count = 0;
ompi_event_add_i(&ompi_event_signal_pipe_event, 0);
}
return (0);
}
/*
* Nothing to be done here.
*/
@ -140,16 +155,17 @@ void
ompi_evsignal_handler(int sig)
{
const char errmsg[] = "ompi_evsignal_handler: error in write\n";
unsigned char byte = 0;
ompi_evsigcaught[sig]++;
ompi_evsignal_caught = 1;
if (ompi_event_signal_count == 0) {
unsigned char byte = 0;
if (write(ompi_event_signal_pipe[1], &byte, 1) != 1) {
write(2, errmsg, sizeof(errmsg));
}
ompi_event_signal_count++;
}
#if 0
if(ompi_event_signal_count == 0) {
ompi_event_signal_count++;
write(ompi_event_signal_pipe[1], &byte, 1);
}
#endif
}
int

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

@ -18,6 +18,9 @@ SUBDIRS = sys
noinst_HEADERS = \
constants.h \
orte_constants.h \
orte_schema.h \
orte_types.h \
totalview.h \
types.h \
ompi_socket_errno.h

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

@ -54,8 +54,16 @@ enum {
OMPI_NODE_DOWN = -34,
OMPI_NODE_BOOTING = -35,
OMPI_NODE_ERROR = -36,
OMPI_PACK_MISMATCH = -37
OMPI_PACK_MISMATCH = -37,
OMPI_ERR_PACK_FAILURE = -38,
OMPI_ERR_UNPACK_FAILURE = -39,
OMPI_ERR_COMM_FAILURE = -40,
OMPI_UNPACK_INADEQUATE_SPACE = -41,
OMPI_UNPACK_READ_PAST_END_OF_BUFFER = -42,
OMPI_ERR_NOT_AVAILABLE = -43
};
#define OMPI_NAMESPACE_SEGMENT "ompi-namespace"
#endif /* OMPI_CONSTANTS_H */

74
src/include/orte_constants.h Обычный файл
Просмотреть файл

@ -0,0 +1,74 @@
/*
* Copyright (c) 2004-2005 The Trustees of Indiana University.
* All rights reserved.
* Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
* All rights reserved.
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
* University of Stuttgart. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
#ifndef ORTE_CONSTANTS_H
#define ORTE_CONSTANTS_H
/* error codes
*
* ANY CHANGES TO THESE DEFINITIONS MUST BE REFLECTED IN THE TEXT ARRAY
* orte_error_strings DEFINED IN src/runtime/orte_init.c.
*
*/
enum {
ORTE_SUCCESS = 0,
ORTE_ERROR = -1,
ORTE_ERR_OUT_OF_RESOURCE = -2, /* fatal error */
ORTE_ERR_TEMP_OUT_OF_RESOURCE = -3, /* try again later */
ORTE_ERR_RESOURCE_BUSY = -4,
ORTE_ERR_BAD_PARAM = -5, /* equivalent to MPI_ERR_ARG error code */
ORTE_ERR_RECV_LESS_THAN_POSTED = -6,
ORTE_ERR_RECV_MORE_THAN_POSTED = -7,
ORTE_ERR_NO_MATCH_YET = -8,
ORTE_ERR_FATAL = -9,
ORTE_ERR_NOT_IMPLEMENTED = -10,
ORTE_ERR_NOT_SUPPORTED = -11,
ORTE_ERR_INTERUPTED = -12,
ORTE_ERR_WOULD_BLOCK = -13,
ORTE_ERR_IN_ERRNO = -14,
ORTE_ERR_UNREACH = -15,
ORTE_ERR_NOT_FOUND = -16,
ORTE_ERR_BUFFER = -17, /* equivalent to MPI_ERR_BUFFER */
ORTE_ERR_REQUEST = -18, /* equivalent to MPI_ERR_REQUEST */
ORTE_EXISTS = -19, /* indicates that the specified object already exists */
ORTE_ERR_NO_CONNECTION_ALLOWED = -20, /* indicates that the receiving process does not allow connections */
ORTE_ERR_CONNECTION_REFUSED = -21, /* contact made with process, but it refuses any further communication */
ORTE_ERR_CONNECTION_FAILED = -22, /* message sent, but delivery failed */
ORTE_ERR_TIMEOUT = -23,
ORTE_STARTUP_DETECTED = -24,
ORTE_SHUTDOWN_DETECTED = -25,
ORTE_PROC_STARTING = -26,
ORTE_PROC_STOPPED = -27,
ORTE_PROC_TERMINATING = -28,
ORTE_PROC_ALIVE = -29,
ORTE_PROC_RUNNING = -30,
ORTE_PROC_KILLED = -31,
ORTE_PROC_EXITED = -32,
ORTE_NODE_UP = -33,
ORTE_NODE_DOWN = -34,
ORTE_NODE_BOOTING = -35,
ORTE_NODE_ERROR = -36,
ORTE_PACK_MISMATCH = -37,
ORTE_ERR_PACK_FAILURE = -38,
ORTE_ERR_UNPACK_FAILURE = -39,
ORTE_ERR_COMM_FAILURE = -40,
ORTE_UNPACK_INADEQUATE_SPACE = -41,
ORTE_UNPACK_READ_PAST_END_OF_BUFFER = -42,
ORTE_ERR_NOT_AVAILABLE = -43,
ORTE_ERR_GPR_DATA_CORRUPT = -44,
ORTE_ERR_PERM /* no permission */
};
#endif /* ORTE_CONSTANTS_H */

135
src/include/orte_schema.h Обычный файл
Просмотреть файл

@ -0,0 +1,135 @@
/*
* Copyright (c) 2004-2005 The Trustees of Indiana University.
* All rights reserved.
* Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
* All rights reserved.
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
* University of Stuttgart. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
#ifndef ORTE_SCHEMA_H
#define ORTE_SCHEMA_H
#include "orte_config.h"
#include "include/orte_types.h"
#include "mca/ns/ns_types.h"
/*
* ORTE_DATA_NAME macro
* This macro is provided so that users can output an intelligible name for a data
* type during debugging. It is called by passing the data type into the macro and
* outputing the result via some print variant. For example, you can call it as:
* ompi_output(0, "data type: %s", ORTE_DATA_NAME(keyval.type));
*
* THE ACTUAL ARRAY IS INSTANTIATED IN runtime/ompi_init.c
*/
#define ORTE_DATA_NAME(n) orte_data_strings[n]
extern char *orte_data_strings[];
/*
* Similar to the above, this macro and array are used to output intelligible error
* messages. It is disturbing to think that we are still outputing error numbers and
* expecting users to look them up in the "big book" to find out what they represent.
* This macro allows the user to output an actual string representation of the error.
*
* * THE ACTUAL ARRAY IS INSTANTIATED IN runtime/ompi_init.c
*/
#define ORTE_ERROR_NAME(n) orte_error_strings[-1*n]
extern char *orte_error_strings[];
/*
* ORTE SEGMENT NAMES
* There are some predefined segments that are used across the entire ORTE system.
* These defines establish those names so everyone can access them, and so they
* can be easily changed if required.
*/
#define ORTE_JOB_SEGMENT "orte-job"
#define ORTE_NODE_SEGMENT "orte-node"
#define ORTE_RESOURCE_SEGMENT "orte-resources"
/*
* ORTE pre-defined tokens for special containers
*/
#define ORTE_JOB_GLOBALS "orte-job-globals"
/*
* ORTE-wide key names for storing/retrieving data from the registry.
* Subsystem-specific keys will be defined in each=/ subsystem's xxx_types.h file.
*/
#define ORTE_CELLID_KEY "orte-cellid"
#define ORTE_JOBID_KEY "orte-jobid"
#define ORTE_VPID_KEY "orte-vpid"
#define ORTE_NODE_NAME_KEY "orte-node-name"
#define ORTE_NODE_ARCH_KEY "orte-node-arch"
#define ORTE_NODE_STATE_KEY "orte-node-state"
#define ORTE_NODE_SLOTS_KEY "orte-node-slots"
#define ORTE_NODE_SLOTS_ALLOC_KEY "orte-node-slots-alloc"
#define ORTE_NODE_SLOTS_MAX_KEY "orte-node-slots-max"
#define ORTE_NODE_ALLOC_KEY "orte-node-alloc"
#define ORTE_JOB_APP_CONTEXT_KEY "orte-job-app-context"
#define ORTE_JOB_SLOTS_KEY "orte-job-slots" /**< number of procs in job */
#define ORTE_JOB_VPID_START_KEY "orte-job-vpid-start"
#define ORTE_JOB_VPID_RANGE_KEY "orte-job-vpid-range"
#define ORTE_JOB_IOF_KEY "orte-job-iof"
#define ORTE_PROC_NAME_KEY "orte-proc-name"
#define ORTE_PROC_RANK_KEY "orte-proc-rank"
#define ORTE_PROC_PID_KEY "orte-proc-pid"
#define ORTE_PROC_STATE_KEY "orte-proc-state"
#define ORTE_PROC_APP_CONTEXT_KEY "orte-proc-app-context"
#define ORTE_PROC_EXIT_CODE_KEY "orte-proc-exit-code"
#define ORTE_PROC_NUM_ALIVE "orte-proc-num-alive"
#define ORTE_PROC_NUM_ABORTED "orte-proc-num-aborted"
#define ORTE_PROC_NUM_AT_STG1 "orte-proc-num-stg1"
#define ORTE_PROC_NUM_AT_STG2 "orte-proc-num-stg2"
#define ORTE_PROC_NUM_AT_STG3 "orte-proc-num-stg3"
#define ORTE_PROC_NUM_FINALIZED "orte-proc-num-finalized"
#define ORTE_PROC_NUM_TERMINATED "orte-proc-num-terminated"
/*
* Convenience functions for accessing ORTE data
*/
typedef int (*orte_schema_get_proc_tokens_fn_t)(
char ***tokens,
int32_t* num_tokens,
orte_process_name_t *proc);
typedef int (*orte_schema_get_node_tokens_fn_t)(
char ***tokens,
int32_t* num_tokens,
orte_cellid_t cellid,
char *nodename);
typedef int (*orte_schema_get_cell_tokens_fn_t)(
char ***tokens,
int32_t* num_tokens,
orte_cellid_t cellid);
typedef int (*orte_schema_get_job_segment_name_fn_t)(char **name, orte_jobid_t jobid);
typedef int (*orte_schema_extract_jobid_from_segment_name_fn_t)(orte_jobid_t *jobid, char *name);
/*
* Base structure for the convenience functions
*/
typedef struct {
orte_schema_get_proc_tokens_fn_t get_proc_tokens;
orte_schema_get_node_tokens_fn_t get_node_tokens;
orte_schema_get_cell_tokens_fn_t get_cell_tokens;
orte_schema_get_job_segment_name_fn_t get_job_segment_name;
orte_schema_extract_jobid_from_segment_name_fn_t extract_jobid_from_segment_name;
} orte_schema_t;
OMPI_DECLSPEC extern orte_schema_t orte_schema;
/*
* Open function to ensure orte_schema is loaded
*/
int orte_schema_open(void);
#endif

142
src/include/orte_types.h Обычный файл
Просмотреть файл

@ -0,0 +1,142 @@
/*
* Copyright (c) 2004-2005 The Trustees of Indiana University.
* All rights reserved.
* Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
* All rights reserved.
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
* University of Stuttgart. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
/** @file */
#ifndef ORTE_TYPES_H
#define ORTE_TYPES_H
#include "class/ompi_object.h"
/**
* Supported datatypes for messaging and storage operations.
*
* ANY CHANGES TO THESE DEFINITIONS MUST BE REFLECTED IN THE TEXT ARRAY
* orte_data_strings DEFINED IN src/runtime/orte_init.c.
*
*/
typedef uint8_t orte_data_type_t ;
#define ORTE_BYTE (orte_data_type_t) 1 /**< a byte of data */
#define ORTE_BOOL (orte_data_type_t) 2 /**< boolean */
#define ORTE_STRING (orte_data_type_t) 3 /**< a NULL terminated string */
#define ORTE_SIZE (orte_data_type_t) 4 /**< the generic size_t */
/* all the integer flavors */
#define ORTE_INT (orte_data_type_t) 5 /**< generic integer */
#define ORTE_INT8 (orte_data_type_t) 6 /**< an 8-bit integer */
#define ORTE_INT16 (orte_data_type_t) 7 /**< a 16-bit integer */
#define ORTE_INT32 (orte_data_type_t) 8 /**< a 32-bit integer */
#define ORTE_INT64 (orte_data_type_t) 9 /**< a 64-bit integer */
/* all the unsigned integer flavors */
#define ORTE_UINT (orte_data_type_t) 10 /**< generic unsigned integer */
#define ORTE_UINT8 (orte_data_type_t) 11 /**< an 8-bit unsigned integer */
#define ORTE_UINT16 (orte_data_type_t) 12 /**< a 16-bit unsigned integer */
#define ORTE_UINT32 (orte_data_type_t) 13 /**< a 32-bit unsigned integer */
#define ORTE_UINT64 (orte_data_type_t) 14 /**< a 64-bit unsigned integer */
/* all the floating point flavors */
#define ORTE_FLOAT (orte_data_type_t) 15 /**< single-precision float */
#define ORTE_FLOAT4 (orte_data_type_t) 16 /**< 4-byte float - usually equiv to single */
#define ORTE_DOUBLE (orte_data_type_t) 17 /**< double-precision float */
#define ORTE_FLOAT8 (orte_data_type_t) 18 /**< 8-byte float - usually equiv to double */
#define ORTE_LONG_DOUBLE (orte_data_type_t) 19 /**< long-double precision float */
#define ORTE_FLOAT12 (orte_data_type_t) 20 /**< 12-byte float - used as long-double on some systems */
#define ORTE_FLOAT16 (orte_data_type_t) 21 /**< 16-byte float - used as long-double on some systems */
/* orte-specific typedefs */
#define ORTE_NAME (orte_data_type_t) 22 /**< an ompi_process_name_t */
#define ORTE_VPID (orte_data_type_t) 23 /**< a vpid */
#define ORTE_JOBID (orte_data_type_t) 24 /**< a jobid */
#define ORTE_CELLID (orte_data_type_t) 25 /**< a cellid */
#define ORTE_NODE_STATE (orte_data_type_t) 26 /**< node status flag */
#define ORTE_PROC_STATE (orte_data_type_t) 27 /**< process/resource status */
#define ORTE_EXIT_CODE (orte_data_type_t) 28 /**< process exit code */
#define ORTE_BYTE_OBJECT (orte_data_type_t) 29 /**< byte object structure */
#define ORTE_KEYVAL (orte_data_type_t) 30 /**< registry key-value pair */
#define ORTE_NOTIFY_ACTION (orte_data_type_t) 31 /**< registry notify action */
#define ORTE_GPR_CMD (orte_data_type_t) 32 /**< registry command */
#define ORTE_GPR_NOTIFY_ID (orte_data_type_t) 33 /**< registry notify id tag */
#define ORTE_GPR_VALUE (orte_data_type_t) 34 /**< registry return value */
#define ORTE_DATA_TYPE (orte_data_type_t) 35 /**< data type */
#define ORTE_APP_CONTEXT (orte_data_type_t) 36 /**< argv and enviro arrays */
#define ORTE_APP_CONTEXT_MAP (orte_data_type_t) 37 /**< application context mapping array */
#define ORTE_GPR_ADDR_MODE (orte_data_type_t) 38 /**< Addressing mode for registry cmds */
#define ORTE_GPR_SUBSCRIPTION (orte_data_type_t) 39 /**< describes data returned by subscription */
#define ORTE_GPR_NOTIFY_DATA (orte_data_type_t) 40 /**< data returned from a subscription */
#define ORTE_NULL (orte_data_type_t) 41 /**< don't interpret data type */
typedef struct {
size_t size;
uint8_t *bytes;
} orte_byte_object_t;
/** Value for orte_app_context_map_t: the data is uninitialized (!) */
#define ORTE_APP_CONTEXT_MAP_INVALID 0
/** Value for orte_app_context_map_t: the data is a comma-delimited
string of hostnames */
#define ORTE_APP_CONTEXT_MAP_HOSTNAME 1
/** Value for orte_app_context_map_t: the data is a comma-delimited
list of architecture names */
#define ORTE_APP_CONTEXT_MAP_ARCH 2
/** Value for orte_app_context_map_t: the data is a comma-delimited
list of C, cX, N, nX mappsing */
#define ORTE_APP_CONTEXT_MAP_CN 3
/**
* Information about mapping requested by the user
*/
typedef struct {
/** Parent object */
ompi_object_t super;
/** One of the ORTE_APP_CONTEXT_MAP_* values */
uint8_t map_type;
/** String data */
char *map_data;
} orte_app_context_map_t;
OBJ_CLASS_DECLARATION(orte_app_context_map_t);
/**
* Information about a specific application to be launched in the RTE.
*/
typedef struct {
/** Parent object */
ompi_object_t super;
/** Unique index when multiple apps per job */
int32_t idx;
/** Absolute pathname of argv[0] */
char *app;
/** Number of copies of this process that are to be launched */
int32_t num_procs;
/** Length of the argv array, not including final NULL entry */
int32_t argc;
/** Standard argv-style array, including a final NULL pointer */
char **argv;
/** Length of the env array, not including the final NULL entry */
int32_t num_env;
/** Standard environ-style array, including a final NULL pointer */
char **env;
/** Current working directory for this app */
char *cwd;
/** Length of the map_data array, not including the final NULL entry */
int32_t num_map;
/** Mapping data about how this app should be laid out across CPUs
/ nodes */
orte_app_context_map_t **map_data;
} orte_app_context_t;
OBJ_CLASS_DECLARATION(orte_app_context_t);
#endif

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

@ -17,26 +17,28 @@ include $(top_srcdir)/config/Makefile.options
EXTRA_DIST = win_makefile op/base/static-components.h op/op.h
SUBDIRS = \
common \
allocator \
base \
coll \
errmgr \
gpr \
io \
iof \
llm \
mpool \
ns \
one \
oob \
pcm \
pcmclient \
pml \
ptl \
soh \
svc \
topo
base \
coll \
common \
errmgr \
gpr \
io \
iof \
gpr \
mpool \
ns \
oob \
pls \
pml \
ptl \
rml \
ras \
rds \
rmaps \
rmgr \
soh \
topo
# Source code files

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

@ -15,9 +15,10 @@
#ifndef MCA_BASE_H
#define MCA_BASE_H
#include "ompi_config.h"
#include "libltdl/ltdl.h"
#include "mpi.h"
#include "class/ompi_object.h"
/*

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

@ -13,19 +13,20 @@
*/
#include "ompi_config.h"
#include <string.h>
#include "class/ompi_hash_table.h"
#include "threads/condition.h"
#include "util/proc_info.h"
#include "util/output.h"
#include "proc/proc.h"
#include "util/proc_info.h"
#include "dps/dps.h"
#include "mca/mca.h"
#include "mca/base/base.h"
#include "mca/oob/oob.h"
#include "mca/errmgr/errmgr.h"
#include "mca/rml/rml.h"
#include "mca/gpr/gpr.h"
#include "mca/gpr/base/base.h"
#include "mca/ns/ns.h"
#include "mca/ns/base/base.h"
#include "mca/pml/pml.h"
#include "mca/base/mca_base_module_exchange.h"
#include "runtime/runtime.h"
@ -108,7 +109,7 @@ OBJ_CLASS_INSTANCE(
struct mca_base_modex_subscription_t {
ompi_list_item_t item;
mca_ns_base_jobid_t jobid;
orte_jobid_t jobid;
};
typedef struct mca_base_modex_subscription_t mca_base_modex_subscription_t;
@ -194,134 +195,187 @@ static mca_base_modex_module_t* mca_base_modex_create_module(
*/
static void mca_base_modex_registry_callback(
ompi_registry_notify_message_t* msg,
orte_gpr_notify_data_t* data,
void* cbdata)
{
ompi_list_item_t* item;
ompi_proc_t** new_procs = NULL;
ompi_proc_t **new_procs = NULL;
size_t new_proc_count = 0;
if(ompi_list_get_size(&msg->data)) {
new_procs = malloc(sizeof(ompi_proc_t*) * ompi_list_get_size(&msg->data));
}
int32_t i, j;
orte_gpr_keyval_t **keyval;
orte_gpr_value_t **value;
ompi_proc_t *proc;
char **token;
orte_process_name_t *proc_name;
mca_base_modex_t *modex;
mca_base_modex_module_t *modex_module;
mca_base_component_t component;
bool isnew = false;
int rc;
/* process the callback */
while((item = ompi_list_remove_first(&msg->data)) != NULL) {
ompi_registry_value_t* value = (ompi_registry_value_t*)item;
ompi_buffer_t buffer;
ompi_proc_t* proc;
char* component_name_version;
ompi_process_name_t proc_name;
mca_base_modex_t* modex;
mca_base_modex_module_t* modex_module;
mca_base_component_t component;
void* bptr;
int32_t bsize;
bool isnew = false;
/* transfer ownership of registry object to buffer and unpack */
ompi_buffer_init_preallocated(&buffer, value->object, value->object_size);
value->object = NULL;
value->object_size = 0;
OBJ_RELEASE(value);
value = data->values;
for (i=0; i < data->cnt; i++) {
/*
* Lookup the process.
*/
ompi_unpack(buffer, &proc_name, 1, OMPI_NAME);
proc = ompi_proc_find_and_add(&proc_name, &isnew);
if (0 < value[i]->cnt) { /* needs to be at least one value */
new_procs = malloc(sizeof(ompi_proc_t*) * value[i]->cnt);
if(NULL == proc)
continue;
if(isnew) {
new_procs[new_proc_count] = proc;
new_proc_count++;
}
/*
* Token for the value should be the process name - look it up
*/
token = value[i]->tokens;
if (ORTE_SUCCESS == orte_ns.convert_string_to_process_name(&proc_name, token[0])) {
proc = ompi_proc_find_and_add(proc_name, &isnew);
if(NULL == proc)
continue;
/*
* Lookup the modex data structure.
*/
OMPI_THREAD_LOCK(&proc->proc_lock);
if(NULL == (modex = (mca_base_modex_t*)proc->proc_modex)) {
modex = OBJ_NEW(mca_base_modex_t);
if(NULL == modex) {
ompi_output(0, "mca_base_modex_registry_callback: unable to allocate mca_base_modex_t\n");
OMPI_THREAD_UNLOCK(&proc->proc_lock);
return;
}
proc->proc_modex = &modex->super;
}
/*
* Unpack the component name and version.
*/
ompi_unpack_string(buffer, &component_name_version);
if(sscanf(component_name_version, "%[^-]-%[^-]-%d-%d",
component.mca_type_name,
component.mca_component_name,
&component.mca_component_major_version,
&component.mca_component_minor_version) != 4) {
ompi_output(0, "mca_base_modex_registry_callback: invalid component name %s\n",
component_name_version);
free(component_name_version);
OMPI_THREAD_UNLOCK(&proc->proc_lock);
continue;
}
free(component_name_version);
/*
* Lookup the corresponding modex structure
*/
if(NULL == (modex_module = mca_base_modex_create_module(modex, &component))) {
ompi_output(0, "mca_base_modex_registry_callback: mca_base_modex_create_module failed\n");
OMPI_THREAD_UNLOCK(&proc->proc_lock);
return;
}
/*
* Create a copy of the data.
*/
ompi_unpack(buffer, &bsize, 1, OMPI_INT32);
if(NULL == (bptr = malloc(bsize))) {
ompi_output(0, "mca_base_modex_registry_callback: mca_base_modex_create_module failed\n");
OMPI_THREAD_UNLOCK(&proc->proc_lock);
return;
}
ompi_unpack(buffer, bptr, bsize, OMPI_BYTE);
modex_module->module_data = bptr;
modex_module->module_data_size = bsize;
modex_module->module_data_avail = true;
ompi_condition_signal(&modex_module->module_data_cond);
/* release buffer */
ompi_buffer_free(buffer);
OMPI_THREAD_UNLOCK(&proc->proc_lock);
/* update the pml/ptls with new proc */
}
if(NULL != new_procs) {
mca_pml.pml_add_procs(new_procs, new_proc_count);
free(new_procs);
}
if(isnew) {
new_procs[new_proc_count] = proc;
new_proc_count++;
}
/*
* Lookup the modex data structure.
*/
OMPI_THREAD_LOCK(&proc->proc_lock);
if(NULL == (modex = (mca_base_modex_t*)proc->proc_modex)) {
modex = OBJ_NEW(mca_base_modex_t);
if(NULL == modex) {
ompi_output(0, "mca_base_modex_registry_callback: unable to allocate mca_base_modex_t\n");
OMPI_THREAD_UNLOCK(&proc->proc_lock);
return;
}
proc->proc_modex = &modex->super;
}
/*
* Extract the component name and version from the keyval object's key
* Could be multiple keyvals returned since there is one for each
* component type/name/version - process them all
*/
keyval = value[i]->keyvals;
for (j=0; j < value[i]->cnt; j++) {
#if 0
if(sscanf(keyval[j]->key, "modex-%[^-]-%[^-]-%d-%d",
component.mca_type_name,
component.mca_component_name,
&component.mca_component_major_version,
&component.mca_component_minor_version) != 4) {
ompi_output(0, "mca_base_modex_registry_callback: invalid component name %s\n",
keyval[j]->key);
OMPI_THREAD_UNLOCK(&proc->proc_lock);
continue;
}
#else
orte_buffer_t buffer;
char *ptr;
void* bytes = NULL;
size_t cnt;
size_t num_bytes;
if(strcmp(keyval[j]->key,"modex") != 0)
continue;
OBJ_CONSTRUCT(&buffer, orte_buffer_t);
if (ORTE_SUCCESS != (rc = orte_dps.load(&buffer,
keyval[j]->value.byteobject.bytes,
keyval[j]->value.byteobject.size))) {
ORTE_ERROR_LOG(rc);
continue;
}
cnt = 1;
if (ORTE_SUCCESS != (rc = orte_dps.unpack(&buffer, &ptr, &cnt, ORTE_STRING))) {
ORTE_ERROR_LOG(rc);
continue;
}
strcpy(component.mca_type_name,ptr);
free(ptr);
cnt = 1;
if (ORTE_SUCCESS != (rc = orte_dps.unpack(&buffer, &ptr, &cnt, ORTE_STRING))) {
ORTE_ERROR_LOG(rc);
continue;
}
strcpy(component.mca_component_name,ptr);
free(ptr);
cnt = 1;
if (ORTE_SUCCESS != (rc = orte_dps.unpack(&buffer,
&component.mca_component_major_version, &cnt, ORTE_INT32))) {
ORTE_ERROR_LOG(rc);
continue;
}
cnt = 1;
if (ORTE_SUCCESS != (rc = orte_dps.unpack(&buffer,
&component.mca_component_minor_version, &cnt, ORTE_INT32))) {
ORTE_ERROR_LOG(rc);
continue;
}
cnt = 1;
if (ORTE_SUCCESS != (rc = orte_dps.unpack(&buffer,
&num_bytes, &cnt, ORTE_UINT32))) {
ORTE_ERROR_LOG(rc);
continue;
}
if (num_bytes != 0) {
if(NULL == (bytes = malloc(num_bytes))) {
ORTE_ERROR_LOG(rc);
continue;
}
}
if (ORTE_SUCCESS != (rc = orte_dps.unpack(&buffer, bytes, &num_bytes, ORTE_BYTE))) {
ORTE_ERROR_LOG(rc);
continue;
}
#endif
/*
* Lookup the corresponding modex structure
*/
if(NULL == (modex_module = mca_base_modex_create_module(modex, &component))) {
ompi_output(0, "mca_base_modex_registry_callback: mca_base_modex_create_module failed\n");
OBJ_RELEASE(data);
OMPI_THREAD_UNLOCK(&proc->proc_lock);
return;
}
#if 0
/*
* Create a copy of the data.
*/
modex_module->module_data = (void*)keyval[j]->value.byteobject.bytes;
keyval[j]->value.byteobject.bytes = NULL; /* dereference this pointer to avoid free'ng space */
modex_module->module_data_size = keyval[j]->value.byteobject.size;
#else
modex_module->module_data = bytes;
modex_module->module_data_size = num_bytes;
#endif
modex_module->module_data_avail = true;
ompi_condition_signal(&modex_module->module_data_cond);
}
OMPI_THREAD_UNLOCK(&proc->proc_lock);
} /* convert string to process name */
} /* if value[i]->cnt > 0 */
if(NULL != new_procs) {
mca_pml.pml_add_procs(new_procs, new_proc_count);
free(new_procs);
}
}
}
/**
* Make sure we have subscribed to this segment.
*/
static int mca_base_modex_subscribe(ompi_process_name_t* name)
static int mca_base_modex_subscribe(orte_process_name_t* name)
{
ompi_registry_notify_id_t rctag;
char *segment;
orte_gpr_notify_id_t rctag;
orte_gpr_value_t trig, *trigs;
orte_gpr_subscription_t sub, *subs;
orte_jobid_t jobid;
ompi_list_item_t* item;
mca_base_modex_subscription_t* subscription;
int rc;
/* check for an existing subscription */
OMPI_LOCK(&mca_base_modex_lock);
@ -336,23 +390,100 @@ static int mca_base_modex_subscribe(ompi_process_name_t* name)
}
OMPI_UNLOCK(&mca_base_modex_lock);
/* otherwise - subscribe */
asprintf(&segment, "%s-%s", OMPI_RTE_MODEX_SEGMENT, mca_ns_base_get_jobid_string(name));
rctag = ompi_registry.subscribe(
OMPI_REGISTRY_OR,
OMPI_REGISTRY_NOTIFY_ADD_ENTRY|OMPI_REGISTRY_NOTIFY_DELETE_ENTRY|
OMPI_REGISTRY_NOTIFY_MODIFICATION|
OMPI_REGISTRY_NOTIFY_ON_STARTUP|OMPI_REGISTRY_NOTIFY_INCLUDE_STARTUP_DATA|
OMPI_REGISTRY_NOTIFY_PRE_EXISTING,
segment,
NULL,
mca_base_modex_registry_callback,
NULL);
if(rctag == OMPI_REGISTRY_NOTIFY_ID_MAX) {
/* otherwise - subscribe to get this jobid's ptl contact info */
if (ORTE_SUCCESS != (rc = orte_ns.get_jobid(&jobid, name))) {
ORTE_ERROR_LOG(rc);
return rc;
}
/* setup the subscription definition */
OBJ_CONSTRUCT(&sub, orte_gpr_subscription_t);
if (ORTE_SUCCESS != (rc = orte_schema.get_job_segment_name(&(sub.segment), jobid))) {
ORTE_ERROR_LOG(rc);
OBJ_DESTRUCT(&sub);
return rc;
}
sub.addr_mode = ORTE_GPR_KEYS_OR | ORTE_GPR_TOKENS_OR;
sub.tokens = NULL;
sub.num_tokens = 0;
sub.num_keys = 1;
sub.keys = (char**)malloc(sizeof(char*));
if (NULL == sub.keys) {
ORTE_ERROR_LOG(ORTE_ERR_OUT_OF_RESOURCE);
OBJ_DESTRUCT(&sub);
return ORTE_ERR_OUT_OF_RESOURCE;
}
sub.keys[0] = strdup("modex");
if (NULL == sub.keys[0]) {
ORTE_ERROR_LOG(ORTE_ERR_OUT_OF_RESOURCE);
OBJ_DESTRUCT(&sub);
return ORTE_ERR_OUT_OF_RESOURCE;
}
sub.cbfunc = mca_base_modex_registry_callback;
sub.user_tag = NULL;
/* setup the trigger definition */
OBJ_CONSTRUCT(&trig, orte_gpr_value_t);
trig.addr_mode = ORTE_GPR_TOKENS_XAND;
if (ORTE_SUCCESS != (rc = orte_schema.get_job_segment_name(&(trig.segment), jobid))) {
ORTE_ERROR_LOG(rc);
OBJ_DESTRUCT(&sub);
OBJ_DESTRUCT(&trig);
return rc;
}
trig.tokens = (char**)malloc(sizeof(char*));
if (NULL == trig.tokens) {
ORTE_ERROR_LOG(ORTE_ERR_OUT_OF_RESOURCE);
OBJ_DESTRUCT(&sub);
OBJ_DESTRUCT(&trig);
return ORTE_ERR_OUT_OF_RESOURCE;
}
trig.tokens[0] = strdup(ORTE_JOB_GLOBALS);
trig.num_tokens = 1;
trig.cnt = 2;
trig.keyvals = (orte_gpr_keyval_t**)malloc(2*sizeof(orte_gpr_keyval_t*));
if (NULL == trig.keyvals) {
ORTE_ERROR_LOG(ORTE_ERR_OUT_OF_RESOURCE);
OBJ_DESTRUCT(&sub);
OBJ_DESTRUCT(&trig);
return ORTE_ERR_OUT_OF_RESOURCE;
}
trig.keyvals[0] = OBJ_NEW(orte_gpr_keyval_t);
if (NULL == trig.keyvals[0]) {
ORTE_ERROR_LOG(ORTE_ERR_OUT_OF_RESOURCE);
OBJ_DESTRUCT(&sub);
OBJ_DESTRUCT(&trig);
return ORTE_ERR_OUT_OF_RESOURCE;
}
trig.keyvals[0]->key = strdup(ORTE_JOB_SLOTS_KEY);
trig.keyvals[0]->type = ORTE_NULL;
trig.keyvals[1] = OBJ_NEW(orte_gpr_keyval_t);
if (NULL == trig.keyvals[1]) {
ORTE_ERROR_LOG(ORTE_ERR_OUT_OF_RESOURCE);
OBJ_DESTRUCT(&sub);
OBJ_DESTRUCT(&trig);
return ORTE_ERR_OUT_OF_RESOURCE;
}
trig.keyvals[1]->key = strdup(ORTE_PROC_NUM_AT_STG1);
trig.keyvals[1]->type = ORTE_NULL;
/* register the subscription */
subs = &sub;
trigs = &trig;
rc = orte_gpr.subscribe(
ORTE_GPR_NOTIFY_ADD_ENTRY | ORTE_GPR_NOTIFY_VALUE_CHG |
ORTE_GPR_TRIG_CMP_LEVELS | ORTE_GPR_TRIG_ONE_SHOT,
1, &subs,
1, &trigs,
&rctag);
if(ORTE_SUCCESS != rc) {
ompi_output(0, "mca_base_modex_exchange: "
"ompi_registry.subscribe failed with return code %d\n", (int)rctag);
free(segment);
return OMPI_ERROR;
"ompi_gpr.subscribe failed with return code %d\n", rc);
OBJ_DESTRUCT(&sub);
OBJ_DESTRUCT(&trig);
return OMPI_ERROR;
}
/* add this jobid to our list of subscriptions */
@ -361,14 +492,15 @@ static int mca_base_modex_subscribe(ompi_process_name_t* name)
subscription->jobid = name->jobid;
ompi_list_append(&mca_base_modex_subscriptions, &subscription->item);
OMPI_UNLOCK(&mca_base_modex_lock);
free(segment);
OBJ_DESTRUCT(&sub);
OBJ_DESTRUCT(&trig);
return OMPI_SUCCESS;
}
/**
* Store the data associated with the specified module in the
* registry. Note that the registry is in a mode where it caches
* gpr. Note that the gpr is in a mode where it caches
* individual puts during startup and sends them as an aggregate
* command.
*/
@ -378,40 +510,97 @@ int mca_base_modex_send(
const void *data,
size_t size)
{
char *segment;
char *component_name_version;
char *keys[3];
ompi_buffer_t buffer;
void* bptr;
int bsize;
char *jobidstring;
orte_gpr_value_t *value;
int rc;
orte_buffer_t buffer;
char* ptr;
asprintf(&component_name_version, "%s-%s-%d-%d",
value = OBJ_NEW(orte_gpr_value_t);
if (NULL == value) {
ORTE_ERROR_LOG(ORTE_ERR_OUT_OF_RESOURCE);
return ORTE_ERR_OUT_OF_RESOURCE;
}
if (ORTE_SUCCESS != (rc = orte_ns.get_jobid_string(&jobidstring, orte_process_info.my_name))) {
ORTE_ERROR_LOG(rc);
return rc;
}
if (0 > asprintf(&(value->segment), "%s-%s", ORTE_JOB_SEGMENT, jobidstring)) {
ORTE_ERROR_LOG(ORTE_ERR_OUT_OF_RESOURCE);
return ORTE_ERR_OUT_OF_RESOURCE;
}
value->tokens = (char**)malloc(sizeof(char*));
if (NULL == value->tokens) {
ORTE_ERROR_LOG(ORTE_ERR_OUT_OF_RESOURCE);
return ORTE_ERR_OUT_OF_RESOURCE;
}
value->addr_mode = ORTE_GPR_TOKENS_AND | ORTE_GPR_OVERWRITE;
if (ORTE_SUCCESS != (rc = orte_ns.get_proc_name_string(&(value->tokens[0]), orte_process_info.my_name))) {
ORTE_ERROR_LOG(rc);
return rc;
}
value->num_tokens = 1;
value->cnt = 1;
value->keyvals = (orte_gpr_keyval_t**)malloc(sizeof(orte_gpr_keyval_t*));
value->keyvals[0] = OBJ_NEW(orte_gpr_keyval_t);
if (NULL == value->keyvals[0]) {
ORTE_ERROR_LOG(ORTE_ERR_OUT_OF_RESOURCE);
return ORTE_ERR_OUT_OF_RESOURCE;
}
(value->keyvals[0])->type = ORTE_BYTE_OBJECT;
#if 0
(value->keyvals[0])->value.byteobject.size = size;
(value->keyvals[0])->value.byteobject.bytes = (void *)malloc(size);
if(NULL == (value->keyvals[0])->value.byteobject.bytes) {
ORTE_ERROR_LOG(ORTE_ERR_OUT_OF_RESOURCE);
return OMPI_ERR_OUT_OF_RESOURCE;
}
memcpy((value->keyvals[0])->value.byteobject.bytes, data, size);
asprintf(&((value->keyvals[0])->key), "modex-%s-%s-%d-%d",
source_component->mca_type_name,
source_component->mca_component_name,
source_component->mca_component_major_version,
source_component->mca_component_minor_version);
#else
OBJ_CONSTRUCT(&buffer, orte_buffer_t);
ptr = source_component->mca_type_name;
if (ORTE_SUCCESS != (rc = orte_dps.pack(&buffer, &ptr, 1, ORTE_STRING))) {
goto cleanup;
}
ptr = source_component->mca_component_name;
if (ORTE_SUCCESS != (rc = orte_dps.pack(&buffer, &ptr, 1, ORTE_STRING))) {
goto cleanup;
}
if (ORTE_SUCCESS != (rc = orte_dps.pack(&buffer, &source_component->mca_component_major_version, 1, ORTE_INT32))) {
goto cleanup;
}
if (ORTE_SUCCESS != (rc = orte_dps.pack(&buffer, &source_component->mca_component_minor_version, 1, ORTE_INT32))) {
goto cleanup;
}
if (ORTE_SUCCESS != (rc = orte_dps.pack(&buffer, &size, 1, ORTE_UINT32))) {
goto cleanup;
}
if (ORTE_SUCCESS != (rc = orte_dps.pack(&buffer, (void*)data, size, ORTE_BYTE))) {
goto cleanup;
}
if (ORTE_SUCCESS != (rc = orte_dps.unload(&buffer,
(void**)&(value->keyvals[0])->value.byteobject.bytes,
(size_t*)&(value->keyvals[0])->value.byteobject.size))) {
goto cleanup;
}
OBJ_DESTRUCT(&buffer);
value->keyvals[0]->key = strdup("modex");
#endif
keys[0] = ompi_name_server.get_proc_name_string(ompi_rte_get_self());
keys[1] = component_name_version;
keys[2] = NULL;
rc = orte_gpr.put(1, &value);
ompi_buffer_init(&buffer, 0);
ompi_pack(buffer, ompi_rte_get_self(), 1, OMPI_NAME);
ompi_pack_string(buffer, component_name_version);
ompi_pack(buffer, &size, 1, OMPI_INT32);
ompi_pack(buffer, (void*)data, size, OMPI_BYTE);
ompi_buffer_get(buffer, &bptr, &bsize);
asprintf(&segment, "%s-%s", OMPI_RTE_MODEX_SEGMENT, mca_ns_base_get_jobid_string(&mca_oob_name_self));
rc = ompi_registry.put(
OMPI_REGISTRY_OVERWRITE,
segment,
keys,
(ompi_registry_object_t)bptr,
(ompi_registry_object_size_t)bsize);
free(segment);
free(component_name_version);
cleanup:
OBJ_RELEASE(value);
return rc;
}
@ -481,7 +670,7 @@ int mca_base_modex_recv(
int mca_base_modex_exchange(void)
{
return mca_base_modex_subscribe(ompi_rte_get_self());
return mca_base_modex_subscribe(orte_process_info.my_name);
}

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

@ -18,6 +18,7 @@
#include <string.h>
#include <stdlib.h>
#include "mpi.h"
#include "include/constants.h"
#include "class/ompi_value_array.h"
#include "class/ompi_hash_table.h"
@ -158,6 +159,7 @@ int mca_base_param_register_int(const char *type_name,
int default_value)
{
mca_base_param_storage_t storage;
mca_base_param_find(type_name,component_name,param_name);
storage.intval = default_value;
return param_register(type_name, component_name, param_name, mca_param_name,
@ -175,6 +177,8 @@ int mca_base_param_register_string(const char *type_name,
const char *default_value)
{
mca_base_param_storage_t storage;
mca_base_param_find(type_name,component_name,param_name);
if (NULL != default_value) {
storage.stringval = (char *) default_value;
} else {
@ -255,7 +259,8 @@ int mca_base_param_set_int(int index, int value)
mca_base_param_unset(index);
storage.intval = value;
return param_set_override(index, &storage, MCA_BASE_PARAM_TYPE_INT);
param_set_override(index, &storage, MCA_BASE_PARAM_TYPE_INT);
return OMPI_SUCCESS;
}
@ -298,8 +303,9 @@ int mca_base_param_set_string(int index, char *value)
mca_base_param_storage_t storage;
mca_base_param_unset(index);
storage.stringval = value;
return param_set_override(index, &storage, MCA_BASE_PARAM_TYPE_STRING);
storage.stringval = strdup(value);
param_set_override(index, &storage, MCA_BASE_PARAM_TYPE_STRING);
return OMPI_SUCCESS;
}
@ -340,6 +346,57 @@ int mca_base_param_unset(int index)
}
/*
* Make a string suitable for the environment, setting an MCA param
*/
char *mca_base_param_environ_variable(const char *type,
const char *component,
const char *param)
{
size_t len;
int id;
char *ret = NULL, *name;
mca_base_param_t *array;
if (NULL == type) {
return NULL;
}
id = mca_base_param_find(type, component, param);
if (OMPI_ERROR != id) {
array = OMPI_VALUE_ARRAY_GET_BASE(&mca_base_params, mca_base_param_t);
ret = strdup(array[id].mbp_env_var_name);
} else {
len = strlen(mca_prefix) + strlen(type) + 16;
if (NULL != component) {
len += strlen(component);
}
if (NULL != param) {
len += strlen(param);
}
name = malloc(len);
if (NULL == name) {
return NULL;
}
name[0] = '\0';
snprintf(name, len, "%s%s", mca_prefix, type);
if (NULL != component) {
strcat(name, "_");
strcat(name, component);
}
if (NULL != param) {
strcat(name, "_");
strcat(name, param);
}
ret = name;
}
/* All done */
return ret;
}
/*
* Find the index for an MCA parameter based on its names.
*/
@ -475,8 +532,6 @@ int mca_base_param_build_env(char ***env, int *num_env, bool internal)
/* Iterate through all the registered parameters */
*env = NULL;
*num_env = 0;
len = ompi_value_array_get_size(&mca_base_params);
array = OMPI_VALUE_ARRAY_GET_BASE(&mca_base_params, mca_base_param_t);
for (i = 0; i < len; ++i) {
@ -761,9 +816,10 @@ static int param_register(const char *type_name, const char *component_name,
if (NULL != array[i].mbp_file_value.stringval) {
free(array[i].mbp_file_value.stringval);
}
if (NULL != array[i].mbp_override_value.stringval) {
free(array[i].mbp_override_value.stringval);
}
/* Do *not* free the override value on the found entry here
-- we will down below, but only *if* the new entry
provides a new override value */
}
/* Now put in the new value */
@ -781,19 +837,26 @@ static int param_register(const char *type_name, const char *component_name,
} else {
array[i].mbp_file_value.stringval = NULL;
}
if (NULL != param.mbp_override_value.stringval) {
array[i].mbp_override_value.stringval =
strdup(param.mbp_override_value.stringval);
} else {
array[i].mbp_override_value.stringval = NULL;
/* Do we need to replace the override value? */
if (NULL != override_value &&
NULL != param.mbp_override_value.stringval) {
if (NULL != array[i].mbp_override_value.stringval) {
free(array[i].mbp_override_value.stringval);
}
array[i].mbp_override_value.stringval =
strdup(param.mbp_override_value.stringval);
}
} else {
array[i].mbp_default_value.intval =
param.mbp_default_value.intval;
array[i].mbp_file_value.intval =
param.mbp_file_value.intval;
array[i].mbp_override_value.intval =
param.mbp_override_value.intval;
if (NULL != override_value) {
array[i].mbp_override_value.intval =
param.mbp_override_value.intval;
}
}
/* Just in case we changed type */

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

@ -54,7 +54,7 @@
#ifndef OMPI_MCA_BASE_PARAM_H
#define OMPI_MCA_BASE_PARAM_H
#include "mpi.h"
#include "ompi_config.h"
#include "class/ompi_value_array.h"
#include "class/ompi_list.h"
@ -379,6 +379,25 @@ extern "C" {
*/
OMPI_DECLSPEC int mca_base_param_unset(int index);
/**
* Get the string name corresponding to the MCA parameter
* value in the environment.
*
* @param type_name Name of the type containing the parameter.
* @param component_name Name of the component containing the parameter.
* @param param_name Name of the parameter.
*
* @retval string A string suitable for setenv() or appending to
* an environ-style string array.
* @retval NULL Upon failure.
*
* The string that is returned is owned by the caller; if
* appropriate, it must be eventually freed by the caller.
*/
OMPI_DECLSPEC char *mca_base_param_environ_variable(const char *type,
const char *component,
const char *param);
/**
* Find the index for an MCA parameter based on its names.
*

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

@ -28,7 +28,7 @@
#ifndef OMPI_MCA_BASE_PARAM_INTERNAL_H
#define OMPI_MCA_BASE_PARAM_INTERNAL_H
#include "mpi.h"
#include "ompi_config.h"
#include "class/ompi_object.h"
#include "class/ompi_list.h"

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

@ -33,7 +33,6 @@
#include "util/output.h"
#include "util/sys_info.h"
#include "util/proc_info.h"
#include "mca/pcm/pcm.h"
#include "common_sm_mmap.h"

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

@ -32,7 +32,7 @@ libmca_errmgr_base_la_SOURCES = \
errmgr_base_close.c \
errmgr_base_select.c \
errmgr_base_open.c \
errmgr_base_log.c
errmgr_base_fns.c
# Conditionally install the header files

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

@ -14,18 +14,19 @@
/** @file:
*/
#ifndef MCA_ERRMGR_BASE_H
#define MCA_ERRMGR_BASE_H
#ifndef ORTE_MCA_ERRMGR_BASE_H
#define ORTE_MCA_ERRMGR_BASE_H
/*
* includes
*/
#include "ompi_config.h"
#include "include/constants.h"
#include "orte_config.h"
#include "include/orte_constants.h"
#include "class/ompi_list.h"
#include "mca/mca.h"
#include "mca/ns/ns_types.h"
#include "mca/errmgr/errmgr.h"
@ -42,25 +43,36 @@ extern "C" {
/*
* function definitions
*/
OMPI_DECLSPEC int mca_errmgr_base_open(void);
OMPI_DECLSPEC int mca_errmgr_base_select(bool *allow_multi_user_threads,
OMPI_DECLSPEC int orte_errmgr_base_open(void);
OMPI_DECLSPEC int orte_errmgr_base_select(bool *allow_multi_user_threads,
bool *have_hidden_threads);
OMPI_DECLSPEC int mca_errmgr_base_close(void);
OMPI_DECLSPEC int orte_errmgr_base_close(void);
/*
* Base functions that are common to all implementations - can be overridden
*/
OMPI_DECLSPEC void mca_errmgr_base_log(char *msg, char *filename, int line);
OMPI_DECLSPEC void orte_errmgr_base_log(int error_code, char *filename, int line);
OMPI_DECLSPEC void orte_errmgr_base_proc_aborted(orte_process_name_t *proc);
OMPI_DECLSPEC void orte_errmgr_base_incomplete_start(orte_jobid_t job);
OMPI_DECLSPEC void orte_errmgr_base_error_detected(int error_code);
OMPI_DECLSPEC int orte_errmgr_base_register_job(orte_jobid_t job);
OMPI_DECLSPEC void orte_errmgr_base_abort(void);
/*
* globals that might be needed
*/
OMPI_DECLSPEC extern int mca_errmgr_base_output;
OMPI_DECLSPEC extern bool mca_errmgr_base_selected;
OMPI_DECLSPEC extern ompi_list_t mca_errmgr_base_components_available;
OMPI_DECLSPEC extern mca_errmgr_base_component_t mca_errmgr_base_selected_component;
OMPI_DECLSPEC extern int orte_errmgr_base_output;
OMPI_DECLSPEC extern bool orte_errmgr_base_selected;
OMPI_DECLSPEC extern bool orte_errmgr_initialized;
OMPI_DECLSPEC extern ompi_list_t orte_errmgr_base_components_available;
OMPI_DECLSPEC extern mca_errmgr_base_component_t orte_errmgr_base_selected_component;
/*
* external API functions will be documented in the mca/errmgr/errmgr.h file

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

@ -12,31 +12,32 @@
* $HEADER$
*/
#include "ompi_config.h"
#include "orte_config.h"
#include <stdio.h>
#include "include/constants.h"
#include "include/orte_constants.h"
#include "mca/mca.h"
#include "mca/base/base.h"
#include "mca/errmgr/base/base.h"
int mca_errmgr_base_close(void)
int orte_errmgr_base_close(void)
{
/* If we have a selected component and module, then finalize it */
if (mca_errmgr_base_selected) {
mca_errmgr_base_selected_component.errmgr_finalize();
if (orte_errmgr_base_selected) {
orte_errmgr_base_selected_component.errmgr_finalize();
}
/* Close all remaining available components (may be one if this is a
OMPI RTE program, or [possibly] multiple if this is mca_info) */
OMPI RTE program, or [possibly] multiple if this is ompi_info) */
mca_base_components_close(mca_errmgr_base_output,
&mca_errmgr_base_components_available, NULL);
mca_base_components_close(orte_errmgr_base_output,
&orte_errmgr_base_components_available, NULL);
orte_errmgr_initialized = false;
/* All done */
return OMPI_SUCCESS;
return ORTE_SUCCESS;
}

84
src/mca/errmgr/base/errmgr_base_fns.c Обычный файл
Просмотреть файл

@ -0,0 +1,84 @@
/*
* Copyright (c) 2004-2005 The Trustees of Indiana University.
* All rights reserved.
* Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
* All rights reserved.
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
* University of Stuttgart. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
#include "orte_config.h"
#include <unistd.h>
#include <stdlib.h>
#include "include/orte_constants.h"
#include "include/orte_schema.h"
#include "runtime/runtime.h"
#include "runtime/orte_wait.h"
#include "util/output.h"
#include "util/proc_info.h"
#include "mca/ns/ns.h"
#include "mca/rmgr/rmgr.h"
#include "mca/errmgr/base/base.h"
void orte_errmgr_base_log(int error_code, char *filename, int line)
{
if (NULL == orte_process_info.my_name) {
ompi_output(0, "[NO-NAME] ORTE_ERROR_LOG: %s in file %s at line %d",
ORTE_ERROR_NAME(error_code), filename, line);
} else {
ompi_output(0, "[%d,%d,%d] ORTE_ERROR_LOG: %s in file %s at line %d",
ORTE_NAME_ARGS(orte_process_info.my_name),
ORTE_ERROR_NAME(error_code), filename, line);
}
/* orte_errmgr_base_error_detected(error_code); */
}
void orte_errmgr_base_proc_aborted(orte_process_name_t *proc)
{
orte_jobid_t job;
int rc;
if (ORTE_SUCCESS != (rc = orte_ns.get_jobid(&job, proc))) {
ORTE_ERROR_LOG(rc);
return;
}
orte_rmgr.terminate_job(job);
}
void orte_errmgr_base_incomplete_start(orte_jobid_t job)
{
orte_rmgr.terminate_job(job);
}
void orte_errmgr_base_error_detected(int error_code)
{
}
void orte_errmgr_base_abort()
{
/* kill and reap all children */
orte_wait_kill(9);
/* abnormal exit */
_exit(-1);
}
int orte_errmgr_base_register_job(orte_jobid_t job)
{
/* register subscription for process_status values
* changing to abnormal termination codes
*/
return ORTE_SUCCESS;
}

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

@ -13,8 +13,8 @@
*/
#include "ompi_config.h"
#include "include/constants.h"
#include "orte_config.h"
#include "include/orte_constants.h"
#include "mca/mca.h"
#include "mca/base/base.h"
@ -39,37 +39,48 @@
/*
* Global variables
*/
int mca_errmgr_base_output = -1;
mca_errmgr_base_module_t orte_errmgr = {
mca_errmgr_base_log
int orte_errmgr_base_output = -1;
orte_errmgr_base_module_t orte_errmgr = {
orte_errmgr_base_log,
orte_errmgr_base_proc_aborted,
orte_errmgr_base_incomplete_start,
orte_errmgr_base_error_detected,
orte_errmgr_base_register_job,
orte_errmgr_base_abort
};
bool mca_errmgr_base_selected = false;
ompi_list_t mca_errmgr_base_components_available;
mca_errmgr_base_component_t mca_errmgr_base_selected_component;
bool orte_errmgr_base_selected = false;
ompi_list_t orte_errmgr_base_components_available;
mca_errmgr_base_component_t orte_errmgr_base_selected_component;
bool orte_errmgr_initialized = false;
/**
* Function for finding and opening either all MCA components, or the one
* that was specifically requested via a MCA parameter.
*/
int mca_errmgr_base_open(void)
int orte_errmgr_base_open(void)
{
/* Open up all available components */
if (OMPI_SUCCESS !=
mca_base_components_open("mca_errmgr", 0, mca_errmgr_base_static_components,
&mca_errmgr_base_components_available)) {
return OMPI_ERROR;
}
/* setup output for debug messages */
if (!ompi_output_init) { /* can't open output */
return OMPI_ERROR;
}
mca_errmgr_base_output = ompi_output_open(NULL);
if (!orte_errmgr_initialized) { /* ensure we only do this once */
/* Open up all available components */
if (ORTE_SUCCESS !=
mca_base_components_open("errmgr", 0, mca_errmgr_base_static_components,
&orte_errmgr_base_components_available)) {
return ORTE_ERROR;
}
/* setup output for debug messages */
if (!ompi_output_init) { /* can't open output */
return ORTE_ERROR;
}
if (0 > orte_errmgr_base_output)
orte_errmgr_base_output = ompi_output_open(NULL);
orte_errmgr_initialized = true;
}
/* All done */
return OMPI_SUCCESS;
return ORTE_SUCCESS;
}

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

@ -13,7 +13,7 @@
*/
#include "ompi_config.h"
#include "orte_config.h"
#include "mca/mca.h"
#include "mca/base/base.h"
@ -25,20 +25,20 @@
* Function for selecting one component from all those that are
* available.
*/
int mca_errmgr_base_select(bool *allow_multi_user_threads,
int orte_errmgr_base_select(bool *allow_multi_user_threads,
bool *have_hidden_threads)
{
ompi_list_item_t *item;
mca_base_component_list_item_t *cli;
mca_errmgr_base_component_t *component, *best_component = NULL;
mca_errmgr_base_module_t *module, *best_module = NULL;
orte_errmgr_base_module_t *module, *best_module = NULL;
bool multi, hidden;
int priority, best_priority = -1;
/* Iterate through all the available components */
for (item = ompi_list_get_first(&mca_errmgr_base_components_available);
item != ompi_list_get_end(&mca_errmgr_base_components_available);
for (item = ompi_list_get_first(&orte_errmgr_base_components_available);
item != ompi_list_get_end(&orte_errmgr_base_components_available);
item = ompi_list_get_next(item)) {
cli = (mca_base_component_list_item_t *) item;
component = (mca_errmgr_base_component_t *) cli->cli_component;
@ -85,17 +85,17 @@ int mca_errmgr_base_select(bool *allow_multi_user_threads,
/* If we didn't find one to select, that's okay - stick with default */
if (NULL == best_component) {
return OMPI_SUCCESS;
return ORTE_SUCCESS;
}
/* We have happiness -- save the component and module for later
usage */
orte_errmgr = *best_module;
mca_errmgr_base_selected_component = *best_component;
mca_errmgr_base_selected = true;
orte_errmgr_base_selected_component = *best_component;
orte_errmgr_base_selected = true;
/* all done */
return OMPI_SUCCESS;
return ORTE_SUCCESS;
}

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

@ -17,16 +17,24 @@
*
*/
#ifndef OMPI_MCA_ERRMGR_H
#define OMPI_MCA_ERRMGR_H
#ifndef ORTE_MCA_ERRMGR_H
#define ORTE_MCA_ERRMGR_H
/*
* includes
*/
#include "ompi_config.h"
#include "include/constants.h"
#include "orte_config.h"
#include "include/orte_constants.h"
#include "include/orte_schema.h"
#include "mca/mca.h"
/*
* Macro definitions
*/
#define ORTE_ERROR_LOG(n) \
orte_errmgr.log((n), __FILE__, __LINE__)
/*
@ -35,34 +43,93 @@
/**
* Log an error
* Log an error that occurred in the runtime environment.
* Log an error that occurred in the runtime environment, and call the "error_detected"
* interface to see if further action is required.
*
* @code
* ompi_errmgr.log("this is an error", __FILE__, __LINE__);
* orte_errmgr.log("this is an error", __FILE__, __LINE__);
* @endcode
*/
typedef void (*mca_errmgr_base_module_log_fn_t)(char *msg, char *filename, int line);
typedef void (*orte_errmgr_base_module_log_fn_t)(int error_code, char *filename, int line);
/**
* Alert - process aborted
* This function is called when a remote process aborts during execution. Note that local
* process errors should always be reported through the error_detected interface and
* NOT here. The function is called when a message is received from the universe daemon
* indicating that another process in the job failed. For now, this function will
* simply cause the local process to gracefully finalize and terminate.
*/
typedef void (*orte_errmgr_base_module_proc_aborted_fn_t)(orte_process_name_t *proc);
/**
* Alert - incomplete start of a job
* This function is called when an attempted launch of a job encounters failure of
* one or more processes to start. The function decides on the strategy for dealing
* with this "incomplete start" situation - for now, it simply orders the resource
* manager to terminate the entire job.
*
* This function is only called by the respective process launcher, which is responsible
* for detecting incomplete starts.
*/
typedef void (*orte_errmgr_base_module_incomplete_start_fn_t)(orte_jobid_t job);
/**
* Alert - internal error detected
* This function is called when an internal error is detected within the local process.
* It decides what to do about the error - for now, it simply orders the local process
* to finalize and terminate.
*/
typedef void (*orte_errmgr_base_module_error_detected_fn_t)(int error_code);
/*
* Register a job with the error manager
* When a job is launched, this function is called so the error manager can register
* subscriptions on the job segment so that the error manager will be notified when
* problems occur - i.e., when process status entries change to abnormal termination
* values. Process status entries are changed by the appropriate state-of-health monitor
* and/or the process launcher, depending upon the stage at which the problem occurs.
*
* Monitoring of the job begins once the job has reached the "executing" stage. Prior
* to that time, failure of processes to start are the responsibility of the respective
* process launcher - which is expected to call the error manager via the "incomplete
* start" interface to report any problems prior to the job beginning "execution".
*/
typedef int (*orte_errmgr_base_module_register_job_fn_t)(orte_jobid_t job);
/**
* Alert - self aborting
* This function is called when a process is aborting. The routine will kill
* any child processes and terminate the calling process.
*/
typedef void (*orte_errmgr_base_module_abort_fn_t)(void);
/*
* Ver 1.0.0
*/
struct mca_errmgr_base_module_1_0_0_t {
mca_errmgr_base_module_log_fn_t log;
struct orte_errmgr_base_module_1_0_0_t {
orte_errmgr_base_module_log_fn_t log;
orte_errmgr_base_module_proc_aborted_fn_t proc_aborted;
orte_errmgr_base_module_incomplete_start_fn_t incomplete_start;
orte_errmgr_base_module_error_detected_fn_t error_detected;
orte_errmgr_base_module_register_job_fn_t register_job;
orte_errmgr_base_module_abort_fn_t abort;
};
typedef struct mca_errmgr_base_module_1_0_0_t mca_errmgr_base_module_1_0_0_t;
typedef mca_errmgr_base_module_1_0_0_t mca_errmgr_base_module_t;
typedef struct orte_errmgr_base_module_1_0_0_t orte_errmgr_base_module_1_0_0_t;
typedef orte_errmgr_base_module_1_0_0_t orte_errmgr_base_module_t;
/*
* ERRMGR Component
*/
typedef mca_errmgr_base_module_t* (*mca_errmgr_base_component_init_fn_t)(
typedef orte_errmgr_base_module_t* (*orte_errmgr_base_component_init_fn_t)(
bool *allow_multi_user_threads,
bool *have_hidden_threads,
int *priority);
typedef int (*mca_errmgr_base_component_finalize_fn_t)(void);
typedef int (*orte_errmgr_base_component_finalize_fn_t)(void);
/*
* the standard component data structure
@ -72,8 +139,8 @@ struct mca_errmgr_base_component_1_0_0_t {
mca_base_component_t errmgr_version;
mca_base_component_data_1_0_0_t errmgr_data;
mca_errmgr_base_component_init_fn_t errmgr_init;
mca_errmgr_base_component_finalize_fn_t errmgr_finalize;
orte_errmgr_base_component_init_fn_t errmgr_init;
orte_errmgr_base_component_finalize_fn_t errmgr_finalize;
};
typedef struct mca_errmgr_base_component_1_0_0_t mca_errmgr_base_component_1_0_0_t;
typedef mca_errmgr_base_component_1_0_0_t mca_errmgr_base_component_t;
@ -83,14 +150,14 @@ typedef mca_errmgr_base_component_1_0_0_t mca_errmgr_base_component_t;
/*
* Macro for use in components that are of type errmgr v1.0.0
*/
#define OMPI_MCA_ERRMGR_BASE_VERSION_1_0_0 \
/* mca v1.0 is chained to MCA v1.0 */ \
#define ORTE_ERRMGR_BASE_VERSION_1_0_0 \
/* ns v1.0 is chained to MCA v1.0 */ \
MCA_BASE_VERSION_1_0_0, \
/* errmgr v1.0 */ \
"errmgr", 1, 0, 0
/* Global structure for accessing error manager functions
*/
OMPI_DECLSPEC extern mca_errmgr_base_module_t orte_errmgr; /* holds selected module's function pointers */
OMPI_DECLSPEC extern orte_errmgr_base_module_t orte_errmgr; /* holds selected module's function pointers */
#endif

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

@ -14,6 +14,8 @@
include $(top_srcdir)/config/Makefile.options
SUBDIRS = pack_api_cmd unpack_api_response
noinst_LTLIBRARIES = libmca_gpr_base.la
# For VPATH builds, have to specify where static-modules.h will be found
@ -29,23 +31,6 @@ libmca_gpr_base_la_SOURCES = \
$(headers) \
gpr_base_open.c \
gpr_base_close.c \
gpr_base_pack_cleanup.c \
gpr_base_pack_del_index.c \
gpr_base_unpack_del_index.c \
gpr_base_pack_dump.c \
gpr_base_print_dump.c \
gpr_base_pack_mode_ops.c \
gpr_base_unpack_mode_ops.c \
gpr_base_pack_put_get.c \
gpr_base_unpack_put_get.c \
gpr_base_pack_startup_msg.c \
gpr_base_unpack_startup_msg.c \
gpr_base_pack_subscribe.c \
gpr_base_unpack_subscribe.c \
gpr_base_pack_synchro.c \
gpr_base_unpack_synchro.c \
gpr_base_pack_test_internals.c \
gpr_base_unpack_test_internals.c \
gpr_base_select.c
# Conditionally install the header files

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

@ -37,7 +37,7 @@
* the program. However, for speed purposes, tokens are translated into
* integer keys prior to storing an object. A table of token-key pairs
* is independently maintained for each registry segment. Users can obtain
* an index of tokens within a dictionary by requesting it through the ompi_registry_index()
* an index of tokens within a dictionary by requesting it through the orte_registry_index()
* function.
*
* The registry also provides a subscription capability whereby a caller
@ -49,46 +49,27 @@
*
*/
#ifndef MCA_GPR_BASE_H_
#define MCA_GRP_BASE_H_
#ifndef ORTE_GPR_BASE_H_
#define ORTE_GRP_BASE_H_
/*
* includes
*/
#include "ompi_config.h"
#include "orte_config.h"
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#ifdef HAVE_LIBGEN_H
#include <libgen.h>
#endif
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#include "include/constants.h"
#include "include/orte_constants.h"
#include "include/orte_types.h"
#include "threads/mutex.h"
#include "threads/condition.h"
#include "runtime/runtime.h"
#include "util/output.h"
#include "util/proc_info.h"
#include "util/sys_info.h"
#include "util/bufpack.h"
#include "class/ompi_list.h"
#include "dps/dps_types.h"
#include "mca/mca.h"
#include "mca/base/base.h"
#include "mca/base/mca_base_param.h"
#include "mca/oob/base/base.h"
#include "mca/rml/rml_types.h"
#include "mca/gpr/gpr.h"
@ -98,96 +79,85 @@
#if defined(c_plusplus) || defined(__cplusplus)
extern "C" {
#endif
OMPI_DECLSPEC int mca_gpr_base_open(void);
OMPI_DECLSPEC int mca_gpr_base_select(bool *allow_multi_user_threads,
bool *have_hidden_threads);
OMPI_DECLSPEC int mca_gpr_base_close(void);
/*
* packing type definitions for GPR-specific types
*/
/* CAUTION - any changes here must also change corresponding
* typedefs in gpr_types.h
*/
#define ORTE_GPR_PACK_CMD ORTE_GPR_CMD
#define ORTE_GPR_PACK_ACTION ORTE_NOTIFY_ACTION
#define ORTE_GPR_PACK_ADDR_MODE ORTE_UINT16
#define ORTE_GPR_PACK_SYNCHRO_MODE ORTE_SYNCHRO_MODE
#define ORTE_GPR_PACK_NOTIFY_ID ORTE_UINT32
OMPI_DECLSPEC int orte_gpr_base_open(void);
OMPI_DECLSPEC int orte_gpr_base_select(void);
OMPI_DECLSPEC int orte_gpr_base_close(void);
/* general usage functions */
OMPI_DECLSPEC int mca_gpr_base_pack_delete_segment(ompi_buffer_t cmd, bool silent, char *segment);
OMPI_DECLSPEC int mca_gpr_base_unpack_delete_segment(ompi_buffer_t buffer);
OMPI_DECLSPEC int orte_gpr_base_pack_delete_segment(orte_buffer_t *cmd,
char *segment);
OMPI_DECLSPEC int orte_gpr_base_unpack_delete_segment(orte_buffer_t *buffer, int *ret);
OMPI_DECLSPEC int mca_gpr_base_pack_delete_object(ompi_buffer_t buffer, bool silent,
ompi_registry_mode_t mode,
char *segment, char **tokens);
OMPI_DECLSPEC int mca_gpr_base_unpack_delete_object(ompi_buffer_t buffer);
OMPI_DECLSPEC int orte_gpr_base_pack_delete_entries(orte_buffer_t *buffer,
orte_gpr_addr_mode_t mode,
char *segment, char **tokens, char **keys);
OMPI_DECLSPEC int orte_gpr_base_unpack_delete_entries(orte_buffer_t *buffer, int *ret);
OMPI_DECLSPEC int mca_gpr_base_pack_index(ompi_buffer_t cmd, char *segment);
OMPI_DECLSPEC int mca_gpr_base_unpack_index(ompi_buffer_t cmd, ompi_list_t *return_list);
OMPI_DECLSPEC int orte_gpr_base_pack_index(orte_buffer_t *cmd, char *segment);
OMPI_DECLSPEC int orte_gpr_base_unpack_index(orte_buffer_t *cmd, int *ret, size_t *cnt,
char **index);
OMPI_DECLSPEC int mca_gpr_base_pack_cleanup(ompi_buffer_t cmd, mca_ns_base_jobid_t jobid);
OMPI_DECLSPEC int orte_gpr_base_pack_subscribe(orte_buffer_t *cmd,
orte_gpr_notify_action_t action, int num_subs,
orte_gpr_subscription_t **subscriptions,
int num_trigs, orte_gpr_value_t **trig);
OMPI_DECLSPEC int orte_gpr_base_unpack_subscribe(orte_buffer_t *buffer, int *ret,
orte_gpr_notify_id_t *remote_idtag);
OMPI_DECLSPEC int mca_gpr_base_pack_synchro(ompi_buffer_t cmd,
ompi_registry_synchro_mode_t synchro_mode,
ompi_registry_mode_t mode,
char *segment, char **tokens, int trigger);
OMPI_DECLSPEC int mca_gpr_base_unpack_synchro(ompi_buffer_t buffer,
ompi_registry_notify_id_t *remote_idtag);
OMPI_DECLSPEC int orte_gpr_base_pack_unsubscribe(orte_buffer_t *cmd,
orte_gpr_notify_id_t remote_idtag);
OMPI_DECLSPEC int orte_gpr_base_unpack_unsubscribe(orte_buffer_t *buffer, int *ret);
OMPI_DECLSPEC int mca_gpr_base_pack_cancel_synchro(ompi_buffer_t cmd,
bool silent,
ompi_registry_notify_id_t remote_idtag);
OMPI_DECLSPEC int mca_gpr_base_unpack_cancel_synchro(ompi_buffer_t buffer);
OMPI_DECLSPEC int orte_gpr_base_pack_put(orte_buffer_t *cmd,
int cnt, orte_gpr_value_t **values);
OMPI_DECLSPEC int orte_gpr_base_unpack_put(orte_buffer_t *buffer, int *ret);
OMPI_DECLSPEC int mca_gpr_base_pack_subscribe(ompi_buffer_t cmd,
ompi_registry_mode_t mode,
ompi_registry_notify_action_t action,
char *segment, char **tokens);
OMPI_DECLSPEC int mca_gpr_base_unpack_subscribe(ompi_buffer_t buffer,
ompi_registry_notify_id_t *remote_idtag);
OMPI_DECLSPEC int orte_gpr_base_pack_get(orte_buffer_t *cmd,
orte_gpr_addr_mode_t mode,
char *segment, char **tokens, char **keys);
OMPI_DECLSPEC int orte_gpr_base_unpack_get(orte_buffer_t *buffer, int *ret,
int *cnt, orte_gpr_value_t ***values);
OMPI_DECLSPEC int mca_gpr_base_pack_unsubscribe(ompi_buffer_t cmd, bool silent,
ompi_registry_notify_id_t remote_idtag);
OMPI_DECLSPEC int mca_gpr_base_unpack_unsubscribe(ompi_buffer_t buffer);
OMPI_DECLSPEC void orte_gpr_base_decode_startup_msg(int status,
orte_process_name_t *peer,
orte_buffer_t* msg,
orte_rml_tag_t tag, void *cbdata);
OMPI_DECLSPEC int orte_gpr_base_pack_dump_all(orte_buffer_t *cmd);
OMPI_DECLSPEC int orte_gpr_base_pack_dump_segments(orte_buffer_t *cmd);
OMPI_DECLSPEC int orte_gpr_base_pack_dump_triggers(orte_buffer_t *cmd);
OMPI_DECLSPEC int orte_gpr_base_print_dump(orte_buffer_t *buffer, int output_id);
OMPI_DECLSPEC int mca_gpr_base_pack_put(ompi_buffer_t cmd, bool silent,
ompi_registry_mode_t mode, char *segment,
char **tokens, ompi_registry_object_t object,
ompi_registry_object_size_t size);
OMPI_DECLSPEC int mca_gpr_base_unpack_put(ompi_buffer_t buffer);
OMPI_DECLSPEC int orte_gpr_base_dump_notify_msg(orte_gpr_notify_message_t *msg, int output_id);
OMPI_DECLSPEC int orte_gpr_base_dump_notify_data(orte_gpr_notify_data_t *data, int output_id);
OMPI_DECLSPEC int mca_gpr_base_pack_get(ompi_buffer_t cmd,
ompi_registry_mode_t mode,
char *segment, char **tokens);
OMPI_DECLSPEC int mca_gpr_base_unpack_get(ompi_buffer_t buffer, ompi_list_t *return_list);
OMPI_DECLSPEC int orte_gpr_base_pack_cleanup_job(orte_buffer_t *buffer,
orte_jobid_t jobid);
OMPI_DECLSPEC int orte_gpr_base_unpack_cleanup_job(orte_buffer_t *buffer, int *ret);
OMPI_DECLSPEC int orte_gpr_base_pack_cleanup_proc(orte_buffer_t *buffer,
orte_process_name_t *proc);
OMPI_DECLSPEC int orte_gpr_base_unpack_cleanup_proc(orte_buffer_t *buffer, int *ret);
OMPI_DECLSPEC int orte_gpr_base_pack_increment_value(orte_buffer_t *cmd, orte_gpr_value_t *value);
OMPI_DECLSPEC int orte_gpr_base_unpack_increment_value(orte_buffer_t *buffer, int *ret);
OMPI_DECLSPEC int mca_gpr_base_pack_dump(ompi_buffer_t cmd);
OMPI_DECLSPEC void mca_gpr_base_print_dump(ompi_buffer_t buffer, int output_id);
OMPI_DECLSPEC int mca_gpr_base_pack_cleanup_job(ompi_buffer_t buffer, mca_ns_base_jobid_t jobid);
OMPI_DECLSPEC int mca_gpr_base_pack_cleanup_proc(ompi_buffer_t buffer, bool purge, ompi_process_name_t *proc);
OMPI_DECLSPEC int mca_gpr_base_pack_test_internals(ompi_buffer_t cmd, int level);
OMPI_DECLSPEC int mca_gpr_base_unpack_test_internals(ompi_buffer_t buffer, ompi_list_t *return_list);
OMPI_DECLSPEC int mca_gpr_base_pack_notify_off(ompi_buffer_t cmd,
ompi_process_name_t *proc,
ompi_registry_notify_id_t sub_number);
OMPI_DECLSPEC int mca_gpr_base_unpack_notify_off(ompi_buffer_t buffer);
OMPI_DECLSPEC int mca_gpr_base_pack_notify_on(ompi_buffer_t cmd,
ompi_process_name_t *proc,
ompi_registry_notify_id_t sub_number);
OMPI_DECLSPEC int mca_gpr_base_unpack_notify_on(ompi_buffer_t buffer);
OMPI_DECLSPEC int mca_gpr_base_pack_assign_ownership(ompi_buffer_t cmd, bool silent,
mca_ns_base_jobid_t jobid, char *segment);
OMPI_DECLSPEC int mca_gpr_base_unpack_assign_ownership(ompi_buffer_t buffer);
OMPI_DECLSPEC int mca_gpr_base_pack_get_startup_msg(ompi_buffer_t cmd, mca_ns_base_jobid_t jobid);
OMPI_DECLSPEC ompi_buffer_t mca_gpr_base_unpack_get_startup_msg(ompi_buffer_t buffer, ompi_list_t *recipients);
OMPI_DECLSPEC int mca_gpr_base_pack_triggers_active_cmd(ompi_buffer_t cmd, mca_ns_base_jobid_t jobid);
OMPI_DECLSPEC int mca_gpr_base_unpack_triggers_active_cmd(ompi_buffer_t cmd);
OMPI_DECLSPEC int mca_gpr_base_pack_triggers_inactive_cmd(ompi_buffer_t cmd, mca_ns_base_jobid_t jobid);
OMPI_DECLSPEC int mca_gpr_base_unpack_triggers_inactive_cmd(ompi_buffer_t cmd);
OMPI_DECLSPEC extern int mca_gpr_base_output;
OMPI_DECLSPEC extern mca_gpr_base_module_t ompi_registry; /* holds selected module's function pointers */
OMPI_DECLSPEC extern bool mca_gpr_base_selected;
OMPI_DECLSPEC extern ompi_list_t mca_gpr_base_components_available;
OMPI_DECLSPEC extern mca_gpr_base_component_t mca_gpr_base_selected_component;
OMPI_DECLSPEC int orte_gpr_base_pack_decrement_value(orte_buffer_t *cmd, orte_gpr_value_t *value);
OMPI_DECLSPEC int orte_gpr_base_unpack_decrement_value(orte_buffer_t *buffer, int *ret);
#if defined(c_plusplus) || defined(__cplusplus)
@ -195,7 +165,12 @@ OMPI_DECLSPEC extern mca_gpr_base_component_t mca_gpr_base_selected_component;
#endif
/*
* globals that might be needed
* globals that might be needed inside the gpr
*/
extern int orte_gpr_base_output;
extern bool orte_gpr_base_selected;
extern ompi_list_t orte_gpr_base_components_available;
extern mca_gpr_base_component_t orte_gpr_base_selected_component;
#endif

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

@ -12,26 +12,27 @@
* $HEADER$
*/
#include "ompi_config.h"
#include "orte_config.h"
#include "include/orte_constants.h"
#include "mca/gpr/base/base.h"
int mca_gpr_base_close(void)
int orte_gpr_base_close(void)
{
/* If we have a selected component and module, then finalize it */
if (mca_gpr_base_selected) {
mca_gpr_base_selected_component.gpr_finalize();
if (orte_gpr_base_selected) {
orte_gpr_base_selected_component.gpr_finalize();
}
/* Close all remaining available components (may be one if this is a
OMPI RTE program, or [possibly] multiple if this is ompi_info) */
mca_base_components_close(mca_gpr_base_output,
&mca_gpr_base_components_available, NULL);
mca_base_components_close(orte_gpr_base_output,
&orte_gpr_base_components_available, NULL);
/* All done */
return OMPI_SUCCESS;
return ORTE_SUCCESS;
}

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

@ -12,7 +12,11 @@
* $HEADER$
*/
#include "ompi_config.h"
#include "orte_config.h"
#include "include/orte_constants.h"
#include "include/constants.h"
#include "util/output.h"
#include "mca/gpr/base/base.h"
@ -30,80 +34,212 @@
* globals
*/
/** KEYVAL **/
/* constructor - used to initialize state of keyval instance */
static void orte_gpr_keyval_construct(orte_gpr_keyval_t* keyval)
{
keyval->key = NULL;
keyval->type = 0;
keyval->value.i32 = 0;
}
/* destructor - used to free any resources held by instance */
static void orte_gpr_keyval_destructor(orte_gpr_keyval_t* keyval)
{
orte_byte_object_t *byteptr;
if (NULL != keyval->key) {
free(keyval->key);
}
if (ORTE_BYTE_OBJECT == keyval->type) {
byteptr = &(keyval->value.byteobject);
if (NULL != byteptr->bytes) {
free(byteptr->bytes);
}
}
}
/* define instance of ompi_class_t */
OBJ_CLASS_INSTANCE(
orte_gpr_keyval_t, /* type name */
ompi_object_t, /* parent "class" name */
orte_gpr_keyval_construct, /* constructor */
orte_gpr_keyval_destructor); /* destructor */
/** VALUE **/
/* constructor - used to initialize state of registry value instance */
static void ompi_registry_value_construct(ompi_registry_value_t* reg_val)
static void orte_gpr_value_construct(orte_gpr_value_t* reg_val)
{
reg_val->object = NULL;
reg_val->object_size = 0;
reg_val->addr_mode = 0;
reg_val->segment = NULL;
reg_val->cnt = 0;
reg_val->keyvals = NULL;
reg_val->num_tokens = 0;
reg_val->tokens = 0;
}
/* destructor - used to free any resources held by instance */
static void ompi_registry_value_destructor(ompi_registry_value_t* reg_val)
static void orte_gpr_value_destructor(orte_gpr_value_t* reg_val)
{
if (NULL != reg_val->object) {
free(reg_val->object);
char **tokens;
int32_t i;
if (NULL != reg_val->segment) free(reg_val->segment);
if (0 < reg_val->cnt && NULL != reg_val->keyvals) {
for (i=0; i < reg_val->cnt; i++) {
if(NULL != reg_val->keyvals[i])
OBJ_RELEASE(reg_val->keyvals[i]);
}
free(reg_val->keyvals);
}
if (0 < reg_val->num_tokens && NULL != reg_val->tokens) {
tokens = reg_val->tokens;
for (i=0; i < reg_val->num_tokens; i++) {
if(NULL != tokens[i])
free(tokens[i]);
}
free(tokens);
}
}
/* define instance of ompi_class_t */
OBJ_CLASS_INSTANCE(
ompi_registry_value_t, /* type name */
ompi_list_item_t, /* parent "class" name */
ompi_registry_value_construct, /* constructor */
ompi_registry_value_destructor); /* destructor */
orte_gpr_value_t, /* type name */
ompi_object_t, /* parent "class" name */
orte_gpr_value_construct, /* constructor */
orte_gpr_value_destructor); /* destructor */
/* constructor - used to initialize state of compound_cmd_value instance */
static void ompi_registry_compound_cmd_results_construct(ompi_registry_compound_cmd_results_t* results)
/** NOTIFY DATA **/
/* constructor - used to initialize state of registry value instance */
static void orte_gpr_notify_data_construct(orte_gpr_notify_data_t* ptr)
{
OBJ_CONSTRUCT(&results->data, ompi_list_t);
ptr->cb_num = 0;
ptr->addr_mode = 0;
ptr->segment = NULL;
ptr->cnt = 0;
ptr->values = NULL;
}
/* destructor - used to free any resources held by instance */
static void ompi_registry_compound_cmd_results_destructor(ompi_registry_compound_cmd_results_t* results)
static void orte_gpr_notify_data_destructor(orte_gpr_notify_data_t* ptr)
{
OBJ_DESTRUCT(&results->data);
}
int32_t i;
/* define instance of ompi_class_t */
OBJ_CLASS_INSTANCE(
ompi_registry_compound_cmd_results_t, /* type name */
ompi_list_item_t, /* parent "class" name */
ompi_registry_compound_cmd_results_construct, /* constructor */
ompi_registry_compound_cmd_results_destructor); /* destructor */
/* constructor - used to initialize state of index_value instance */
static void ompi_registry_index_value_construct(ompi_registry_index_value_t* value)
{
value->token = NULL;
}
/* destructor - used to free any resources held by instance */
static void ompi_registry_index_value_destructor(ompi_registry_index_value_t* value)
{
if (value->token) {
free(value->token);
if (NULL != ptr->segment) free(ptr->segment);
if (0 < ptr->cnt && NULL != ptr->values) {
for (i=0; i < ptr->cnt; i++) {
if(NULL != ptr->values[i])
OBJ_RELEASE(ptr->values[i]);
}
free(ptr->values);
}
}
/* define instance of ompi_class_t */
OBJ_CLASS_INSTANCE(
ompi_registry_index_value_t, /* type name */
ompi_list_item_t, /* parent "class" name */
ompi_registry_index_value_construct, /* constructor */
ompi_registry_index_value_destructor); /* destructor */
orte_gpr_notify_data_t, /* type name */
ompi_object_t, /* parent "class" name */
orte_gpr_notify_data_construct, /* constructor */
orte_gpr_notify_data_destructor); /* destructor */
/** SUBSCRIPTION **/
/* constructor - used to initialize state of registry subscription instance */
static void orte_gpr_subscription_construct(orte_gpr_subscription_t* sub)
{
sub->addr_mode = 0;
sub->segment = NULL;
sub->num_tokens = 0;
sub->tokens = NULL;
sub->num_keys = 0;
sub->keys = NULL;
sub->cbfunc = NULL;
sub->user_tag = NULL;
}
/* destructor - used to free any resources held by instance */
static void orte_gpr_subscription_destructor(orte_gpr_subscription_t* sub)
{
char **tokens;
int32_t i;
if (NULL != sub->segment) free(sub->segment);
if (0 < sub->num_tokens && NULL != sub->tokens) {
tokens = sub->tokens;
for (i=0; i < sub->num_tokens; i++) {
if(NULL != tokens[i])
free(tokens[i]);
}
free(sub->tokens);
}
if (0 < sub->num_keys && NULL != sub->keys) {
tokens = sub->keys;
for (i=0; i < sub->num_keys; i++) {
if(NULL != tokens[i])
free(tokens[i]);
}
free(sub->keys);
}
}
/* define instance of ompi_class_t */
OBJ_CLASS_INSTANCE(
orte_gpr_subscription_t, /* type name */
ompi_object_t, /* parent "class" name */
orte_gpr_subscription_construct, /* constructor */
orte_gpr_subscription_destructor); /* destructor */
/** NOTIFY MESSAGE */
/* constructor - used to initialize notify message instance */
static void orte_gpr_notify_message_construct(orte_gpr_notify_message_t* msg)
{
msg->idtag = 0;
msg->cnt = 0;
msg->data = NULL;
}
/* destructor - used to free any resources held by instance */
static void orte_gpr_notify_message_destructor(orte_gpr_notify_message_t* msg)
{
int i;
if (0 < msg->cnt && NULL != msg->data) {
for (i=0; i < msg->cnt; i++) {
OBJ_RELEASE(msg->data[i]);
}
free(msg->data);
}
}
/* define instance of ompi_class_t */
OBJ_CLASS_INSTANCE(
orte_gpr_notify_message_t, /* type name */
ompi_object_t, /* parent "class" name */
orte_gpr_notify_message_construct, /* constructor */
orte_gpr_notify_message_destructor); /* destructor */
/** TEST RESULTS */
/* constructor - used to initialize state of test results instance */
static void ompi_registry_internal_test_results_construct(ompi_registry_internal_test_results_t* results)
static void orte_gpr_internal_test_results_construct(orte_gpr_internal_test_results_t* results)
{
results->test = NULL;
results->message = NULL;
}
/* destructor - used to free any resources held by instance */
static void ompi_registry_internal_test_results_destructor(ompi_registry_internal_test_results_t* results)
static void orte_gpr_internal_test_results_destructor(orte_gpr_internal_test_results_t* results)
{
if (NULL != results->test) {
free(results->test);
@ -115,110 +251,46 @@ static void ompi_registry_internal_test_results_destructor(ompi_registry_interna
/* define instance of ompi_class_t */
OBJ_CLASS_INSTANCE(
ompi_registry_internal_test_results_t, /* type name */
orte_gpr_internal_test_results_t, /* type name */
ompi_list_item_t, /* parent "class" name */
ompi_registry_internal_test_results_construct, /* constructor */
ompi_registry_internal_test_results_destructor); /* destructor */
/* constructor - used to initialize notify idtag list instance */
static void mca_gpr_idtag_list_construct(mca_gpr_idtag_list_t* req)
{
req->id_tag = OMPI_REGISTRY_NOTIFY_ID_MAX;
}
/* destructor - used to free any resources held by instance */
static void mca_gpr_idtag_list_destructor(mca_gpr_idtag_list_t* req)
{
}
/* define instance of ompi_class_t */
OBJ_CLASS_INSTANCE(
mca_gpr_idtag_list_t, /* type name */
ompi_list_item_t, /* parent "class" name */
mca_gpr_idtag_list_construct, /* constructor */
mca_gpr_idtag_list_destructor); /* destructor */
/* constructor - used to initialize notify message instance */
static void ompi_registry_notify_message_construct(ompi_registry_notify_message_t* msg)
{
msg->segment = NULL;
msg->owning_job = 0;
OBJ_CONSTRUCT(&msg->data, ompi_list_t);
msg->trig_action = OMPI_REGISTRY_NOTIFY_NONE;
msg->trig_synchro = OMPI_REGISTRY_SYNCHRO_MODE_NONE;
msg->num_tokens = 0;
msg->tokens = NULL;
}
/* destructor - used to free any resources held by instance */
static void ompi_registry_notify_message_destructor(ompi_registry_notify_message_t* msg)
{
uint32_t i;
char **tokptr;
ompi_registry_value_t *ptr;
if (NULL != msg->segment) {
free(msg->segment);
}
while (NULL != (ptr = (ompi_registry_value_t*)ompi_list_remove_first(&msg->data))) {
OBJ_RELEASE(ptr);
}
OBJ_DESTRUCT(&msg->data);
for (i=0, tokptr=msg->tokens; i < msg->num_tokens; i++, tokptr++) {
free(*tokptr);
}
if (NULL != msg->tokens) {
free(msg->tokens);
}
}
/* define instance of ompi_class_t */
OBJ_CLASS_INSTANCE(
ompi_registry_notify_message_t, /* type name */
ompi_object_t, /* parent "class" name */
ompi_registry_notify_message_construct, /* constructor */
ompi_registry_notify_message_destructor); /* destructor */
orte_gpr_internal_test_results_construct, /* constructor */
orte_gpr_internal_test_results_destructor); /* destructor */
/*
* Global variables
*/
int mca_gpr_base_output = -1;
mca_gpr_base_module_t ompi_registry;
bool mca_gpr_base_selected = false;
ompi_list_t mca_gpr_base_components_available;
mca_gpr_base_component_t mca_gpr_base_selected_component;
ompi_mutex_t mca_gpr_mutex;
int orte_gpr_base_output = -1;
orte_gpr_base_module_t orte_gpr;
bool orte_gpr_base_selected = false;
ompi_list_t orte_gpr_base_components_available;
mca_gpr_base_component_t orte_gpr_base_selected_component;
ompi_mutex_t orte_gpr_mutex;
/**
* Function for finding and opening either all MCA components, or the one
* that was specifically requested via a MCA parameter.
*/
int mca_gpr_base_open(void)
int orte_gpr_base_open(void)
{
/* Open up all available components */
if (OMPI_SUCCESS !=
mca_base_components_open("gpr", 0, mca_gpr_base_static_components,
&mca_gpr_base_components_available)) {
return OMPI_ERROR;
&orte_gpr_base_components_available)) {
return ORTE_ERROR;
}
/* setup output for debug messages */
if (!ompi_output_init) { /* can't open output */
return OMPI_ERROR;
return ORTE_ERROR;
}
mca_gpr_base_output = ompi_output_open(NULL);
orte_gpr_base_output = ompi_output_open(NULL);
/* All done */
return OMPI_SUCCESS;
return ORTE_SUCCESS;
}

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

@ -1,65 +0,0 @@
/*
* Copyright (c) 2004-2005 The Trustees of Indiana University.
* All rights reserved.
* Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
* All rights reserved.
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
* University of Stuttgart. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
/** @file:
*
* The Open MPI general purpose registry - implementation.
*
*/
/*
* includes
*/
#include "ompi_config.h"
#include "mca/gpr/base/base.h"
int mca_gpr_base_pack_cleanup_job(ompi_buffer_t buffer, mca_ns_base_jobid_t jobid)
{
mca_gpr_cmd_flag_t command;
command = MCA_GPR_CLEANUP_JOB_CMD;
if (OMPI_SUCCESS != ompi_pack(buffer, &command, 1, MCA_GPR_OOB_PACK_CMD)) {
return OMPI_ERROR;
}
if (OMPI_SUCCESS != ompi_pack(buffer, &jobid, 1, MCA_GPR_OOB_PACK_JOBID)) {
return OMPI_ERROR;
}
return OMPI_SUCCESS;
}
int mca_gpr_base_pack_cleanup_proc(ompi_buffer_t buffer, bool purge, ompi_process_name_t *proc)
{
mca_gpr_cmd_flag_t command;
command = MCA_GPR_CLEANUP_PROC_CMD;
if (OMPI_SUCCESS != ompi_pack(buffer, &command, 1, MCA_GPR_OOB_PACK_CMD)) {
return OMPI_ERROR;
}
if (OMPI_SUCCESS != ompi_pack(buffer, &purge, 1, MCA_GPR_OOB_PACK_BOOL)) {
return OMPI_ERROR;
}
if (OMPI_SUCCESS != ompi_pack(buffer, proc, 1, MCA_GPR_OOB_PACK_NAME)) {
return OMPI_ERROR;
}
return OMPI_SUCCESS;
}

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

@ -1,126 +0,0 @@
/*
* Copyright (c) 2004-2005 The Trustees of Indiana University.
* All rights reserved.
* Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
* All rights reserved.
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
* University of Stuttgart. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
/** @file:
*
*/
#include "ompi_config.h"
#include "mca/gpr/base/base.h"
int mca_gpr_base_pack_delete_segment(ompi_buffer_t cmd, bool silent, char *segment)
{
mca_gpr_cmd_flag_t command;
int8_t tmp_bool;
command = MCA_GPR_DELETE_SEGMENT_CMD;
if (OMPI_SUCCESS != ompi_pack(cmd, &command, 1, MCA_GPR_OOB_PACK_CMD)) {
return OMPI_ERROR;
}
tmp_bool = (int8_t)silent;
if (OMPI_SUCCESS != ompi_pack(cmd, &tmp_bool, 1, MCA_GPR_OOB_PACK_BOOL)) {
return OMPI_ERROR;
}
if (OMPI_SUCCESS != ompi_pack_string(cmd, segment)) {
return OMPI_ERROR;
}
return OMPI_SUCCESS;
}
int mca_gpr_base_pack_delete_object(ompi_buffer_t cmd, bool silent,
ompi_registry_mode_t mode,
char *segment, char **tokens)
{
mca_gpr_cmd_flag_t command;
char **tokptr;
int32_t num_tokens;
int i;
int8_t tmp_bool;
command = MCA_GPR_DELETE_OBJECT_CMD;
if (OMPI_SUCCESS != ompi_pack(cmd, &command, 1, MCA_GPR_OOB_PACK_CMD)) {
return OMPI_ERROR;
}
tmp_bool = (int8_t)silent;
if (OMPI_SUCCESS != ompi_pack(cmd, &tmp_bool, 1, MCA_GPR_OOB_PACK_BOOL)) {
return OMPI_ERROR;
}
if (OMPI_SUCCESS != ompi_pack(cmd, &mode, 1, MCA_GPR_OOB_PACK_MODE)) {
return OMPI_ERROR;
}
if (OMPI_SUCCESS != ompi_pack_string(cmd, segment)) {
return OMPI_ERROR;
}
/* compute number of tokens */
tokptr = tokens;
num_tokens = 0;
while (NULL != *tokptr) {
num_tokens++;
tokptr++;
}
if (OMPI_SUCCESS != ompi_pack(cmd, &num_tokens, 1, OMPI_INT32)) {
return OMPI_ERROR;
}
tokptr = tokens;
for (i=0; i<num_tokens; i++) { /* pack the tokens */
if (OMPI_SUCCESS != ompi_pack_string(cmd, *tokptr)) {
return OMPI_ERROR;
}
tokptr++;
}
return OMPI_SUCCESS;
}
int mca_gpr_base_pack_index(ompi_buffer_t cmd, char *segment)
{
mca_gpr_cmd_flag_t command;
ompi_registry_mode_t mode;
command = MCA_GPR_INDEX_CMD;
if (OMPI_SUCCESS != ompi_pack(cmd, &command, 1, MCA_GPR_OOB_PACK_CMD)) {
return OMPI_ERROR;
}
if (NULL == segment) { /* no segment specified - want universe dict */
mode = 0;
if (OMPI_SUCCESS != ompi_pack(cmd, &mode, 1, MCA_GPR_OOB_PACK_MODE)) {
return OMPI_ERROR;
}
} else {
mode = 1;
if (OMPI_SUCCESS != ompi_pack(cmd, &mode, 1, MCA_GPR_OOB_PACK_MODE)) {
return OMPI_ERROR;
}
if (OMPI_SUCCESS != ompi_pack_string(cmd, segment)) {
return OMPI_ERROR;
}
}
return OMPI_SUCCESS;
}

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

@ -1,137 +0,0 @@
/*
* Copyright (c) 2004-2005 The Trustees of Indiana University.
* All rights reserved.
* Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
* All rights reserved.
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
* University of Stuttgart. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
/** @file:
*
* The Open MPI general purpose registry - implementation.
*
*/
/*
* includes
*/
#include "ompi_config.h"
#include "mca/gpr/base/base.h"
int mca_gpr_base_pack_triggers_active_cmd(ompi_buffer_t cmd,
mca_ns_base_jobid_t jobid)
{
mca_gpr_cmd_flag_t command;
command = MCA_GPR_TRIGGERS_ACTIVE_CMD;
if (OMPI_SUCCESS != ompi_pack(cmd, &command, 1, MCA_GPR_OOB_PACK_CMD)) {
return OMPI_ERROR;
}
if (OMPI_SUCCESS != ompi_pack(cmd, &jobid, 1, MCA_GPR_OOB_PACK_JOBID)) {
return OMPI_ERROR;
}
return OMPI_SUCCESS;
}
int mca_gpr_base_pack_triggers_inactive_cmd(ompi_buffer_t cmd,
mca_ns_base_jobid_t jobid)
{
mca_gpr_cmd_flag_t command;
command = MCA_GPR_TRIGGERS_INACTIVE_CMD;
if (OMPI_SUCCESS != ompi_pack(cmd, &command, 1, MCA_GPR_OOB_PACK_CMD)) {
return OMPI_ERROR;
}
if (OMPI_SUCCESS != ompi_pack(cmd, &jobid, 1, MCA_GPR_OOB_PACK_JOBID)) {
return OMPI_ERROR;
}
return OMPI_SUCCESS;
}
int mca_gpr_base_pack_notify_on(ompi_buffer_t cmd,
ompi_process_name_t *proc,
ompi_registry_notify_id_t sub_number)
{
mca_gpr_cmd_flag_t command;
command = MCA_GPR_NOTIFY_ON_CMD;
if (OMPI_SUCCESS != ompi_pack(cmd, &command, 1, MCA_GPR_OOB_PACK_CMD)) {
return OMPI_ERROR;
}
if (OMPI_SUCCESS != ompi_pack(cmd, proc, 1, MCA_GPR_OOB_PACK_NAME)) {
return OMPI_ERROR;
}
if (OMPI_SUCCESS != ompi_pack(cmd, &sub_number, 1, MCA_GPR_OOB_PACK_NOTIFY_ID)) {
return OMPI_ERROR;
}
return OMPI_SUCCESS;
}
int mca_gpr_base_pack_notify_off(ompi_buffer_t cmd,
ompi_process_name_t *proc,
ompi_registry_notify_id_t sub_number)
{
mca_gpr_cmd_flag_t command;
command = MCA_GPR_NOTIFY_OFF_CMD;
if (OMPI_SUCCESS != ompi_pack(cmd, &command, 1, MCA_GPR_OOB_PACK_CMD)) {
return OMPI_ERROR;
}
if (OMPI_SUCCESS != ompi_pack(cmd, proc, 1, MCA_GPR_OOB_PACK_NAME)) {
return OMPI_ERROR;
}
if (OMPI_SUCCESS != ompi_pack(cmd, &sub_number, 1, MCA_GPR_OOB_PACK_NOTIFY_ID)) {
return OMPI_ERROR;
}
return OMPI_SUCCESS;
}
int mca_gpr_base_pack_assign_ownership(ompi_buffer_t cmd, bool silent,
mca_ns_base_jobid_t jobid, char *segment)
{
mca_gpr_cmd_flag_t command;
int8_t tmp_bool;
command = MCA_GPR_ASSIGN_OWNERSHIP_CMD;
if (OMPI_SUCCESS != ompi_pack(cmd, &command, 1, MCA_GPR_OOB_PACK_CMD)) {
return OMPI_ERROR;
}
tmp_bool = (int8_t)silent;
if (OMPI_SUCCESS != ompi_pack(cmd, &tmp_bool, 1, MCA_GPR_OOB_PACK_BOOL)) {
return OMPI_ERROR;
}
if (OMPI_SUCCESS != ompi_pack(cmd, &jobid, 1, MCA_GPR_OOB_PACK_JOBID)) {
return OMPI_ERROR;
}
if (OMPI_SUCCESS != ompi_pack_string(cmd, segment)) {
return OMPI_ERROR;
}
return OMPI_SUCCESS;
}

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

@ -1,143 +0,0 @@
/*
* Copyright (c) 2004-2005 The Trustees of Indiana University.
* All rights reserved.
* Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
* All rights reserved.
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
* University of Stuttgart. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
/** @file:
*
* The Open MPI general purpose registry - implementation.
*
*/
/*
* includes
*/
#include "ompi_config.h"
#include "mca/gpr/base/base.h"
int mca_gpr_base_pack_put(ompi_buffer_t cmd, bool silent,
ompi_registry_mode_t mode, char *segment,
char **tokens, ompi_registry_object_t object,
ompi_registry_object_size_t size)
{
mca_gpr_cmd_flag_t command;
mca_ns_base_jobid_t jobid;
char **tokptr;
int i;
int32_t num_tokens, object_size;
int8_t tmp_bool;
command = MCA_GPR_PUT_CMD;
if (OMPI_SUCCESS != ompi_pack(cmd, &command, 1, MCA_GPR_OOB_PACK_CMD)) {
return OMPI_ERROR;
}
tmp_bool = (int8_t)silent;
if (OMPI_SUCCESS != ompi_pack(cmd, &tmp_bool, 1, MCA_GPR_OOB_PACK_BOOL)) {
return OMPI_ERROR;
}
if (OMPI_SUCCESS != ompi_pack(cmd, &mode, 1, MCA_GPR_OOB_PACK_MODE)) {
return OMPI_ERROR;
}
if (OMPI_SUCCESS != ompi_pack_string(cmd, segment)) {
return OMPI_ERROR;
}
jobid = ompi_name_server.get_jobid(ompi_rte_get_self());
if (OMPI_SUCCESS != ompi_pack(cmd, &jobid, 1, MCA_GPR_OOB_PACK_JOBID)) {
return OMPI_ERROR;
}
/* compute number of tokens */
tokptr = tokens;
num_tokens = 0;
while (NULL != *tokptr) {
num_tokens++;
tokptr++;
}
if (OMPI_SUCCESS != ompi_pack(cmd, &num_tokens, 1, OMPI_INT32)) {
return OMPI_ERROR;
}
tokptr = tokens;
for (i=0; i<num_tokens; i++) { /* pack the tokens */
if (OMPI_SUCCESS != ompi_pack_string(cmd, *tokptr)) {
return OMPI_ERROR;
}
tokptr++;
}
object_size = (int32_t)size;
if (OMPI_SUCCESS != ompi_pack(cmd, &object_size, 1, MCA_GPR_OOB_PACK_OBJECT_SIZE)) {
return OMPI_ERROR;
}
if (OMPI_SUCCESS != ompi_pack(cmd, object, object_size, OMPI_BYTE)) {
return OMPI_ERROR;
}
return OMPI_SUCCESS;
}
int mca_gpr_base_pack_get(ompi_buffer_t cmd,
ompi_registry_mode_t mode,
char *segment, char **tokens)
{
mca_gpr_cmd_flag_t command;
char **tokptr;
int i;
int32_t num_tokens;
command = MCA_GPR_GET_CMD;
if (OMPI_SUCCESS != ompi_pack(cmd, &command, 1, MCA_GPR_OOB_PACK_CMD)) {
return OMPI_ERROR;
}
if (OMPI_SUCCESS != ompi_pack(cmd, &mode, 1, MCA_GPR_OOB_PACK_MODE)) {
return OMPI_ERROR;
}
if (OMPI_SUCCESS != ompi_pack_string(cmd, segment)) {
return OMPI_ERROR;
}
/* compute number of tokens */
tokptr = tokens;
num_tokens = 0;
while (NULL != *tokptr) {
num_tokens++;
tokptr++;
}
if (OMPI_SUCCESS != ompi_pack(cmd, &num_tokens, 1, OMPI_INT32)) {
return OMPI_ERROR;
}
tokptr = tokens;
for (i=0; i<num_tokens; i++) { /* pack the tokens */
if (OMPI_SUCCESS != ompi_pack_string(cmd, *tokptr)) {
return OMPI_ERROR;
}
tokptr++;
}
return OMPI_SUCCESS;
}

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

@ -1,44 +0,0 @@
/* -*- C -*-
*
* Copyright (c) 2004-2005 The Trustees of Indiana University.
* All rights reserved.
* Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
* All rights reserved.
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
* University of Stuttgart. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
/** @file:
*
* The Open MPI General Purpose Registry - pack functions
*
*/
/*
* includes
*/
#include "ompi_config.h"
#include "mca/gpr/base/base.h"
int mca_gpr_base_pack_get_startup_msg(ompi_buffer_t cmd,
mca_ns_base_jobid_t jobid)
{
mca_gpr_cmd_flag_t command;
command = MCA_GPR_GET_STARTUP_MSG_CMD;
if (OMPI_SUCCESS != ompi_pack(cmd, &command, 1, MCA_GPR_OOB_PACK_CMD)) {
return OMPI_ERROR;
}
if (OMPI_SUCCESS != ompi_pack(cmd, &jobid, 1, OMPI_JOBID)) {
return OMPI_ERROR;
}
return OMPI_SUCCESS;
}

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

@ -1,106 +0,0 @@
/*
* Copyright (c) 2004-2005 The Trustees of Indiana University.
* All rights reserved.
* Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
* All rights reserved.
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
* University of Stuttgart. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
/** @file:
*
* The Open MPI general purpose registry - implementation.
*
*/
/*
* includes
*/
#include "ompi_config.h"
#include "mca/gpr/base/base.h"
int mca_gpr_base_pack_subscribe(ompi_buffer_t cmd,
ompi_registry_mode_t mode,
ompi_registry_notify_action_t action,
char *segment, char **tokens)
{
mca_gpr_cmd_flag_t command;
char **tokptr;
int i;
int32_t num_tokens;
command = MCA_GPR_SUBSCRIBE_CMD;
if (OMPI_SUCCESS != ompi_pack(cmd, &command, 1, MCA_GPR_OOB_PACK_CMD)) {
return OMPI_ERROR;
}
if (OMPI_SUCCESS != ompi_pack(cmd, &mode, 1, MCA_GPR_OOB_PACK_MODE)) {
return OMPI_ERROR;
}
if (OMPI_SUCCESS != ompi_pack(cmd, &action, 1, MCA_GPR_OOB_PACK_ACTION)) {
return OMPI_ERROR;
}
if (OMPI_SUCCESS != ompi_pack_string(cmd, segment)) {
return OMPI_ERROR;
}
num_tokens = 0;
if (NULL != tokens) {
/* compute number of tokens */
tokptr = tokens;
while (NULL != *tokptr) {
num_tokens++;
tokptr++;
}
}
if (OMPI_SUCCESS != ompi_pack(cmd, &num_tokens, 1, OMPI_INT32)) {
return OMPI_ERROR;
}
if (0 < num_tokens) {
tokptr = tokens;
for (i=0; i<num_tokens; i++) { /* pack the tokens */
if (OMPI_SUCCESS != ompi_pack_string(cmd, *tokptr)) {
return OMPI_ERROR;
}
tokptr++;
}
}
return OMPI_SUCCESS;
}
int mca_gpr_base_pack_unsubscribe(ompi_buffer_t cmd, bool silent,
ompi_registry_notify_id_t remote_idtag)
{
mca_gpr_cmd_flag_t command;
int8_t tmp_bool;
command = MCA_GPR_UNSUBSCRIBE_CMD;
if (OMPI_SUCCESS != ompi_pack(cmd, &command, 1, MCA_GPR_OOB_PACK_CMD)) {
return OMPI_ERROR;
}
tmp_bool = (int8_t)silent;
if (OMPI_SUCCESS != ompi_pack(cmd, &tmp_bool, 1, MCA_GPR_OOB_PACK_BOOL)) {
return OMPI_ERROR;
}
if (OMPI_SUCCESS != ompi_pack(cmd, &remote_idtag, 1, MCA_GPR_OOB_PACK_NOTIFY_ID)) {
return OMPI_ERROR;
}
return OMPI_SUCCESS;
}

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

@ -1,122 +0,0 @@
/*
* Copyright (c) 2004-2005 The Trustees of Indiana University.
* All rights reserved.
* Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
* All rights reserved.
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
* University of Stuttgart. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
/** @file:
*
* The Open MPI general purpose registry - implementation.
*
*/
/*
* includes
*/
#include "ompi_config.h"
#include "mca/gpr/base/base.h"
int mca_gpr_base_pack_synchro(ompi_buffer_t cmd,
ompi_registry_synchro_mode_t synchro_mode,
ompi_registry_mode_t mode,
char *segment, char **tokens, int trigger)
{
mca_gpr_cmd_flag_t command;
char **tokptr;
int i;
int32_t num_tokens, tmp;
/* need to protect against errors */
if (NULL == segment) {
return OMPI_ERROR;
}
command = MCA_GPR_SYNCHRO_CMD;
if (OMPI_REGISTRY_SYNCHRO_MODE_NONE == synchro_mode) { /* not allowed */
return OMPI_ERROR;
}
if (OMPI_SUCCESS != ompi_pack(cmd, &command, 1, MCA_GPR_OOB_PACK_CMD)) {
return OMPI_ERROR;
}
tmp = (int32_t)synchro_mode;
if (OMPI_SUCCESS != ompi_pack(cmd, &tmp, 1, OMPI_INT32)) {
return OMPI_ERROR;
}
if (OMPI_SUCCESS != ompi_pack(cmd, &mode, 1, MCA_GPR_OOB_PACK_MODE)) {
return OMPI_ERROR;
}
if (OMPI_SUCCESS != ompi_pack_string(cmd, segment)) {
return OMPI_ERROR;
}
num_tokens = 0;
if (NULL != tokens) {
/* compute number of tokens */
tokptr = tokens;
while (NULL != *tokptr) {
num_tokens++;
tokptr++;
}
}
if (OMPI_SUCCESS != ompi_pack(cmd, &num_tokens, 1, OMPI_INT32)) {
return OMPI_ERROR;
}
if (0 < num_tokens) {
tokptr = tokens;
for (i=0; i<num_tokens; i++) { /* pack the tokens */
if (OMPI_SUCCESS != ompi_pack_string(cmd, *tokptr)) {
return OMPI_ERROR;
}
tokptr++;
}
}
tmp = (int32_t)trigger;
if (OMPI_SUCCESS != ompi_pack(cmd, &tmp, 1, OMPI_INT32)) {
return OMPI_ERROR;
}
return OMPI_SUCCESS;
}
int mca_gpr_base_pack_cancel_synchro(ompi_buffer_t cmd, bool silent,
ompi_registry_notify_id_t remote_idtag)
{
mca_gpr_cmd_flag_t command;
int8_t tmp_bool;
command = MCA_GPR_CANCEL_SYNCHRO_CMD;
if (OMPI_SUCCESS != ompi_pack(cmd, &command, 1, MCA_GPR_OOB_PACK_CMD)) {
return OMPI_ERROR;
}
tmp_bool = (int8_t)silent;
if (OMPI_SUCCESS != ompi_pack(cmd, &tmp_bool, 1, MCA_GPR_OOB_PACK_BOOL)) {
return OMPI_ERROR;
}
if (OMPI_SUCCESS != ompi_pack(cmd, &remote_idtag, 1, MCA_GPR_OOB_PACK_NOTIFY_ID)) {
return OMPI_ERROR;
}
return OMPI_SUCCESS;
}

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

@ -1,45 +0,0 @@
/*
* Copyright (c) 2004-2005 The Trustees of Indiana University.
* All rights reserved.
* Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
* All rights reserved.
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
* University of Stuttgart. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
/** @file:
*
* The Open MPI general purpose registry - implementation.
*
*/
/*
* includes
*/
#include "ompi_config.h"
#include "mca/gpr/base/base.h"
int mca_gpr_base_pack_test_internals(ompi_buffer_t cmd, int level)
{
mca_gpr_cmd_flag_t command;
int32_t test_level;
command = MCA_GPR_TEST_INTERNALS_CMD;
test_level = (int32_t)level;
if (OMPI_SUCCESS != ompi_pack(cmd, &command, 1, MCA_GPR_OOB_PACK_CMD)) {
return OMPI_ERROR;
}
if (OMPI_SUCCESS != ompi_pack(cmd, &test_level, 1, OMPI_INT32)) {
return OMPI_ERROR;
}
return OMPI_SUCCESS;
}

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

@ -12,7 +12,9 @@
* $HEADER$
*/
#include "ompi_config.h"
#include "orte_config.h"
#include "include/orte_constants.h"
#include "mca/gpr/base/base.h"
@ -21,20 +23,19 @@
* Function for selecting one component from all those that are
* available.
*/
int mca_gpr_base_select(bool *allow_multi_user_threads,
bool *have_hidden_threads)
int orte_gpr_base_select(void)
{
ompi_list_item_t *item;
mca_base_component_list_item_t *cli;
mca_gpr_base_component_t *component, *best_component = NULL;
mca_gpr_base_module_t *module, *best_module = NULL;
orte_gpr_base_module_t *module, *best_module = NULL;
bool multi, hidden;
int priority, best_priority = -1;
/* Iterate through all the available components */
for (item = ompi_list_get_first(&mca_gpr_base_components_available);
item != ompi_list_get_end(&mca_gpr_base_components_available);
for (item = ompi_list_get_first(&orte_gpr_base_components_available);
item != ompi_list_get_end(&orte_gpr_base_components_available);
item = ompi_list_get_next(item)) {
cli = (mca_base_component_list_item_t *) item;
component = (mca_gpr_base_component_t *) cli->cli_component;
@ -60,8 +61,6 @@ int mca_gpr_base_select(bool *allow_multi_user_threads,
/* Save the new best one */
best_module = module;
best_component = component;
*allow_multi_user_threads = multi;
*have_hidden_threads = hidden;
/* update the best priority */
best_priority = priority;
@ -78,17 +77,17 @@ int mca_gpr_base_select(bool *allow_multi_user_threads,
/* If we didn't find one to select, barf */
if (NULL == best_component) {
return OMPI_ERROR;
return ORTE_ERROR;
}
/* We have happiness -- save the component and module for later
usage */
ompi_registry = *best_module;
mca_gpr_base_selected_component = *best_component;
mca_gpr_base_selected = true;
orte_gpr = *best_module;
orte_gpr_base_selected_component = *best_component;
orte_gpr_base_selected = true;
/* all done */
return OMPI_SUCCESS;
return ORTE_SUCCESS;
}

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

@ -1,87 +0,0 @@
/*
* Copyright (c) 2004-2005 The Trustees of Indiana University.
* All rights reserved.
* Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
* All rights reserved.
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
* University of Stuttgart. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
/** @file:
*
*/
#include "ompi_config.h"
#include "mca/gpr/base/base.h"
int mca_gpr_base_unpack_delete_segment(ompi_buffer_t buffer)
{
mca_gpr_cmd_flag_t command;
int32_t response;
if ((OMPI_SUCCESS != ompi_unpack(buffer, &command, 1, MCA_GPR_OOB_PACK_CMD))
|| (MCA_GPR_DELETE_SEGMENT_CMD != command)) {
return OMPI_ERROR;
}
if (OMPI_SUCCESS != ompi_unpack(buffer, &response, 1, OMPI_INT32)) {
return OMPI_ERROR;
} else {
return (int)response;
}
}
int mca_gpr_base_unpack_delete_object(ompi_buffer_t buffer)
{
mca_gpr_cmd_flag_t command;
int32_t response;
if ((OMPI_SUCCESS != ompi_unpack(buffer, &command, 1, MCA_GPR_OOB_PACK_CMD))
|| (MCA_GPR_DELETE_OBJECT_CMD != command)) {
return OMPI_ERROR;
}
if (OMPI_SUCCESS != ompi_unpack(buffer, &response, 1, OMPI_INT32)) {
return OMPI_ERROR;
} else {
return (int)response;
}
}
int mca_gpr_base_unpack_index(ompi_buffer_t buffer, ompi_list_t *return_list)
{
mca_gpr_cmd_flag_t command;
int32_t num_responses;
ompi_registry_index_value_t *newptr;
char *string1;
int i;
if ((OMPI_SUCCESS != ompi_unpack(buffer, &command, 1, MCA_GPR_OOB_PACK_CMD))
|| (MCA_GPR_INDEX_CMD != command)) {
return OMPI_ERROR;
}
if ((OMPI_SUCCESS != ompi_unpack(buffer, &num_responses, 1, OMPI_INT32)) ||
(0 >= num_responses)) {
return OMPI_ERROR;
}
for (i=0; i<num_responses; i++) {
if (0 > ompi_unpack_string(buffer, &string1)) {
return OMPI_ERROR;
}
newptr = OBJ_NEW(ompi_registry_index_value_t);
newptr->token = strdup(string1);
ompi_list_append(return_list, &newptr->item);
}
return OMPI_SUCCESS;
}

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

@ -1,65 +0,0 @@
/*
* Copyright (c) 2004-2005 The Trustees of Indiana University.
* All rights reserved.
* Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
* All rights reserved.
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
* University of Stuttgart. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
/** @file:
*
* The Open MPI general purpose registry - implementation.
*
*/
/*
* includes
*/
#include "ompi_config.h"
#include "mca/gpr/base/base.h"
int mca_gpr_base_unpack_triggers_active_cmd(ompi_buffer_t cmd)
{
return OMPI_SUCCESS;
}
int mca_gpr_base_unpack_triggers_inactive_cmd(ompi_buffer_t cmd)
{
return OMPI_SUCCESS;
}
int mca_gpr_base_unpack_notify_on(ompi_buffer_t cmd)
{
return OMPI_SUCCESS;
}
int mca_gpr_base_unpack_notify_off(ompi_buffer_t cmd)
{
return OMPI_SUCCESS;
}
int mca_gpr_base_unpack_assign_ownership(ompi_buffer_t cmd)
{
mca_gpr_cmd_flag_t command;
int32_t response;
if ((OMPI_SUCCESS != ompi_unpack(cmd, &command, 1, MCA_GPR_OOB_PACK_CMD)) ||
(MCA_GPR_ASSIGN_OWNERSHIP_CMD != command)) {
return OMPI_ERROR;
}
if (OMPI_SUCCESS != ompi_unpack(cmd, &response, 1, OMPI_INT32)) {
return OMPI_ERROR;
}
return (int)response;
}

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

@ -1,81 +0,0 @@
/*
* Copyright (c) 2004-2005 The Trustees of Indiana University.
* All rights reserved.
* Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
* All rights reserved.
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
* University of Stuttgart. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
/** @file:
*
* The Open MPI general purpose registry - base unpack functions.
*
*/
/*
* includes
*/
#include "ompi_config.h"
#include "mca/gpr/base/base.h"
int mca_gpr_base_unpack_put(ompi_buffer_t buffer)
{
mca_gpr_cmd_flag_t command;
int32_t response;
if ((OMPI_SUCCESS != ompi_unpack(buffer, &command, 1, MCA_GPR_OOB_PACK_CMD))
|| (MCA_GPR_PUT_CMD != command)) {
return OMPI_ERROR;
}
if (OMPI_SUCCESS != ompi_unpack(buffer, &response, 1, OMPI_INT32)) {
return OMPI_ERROR;
} else {
return (int)response;
}
}
int mca_gpr_base_unpack_get(ompi_buffer_t buffer, ompi_list_t *returned_list)
{
mca_gpr_cmd_flag_t command;
int32_t object_size, num_responses;
ompi_registry_value_t *newptr;
ompi_registry_object_t *object;
int i;
if ((OMPI_SUCCESS != ompi_unpack(buffer, &command, 1, MCA_GPR_OOB_PACK_CMD))
|| (MCA_GPR_GET_CMD != command)) {
return OMPI_ERROR;
}
if ((OMPI_SUCCESS != ompi_unpack(buffer, &num_responses, 1, OMPI_INT32)) ||
(0 >= num_responses)) {
return OMPI_ERROR;
}
for (i=0; i<num_responses; i++) {
if (OMPI_SUCCESS != ompi_unpack(buffer, &object_size, 1, MCA_GPR_OOB_PACK_OBJECT_SIZE)) {
return OMPI_ERROR;
}
object = (ompi_registry_object_t)malloc(object_size);
if (OMPI_SUCCESS != ompi_unpack(buffer, object, object_size, OMPI_BYTE)) {
free(object);
return OMPI_ERROR;
}
newptr = OBJ_NEW(ompi_registry_value_t);
newptr->object_size = object_size;
newptr->object = object;
ompi_list_append(returned_list, &newptr->item);
}
return OMPI_SUCCESS;
}

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

@ -1,89 +0,0 @@
/* -*- C -*-
*
* Copyright (c) 2004-2005 The Trustees of Indiana University.
* All rights reserved.
* Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
* All rights reserved.
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
* University of Stuttgart. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
/** @file:
*
* The Open MPI General Purpose Registry - unpack functions
*
*/
/*
* includes
*/
#include "ompi_config.h"
#include "mca/gpr/base/base.h"
ompi_buffer_t
mca_gpr_base_unpack_get_startup_msg(ompi_buffer_t buffer,
ompi_list_t *recipients)
{
mca_gpr_cmd_flag_t command;
int32_t num_objects, num_recipients, i;
ompi_process_name_t proc;
ompi_name_server_namelist_t *peer;
ompi_buffer_t msg;
char *segment=NULL;
ompi_registry_object_t *data_object;
ompi_registry_object_size_t data_obj_size;
if ((OMPI_SUCCESS != ompi_unpack(buffer, &command, 1, MCA_GPR_OOB_PACK_CMD))
|| (MCA_GPR_GET_STARTUP_MSG_CMD != command)) {
ompi_output(0, "unpacking startup msg: got bad command %d", (int)command);
return NULL;
}
if (OMPI_SUCCESS != ompi_unpack(buffer, &num_recipients, 1, OMPI_INT32)) {
ompi_output(0, "unpacking startup msg: got bad num recipients");
return NULL;
}
ompi_output(0, "unpacking startup msg: %d recipients", num_recipients);
for (i=0; i<num_recipients; i++) {
if (OMPI_SUCCESS != ompi_unpack(buffer, &proc, 1, OMPI_NAME)) {
return NULL;
}
peer = OBJ_NEW(ompi_name_server_namelist_t);
peer->name = ompi_name_server.copy_process_name(&proc);
ompi_output(0, "\tproc [%d,%d,%d] added to list as [%d,%d,%d]",
OMPI_NAME_ARGS(proc), OMPI_NAME_ARGS(*(peer->name)));
ompi_list_append(recipients, &peer->item);
}
if (OMPI_SUCCESS != ompi_buffer_init(&msg, 0)) {
return NULL;
}
while (0 < ompi_unpack_string(buffer, &segment)) {
ompi_output(0, "\transferring data for segment %s", segment);
ompi_pack_string(msg, segment);
ompi_unpack(buffer, &num_objects, 1, OMPI_INT32); /* unpack #data objects */
ompi_pack(msg, &num_objects, 1, OMPI_INT32);
if (0 < num_objects) {
for (i=0; i < num_objects; i++) {
ompi_unpack(buffer, &data_obj_size, 1, MCA_GPR_OOB_PACK_OBJECT_SIZE);
data_object = (ompi_registry_object_t)malloc(data_obj_size);
ompi_unpack(buffer, data_object, data_obj_size, OMPI_BYTE);
ompi_pack(msg, &data_obj_size, 1, MCA_GPR_OOB_PACK_OBJECT_SIZE);
ompi_pack(msg, data_object, data_obj_size, OMPI_BYTE);
free(data_object);
}
}
free(segment);
}
return msg;
}

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

@ -1,61 +0,0 @@
/*
* Copyright (c) 2004-2005 The Trustees of Indiana University.
* All rights reserved.
* Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
* All rights reserved.
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
* University of Stuttgart. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
/** @file:
*
* The Open MPI general purpose registry - unpack functions.
*
*/
/*
* includes
*/
#include "ompi_config.h"
#include "mca/gpr/base/base.h"
int mca_gpr_base_unpack_subscribe(ompi_buffer_t buffer, ompi_registry_notify_id_t *remote_idtag)
{
mca_gpr_cmd_flag_t command;
if ((OMPI_SUCCESS != ompi_unpack(buffer, &command, 1, MCA_GPR_OOB_PACK_CMD))
|| (MCA_GPR_SUBSCRIBE_CMD != command)) {
return OMPI_ERROR;
}
if (OMPI_SUCCESS != ompi_unpack(buffer, remote_idtag, 1, MCA_GPR_OOB_PACK_NOTIFY_ID)) {
return OMPI_ERROR;
}
return OMPI_SUCCESS;
}
int mca_gpr_base_unpack_unsubscribe(ompi_buffer_t buffer)
{
mca_gpr_cmd_flag_t command;
int32_t response;
if ((OMPI_SUCCESS != ompi_unpack(buffer, &command, 1, MCA_GPR_OOB_PACK_CMD))
|| (MCA_GPR_UNSUBSCRIBE_CMD != command)) {
return OMPI_ERROR;
}
if (OMPI_SUCCESS != ompi_unpack(buffer, &response, 1, OMPI_INT32)) {
return OMPI_ERROR;
}
return (int)response;
}

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

@ -1,61 +0,0 @@
/*
* Copyright (c) 2004-2005 The Trustees of Indiana University.
* All rights reserved.
* Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
* All rights reserved.
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
* University of Stuttgart. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
/** @file:
*
* The Open MPI general purpose registry - unpack functions.
*
*/
/*
* includes
*/
#include "ompi_config.h"
#include "mca/gpr/base/base.h"
int mca_gpr_base_unpack_synchro(ompi_buffer_t buffer, ompi_registry_notify_id_t *remote_idtag)
{
mca_gpr_cmd_flag_t command;
if ((OMPI_SUCCESS != ompi_unpack(buffer, &command, 1, MCA_GPR_OOB_PACK_CMD))
|| (MCA_GPR_SYNCHRO_CMD != command)) {
return OMPI_ERROR;
}
if (OMPI_SUCCESS != ompi_unpack(buffer, remote_idtag, 1, MCA_GPR_OOB_PACK_NOTIFY_ID)) {
return OMPI_ERROR;
}
return OMPI_SUCCESS;
}
int mca_gpr_base_unpack_cancel_synchro(ompi_buffer_t buffer)
{
mca_gpr_cmd_flag_t command;
int32_t response;
if ((OMPI_SUCCESS != ompi_unpack(buffer, &command, 1, MCA_GPR_OOB_PACK_CMD))
|| (MCA_GPR_CANCEL_SYNCHRO_CMD != command)) {
return OMPI_ERROR;
}
if (OMPI_SUCCESS != ompi_unpack(buffer, &response, 1, OMPI_INT32)) {
return OMPI_ERROR;
}
return (int)response;
}

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

@ -1,60 +0,0 @@
/*
* Copyright (c) 2004-2005 The Trustees of Indiana University.
* All rights reserved.
* Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
* All rights reserved.
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
* University of Stuttgart. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
/** @file:
*
* The Open MPI general purpose registry - implementation.
*
*/
/*
* includes
*/
#include "ompi_config.h"
#include "mca/gpr/base/base.h"
int mca_gpr_base_unpack_test_internals(ompi_buffer_t buffer, ompi_list_t *test_results)
{
char **string1=NULL, **string2=NULL;
int i;
int32_t num_responses;
ompi_registry_internal_test_results_t *newptr=NULL;
mca_gpr_cmd_flag_t command;
if ((OMPI_SUCCESS != ompi_unpack(buffer, &command, 1, MCA_GPR_OOB_PACK_CMD))
|| (MCA_GPR_TEST_INTERNALS_CMD != command)) {
return OMPI_ERROR;
}
if ((OMPI_SUCCESS != ompi_unpack(buffer, &num_responses, 1, OMPI_INT32)) ||
(0 >= num_responses)) {
return OMPI_ERROR;
}
for (i=0; i<num_responses; i++) {
if (0 > ompi_unpack_string(buffer, string1)) {
return OMPI_ERROR;
}
if (0 > ompi_unpack_string(buffer, string2)) {
return OMPI_ERROR;
}
newptr = OBJ_NEW(ompi_registry_internal_test_results_t);
newptr->test = strdup(*string1);
newptr->message = strdup(*string2);
ompi_list_append(test_results, &newptr->item);
}
return OMPI_SUCCESS;
}

40
src/mca/gpr/base/pack_api_cmd/Makefile.am Обычный файл
Просмотреть файл

@ -0,0 +1,40 @@
#
# Copyright (c) 2004-2005 The Trustees of Indiana University.
# All rights reserved.
# Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
# All rights reserved.
# Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
# University of Stuttgart. All rights reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
#
# $HEADER$
#
include $(top_srcdir)/config/Makefile.options
noinst_LTLIBRARIES = libmca_gpr_base_pack.la
# Source code files
headers =
libmca_gpr_base_pack_la_SOURCES = \
$(headers) \
gpr_base_pack_cleanup.c \
gpr_base_pack_del_index.c \
gpr_base_pack_dump.c \
gpr_base_pack_arithmetic_ops.c \
gpr_base_pack_put_get.c \
gpr_base_pack_subscribe.c
# Conditionally install the header files
if WANT_INSTALL_HEADERS
ompidir = $(includedir)/openmpi/mca/gpr/base/pack_api_cmd
ompi_HEADERS = $(headers)
else
ompidir = $(includedir)
endif

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

@ -0,0 +1,72 @@
/*
* Copyright (c) 2004-2005 The Trustees of Indiana University.
* All rights reserved.
* Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
* All rights reserved.
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
* University of Stuttgart. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
/** @file:
*
* The Open MPI general purpose registry - implementation.
*
*/
/*
* includes
*/
#include "orte_config.h"
#include "include/orte_constants.h"
#include "include/orte_types.h"
#include "dps/dps.h"
#include "mca/errmgr/errmgr.h"
#include "mca/gpr/base/base.h"
int orte_gpr_base_pack_increment_value(orte_buffer_t *cmd, orte_gpr_value_t *value)
{
orte_gpr_cmd_flag_t command;
int rc;
command = ORTE_GPR_INCREMENT_VALUE_CMD;
if (ORTE_SUCCESS != (rc = orte_dps.pack(cmd, &command, 1, ORTE_GPR_PACK_CMD))) {
ORTE_ERROR_LOG(rc);
return rc;
}
if (ORTE_SUCCESS != (rc = orte_dps.pack(cmd, &value, 1, ORTE_GPR_VALUE))) {
ORTE_ERROR_LOG(rc);
return rc;
}
return ORTE_SUCCESS;
}
int orte_gpr_base_pack_decrement_value(orte_buffer_t *cmd, orte_gpr_value_t *value)
{
orte_gpr_cmd_flag_t command;
int rc;
command = ORTE_GPR_DECREMENT_VALUE_CMD;
if (ORTE_SUCCESS != (rc = orte_dps.pack(cmd, &command, 1, ORTE_GPR_PACK_CMD))) {
ORTE_ERROR_LOG(rc);
return rc;
}
if (ORTE_SUCCESS != (rc = orte_dps.pack(cmd, &value, 1, ORTE_GPR_VALUE))) {
ORTE_ERROR_LOG(rc);
return rc;
}
return ORTE_SUCCESS;
}

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

@ -0,0 +1,65 @@
/*
* Copyright (c) 2004-2005 The Trustees of Indiana University.
* All rights reserved.
* Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
* All rights reserved.
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
* University of Stuttgart. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
/** @file:
*
* The Open MPI general purpose registry - implementation.
*
*/
/*
* includes
*/
#include "orte_config.h"
#include "dps/dps.h"
#include "mca/gpr/base/base.h"
int orte_gpr_base_pack_cleanup_job(orte_buffer_t *buffer, orte_jobid_t jobid)
{
orte_gpr_cmd_flag_t command;
int rc;
command = ORTE_GPR_CLEANUP_JOB_CMD;
if (ORTE_SUCCESS != (rc = orte_dps.pack(buffer, &command, 1, ORTE_GPR_PACK_CMD))) {
return rc;
}
if (ORTE_SUCCESS != (rc = orte_dps.pack(buffer, &jobid, 1, ORTE_JOBID))) {
return rc;
}
return ORTE_SUCCESS;
}
int orte_gpr_base_pack_cleanup_proc(orte_buffer_t *buffer, orte_process_name_t *proc)
{
orte_gpr_cmd_flag_t command;
int rc;
command = ORTE_GPR_CLEANUP_PROC_CMD;
if (ORTE_SUCCESS != (rc = orte_dps.pack(buffer, &command, 1, ORTE_GPR_PACK_CMD))) {
return rc;
}
if (ORTE_SUCCESS != (rc = orte_dps.pack(buffer, proc, 1, ORTE_NAME))) {
return rc;
}
return ORTE_SUCCESS;
}

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

@ -0,0 +1,139 @@
/*
* Copyright (c) 2004-2005 The Trustees of Indiana University.
* All rights reserved.
* Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
* All rights reserved.
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
* University of Stuttgart. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
/** @file:
*
*/
#include "orte_config.h"
#include "include/orte_constants.h"
#include "dps/dps.h"
#include "mca/errmgr/errmgr.h"
#include "mca/gpr/base/base.h"
int orte_gpr_base_pack_delete_segment(orte_buffer_t *cmd, char *segment)
{
orte_gpr_cmd_flag_t command;
int rc;
command = ORTE_GPR_DELETE_SEGMENT_CMD;
if (ORTE_SUCCESS != (rc = orte_dps.pack(cmd, &command, 1, ORTE_GPR_PACK_CMD))) {
return rc;
}
if (ORTE_SUCCESS != (rc = orte_dps.pack(cmd, &segment, 1, ORTE_STRING))) {
return rc;
}
return ORTE_SUCCESS;
}
int orte_gpr_base_pack_delete_entries(orte_buffer_t *cmd,
orte_gpr_addr_mode_t mode,
char *segment, char **tokens, char **keys)
{
orte_gpr_cmd_flag_t command;
char **ptr;
size_t n;
int rc;
command = ORTE_GPR_DELETE_ENTRIES_CMD;
if (ORTE_SUCCESS != (rc = orte_dps.pack(cmd, &command, 1, ORTE_GPR_CMD))) {
return rc;
}
if (ORTE_SUCCESS != (rc = orte_dps.pack(cmd, &mode, 1, ORTE_GPR_ADDR_MODE))) {
return rc;
}
if (ORTE_SUCCESS != (rc = orte_dps.pack(cmd, &segment, 1, ORTE_STRING))) {
return rc;
}
/* compute number of tokens */
if (NULL == tokens) {
n = 0;
} else {
ptr = tokens;
n = 0;
while (NULL != ptr[n]) {
n++;
}
}
/* pack number of tokens */
if (ORTE_SUCCESS != (rc = orte_dps.pack(cmd, (int*)&n, 1, ORTE_INT))) {
return rc;
}
/* pack tokens ONLY if n > 0 */
if (0 < n) {
if (ORTE_SUCCESS != (rc = orte_dps.pack(cmd, tokens, n, ORTE_STRING))) {
return rc;
}
}
/* compute number of keys */
if (NULL == keys) {
n = 0;
} else {
ptr = keys;
n = 0;
while (NULL != ptr[n]) {
n++;
}
}
/* pack number of keys */
if (ORTE_SUCCESS != (rc = orte_dps.pack(cmd, (int*)&n, 1, ORTE_INT))) {
return rc;
}
/* pack keys ONLY if n > 0 */
if (0 < n) {
if (ORTE_SUCCESS != (rc = orte_dps.pack(cmd, keys, n, ORTE_STRING))) {
return rc;
}
}
return ORTE_SUCCESS;
}
int orte_gpr_base_pack_index(orte_buffer_t *cmd, char *segment)
{
orte_gpr_cmd_flag_t command;
int rc;
command = ORTE_GPR_INDEX_CMD;
if (ORTE_SUCCESS != (rc = orte_dps.pack(cmd, &command, 1, ORTE_GPR_CMD))) {
ORTE_ERROR_LOG(rc);
return rc;
}
if (NULL == segment) { /* no segment specified - want universe dict */
return ORTE_SUCCESS;
}
if (ORTE_SUCCESS != (rc = orte_dps.pack(cmd, &segment, 1, ORTE_STRING))) {
ORTE_ERROR_LOG(rc);
return rc;
}
return ORTE_SUCCESS;
}

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

@ -0,0 +1,56 @@
/*
* Copyright (c) 2004-2005 The Trustees of Indiana University.
* All rights reserved.
* Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
* All rights reserved.
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
* University of Stuttgart. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
/** @file:
*
* The Open MPI general purpose registry - implementation.
*
*/
/*
* includes
*/
#include "orte_config.h"
#include "include/orte_constants.h"
#include "dps/dps.h"
#include "mca/gpr/base/base.h"
int orte_gpr_base_pack_dump_all(orte_buffer_t *cmd)
{
orte_gpr_cmd_flag_t command;
command = ORTE_GPR_DUMP_ALL_CMD;
return orte_dps.pack(cmd, &command, 1, ORTE_GPR_PACK_CMD);
}
int orte_gpr_base_pack_dump_segments(orte_buffer_t *cmd)
{
orte_gpr_cmd_flag_t command;
command = ORTE_GPR_DUMP_SEGMENTS_CMD;
return orte_dps.pack(cmd, &command, 1, ORTE_GPR_PACK_CMD);
}
int orte_gpr_base_pack_dump_triggers(orte_buffer_t *cmd)
{
orte_gpr_cmd_flag_t command;
command = ORTE_GPR_DUMP_TRIGGERS_CMD;
return orte_dps.pack(cmd, &command, 1, ORTE_GPR_PACK_CMD);
}

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

@ -0,0 +1,118 @@
/*
* Copyright (c) 2004-2005 The Trustees of Indiana University.
* All rights reserved.
* Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
* All rights reserved.
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
* University of Stuttgart. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
/** @file:
*
* The Open MPI general purpose registry - implementation.
*
*/
/*
* includes
*/
#include "orte_config.h"
#include "include/orte_constants.h"
#include "include/orte_types.h"
#include "dps/dps.h"
#include "mca/errmgr/errmgr.h"
#include "mca/gpr/base/base.h"
int orte_gpr_base_pack_put(orte_buffer_t *cmd,
int cnt, orte_gpr_value_t **values)
{
orte_gpr_cmd_flag_t command;
int rc;
command = ORTE_GPR_PUT_CMD;
if (ORTE_SUCCESS != (rc = orte_dps.pack(cmd, &command, 1, ORTE_GPR_CMD))) {
return rc;
}
if (ORTE_SUCCESS != (rc = orte_dps.pack(cmd, values, (size_t)cnt, ORTE_GPR_VALUE))) {
return rc;
}
return ORTE_SUCCESS;
}
int orte_gpr_base_pack_get(orte_buffer_t *cmd,
orte_gpr_addr_mode_t mode,
char *segment, char **tokens, char **keys)
{
orte_gpr_cmd_flag_t command;
char **ptr;
int rc;
int n;
command = ORTE_GPR_GET_CMD;
if (ORTE_SUCCESS != (rc = orte_dps.pack(cmd, &command, 1, ORTE_GPR_CMD))) {
return rc;
}
if (ORTE_SUCCESS != (rc = orte_dps.pack(cmd, &mode, 1, ORTE_GPR_ADDR_MODE))) {
return rc;
}
if (ORTE_SUCCESS != (rc = orte_dps.pack(cmd, &segment, 1, ORTE_STRING))) {
return rc;
}
/* compute number of tokens */
n = 0;
if (NULL != tokens) {
ptr = tokens;
while (NULL != ptr[n]) {
n++;
}
}
/* pack number of tokens */
if (ORTE_SUCCESS != (rc = orte_dps.pack(cmd, &n, 1, ORTE_INT))) {
return rc;
}
if (n > 0) {
if (ORTE_SUCCESS != (rc = orte_dps.pack(cmd, tokens, (size_t)n, ORTE_STRING))) {
return rc;
}
}
/* compute number of keys */
n = 0;
if (NULL != keys) {
ptr = keys;
while (NULL != ptr[n]) {
n++;
}
}
/* pack number of keys */
if (ORTE_SUCCESS != (rc = orte_dps.pack(cmd, &n, 1, ORTE_INT))) {
return rc;
}
if (n > 0) {
if (ORTE_SUCCESS != (rc = orte_dps.pack(cmd, keys, (size_t)n, ORTE_STRING))) {
return rc;
}
}
return ORTE_SUCCESS;
}

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

@ -0,0 +1,85 @@
/*
* Copyright (c) 2004-2005 The Trustees of Indiana University.
* All rights reserved.
* Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
* All rights reserved.
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
* University of Stuttgart. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
/** @file:
*
* The Open MPI general purpose registry - implementation.
*
*/
/*
* includes
*/
#include "orte_config.h"
#include "include/orte_constants.h"
#include "include/orte_types.h"
#include "dps/dps.h"
#include "mca/errmgr/errmgr.h"
#include "mca/gpr/base/base.h"
int orte_gpr_base_pack_subscribe(orte_buffer_t *cmd,
orte_gpr_notify_action_t action, int num_subs,
orte_gpr_subscription_t **subscriptions,
int num_trigs,
orte_gpr_value_t **trigs)
{
orte_gpr_cmd_flag_t command;
int rc;
command = ORTE_GPR_SUBSCRIBE_CMD;
if (ORTE_SUCCESS != (rc = orte_dps.pack(cmd, &command, 1, ORTE_GPR_CMD))) {
ORTE_ERROR_LOG(rc);
return rc;
}
if (ORTE_SUCCESS != (rc = orte_dps.pack(cmd, &action, 1, ORTE_NOTIFY_ACTION))) {
ORTE_ERROR_LOG(rc);
return rc;
}
if (ORTE_SUCCESS != (rc = orte_dps.pack(cmd, subscriptions, num_subs, ORTE_GPR_SUBSCRIPTION))) {
ORTE_ERROR_LOG(rc);
return rc;
}
if (ORTE_SUCCESS != (rc = orte_dps.pack(cmd, trigs, num_trigs, ORTE_GPR_VALUE))) {
ORTE_ERROR_LOG(rc);
return rc;
}
return ORTE_SUCCESS;
}
int orte_gpr_base_pack_unsubscribe(orte_buffer_t *cmd,
orte_gpr_notify_id_t remote_idtag)
{
orte_gpr_cmd_flag_t command;
int rc;
command = ORTE_GPR_UNSUBSCRIBE_CMD;
if (ORTE_SUCCESS != (rc = orte_dps.pack(cmd, &command, 1, ORTE_GPR_PACK_CMD))) {
return rc;
}
if (ORTE_SUCCESS != (rc = orte_dps.pack(cmd, &remote_idtag, 1, ORTE_GPR_PACK_NOTIFY_ID))) {
return rc;
}
return ORTE_SUCCESS;
}

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

@ -0,0 +1,42 @@
#
# Copyright (c) 2004-2005 The Trustees of Indiana University.
# All rights reserved.
# Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
# All rights reserved.
# Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
# University of Stuttgart. All rights reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
#
# $HEADER$
#
include $(top_srcdir)/config/Makefile.options
noinst_LTLIBRARIES = libmca_gpr_base_unpack.la
# Source code files
headers =
libmca_gpr_base_unpack_la_SOURCES = \
$(headers) \
gpr_base_unpack_cleanup.c \
gpr_base_unpack_del_index.c \
gpr_base_decode_startup_msg.c \
gpr_base_print_dump.c \
gpr_base_dump_notify.c \
gpr_base_unpack_arithmetic_ops.c \
gpr_base_unpack_put_get.c \
gpr_base_unpack_subscribe.c
# Conditionally install the header files
if WANT_INSTALL_HEADERS
ompidir = $(includedir)/openmpi/mca/gpr/base/unpack_api_response
ompi_HEADERS = $(headers)
else
ompidir = $(includedir)
endif

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

@ -0,0 +1,82 @@
/* -*- C -*-
*
* Copyright (c) 2004-2005 The Trustees of Indiana University.
* All rights reserved.
* Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
* All rights reserved.
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
* University of Stuttgart. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*
*/
/** @file
*/
#include "orte_config.h"
#include "dps/dps.h"
#include "mca/rml/rml_types.h"
#include "util/output.h"
#include "util/proc_info.h"
#include "mca/gpr/base/base.h"
void
orte_gpr_base_decode_startup_msg(int status, orte_process_name_t *peer,
orte_buffer_t* msg,
orte_rml_tag_t tag, void *cbdata)
{
#if 0
char *segment;
orte_gpr_notify_message_t *notify_msg;
orte_gpr_value_t *data_value;
int32_t num_objects, i;
size_t buf_size;
while (0 < ompi_unpack_string(msg, &segment)) {
if (ompi_rte_globals.debug_flag) {
ompi_output(0, "[%d,%d,%d] decoding msg for segment %s",
ORTE_NAME_ARGS(*ompi_rte_get_self()), segment);
}
ompi_unpack(msg, &num_objects, 1, OMPI_INT32); /* unpack #data objects */
if (ompi_rte_globals.debug_flag) {
ompi_output(0, "\twith %d objects", num_objects);
}
if (0 < num_objects) {
notify_msg = OBJ_NEW(orte_gpr_notify_message_t);
notify_msg->segment = strdup(segment);
for (i=0; i < num_objects; i++) {
data_value = OBJ_NEW(orte_gpr_value_t);
ompi_unpack(msg, &data_obj_size, 1, MCA_GPR_OOB_PACK_OBJECT_SIZE);
data_object = (orte_gpr_object_t)malloc(data_obj_size);
ompi_unpack(msg, data_object, data_obj_size, OMPI_BYTE);
data_value->object = data_object;
data_value->object_size = data_obj_size;
ompi_list_append(&notify_msg->data, &data_value->item);
}
if (ompi_rte_globals.debug_flag) {
ompi_output(0, "[%d,%d,%d] delivering msg for segment %s with %d data objects",
ORTE_NAME_ARGS(*ompi_rte_get_self()), segment, (int)num_objects);
}
orte_gpr.deliver_notify_msg(OMPI_REGISTRY_NOTIFY_ON_STARTUP, notify_msg);
}
free(segment);
}
#endif
return;
}

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

@ -0,0 +1,252 @@
/*
* Copyright (c) 2004-2005 The Trustees of Indiana University.
* All rights reserved.
* Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
* All rights reserved.
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
* University of Stuttgart. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
/** @file:
*
* The Open MPI general purpose registry - implementation.
*
*/
/*
* includes
*/
#include "orte_config.h"
#include "include/orte_constants.h"
#include "include/orte_types.h"
#include "dps/dps.h"
#include "util/output.h"
#include "mca/gpr/base/base.h"
static void orte_gpr_base_dump_data(orte_gpr_notify_data_t *data, int output_id);
static void orte_gpr_base_dump_keyval_value(orte_gpr_keyval_t *iptr, int output_id);
int orte_gpr_base_dump_notify_msg(orte_gpr_notify_message_t *msg, int output_id)
{
int i;
ompi_output(output_id, "\n\nDUMP OF NOTIFY MESSAGE STRUCTURE\n");
if (NULL == msg) {
ompi_output(output_id, "NULL msg pointer");
return ORTE_SUCCESS;
}
ompi_output(output_id, "%d Notify data structures in message", msg->cnt);
if (0 < msg->cnt && NULL != msg->data) {
for (i=0; i < msg->cnt; i++) {
ompi_output(output_id, "\n\nDump of data structure %d", i);
orte_gpr_base_dump_data(msg->data[i], output_id);
}
}
return ORTE_SUCCESS;
}
int orte_gpr_base_dump_notify_data(orte_gpr_notify_data_t *data, int output_id)
{
ompi_output(output_id, "\n\nDUMP OF NOTIFY DATA STRUCTURE\n");
if (NULL == data) {
ompi_output(output_id, "NULL data pointer");
return ORTE_SUCCESS;
}
orte_gpr_base_dump_data(data, output_id);
return ORTE_SUCCESS;
}
static void orte_gpr_base_dump_data(orte_gpr_notify_data_t *data, int output_id)
{
orte_gpr_addr_mode_t addr;
orte_gpr_value_t **values;
int i, j;
ompi_output(output_id, "%d Values from segment %s", data->cnt, data->segment);
if (0 < data->cnt && NULL != data->values) {
values = data->values;
for (i=0; i < data->cnt; i++) {
ompi_output(output_id, "\nData for value %d", i);
if (NULL == values[i]) {
ompi_output(output_id, "\tError encountered: NULL value pointer");
} else {
addr = values[i]->addr_mode;
if (NULL == values[i]->tokens) {
ompi_output(output_id, "\tNULL tokens (wildcard)");
} else {
ompi_output(output_id, "\t%d Tokens returned", values[i]->num_tokens);
for (j=0; j < values[i]->num_tokens; j++) {
ompi_output(output_id, "\tToken %d: %s", j, values[i]->tokens[j]);
}
}
ompi_output(output_id, "\tToken addressing mode:");
if (ORTE_GPR_TOKENS_AND & addr) {
ompi_output(output_id, "\t\tORTE_GPR_TOKENS_AND");
}
if (ORTE_GPR_TOKENS_OR & addr) {
ompi_output(output_id, "\t\tORTE_GPR_TOKENS_OR");
}
if (ORTE_GPR_TOKENS_XAND & addr) {
ompi_output(output_id, "\t\tORTE_GPR_TOKENS_XAND");
}
if (ORTE_GPR_TOKENS_XOR & addr) {
ompi_output(output_id, "\t\tORTE_GPR_TOKENS_XOR");
}
if (ORTE_GPR_TOKENS_NOT & addr) {
ompi_output(output_id, "\t\tORTE_GPR_TOKENS_NOT");
}
ompi_output(output_id, "\n\tKey addressing mode:");
if (0x0000 == addr) {
ompi_output(output_id, "\t\tNONE");
}
if (ORTE_GPR_KEYS_AND & addr) {
ompi_output(output_id, "\t\tORTE_GPR_KEYS_AND");
}
if (ORTE_GPR_KEYS_OR & addr) {
ompi_output(output_id, "\t\tORTE_GPR_KEYS_OR");
}
if (ORTE_GPR_KEYS_XAND & addr) {
ompi_output(output_id, "\t\tORTE_GPR_KEYS_XAND");
}
if (ORTE_GPR_KEYS_XOR & addr) {
ompi_output(output_id, "\t\tORTE_GPR_KEYS_XOR");
}
if (ORTE_GPR_KEYS_NOT & addr) {
ompi_output(output_id, "\t\tORTE_GPR_KEYS_NOT");
}
if (NULL == values[i]->keyvals) {
ompi_output(output_id, "\tNo keyvals returned");
} else {
ompi_output(output_id, "\t%d Keyvals returned", values[i]->cnt);
for (j=0; j < values[i]->cnt; j++) {
ompi_output(output_id, "\t\tData for keyval %d: Key: %s", j,
(values[i]->keyvals[j])->key);
orte_gpr_base_dump_keyval_value(values[i]->keyvals[j], output_id);
}
}
}
}
}
}
static void orte_gpr_base_dump_keyval_value(orte_gpr_keyval_t *iptr, int output_id)
{
switch(iptr->type) {
case ORTE_BYTE:
ompi_output(output_id, "\t\t\tData type: ORTE_BYTE");
break;
case ORTE_BOOL:
ompi_output(output_id, "\t\t\tData type: ORTE_BOOL");
break;
case ORTE_STRING:
ompi_output(output_id, "\t\t\tData type: ORTE_STRING\tValue: %s", iptr->value.strptr);
break;
case ORTE_SIZE:
ompi_output(output_id, "\t\t\tData type: ORTE_SIZE");
break;
case ORTE_INT:
ompi_output(output_id, "\t\t\tData type: ORTE_INT\tValue: %d", (int)iptr->value.i32);
break;
case ORTE_UINT8:
ompi_output(output_id, "\t\t\tData type: ORTE_UINT8\tValue: %d", (int)iptr->value.ui8);
break;
case ORTE_UINT16:
ompi_output(output_id, "\t\t\tData type: ORTE_UINT16\tValue: %d", (int)iptr->value.ui16);
break;
case ORTE_UINT32:
ompi_output(output_id, "\t\t\tData type: ORTE_UINT32\tValue: %d", (int)iptr->value.ui32);
break;
#ifdef HAVE_I64
case ORTE_UINT64:
ompi_output(output_id, "\t\t\tData type: ORTE_UINT64\tValue: %d", (int)iptr->value.ui64);
break;
#endif
case ORTE_INT8:
ompi_output(output_id, "\t\t\tData type: ORTE_INT8\tValue: %d", (int)iptr->value.i8);
break;
case ORTE_INT16:
ompi_output(output_id, "\t\t\tData type: ORTE_INT16\tValue: %d", (int)iptr->value.i16);
break;
case ORTE_INT32:
ompi_output(output_id, "\t\t\tData type: ORTE_INT32\tValue: %d", (int)iptr->value.i32);
break;
#ifdef HAVE_I64
case ORTE_INT64:
ompi_output(output_id, "\t\t\tData type: ORTE_INT64\tValue: %d", (int)iptr->value.i64);
break;
#endif
case ORTE_BYTE_OBJECT:
ompi_output(output_id, "\t\t\tData type: ORTE_BYTE_OBJECT\tSize: %d", (int)(iptr->value.byteobject).size);
break;
case ORTE_NAME:
ompi_output(output_id, "\t\t\tData type: ORTE_NAME\tValue: [%d,%d,%d]", ORTE_NAME_ARGS(&(iptr->value.proc)));
break;
case ORTE_VPID:
ompi_output(output_id, "\t\t\tData type: ORTE_VPID\tValue: %d", (int)iptr->value.vpid);
break;
case ORTE_JOBID:
ompi_output(output_id, "\t\t\tData type: ORTE_JOBID\tValue: %d", (int)iptr->value.jobid);
break;
case ORTE_CELLID:
ompi_output(output_id, "\t\t\tData type: ORTE_CELLID\tValue: %d", (int)iptr->value.cellid);
break;
case ORTE_NODE_STATE:
ompi_output(output_id, "\t\t\tData type: ORTE_NODE_STATE\tValue: %d", (int)iptr->value.node_state);
break;
case ORTE_PROC_STATE:
ompi_output(output_id, "\t\t\tData type: ORTE_PROC_STATE\tValue: %d", (int)iptr->value.proc_state);
break;
case ORTE_EXIT_CODE:
ompi_output(output_id, "\t\t\tData type: ORTE_EXIT_CODE\tValue: %d", (int)iptr->value.exit_code);
break;
case ORTE_NULL:
ompi_output(output_id, "\t\t\tData type: ORTE_NULL");
break;
case ORTE_APP_CONTEXT:
ompi_output(output_id, "\t\t\tData type: ORTE_APP_CONTEXT");
break;
default:
ompi_output(output_id, "\t\t\tData type: UNKNOWN");
break;
}
}

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

@ -21,16 +21,26 @@
* includes
*/
#include "ompi_config.h"
#include "orte_config.h"
#include "include/orte_constants.h"
#include "include/orte_types.h"
#include "dps/dps.h"
#include "util/output.h"
#include "mca/gpr/base/base.h"
void mca_gpr_base_print_dump(ompi_buffer_t buffer, int output_id)
int orte_gpr_base_print_dump(orte_buffer_t *buffer, int output_id)
{
char *line;
size_t n;
while (0 < ompi_unpack_string(buffer, &line)) {
ompi_output(output_id, "%s", line);
free(line);
n = 1;
while (ORTE_SUCCESS == orte_dps.unpack(buffer, &line, &n, ORTE_STRING)) {
ompi_output(output_id, "%s", line);
free(line);
n=1;
}
return ORTE_SUCCESS;
}

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

@ -0,0 +1,84 @@
/*
* Copyright (c) 2004-2005 The Trustees of Indiana University.
* All rights reserved.
* Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
* All rights reserved.
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
* University of Stuttgart. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
/** @file:
*
* The Open MPI general purpose registry - implementation.
*
*/
/*
* includes
*/
#include "orte_config.h"
#include "include/orte_constants.h"
#include "include/orte_types.h"
#include "dps/dps.h"
#include "mca/errmgr/errmgr.h"
#include "mca/gpr/base/base.h"
int orte_gpr_base_unpack_increment_value(orte_buffer_t *cmd, int *ret)
{
orte_gpr_cmd_flag_t command;
int rc;
size_t n;
n=1;
if (ORTE_SUCCESS != (rc = orte_dps.unpack(cmd, &command, &n, ORTE_GPR_PACK_CMD))) {
ORTE_ERROR_LOG(rc);
return rc;
}
if (ORTE_GPR_INCREMENT_VALUE_CMD != command) {
ORTE_ERROR_LOG(ORTE_ERR_COMM_FAILURE);
return ORTE_ERR_COMM_FAILURE;
}
n=1;
if (ORTE_SUCCESS != (rc = orte_dps.unpack(cmd, ret, &n, ORTE_INT))) {
ORTE_ERROR_LOG(rc);
return rc;
}
return ORTE_SUCCESS;
}
int orte_gpr_base_unpack_decrement_value(orte_buffer_t *cmd, int *ret)
{
orte_gpr_cmd_flag_t command;
int rc;
size_t n;
n=1;
if (ORTE_SUCCESS != (rc = orte_dps.unpack(cmd, &command, &n, ORTE_GPR_PACK_CMD))) {
ORTE_ERROR_LOG(rc);
return rc;
}
if (ORTE_GPR_DECREMENT_VALUE_CMD != command) {
ORTE_ERROR_LOG(ORTE_ERR_COMM_FAILURE);
return ORTE_ERR_COMM_FAILURE;
}
n=1;
if (ORTE_SUCCESS != (rc = orte_dps.unpack(cmd, ret, &n, ORTE_INT32))) {
ORTE_ERROR_LOG(rc);
return rc;
}
return ORTE_SUCCESS;
}

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

@ -0,0 +1,83 @@
/*
* Copyright (c) 2004-2005 The Trustees of Indiana University.
* All rights reserved.
* Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
* All rights reserved.
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
* University of Stuttgart. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
/** @file:
*
* The Open MPI general purpose registry - implementation.
*
*/
/*
* includes
*/
#include "orte_config.h"
#include "include/orte_constants.h"
#include "include/orte_types.h"
#include "dps/dps.h"
#include "mca/errmgr/errmgr.h"
#include "mca/gpr/base/base.h"
int orte_gpr_base_unpack_cleanup_job(orte_buffer_t *cmd, int *ret)
{
orte_gpr_cmd_flag_t command;
int rc;
size_t n;
n=1;
if (ORTE_SUCCESS != (rc = orte_dps.unpack(cmd, &command, &n, ORTE_GPR_PACK_CMD))) {
ORTE_ERROR_LOG(rc);
return rc;
}
if (ORTE_GPR_CLEANUP_JOB_CMD != command) {
ORTE_ERROR_LOG(ORTE_ERR_COMM_FAILURE);
return ORTE_ERR_COMM_FAILURE;
}
n=1;
if (ORTE_SUCCESS != (rc = orte_dps.unpack(cmd, ret, &n, ORTE_INT))) {
ORTE_ERROR_LOG(rc);
return rc;
}
return ORTE_SUCCESS;
}
int orte_gpr_base_unpack_cleanup_proc(orte_buffer_t *cmd, int *ret)
{
orte_gpr_cmd_flag_t command;
int rc;
size_t n;
n=1;
if (ORTE_SUCCESS != (rc = orte_dps.unpack(cmd, &command, &n, ORTE_GPR_PACK_CMD))) {
ORTE_ERROR_LOG(rc);
return rc;
}
if (ORTE_GPR_CLEANUP_PROC_CMD != command) {
ORTE_ERROR_LOG(ORTE_ERR_COMM_FAILURE);
return ORTE_ERR_COMM_FAILURE;
}
n=1;
if (ORTE_SUCCESS != (rc = orte_dps.unpack(cmd, ret, &n, ORTE_INT))) {
ORTE_ERROR_LOG(rc);
return rc;
}
return ORTE_SUCCESS;
}

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

@ -0,0 +1,137 @@
/*
* Copyright (c) 2004-2005 The Trustees of Indiana University.
* All rights reserved.
* Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
* All rights reserved.
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
* University of Stuttgart. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
/** @file:
*
*/
#include "orte_config.h"
#include "include/orte_constants.h"
#include "include/orte_types.h"
#include "dps/dps.h"
#include "mca/errmgr/errmgr.h"
#include "mca/gpr/base/base.h"
int orte_gpr_base_unpack_delete_segment(orte_buffer_t *buffer, int *ret)
{
orte_gpr_cmd_flag_t command;
int rc;
size_t n;
n = 1;
if (ORTE_SUCCESS != (rc = orte_dps.unpack(buffer, &command, &n, ORTE_GPR_PACK_CMD))) {
ORTE_ERROR_LOG(rc);
return rc;
}
if (ORTE_GPR_DELETE_SEGMENT_CMD != command) {
ORTE_ERROR_LOG(ORTE_ERR_COMM_FAILURE);
return ORTE_ERR_COMM_FAILURE;
}
n = 1;
if (ORTE_SUCCESS != (rc = orte_dps.unpack(buffer, ret, &n, ORTE_INT))) {
ORTE_ERROR_LOG(rc);
return rc;
}
return ORTE_SUCCESS;
}
int orte_gpr_base_unpack_delete_entries(orte_buffer_t *buffer, int *ret)
{
orte_gpr_cmd_flag_t command;
int rc;
size_t n;
n = 1;
if (ORTE_SUCCESS != (rc = orte_dps.unpack(buffer, &command, &n, ORTE_GPR_PACK_CMD))) {
ORTE_ERROR_LOG(rc);
return rc;
}
if (ORTE_GPR_DELETE_ENTRIES_CMD != command) {
ORTE_ERROR_LOG(ORTE_ERR_COMM_FAILURE);
return ORTE_ERR_COMM_FAILURE;
}
n = 1;
if (ORTE_SUCCESS != (rc = orte_dps.unpack(buffer, ret, &n, ORTE_INT))) {
ORTE_ERROR_LOG(rc);
return rc;
}
return ORTE_SUCCESS;
}
int orte_gpr_base_unpack_index(orte_buffer_t *buffer, int *ret, size_t *cnt, char **index)
{
orte_gpr_cmd_flag_t command;
size_t n;
orte_data_type_t type;
int rc;
*cnt = 0;
n = 1;
if (ORTE_SUCCESS != (rc = orte_dps.unpack(buffer, &command, &n, ORTE_GPR_PACK_CMD))) {
ORTE_ERROR_LOG(rc);
return rc;
}
if (ORTE_GPR_INDEX_CMD != command) {
ORTE_ERROR_LOG(ORTE_ERR_COMM_FAILURE);
return ORTE_ERR_COMM_FAILURE;
}
n = 1;
if (ORTE_SUCCESS != (rc = orte_dps.unpack(buffer, ret, &n, ORTE_INT))) {
ORTE_ERROR_LOG(rc);
return rc;
}
if (ORTE_SUCCESS != (rc = orte_dps.peek(buffer, &type, &n))) {
ORTE_ERROR_LOG(rc);
return rc;
}
if (ORTE_STRING != type) {
ORTE_ERROR_LOG(ORTE_ERR_COMM_FAILURE);
return ORTE_ERR_COMM_FAILURE;
}
if (NULL != index) {
ORTE_ERROR_LOG(ORTE_ERR_BAD_PARAM);
return ORTE_ERR_BAD_PARAM;
}
if (0 < n) {
*index = (char *)malloc(n*sizeof(char*));
if (NULL == *index) {
ORTE_ERROR_LOG(ORTE_ERR_OUT_OF_RESOURCE);
return ORTE_ERR_OUT_OF_RESOURCE;
}
}
/* need to unpack the string regardless of n to "clear" the entry from the buffer */
if (ORTE_SUCCESS != (rc = orte_dps.unpack(buffer, index, &n, ORTE_STRING))) {
ORTE_ERROR_LOG(rc);
return rc;
}
*cnt = n;
return ORTE_SUCCESS;
}

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

@ -0,0 +1,113 @@
/*
* Copyright (c) 2004-2005 The Trustees of Indiana University.
* All rights reserved.
* Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
* All rights reserved.
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
* University of Stuttgart. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
/** @file:
*
* The Open MPI general purpose registry - base unpack functions.
*
*/
/*
* includes
*/
#include "orte_config.h"
#include "include/orte_constants.h"
#include "include/orte_types.h"
#include "dps/dps.h"
#include "mca/errmgr/errmgr.h"
#include "mca/gpr/base/base.h"
int orte_gpr_base_unpack_put(orte_buffer_t *buffer, int *ret)
{
orte_gpr_cmd_flag_t command;
int rc;
size_t n;
n=1;
if (ORTE_SUCCESS != (rc = orte_dps.unpack(buffer, &command, &n, ORTE_GPR_PACK_CMD))) {
ORTE_ERROR_LOG(rc);
return rc;
}
if (ORTE_GPR_PUT_CMD != command) {
ORTE_ERROR_LOG(ORTE_ERR_COMM_FAILURE);
return ORTE_ERR_COMM_FAILURE;
}
n=1;
if (ORTE_SUCCESS != (rc = orte_dps.unpack(buffer, ret, &n, ORTE_INT))) {
ORTE_ERROR_LOG(rc);
return rc;
}
return ORTE_SUCCESS;
}
int orte_gpr_base_unpack_get(orte_buffer_t *buffer, int *ret, int *cnt, orte_gpr_value_t ***values)
{
orte_gpr_cmd_flag_t command;
int rc, num;
size_t n;
n=1;
if (ORTE_SUCCESS != (rc = orte_dps.unpack(buffer, &command, &n, ORTE_GPR_PACK_CMD))) {
ORTE_ERROR_LOG(rc);
return rc;
}
if (ORTE_GPR_GET_CMD != command) {
ORTE_ERROR_LOG(ORTE_ERR_COMM_FAILURE);
return ORTE_ERR_COMM_FAILURE;
}
/* find out how many values came back */
if (ORTE_SUCCESS != (rc = orte_dps.unpack(buffer, &num, &n, ORTE_INT))) {
ORTE_ERROR_LOG(rc);
return rc;
}
/* if there were some, then get them */
if (0 < num) {
*values = (orte_gpr_value_t**)malloc(num*sizeof(orte_gpr_value_t*));
if (NULL == *values) {
ORTE_ERROR_LOG(ORTE_ERR_OUT_OF_RESOURCE);
return ORTE_ERR_OUT_OF_RESOURCE;
}
if (ORTE_SUCCESS != (rc = orte_dps.unpack(buffer, *values, (size_t*)&num, ORTE_GPR_VALUE))) {
ORTE_ERROR_LOG(rc);
free(*values);
return rc;
}
}
/* unpack the response code */
n=1;
if (ORTE_SUCCESS != (rc = orte_dps.unpack(buffer, ret, &n, ORTE_INT))) {
ORTE_ERROR_LOG(rc);
return rc;
}
if (ORTE_SUCCESS != *ret) {
ORTE_ERROR_LOG(*ret);
return rc;
}
*cnt = num;
return ORTE_SUCCESS;
}

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

@ -0,0 +1,91 @@
/*
* Copyright (c) 2004-2005 The Trustees of Indiana University.
* All rights reserved.
* Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
* All rights reserved.
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
* University of Stuttgart. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
/** @file:
*
* The Open MPI general purpose registry - unpack functions.
*
*/
/*
* includes
*/
#include "orte_config.h"
#include "include/orte_constants.h"
#include "include/orte_types.h"
#include "dps/dps.h"
#include "mca/errmgr/errmgr.h"
#include "mca/gpr/base/base.h"
int orte_gpr_base_unpack_subscribe(orte_buffer_t *buffer, int *ret, orte_gpr_notify_id_t *remote_idtag)
{
orte_gpr_cmd_flag_t command;
size_t n;
int rc;
n = 1;
if (ORTE_SUCCESS != (rc = orte_dps.unpack(buffer, &command, &n, ORTE_GPR_PACK_CMD))) {
ORTE_ERROR_LOG(rc);
return rc;
}
if (ORTE_GPR_SUBSCRIBE_CMD != command) {
ORTE_ERROR_LOG(ORTE_ERR_COMM_FAILURE);
return ORTE_ERR_COMM_FAILURE;
}
n = 1;
if (ORTE_SUCCESS != (rc = orte_dps.unpack(buffer, remote_idtag, &n, ORTE_GPR_NOTIFY_ID))) {
ORTE_ERROR_LOG(rc);
return rc;
}
n = 1;
if (ORTE_SUCCESS != (rc = orte_dps.unpack(buffer, ret, &n, ORTE_INT))) {
ORTE_ERROR_LOG(rc);
return rc;
}
return ORTE_SUCCESS;
}
int orte_gpr_base_unpack_unsubscribe(orte_buffer_t *buffer, int *ret)
{
orte_gpr_cmd_flag_t command;
size_t n;
int rc;
n = 1;
if (ORTE_SUCCESS != (rc = orte_dps.unpack(buffer, &command, &n, ORTE_GPR_PACK_CMD))) {
ORTE_ERROR_LOG(rc);
return rc;
}
if (ORTE_GPR_UNSUBSCRIBE_CMD != command) {
ORTE_ERROR_LOG(ORTE_ERR_COMM_FAILURE);
return ORTE_ERR_COMM_FAILURE;
}
n = 1;
if (ORTE_SUCCESS != (rc = orte_dps.unpack(buffer, ret, &n, ORTE_INT))) {
ORTE_ERROR_LOG(rc);
return rc;
}
return ORTE_SUCCESS;
}

Разница между файлами не показана из-за своего большого размера Загрузить разницу

249
src/mca/gpr/gpr_types.h Обычный файл
Просмотреть файл

@ -0,0 +1,249 @@
/* -*- C -*-
*
* Copyright (c) 2004-2005 The Trustees of Indiana University.
* All rights reserved.
* Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
* All rights reserved.
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
* University of Stuttgart. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
/** @file
*/
/**
* \brief General Purpose Registry (GPR) API
*
* The Open MPI General Purpose Registry (GPR)
*
* This file contains the public type definitions supporting the GPR
*/
#ifndef ORTE_GPR_TYPES_H_
#define ORTE_GPR_TYPES_H_
#include "orte_config.h"
#include "include/orte_types.h"
#include "include/orte_schema.h"
#include "class/ompi_object.h"
#include "mca/ns/ns_types.h"
#include "mca/soh/soh_types.h"
/** Define the notify actions for the subscription system - can be OR'd
* to create multiple actions
*/
#define ORTE_GPR_NOTIFY_NONE (uint16_t)0x0000 /**< No trigger action */
#define ORTE_GPR_NOTIFY_VALUE_CHG_TO (uint16_t)0x0001 /**< Notifies subscriber when value changes to specified value */
#define ORTE_GPR_NOTIFY_VALUE_CHG_FRM (uint16_t)0x0002 /**< Notifies subscriber when value changes away from specified value */
#define ORTE_GPR_NOTIFY_VALUE_CHG (uint16_t)0x0003 /**< Notifies subscriber when value changes */
#define ORTE_GPR_NOTIFY_ADD_ENTRY (uint16_t)0x0004 /**< Notifies subscriber when entry added */
#define ORTE_GPR_NOTIFY_DEL_ENTRY (uint16_t)0x0008 /**< Notifies subscriber when entry deleted */
#define ORTE_GPR_NOTIFY_ALL (uint16_t)0x000f /**< Notifies subscriber upon any action */
#define ORTE_GPR_NOTIFY_PRE_EXISTING (uint16_t)0x0010 /**< Provide list of all pre-existing data */
#define ORTE_GPR_NOTIFY_ANY (uint16_t)0x00ff /**< Used to test if any action flags set */
#define ORTE_GPR_TRIG_ONE_SHOT (uint16_t)0x0100 /**< Only trigger once - then delete subscription */
#define ORTE_GPR_TRIG_AT_LEVEL (uint16_t)0x0200 /**< Trigger whenever count reaches specified level */
#define ORTE_GPR_TRIG_CMP_LEVELS (uint16_t)0x0400 /**< Trigger when all the specified values are equal */
#define ORTE_GPR_TRIG_MONITOR_ONLY (uint16_t)0x0800 /**< Monitor the provided trigger keyval - counting done by someone else */
#define ORTE_GPR_TRIG_NOTIFY_START (uint16_t)0x1000 /**< Notifies are off when subscription entered - turned on when trigger fires */
#define ORTE_GPR_TRIG_INCLUDE_DATA (uint16_t)0x2000 /**< Include the trigger data in the trigger msg */
#define ORTE_GPR_TRIG_ALL_AT (uint16_t)0xdb00 /**< Use all trig defs except include trig data with AT - a typical situation */
#define ORTE_GPR_TRIG_ALL_CMP (uint16_t)0xdd00 /**< Use all trig defs except include trig data with CMP */
#define ORTE_GPR_TRIG_ANY (uint16_t)0xff00 /**< Used to test if any trigs are set */
typedef uint16_t orte_gpr_notify_action_t;
typedef int32_t orte_gpr_notify_id_t;
#define ORTE_GPR_NOTIFY_ID_MAX INT32_MAX
/*
* Define flag values for remote commands - normally used internally, but required
* here to allow for decoding of notify messages
*/
#define ORTE_GPR_DELETE_SEGMENT_CMD (uint16_t)0x0001
#define ORTE_GPR_PUT_CMD (uint16_t)0x0002
#define ORTE_GPR_DELETE_ENTRIES_CMD (uint16_t)0x0004
#define ORTE_GPR_INDEX_CMD (uint16_t)0x0008
#define ORTE_GPR_SUBSCRIBE_CMD (uint16_t)0x0010
#define ORTE_GPR_UNSUBSCRIBE_CMD (uint16_t)0x0020
#define ORTE_GPR_GET_CMD (uint16_t)0x0100
#define ORTE_GPR_TEST_INTERNALS_CMD (uint16_t)0x0200
#define ORTE_GPR_NOTIFY_CMD (uint16_t)0x0400
#define ORTE_GPR_DUMP_ALL_CMD (uint16_t)0x0800
#define ORTE_GPR_DUMP_SEGMENTS_CMD (uint16_t)0x0810
#define ORTE_GPR_DUMP_TRIGGERS_CMD (uint16_t)0x0820
#define ORTE_GPR_INCREMENT_VALUE_CMD (uint16_t)0x2000
#define ORTE_GPR_DECREMENT_VALUE_CMD (uint16_t)0x4000
#define ORTE_GPR_COMPOUND_CMD (uint16_t)0x8000
#define ORTE_GPR_CLEANUP_JOB_CMD (uint16_t)0x8200
#define ORTE_GPR_CLEANUP_PROC_CMD (uint16_t)0x8400
#define ORTE_GPR_ERROR (uint16_t)0xffff
typedef uint16_t orte_gpr_cmd_flag_t;
/** Define the addressing mode bit-masks for registry operations.
*
* Token modes
*/
#define ORTE_GPR_TOKENS_AND (uint16_t)0x0001 /**< AND tokens together for search results */
#define ORTE_GPR_TOKENS_OR (uint16_t)0x0002 /**< OR tokens for search results */
#define ORTE_GPR_TOKENS_XAND (uint16_t)0x0004 /**< All tokens required, nothing else allowed */
#define ORTE_GPR_TOKENS_XOR (uint16_t)0x0008 /**< Any one of the tokens required, nothing else allowed */
#define ORTE_GPR_TOKENS_NOT (uint16_t)0x0040 /**< Everything except those that meet specs */
/*
* Key modes
*/
#define ORTE_GPR_KEYS_AND (uint16_t)0x0100 /**< AND keys together */
#define ORTE_GPR_KEYS_OR (uint16_t)0x0200 /**< OR keys together */
#define ORTE_GPR_KEYS_XAND (uint16_t)0x0400 /**< All keys required, nothing else allowed */
#define ORTE_GPR_KEYS_XOR (uint16_t)0x0800 /**< Any one of the keys required, nothing else allowed */
#define ORTE_GPR_KEYS_NOT (uint16_t)0x4000 /**< Everything except those that meet specs */
/*
* General modes
*/
#define ORTE_GPR_OVERWRITE (uint16_t)0x8000 /**< Allow overwrite of existing info */
#define ORTE_GPR_NO_OVERWRITE (uint16_t)0x0000 /**< Do not allow overwrite of existing info */
typedef uint16_t orte_gpr_addr_mode_t;
/*
* typedefs
*/
typedef union { /* shared storage for the value */
char *strptr;
uint8_t ui8;
uint16_t ui16;
uint32_t ui32;
#ifdef HAVE_I64
uint64_t ui64;
#endif
int8_t i8;
int16_t i16;
int32_t i32;
#ifdef HAVE_I64
int64_t i64;
#endif
orte_byte_object_t byteobject;
orte_process_name_t proc;
orte_vpid_t vpid;
orte_jobid_t jobid;
orte_cellid_t cellid;
orte_node_state_t node_state;
orte_proc_state_t proc_state;
orte_app_context_t *app_context;
orte_exit_code_t exit_code;
} orte_gpr_value_union_t;
/*
* Key-value pairs for registry operations
*/
typedef struct {
ompi_object_t super; /* required for this to be an object */
char *key; /* string key for this value */
orte_data_type_t type; /* the type of value stored */
orte_gpr_value_union_t value;
} orte_gpr_keyval_t;
OMPI_DECLSPEC OBJ_CLASS_DECLARATION(orte_gpr_keyval_t);
/** Return value structure for registry requests.
* A request for information stored within the registry returns an array of values that
* correspond to the provided tokens. Each object in the array contains an array of
* keyvals from a specific container. Note that the array
* contains \em copies of the data in the registry. This prevents inadvertent
* modification of the registry, but requires the recipient to release the data's
* memory when done.
*
* The address mode and segment fields are included here for convenience and so that
* the structure can be re-used by the put command.
*/
typedef struct {
ompi_object_t super; /**< Makes this an object */
orte_gpr_addr_mode_t addr_mode; /**< Address mode that was used for combining keys/tokens */
char *segment; /**< Name of the segment this came from */
int32_t cnt; /**< Number of keyval objects returned */
orte_gpr_keyval_t **keyvals; /**< Contiguous array of keyval object pointers */
int32_t num_tokens; /**< Number of tokens from the container that held these keyvals */
char **tokens; /**< List of tokens that described the container */
} orte_gpr_value_t;
OMPI_DECLSPEC OBJ_CLASS_DECLARATION(orte_gpr_value_t);
/** Return structure for notification messages
* A notification message contains data from each registered subscription structure.
* Each block of data is associated with a specified callback function and contains
* data from a single segment, one or more containers with one or more keyvals/container.
*/
typedef struct {
ompi_object_t super; /**< Makes this an object */
int32_t cb_num; /**< Number of the subscribed data - indicates which callback to use */
orte_gpr_addr_mode_t addr_mode; /**< Address mode that was used for combining keys/tokens */
char *segment; /**< Name of the segment this came from */
int32_t cnt; /**< Number of value objects returned, one per container */
orte_gpr_value_t **values; /**< Array of value objects returned */
} orte_gpr_notify_data_t;
OBJ_CLASS_DECLARATION(orte_gpr_notify_data_t);
/** Return message for notify requests
*/
typedef struct {
ompi_object_t super; /**< Make this an object */
orte_gpr_notify_id_t idtag; /**< Referenced notify request */
int32_t cnt; /**< number of data objects */
orte_gpr_notify_data_t **data; /**< Contiguous array of pointers to data objects */
} orte_gpr_notify_message_t;
OMPI_DECLSPEC OBJ_CLASS_DECLARATION(orte_gpr_notify_message_t);
/** Notify callback function
* notify_msg = message containing data provided by trigger
*
* user_tag = whatever tag data the user provided when filing the subscription
*/
typedef void (*orte_gpr_notify_cb_fn_t)(orte_gpr_notify_data_t *notify_data, void *user_tag);
/** Structure for registering subscriptions
* A request to be notified when certain events occur, or when counters reach specified
* values, is registered on the registry via a subscription request. This structure
* is provided to concisely provide the required information. The information in this
* structure describes the data that is to be sent when the subscription "fires". It includes
* the segment upon which the data resides, the tokens that describe the containers, and
* the keys that describe the keyvals to be returned. These are combined via the
* addr_mode to locate and return the data.
*/
typedef struct {
ompi_object_t super; /**< Makes this an object */
orte_gpr_addr_mode_t addr_mode; /**< Address mode for combining keys/tokens */
char *segment; /**< Name of the segment where the data is located */
int32_t num_tokens; /**< Number of tokens used to describe data */
char **tokens; /**< List of tokens that describe the data */
int32_t num_keys; /**< Number of keys describing data */
char **keys; /**< Contiguous array of keys */
orte_gpr_notify_cb_fn_t cbfunc; /**< Function to be called with this data */
void *user_tag; /**< User-provided tag to be used in cbfunc */
} orte_gpr_subscription_t;
OBJ_CLASS_DECLARATION(orte_gpr_subscription_t);
/** Return value for test results on internal test
*/
struct orte_gpr_internal_test_results_t {
ompi_list_item_t item; /**< Allows this item to be placed on a list */
char *test;
char *message;
int exit_code;
};
typedef struct orte_gpr_internal_test_results_t orte_gpr_internal_test_results_t;
OMPI_DECLSPEC OBJ_CLASS_DECLARATION(orte_gpr_internal_test_results_t);
#endif /* GPR_TYPES_H */

Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше