From 9eb8e3976eabb224083abd3f8d8cae17b697bd57 Mon Sep 17 00:00:00 2001 From: Danny Auble Date: Tue, 1 Dec 2009 22:59:18 +0000 Subject: [PATCH] removed extra whitespace at end of lines. well at least around 98% of it anyway --- config.h.in | 3 - configure.ac | 32 +- contribs/perlapi/libslurm-perl/Slurm.xs | 52 +- contribs/phpext/Makefile.am | 2 +- contribs/phpext/Makefile.in | 2 +- contribs/slurmdb-direct/moab_2_slurmdb.pl | 62 +- contribs/torque/mpiexec.pl | 38 +- contribs/torque/pbsnodes.pl | 32 +- contribs/torque/qdel.pl | 26 +- contribs/torque/qhold.pl | 32 +- contribs/torque/qrls.pl | 36 +- contribs/torque/qstat.pl | 116 +- contribs/torque/qsub.pl | 60 +- src/Makefile.am | 4 +- src/api/Makefile.am | 20 +- src/api/Makefile.in | 16 +- src/api/allocate.c | 110 +- src/api/allocate_msg.c | 50 +- src/api/block_info.c | 74 +- src/api/cancel.c | 32 +- src/api/checkpoint.c | 46 +- src/api/complete.c | 30 +- src/api/config_info.c | 190 +- src/api/init_msg.c | 36 +- src/api/job_info.c | 86 +- src/api/job_step_info.c | 68 +- src/api/node_info.c | 66 +- src/api/partition_info.c | 78 +- src/api/pmi.c | 100 +- src/api/pmi_server.c | 52 +- src/api/pmi_server.h | 8 +- src/api/reconfigure.c | 56 +- src/api/reservation_info.c | 68 +- src/api/signal.c | 62 +- src/api/slurm_hostlist.c | 24 +- src/api/slurm_pmi.c | 58 +- src/api/slurm_pmi.h | 26 +- src/api/step_ctx.c | 62 +- src/api/step_ctx.h | 8 +- src/api/step_io.c | 56 +- src/api/step_io.h | 18 +- src/api/step_launch.c | 176 +- src/api/step_launch.h | 16 +- src/api/submit.c | 32 +- src/api/suspend.c | 26 +- src/api/topo_info.c | 50 +- src/api/triggers.c | 32 +- src/api/update_config.c | 78 +- src/common/Makefile.am | 40 +- src/common/Makefile.in | 30 +- src/common/arg_desc.c | 22 +- src/common/arg_desc.h | 16 +- src/common/assoc_mgr.c | 598 +++--- src/common/assoc_mgr.h | 98 +- src/common/basil_resv_conf.c | 28 +- src/common/basil_resv_conf.h | 26 +- src/common/bitstring.c | 152 +- src/common/bitstring.h | 44 +- src/common/checkpoint.c | 64 +- src/common/checkpoint.h | 38 +- src/common/daemonize.c | 40 +- src/common/daemonize.h | 22 +- src/common/eio.c | 52 +- src/common/eio.h | 12 +- src/common/env.c | 246 +-- src/common/env.h | 18 +- src/common/forward.c | 170 +- src/common/forward.h | 46 +- src/common/getopt.c | 12 +- src/common/getopt1.c | 4 +- src/common/hostlist.c | 320 +-- src/common/hostlist.h | 90 +- src/common/io_hdr.c | 34 +- src/common/io_hdr.h | 26 +- src/common/job_options.c | 40 +- src/common/job_options.h | 28 +- src/common/job_resources.c | 26 +- src/common/job_resources.h | 24 +- src/common/jobacct_common.c | 80 +- src/common/jobacct_common.h | 54 +- src/common/log.c | 102 +- src/common/log.h | 32 +- src/common/macros.h | 34 +- src/common/mpi.c | 76 +- src/common/mpi.h | 24 +- src/common/net.c | 38 +- src/common/net.h | 18 +- src/common/node_conf.c | 184 +- src/common/node_conf.h | 74 +- src/common/node_select.c | 208 +- src/common/node_select.h | 70 +- src/common/optz.c | 24 +- src/common/optz.h | 24 +- src/common/pack.c | 84 +- src/common/pack.h | 44 +- src/common/parse_config.c | 58 +- src/common/parse_config.h | 24 +- src/common/parse_spec.c | 112 +- src/common/parse_spec.h | 48 +- src/common/parse_time.c | 72 +- src/common/parse_time.h | 28 +- src/common/plugin.c | 56 +- src/common/plugin.h | 24 +- src/common/plugrack.c | 106 +- src/common/plugrack.h | 24 +- src/common/plugstack.c | 80 +- src/common/plugstack.h | 32 +- src/common/print_fields.c | 120 +- src/common/print_fields.h | 26 +- src/common/proc_args.c | 74 +- src/common/proc_args.h | 36 +- src/common/read_config.c | 186 +- src/common/read_config.h | 56 +- src/common/safeopen.c | 20 +- src/common/safeopen.h | 16 +- src/common/slurm_accounting_storage.c | 1288 +++++------ src/common/slurm_accounting_storage.h | 368 ++-- src/common/slurm_auth.c | 72 +- src/common/slurm_auth.h | 28 +- src/common/slurm_cred.c | 188 +- src/common/slurm_cred.h | 52 +- src/common/slurm_errno.c | 90 +- src/common/slurm_jobacct_gather.c | 138 +- src/common/slurm_jobacct_gather.h | 28 +- src/common/slurm_jobcomp.c | 52 +- src/common/slurm_jobcomp.h | 34 +- src/common/slurm_priority.c | 36 +- src/common/slurm_priority.h | 26 +- src/common/slurm_protocol_api.c | 464 ++-- src/common/slurm_protocol_api.h | 106 +- src/common/slurm_protocol_common.h | 32 +- src/common/slurm_protocol_defs.c | 122 +- src/common/slurm_protocol_defs.h | 68 +- src/common/slurm_protocol_interface.h | 132 +- src/common/slurm_protocol_mongo_common.h | 36 +- src/common/slurm_protocol_pack.c | 390 ++-- src/common/slurm_protocol_pack.h | 38 +- src/common/slurm_protocol_socket_common.h | 28 +- .../slurm_protocol_socket_implementation.c | 166 +- src/common/slurm_protocol_util.c | 38 +- src/common/slurm_protocol_util.h | 38 +- src/common/slurm_resource_info.c | 54 +- src/common/slurm_resource_info.h | 20 +- src/common/slurm_rlimits_info.c | 18 +- src/common/slurm_rlimits_info.h | 20 +- src/common/slurm_selecttype_info.c | 16 +- src/common/slurm_selecttype_info.h | 10 +- src/common/slurm_step_layout.c | 186 +- src/common/slurm_step_layout.h | 42 +- src/common/slurm_strcasestr.c | 2 +- src/common/slurm_topology.c | 30 +- src/common/slurm_topology.h | 32 +- src/common/slurm_xlator.h | 52 +- src/common/slurmdbd_defs.c | 320 +-- src/common/slurmdbd_defs.h | 170 +- src/common/stepd_api.c | 46 +- src/common/stepd_api.h | 32 +- src/common/strlcpy.c | 4 +- src/common/switch.c | 74 +- src/common/switch.h | 78 +- src/common/timers.c | 24 +- src/common/timers.h | 26 +- src/common/uid.c | 22 +- src/common/uid.h | 34 +- src/common/unsetenv.c | 24 +- src/common/unsetenv.h | 16 +- src/common/util-net.c | 24 +- src/common/util-net.h | 26 +- src/common/write_labelled_message.c | 26 +- src/common/write_labelled_message.h | 24 +- src/common/xassert.c | 22 +- src/common/xassert.h | 20 +- src/common/xmalloc.c | 76 +- src/common/xmalloc.h | 34 +- src/common/xsignal.c | 30 +- src/common/xsignal.h | 32 +- src/common/xstring.c | 58 +- src/common/xstring.h | 36 +- src/database/Makefile.am | 4 +- src/database/Makefile.in | 4 +- src/database/mysql_common.c | 96 +- src/database/mysql_common.h | 32 +- src/database/pgsql_common.c | 90 +- src/database/pgsql_common.h | 34 +- .../accounting_storage/filetxt/Makefile.am | 2 +- .../accounting_storage/filetxt/Makefile.in | 2 +- .../filetxt/accounting_storage_filetxt.c | 160 +- .../filetxt/filetxt_jobacct_process.c | 244 +-- .../filetxt/filetxt_jobacct_process.h | 22 +- .../mysql/accounting_storage_mysql.c | 1884 ++++++++--------- .../mysql/mysql_jobacct_process.c | 360 ++-- .../mysql/mysql_jobacct_process.h | 24 +- .../accounting_storage/mysql/mysql_problems.c | 76 +- .../accounting_storage/mysql/mysql_problems.h | 28 +- .../accounting_storage/mysql/mysql_rollup.c | 192 +- .../accounting_storage/mysql/mysql_rollup.h | 22 +- .../accounting_storage/none/Makefile.am | 2 +- .../accounting_storage/none/Makefile.in | 2 +- .../none/accounting_storage_none.c | 62 +- .../pgsql/accounting_storage_pgsql.c | 392 ++-- .../pgsql/pgsql_jobacct_process.c | 146 +- .../pgsql/pgsql_jobacct_process.h | 22 +- .../accounting_storage/slurmdbd/Makefile.am | 2 +- .../accounting_storage/slurmdbd/Makefile.in | 2 +- .../slurmdbd/accounting_storage_slurmdbd.c | 230 +- src/plugins/auth/authd/Makefile.am | 2 +- src/plugins/auth/authd/Makefile.in | 2 +- src/plugins/auth/authd/auth_authd.c | 46 +- src/plugins/auth/munge/Makefile.am | 2 +- src/plugins/auth/munge/Makefile.in | 2 +- src/plugins/auth/munge/auth_munge.c | 68 +- src/plugins/auth/none/Makefile.am | 2 +- src/plugins/auth/none/Makefile.in | 2 +- src/plugins/auth/none/auth_none.c | 34 +- src/plugins/checkpoint/aix/Makefile.am | 2 +- src/plugins/checkpoint/aix/Makefile.in | 2 +- src/plugins/checkpoint/aix/checkpoint_aix.c | 68 +- src/plugins/checkpoint/blcr/Makefile.am | 2 +- src/plugins/checkpoint/blcr/Makefile.in | 2 +- src/plugins/checkpoint/blcr/checkpoint_blcr.c | 92 +- src/plugins/checkpoint/none/Makefile.am | 2 +- src/plugins/checkpoint/none/Makefile.in | 2 +- src/plugins/checkpoint/none/checkpoint_none.c | 34 +- src/plugins/checkpoint/ompi/Makefile.am | 2 +- src/plugins/checkpoint/ompi/Makefile.in | 2 +- src/plugins/checkpoint/ompi/checkpoint_ompi.c | 48 +- src/plugins/checkpoint/xlch/Makefile.am | 2 +- src/plugins/checkpoint/xlch/Makefile.in | 2 +- src/plugins/checkpoint/xlch/checkpoint_xlch.c | 98 +- src/plugins/crypto/munge/Makefile.am | 2 +- src/plugins/crypto/munge/Makefile.in | 2 +- src/plugins/crypto/munge/crypto_munge.c | 36 +- src/plugins/crypto/openssl/Makefile.am | 2 +- src/plugins/crypto/openssl/Makefile.in | 2 +- src/plugins/crypto/openssl/crypto_openssl.c | 38 +- src/plugins/jobacct_gather/aix/Makefile.am | 4 +- src/plugins/jobacct_gather/aix/Makefile.in | 4 +- .../jobacct_gather/aix/jobacct_gather_aix.c | 110 +- src/plugins/jobacct_gather/linux/Makefile.am | 4 +- src/plugins/jobacct_gather/linux/Makefile.in | 4 +- .../linux/jobacct_gather_linux.c | 132 +- src/plugins/jobacct_gather/none/Makefile.am | 2 +- src/plugins/jobacct_gather/none/Makefile.in | 2 +- .../jobacct_gather/none/jobacct_gather_none.c | 34 +- src/plugins/jobcomp/filetxt/Makefile.am | 2 +- src/plugins/jobcomp/filetxt/Makefile.in | 2 +- .../jobcomp/filetxt/filetxt_jobcomp_process.c | 70 +- .../jobcomp/filetxt/filetxt_jobcomp_process.h | 22 +- src/plugins/jobcomp/filetxt/jobcomp_filetxt.c | 60 +- src/plugins/jobcomp/mysql/jobcomp_mysql.c | 78 +- .../jobcomp/mysql/mysql_jobcomp_process.c | 60 +- .../jobcomp/mysql/mysql_jobcomp_process.h | 24 +- src/plugins/jobcomp/none/Makefile.am | 2 +- src/plugins/jobcomp/none/Makefile.in | 2 +- src/plugins/jobcomp/none/jobcomp_none.c | 28 +- src/plugins/jobcomp/pgsql/jobcomp_pgsql.c | 80 +- .../jobcomp/pgsql/pgsql_jobcomp_process.c | 68 +- .../jobcomp/pgsql/pgsql_jobcomp_process.h | 24 +- src/plugins/jobcomp/script/Makefile.am | 2 +- src/plugins/jobcomp/script/Makefile.in | 2 +- src/plugins/jobcomp/script/jobcomp_script.c | 56 +- src/plugins/mpi/lam/Makefile.am | 2 +- src/plugins/mpi/lam/Makefile.in | 2 +- src/plugins/mpi/lam/lam.h | 26 +- src/plugins/mpi/lam/mpi_lam.c | 28 +- src/plugins/mpi/mpich1_p4/Makefile.am | 2 +- src/plugins/mpi/mpich1_p4/Makefile.in | 2 +- src/plugins/mpi/mpich1_p4/mpich1_p4.c | 50 +- src/plugins/mpi/mpich1_shmem/Makefile.am | 2 +- src/plugins/mpi/mpich1_shmem/Makefile.in | 2 +- src/plugins/mpi/mpich1_shmem/mpich1_shmem.c | 28 +- src/plugins/mpi/mpichgm/Makefile.am | 2 +- src/plugins/mpi/mpichgm/Makefile.in | 2 +- src/plugins/mpi/mpichgm/mpi_mpichgm.c | 36 +- src/plugins/mpi/mpichgm/mpichgm.c | 40 +- src/plugins/mpi/mpichgm/mpichgm.h | 26 +- src/plugins/mpi/mpichmx/Makefile.am | 2 +- src/plugins/mpi/mpichmx/Makefile.in | 2 +- src/plugins/mpi/mpichmx/mpi_mpichmx.c | 34 +- src/plugins/mpi/mpichmx/mpichmx.c | 42 +- src/plugins/mpi/mpichmx/mpichmx.h | 24 +- src/plugins/mpi/mvapich/Makefile.am | 2 +- src/plugins/mpi/mvapich/Makefile.in | 2 +- src/plugins/mpi/mvapich/mpi_mvapich.c | 34 +- src/plugins/mpi/mvapich/mvapich.c | 238 +-- src/plugins/mpi/mvapich/mvapich.h | 26 +- src/plugins/mpi/none/Makefile.am | 2 +- src/plugins/mpi/none/Makefile.in | 2 +- src/plugins/mpi/none/mpi_none.c | 26 +- src/plugins/mpi/openmpi/Makefile.am | 2 +- src/plugins/mpi/openmpi/Makefile.in | 2 +- src/plugins/mpi/openmpi/mpi_openmpi.c | 26 +- src/plugins/preempt/none/Makefile.am | 2 +- src/plugins/preempt/none/Makefile.in | 2 +- src/plugins/preempt/none/preempt_none.c | 22 +- .../preempt/partition_prio/Makefile.am | 2 +- .../preempt/partition_prio/Makefile.in | 2 +- .../partition_prio/preempt_partition_prio.c | 32 +- src/plugins/preempt/qos/Makefile.am | 2 +- src/plugins/preempt/qos/Makefile.in | 2 +- src/plugins/preempt/qos/preempt_qos.c | 42 +- src/plugins/priority/basic/Makefile.am | 2 +- src/plugins/priority/basic/Makefile.in | 2 +- src/plugins/priority/basic/priority_basic.c | 32 +- src/plugins/priority/multifactor/Makefile.am | 2 +- src/plugins/priority/multifactor/Makefile.in | 2 +- .../multifactor/priority_multifactor.c | 106 +- src/plugins/proctrack/Makefile.am | 2 +- src/plugins/proctrack/Makefile.in | 2 +- src/plugins/proctrack/aix/Makefile.am | 2 +- src/plugins/proctrack/aix/Makefile.in | 2 +- src/plugins/proctrack/aix/proctrack_aix.c | 28 +- src/plugins/proctrack/linuxproc/Makefile.am | 2 +- src/plugins/proctrack/linuxproc/Makefile.in | 2 +- src/plugins/proctrack/linuxproc/kill_tree.c | 32 +- src/plugins/proctrack/linuxproc/kill_tree.h | 24 +- .../proctrack/linuxproc/proctrack_linuxproc.c | 28 +- src/plugins/proctrack/pgid/Makefile.am | 2 +- src/plugins/proctrack/pgid/Makefile.in | 2 +- src/plugins/proctrack/pgid/proctrack_pgid.c | 32 +- src/plugins/proctrack/rms/Makefile.am | 6 +- src/plugins/proctrack/rms/Makefile.in | 4 +- src/plugins/proctrack/rms/proctrack_rms.c | 30 +- src/plugins/proctrack/sgi_job/Makefile.am | 4 +- src/plugins/proctrack/sgi_job/Makefile.in | 4 +- .../proctrack/sgi_job/proctrack_sgi_job.c | 36 +- src/plugins/sched/backfill/Makefile.am | 2 +- src/plugins/sched/backfill/Makefile.in | 2 +- src/plugins/sched/backfill/backfill.c | 98 +- src/plugins/sched/backfill/backfill.h | 24 +- src/plugins/sched/backfill/backfill_wrapper.c | 24 +- src/plugins/sched/builtin/Makefile.am | 2 +- src/plugins/sched/builtin/Makefile.in | 2 +- src/plugins/sched/builtin/builtin_wrapper.c | 26 +- src/plugins/sched/hold/Makefile.am | 2 +- src/plugins/sched/hold/Makefile.in | 2 +- src/plugins/sched/hold/hold_wrapper.c | 26 +- src/plugins/sched/wiki/Makefile.am | 2 +- src/plugins/sched/wiki/Makefile.in | 2 +- src/plugins/sched/wiki/cancel_job.c | 28 +- src/plugins/sched/wiki/crypto.c | 14 +- src/plugins/sched/wiki/crypto.h | 2 +- src/plugins/sched/wiki/get_jobs.c | 44 +- src/plugins/sched/wiki/get_nodes.c | 28 +- src/plugins/sched/wiki/hostlist.c | 34 +- src/plugins/sched/wiki/job_modify.c | 32 +- src/plugins/sched/wiki/msg.c | 68 +- src/plugins/sched/wiki/msg.h | 34 +- src/plugins/sched/wiki/resume_job.c | 22 +- src/plugins/sched/wiki/sched_wiki.c | 30 +- src/plugins/sched/wiki/start_job.c | 34 +- src/plugins/sched/wiki/suspend_job.c | 22 +- src/plugins/sched/wiki2/Makefile.am | 2 +- src/plugins/sched/wiki2/Makefile.in | 2 +- src/plugins/sched/wiki2/cancel_job.c | 32 +- src/plugins/sched/wiki2/crypto.c | 14 +- src/plugins/sched/wiki2/crypto.h | 2 +- src/plugins/sched/wiki2/event.c | 30 +- src/plugins/sched/wiki2/get_jobs.c | 52 +- src/plugins/sched/wiki2/get_nodes.c | 52 +- src/plugins/sched/wiki2/hostlist.c | 28 +- src/plugins/sched/wiki2/initialize.c | 26 +- src/plugins/sched/wiki2/job_add_task.c | 24 +- src/plugins/sched/wiki2/job_modify.c | 62 +- src/plugins/sched/wiki2/job_notify.c | 26 +- src/plugins/sched/wiki2/job_release_task.c | 24 +- src/plugins/sched/wiki2/job_requeue.c | 26 +- src/plugins/sched/wiki2/job_signal.c | 28 +- src/plugins/sched/wiki2/job_will_run.c | 100 +- src/plugins/sched/wiki2/msg.c | 64 +- src/plugins/sched/wiki2/msg.h | 40 +- src/plugins/sched/wiki2/resume_job.c | 22 +- src/plugins/sched/wiki2/sched_wiki.c | 36 +- src/plugins/sched/wiki2/start_job.c | 38 +- src/plugins/sched/wiki2/suspend_job.c | 22 +- .../bluegene/block_allocator/Makefile.am | 4 +- .../bluegene/block_allocator/Makefile.in | 4 +- .../block_allocator/block_allocator.c | 1300 ++++++------ .../block_allocator/block_allocator.h | 128 +- .../bluegene/block_allocator/bridge_linker.c | 156 +- .../bluegene/block_allocator/bridge_linker.h | 42 +- .../bluegene/block_allocator/wire_test.c | 38 +- .../select/bluegene/plugin/Makefile.am | 8 +- .../select/bluegene/plugin/Makefile.in | 8 +- .../select/bluegene/plugin/bg_block_info.c | 160 +- .../select/bluegene/plugin/bg_block_info.h | 22 +- .../select/bluegene/plugin/bg_boot_time.h | 28 +- .../select/bluegene/plugin/bg_job_place.c | 440 ++-- .../select/bluegene/plugin/bg_job_place.h | 40 +- .../select/bluegene/plugin/bg_job_run.c | 418 ++-- .../select/bluegene/plugin/bg_job_run.h | 40 +- .../bluegene/plugin/bg_record_functions.c | 364 ++-- .../bluegene/plugin/bg_record_functions.h | 40 +- .../bluegene/plugin/bg_switch_connections.c | 312 +-- .../select/bluegene/plugin/block_sys.c | 406 ++-- src/plugins/select/bluegene/plugin/bluegene.c | 398 ++-- src/plugins/select/bluegene/plugin/bluegene.h | 34 +- .../select/bluegene/plugin/defined_block.c | 88 +- .../select/bluegene/plugin/defined_block.h | 22 +- .../select/bluegene/plugin/dynamic_block.c | 210 +- .../select/bluegene/plugin/dynamic_block.h | 24 +- src/plugins/select/bluegene/plugin/jobinfo.c | 98 +- src/plugins/select/bluegene/plugin/jobinfo.h | 34 +- .../select/bluegene/plugin/libsched_if64.c | 26 +- src/plugins/select/bluegene/plugin/nodeinfo.c | 72 +- src/plugins/select/bluegene/plugin/nodeinfo.h | 24 +- src/plugins/select/bluegene/plugin/opts.c | 20 +- .../select/bluegene/plugin/select_bluegene.c | 260 +-- src/plugins/select/bluegene/plugin/sfree.c | 38 +- src/plugins/select/bluegene/plugin/sfree.h | 16 +- .../select/bluegene/plugin/slurm_epilog.c | 24 +- .../select/bluegene/plugin/slurm_prolog.c | 34 +- .../select/bluegene/plugin/state_test.c | 162 +- .../select/bluegene/plugin/state_test.h | 34 +- src/plugins/select/bluegene/wrap_rm_api.h | 6 +- src/plugins/select/cons_res/Makefile.am | 2 +- src/plugins/select/cons_res/Makefile.in | 2 +- src/plugins/select/cons_res/dist_tasks.c | 38 +- src/plugins/select/cons_res/dist_tasks.h | 8 +- src/plugins/select/cons_res/job_test.c | 240 +-- src/plugins/select/cons_res/job_test.h | 12 +- src/plugins/select/cons_res/select_cons_res.c | 282 +-- src/plugins/select/cons_res/select_cons_res.h | 10 +- src/plugins/select/linear/Makefile.am | 2 +- src/plugins/select/linear/Makefile.in | 2 +- src/plugins/select/linear/select_linear.c | 338 +-- src/plugins/select/linear/select_linear.h | 20 +- src/plugins/switch/elan/Makefile.am | 2 +- src/plugins/switch/elan/Makefile.in | 2 +- src/plugins/switch/elan/qsw.c | 188 +- src/plugins/switch/elan/qsw.h | 34 +- src/plugins/switch/elan/switch_elan.c | 136 +- src/plugins/switch/federation/Makefile.am | 6 +- src/plugins/switch/federation/Makefile.in | 4 +- src/plugins/switch/federation/federation.c | 326 +-- src/plugins/switch/federation/federation.h | 26 +- .../switch/federation/federation_keys.h | 24 +- .../switch/federation/switch_federation.c | 80 +- src/plugins/switch/none/Makefile.am | 2 +- src/plugins/switch/none/Makefile.in | 2 +- src/plugins/switch/none/switch_none.c | 44 +- src/plugins/task/affinity/Makefile.am | 2 +- src/plugins/task/affinity/Makefile.in | 2 +- src/plugins/task/affinity/affinity.c | 32 +- src/plugins/task/affinity/affinity.h | 26 +- src/plugins/task/affinity/cpuset.c | 30 +- src/plugins/task/affinity/dist_tasks.c | 128 +- src/plugins/task/affinity/dist_tasks.h | 8 +- src/plugins/task/affinity/numa.c | 30 +- src/plugins/task/affinity/schedutils.c | 24 +- src/plugins/task/affinity/task_affinity.c | 68 +- src/plugins/task/none/Makefile.am | 2 +- src/plugins/task/none/Makefile.in | 2 +- src/plugins/task/none/task_none.c | 40 +- src/plugins/topology/3d_torus/Makefile.am | 2 +- src/plugins/topology/3d_torus/Makefile.in | 2 +- src/plugins/topology/3d_torus/hilbert.c | 6 +- src/plugins/topology/3d_torus/hilbert.h | 4 +- src/plugins/topology/3d_torus/hilbert_slurm.c | 46 +- .../topology/3d_torus/topology_3d_torus.c | 28 +- src/plugins/topology/none/Makefile.am | 2 +- src/plugins/topology/none/Makefile.in | 2 +- src/plugins/topology/none/topology_none.c | 30 +- src/plugins/topology/tree/Makefile.am | 2 +- src/plugins/topology/tree/Makefile.in | 2 +- src/plugins/topology/tree/topology_tree.c | 52 +- src/sacct/Makefile.am | 2 +- src/sacct/Makefile.in | 2 +- src/sacct/options.c | 220 +- src/sacct/print.c | 98 +- src/sacct/process.c | 34 +- src/sacct/sacct.c | 96 +- src/sacct/sacct.h | 22 +- src/sacctmgr/account_functions.c | 384 ++-- src/sacctmgr/archive_functions.c | 94 +- src/sacctmgr/association_functions.c | 112 +- src/sacctmgr/cluster_functions.c | 204 +- src/sacctmgr/common.c | 340 +-- src/sacctmgr/config_functions.c | 22 +- src/sacctmgr/file_functions.c | 494 ++--- src/sacctmgr/problem_functions.c | 68 +- src/sacctmgr/qos_functions.c | 164 +- src/sacctmgr/sacctmgr.c | 148 +- src/sacctmgr/sacctmgr.h | 30 +- src/sacctmgr/txn_functions.c | 66 +- src/sacctmgr/user_functions.c | 526 ++--- src/sacctmgr/wckey_functions.c | 58 +- src/salloc/Makefile.am | 2 +- src/salloc/Makefile.in | 2 +- src/salloc/opt.c | 158 +- src/salloc/opt.h | 32 +- src/salloc/salloc.c | 60 +- src/salloc/salloc.h | 22 +- src/sattach/Makefile.am | 6 +- src/sattach/Makefile.in | 6 +- src/sattach/attach.c | 30 +- src/sattach/attach.h | 12 +- src/sattach/opt.c | 24 +- src/sattach/opt.h | 10 +- src/sattach/sattach.c | 32 +- src/sattach/sattach.wrapper.c | 6 +- src/sbatch/Makefile.am | 4 +- src/sbatch/Makefile.in | 4 +- src/sbatch/opt.c | 206 +- src/sbatch/opt.h | 30 +- src/sbatch/sbatch.c | 44 +- src/sbcast/agent.c | 32 +- src/sbcast/opts.c | 22 +- src/sbcast/sbcast.c | 30 +- src/sbcast/sbcast.h | 16 +- src/scancel/opt.c | 46 +- src/scancel/scancel.c | 68 +- src/scancel/scancel.h | 24 +- src/scontrol/create_res.c | 102 +- src/scontrol/info_block.c | 36 +- src/scontrol/info_job.c | 80 +- src/scontrol/info_node.c | 64 +- src/scontrol/info_part.c | 42 +- src/scontrol/info_res.c | 38 +- src/scontrol/scontrol.c | 206 +- src/scontrol/scontrol.h | 30 +- src/scontrol/update_job.c | 112 +- src/scontrol/update_node.c | 58 +- src/scontrol/update_part.c | 68 +- src/sinfo/opts.c | 210 +- src/sinfo/print.c | 150 +- src/sinfo/print.h | 36 +- src/sinfo/sinfo.c | 154 +- src/sinfo/sinfo.h | 18 +- src/sinfo/sort.c | 30 +- src/slurmctld/acct_policy.c | 204 +- src/slurmctld/acct_policy.h | 26 +- src/slurmctld/agent.c | 268 +-- src/slurmctld/agent.h | 46 +- src/slurmctld/backup.c | 100 +- src/slurmctld/basil_interface.c | 50 +- src/slurmctld/basil_interface.h | 22 +- src/slurmctld/controller.c | 226 +- src/slurmctld/gang.c | 140 +- src/slurmctld/gang.h | 14 +- src/slurmctld/job_mgr.c | 1090 +++++----- src/slurmctld/job_scheduler.c | 172 +- src/slurmctld/job_scheduler.h | 56 +- src/slurmctld/licenses.c | 50 +- src/slurmctld/licenses.h | 30 +- src/slurmctld/locks.c | 26 +- src/slurmctld/locks.h | 60 +- src/slurmctld/node_mgr.c | 334 +-- src/slurmctld/node_scheduler.c | 344 +-- src/slurmctld/node_scheduler.h | 36 +- src/slurmctld/partition_mgr.c | 174 +- src/slurmctld/ping_nodes.c | 84 +- src/slurmctld/ping_nodes.h | 40 +- src/slurmctld/port_mgr.c | 42 +- src/slurmctld/port_mgr.h | 22 +- src/slurmctld/power_save.c | 68 +- src/slurmctld/preempt.c | 28 +- src/slurmctld/preempt.h | 26 +- src/slurmctld/proc_req.c | 406 ++-- src/slurmctld/proc_req.h | 28 +- src/slurmctld/read_config.c | 156 +- src/slurmctld/read_config.h | 30 +- src/slurmctld/reservation.c | 308 +-- src/slurmctld/reservation.h | 30 +- src/slurmctld/sched_plugin.c | 56 +- src/slurmctld/sched_plugin.h | 30 +- src/slurmctld/slurmctld.h | 374 ++-- src/slurmctld/srun_comm.c | 70 +- src/slurmctld/srun_comm.h | 24 +- src/slurmctld/state_save.c | 38 +- src/slurmctld/state_save.h | 28 +- src/slurmctld/step_mgr.c | 422 ++-- src/slurmctld/trigger_mgr.c | 96 +- src/slurmctld/trigger_mgr.h | 24 +- src/slurmd/slurmd/Makefile.am | 4 +- src/slurmd/slurmd/Makefile.in | 4 +- src/slurmd/slurmstepd/Makefile.am | 2 +- src/slurmd/slurmstepd/Makefile.in | 2 +- src/slurmdbd/Makefile.am | 2 +- src/slurmdbd/Makefile.in | 2 +- src/slurmdbd/agent.c | 22 +- src/slurmdbd/agent.h | 24 +- src/slurmdbd/backup.c | 40 +- src/slurmdbd/backup.h | 26 +- src/slurmdbd/proc_req.c | 860 ++++---- src/slurmdbd/proc_req.h | 26 +- src/slurmdbd/read_config.c | 90 +- src/slurmdbd/read_config.h | 36 +- src/slurmdbd/rpc_mgr.c | 54 +- src/slurmdbd/rpc_mgr.h | 24 +- src/slurmdbd/slurmdbd.c | 78 +- src/slurmdbd/slurmdbd.h | 24 +- src/smap/Makefile.am | 6 +- src/smap/Makefile.in | 6 +- src/smap/configure_functions.c | 452 ++-- src/smap/grid_functions.c | 84 +- src/smap/job_functions.c | 122 +- src/smap/opts.c | 18 +- src/smap/partition_functions.c | 318 +-- src/smap/reservation_functions.c | 44 +- src/smap/smap.c | 114 +- src/smap/smap.h | 16 +- src/sprio/opts.c | 20 +- src/sprio/print.c | 4 +- src/sprio/print.h | 24 +- src/sprio/sprio.c | 24 +- src/sprio/sprio.h | 16 +- src/squeue/print.c | 194 +- src/squeue/print.h | 96 +- src/squeue/sort.c | 26 +- src/squeue/squeue.c | 58 +- src/squeue/squeue.h | 16 +- src/sreport/assoc_reports.c | 22 +- src/sreport/assoc_reports.h | 22 +- src/sreport/cluster_reports.c | 356 ++-- src/sreport/cluster_reports.h | 22 +- src/sreport/common.c | 112 +- src/sreport/job_reports.c | 220 +- src/sreport/job_reports.h | 22 +- src/sreport/resv_reports.c | 114 +- src/sreport/resv_reports.h | 22 +- src/sreport/sreport.c | 148 +- src/sreport/sreport.h | 24 +- src/sreport/user_reports.c | 124 +- src/sreport/user_reports.h | 22 +- src/srun/Makefile.am | 6 +- src/srun/Makefile.in | 6 +- src/srun/allocate.c | 92 +- src/srun/allocate.h | 28 +- src/srun/core-format.c | 32 +- src/srun/core-format.h | 24 +- src/srun/debugger.c | 28 +- src/srun/debugger.h | 14 +- src/srun/fname.c | 30 +- src/srun/fname.h | 26 +- src/srun/multi_prog.c | 38 +- src/srun/multi_prog.h | 16 +- src/srun/opt.c | 204 +- src/srun/opt.h | 38 +- src/srun/srun.c | 96 +- src/srun/srun.h | 8 +- src/srun/srun.wrapper.c | 4 +- src/srun/srun_job.c | 78 +- src/srun/srun_job.h | 26 +- src/srun/srun_pty.c | 24 +- src/srun/srun_pty.h | 22 +- src/srun_cr/srun_cr.c | 70 +- src/sshare/Makefile.am | 2 +- src/sshare/Makefile.in | 2 +- src/sshare/process.c | 48 +- src/sshare/sshare.c | 78 +- src/sshare/sshare.h | 22 +- src/sstat/Makefile.am | 2 +- src/sstat/Makefile.in | 2 +- src/sstat/options.c | 62 +- src/sstat/print.c | 50 +- src/sstat/process.c | 34 +- src/sstat/sstat.c | 110 +- src/sstat/sstat.h | 22 +- src/strigger/opts.c | 20 +- src/strigger/strigger.c | 54 +- src/strigger/strigger.h | 16 +- src/sview/Makefile.am | 2 +- src/sview/Makefile.in | 2 +- src/sview/admin_info.c | 34 +- src/sview/block_info.c | 368 ++-- src/sview/common.c | 424 ++-- src/sview/grid.c | 220 +- src/sview/job_info.c | 1232 +++++------ src/sview/node_info.c | 384 ++-- src/sview/part_info.c | 644 +++--- src/sview/popups.c | 154 +- src/sview/resv_info.c | 362 ++-- src/sview/submit_info.c | 32 +- src/sview/sview.c | 248 +-- src/sview/sview.h | 48 +- testsuite/expect/README | 152 +- testsuite/expect/globals | 98 +- testsuite/expect/globals_accounting | 26 +- testsuite/expect/mpi-testscripts/allred.c | 684 +++--- .../expect/mpi-testscripts/alltoall_timed.c | 2 +- testsuite/expect/pkill | 12 +- testsuite/expect/regression | 18 +- testsuite/expect/regression.py | 8 +- testsuite/expect/test1.1 | 14 +- testsuite/expect/test1.10 | 8 +- testsuite/expect/test1.11 | 12 +- testsuite/expect/test1.12 | 12 +- testsuite/expect/test1.13 | 10 +- testsuite/expect/test1.14 | 8 +- testsuite/expect/test1.15 | 8 +- testsuite/expect/test1.16 | 10 +- testsuite/expect/test1.17 | 8 +- testsuite/expect/test1.18 | 8 +- testsuite/expect/test1.19 | 12 +- testsuite/expect/test1.2 | 10 +- testsuite/expect/test1.20 | 10 +- testsuite/expect/test1.21 | 8 +- testsuite/expect/test1.22 | 14 +- testsuite/expect/test1.23 | 30 +- testsuite/expect/test1.24 | 12 +- testsuite/expect/test1.25 | 10 +- testsuite/expect/test1.26 | 18 +- testsuite/expect/test1.27 | 8 +- testsuite/expect/test1.28 | 8 +- testsuite/expect/test1.29 | 12 +- testsuite/expect/test1.29.prog.c | 14 +- testsuite/expect/test1.3 | 8 +- testsuite/expect/test1.30 | 8 +- testsuite/expect/test1.31 | 12 +- testsuite/expect/test1.32 | 14 +- testsuite/expect/test1.32.prog.c | 12 +- testsuite/expect/test1.33 | 8 +- testsuite/expect/test1.34 | 8 +- testsuite/expect/test1.34.prog.c | 8 +- testsuite/expect/test1.35 | 8 +- testsuite/expect/test1.36 | 8 +- testsuite/expect/test1.37 | 8 +- testsuite/expect/test1.38 | 10 +- testsuite/expect/test1.39 | 10 +- testsuite/expect/test1.39.prog.c | 12 +- testsuite/expect/test1.4 | 8 +- testsuite/expect/test1.40 | 8 +- testsuite/expect/test1.41 | 10 +- testsuite/expect/test1.42 | 8 +- testsuite/expect/test1.43 | 8 +- testsuite/expect/test1.44 | 8 +- testsuite/expect/test1.45 | 8 +- testsuite/expect/test1.46 | 8 +- testsuite/expect/test1.47 | 8 +- testsuite/expect/test1.48 | 10 +- testsuite/expect/test1.49 | 16 +- testsuite/expect/test1.5 | 8 +- testsuite/expect/test1.50 | 8 +- testsuite/expect/test1.51 | 8 +- testsuite/expect/test1.52 | 12 +- testsuite/expect/test1.53 | 8 +- testsuite/expect/test1.53.prog.c | 2 +- testsuite/expect/test1.54 | 12 +- testsuite/expect/test1.55 | 8 +- testsuite/expect/test1.56 | 8 +- testsuite/expect/test1.57 | 10 +- testsuite/expect/test1.58 | 8 +- testsuite/expect/test1.59 | 32 +- testsuite/expect/test1.6 | 8 +- testsuite/expect/test1.60 | 8 +- testsuite/expect/test1.61 | 8 +- testsuite/expect/test1.7 | 22 +- testsuite/expect/test1.8 | 12 +- testsuite/expect/test1.80 | 12 +- testsuite/expect/test1.81 | 40 +- testsuite/expect/test1.82 | 48 +- testsuite/expect/test1.83 | 22 +- testsuite/expect/test1.84 | 20 +- testsuite/expect/test1.86 | 26 +- testsuite/expect/test1.87 | 24 +- testsuite/expect/test1.88 | 10 +- testsuite/expect/test1.88.prog.c | 10 +- testsuite/expect/test1.89 | 10 +- testsuite/expect/test1.89.prog.c | 6 +- testsuite/expect/test1.9 | 8 +- testsuite/expect/test1.90 | 10 +- testsuite/expect/test1.90.prog.c | 2 +- testsuite/expect/test1.91 | 10 +- testsuite/expect/test1.91.prog.c | 6 +- testsuite/expect/test1.92 | 10 +- testsuite/expect/test1.93 | 10 +- testsuite/expect/test10.1 | 10 +- testsuite/expect/test10.10 | 20 +- testsuite/expect/test10.11 | 8 +- testsuite/expect/test10.12 | 12 +- testsuite/expect/test10.13 | 22 +- testsuite/expect/test10.2 | 10 +- testsuite/expect/test10.3 | 16 +- testsuite/expect/test10.4 | 16 +- testsuite/expect/test10.5 | 16 +- testsuite/expect/test10.6 | 14 +- testsuite/expect/test10.7 | 16 +- testsuite/expect/test10.8 | 16 +- testsuite/expect/test10.9 | 14 +- testsuite/expect/test11.1 | 12 +- testsuite/expect/test11.2 | 22 +- testsuite/expect/test11.3 | 18 +- testsuite/expect/test11.4 | 12 +- testsuite/expect/test11.5 | 8 +- testsuite/expect/test11.6 | 12 +- testsuite/expect/test11.7 | 12 +- testsuite/expect/test12.1 | 10 +- testsuite/expect/test12.2 | 12 +- testsuite/expect/test12.2.prog.c | 14 +- testsuite/expect/test12.4 | 8 +- testsuite/expect/test12.5 | 8 +- testsuite/expect/test13.1 | 10 +- testsuite/expect/test14.1 | 12 +- testsuite/expect/test14.2 | 12 +- testsuite/expect/test14.3 | 10 +- testsuite/expect/test14.4 | 10 +- testsuite/expect/test14.5 | 8 +- testsuite/expect/test14.6 | 8 +- testsuite/expect/test14.7 | 8 +- testsuite/expect/test14.8 | 10 +- testsuite/expect/test15.1 | 12 +- testsuite/expect/test15.10 | 12 +- testsuite/expect/test15.11 | 8 +- testsuite/expect/test15.12 | 12 +- testsuite/expect/test15.13 | 8 +- testsuite/expect/test15.14 | 8 +- testsuite/expect/test15.15 | 10 +- testsuite/expect/test15.16 | 8 +- testsuite/expect/test15.17 | 8 +- testsuite/expect/test15.18 | 8 +- testsuite/expect/test15.19 | 38 +- testsuite/expect/test15.2 | 12 +- testsuite/expect/test15.20 | 46 +- testsuite/expect/test15.21 | 22 +- testsuite/expect/test15.22 | 16 +- testsuite/expect/test15.23 | 10 +- testsuite/expect/test15.24 | 8 +- testsuite/expect/test15.25 | 8 +- testsuite/expect/test15.3 | 10 +- testsuite/expect/test15.4 | 12 +- testsuite/expect/test15.5 | 24 +- testsuite/expect/test15.6 | 10 +- testsuite/expect/test15.7 | 12 +- testsuite/expect/test15.8 | 10 +- testsuite/expect/test15.9 | 8 +- testsuite/expect/test16.1 | 12 +- testsuite/expect/test16.2 | 12 +- testsuite/expect/test16.3 | 10 +- testsuite/expect/test16.4 | 10 +- testsuite/expect/test16.4.prog.c | 10 +- testsuite/expect/test17.1 | 12 +- testsuite/expect/test17.10 | 12 +- testsuite/expect/test17.11 | 10 +- testsuite/expect/test17.12 | 12 +- testsuite/expect/test17.13 | 8 +- testsuite/expect/test17.14 | 8 +- testsuite/expect/test17.15 | 12 +- testsuite/expect/test17.15.prog.c | 14 +- testsuite/expect/test17.16 | 8 +- testsuite/expect/test17.17 | 16 +- testsuite/expect/test17.18 | 10 +- testsuite/expect/test17.2 | 12 +- testsuite/expect/test17.20 | 12 +- testsuite/expect/test17.21 | 10 +- testsuite/expect/test17.22 | 8 +- testsuite/expect/test17.23 | 8 +- testsuite/expect/test17.24 | 10 +- testsuite/expect/test17.25 | 10 +- testsuite/expect/test17.26 | 8 +- testsuite/expect/test17.27 | 42 +- testsuite/expect/test17.28 | 12 +- testsuite/expect/test17.29 | 8 +- testsuite/expect/test17.3 | 10 +- testsuite/expect/test17.31 | 12 +- testsuite/expect/test17.32 | 8 +- testsuite/expect/test17.33 | 8 +- testsuite/expect/test17.4 | 16 +- testsuite/expect/test17.5 | 16 +- testsuite/expect/test17.6 | 8 +- testsuite/expect/test17.7 | 8 +- testsuite/expect/test17.8 | 8 +- testsuite/expect/test17.9 | 8 +- testsuite/expect/test19.1 | 10 +- testsuite/expect/test19.2 | 10 +- testsuite/expect/test19.3 | 8 +- testsuite/expect/test19.4 | 8 +- testsuite/expect/test19.5 | 14 +- testsuite/expect/test19.6 | 10 +- testsuite/expect/test19.7 | 10 +- testsuite/expect/test2.1 | 12 +- testsuite/expect/test2.10 | 8 +- testsuite/expect/test2.11 | 8 +- testsuite/expect/test2.12 | 10 +- testsuite/expect/test2.2 | 12 +- testsuite/expect/test2.3 | 12 +- testsuite/expect/test2.4 | 18 +- testsuite/expect/test2.5 | 10 +- testsuite/expect/test2.6 | 8 +- testsuite/expect/test2.7 | 8 +- testsuite/expect/test2.8 | 8 +- testsuite/expect/test2.9 | 12 +- testsuite/expect/test20.1 | 8 +- testsuite/expect/test20.2 | 8 +- testsuite/expect/test20.3 | 8 +- testsuite/expect/test20.4 | 8 +- testsuite/expect/test21.1 | 8 +- testsuite/expect/test21.10 | 8 +- testsuite/expect/test21.11 | 10 +- testsuite/expect/test21.12 | 10 +- testsuite/expect/test21.13 | 18 +- testsuite/expect/test21.14 | 22 +- testsuite/expect/test21.15 | 10 +- testsuite/expect/test21.16 | 10 +- testsuite/expect/test21.17 | 14 +- testsuite/expect/test21.18 | 22 +- testsuite/expect/test21.19 | 14 +- testsuite/expect/test21.2 | 10 +- testsuite/expect/test21.20 | 10 +- testsuite/expect/test21.21 | 8 +- testsuite/expect/test21.22 | 14 +- testsuite/expect/test21.23 | 8 +- testsuite/expect/test21.24 | 14 +- testsuite/expect/test21.25 | 8 +- testsuite/expect/test21.26 | 12 +- testsuite/expect/test21.3 | 10 +- testsuite/expect/test21.4 | 10 +- testsuite/expect/test21.5 | 8 +- testsuite/expect/test21.6 | 8 +- testsuite/expect/test21.7 | 8 +- testsuite/expect/test21.8 | 10 +- testsuite/expect/test21.9 | 10 +- testsuite/expect/test22.1 | 54 +- testsuite/expect/test22.2 | 10 +- testsuite/expect/test23.1 | 16 +- testsuite/expect/test23.2 | 10 +- testsuite/expect/test23.3 | 40 +- testsuite/expect/test24.1 | 18 +- testsuite/expect/test24.1.prog.c | 18 +- testsuite/expect/test24.2 | 12 +- testsuite/expect/test25.1 | 46 +- testsuite/expect/test3.1 | 10 +- testsuite/expect/test3.10 | 10 +- testsuite/expect/test3.11 | 14 +- testsuite/expect/test3.2 | 18 +- testsuite/expect/test3.3 | 14 +- testsuite/expect/test3.4 | 10 +- testsuite/expect/test3.5 | 8 +- testsuite/expect/test3.6 | 14 +- testsuite/expect/test3.7 | 12 +- testsuite/expect/test3.7.prog.c | 8 +- testsuite/expect/test3.8 | 16 +- testsuite/expect/test3.9 | 8 +- testsuite/expect/test4.1 | 12 +- testsuite/expect/test4.10 | 8 +- testsuite/expect/test4.11 | 10 +- testsuite/expect/test4.12 | 56 +- testsuite/expect/test4.2 | 12 +- testsuite/expect/test4.3 | 30 +- testsuite/expect/test4.4 | 16 +- testsuite/expect/test4.5 | 16 +- testsuite/expect/test4.6 | 10 +- testsuite/expect/test4.7 | 12 +- testsuite/expect/test4.8 | 22 +- testsuite/expect/test4.9 | 10 +- testsuite/expect/test5.1 | 12 +- testsuite/expect/test5.2 | 12 +- testsuite/expect/test5.3 | 10 +- testsuite/expect/test5.4 | 14 +- testsuite/expect/test5.5 | 8 +- testsuite/expect/test5.6 | 22 +- testsuite/expect/test5.7 | 14 +- testsuite/expect/test5.8 | 8 +- testsuite/expect/test6.1 | 12 +- testsuite/expect/test6.10 | 12 +- testsuite/expect/test6.11 | 8 +- testsuite/expect/test6.12 | 14 +- testsuite/expect/test6.13 | 10 +- testsuite/expect/test6.13.prog.c | 4 +- testsuite/expect/test6.14 | 14 +- testsuite/expect/test6.2 | 12 +- testsuite/expect/test6.3 | 8 +- testsuite/expect/test6.4 | 8 +- testsuite/expect/test6.5 | 8 +- testsuite/expect/test6.6 | 12 +- testsuite/expect/test6.7 | 10 +- testsuite/expect/test6.7.prog.c | 4 +- testsuite/expect/test6.8 | 10 +- testsuite/expect/test6.9 | 10 +- testsuite/expect/test7.1 | 10 +- testsuite/expect/test7.10 | 8 +- testsuite/expect/test7.11 | 20 +- testsuite/expect/test7.11.prog.c | 16 +- testsuite/expect/test7.2 | 12 +- testsuite/expect/test7.2.prog.c | 64 +- testsuite/expect/test7.3 | 10 +- testsuite/expect/test7.3.io.c | 10 +- testsuite/expect/test7.3.prog.c | 14 +- testsuite/expect/test7.4 | 10 +- testsuite/expect/test7.4.prog.c | 10 +- testsuite/expect/test7.5 | 14 +- testsuite/expect/test7.5.prog.c | 12 +- testsuite/expect/test7.6 | 10 +- testsuite/expect/test7.6.prog.c | 10 +- testsuite/expect/test7.7 | 8 +- testsuite/expect/test7.7.crypto.c | 14 +- testsuite/expect/test7.7.prog.c | 24 +- testsuite/expect/test7.8 | 8 +- testsuite/expect/test7.8.prog.c | 24 +- testsuite/expect/test7.9 | 12 +- testsuite/expect/test7.9.prog.c | 12 +- testsuite/expect/test8.1 | 10 +- testsuite/expect/test8.2 | 8 +- testsuite/expect/test8.3 | 10 +- testsuite/expect/test8.4 | 10 +- testsuite/expect/test8.4.prog.c | 10 +- testsuite/expect/test8.5 | 14 +- testsuite/expect/test8.6 | 46 +- testsuite/expect/test8.7 | 8 +- testsuite/expect/test8.7.crypto.c | 14 +- testsuite/expect/test8.7.prog.c | 20 +- testsuite/expect/test8.8 | 46 +- testsuite/expect/test9.1 | 12 +- testsuite/expect/test9.2 | 14 +- testsuite/expect/test9.3 | 14 +- testsuite/expect/test9.4 | 20 +- testsuite/expect/test9.5 | 14 +- testsuite/expect/test9.6 | 12 +- testsuite/expect/test9.7 | 10 +- testsuite/expect/test9.7.bash | 12 +- testsuite/expect/test9.8 | 24 +- testsuite/expect/usleep | 12 +- 1012 files changed, 27774 insertions(+), 27777 deletions(-) diff --git a/config.h.in b/config.h.in index 7863bfd72b..a5c48d13f2 100644 --- a/config.h.in +++ b/config.h.in @@ -308,9 +308,6 @@ /* Define to 1 if using XCPU for job launch */ #undef HAVE_XCPU -/* Define to 1 if you have the `\' function. */ -#undef HAVE__ - /* Define if you have __progname. */ #undef HAVE__PROGNAME diff --git a/configure.ac b/configure.ac index 92e6af6b43..46c4c7107f 100644 --- a/configure.ac +++ b/configure.ac @@ -37,11 +37,11 @@ dnl Check to see if this architecture should use slurm_* prefix function dnl aliases for plugins. dnl case "$host" in - *-*-aix*) AC_DEFINE(USE_ALIAS, 0, + *-*-aix*) AC_DEFINE(USE_ALIAS, 0, [Define slurm_ prefix function aliases for plusins]) ;; *darwin*) AC_DEFINE(USE_ALIAS, 0, [Define slurm_ prefix function aliases for plusins]) ;; - *) AC_DEFINE(USE_ALIAS, 1, + *) AC_DEFINE(USE_ALIAS, 1, [Define slurm_ prefix function aliases for plugins]) ;; esac @@ -141,7 +141,7 @@ AC_CHECK_FUNCS( \ mtrace \ strndup \ strlcpy \ - strsignal \ + strsignal \ inet_aton \ inet_ntop \ inet_pton \ @@ -243,10 +243,10 @@ dnl X_AC_PRINTF_NULL dnl Check for whether to include readline support -dnl +dnl X_AC_READLINE -dnl +dnl dnl X_AC_SLURM_WITH_SSL AM_CONDITIONAL(HAVE_OPENSSL, test "x$ac_have_openssl" = "xyes") @@ -309,7 +309,7 @@ X_AC_BLCR dnl All slurm Makefiles: AC_CONFIG_FILES([Makefile - config.xml + config.xml auxdir/Makefile contribs/Makefile contribs/pam/Makefile @@ -319,8 +319,8 @@ AC_CONFIG_FILES([Makefile contribs/phpext/Makefile contribs/phpext/slurm_php/config.m4 contribs/slurmdb-direct/Makefile - src/Makefile - src/api/Makefile + src/Makefile + src/api/Makefile src/common/Makefile src/database/Makefile src/sacct/Makefile @@ -328,18 +328,18 @@ AC_CONFIG_FILES([Makefile src/sreport/Makefile src/sstat/Makefile src/sshare/Makefile - src/salloc/Makefile - src/sbatch/Makefile + src/salloc/Makefile + src/sbatch/Makefile src/sattach/Makefile src/sprio/Makefile - src/srun/Makefile - src/srun_cr/Makefile - src/slurmd/Makefile - src/slurmd/slurmd/Makefile - src/slurmd/slurmstepd/Makefile + src/srun/Makefile + src/srun_cr/Makefile + src/slurmd/Makefile + src/slurmd/slurmd/Makefile + src/slurmd/slurmstepd/Makefile src/slurmdbd/Makefile src/slurmctld/Makefile - src/sbcast/Makefile + src/sbcast/Makefile src/scontrol/Makefile src/scancel/Makefile src/squeue/Makefile diff --git a/contribs/perlapi/libslurm-perl/Slurm.xs b/contribs/perlapi/libslurm-perl/Slurm.xs index 62625ee815..724ad4b0c7 100644 --- a/contribs/perlapi/libslurm-perl/Slurm.xs +++ b/contribs/perlapi/libslurm-perl/Slurm.xs @@ -11,7 +11,7 @@ #include "msg.h" #include "const-c.inc" - + /* these declaration are not in slurm.h */ extern void slurm_api_set_conf_file(char *pathname); extern void slurm_api_clear_config(void); @@ -31,7 +31,7 @@ typedef struct slurm * slurm_t; static struct slurm slurm; #define SINGLETON (&slurm) -static void +static void free_slurm(void) { if(slurm.node_info_msg) { @@ -61,19 +61,19 @@ static signo_t signame_to_no(char* signame) { int i = 0; - struct { - char * name; + struct { + char * name; signo_t no; } map [] = { - {"SIGHUP", SIGHUP}, {"SIGINT", SIGINT}, {"SIGQUIT", SIGQUIT}, {"SIGILL", SIGILL}, {"SIGTRAP", SIGTRAP}, - {"SIGABRT", SIGABRT}, {"SIGBUS", SIGBUS}, {"SIGFPE", SIGFPE}, {"SIGKILL", SIGKILL}, {"SIGUSR1", SIGUSR1}, - {"SIGSEGV", SIGSEGV}, {"SIGUSR2", SIGUSR2}, {"SIGPIPE", SIGPIPE}, {"SIGALRM", SIGALRM}, {"SIGTERM", SIGTERM}, - {"SIGCHLD", SIGCHLD}, {"SIGCONT", SIGCONT}, {"SIGSTOP", SIGSTOP}, {"SIGTSTP", SIGTSTP}, {"SIGTTIN", SIGTTIN}, - {"SIGTTOU", SIGTTOU}, {"SIGURG", SIGURG}, {"SIGXCPU", SIGXCPU}, {"SIGXFSZ", SIGXFSZ}, {"SIGVTALRM", SIGVTALRM}, - {"SIGPROF", SIGPROF}, {"SIGWINCH", SIGWINCH}, {"SIGIO", SIGIO}, {"SIGPWR", SIGPWR}, {"SIGSYS", SIGSYS}, + {"SIGHUP", SIGHUP}, {"SIGINT", SIGINT}, {"SIGQUIT", SIGQUIT}, {"SIGILL", SIGILL}, {"SIGTRAP", SIGTRAP}, + {"SIGABRT", SIGABRT}, {"SIGBUS", SIGBUS}, {"SIGFPE", SIGFPE}, {"SIGKILL", SIGKILL}, {"SIGUSR1", SIGUSR1}, + {"SIGSEGV", SIGSEGV}, {"SIGUSR2", SIGUSR2}, {"SIGPIPE", SIGPIPE}, {"SIGALRM", SIGALRM}, {"SIGTERM", SIGTERM}, + {"SIGCHLD", SIGCHLD}, {"SIGCONT", SIGCONT}, {"SIGSTOP", SIGSTOP}, {"SIGTSTP", SIGTSTP}, {"SIGTTIN", SIGTTIN}, + {"SIGTTOU", SIGTTOU}, {"SIGURG", SIGURG}, {"SIGXCPU", SIGXCPU}, {"SIGXFSZ", SIGXFSZ}, {"SIGVTALRM", SIGVTALRM}, + {"SIGPROF", SIGPROF}, {"SIGWINCH", SIGWINCH}, {"SIGIO", SIGIO}, {"SIGPWR", SIGPWR}, {"SIGSYS", SIGSYS}, {NULL, 0} }; - + for( i = 0; map[i].name != NULL; i ++) { if (strcasecmp (map[i].name, signame) == 0) return map[i].no; @@ -132,7 +132,7 @@ PROTOTYPES: ENABLE ###################################################################### # MISC FUNCTIONS ###################################################################### -slurm_t +slurm_t get_slurm(slurm_t self = NULL, char *conf_file=NULL) slurm_t RETVAL = NULL; CODE: @@ -207,7 +207,7 @@ slurm_allocate_resources_blocking(slurm_t self, HV* job_req = NULL, time_t timeo XSRETURN_UNDEF; } sarb_cb_sv = callback; - resp_msg = slurm_allocate_resources_blocking(&job_desc_msg, timeout, + resp_msg = slurm_allocate_resources_blocking(&job_desc_msg, timeout, callback == NULL ? NULL : sarb_cb); free_job_desc_msg_memory(&job_desc_msg); if (resp_msg != NULL) { @@ -297,7 +297,7 @@ slurm_submit_batch_job(slurm_t self, HV* job_req = NULL) slurm_free_submit_response_response_msg(resp_msg); OUTPUT: RETVAL - + int slurm_job_will_run(slurm_t self, HV* job_req = NULL) PREINIT: @@ -328,7 +328,7 @@ int slurm_signal_job(slurm_t self, U32 jobid, signo_t signal = 0) C_ARGS: jobid, signal - + int slurm_signal_job_step(slurm_t self, U32 jobid, U32 stepid, signo_t signal = 0) C_ARGS: @@ -417,7 +417,7 @@ slurm_load_jobs(slurm_t self = NULL, U16 show_flags = 0) OUTPUT: RETVAL -# To be implemented in perl code +# To be implemented in perl code #slurm_print_job_info_msg() #slurm_print_job_info() #slurm_sprint_job_info() @@ -435,12 +435,12 @@ slurm_get_end_time(slurm_t self, U32 jobid) RETVAL = end_time; OUTPUT: RETVAL - + long slurm_get_rem_time(slurm_t self, U32 jobid) C_ARGS: jobid - + U32 slurm_pid2jobid(slurm_t self, U32 pid) PREINIT: @@ -503,7 +503,7 @@ slurm_get_job_steps(slurm_t self = NULL, U16 show_flags = 0, U32 jobid = 0, U32 # slurm_print_job_step_info_response_msg # slurm_print_job_step_info_msg # slurm_sprint_job_step_info - + HV* slurm_job_step_layout_get(slurm_t self, U32 jobid, U32 stepid) PREINIT: @@ -520,9 +520,9 @@ slurm_job_step_layout_get(slurm_t self, U32 jobid, U32 stepid) } OUTPUT: RETVAL - - + + ###################################################################### # SLURM NODE CONFIGURATION READ/PRINT/UPDATE FUNCTIONS ###################################################################### @@ -562,7 +562,7 @@ slurm_update_node(slurm_t self, HV* update_req = NULL) } C_ARGS: &node_msg - + ###################################################################### # SLURM PARTITION CONFIGURATION READ/PRINT/UPDATE FUNCTIONS ###################################################################### @@ -602,7 +602,7 @@ slurm_update_partition(slurm_t self, HV* part_info = NULL) } C_ARGS: &update_msg - + int slurm_delete_partition(slurm_t self, char* part_name) PREINIT: @@ -625,7 +625,7 @@ slurm_ping(slurm_t self, U16 primary = 1) int slurm_reconfigure(slurm_t self) C_ARGS: - + int slurm_shutdown(slurm_t self, U16 core = 0) C_ARGS: @@ -753,7 +753,7 @@ int slurm_hostlist_count(hostlist_t hl = NULL) OUTPUT: RETVAL - + hostlist_t slurm_hostlist_create(char* hostlist) @@ -787,7 +787,7 @@ slurm_hostlist_ranged_string(hostlist_t hl = NULL) RETVAL char* -slurm_hostlist_shift(hostlist_t hl = NULL) +slurm_hostlist_shift(hostlist_t hl = NULL) PREINIT: char *host = NULL; CODE: diff --git a/contribs/phpext/Makefile.am b/contribs/phpext/Makefile.am index 365ea0c5e3..f9ee92ce60 100644 --- a/contribs/phpext/Makefile.am +++ b/contribs/phpext/Makefile.am @@ -20,7 +20,7 @@ all-local: fi \ fi && \ $(MAKE) $(add_flags); \ - cd ..; + cd ..; install-exec-local: @cd $(php_dir) && \ diff --git a/contribs/phpext/Makefile.in b/contribs/phpext/Makefile.in index 5457b7a1e3..36919bcf69 100644 --- a/contribs/phpext/Makefile.in +++ b/contribs/phpext/Makefile.in @@ -461,7 +461,7 @@ all-local: fi \ fi && \ $(MAKE) $(add_flags); \ - cd ..; + cd ..; install-exec-local: @cd $(php_dir) && \ diff --git a/contribs/slurmdb-direct/moab_2_slurmdb.pl b/contribs/slurmdb-direct/moab_2_slurmdb.pl index 5ebd5c33bf..8d98dee89e 100755 --- a/contribs/slurmdb-direct/moab_2_slurmdb.pl +++ b/contribs/slurmdb-direct/moab_2_slurmdb.pl @@ -12,35 +12,35 @@ # Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). # Written by Danny Auble # CODE-OCEC-09-009. All rights reserved. -# +# # This file is part of SLURM, a resource management program. # For details, see . -# +# # SLURM is free software; you can redistribute it and/or modify it under # the terms of the GNU General Public License as published by the Free # Software Foundation; either version 2 of the License, or (at your option) # any later version. # -# In addition, as a special exception, the copyright holders give permission +# In addition, as a special exception, the copyright holders give permission # to link the code of portions of this program with the OpenSSL library under -# certain conditions as described in each individual source file, and -# distribute linked combinations including the two. You must obey the GNU -# General Public License in all respects for all of the code used other than -# OpenSSL. If you modify file(s) with this exception, you may extend this -# exception to your version of the file(s), but you are not obligated to do +# certain conditions as described in each individual source file, and +# distribute linked combinations including the two. You must obey the GNU +# General Public License in all respects for all of the code used other than +# OpenSSL. If you modify file(s) with this exception, you may extend this +# exception to your version of the file(s), but you are not obligated to do # so. If you do not wish to do so, delete this exception statement from your -# version. If you delete this exception statement from all source files in +# version. If you delete this exception statement from all source files in # the program, then also delete it here. -# +# # SLURM is distributed in the hope that it will be useful, but WITHOUT ANY # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more # details. -# +# # You should have received a copy of the GNU General Public License along # with SLURM; if not, write to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -# +# ############################################################################### use strict; @@ -148,21 +148,21 @@ foreach my $line () { my $gid = getgrnam($group); $uid = -2 if !$uid; $gid = -2 if !$gid; - - # figure out the wckey + + # figure out the wckey my $wckey = ""; if ($rm_ext =~ /wckey:(\w*)/) { $wckey = $1; } - + if($partition =~ /\[(\w*)/) { $partition = $1; } - # Only pick out a number at the beginning if it is something else - # we should skip it and make comp_code 0. If we want something - # else just change it to whatever you would think would be best. - # Dispite the Moab documentation the comp code could contain + # Only pick out a number at the beginning if it is something else + # we should skip it and make comp_code 0. If we want something + # else just change it to whatever you would think would be best. + # Dispite the Moab documentation the comp code could contain # characters like ,SID= afterwards, without knowing what that means # we just skip it. We haven't seen a case where comp_code isn't an # int at the first so the 0 "should" never happen. @@ -184,7 +184,7 @@ foreach my $line () { $cluster = ""; } } - + if($message =~ /job\\20exceeded\\20wallclock\\20limit/) { $event = "JOBTIMEOUT"; } @@ -194,25 +194,25 @@ foreach my $line () { Slurm::Hostlist::uniq($alloc_hl); $alloc_hl = Slurm::Hostlist::ranged_string($alloc_hl); } - + if($event eq "JOBSUBMIT") { $submit_sql .= ", " if $submit_set; $submit_sql .= "($id, 0, 0, 0, 0, $uid, $gid, \"$cluster\", " . "\"$account\", \"$partition\", \"$wckey\", " . "\"$executable\", 0, $req_tasks, $submit_time)"; - $submit_set = 1; - $set = 1; + $submit_set = 1; + $set = 1; } elsif ($event eq "JOBMIGRATE") { $migrate_sql .= ", " if $migrate_set; - # here for some reason the eligible time is really the - # elgible time, so we use the end time which appears + # here for some reason the eligible time is really the + # elgible time, so we use the end time which appears # to be the best guess. $migrate_sql .= "($id, 0, 0, 0, 0, $uid, $gid, \"$cluster\", " . "\"$account\", \"$partition\", \"$wckey\", " . "\"$executable\", 0, $req_tasks, $submit_time, " . "$end_time)"; - $migrate_set = 1; - $set = 1; + $migrate_set = 1; + $set = 1; } elsif ($event eq "JOBSTART") { $start_sql .= ", " if $start_set; @@ -223,8 +223,8 @@ foreach my $line () { "\"$executable\", 1, $req_tasks, $submit_time, " . "$eligible_time, $start_time, \"$alloc_hl\", " . "$req_tasks)"; - $start_set = 1; - $set = 1; + $start_set = 1; + $set = 1; } elsif (($event eq "JOBEND") || ($event eq "JOBCANCEL") || ($event eq "JOBFAILURE") || ($event eq "JOBTIMEOUT")) { if($event eq "JOBEND") { @@ -243,8 +243,8 @@ foreach my $line () { "\"$executable\", $state, $req_tasks, $submit_time, " . "$eligible_time, $start_time, \"$alloc_hl\", " . "$req_tasks, $end_time, $comp_code)"; - $end_set = 1; - $set = 1; + $end_set = 1; + $set = 1; } else { print "ERROR: unknown event of $event\n"; next; diff --git a/contribs/torque/mpiexec.pl b/contribs/torque/mpiexec.pl index badbd43d97..9724a5316d 100755 --- a/contribs/torque/mpiexec.pl +++ b/contribs/torque/mpiexec.pl @@ -9,36 +9,36 @@ # Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). # Written by Danny Auble . # CODE-OCEC-09-009. All rights reserved. -# +# # This file is part of SLURM, a resource management program. # For details, see . # Please also read the included file: DISCLAIMER. -# +# # SLURM is free software; you can redistribute it and/or modify it under # the terms of the GNU General Public License as published by the Free # Software Foundation; either version 2 of the License, or (at your option) # any later version. # -# In addition, as a special exception, the copyright holders give permission +# In addition, as a special exception, the copyright holders give permission # to link the code of portions of this program with the OpenSSL library under -# certain conditions as described in each individual source file, and -# distribute linked combinations including the two. You must obey the GNU -# General Public License in all respects for all of the code used other than -# OpenSSL. If you modify file(s) with this exception, you may extend this -# exception to your version of the file(s), but you are not obligated to do +# certain conditions as described in each individual source file, and +# distribute linked combinations including the two. You must obey the GNU +# General Public License in all respects for all of the code used other than +# OpenSSL. If you modify file(s) with this exception, you may extend this +# exception to your version of the file(s), but you are not obligated to do # so. If you do not wish to do so, delete this exception statement from your -# version. If you delete this exception statement from all source files in +# version. If you delete this exception statement from all source files in # the program, then also delete it here. -# +# # SLURM is distributed in the hope that it will be useful, but WITHOUT ANY # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more # details. -# +# # You should have received a copy of the GNU General Public License along # with SLURM; if not, write to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -# +# ############################################################################### use strict; @@ -65,7 +65,7 @@ sub get_new_config() { die "$config_file doesn't exsist!"; open FILE, ">$new_config" or die "Can't open $new_config"; - + foreach my $line () { my @parts = split(/\:/, $line); if(!$parts[0] || !$parts[1] @@ -79,13 +79,13 @@ sub get_new_config() { $task_cnt = $end_cnt+1; } else { print "We don't have support for hostname task layout in a config file right now.\nPlease use srun with the -m arbitrary mode to layout tasks on specific nodes.\n"; - } + } } - + close FILE; close OLD_FILE; - - return ($new_config, $task_cnt); + + return ($new_config, $task_cnt); } @@ -139,8 +139,8 @@ my $new_config; my $command = "$srun"; # write stdout and err to files instead of stdout -$command .= " -o job.o\%j -e job.e\%j" if $nostdout; -$command .= " -inone" if $nostdin; +$command .= " -o job.o\%j -e job.e\%j" if $nostdout; +$command .= " -inone" if $nostdin; $command .= " -i0" if !$allstdin; #default only send stdin to first node $command .= " -n$nprocs" if $nprocs; # number of tasks $command .= " -w$hostname" if $hostname; # Hostlist provided diff --git a/contribs/torque/pbsnodes.pl b/contribs/torque/pbsnodes.pl index 3992f1a64c..d7ac4e815a 100755 --- a/contribs/torque/pbsnodes.pl +++ b/contribs/torque/pbsnodes.pl @@ -9,36 +9,36 @@ # Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). # Written by Danny Auble . # CODE-OCEC-09-009. All rights reserved. -# +# # This file is part of SLURM, a resource management program. # For details, see . # Please also read the included file: DISCLAIMER. -# +# # SLURM is free software; you can redistribute it and/or modify it under # the terms of the GNU General Public License as published by the Free # Software Foundation; either version 2 of the License, or (at your option) # any later version. # -# In addition, as a special exception, the copyright holders give permission +# In addition, as a special exception, the copyright holders give permission # to link the code of portions of this program with the OpenSSL library under -# certain conditions as described in each individual source file, and -# distribute linked combinations including the two. You must obey the GNU -# General Public License in all respects for all of the code used other than -# OpenSSL. If you modify file(s) with this exception, you may extend this -# exception to your version of the file(s), but you are not obligated to do +# certain conditions as described in each individual source file, and +# distribute linked combinations including the two. You must obey the GNU +# General Public License in all respects for all of the code used other than +# OpenSSL. If you modify file(s) with this exception, you may extend this +# exception to your version of the file(s), but you are not obligated to do # so. If you do not wish to do so, delete this exception statement from your -# version. If you delete this exception statement from all source files in +# version. If you delete this exception statement from all source files in # the program, then also delete it here. -# +# # SLURM is distributed in the hope that it will be useful, but WITHOUT ANY # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more # details. -# +# # You should have received a copy of the GNU General Public License along # with SLURM; if not, write to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -# +# # Based off code with permission copyright 2006, 2007 Cluster Resources, Inc. ############################################################################### @@ -90,7 +90,7 @@ Main: die "Problem loading jobs.\n"; } - + foreach my $node (@{$resp->{node_array}}) { my $nodeId = $node->{'name'}; my $rCProc = $node->{'cpus'}; @@ -104,14 +104,14 @@ Main: my $load = $node->{'LOAD'}; my $arch = $node->{'ARCH'}; # - + # Filter nodes according to options and arguments if (@nodeIds) { next unless grep /^$nodeId/, @nodeIds; } - + # Prepare variables - + my @status = (); push @status, "opsys=$os" if $os; push @status, "loadave=" . sprintf("%.2f", $load) if defined $load; diff --git a/contribs/torque/qdel.pl b/contribs/torque/qdel.pl index 49a991cc51..27167d839f 100755 --- a/contribs/torque/qdel.pl +++ b/contribs/torque/qdel.pl @@ -9,36 +9,36 @@ # Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). # Written by Danny Auble . # CODE-OCEC-09-009. All rights reserved. -# +# # This file is part of SLURM, a resource management program. # For details, see . # Please also read the included file: DISCLAIMER. -# +# # SLURM is free software; you can redistribute it and/or modify it under # the terms of the GNU General Public License as published by the Free # Software Foundation; either version 2 of the License, or (at your option) # any later version. # -# In addition, as a special exception, the copyright holders give permission +# In addition, as a special exception, the copyright holders give permission # to link the code of portions of this program with the OpenSSL library under -# certain conditions as described in each individual source file, and -# distribute linked combinations including the two. You must obey the GNU -# General Public License in all respects for all of the code used other than -# OpenSSL. If you modify file(s) with this exception, you may extend this -# exception to your version of the file(s), but you are not obligated to do +# certain conditions as described in each individual source file, and +# distribute linked combinations including the two. You must obey the GNU +# General Public License in all respects for all of the code used other than +# OpenSSL. If you modify file(s) with this exception, you may extend this +# exception to your version of the file(s), but you are not obligated to do # so. If you do not wish to do so, delete this exception statement from your -# version. If you delete this exception statement from all source files in +# version. If you delete this exception statement from all source files in # the program, then also delete it here. -# +# # SLURM is distributed in the hope that it will be useful, but WITHOUT ANY # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more # details. -# +# # You should have received a copy of the GNU General Public License along # with SLURM; if not, write to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -# +# # Based off code with permission copyright 2006, 2007 Cluster Resources, Inc. ############################################################################### @@ -94,7 +94,7 @@ Main: my $resp = 0; for(my $i=0; $i<3; $i++) { $resp = Slurm->kill_job($jobid, SIGKILL); - $err = Slurm->get_errno(); + $err = Slurm->get_errno(); if($resp == SLURM_SUCCESS || ($err ne ESLURM_TRANSITION_STATE_NO_UPDATE && $err ne ESLURM_JOB_PENDING)) { diff --git a/contribs/torque/qhold.pl b/contribs/torque/qhold.pl index 4d3e2d5957..41c61dc945 100755 --- a/contribs/torque/qhold.pl +++ b/contribs/torque/qhold.pl @@ -10,36 +10,36 @@ # Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). # Written by Danny Auble . # CODE-OCEC-09-009. All rights reserved. -# +# # This file is part of SLURM, a resource management program. # For details, see . # Please also read the included file: DISCLAIMER. -# +# # SLURM is free software; you can redistribute it and/or modify it under # the terms of the GNU General Public License as published by the Free # Software Foundation; either version 2 of the License, or (at your option) # any later version. # -# In addition, as a special exception, the copyright holders give permission +# In addition, as a special exception, the copyright holders give permission # to link the code of portions of this program with the OpenSSL library under -# certain conditions as described in each individual source file, and -# distribute linked combinations including the two. You must obey the GNU -# General Public License in all respects for all of the code used other than -# OpenSSL. If you modify file(s) with this exception, you may extend this -# exception to your version of the file(s), but you are not obligated to do +# certain conditions as described in each individual source file, and +# distribute linked combinations including the two. You must obey the GNU +# General Public License in all respects for all of the code used other than +# OpenSSL. If you modify file(s) with this exception, you may extend this +# exception to your version of the file(s), but you are not obligated to do # so. If you do not wish to do so, delete this exception statement from your -# version. If you delete this exception statement from all source files in +# version. If you delete this exception statement from all source files in # the program, then also delete it here. -# +# # SLURM is distributed in the hope that it will be useful, but WITHOUT ANY # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more # details. -# +# # You should have received a copy of the GNU General Public License along # with SLURM; if not, write to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -# +# # Based off code with permission copyright 2006, 2007 Cluster Resources, Inc. ############################################################################### @@ -107,7 +107,7 @@ Main: my $rc = 0; foreach my $jobid (@jobIds) { my $err = 0; - my $resp = 0; + my $resp = 0; my %update = (); $update{job_id} = $jobid; @@ -115,12 +115,12 @@ Main: $update{priority} = 0; $update{comment} = $reason; #doesn't do anything in 1.2 } else { - $update{priority} = -1; + $update{priority} = -1; $update{comment} = "None"; #doesn't do anything in 1.2 } - + if(Slurm->update_job(\%update)) { - $err = Slurm->get_errno(); + $err = Slurm->get_errno(); $rc++; printf("qhold: Error on job id %d: %s\n", $jobid, Slurm->strerror($err)); diff --git a/contribs/torque/qrls.pl b/contribs/torque/qrls.pl index 8d44fef2b7..851df7013e 100755 --- a/contribs/torque/qrls.pl +++ b/contribs/torque/qrls.pl @@ -9,36 +9,36 @@ # Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). # Written by Danny Auble . # CODE-OCEC-09-009. All rights reserved. -# +# # This file is part of SLURM, a resource management program. # For details, see . # Please also read the included file: DISCLAIMER. -# +# # SLURM is free software; you can redistribute it and/or modify it under # the terms of the GNU General Public License as published by the Free # Software Foundation; either version 2 of the License, or (at your option) # any later version. # -# In addition, as a special exception, the copyright holders give permission +# In addition, as a special exception, the copyright holders give permission # to link the code of portions of this program with the OpenSSL library under -# certain conditions as described in each individual source file, and -# distribute linked combinations including the two. You must obey the GNU -# General Public License in all respects for all of the code used other than -# OpenSSL. If you modify file(s) with this exception, you may extend this -# exception to your version of the file(s), but you are not obligated to do +# certain conditions as described in each individual source file, and +# distribute linked combinations including the two. You must obey the GNU +# General Public License in all respects for all of the code used other than +# OpenSSL. If you modify file(s) with this exception, you may extend this +# exception to your version of the file(s), but you are not obligated to do # so. If you do not wish to do so, delete this exception statement from your -# version. If you delete this exception statement from all source files in +# version. If you delete this exception statement from all source files in # the program, then also delete it here. -# +# # SLURM is distributed in the hope that it will be useful, but WITHOUT ANY # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more # details. -# +# # You should have received a copy of the GNU General Public License along # with SLURM; if not, write to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -# +# # Based off code with permission copyright 2006, 2007 Cluster Resources, Inc. ############################################################################## @@ -94,17 +94,17 @@ Main: my $rc = 0; foreach my $jobid (@jobIds) { my $err = 0; - my $resp = 0; + my $resp = 0; my %update = (); $update{job_id} = $jobid; - - $update{priority} = -1; + + $update{priority} = -1; $update{comment} = "None"; #doesn't do anything in 1.2 - - + + if(Slurm->update_job(\%update)) { - $err = Slurm->get_errno(); + $err = Slurm->get_errno(); $rc++; printf("qrls: Error on job id %d: %s\n", $jobid, Slurm->strerror($err)); diff --git a/contribs/torque/qstat.pl b/contribs/torque/qstat.pl index 6a5a8e5048..536c22f231 100755 --- a/contribs/torque/qstat.pl +++ b/contribs/torque/qstat.pl @@ -9,36 +9,36 @@ # Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). # Written by Danny Auble . # CODE-OCEC-09-009. All rights reserved. -# +# # This file is part of SLURM, a resource management program. # For details, see . # Please also read the included file: DISCLAIMER. -# +# # SLURM is free software; you can redistribute it and/or modify it under # the terms of the GNU General Public License as published by the Free # Software Foundation; either version 2 of the License, or (at your option) # any later version. # -# In addition, as a special exception, the copyright holders give permission +# In addition, as a special exception, the copyright holders give permission # to link the code of portions of this program with the OpenSSL library under -# certain conditions as described in each individual source file, and -# distribute linked combinations including the two. You must obey the GNU -# General Public License in all respects for all of the code used other than -# OpenSSL. If you modify file(s) with this exception, you may extend this -# exception to your version of the file(s), but you are not obligated to do +# certain conditions as described in each individual source file, and +# distribute linked combinations including the two. You must obey the GNU +# General Public License in all respects for all of the code used other than +# OpenSSL. If you modify file(s) with this exception, you may extend this +# exception to your version of the file(s), but you are not obligated to do # so. If you do not wish to do so, delete this exception statement from your -# version. If you delete this exception statement from all source files in +# version. If you delete this exception statement from all source files in # the program, then also delete it here. -# +# # SLURM is distributed in the hope that it will be useful, but WITHOUT ANY # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more # details. -# +# # You should have received a copy of the GNU General Public License along # with SLURM; if not, write to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -# +# # Based off code with permission copyright 2006, 2007 Cluster Resources, Inc. ############################################################################### @@ -103,13 +103,13 @@ if ($man) # Use sole remaining argument as jobIds -if($^O eq 'aix') { +if($^O eq 'aix') { $hostname = `hostname`; } else { $hostname = `hostname -f`; } chomp $hostname; - + # Handle unsupported arguments #unsupportedOption("-e", DIE) if $executable; #unsupportedOption("-W", DIE) if $siteSpecific; @@ -134,19 +134,19 @@ if(defined($queueList)) { if(!$resp) { die "Problem loading jobs.\n"; } - + my $line = 0; foreach my $part (@{$resp->{partition_array}}) { if (@queueIds) { next unless grep /^$part->{'name'}/, @queueIds; - } - + } + if ($full) { # Full print_part_full($part); } else { # Brief print_part_brief($part, $line); $line++; - } + } $rc = 0; } } elsif($queueStatus) { @@ -190,15 +190,15 @@ if(defined($queueList)) { my $state = $job->{'job_state'}; if($job->{'end_time'} && $job->{'end_time'} < $now_time) { $use_time = $job->{'end_time'}; - } + } $job->{'statPSUtl'} = job_time_used($job); $job->{'aWDuration'} = $job->{'statPSUtl'}; $job->{'allocNodeList'} = $job->{'nodes'} || "--"; $job->{'stateCode'} = stateCode($job->{'job_state'}); $job->{'user_name'} = getpwuid($job->{'user_id'}); - $job->{'name'} = "Allocation" if !$job->{'name'}; - + $job->{'name'} = "Allocation" if !$job->{'name'}; + # Filter jobs according to options and arguments if (@jobIds) { next unless grep /^$job->{'job_id'}/, @jobIds; @@ -211,11 +211,11 @@ if(defined($queueList)) { next unless ($job->{'stateCode'} eq 'Q'); } if (@userIds) { - next unless + next unless grep /^$job->{'user_name'}$/, @userIds; } } - + if ($all || $idle || $nodes || $running || $giga || $mega || $userList) { # Normal print_job_select($job); @@ -245,7 +245,7 @@ sub stateCode } switch($state) { - case [JOB_COMPLETE, + case [JOB_COMPLETE, JOB_CANCELLED, JOB_TIMEOUT, JOB_FAILED] { return 'C' } @@ -265,11 +265,11 @@ sub stateCode sub hhmm { my ($hhmmss) = @_; - + if ($hhmmss == INFINITE) { return "Infinite"; } - + # Convert hhmmss to duration in minutes $hhmmss = 0 unless $hhmmss; $hhmmss =~ /(?:(\d+):)?(?:(\d+):)?([\d\.]+)/; @@ -378,8 +378,8 @@ sub job_time_used } else { $end_time = $job->{'end_time'}; } - - return ($end_time - $job->{'suspend_time'} + $job->{'pre_sus_time'}) + + return ($end_time - $job->{'suspend_time'} + $job->{'pre_sus_time'}) if $job->{'suspend_time'}; return ($end_time - $job->{'start_time'}); } @@ -405,7 +405,7 @@ sub running_stopped return "S"; } -sub get_exec_host +sub get_exec_host { my ($job) = @_; @@ -418,12 +418,12 @@ sub get_exec_host while((my $host = Slurm::Hostlist::shift($hl))) { push(@allocNodes, "$host/" . $job->{'cpus_per_node'}[$inx]); - + $cpu_cnt++; if($cpu_cnt >= $job->{'cpu_count_reps'}[$inx]) { $cpu_cnt = 0; $inx++; - } + } } $execHost = join '+', @allocNodes; } @@ -433,7 +433,7 @@ sub get_exec_host ############################################################################### # Job Functions ############################################################################### -sub print_job_brief +sub print_job_brief { my ($job, $line_num) = @_; @@ -456,7 +456,7 @@ sub print_job_select if (!defined $header_printed) { print "\n${hostname}:\n"; - + printf("%-20s %-8s %-8s %-20s %-6s %-5s %-3s %-6s %-5s %-1s %-5s\n", "", "", "", "", "", "", "", "Req'd", "Req'd", "", "Elap"); printf( @@ -472,10 +472,10 @@ sub print_job_select $header_printed = 1; } $execHost = get_exec_host($job) if $nodes; - + printf("%-20.20s %-8.8s %-8.8s %-20.20s " . "%-6.6s %5.5s %3.3s %6.6s %-5.5s %-1s %-5.5s", - $job->{'job_id'}, + $job->{'job_id'}, $job->{'user_name'}, $job->{'partition'}, $job->{'name'}, @@ -503,25 +503,25 @@ sub print_job_full # Print the job attributes printf("Job Id:\t%s\n", $job->{'job_id'}); printf("\tJob_Name = %s\n", $job->{'name'}) if $job->{'name'}; - printf("\tJob_Owner = %s@%s\n", + printf("\tJob_Owner = %s@%s\n", $job->{'user_name'}, $job->{'alloc_node'}); - + printf "\tinteractive = True\n" if !$job->{'batch_flag'}; - + printf("\tjob_state = %s\n", $job->{'stateCode'}); printf("\tqueue = %s\n", $job->{'partition'}); - + printf("\tqtime = %s\n", hRTime($job->{'submit_time'})); - printf("\tmtime = %s\n", hRTime($job->{'start_time'})) + printf("\tmtime = %s\n", hRTime($job->{'start_time'})) if $job->{'start_time'}; printf("\tctime = %s\n", hRTime($job->{'end_time'})) if $job->{'end_time'}; - + printf("\tAccount_Name = %s\n", $job->{'account'}) if $job->{'account'}; - + my $execHost = get_exec_host($job); printf("\texec_host = %s\n", $execHost) if $execHost ne '--'; - + printf("\tPriority = %u\n", $job->{'priority'}); printf("\teuser = %s(%d)\n", $job->{'user_name'}, $job->{'user_id'}); @@ -533,24 +533,24 @@ sub print_job_full printf("\tResource_List.walltime = %s\n", hhmmss($job->{'aWDuration'})); printf("\tResource_List.nodect = %d\n", $job->{'num_nodes'}) if $job->{'num_nodes'}; - printf("\tResource_List.ncpus = %s\n", $job->{'num_procs'}) - if $job->{'num_procs'}; - + printf("\tResource_List.ncpus = %s\n", $job->{'num_procs'}) + if $job->{'num_procs'}; + if ($job->{'reqNodes'}) { my $nodeExpr = $job->{'reqNodes'}; - $nodeExpr .= ":ppn=" . $job->{'ntasks_per_node'} - if $job->{'ntasks_per_node'}; - + $nodeExpr .= ":ppn=" . $job->{'ntasks_per_node'} + if $job->{'ntasks_per_node'}; + printf("\tResource_List.nodes = %s\n", $nodeExpr); } - + print "\n"; } ############################################################################### # Partition Functions ############################################################################### -sub print_part_brief +sub print_part_brief { my ($part, $line_num) = @_; @@ -559,7 +559,7 @@ sub print_part_brief "Queue", "Max", "Tot", "Ena", "Str", "Que", "Run", "Hld", "Wat", "Trn", "Ext", "T"); printf("%-16s %5s %5s %5s %5s %5s %5s %5s %5s %5s %5s %1s\n", - "----------------", "---", "---", "---", "---", "---", + "----------------", "---", "---", "---", "---", "---", "---", "---", "---", "---", "---", "-"); } printf("%-16.16s %5.5s %5.5s %5.5s %5.5s %5.5s %5.5s %5.5s " . @@ -576,15 +576,15 @@ sub print_part_full printf("Queue:\t%s\n", $part->{'name'}); printf("\tqueue_type = Execution\n"); printf("\tresources_default.nodes = %d\n", $part->{'total_nodes'}); - + printf("\tenabled = %s\n", yes_no($part->{'state_up'})); - + printf("\tstarted = %s\n", yes_no($part->{'state_up'})); - + print "\n"; } -sub print_part_limits +sub print_part_limits { my ($part, $line_num) = @_; @@ -597,13 +597,13 @@ sub print_part_limits "----", "---", "---", "--", "-----"); } - + printf("%-16.16s -- -- ", $part->{'name'}); if($part->{'max_time'} != INFINITE) { printf("%8u ", $part->{'max_time'}); } else { printf(" -- "); - + } if($part->{'max_nodes'} != INFINITE) { diff --git a/contribs/torque/qsub.pl b/contribs/torque/qsub.pl index ff800bfb04..dc5bff4948 100755 --- a/contribs/torque/qsub.pl +++ b/contribs/torque/qsub.pl @@ -9,36 +9,36 @@ # Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). # Written by Danny Auble . # CODE-OCEC-09-009. All rights reserved. -# +# # This file is part of SLURM, a resource management program. # For details, see . # Please also read the included file: DISCLAIMER. -# +# # SLURM is free software; you can redistribute it and/or modify it under # the terms of the GNU General Public License as published by the Free # Software Foundation; either version 2 of the License, or (at your option) # any later version. # -# In addition, as a special exception, the copyright holders give permission +# In addition, as a special exception, the copyright holders give permission # to link the code of portions of this program with the OpenSSL library under -# certain conditions as described in each individual source file, and -# distribute linked combinations including the two. You must obey the GNU -# General Public License in all respects for all of the code used other than -# OpenSSL. If you modify file(s) with this exception, you may extend this -# exception to your version of the file(s), but you are not obligated to do +# certain conditions as described in each individual source file, and +# distribute linked combinations including the two. You must obey the GNU +# General Public License in all respects for all of the code used other than +# OpenSSL. If you modify file(s) with this exception, you may extend this +# exception to your version of the file(s), but you are not obligated to do # so. If you do not wish to do so, delete this exception statement from your -# version. If you delete this exception statement from all source files in +# version. If you delete this exception statement from all source files in # the program, then also delete it here. -# +# # SLURM is distributed in the hope that it will be useful, but WITHOUT ANY # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more # details. -# +# # You should have received a copy of the GNU General Public License along # with SLURM; if not, write to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -# +# ############################################################################### use strict; @@ -138,7 +138,7 @@ my %node_opts; if($resource_list) { %res_opts = %{parse_resource_list($resource_list)}; - + # while((my $key, my $val) = each(%res_opts)) { # print "$key = "; # if($val) { @@ -147,7 +147,7 @@ if($resource_list) { # print "\n"; # } # } - + if($res_opts{nodes}) { %node_opts = %{parse_node_opts($res_opts{nodes})}; } @@ -157,10 +157,10 @@ my $command; if($interactive) { $command = "$salloc"; - + } else { $command = "$sbatch"; - + $command .= " -D $directive_prefix" if $directive_prefix; $command .= " -e $err_path" if $err_path; $command .= " -o $out_path" if $out_path; @@ -223,11 +223,11 @@ sub parse_resource_list { 'walltime' => "" ); my @keys = keys(%opt); - + foreach my $key (@keys) { #print "$rl\n"; ($opt{$key}) = $rl =~ m/$key=([\w:\+=+]+)/; - + } if($opt{cput}) { $opt{cput} = get_minutes($opt{cput}); @@ -240,7 +240,7 @@ sub parse_resource_list { if($opt{file}) { $opt{file} = convert_mb_format($opt{file}); } - + return \%opt; } @@ -271,24 +271,24 @@ sub parse_node_opts { } } } - + $opt{hostlist} = Slurm::Hostlist::ranged_string($hl); my $hl_cnt = Slurm::Hostlist::count($hl); $opt{node_cnt} = $hl_cnt if $hl_cnt > $opt{node_cnt}; - - # we always want at least one here + + # we always want at least one here if(!$opt{node_cnt}) { - + $opt{node_cnt} = 1; } - - # figure out the amount of tasks based of the node cnt and the amount + + # figure out the amount of tasks based of the node cnt and the amount # of ppn's in the request if($opt{task_cnt}) { $opt{task_cnt} *= $opt{node_cnt}; } - + return \%opt; } @@ -318,7 +318,7 @@ sub convert_mb_format { my ($value) = @_; my ($amount, $suffix) = $value =~ /(\d+)($|[KMGT])/i; return if !$amount; - $suffix = lc($suffix); + $suffix = lc($suffix); if (!$suffix) { $amount /= 1048576; @@ -330,7 +330,7 @@ sub convert_mb_format { $amount *= 1024; } elsif ($suffix eq "t") { $amount *= 1048576; - } else { + } else { print "don't know what to do with suffix $suffix\n"; return; } @@ -349,13 +349,13 @@ B - submit a batch job in a familiar pbs format =head1 SYNOPSIS -qsub [-a date_time] [-A account_string] [-b secs] [-c interval] +qsub [-a date_time] [-A account_string] [-b secs] [-c interval] [-C directive_prefix] [-e path] [-h] [-I] [-j join] [-k keep] [-l resource_list] [-m mail_options] [-M user_list] [-N name] [-o path] [-p priority] [-q destination] [-r c] [-S path_list] [-u user_list] [-v variable_list] [-V] [-W additional_attributes] [-z] [script] - + =head1 DESCRIPTION The B command displays information about nodes. diff --git a/src/Makefile.am b/src/Makefile.am index 4392926da6..3bc20923de 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,7 +1,7 @@ -if WITH_BLCR +if WITH_BLCR SRUN_CR = srun_cr else -SRUN_CR = +SRUN_CR = endif SUBDIRS = common api database \ diff --git a/src/api/Makefile.am b/src/api/Makefile.am index 5418b408ad..fbfda5188e 100644 --- a/src/api/Makefile.am +++ b/src/api/Makefile.am @@ -16,10 +16,10 @@ PMI_OTHER_FLAGS = \ -Wl,--version-script=$(PMI_VERSION_SCRIPT) endif -# libslurm version information : +# libslurm version information : # # Update META file information before a public release only! -# +# # Note that libtool builds libslurm.so... # where major = API_MAJOR = (API_CURRENT - API_AGE) # and age = API_AGE @@ -31,13 +31,13 @@ endif # If any interfaces have been added: increment API_CURRENT, increment API_AGE, # and set API_REVISION = 0 (e.g. libslurm.so.2.4.6 -> libslurm.so.2.5.0) # -# If any interfaces have been removed: increment API_CURRENT, set API_AGE = 0, +# If any interfaces have been removed: increment API_CURRENT, set API_AGE = 0, # and set API_REVISION = 0 (e.g. libslurm.so.2.4.6 -> libslurm.so.7.0.0) # # If any interfaces have changed: increment API_CURRENT only # (e.g. libslurm.so.2.4.6 -> libslurm.so.3.4.6) # -# If the interfaces have not changed, but underlying code has changed at all: +# If the interfaces have not changed, but underlying code has changed at all: # increment API_REVISION only (e.g. libslurm.so.2.4.6 -> libslurm.so.2.4.7) # current = $(SLURM_API_CURRENT) @@ -54,10 +54,10 @@ BUILT_SOURCES = $(VERSION_SCRIPT) $(PMI_VERSION_SCRIPT) libslurm.la # Note that libslurmhelper is mostly the same as libslurm, except that # it exports ALL symbols used by the process, libcommon, libeio, etc. -# Only link with libslurmhelper if you are sure you are not going to be -# loading a plugin that could use something you yourself are not +# Only link with libslurmhelper if you are sure you are not going to be +# loading a plugin that could use something you yourself are not # calling from here. -# libslurm.o only contains all the api symbols and will export +# libslurm.o only contains all the api symbols and will export # them to plugins that are loaded. # Also, libslurmhelper, libslurm.o are for convenience, they are not installed. noinst_LTLIBRARIES = libslurmhelper.la @@ -108,7 +108,7 @@ libslurmhelper_la_LDFLAGs = \ convenience_libs = \ $(top_builddir)/src/api/libslurmhelper.la -libslurm_la_SOURCES = +libslurm_la_SOURCES = libslurm_la_LIBADD = $(convenience_libs) libslurm_la_LDFLAGS = \ $(LIB_LDFLAGS) \ @@ -126,9 +126,9 @@ libpmi_la_LDFLAGS = $(LIB_LDFLAGS) \ -version-info $(current):$(rev):$(age) \ $(PMI_OTHER_FLAGS) -# This was made so we chould export all symbols from libcommon +# This was made so we chould export all symbols from libcommon # on multiple platforms -libslurm_o_SOURCES = +libslurm_o_SOURCES = libslurm_o_LDADD = $(top_builddir)/src/common/libeio.o \ $(top_builddir)/src/common/libspank.o \ diff --git a/src/api/Makefile.in b/src/api/Makefile.in index 96abe78ad5..90b5a81bff 100644 --- a/src/api/Makefile.in +++ b/src/api/Makefile.in @@ -354,10 +354,10 @@ INCLUDES = -I$(top_srcdir) $(BG_INCLUDES) @WITH_GNU_LD_TRUE@ -Wl,--version-script=$(PMI_VERSION_SCRIPT) -# libslurm version information : +# libslurm version information : # # Update META file information before a public release only! -# +# # Note that libtool builds libslurm.so... # where major = API_MAJOR = (API_CURRENT - API_AGE) # and age = API_AGE @@ -369,13 +369,13 @@ INCLUDES = -I$(top_srcdir) $(BG_INCLUDES) # If any interfaces have been added: increment API_CURRENT, increment API_AGE, # and set API_REVISION = 0 (e.g. libslurm.so.2.4.6 -> libslurm.so.2.5.0) # -# If any interfaces have been removed: increment API_CURRENT, set API_AGE = 0, +# If any interfaces have been removed: increment API_CURRENT, set API_AGE = 0, # and set API_REVISION = 0 (e.g. libslurm.so.2.4.6 -> libslurm.so.7.0.0) # # If any interfaces have changed: increment API_CURRENT only # (e.g. libslurm.so.2.4.6 -> libslurm.so.3.4.6) # -# If the interfaces have not changed, but underlying code has changed at all: +# If the interfaces have not changed, but underlying code has changed at all: # increment API_REVISION only (e.g. libslurm.so.2.4.6 -> libslurm.so.2.4.7) # current = $(SLURM_API_CURRENT) @@ -391,10 +391,10 @@ BUILT_SOURCES = $(VERSION_SCRIPT) $(PMI_VERSION_SCRIPT) libslurm.la # Note that libslurmhelper is mostly the same as libslurm, except that # it exports ALL symbols used by the process, libcommon, libeio, etc. -# Only link with libslurmhelper if you are sure you are not going to be -# loading a plugin that could use something you yourself are not +# Only link with libslurmhelper if you are sure you are not going to be +# loading a plugin that could use something you yourself are not # calling from here. -# libslurm.o only contains all the api symbols and will export +# libslurm.o only contains all the api symbols and will export # them to plugins that are loaded. # Also, libslurmhelper, libslurm.o are for convenience, they are not installed. noinst_LTLIBRARIES = libslurmhelper.la @@ -462,7 +462,7 @@ libpmi_la_LDFLAGS = $(LIB_LDFLAGS) \ $(PMI_OTHER_FLAGS) -# This was made so we chould export all symbols from libcommon +# This was made so we chould export all symbols from libcommon # on multiple platforms libslurm_o_SOURCES = libslurm_o_LDADD = $(top_builddir)/src/common/libeio.o \ diff --git a/src/api/allocate.c b/src/api/allocate.c index 8ac8a28482..bb085a4914 100644 --- a/src/api/allocate.c +++ b/src/api/allocate.c @@ -7,32 +7,32 @@ * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Morris Jette . * CODE-OCEC-09-009. All rights reserved. - * + * * This file is part of SLURM, a resource management program. * For details, see . * Please also read the included file: DISCLAIMER. - * + * * SLURM is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free * Software Foundation; either version 2 of the License, or (at your option) * any later version. * - * In addition, as a special exception, the copyright holders give permission + * In addition, as a special exception, the copyright holders give permission * to link the code of portions of this program with the OpenSSL library under - * certain conditions as described in each individual source file, and - * distribute linked combinations including the two. You must obey the GNU - * General Public License in all respects for all of the code used other than - * OpenSSL. If you modify file(s) with this exception, you may extend this - * exception to your version of the file(s), but you are not obligated to do + * certain conditions as described in each individual source file, and + * distribute linked combinations including the two. You must obey the GNU + * General Public License in all respects for all of the code used other than + * OpenSSL. If you modify file(s) with this exception, you may extend this + * exception to your version of the file(s), but you are not obligated to do * so. If you do not wish to do so, delete this exception statement from your - * version. If you delete this exception statement from all source files in + * version. If you delete this exception statement from all source files in * the program, then also delete it here. - * + * * SLURM is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. - * + * * You should have received a copy of the GNU General Public License along * with SLURM; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. @@ -94,7 +94,7 @@ static resource_allocation_response_msg_t *_wait_for_allocation_response( * NOTE: free the allocated using slurm_free_resource_allocation_response_msg */ int -slurm_allocate_resources (job_desc_msg_t *req, +slurm_allocate_resources (job_desc_msg_t *req, resource_allocation_response_msg_t **resp) { int rc; @@ -105,21 +105,21 @@ slurm_allocate_resources (job_desc_msg_t *req, slurm_msg_t_init(&req_msg); slurm_msg_t_init(&resp_msg); - /* + /* * set Node and session id for this request */ if (req->alloc_sid == NO_VAL) req->alloc_sid = getsid(0); - if ( (req->alloc_node == NULL) + if ( (req->alloc_node == NULL) && (gethostname_short(host, sizeof(host)) == 0) ) { req->alloc_node = host; host_set = true; } req_msg.msg_type = REQUEST_RESOURCE_ALLOCATION; - req_msg.data = req; - + req_msg.data = req; + rc = slurm_send_recv_controller_msg(&req_msg, &resp_msg); /* @@ -129,7 +129,7 @@ slurm_allocate_resources (job_desc_msg_t *req, if (host_set) req->alloc_node = NULL; - if (rc == SLURM_SOCKET_ERROR) + if (rc == SLURM_SOCKET_ERROR) return SLURM_SOCKET_ERROR; switch (resp_msg.msg_type) { @@ -161,7 +161,7 @@ slurm_allocate_resources (job_desc_msg_t *req, * the controller will put the job in the PENDING state. If * pending callback is not NULL, it will be called with the job_id * of the pending job as the sole parameter. - * + * * RET allocation structure on success, NULL on error set errno to * indicate the error (errno will be ETIMEDOUT if the timeout is reached * with no allocation granted) @@ -185,7 +185,7 @@ slurm_allocate_resources_blocking (const job_desc_msg_t *user_req, slurm_msg_t_init(&req_msg); slurm_msg_t_init(&resp_msg); - + /* make a copy of the user's job description struct so that we * can make changes before contacting the controller */ req = (job_desc_msg_t *)xmalloc(sizeof(job_desc_msg_t)); @@ -193,7 +193,7 @@ slurm_allocate_resources_blocking (const job_desc_msg_t *user_req, return NULL; memcpy(req, user_req, sizeof(job_desc_msg_t)); - /* + /* * set Node and session id for this request */ if (req->alloc_sid == NO_VAL) @@ -219,7 +219,7 @@ slurm_allocate_resources_blocking (const job_desc_msg_t *user_req, } req_msg.msg_type = REQUEST_RESOURCE_ALLOCATION; - req_msg.data = req; + req_msg.data = req; rc = slurm_send_recv_controller_msg(&req_msg, &resp_msg); @@ -252,7 +252,7 @@ slurm_allocate_resources_blocking (const job_desc_msg_t *user_req, /* yes, allocation has been granted */ errno = SLURM_PROTOCOL_SUCCESS; } else if (!req->immediate) { - if (resp->error_code != SLURM_SUCCESS) + if (resp->error_code != SLURM_SUCCESS) info("%s", slurm_strerror(resp->error_code)); /* no, we need to wait for a response */ job_id = resp->job_id; @@ -261,7 +261,7 @@ slurm_allocate_resources_blocking (const job_desc_msg_t *user_req, pending_callback(job_id); resp = _wait_for_allocation_response(job_id, listen, timeout); - /* If NULL, we didn't get the allocation in + /* If NULL, we didn't get the allocation in the time desired, so just free the job id */ if ((resp == NULL) && (errno != ESLURM_ALREADY_DONE)) { errnum = errno; @@ -284,7 +284,7 @@ slurm_allocate_resources_blocking (const job_desc_msg_t *user_req, } /* - * slurm_job_will_run - determine if a job would execute immediately if + * slurm_job_will_run - determine if a job would execute immediately if * submitted now * IN job_desc_msg - description of resource allocation request * RET 0 on success, otherwise return -1 and set errno to indicate the error @@ -301,8 +301,8 @@ int slurm_job_will_run (job_desc_msg_t *req) req->alloc_node = buf; slurm_msg_t_init(&req_msg); req_msg.msg_type = REQUEST_JOB_WILL_RUN; - req_msg.data = req; - + req_msg.data = req; + if (slurm_send_recv_controller_msg(&req_msg, &resp_msg) < 0) return SLURM_SOCKET_ERROR; @@ -317,9 +317,9 @@ int slurm_job_will_run (job_desc_msg_t *req) buf, sizeof(buf)); info("Job %u to start at %s using %u " #ifdef HAVE_BG - "cnodes" + "cnodes" #else - "processors" + "processors" #endif " on %s", will_run_resp->job_id, buf, @@ -358,7 +358,7 @@ int slurm_job_will_run (job_desc_msg_t *req) * NOTE: free the response using slurm_free_job_step_create_response_msg */ int -slurm_job_step_create (job_step_create_request_msg_t *req, +slurm_job_step_create (job_step_create_request_msg_t *req, job_step_create_response_msg_t **resp) { slurm_msg_t req_msg, resp_msg; @@ -366,8 +366,8 @@ slurm_job_step_create (job_step_create_request_msg_t *req, slurm_msg_t_init(&req_msg); slurm_msg_t_init(&resp_msg); req_msg.msg_type = REQUEST_JOB_STEP_CREATE; - req_msg.data = req; - + req_msg.data = req; + if (slurm_send_recv_controller_msg(&req_msg, &resp_msg) < 0) return SLURM_ERROR; @@ -407,8 +407,8 @@ slurm_allocation_lookup(uint32_t jobid, slurm_msg_t_init(&req_msg); slurm_msg_t_init(&resp_msg); req_msg.msg_type = REQUEST_JOB_ALLOCATION_INFO; - req_msg.data = &req; - + req_msg.data = &req; + if (slurm_send_recv_controller_msg(&req_msg, &resp_msg) < 0) return SLURM_ERROR; @@ -431,7 +431,7 @@ slurm_allocation_lookup(uint32_t jobid, } /* - * slurm_allocation_lookup_lite - retrieve info for an existing resource + * slurm_allocation_lookup_lite - retrieve info for an existing resource * allocation without the addrs and such * IN jobid - job allocation identifier * OUT info - job allocation information @@ -450,8 +450,8 @@ slurm_allocation_lookup_lite(uint32_t jobid, slurm_msg_t_init(&req_msg); slurm_msg_t_init(&resp_msg); req_msg.msg_type = REQUEST_JOB_ALLOCATION_INFO_LITE; - req_msg.data = &req; - + req_msg.data = &req; + if (slurm_send_recv_controller_msg(&req_msg, &resp_msg) < 0) return SLURM_ERROR; @@ -491,8 +491,8 @@ int slurm_sbcast_lookup(uint32_t jobid, job_sbcast_cred_msg_t **info) slurm_msg_t_init(&req_msg); slurm_msg_t_init(&resp_msg); req_msg.msg_type = REQUEST_JOB_SBCAST_CRED; - req_msg.data = &req; - + req_msg.data = &req; + if (slurm_send_recv_controller_msg(&req_msg, &resp_msg) < 0) return SLURM_ERROR; @@ -515,7 +515,7 @@ int slurm_sbcast_lookup(uint32_t jobid, job_sbcast_cred_msg_t **info) } /* - * Handle a return code message type. + * Handle a return code message type. * if return code is nonzero, sets errno to return code and returns < 0. * Otherwise, returns 0 (SLURM_SUCCES) */ @@ -525,7 +525,7 @@ _handle_rc_msg(slurm_msg_t *msg) int rc = ((return_code_msg_t *) msg->data)->return_code; slurm_free_return_code_msg(msg->data); - if (rc) + if (rc) slurm_seterrno_ret(rc); else return SLURM_SUCCESS; @@ -534,7 +534,7 @@ _handle_rc_msg(slurm_msg_t *msg) /* * Read a SLURM hostfile specified by "filename". "filename" must contain * a list of SLURM NodeNames, one per line. Reads up to "n" number of hostnames - * from the file. Returns a string representing a hostlist ranged string of + * from the file. Returns a string representing a hostlist ranged string of * the contents of the file. This is a helper function, it does not * contact any SLURM daemons. * @@ -553,7 +553,7 @@ char *slurm_read_hostfile(char *filename, int n) int line_num = 0; hostlist_t hostlist = NULL; char *nodelist = NULL; - + if (filename == NULL || strlen(filename) == 0) return NULL; @@ -592,14 +592,14 @@ char *slurm_read_hostfile(char *filename, int n) } line_size--; continue; - } + } in_line[i] = '\0'; break; } - + hostlist_push(hostlist, in_line); - if(n != (int)NO_VAL && hostlist_count(hostlist) == n) - break; + if(n != (int)NO_VAL && hostlist_count(hostlist) == n) + break; } fclose(fp); @@ -610,7 +610,7 @@ char *slurm_read_hostfile(char *filename, int n) if (hostlist_count(hostlist) < n) { error("Too few NodeNames in SLURM Hostfile"); goto cleanup_hostfile; - } + } nodelist = (char *)malloc(0xffff); if (!nodelist) { @@ -710,8 +710,8 @@ _handle_msg(slurm_msg_t *msg, resource_allocation_response_msg_t **resp) * IN slurmctld_fd: file descriptor for slurmctld communications * OUT resp: resource allocation response message * RET 1 if resp is filled in, 0 otherwise */ -static int -_accept_msg_connection(int listen_fd, +static int +_accept_msg_connection(int listen_fd, resource_allocation_response_msg_t **resp) { int conn_fd; @@ -720,7 +720,7 @@ _accept_msg_connection(int listen_fd, char host[256]; uint16_t port; int rc = 0; - + conn_fd = slurm_accept_msg_conn(listen_fd, &cli_addr); if (conn_fd < 0) { error("Unable to accept connection: %m"); @@ -732,7 +732,7 @@ _accept_msg_connection(int listen_fd, msg = xmalloc(sizeof(slurm_msg_t)); slurm_msg_t_init(msg); - + if((rc = slurm_receive_msg(conn_fd, msg, 0)) != 0) { slurm_free_msg(msg); @@ -741,14 +741,14 @@ _accept_msg_connection(int listen_fd, *resp = NULL; return 0; } - + error("_accept_msg_connection[%s]: %m", host); return SLURM_ERROR; } - + rc = _handle_msg(msg, resp); /* handle_msg frees msg */ slurm_free_msg(msg); - + slurm_close_accepted_conn(conn_fd); return rc; } @@ -824,7 +824,7 @@ _wait_for_allocation_response(uint32_t job_id, const listen_t *listen, errno = errnum; return NULL; } else { - debug3("Unable to confirm allocation for job %u: %m", + debug3("Unable to confirm allocation for job %u: %m", job_id); return NULL; } diff --git a/src/api/allocate_msg.c b/src/api/allocate_msg.c index 73f1d667a0..a8f602eb11 100644 --- a/src/api/allocate_msg.c +++ b/src/api/allocate_msg.c @@ -7,32 +7,32 @@ * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Morris Jette . * CODE-OCEC-09-009. All rights reserved. - * + * * This file is part of SLURM, a resource management program. * For details, see . * Please also read the included file: DISCLAIMER. - * + * * SLURM is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free * Software Foundation; either version 2 of the License, or (at your option) * any later version. * - * In addition, as a special exception, the copyright holders give permission + * In addition, as a special exception, the copyright holders give permission * to link the code of portions of this program with the OpenSSL library under - * certain conditions as described in each individual source file, and - * distribute linked combinations including the two. You must obey the GNU - * General Public License in all respects for all of the code used other than - * OpenSSL. If you modify file(s) with this exception, you may extend this - * exception to your version of the file(s), but you are not obligated to do + * certain conditions as described in each individual source file, and + * distribute linked combinations including the two. You must obey the GNU + * General Public License in all respects for all of the code used other than + * OpenSSL. If you modify file(s) with this exception, you may extend this + * exception to your version of the file(s), but you are not obligated to do * so. If you do not wish to do so, delete this exception statement from your - * version. If you delete this exception statement from all source files in + * version. If you delete this exception statement from all source files in * the program, then also delete it here. - * + * * SLURM is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. - * + * * You should have received a copy of the GNU General Public License along * with SLURM; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. @@ -165,7 +165,7 @@ extern void slurm_allocation_msg_thr_destroy( xfree(msg_thr); } -static void _handle_node_fail(struct allocation_msg_thread *msg_thr, +static void _handle_node_fail(struct allocation_msg_thread *msg_thr, slurm_msg_t *msg) { srun_node_fail_msg_t *nf = (srun_node_fail_msg_t *)msg->data; @@ -177,36 +177,36 @@ static void _handle_node_fail(struct allocation_msg_thread *msg_thr, } /* - * Job has been notified of it's approaching time limit. + * Job has been notified of it's approaching time limit. * Job will be killed shortly after timeout. * This RPC can arrive multiple times with the same or updated timeouts. */ -static void _handle_timeout(struct allocation_msg_thread *msg_thr, +static void _handle_timeout(struct allocation_msg_thread *msg_thr, slurm_msg_t *msg) { srun_timeout_msg_t *to = (srun_timeout_msg_t *)msg->data; debug3("received timeout message"); - + if (msg_thr->callback.timeout != NULL) (msg_thr->callback.timeout)(to); slurm_free_srun_timeout_msg(msg->data); } -static void _handle_user_msg(struct allocation_msg_thread *msg_thr, +static void _handle_user_msg(struct allocation_msg_thread *msg_thr, slurm_msg_t *msg) { srun_user_msg_t *um = (srun_user_msg_t *)msg->data; debug3("received user message"); - + if (msg_thr->callback.user_msg != NULL) (msg_thr->callback.user_msg)(um); - + slurm_free_srun_user_msg(msg->data); } -static void _handle_ping(struct allocation_msg_thread *msg_thr, +static void _handle_ping(struct allocation_msg_thread *msg_thr, slurm_msg_t *msg) { srun_ping_msg_t *ping = (srun_ping_msg_t *)msg->data; @@ -215,10 +215,10 @@ static void _handle_ping(struct allocation_msg_thread *msg_thr, if (msg_thr->callback.ping != NULL) (msg_thr->callback.ping)(ping); - + slurm_free_srun_ping_msg(msg->data); } -static void _handle_job_complete(struct allocation_msg_thread *msg_thr, +static void _handle_job_complete(struct allocation_msg_thread *msg_thr, slurm_msg_t *msg) { srun_job_complete_msg_t *comp = (srun_job_complete_msg_t *)msg->data; @@ -226,20 +226,20 @@ static void _handle_job_complete(struct allocation_msg_thread *msg_thr, if (msg_thr->callback.job_complete != NULL) (msg_thr->callback.job_complete)(comp); - + slurm_free_srun_job_complete_msg(msg->data); } static void _handle_msg(void *arg, slurm_msg_t *msg) { - struct allocation_msg_thread *msg_thr = + struct allocation_msg_thread *msg_thr = (struct allocation_msg_thread *)arg; uid_t req_uid = g_slurm_auth_get_uid(msg->auth_cred, NULL); uid_t uid = getuid(); - + if ((req_uid != slurm_uid) && (req_uid != 0) && (req_uid != uid)) { - error ("Security violation, slurm message from uid %u", + error ("Security violation, slurm message from uid %u", (unsigned int) req_uid); return; } diff --git a/src/api/block_info.c b/src/api/block_info.c index 337c40b148..417d18fe95 100644 --- a/src/api/block_info.c +++ b/src/api/block_info.c @@ -7,32 +7,32 @@ * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Morris Jette * CODE-OCEC-09-009. All rights reserved. - * + * * This file is part of SLURM, a resource management program. * For details, see . * Please also read the included file: DISCLAIMER. - * + * * SLURM is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free * Software Foundation; either version 2 of the License, or (at your option) * any later version. * - * In addition, as a special exception, the copyright holders give permission + * In addition, as a special exception, the copyright holders give permission * to link the code of portions of this program with the OpenSSL library under - * certain conditions as described in each individual source file, and - * distribute linked combinations including the two. You must obey the GNU - * General Public License in all respects for all of the code used other than - * OpenSSL. If you modify file(s) with this exception, you may extend this - * exception to your version of the file(s), but you are not obligated to do + * certain conditions as described in each individual source file, and + * distribute linked combinations including the two. You must obey the GNU + * General Public License in all respects for all of the code used other than + * OpenSSL. If you modify file(s) with this exception, you may extend this + * exception to your version of the file(s), but you are not obligated to do * so. If you do not wish to do so, delete this exception statement from your - * version. If you delete this exception statement from all source files in + * version. If you delete this exception statement from all source files in * the program, then also delete it here. - * + * * SLURM is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. - * + * * You should have received a copy of the GNU General Public License along * with SLURM; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. @@ -66,7 +66,7 @@ /* - * slurm_print_block_info_msg - output information about all Bluegene + * slurm_print_block_info_msg - output information about all Bluegene * blocks based upon message as loaded using slurm_load_block * IN out - file to write to * IN info_ptr - block information message pointer @@ -79,17 +79,17 @@ void slurm_print_block_info_msg( block_info_t * block_ptr = info_ptr->block_array; char time_str[32]; - slurm_make_time_str ((time_t *)&info_ptr->last_update, time_str, + slurm_make_time_str ((time_t *)&info_ptr->last_update, time_str, sizeof(time_str)); fprintf( out, "Bluegene Block data as of %s, record count %d\n", time_str, info_ptr->record_count); - for (i = 0; i < info_ptr->record_count; i++) + for (i = 0; i < info_ptr->record_count; i++) slurm_print_block_info(out, & block_ptr[i], one_liner); } /* - * slurm_print_block_info - output information about a specific Bluegene + * slurm_print_block_info - output information about a specific Bluegene * block based upon message as loaded using slurm_load_block * IN out - file to write to * IN block_ptr - an individual block information record pointer @@ -106,7 +106,7 @@ void slurm_print_block_info( /* - * slurm_sprint_block_info - output information about a specific Bluegene + * slurm_sprint_block_info - output information about a specific Bluegene * block based upon message as loaded using slurm_load_block * IN block_ptr - an individual partition information record pointer * IN one_liner - print as a single line if true @@ -128,34 +128,34 @@ char *slurm_sprint_block_info( convert_num_unit((float)block_ptr->node_cnt, tmp1, sizeof(tmp1), UNIT_NONE); - out = xstrdup_printf("BlockName=%s TotalNodes=%s State=%s%s", + out = xstrdup_printf("BlockName=%s TotalNodes=%s State=%s%s", block_ptr->bg_block_id, tmp1, bg_block_state_string(block_ptr->state), line_end); - + /****** Line 2 ******/ if (block_ptr->job_running > NO_JOB_RUNNING) xstrfmtcat(out, "JobRunning=%u ", block_ptr->job_running); - else - xstrcat(out, "JobRunning=NONE "); + else + xstrcat(out, "JobRunning=NONE "); xstrfmtcat(out, "User=%s ConnType=%s", - block_ptr->owner_name, + block_ptr->owner_name, conn_type_string(block_ptr->conn_type)); #ifdef HAVE_BGL xstrfmtcat(out, " NodeUse=%s", node_use_string(block_ptr->node_use)); #endif xstrcat(out, line_end); - + /****** Line 3 ******/ - if(block_ptr->ionodes) + if(block_ptr->ionodes) xstrfmtcat(out, "BasePartitions=%s[%s] BPIndices=", block_ptr->nodes, block_ptr->ionodes); else xstrfmtcat(out, "BasePartitions=%s BPIndices=", block_ptr->nodes); - for (j = 0; - (block_ptr->bp_inx && (block_ptr->bp_inx[j] != -1)); + for (j = 0; + (block_ptr->bp_inx && (block_ptr->bp_inx[j] != -1)); j+=2) { if (j > 0) xstrcat(out, ","); @@ -180,20 +180,20 @@ char *slurm_sprint_block_info( xstrfmtcat(out, "CnloadImage=%s%s", block_ptr->linuximage, line_end); /****** Line 6 ******/ xstrfmtcat(out, "IoloadImage=%s", block_ptr->ramdiskimage); -#endif +#endif if (one_liner) xstrcat(out, "\n"); else xstrcat(out, "\n\n"); - + return out; } /* - * slurm_load_block_info - issue RPC to get slurm all node select plugin - * information if changed since update_time + * slurm_load_block_info - issue RPC to get slurm all node select plugin + * information if changed since update_time * IN update_time - time of current configuration data - * IN block_info_msg_pptr - place to store a node select configuration + * IN block_info_msg_pptr - place to store a node select configuration * pointer * RET 0 or a slurm error code * NOTE: free the response using slurm_free_block_info_msg @@ -212,19 +212,19 @@ extern int slurm_load_block_info ( req.last_update = update_time; req_msg.msg_type = REQUEST_BLOCK_INFO; req_msg.data = &req; - + if (slurm_send_recv_controller_msg(&req_msg, &resp_msg) < 0) return SLURM_ERROR; - + switch (resp_msg.msg_type) { case RESPONSE_BLOCK_INFO: - *block_info_msg_pptr = (block_info_msg_t *) + *block_info_msg_pptr = (block_info_msg_t *) resp_msg.data; break; case RESPONSE_SLURM_RC: rc = ((return_code_msg_t *) resp_msg.data)->return_code; - slurm_free_return_code_msg(resp_msg.data); - if (rc) + slurm_free_return_code_msg(resp_msg.data); + if (rc) slurm_seterrno_ret(rc); *block_info_msg_pptr = NULL; break; @@ -233,7 +233,7 @@ extern int slurm_load_block_info ( slurm_seterrno_ret(SLURM_UNEXPECTED_MSG_ERROR); break; } - + return SLURM_SUCCESS; } @@ -249,7 +249,7 @@ extern int slurm_get_select_jobinfo(select_jobinfo_t *jobinfo, return select_g_select_jobinfo_get(jobinfo, data_type, data); } -extern int slurm_get_select_nodeinfo(select_nodeinfo_t *nodeinfo, +extern int slurm_get_select_nodeinfo(select_nodeinfo_t *nodeinfo, enum select_nodedata_type data_type, enum node_states state, void *data) { diff --git a/src/api/cancel.c b/src/api/cancel.c index cb60701ae7..4ec2f60893 100644 --- a/src/api/cancel.c +++ b/src/api/cancel.c @@ -6,32 +6,32 @@ * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Morris Jette . * CODE-OCEC-09-009. All rights reserved. - * + * * This file is part of SLURM, a resource management program. * For details, see . * Please also read the included file: DISCLAIMER. - * + * * SLURM is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free * Software Foundation; either version 2 of the License, or (at your option) * any later version. * - * In addition, as a special exception, the copyright holders give permission - * to link the code of portions of this program with the OpenSSL library under - * certain conditions as described in each individual source file, and - * distribute linked combinations including the two. You must obey the GNU - * General Public License in all respects for all of the code used other than - * OpenSSL. If you modify file(s) with this exception, you may extend this - * exception to your version of the file(s), but you are not obligated to do + * In addition, as a special exception, the copyright holders give permission + * to link the code of portions of this program with the OpenSSL library under + * certain conditions as described in each individual source file, and + * distribute linked combinations including the two. You must obey the GNU + * General Public License in all respects for all of the code used other than + * OpenSSL. If you modify file(s) with this exception, you may extend this + * exception to your version of the file(s), but you are not obligated to do * so. If you do not wish to do so, delete this exception statement from your - * version. If you delete this exception statement from all source files in + * version. If you delete this exception statement from all source files in * the program, then also delete it here. - * + * * SLURM is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. - * + * * You should have received a copy of the GNU General Public License along * with SLURM; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. @@ -57,7 +57,7 @@ * IN batch_flag - 1 to signal batch shell only, otherwise 0 * RET 0 on success, otherwise return -1 and set errno to indicate the error */ -int +int slurm_kill_job ( uint32_t job_id, uint16_t signal, uint16_t batch_flag ) { int rc; @@ -65,7 +65,7 @@ slurm_kill_job ( uint32_t job_id, uint16_t signal, uint16_t batch_flag ) job_step_kill_msg_t req; slurm_msg_t_init(&msg); - /* + /* * Request message: */ req.job_id = job_id; @@ -92,7 +92,7 @@ slurm_kill_job ( uint32_t job_id, uint16_t signal, uint16_t batch_flag ) * IN signal - signal number * RET 0 on success, otherwise return -1 and set errno to indicate the error */ -int +int slurm_kill_job_step (uint32_t job_id, uint32_t step_id, uint16_t signal) { int rc; @@ -100,7 +100,7 @@ slurm_kill_job_step (uint32_t job_id, uint32_t step_id, uint16_t signal) job_step_kill_msg_t req; slurm_msg_t_init(&msg); - /* + /* * Request message: */ req.job_id = job_id; diff --git a/src/api/checkpoint.c b/src/api/checkpoint.c index 92463559ab..b571e836ed 100644 --- a/src/api/checkpoint.c +++ b/src/api/checkpoint.c @@ -7,32 +7,32 @@ * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Morris Jette et. al. * CODE-OCEC-09-009. All rights reserved. - * + * * This file is part of SLURM, a resource management program. * For details, see . * Please also read the included file: DISCLAIMER. - * + * * SLURM is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free * Software Foundation; either version 2 of the License, or (at your option) * any later version. * - * In addition, as a special exception, the copyright holders give permission - * to link the code of portions of this program with the OpenSSL library under - * certain conditions as described in each individual source file, and - * distribute linked combinations including the two. You must obey the GNU - * General Public License in all respects for all of the code used other than - * OpenSSL. If you modify file(s) with this exception, you may extend this - * exception to your version of the file(s), but you are not obligated to do + * In addition, as a special exception, the copyright holders give permission + * to link the code of portions of this program with the OpenSSL library under + * certain conditions as described in each individual source file, and + * distribute linked combinations including the two. You must obey the GNU + * General Public License in all respects for all of the code used other than + * OpenSSL. If you modify file(s) with this exception, you may extend this + * exception to your version of the file(s), but you are not obligated to do * so. If you do not wish to do so, delete this exception statement from your - * version. If you delete this exception statement from all source files in + * version. If you delete this exception statement from all source files in * the program, then also delete it here. - * + * * SLURM is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. - * + * * You should have received a copy of the GNU General Public License along * with SLURM; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. @@ -103,7 +103,7 @@ static int _checkpoint_op (uint16_t op, uint16_t data, * OUT start_time - time at which checkpoint request was issued * RET 0 (can be checkpoined) or a slurm error code */ -extern int slurm_checkpoint_able (uint32_t job_id, uint32_t step_id, +extern int slurm_checkpoint_able (uint32_t job_id, uint32_t step_id, time_t *start_time) { int rc; @@ -172,10 +172,10 @@ extern int slurm_checkpoint_enable (uint32_t job_id, uint32_t step_id) * IN image_dir - directory used to get/put checkpoint images * RET 0 or a slurm error code */ -extern int slurm_checkpoint_create (uint32_t job_id, uint32_t step_id, +extern int slurm_checkpoint_create (uint32_t job_id, uint32_t step_id, uint16_t max_wait, char *image_dir) { - return _checkpoint_op (CHECK_CREATE, max_wait, job_id, step_id, + return _checkpoint_op (CHECK_CREATE, max_wait, job_id, step_id, image_dir); } @@ -188,10 +188,10 @@ extern int slurm_checkpoint_create (uint32_t job_id, uint32_t step_id, * IN image_dir - directory used to get/put checkpoint images * RET 0 or a slurm error code */ -extern int slurm_checkpoint_vacate (uint32_t job_id, uint32_t step_id, +extern int slurm_checkpoint_vacate (uint32_t job_id, uint32_t step_id, uint16_t max_wait, char *image_dir) { - return _checkpoint_op (CHECK_VACATE, max_wait, job_id, step_id, + return _checkpoint_op (CHECK_VACATE, max_wait, job_id, step_id, image_dir); } @@ -241,7 +241,7 @@ extern int slurm_checkpoint_complete (uint32_t job_id, uint32_t step_id, } /* - * slurm_checkpoint_error - gather error information for the last checkpoint + * slurm_checkpoint_error - gather error information for the last checkpoint * operation for some job step * IN job_id - job on which to perform operation * IN step_id - job step on which to perform operation @@ -249,11 +249,11 @@ extern int slurm_checkpoint_complete (uint32_t job_id, uint32_t step_id, * this value is dependent upon the checkpoint plugin used and may be * completely unrelated to slurm error codes, the highest value for all * complete calls is preserved - * OUT error_msg - error message, preserved for highest error_code, value + * OUT error_msg - error message, preserved for highest error_code, value * must be freed by the caller to prevent memory leak * RET 0 or a slurm error code */ -extern int slurm_checkpoint_error ( uint32_t job_id, uint32_t step_id, +extern int slurm_checkpoint_error ( uint32_t job_id, uint32_t step_id, uint32_t *error_code, char **error_msg) { int rc; @@ -279,7 +279,7 @@ extern int slurm_checkpoint_error ( uint32_t job_id, uint32_t step_id, rc = slurm_send_recv_controller_msg(&msg, &resp_msg); - if (rc == SLURM_SOCKET_ERROR) + if (rc == SLURM_SOCKET_ERROR) return rc; switch (resp_msg.msg_type) { @@ -306,7 +306,7 @@ extern int slurm_checkpoint_error ( uint32_t job_id, uint32_t step_id, } /* - * Handle a return code message type. + * Handle a return code message type. * Sets errno to return code and returns it */ static int @@ -331,7 +331,7 @@ _handle_rc_msg(slurm_msg_t *msg) */ extern int slurm_checkpoint_task_complete (uint32_t job_id, uint32_t step_id, uint32_t task_id, time_t begin_time, - uint32_t error_code, + uint32_t error_code, char *error_msg) { int rc; diff --git a/src/api/complete.c b/src/api/complete.c index 7e4c6eceaf..9936c708b1 100644 --- a/src/api/complete.c +++ b/src/api/complete.c @@ -6,32 +6,32 @@ * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Morris Jette . * CODE-OCEC-09-009. All rights reserved. - * + * * This file is part of SLURM, a resource management program. * For details, see . * Please also read the included file: DISCLAIMER. - * + * * SLURM is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free * Software Foundation; either version 2 of the License, or (at your option) * any later version. * - * In addition, as a special exception, the copyright holders give permission - * to link the code of portions of this program with the OpenSSL library under - * certain conditions as described in each individual source file, and - * distribute linked combinations including the two. You must obey the GNU - * General Public License in all respects for all of the code used other than - * OpenSSL. If you modify file(s) with this exception, you may extend this - * exception to your version of the file(s), but you are not obligated to do + * In addition, as a special exception, the copyright holders give permission + * to link the code of portions of this program with the OpenSSL library under + * certain conditions as described in each individual source file, and + * distribute linked combinations including the two. You must obey the GNU + * General Public License in all respects for all of the code used other than + * OpenSSL. If you modify file(s) with this exception, you may extend this + * exception to your version of the file(s), but you are not obligated to do * so. If you do not wish to do so, delete this exception statement from your - * version. If you delete this exception statement from all source files in + * version. If you delete this exception statement from all source files in * the program, then also delete it here. - * + * * SLURM is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. - * + * * You should have received a copy of the GNU General Public License along * with SLURM; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. @@ -56,7 +56,7 @@ * IN job_return_code - the highest exit code of any task of the job * RET 0 on success, otherwise return -1 and set errno to indicate the error */ -int +int slurm_complete_job ( uint32_t job_id, uint32_t job_return_code ) { int rc; @@ -71,8 +71,8 @@ slurm_complete_job ( uint32_t job_id, uint32_t job_return_code ) req_msg.data = &req; if (slurm_send_recv_controller_rc_msg(&req_msg, &rc) < 0) - return SLURM_ERROR; - + return SLURM_ERROR; + if (rc) slurm_seterrno_ret(rc); diff --git a/src/api/config_info.c b/src/api/config_info.c index 0ac951ed0d..6f59a3228f 100644 --- a/src/api/config_info.c +++ b/src/api/config_info.c @@ -6,32 +6,32 @@ * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Morris Jette and Kevin Tew . * CODE-OCEC-09-009. All rights reserved. - * + * * This file is part of SLURM, a resource management program. * For details, see . * Please also read the included file: DISCLAIMER. - * + * * SLURM is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free * Software Foundation; either version 2 of the License, or (at your option) * any later version. * - * In addition, as a special exception, the copyright holders give permission + * In addition, as a special exception, the copyright holders give permission * to link the code of portions of this program with the OpenSSL library under - * certain conditions as described in each individual source file, and - * distribute linked combinations including the two. You must obey the GNU - * General Public License in all respects for all of the code used other than - * OpenSSL. If you modify file(s) with this exception, you may extend this - * exception to your version of the file(s), but you are not obligated to do + * certain conditions as described in each individual source file, and + * distribute linked combinations including the two. You must obey the GNU + * General Public License in all respects for all of the code used other than + * OpenSSL. If you modify file(s) with this exception, you may extend this + * exception to your version of the file(s), but you are not obligated to do * so. If you do not wish to do so, delete this exception statement from your - * version. If you delete this exception statement from all source files in + * version. If you delete this exception statement from all source files in * the program, then also delete it here. - * + * * SLURM is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. - * + * * You should have received a copy of the GNU General Public License along * with SLURM; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. @@ -56,8 +56,8 @@ #include "src/common/list.h" /* - * slurm_api_version - Return a single number reflecting the SLURM API's - * version number. Use the macros SLURM_VERSION_NUM, SLURM_VERSION_MAJOR, + * slurm_api_version - Return a single number reflecting the SLURM API's + * version number. Use the macros SLURM_VERSION_NUM, SLURM_VERSION_MAJOR, * SLURM_VERSION_MINOR, and SLURM_VERSION_MICRO to work with this value * RET API's version number */ @@ -147,12 +147,12 @@ _preempt_str(uint16_t preempt_mode) } /* - * slurm_print_ctl_conf - output the contents of slurm control configuration + * slurm_print_ctl_conf - output the contents of slurm control configuration * message as loaded using slurm_load_ctl_conf * IN out - file to write to * IN slurm_ctl_conf_ptr - slurm control configuration pointer */ -void slurm_print_ctl_conf ( FILE* out, +void slurm_print_ctl_conf ( FILE* out, slurm_ctl_conf_info_msg_t * slurm_ctl_conf_ptr ) { char time_str[32], tmp_str[128]; @@ -170,7 +170,7 @@ void slurm_print_ctl_conf ( FILE* out, if ( slurm_ctl_conf_ptr == NULL ) return ; - slurm_make_time_str((time_t *)&slurm_ctl_conf_ptr->last_update, + slurm_make_time_str((time_t *)&slurm_ctl_conf_ptr->last_update, time_str, sizeof(time_str)); snprintf(tmp_str, sizeof(tmp_str), "Configuration data as of %s\n", time_str); @@ -178,7 +178,7 @@ void slurm_print_ctl_conf ( FILE* out, ret_list = slurm_ctl_conf_2_key_pairs(slurm_ctl_conf_ptr); if(ret_list) { slurm_print_key_pairs(out, ret_list, tmp_str); - + list_destroy((List)ret_list); } @@ -194,7 +194,7 @@ extern void *slurm_ctl_conf_2_key_pairs (slurm_ctl_conf_t* slurm_ctl_conf_ptr) if ( slurm_ctl_conf_ptr == NULL ) return NULL; - + ret_list = list_create(destroy_config_key_pair); key_pair = xmalloc(sizeof(config_key_pair_t)); @@ -226,7 +226,7 @@ extern void *slurm_ctl_conf_2_key_pairs (slurm_ctl_conf_t* slurm_ctl_conf_ptr) key_pair->value = xstrdup(slurm_ctl_conf_ptr->accounting_storage_pass); list_append(ret_list, key_pair); - snprintf(tmp_str, sizeof(tmp_str), "%u", + snprintf(tmp_str, sizeof(tmp_str), "%u", slurm_ctl_conf_ptr->accounting_storage_port); key_pair = xmalloc(sizeof(config_key_pair_t)); key_pair->name = xstrdup("AccountingStoragePort"); @@ -258,7 +258,7 @@ extern void *slurm_ctl_conf_2_key_pairs (slurm_ctl_conf_t* slurm_ctl_conf_ptr) key_pair->value = xstrdup(slurm_ctl_conf_ptr->backup_controller); list_append(ret_list, key_pair); - snprintf(tmp_str, sizeof(tmp_str), "%u sec", + snprintf(tmp_str, sizeof(tmp_str), "%u sec", slurm_ctl_conf_ptr->batch_start_timeout); key_pair = xmalloc(sizeof(config_key_pair_t)); key_pair->name = xstrdup("BatchStartTimeout"); @@ -271,14 +271,14 @@ extern void *slurm_ctl_conf_2_key_pairs (slurm_ctl_conf_t* slurm_ctl_conf_ptr) key_pair->name = xstrdup("BOOT_TIME"); key_pair->value = xstrdup(tmp_str); list_append(ret_list, key_pair); - + snprintf(tmp_str, sizeof(tmp_str), "%u", slurm_ctl_conf_ptr->cache_groups); key_pair = xmalloc(sizeof(config_key_pair_t)); key_pair->name = xstrdup("CacheGroups"); key_pair->value = xstrdup(tmp_str); list_append(ret_list, key_pair); - + key_pair = xmalloc(sizeof(config_key_pair_t)); key_pair->name = xstrdup("CheckpointType"); key_pair->value = xstrdup(slurm_ctl_conf_ptr->checkpoint_type); @@ -310,7 +310,7 @@ extern void *slurm_ctl_conf_2_key_pairs (slurm_ctl_conf_t* slurm_ctl_conf_ptr) key_pair->name = xstrdup("CryptoType"); key_pair->value = xstrdup(slurm_ctl_conf_ptr->crypto_type); list_append(ret_list, key_pair); - + key_pair = xmalloc(sizeof(config_key_pair_t)); key_pair->name = xstrdup("DebugFlags"); key_pair->value = debug_flags2str(slurm_ctl_conf_ptr->debug_flags);; @@ -320,12 +320,12 @@ extern void *slurm_ctl_conf_2_key_pairs (slurm_ctl_conf_t* slurm_ctl_conf_ptr) list_append(ret_list, key_pair); key_pair->name = xstrdup("DefMemPerCPU"); if (slurm_ctl_conf_ptr->def_mem_per_cpu & MEM_PER_CPU) { - snprintf(tmp_str, sizeof(tmp_str), "%u", - slurm_ctl_conf_ptr->def_mem_per_cpu & + snprintf(tmp_str, sizeof(tmp_str), "%u", + slurm_ctl_conf_ptr->def_mem_per_cpu & (~MEM_PER_CPU)); key_pair->value = xstrdup(tmp_str); } else if (slurm_ctl_conf_ptr->def_mem_per_cpu) { - snprintf(tmp_str, sizeof(tmp_str), "%u", + snprintf(tmp_str, sizeof(tmp_str), "%u", slurm_ctl_conf_ptr->def_mem_per_cpu); key_pair->value = xstrdup(tmp_str); } else { @@ -353,7 +353,7 @@ extern void *slurm_ctl_conf_2_key_pairs (slurm_ctl_conf_t* slurm_ctl_conf_ptr) key_pair->value = xstrdup(slurm_ctl_conf_ptr->epilog); list_append(ret_list, key_pair); - snprintf(tmp_str, sizeof(tmp_str), "%u usec", + snprintf(tmp_str, sizeof(tmp_str), "%u usec", slurm_ctl_conf_ptr->epilog_msg_time); key_pair = xmalloc(sizeof(config_key_pair_t)); key_pair->name = xstrdup("EpilogMsgTime"); @@ -372,21 +372,21 @@ extern void *slurm_ctl_conf_2_key_pairs (slurm_ctl_conf_t* slurm_ctl_conf_ptr) key_pair->value = xstrdup(tmp_str); list_append(ret_list, key_pair); - snprintf(tmp_str, sizeof(tmp_str), "%u", + snprintf(tmp_str, sizeof(tmp_str), "%u", slurm_ctl_conf_ptr->first_job_id); key_pair = xmalloc(sizeof(config_key_pair_t)); key_pair->name = xstrdup("FirstJobId"); key_pair->value = xstrdup(tmp_str); list_append(ret_list, key_pair); - snprintf(tmp_str, sizeof(tmp_str), "%u sec", + snprintf(tmp_str, sizeof(tmp_str), "%u sec", slurm_ctl_conf_ptr->get_env_timeout); key_pair = xmalloc(sizeof(config_key_pair_t)); key_pair->name = xstrdup("GetEnvTimeout"); key_pair->value = xstrdup(tmp_str); list_append(ret_list, key_pair); - snprintf(tmp_str, sizeof(tmp_str), "%u sec", + snprintf(tmp_str, sizeof(tmp_str), "%u sec", slurm_ctl_conf_ptr->health_check_interval); key_pair = xmalloc(sizeof(config_key_pair_t)); key_pair->name = xstrdup("HealthCheckInterval"); @@ -411,7 +411,7 @@ extern void *slurm_ctl_conf_2_key_pairs (slurm_ctl_conf_t* slurm_ctl_conf_ptr) key_pair->value = xstrdup(tmp_str); list_append(ret_list, key_pair); - snprintf(tmp_str, sizeof(tmp_str), "%u sec", + snprintf(tmp_str, sizeof(tmp_str), "%u sec", slurm_ctl_conf_ptr->job_acct_gather_freq); key_pair = xmalloc(sizeof(config_key_pair_t)); key_pair->name = xstrdup("JobAcctGatherFrequency"); @@ -443,7 +443,7 @@ extern void *slurm_ctl_conf_2_key_pairs (slurm_ctl_conf_t* slurm_ctl_conf_ptr) key_pair->value = xstrdup(slurm_ctl_conf_ptr->job_comp_pass); list_append(ret_list, key_pair); - snprintf(tmp_str, sizeof(tmp_str), "%u", + snprintf(tmp_str, sizeof(tmp_str), "%u", slurm_ctl_conf_ptr->job_comp_port); key_pair = xmalloc(sizeof(config_key_pair_t)); key_pair->name = xstrdup("JobCompPort"); @@ -486,14 +486,14 @@ extern void *slurm_ctl_conf_2_key_pairs (slurm_ctl_conf_t* slurm_ctl_conf_ptr) key_pair->value = xstrdup(tmp_str); list_append(ret_list, key_pair); - snprintf(tmp_str, sizeof(tmp_str), "%u", + snprintf(tmp_str, sizeof(tmp_str), "%u", slurm_ctl_conf_ptr->kill_on_bad_exit); key_pair = xmalloc(sizeof(config_key_pair_t)); key_pair->name = xstrdup("KillOnBadExit"); key_pair->value = xstrdup(tmp_str); list_append(ret_list, key_pair); - snprintf(tmp_str, sizeof(tmp_str), "%u sec", + snprintf(tmp_str, sizeof(tmp_str), "%u sec", slurm_ctl_conf_ptr->kill_wait); key_pair = xmalloc(sizeof(config_key_pair_t)); key_pair->name = xstrdup("KillWait"); @@ -510,7 +510,7 @@ extern void *slurm_ctl_conf_2_key_pairs (slurm_ctl_conf_t* slurm_ctl_conf_ptr) key_pair->value = xstrdup(slurm_ctl_conf_ptr->mail_prog); list_append(ret_list, key_pair); - snprintf(tmp_str, sizeof(tmp_str), "%u", + snprintf(tmp_str, sizeof(tmp_str), "%u", slurm_ctl_conf_ptr->max_job_cnt); key_pair = xmalloc(sizeof(config_key_pair_t)); key_pair->name = xstrdup("MaxJobCount"); @@ -521,33 +521,33 @@ extern void *slurm_ctl_conf_2_key_pairs (slurm_ctl_conf_t* slurm_ctl_conf_ptr) list_append(ret_list, key_pair); key_pair->name = xstrdup("MaxMemPerCPU"); if (slurm_ctl_conf_ptr->max_mem_per_cpu & MEM_PER_CPU) { - snprintf(tmp_str, sizeof(tmp_str), "%u", + snprintf(tmp_str, sizeof(tmp_str), "%u", slurm_ctl_conf_ptr->max_mem_per_cpu & (~MEM_PER_CPU)); key_pair->value = xstrdup(tmp_str); } else if (slurm_ctl_conf_ptr->max_mem_per_cpu) { - snprintf(tmp_str, sizeof(tmp_str), "%u", + snprintf(tmp_str, sizeof(tmp_str), "%u", slurm_ctl_conf_ptr->max_mem_per_cpu); key_pair->value = xstrdup(tmp_str); } else { key_pair->value = xstrdup("UNLIMITED"); } - snprintf(tmp_str, sizeof(tmp_str), "%u", + snprintf(tmp_str, sizeof(tmp_str), "%u", slurm_ctl_conf_ptr->max_tasks_per_node); key_pair = xmalloc(sizeof(config_key_pair_t)); key_pair->name = xstrdup("MaxTasksPerNode"); key_pair->value = xstrdup(tmp_str); list_append(ret_list, key_pair); - snprintf(tmp_str, sizeof(tmp_str), "%u sec", + snprintf(tmp_str, sizeof(tmp_str), "%u sec", slurm_ctl_conf_ptr->msg_timeout); key_pair = xmalloc(sizeof(config_key_pair_t)); key_pair->name = xstrdup("MessageTimeout"); key_pair->value = xstrdup(tmp_str); list_append(ret_list, key_pair); - snprintf(tmp_str, sizeof(tmp_str), "%u sec", + snprintf(tmp_str, sizeof(tmp_str), "%u sec", slurm_ctl_conf_ptr->min_job_age); key_pair = xmalloc(sizeof(config_key_pair_t)); key_pair->name = xstrdup("MinJobAge"); @@ -571,7 +571,7 @@ extern void *slurm_ctl_conf_2_key_pairs (slurm_ctl_conf_t* slurm_ctl_conf_ptr) list_append(ret_list, key_pair); #endif - snprintf(tmp_str, sizeof(tmp_str), "%u", + snprintf(tmp_str, sizeof(tmp_str), "%u", slurm_ctl_conf_ptr->next_job_id); key_pair = xmalloc(sizeof(config_key_pair_t)); key_pair->name = xstrdup("NEXT_JOB_ID"); @@ -581,13 +581,13 @@ extern void *slurm_ctl_conf_2_key_pairs (slurm_ctl_conf_t* slurm_ctl_conf_ptr) if (slurm_ctl_conf_ptr->over_time_limit == (uint16_t) INFINITE) snprintf(tmp_str, sizeof(tmp_str), "UNLIMITED"); else - snprintf(tmp_str, sizeof(tmp_str), "%u min", + snprintf(tmp_str, sizeof(tmp_str), "%u min", slurm_ctl_conf_ptr->over_time_limit); key_pair = xmalloc(sizeof(config_key_pair_t)); key_pair->name = xstrdup("OverTimeLimit"); key_pair->value = xstrdup(tmp_str); list_append(ret_list, key_pair); - + key_pair = xmalloc(sizeof(config_key_pair_t)); key_pair->name = xstrdup("PluginDir"); key_pair->value = xstrdup(slurm_ctl_conf_ptr->plugindir); @@ -622,7 +622,7 @@ extern void *slurm_ctl_conf_2_key_pairs (slurm_ctl_conf_t* slurm_ctl_conf_ptr) key_pair->value = xstrdup(tmp_str); list_append(ret_list, key_pair); - snprintf(tmp_str, sizeof(tmp_str), "%u", + snprintf(tmp_str, sizeof(tmp_str), "%u", slurm_ctl_conf_ptr->priority_favor_small); key_pair = xmalloc(sizeof(config_key_pair_t)); key_pair->name = xstrdup("PriorityFavorSmall"); @@ -648,35 +648,35 @@ extern void *slurm_ctl_conf_2_key_pairs (slurm_ctl_conf_t* slurm_ctl_conf_ptr) key_pair->value = xstrdup(slurm_ctl_conf_ptr->priority_type); list_append(ret_list, key_pair); - snprintf(tmp_str, sizeof(tmp_str), "%u", + snprintf(tmp_str, sizeof(tmp_str), "%u", slurm_ctl_conf_ptr->priority_weight_age); key_pair = xmalloc(sizeof(config_key_pair_t)); key_pair->name = xstrdup("PriorityWeightAge"); key_pair->value = xstrdup(tmp_str); list_append(ret_list, key_pair); - snprintf(tmp_str, sizeof(tmp_str), "%u", + snprintf(tmp_str, sizeof(tmp_str), "%u", slurm_ctl_conf_ptr->priority_weight_fs); key_pair = xmalloc(sizeof(config_key_pair_t)); key_pair->name = xstrdup("PriorityWeightFairShare"); key_pair->value = xstrdup(tmp_str); list_append(ret_list, key_pair); - snprintf(tmp_str, sizeof(tmp_str), "%u", + snprintf(tmp_str, sizeof(tmp_str), "%u", slurm_ctl_conf_ptr->priority_weight_js); key_pair = xmalloc(sizeof(config_key_pair_t)); key_pair->name = xstrdup("PriorityWeightJobSize"); key_pair->value = xstrdup(tmp_str); list_append(ret_list, key_pair); - - snprintf(tmp_str, sizeof(tmp_str), "%u", + + snprintf(tmp_str, sizeof(tmp_str), "%u", slurm_ctl_conf_ptr->priority_weight_part); key_pair = xmalloc(sizeof(config_key_pair_t)); key_pair->name = xstrdup("PriorityWeightPartition"); key_pair->value = xstrdup(tmp_str); list_append(ret_list, key_pair); - snprintf(tmp_str, sizeof(tmp_str), "%u", + snprintf(tmp_str, sizeof(tmp_str), "%u", slurm_ctl_conf_ptr->priority_weight_qos); key_pair = xmalloc(sizeof(config_key_pair_t)); key_pair->name = xstrdup("PriorityWeightQOS"); @@ -685,7 +685,7 @@ extern void *slurm_ctl_conf_2_key_pairs (slurm_ctl_conf_t* slurm_ctl_conf_ptr) } - private_data_string(slurm_ctl_conf_ptr->private_data, + private_data_string(slurm_ctl_conf_ptr->private_data, tmp_str, sizeof(tmp_str)); key_pair = xmalloc(sizeof(config_key_pair_t)); key_pair->name = xstrdup("PrivateData"); @@ -707,7 +707,7 @@ extern void *slurm_ctl_conf_2_key_pairs (slurm_ctl_conf_t* slurm_ctl_conf_ptr) key_pair->value = xstrdup(slurm_ctl_conf_ptr->prolog_slurmctld); list_append(ret_list, key_pair); - snprintf(tmp_str, sizeof(tmp_str), "%u", + snprintf(tmp_str, sizeof(tmp_str), "%u", slurm_ctl_conf_ptr->propagate_prio_process); key_pair = xmalloc(sizeof(config_key_pair_t)); key_pair->name = xstrdup("PropagatePrioProcess"); @@ -718,7 +718,7 @@ extern void *slurm_ctl_conf_2_key_pairs (slurm_ctl_conf_t* slurm_ctl_conf_ptr) key_pair->name = xstrdup("PropagateResourceLimits"); key_pair->value = xstrdup(slurm_ctl_conf_ptr->propagate_rlimits); list_append(ret_list, key_pair); - + key_pair = xmalloc(sizeof(config_key_pair_t)); key_pair->name = xstrdup("PropagateResourceLimitsExcept"); key_pair->value = xstrdup(slurm_ctl_conf_ptr->propagate_rlimits_except); @@ -729,14 +729,14 @@ extern void *slurm_ctl_conf_2_key_pairs (slurm_ctl_conf_t* slurm_ctl_conf_ptr) key_pair->value = xstrdup(slurm_ctl_conf_ptr->resume_program); list_append(ret_list, key_pair); - snprintf(tmp_str, sizeof(tmp_str), "%u nodes/min", + snprintf(tmp_str, sizeof(tmp_str), "%u nodes/min", slurm_ctl_conf_ptr->resume_rate); key_pair = xmalloc(sizeof(config_key_pair_t)); key_pair->name = xstrdup("ResumeRate"); key_pair->value = xstrdup(tmp_str); list_append(ret_list, key_pair); - snprintf(tmp_str, sizeof(tmp_str), "%u sec", + snprintf(tmp_str, sizeof(tmp_str), "%u sec", slurm_ctl_conf_ptr->resume_timeout); key_pair = xmalloc(sizeof(config_key_pair_t)); key_pair->name = xstrdup("ResumeTimeout"); @@ -751,7 +751,7 @@ extern void *slurm_ctl_conf_2_key_pairs (slurm_ctl_conf_t* slurm_ctl_conf_ptr) key_pair = xmalloc(sizeof(config_key_pair_t)); key_pair->name = xstrdup("ResvOverRun"); key_pair->value = xstrdup(tmp_str); - list_append(ret_list, key_pair); + list_append(ret_list, key_pair); snprintf(tmp_str, sizeof(tmp_str), "%u", slurm_ctl_conf_ptr->ret2service); @@ -759,7 +759,7 @@ extern void *slurm_ctl_conf_2_key_pairs (slurm_ctl_conf_t* slurm_ctl_conf_ptr) key_pair->name = xstrdup("ReturnToService"); key_pair->value = xstrdup(tmp_str); list_append(ret_list, key_pair); - + key_pair = xmalloc(sizeof(config_key_pair_t)); key_pair->name = xstrdup("SallocDefaultCommand"); key_pair->value = xstrdup(slurm_ctl_conf_ptr->salloc_default_command); @@ -776,14 +776,14 @@ extern void *slurm_ctl_conf_2_key_pairs (slurm_ctl_conf_t* slurm_ctl_conf_ptr) key_pair->value = xstrdup(tmp_str); list_append(ret_list, key_pair); - snprintf(tmp_str, sizeof(tmp_str), "%u", + snprintf(tmp_str, sizeof(tmp_str), "%u", slurm_ctl_conf_ptr->schedrootfltr); key_pair = xmalloc(sizeof(config_key_pair_t)); key_pair->name = xstrdup("SchedulerRootFilter"); key_pair->value = xstrdup(tmp_str); list_append(ret_list, key_pair); - snprintf(tmp_str, sizeof(tmp_str), "%u sec", + snprintf(tmp_str, sizeof(tmp_str), "%u sec", slurm_ctl_conf_ptr->sched_time_slice); key_pair = xmalloc(sizeof(config_key_pair_t)); key_pair->name = xstrdup("SchedulerTimeSlice"); @@ -799,7 +799,7 @@ extern void *slurm_ctl_conf_2_key_pairs (slurm_ctl_conf_t* slurm_ctl_conf_ptr) key_pair->name = xstrdup("SelectType"); key_pair->value = xstrdup(slurm_ctl_conf_ptr->select_type); list_append(ret_list, key_pair); - + if (slurm_ctl_conf_ptr->select_type_param) { key_pair = xmalloc(sizeof(config_key_pair_t)); key_pair->name = xstrdup("SelectTypeParameters"); @@ -808,7 +808,7 @@ extern void *slurm_ctl_conf_2_key_pairs (slurm_ctl_conf_t* slurm_ctl_conf_ptr) list_append(ret_list, key_pair); } - snprintf(tmp_str, sizeof(tmp_str), "%s(%u)", + snprintf(tmp_str, sizeof(tmp_str), "%s(%u)", slurm_ctl_conf_ptr->slurm_user_name, slurm_ctl_conf_ptr->slurm_user_id); key_pair = xmalloc(sizeof(config_key_pair_t)); @@ -816,7 +816,7 @@ extern void *slurm_ctl_conf_2_key_pairs (slurm_ctl_conf_t* slurm_ctl_conf_ptr) key_pair->value = xstrdup(tmp_str); list_append(ret_list, key_pair); - snprintf(tmp_str, sizeof(tmp_str), "%u", + snprintf(tmp_str, sizeof(tmp_str), "%u", slurm_ctl_conf_ptr->slurmctld_debug); key_pair = xmalloc(sizeof(config_key_pair_t)); key_pair->name = xstrdup("SlurmctldDebug"); @@ -840,7 +840,7 @@ extern void *slurm_ctl_conf_2_key_pairs (slurm_ctl_conf_t* slurm_ctl_conf_ptr) key_pair->value = xstrdup(tmp_str); list_append(ret_list, key_pair); - snprintf(tmp_str, sizeof(tmp_str), "%u sec", + snprintf(tmp_str, sizeof(tmp_str), "%u sec", slurm_ctl_conf_ptr->slurmctld_timeout); key_pair = xmalloc(sizeof(config_key_pair_t)); key_pair->name = xstrdup("SlurmctldTimeout"); @@ -878,15 +878,15 @@ extern void *slurm_ctl_conf_2_key_pairs (slurm_ctl_conf_t* slurm_ctl_conf_ptr) key_pair->value = xstrdup(slurm_ctl_conf_ptr->slurmd_spooldir); list_append(ret_list, key_pair); - snprintf(tmp_str, sizeof(tmp_str), "%u sec", + snprintf(tmp_str, sizeof(tmp_str), "%u sec", slurm_ctl_conf_ptr->slurmd_timeout); key_pair = xmalloc(sizeof(config_key_pair_t)); key_pair->name = xstrdup("SlurmdTimeout"); key_pair->value = xstrdup(tmp_str); list_append(ret_list, key_pair); - snprintf(tmp_str, sizeof(tmp_str), "%s(%u)", - slurm_ctl_conf_ptr->slurmd_user_name, + snprintf(tmp_str, sizeof(tmp_str), "%s(%u)", + slurm_ctl_conf_ptr->slurmd_user_name, slurm_ctl_conf_ptr->slurmd_user_id); key_pair = xmalloc(sizeof(config_key_pair_t)); key_pair->name = xstrdup("SlurmdUser"); @@ -933,24 +933,24 @@ extern void *slurm_ctl_conf_2_key_pairs (slurm_ctl_conf_t* slurm_ctl_conf_ptr) key_pair->value = xstrdup(slurm_ctl_conf_ptr->suspend_program); list_append(ret_list, key_pair); - snprintf(tmp_str, sizeof(tmp_str), "%u nodes/min", + snprintf(tmp_str, sizeof(tmp_str), "%u nodes/min", slurm_ctl_conf_ptr->suspend_rate); key_pair = xmalloc(sizeof(config_key_pair_t)); key_pair->name = xstrdup("SuspendRate"); key_pair->value = xstrdup(tmp_str); list_append(ret_list, key_pair); - if (!slurm_ctl_conf_ptr->suspend_time) + if (!slurm_ctl_conf_ptr->suspend_time) snprintf(tmp_str, sizeof(tmp_str), "NONE"); else - snprintf(tmp_str, sizeof(tmp_str), "%d sec", + snprintf(tmp_str, sizeof(tmp_str), "%d sec", ((int)slurm_ctl_conf_ptr->suspend_time - 1)); key_pair = xmalloc(sizeof(config_key_pair_t)); key_pair->name = xstrdup("SuspendTime"); key_pair->value = xstrdup(tmp_str); list_append(ret_list, key_pair); - snprintf(tmp_str, sizeof(tmp_str), "%u sec", + snprintf(tmp_str, sizeof(tmp_str), "%u sec", slurm_ctl_conf_ptr->suspend_timeout); key_pair = xmalloc(sizeof(config_key_pair_t)); key_pair->name = xstrdup("SuspendTimeout"); @@ -972,7 +972,7 @@ extern void *slurm_ctl_conf_2_key_pairs (slurm_ctl_conf_t* slurm_ctl_conf_ptr) key_pair->value = xstrdup(slurm_ctl_conf_ptr->task_plugin); list_append(ret_list, key_pair); - slurm_sprint_cpu_bind_type(tmp_str, + slurm_sprint_cpu_bind_type(tmp_str, slurm_ctl_conf_ptr->task_plugin_param); key_pair = xmalloc(sizeof(config_key_pair_t)); key_pair->name = xstrdup("TaskPluginParam"); @@ -994,21 +994,21 @@ extern void *slurm_ctl_conf_2_key_pairs (slurm_ctl_conf_t* slurm_ctl_conf_ptr) key_pair->value = xstrdup(slurm_ctl_conf_ptr->topology_plugin); list_append(ret_list, key_pair); - snprintf(tmp_str, sizeof(tmp_str), "%u", + snprintf(tmp_str, sizeof(tmp_str), "%u", slurm_ctl_conf_ptr->track_wckey); key_pair = xmalloc(sizeof(config_key_pair_t)); key_pair->name = xstrdup("TrackWCKey"); key_pair->value = xstrdup(tmp_str); list_append(ret_list, key_pair); - snprintf(tmp_str, sizeof(tmp_str), "%u", + snprintf(tmp_str, sizeof(tmp_str), "%u", slurm_ctl_conf_ptr->tree_width); key_pair = xmalloc(sizeof(config_key_pair_t)); key_pair->name = xstrdup("TreeWidth"); key_pair->value = xstrdup(tmp_str); list_append(ret_list, key_pair); - snprintf(tmp_str, sizeof(tmp_str), "%u", + snprintf(tmp_str, sizeof(tmp_str), "%u", slurm_ctl_conf_ptr->use_pam); key_pair = xmalloc(sizeof(config_key_pair_t)); key_pair->name = xstrdup("UsePam"); @@ -1027,21 +1027,21 @@ extern void *slurm_ctl_conf_2_key_pairs (slurm_ctl_conf_t* slurm_ctl_conf_ptr) key_pair->value = xstrdup(tmp_str); list_append(ret_list, key_pair); - snprintf(tmp_str, sizeof(tmp_str), "%u sec", + snprintf(tmp_str, sizeof(tmp_str), "%u sec", slurm_ctl_conf_ptr->wait_time); key_pair = xmalloc(sizeof(config_key_pair_t)); key_pair->name = xstrdup("WaitTime"); key_pair->value = xstrdup(tmp_str); - list_append(ret_list, key_pair); + list_append(ret_list, key_pair); return (void *)ret_list; } /* - * slurm_load_ctl_conf - issue RPC to get slurm control configuration - * information if changed since update_time + * slurm_load_ctl_conf - issue RPC to get slurm control configuration + * information if changed since update_time * IN update_time - time of current configuration data - * IN slurm_ctl_conf_ptr - place to store slurm control configuration + * IN slurm_ctl_conf_ptr - place to store slurm control configuration * pointer * RET 0 on success, otherwise return -1 and set errno to indicate the error * NOTE: free the response using slurm_free_ctl_conf @@ -1052,8 +1052,8 @@ slurm_load_ctl_conf (time_t update_time, slurm_ctl_conf_t **confp) int rc; slurm_msg_t req_msg; slurm_msg_t resp_msg; - last_update_msg_t req; - + last_update_msg_t req; + slurm_msg_t_init(&req_msg); slurm_msg_t_init(&resp_msg); @@ -1061,7 +1061,7 @@ slurm_load_ctl_conf (time_t update_time, slurm_ctl_conf_t **confp) req_msg.msg_type = REQUEST_BUILD_INFO; req_msg.data = &req; - if (slurm_send_recv_controller_msg(&req_msg, &resp_msg) < 0) + if (slurm_send_recv_controller_msg(&req_msg, &resp_msg) < 0) return SLURM_ERROR; switch (resp_msg.msg_type) { @@ -1070,8 +1070,8 @@ slurm_load_ctl_conf (time_t update_time, slurm_ctl_conf_t **confp) break; case RESPONSE_SLURM_RC: rc = ((return_code_msg_t *) resp_msg.data)->return_code; - slurm_free_return_code_msg(resp_msg.data); - if (rc) + slurm_free_return_code_msg(resp_msg.data); + if (rc) slurm_seterrno_ret(rc); break; default: @@ -1082,7 +1082,7 @@ slurm_load_ctl_conf (time_t update_time, slurm_ctl_conf_t **confp) } /* - * slurm_load_slurmd_status - issue RPC to get the status of slurmd + * slurm_load_slurmd_status - issue RPC to get the status of slurmd * daemon on this machine * IN slurmd_info_ptr - place to store slurmd status information * RET 0 or -1 on error @@ -1106,13 +1106,13 @@ slurm_load_slurmd_status(slurmd_status_t **slurmd_status_ptr) this_addr = slurm_conf_get_nodeaddr(this_host); if (this_addr == NULL) this_addr = xstrdup("localhost"); - slurm_set_addr(&req_msg.address, (uint16_t)slurm_get_slurmd_port(), + slurm_set_addr(&req_msg.address, (uint16_t)slurm_get_slurmd_port(), this_addr); xfree(this_addr); req_msg.msg_type = REQUEST_DAEMON_STATUS; req_msg.data = NULL; - + rc = slurm_send_recv_node_msg(&req_msg, &resp_msg, 0); if ((rc != 0) || !resp_msg.auth_cred) { @@ -1130,8 +1130,8 @@ slurm_load_slurmd_status(slurmd_status_t **slurmd_status_ptr) break; case RESPONSE_SLURM_RC: rc = ((return_code_msg_t *) resp_msg.data)->return_code; - slurm_free_return_code_msg(resp_msg.data); - if (rc) + slurm_free_return_code_msg(resp_msg.data); + if (rc) slurm_seterrno_ret(rc); break; default: @@ -1143,12 +1143,12 @@ slurm_load_slurmd_status(slurmd_status_t **slurmd_status_ptr) } /* - * slurm_print_slurmd_status - output the contents of slurmd status + * slurm_print_slurmd_status - output the contents of slurmd status * message as loaded using slurm_load_slurmd_status * IN out - file to write to * IN slurmd_status_ptr - slurmd status pointer */ -void slurm_print_slurmd_status (FILE* out, +void slurm_print_slurmd_status (FILE* out, slurmd_status_t * slurmd_status_ptr) { char time_str[32]; @@ -1172,7 +1172,7 @@ void slurm_print_slurmd_status (FILE* out, fprintf(out, "Actual temp disk space = %u MB\n", slurmd_status_ptr->actual_tmp_disk); - slurm_make_time_str ((time_t *)&slurmd_status_ptr->booted, + slurm_make_time_str ((time_t *)&slurmd_status_ptr->booted, time_str, sizeof(time_str)); fprintf(out, "Boot time = %s\n", time_str); @@ -1181,10 +1181,10 @@ void slurm_print_slurmd_status (FILE* out, if (slurmd_status_ptr->last_slurmctld_msg) { slurm_make_time_str ((time_t *) - &slurmd_status_ptr->last_slurmctld_msg, + &slurmd_status_ptr->last_slurmctld_msg, time_str, sizeof(time_str)); fprintf(out, "Last slurmctld msg time = %s\n", time_str); - } else + } else fprintf(out, "Last slurmctld msg time = NONE\n"); fprintf(out, "Slurmd PID = %u\n", @@ -1206,7 +1206,7 @@ extern void slurm_print_key_pairs(FILE* out, void *key_pairs, char *title) if (!config_list) return; - + fprintf(out, "%s", title); iter = list_iterator_create(config_list); while((key_pair = list_next(iter))) { diff --git a/src/api/init_msg.c b/src/api/init_msg.c index 4b6e59c8ae..00e940e75a 100644 --- a/src/api/init_msg.c +++ b/src/api/init_msg.c @@ -6,32 +6,32 @@ * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Morris Jette . * CODE-OCEC-09-009. All rights reserved. - * + * * This file is part of SLURM, a resource management program. * For details, see . * Please also read the included file: DISCLAIMER. - * + * * SLURM is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free * Software Foundation; either version 2 of the License, or (at your option) * any later version. * - * In addition, as a special exception, the copyright holders give permission + * In addition, as a special exception, the copyright holders give permission * to link the code of portions of this program with the OpenSSL library under - * certain conditions as described in each individual source file, and - * distribute linked combinations including the two. You must obey the GNU - * General Public License in all respects for all of the code used other than - * OpenSSL. If you modify file(s) with this exception, you may extend this - * exception to your version of the file(s), but you are not obligated to do + * certain conditions as described in each individual source file, and + * distribute linked combinations including the two. You must obey the GNU + * General Public License in all respects for all of the code used other than + * OpenSSL. If you modify file(s) with this exception, you may extend this + * exception to your version of the file(s), but you are not obligated to do * so. If you do not wish to do so, delete this exception statement from your - * version. If you delete this exception statement from all source files in + * version. If you delete this exception statement from all source files in * the program, then also delete it here. - * + * * SLURM is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. - * + * * You should have received a copy of the GNU General Public License along * with SLURM; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. @@ -50,8 +50,8 @@ #include "src/common/forward.h" /* - * slurm_init_job_desc_msg - initialize job descriptor with - * default values + * slurm_init_job_desc_msg - initialize job descriptor with + * default values * IN/OUT job_desc_msg - user defined job descriptor */ void slurm_init_job_desc_msg(job_desc_msg_t * job_desc_msg) @@ -101,8 +101,8 @@ void slurm_init_job_desc_msg(job_desc_msg_t * job_desc_msg) } /* - * slurm_init_part_desc_msg - initialize partition descriptor with - * default values + * slurm_init_part_desc_msg - initialize partition descriptor with + * default values * IN/OUT update_part_msg - user defined partition descriptor */ void slurm_init_part_desc_msg (update_part_msg_t * update_part_msg) @@ -121,8 +121,8 @@ void slurm_init_part_desc_msg (update_part_msg_t * update_part_msg) } /* - * slurm_init_resv_desc_msg - initialize reservation descriptor with - * default values + * slurm_init_resv_desc_msg - initialize reservation descriptor with + * default values * OUT job_desc_msg - user defined partition descriptor */ void slurm_init_resv_desc_msg (resv_desc_msg_t * resv_msg) @@ -158,5 +158,5 @@ void slurm_init_update_block_msg (update_block_msg_t *update_block_msg) update_block_msg->node_cnt = NO_VAL; update_block_msg->node_use = (uint16_t)NO_VAL; update_block_msg->state = (uint16_t)NO_VAL; - + } diff --git a/src/api/job_info.c b/src/api/job_info.c index 864c701ce5..981f3c89e3 100644 --- a/src/api/job_info.c +++ b/src/api/job_info.c @@ -6,32 +6,32 @@ * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Morris Jette et. al. * CODE-OCEC-09-009. All rights reserved. - * + * * This file is part of SLURM, a resource management program. * For details, see . * Please also read the included file: DISCLAIMER. - * + * * SLURM is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free * Software Foundation; either version 2 of the License, or (at your option) * any later version. * - * In addition, as a special exception, the copyright holders give permission + * In addition, as a special exception, the copyright holders give permission * to link the code of portions of this program with the OpenSSL library under - * certain conditions as described in each individual source file, and - * distribute linked combinations including the two. You must obey the GNU - * General Public License in all respects for all of the code used other than - * OpenSSL. If you modify file(s) with this exception, you may extend this - * exception to your version of the file(s), but you are not obligated to do + * certain conditions as described in each individual source file, and + * distribute linked combinations including the two. You must obey the GNU + * General Public License in all respects for all of the code used other than + * OpenSSL. If you modify file(s) with this exception, you may extend this + * exception to your version of the file(s), but you are not obligated to do * so. If you do not wish to do so, delete this exception statement from your - * version. If you delete this exception statement from all source files in + * version. If you delete this exception statement from all source files in * the program, then also delete it here. - * + * * SLURM is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more - * details. - * + * details. + * * You should have received a copy of the GNU General Public License along * with SLURM; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. @@ -64,25 +64,25 @@ #include "src/common/xstring.h" /* - * slurm_print_job_info_msg - output information about all Slurm + * slurm_print_job_info_msg - output information about all Slurm * jobs based upon message as loaded using slurm_load_jobs * IN out - file to write to * IN job_info_msg_ptr - job information message pointer * IN one_liner - print as a single line if true */ -extern void +extern void slurm_print_job_info_msg ( FILE* out, job_info_msg_t *jinfo, int one_liner ) { int i; job_info_t *job_ptr = jinfo->job_array; char time_str[32]; - slurm_make_time_str ((time_t *)&jinfo->last_update, time_str, + slurm_make_time_str ((time_t *)&jinfo->last_update, time_str, sizeof(time_str)); fprintf( out, "Job data as of %s, record count %d\n", time_str, jinfo->record_count); - for (i = 0; i < jinfo->record_count; i++) + for (i = 0; i < jinfo->record_count; i++) slurm_print_job_info(out, &job_ptr[i], one_liner); } @@ -110,7 +110,7 @@ static void _sprint_range(char *str, uint32_t str_size, } /* - * slurm_print_job_info - output information about a specific Slurm + * slurm_print_job_info - output information about a specific Slurm * job based upon message as loaded using slurm_load_jobs * IN out - file to write to * IN job_ptr - an individual job information record pointer @@ -125,7 +125,7 @@ slurm_print_job_info ( FILE* out, job_info_t * job_ptr, int one_liner ) } /* - * slurm_sprint_job_info - output information about a specific Slurm + * slurm_sprint_job_info - output information about a specific Slurm * job based upon message as loaded using slurm_load_jobs * IN job_ptr - an individual job information record pointer * IN one_liner - print as a single line if true @@ -147,8 +147,8 @@ slurm_sprint_job_info ( job_info_t * job_ptr, int one_liner ) #ifdef HAVE_BG char *nodelist = "BP_List"; - select_g_select_jobinfo_get(job_ptr->select_jobinfo, - SELECT_JOBDATA_IONODES, + select_g_select_jobinfo_get(job_ptr->select_jobinfo, + SELECT_JOBDATA_IONODES, &ionodes); #else bitstr_t *core_bitmap; @@ -355,8 +355,8 @@ slurm_sprint_job_info ( job_info_t * job_ptr, int one_liner ) _sprint_range(tmp2, sizeof(tmp2), min_nodes, max_nodes); snprintf(tmp_line, sizeof(tmp_line), "NumNodes=%s NumCPUs=%s CPUs/Task=%u ReqS:C:T=%u:%u:%u", - tmp2, tmp1, job_ptr->cpus_per_task, - job_ptr->min_sockets, + tmp2, tmp1, job_ptr->cpus_per_task, + job_ptr->min_sockets, job_ptr->min_cores, job_ptr->min_threads); xstrcat(out, tmp_line); @@ -524,7 +524,7 @@ slurm_sprint_job_info ( job_info_t * job_ptr, int one_liner ) #endif /****** Line 13 ******/ -line13: +line13: if (job_ptr->job_min_memory & MEM_PER_CPU) { job_ptr->job_min_memory &= (~MEM_PER_CPU); tmp3_ptr = "CPU"; @@ -593,7 +593,7 @@ line13: xstrcat(out, " "); else xstrcat(out, "\n "); - snprintf(tmp_line, sizeof(tmp_line), "Comment=%s ", + snprintf(tmp_line, sizeof(tmp_line), "Comment=%s ", job_ptr->comment); xstrcat(out, tmp_line); } @@ -702,8 +702,8 @@ line13: } /* - * slurm_load_jobs - issue RPC to get all job configuration - * information if changed since update_time + * slurm_load_jobs - issue RPC to get all job configuration + * information if changed since update_time * IN update_time - time of current configuration data * IN job_info_msg_pptr - place to store a job configuration pointer * IN show_flags - job filtering option: 0, SHOW_ALL or SHOW_DETAIL @@ -736,8 +736,8 @@ slurm_load_jobs (time_t update_time, job_info_msg_t **resp, break; case RESPONSE_SLURM_RC: rc = ((return_code_msg_t *) resp_msg.data)->return_code; - slurm_free_return_code_msg(resp_msg.data); - if (rc) + slurm_free_return_code_msg(resp_msg.data); + if (rc) slurm_seterrno_ret(rc); break; default: @@ -751,7 +751,7 @@ slurm_load_jobs (time_t update_time, job_info_msg_t **resp, /* * slurm_load_job - issue RPC to get job information for one job ID * IN job_info_msg_pptr - place to store a job configuration pointer - * IN job_id - ID of job we want information about + * IN job_id - ID of job we want information about * IN show_flags - job filtering option: 0, SHOW_ALL or SHOW_DETAIL * RET 0 or -1 on error * NOTE: free the response using slurm_free_job_info_msg @@ -781,8 +781,8 @@ slurm_load_job (job_info_msg_t **resp, uint32_t job_id, uint16_t show_flags) break; case RESPONSE_SLURM_RC: rc = ((return_code_msg_t *) resp_msg.data)->return_code; - slurm_free_return_code_msg(resp_msg.data); - if (rc) + slurm_free_return_code_msg(resp_msg.data); + if (rc) slurm_seterrno_ret(rc); break; default: @@ -794,7 +794,7 @@ slurm_load_job (job_info_msg_t **resp, uint32_t job_id, uint16_t show_flags) } /* - * slurm_pid2jobid - issue RPC to get the slurm job_id given a process_id + * slurm_pid2jobid - issue RPC to get the slurm job_id given a process_id * on this machine * IN job_pid - process_id of interest on this machine * OUT job_id_ptr - place to store a slurm job_id @@ -819,14 +819,14 @@ slurm_pid2jobid (pid_t job_pid, uint32_t *jobid) this_addr = slurm_conf_get_nodeaddr(this_host); if (this_addr == NULL) this_addr = xstrdup("localhost"); - slurm_set_addr(&req_msg.address, (uint16_t)slurm_get_slurmd_port(), + slurm_set_addr(&req_msg.address, (uint16_t)slurm_get_slurmd_port(), this_addr); xfree(this_addr); req.job_pid = job_pid; req_msg.msg_type = REQUEST_JOB_ID; req_msg.data = &req; - + rc = slurm_send_recv_node_msg(&req_msg, &resp_msg, 0); if(rc != 0 || !resp_msg.auth_cred) { @@ -836,7 +836,7 @@ slurm_pid2jobid (pid_t job_pid, uint32_t *jobid) return SLURM_ERROR; } if(resp_msg.auth_cred) - g_slurm_auth_destroy(resp_msg.auth_cred); + g_slurm_auth_destroy(resp_msg.auth_cred); switch (resp_msg.msg_type) { case RESPONSE_JOB_ID: *jobid = ((job_id_response_msg_t *) resp_msg.data)->job_id; @@ -844,8 +844,8 @@ slurm_pid2jobid (pid_t job_pid, uint32_t *jobid) break; case RESPONSE_SLURM_RC: rc = ((return_code_msg_t *) resp_msg.data)->return_code; - slurm_free_return_code_msg(resp_msg.data); - if (rc) + slurm_free_return_code_msg(resp_msg.data); + if (rc) slurm_seterrno_ret(rc); break; default: @@ -859,7 +859,7 @@ slurm_pid2jobid (pid_t job_pid, uint32_t *jobid) /* * slurm_get_rem_time - get the expected time remaining for a given job * IN jobid - slurm job id - * RET remaining time in seconds or -1 on error + * RET remaining time in seconds or -1 on error */ extern long slurm_get_rem_time(uint32_t jobid) { @@ -907,7 +907,7 @@ extern int32_t islurm_get_rem_time2__() /* * slurm_get_end_time - get the expected end time for a given slurm job * IN jobid - slurm job id - * end_time_ptr - location in which to store scheduled end time for job + * end_time_ptr - location in which to store scheduled end time for job * RET 0 or -1 on error */ extern int @@ -1013,7 +1013,7 @@ extern int slurm_job_node_ready(uint32_t job_id) rc = ((return_code_msg_t *) resp.data)->return_code; slurm_free_return_code_msg(resp.data); } else if (resp.msg_type == RESPONSE_SLURM_RC) { - int job_rc = ((return_code_msg_t *) resp.data) -> + int job_rc = ((return_code_msg_t *) resp.data) -> return_code; if ((job_rc == ESLURM_INVALID_PARTITION_NAME) || (job_rc == ESLURM_INVALID_JOB_ID)) @@ -1041,7 +1041,7 @@ extern int slurm_job_cpus_allocated_on_node_id( for (i = 0; i < job_resrcs_ptr->cpu_array_cnt; i++) { start_node += job_resrcs_ptr->cpu_array_reps[i]; - if(start_node >= node_id) + if(start_node >= node_id) break; } @@ -1066,10 +1066,10 @@ extern int slurm_job_cpus_allocated_on_node( } else if((node_id = hostlist_find(job_resrcs_ptr->node_hl, node)) == -1) { error("slurm_cpus_used_on_node: " - "node %s is not in this allocation", node); + "node %s is not in this allocation", node); return -1; } - + return slurm_job_cpus_allocated_on_node_id(job_resrcs_ptr, node_id); } diff --git a/src/api/job_step_info.c b/src/api/job_step_info.c index c61a6290c8..003a4ac378 100644 --- a/src/api/job_step_info.c +++ b/src/api/job_step_info.c @@ -5,35 +5,35 @@ * Copyright (C) 2002-2006 The Regents of the University of California. * Copyright (C) 2008-2009 Lawrence Livermore National Security. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). - * Written by Morris Jette , + * Written by Morris Jette , * Joey Ekstrom , et. al. * CODE-OCEC-09-009. All rights reserved. - * + * * This file is part of SLURM, a resource management program. * For details, see . * Please also read the included file: DISCLAIMER. - * + * * SLURM is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free * Software Foundation; either version 2 of the License, or (at your option) * any later version. * - * In addition, as a special exception, the copyright holders give permission - * to link the code of portions of this program with the OpenSSL library under - * certain conditions as described in each individual source file, and - * distribute linked combinations including the two. You must obey the GNU - * General Public License in all respects for all of the code used other than - * OpenSSL. If you modify file(s) with this exception, you may extend this - * exception to your version of the file(s), but you are not obligated to do + * In addition, as a special exception, the copyright holders give permission + * to link the code of portions of this program with the OpenSSL library under + * certain conditions as described in each individual source file, and + * distribute linked combinations including the two. You must obey the GNU + * General Public License in all respects for all of the code used other than + * OpenSSL. If you modify file(s) with this exception, you may extend this + * exception to your version of the file(s), but you are not obligated to do * so. If you do not wish to do so, delete this exception statement from your - * version. If you delete this exception statement from all source files in + * version. If you delete this exception statement from all source files in * the program, then also delete it here. - * + * * SLURM is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. - * + * * You should have received a copy of the GNU General Public License along * with SLURM; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. @@ -55,42 +55,42 @@ #include "src/common/xstring.h" /* - * slurm_print_job_step_info_msg - output information about all Slurm + * slurm_print_job_step_info_msg - output information about all Slurm * job steps based upon message as loaded using slurm_get_job_steps * IN out - file to write to * IN job_step_info_msg_ptr - job step information message pointer * IN one_liner - print as a single line if true */ -void -slurm_print_job_step_info_msg ( FILE* out, - job_step_info_response_msg_t * job_step_info_msg_ptr, +void +slurm_print_job_step_info_msg ( FILE* out, + job_step_info_response_msg_t * job_step_info_msg_ptr, int one_liner ) { int i; job_step_info_t *job_step_ptr = job_step_info_msg_ptr->job_steps ; char time_str[32]; - slurm_make_time_str ((time_t *)&job_step_info_msg_ptr->last_update, + slurm_make_time_str ((time_t *)&job_step_info_msg_ptr->last_update, time_str, sizeof(time_str)); fprintf( out, "Job step data as of %s, record count %d\n", time_str, job_step_info_msg_ptr->job_step_count); - for (i = 0; i < job_step_info_msg_ptr-> job_step_count; i++) + for (i = 0; i < job_step_info_msg_ptr-> job_step_count; i++) { - slurm_print_job_step_info ( out, & job_step_ptr[i], + slurm_print_job_step_info ( out, & job_step_ptr[i], one_liner ) ; } } /* - * slurm_print_job_step_info - output information about a specific Slurm + * slurm_print_job_step_info - output information about a specific Slurm * job step based upon message as loaded using slurm_get_job_steps * IN out - file to write to * IN job_ptr - an individual job step information record pointer * IN one_liner - print as a single line if true */ void -slurm_print_job_step_info ( FILE* out, job_step_info_t * job_step_ptr, +slurm_print_job_step_info ( FILE* out, job_step_info_t * job_step_ptr, int one_liner ) { char *print_this = slurm_sprint_job_step_info(job_step_ptr, one_liner); @@ -99,7 +99,7 @@ slurm_print_job_step_info ( FILE* out, job_step_info_t * job_step_ptr, } /* - * slurm_sprint_job_step_info - output information about a specific Slurm + * slurm_sprint_job_step_info - output information about a specific Slurm * job step based upon message as loaded using slurm_get_job_steps * IN job_ptr - an individual job step information record pointer * IN one_liner - print as a single line if true @@ -107,7 +107,7 @@ slurm_print_job_step_info ( FILE* out, job_step_info_t * job_step_ptr, * NULL is returned on failure. */ char * -slurm_sprint_job_step_info ( job_step_info_t * job_step_ptr, +slurm_sprint_job_step_info ( job_step_info_t * job_step_ptr, int one_liner ) { char time_str[32]; @@ -124,8 +124,8 @@ slurm_sprint_job_step_info ( job_step_info_t * job_step_ptr, secs2time_str ((time_t)job_step_ptr->time_limit * 60, limit_str, sizeof(limit_str)); snprintf(tmp_line, sizeof(tmp_line), - "StepId=%u.%u UserId=%u StartTime=%s TimeLimit=%s", - job_step_ptr->job_id, job_step_ptr->step_id, + "StepId=%u.%u UserId=%u StartTime=%s TimeLimit=%s", + job_step_ptr->job_id, job_step_ptr->step_id, job_step_ptr->user_id, time_str, limit_str); out = xstrdup(tmp_line); if (one_liner) @@ -135,7 +135,7 @@ slurm_sprint_job_step_info ( job_step_info_t * job_step_ptr, /****** Line 2 ******/ snprintf(tmp_line, sizeof(tmp_line), - "Partition=%s Nodes=%s Tasks=%u Name=%s Network=%s", + "Partition=%s Nodes=%s Tasks=%u Name=%s Network=%s", job_step_ptr->partition, job_step_ptr->nodes, job_step_ptr->num_tasks, job_step_ptr->name, job_step_ptr->network); @@ -147,7 +147,7 @@ slurm_sprint_job_step_info ( job_step_info_t * job_step_ptr, /****** Line 3 ******/ snprintf(tmp_line, sizeof(tmp_line), - "ResvPorts=%s Checkpoint=%u CheckpointDir=%s\n\n", + "ResvPorts=%s Checkpoint=%u CheckpointDir=%s\n\n", job_step_ptr->resv_ports, job_step_ptr->ckpt_interval, job_step_ptr->ckpt_dir); xstrcat(out, tmp_line); @@ -156,13 +156,13 @@ slurm_sprint_job_step_info ( job_step_info_t * job_step_ptr, } /* - * slurm_get_job_steps - issue RPC to get specific slurm job step + * slurm_get_job_steps - issue RPC to get specific slurm job step * configuration information if changed since update_time. - * a job_id value of NO_VAL implies all jobs, a step_id value of + * a job_id value of NO_VAL implies all jobs, a step_id value of * NO_VAL implies all steps * IN update_time - time of current configuration data * IN job_id - get information for specific job id, NO_VAL for all jobs - * IN step_id - get information for specific job step id, NO_VAL for all + * IN step_id - get information for specific job step id, NO_VAL for all * job steps * IN job_info_msg_pptr - place to store a job configuration pointer * IN show_flags - job step filtering options @@ -170,7 +170,7 @@ slurm_sprint_job_step_info ( job_step_info_t * job_step_ptr, * NOTE: free the response using slurm_free_job_step_info_response_msg */ int -slurm_get_job_steps (time_t update_time, uint32_t job_id, uint32_t step_id, +slurm_get_job_steps (time_t update_time, uint32_t job_id, uint32_t step_id, job_step_info_response_msg_t **resp, uint16_t show_flags) { int rc; @@ -197,8 +197,8 @@ slurm_get_job_steps (time_t update_time, uint32_t job_id, uint32_t step_id, break; case RESPONSE_SLURM_RC: rc = ((return_code_msg_t *) resp_msg.data)->return_code; - slurm_free_return_code_msg(resp_msg.data); - if (rc) + slurm_free_return_code_msg(resp_msg.data); + if (rc) slurm_seterrno_ret(rc); *resp = NULL; break; diff --git a/src/api/node_info.c b/src/api/node_info.c index e4f1a161d9..0080acadda 100644 --- a/src/api/node_info.c +++ b/src/api/node_info.c @@ -7,32 +7,32 @@ * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Morris Jette et. al. * CODE-OCEC-09-009. All rights reserved. - * + * * This file is part of SLURM, a resource management program. * For details, see . * Please also read the included file: DISCLAIMER. - * + * * SLURM is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free * Software Foundation; either version 2 of the License, or (at your option) * any later version. * - * In addition, as a special exception, the copyright holders give permission + * In addition, as a special exception, the copyright holders give permission * to link the code of portions of this program with the OpenSSL library under - * certain conditions as described in each individual source file, and - * distribute linked combinations including the two. You must obey the GNU - * General Public License in all respects for all of the code used other than - * OpenSSL. If you modify file(s) with this exception, you may extend this - * exception to your version of the file(s), but you are not obligated to do + * certain conditions as described in each individual source file, and + * distribute linked combinations including the two. You must obey the GNU + * General Public License in all respects for all of the code used other than + * OpenSSL. If you modify file(s) with this exception, you may extend this + * exception to your version of the file(s), but you are not obligated to do * so. If you do not wish to do so, delete this exception statement from your - * version. If you delete this exception statement from all source files in + * version. If you delete this exception statement from all source files in * the program, then also delete it here. - * + * * SLURM is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. - * + * * You should have received a copy of the GNU General Public License along * with SLURM; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. @@ -69,21 +69,21 @@ * IN node_info_msg_ptr - node information message pointer * IN one_liner - print as a single line if true */ -void -slurm_print_node_info_msg ( FILE * out, node_info_msg_t * node_info_msg_ptr, +void +slurm_print_node_info_msg ( FILE * out, node_info_msg_t * node_info_msg_ptr, int one_liner ) { int i; node_info_t * node_ptr = node_info_msg_ptr -> node_array ; char time_str[32]; - slurm_make_time_str ((time_t *)&node_info_msg_ptr->last_update, + slurm_make_time_str ((time_t *)&node_info_msg_ptr->last_update, time_str, sizeof(time_str)); fprintf( out, "Node data as of %s, record count %d\n", time_str, node_info_msg_ptr->record_count); for (i = 0; i < node_info_msg_ptr-> record_count; i++) { - slurm_print_node_table ( out, & node_ptr[i], + slurm_print_node_table ( out, & node_ptr[i], node_info_msg_ptr->node_scaling, one_liner ) ; } @@ -99,10 +99,10 @@ slurm_print_node_info_msg ( FILE * out, node_info_msg_t * node_info_msg_ptr, * IN one_liner - print as a single line if true */ void -slurm_print_node_table ( FILE * out, node_info_t * node_ptr, +slurm_print_node_table ( FILE * out, node_info_t * node_ptr, int node_scaling, int one_liner ) { - char *print_this = slurm_sprint_node_table(node_ptr, node_scaling, + char *print_this = slurm_sprint_node_table(node_ptr, node_scaling, one_liner); fprintf ( out, "%s", print_this); xfree(print_this); @@ -118,7 +118,7 @@ slurm_print_node_table ( FILE * out, node_info_t * node_ptr, * NULL is returned on failure. */ char * -slurm_sprint_node_table (node_info_t * node_ptr, +slurm_sprint_node_table (node_info_t * node_ptr, int node_scaling, int one_liner ) { uint16_t my_state = node_ptr->node_state; @@ -129,7 +129,7 @@ slurm_sprint_node_table (node_info_t * node_ptr, int cpus_per_node = 1; int total_used = node_ptr->cpus; - if(node_scaling) + if(node_scaling) cpus_per_node = node_ptr->cpus / node_scaling; if (my_state & NODE_STATE_COMPLETING) { @@ -144,12 +144,12 @@ slurm_sprint_node_table (node_info_t * node_ptr, my_state &= (~NODE_STATE_POWER_SAVE); power_str = "+POWER"; } - slurm_get_select_nodeinfo(node_ptr->select_nodeinfo, + slurm_get_select_nodeinfo(node_ptr->select_nodeinfo, SELECT_NODEDATA_SUBCNT, NODE_STATE_ALLOCATED, &alloc_cpus); #ifdef HAVE_BG - if(!alloc_cpus + if(!alloc_cpus && (IS_NODE_ALLOCATED(node_ptr) || IS_NODE_COMPLETING(node_ptr))) alloc_cpus = node_ptr->cpus; else @@ -157,7 +157,7 @@ slurm_sprint_node_table (node_info_t * node_ptr, #endif total_used -= alloc_cpus; - slurm_get_select_nodeinfo(node_ptr->select_nodeinfo, + slurm_get_select_nodeinfo(node_ptr->select_nodeinfo, SELECT_NODEDATA_SUBCNT, NODE_STATE_ERROR, &err_cpus); @@ -166,7 +166,7 @@ slurm_sprint_node_table (node_info_t * node_ptr, #endif total_used -= err_cpus; - if ((alloc_cpus && err_cpus) || + if ((alloc_cpus && err_cpus) || (total_used && (total_used != node_ptr->cpus))) { my_state &= NODE_STATE_FLAGS; my_state |= NODE_STATE_MIXED; @@ -198,7 +198,7 @@ slurm_sprint_node_table (node_info_t * node_ptr, xstrcat(out, " "); else xstrcat(out, "\n "); - + /****** Line 3 ******/ if (node_ptr->os) { snprintf(tmp_line, sizeof(tmp_line), "OS=%s ", node_ptr->os); @@ -218,7 +218,7 @@ slurm_sprint_node_table (node_info_t * node_ptr, "Sockets=%u State=%s%s%s%s ThreadsPerCore=%u " "TmpDisk=%u Weight=%u", node_ptr->sockets, node_state_string(my_state), - comp_str, drain_str, power_str, node_ptr->threads, + comp_str, drain_str, power_str, node_ptr->threads, node_ptr->tmp_disk, node_ptr->weight); xstrcat(out, tmp_line); if (one_liner) @@ -230,40 +230,40 @@ slurm_sprint_node_table (node_info_t * node_ptr, /* - * slurm_load_node - issue RPC to get slurm all node configuration information - * if changed since update_time + * slurm_load_node - issue RPC to get slurm all node configuration information + * if changed since update_time * IN update_time - time of current configuration data * IN node_info_msg_pptr - place to store a node configuration pointer * IN show_flags - node filtering options * RET 0 or a slurm error code * NOTE: free the response using slurm_free_node_info_msg */ -extern int slurm_load_node (time_t update_time, +extern int slurm_load_node (time_t update_time, node_info_msg_t **resp, uint16_t show_flags) { int rc; slurm_msg_t req_msg; slurm_msg_t resp_msg; node_info_request_msg_t req; - + slurm_msg_t_init(&req_msg); slurm_msg_t_init(&resp_msg); req.last_update = update_time; req.show_flags = show_flags; req_msg.msg_type = REQUEST_NODE_INFO; req_msg.data = &req; - + if (slurm_send_recv_controller_msg(&req_msg, &resp_msg) < 0) return SLURM_ERROR; - + switch (resp_msg.msg_type) { case RESPONSE_NODE_INFO: *resp = (node_info_msg_t *) resp_msg.data; break; case RESPONSE_SLURM_RC: rc = ((return_code_msg_t *) resp_msg.data)->return_code; - slurm_free_return_code_msg(resp_msg.data); - if (rc) + slurm_free_return_code_msg(resp_msg.data); + if (rc) slurm_seterrno_ret(rc); *resp = NULL; break; diff --git a/src/api/partition_info.c b/src/api/partition_info.c index adea20c73a..46ced22a1d 100644 --- a/src/api/partition_info.c +++ b/src/api/partition_info.c @@ -6,32 +6,32 @@ * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Morris Jette et. al. * CODE-OCEC-09-009. All rights reserved. - * + * * This file is part of SLURM, a resource management program. * For details, see . * Please also read the included file: DISCLAIMER. - * + * * SLURM is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free * Software Foundation; either version 2 of the License, or (at your option) * any later version. * - * In addition, as a special exception, the copyright holders give permission - * to link the code of portions of this program with the OpenSSL library under - * certain conditions as described in each individual source file, and - * distribute linked combinations including the two. You must obey the GNU - * General Public License in all respects for all of the code used other than - * OpenSSL. If you modify file(s) with this exception, you may extend this - * exception to your version of the file(s), but you are not obligated to do + * In addition, as a special exception, the copyright holders give permission + * to link the code of portions of this program with the OpenSSL library under + * certain conditions as described in each individual source file, and + * distribute linked combinations including the two. You must obey the GNU + * General Public License in all respects for all of the code used other than + * OpenSSL. If you modify file(s) with this exception, you may extend this + * exception to your version of the file(s), but you are not obligated to do * so. If you do not wish to do so, delete this exception statement from your - * version. If you delete this exception statement from all source files in + * version. If you delete this exception statement from all source files in * the program, then also delete it here. - * + * * SLURM is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. - * + * * You should have received a copy of the GNU General Public License along * with SLURM; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. @@ -53,20 +53,20 @@ #include "src/common/xstring.h" /* - * slurm_print_partition_info_msg - output information about all Slurm + * slurm_print_partition_info_msg - output information about all Slurm * partitions based upon message as loaded using slurm_load_partitions * IN out - file to write to * IN part_info_ptr - partitions information message pointer * IN one_liner - print as a single line if true */ -void slurm_print_partition_info_msg ( FILE* out, +void slurm_print_partition_info_msg ( FILE* out, partition_info_msg_t * part_info_ptr, int one_liner ) { int i ; partition_info_t * part_ptr = part_info_ptr->partition_array ; char time_str[32]; - slurm_make_time_str ((time_t *)&part_info_ptr->last_update, time_str, + slurm_make_time_str ((time_t *)&part_info_ptr->last_update, time_str, sizeof(time_str)); fprintf( out, "Partition data as of %s, record count %d\n", time_str, part_info_ptr->record_count); @@ -78,13 +78,13 @@ void slurm_print_partition_info_msg ( FILE* out, } /* - * slurm_print_partition_info - output information about a specific Slurm + * slurm_print_partition_info - output information about a specific Slurm * partition based upon message as loaded using slurm_load_partitions * IN out - file to write to * IN part_ptr - an individual partition information record pointer * IN one_liner - print as a single line if true */ -void slurm_print_partition_info ( FILE* out, partition_info_t * part_ptr, +void slurm_print_partition_info ( FILE* out, partition_info_t * part_ptr, int one_liner ) { char *print_this = slurm_sprint_partition_info(part_ptr, one_liner); @@ -94,14 +94,14 @@ void slurm_print_partition_info ( FILE* out, partition_info_t * part_ptr, /* - * slurm_sprint_partition_info - output information about a specific Slurm + * slurm_sprint_partition_info - output information about a specific Slurm * partition based upon message as loaded using slurm_load_partitions * IN part_ptr - an individual partition information record pointer * IN one_liner - print as a single line if true * RET out - char * containing formatted output (must be freed after call) * NULL is returned on failure. */ -char *slurm_sprint_partition_info ( partition_info_t * part_ptr, +char *slurm_sprint_partition_info ( partition_info_t * part_ptr, int one_liner ) { char tmp1[16], tmp2[16]; @@ -112,7 +112,7 @@ char *slurm_sprint_partition_info ( partition_info_t * part_ptr, /****** Line 1 ******/ snprintf(tmp_line, sizeof(tmp_line), - "PartitionName=%s", + "PartitionName=%s", part_ptr->name); xstrcat(out, tmp_line); if (one_liner) @@ -128,11 +128,11 @@ char *slurm_sprint_partition_info ( partition_info_t * part_ptr, snprintf(tmp_line, sizeof(tmp_line), "AllocNodes=%s", part_ptr->allow_alloc_nodes); xstrcat(out, tmp_line); - if ((part_ptr->allow_groups == NULL) || + if ((part_ptr->allow_groups == NULL) || (part_ptr->allow_groups[0] == '\0')) sprintf(tmp_line, " AllowGroups=ALL"); else { - snprintf(tmp_line, sizeof(tmp_line), + snprintf(tmp_line, sizeof(tmp_line), " AllowGroups=%s", part_ptr->allow_groups); } xstrcat(out, tmp_line); @@ -146,11 +146,11 @@ char *slurm_sprint_partition_info ( partition_info_t * part_ptr, else xstrcat(out, "\n "); - /****** Line added here for BG partitions + /****** Line added here for BG partitions to keep with alphabetized output******/ #ifdef HAVE_BG - snprintf(tmp_line, sizeof(tmp_line), "BasePartitions=%s", + snprintf(tmp_line, sizeof(tmp_line), "BasePartitions=%s", part_ptr->nodes); xstrcat(out, tmp_line); if (one_liner) @@ -165,10 +165,10 @@ char *slurm_sprint_partition_info ( partition_info_t * part_ptr, if (part_ptr->default_time == INFINITE) sprintf(tmp_line, "DefaultTime=UNLIMITED"); else if (part_ptr->default_time == NO_VAL) - sprintf(tmp_line, "DefaultTime=NONE"); + sprintf(tmp_line, "DefaultTime=NONE"); else { char time_line[32]; - secs2time_str(part_ptr->default_time * 60, time_line, + secs2time_str(part_ptr->default_time * 60, time_line, sizeof(time_line)); sprintf(tmp_line, " DefaultTime=%s", time_line); } @@ -188,7 +188,7 @@ char *slurm_sprint_partition_info ( partition_info_t * part_ptr, xstrcat(out, " "); else xstrcat(out, "\n "); - + /****** Line 4 ******/ if (part_ptr->max_nodes == INFINITE) @@ -207,7 +207,7 @@ char *slurm_sprint_partition_info ( partition_info_t * part_ptr, sprintf(tmp_line, " MaxTime=UNLIMITED"); else { char time_line[32]; - secs2time_str(part_ptr->max_time * 60, time_line, + secs2time_str(part_ptr->max_time * 60, time_line, sizeof(time_line)); sprintf(tmp_line, " MaxTime=%s", time_line); } @@ -243,7 +243,7 @@ char *slurm_sprint_partition_info ( partition_info_t * part_ptr, /****** Line 6 ******/ sprintf(tmp_line, "Priority=%u", part_ptr->priority); - xstrcat(out, tmp_line); + xstrcat(out, tmp_line); if (part_ptr->root_only) sprintf(tmp_line, " RootOnly=YES"); else @@ -275,7 +275,7 @@ char *slurm_sprint_partition_info ( partition_info_t * part_ptr, else sprintf(tmp_line, "State=DOWN"); xstrcat(out, tmp_line); - + #ifdef HAVE_BG convert_num_unit((float)part_ptr->total_cpus, tmp1, sizeof(tmp1), UNIT_NONE); @@ -296,22 +296,22 @@ char *slurm_sprint_partition_info ( partition_info_t * part_ptr, xstrcat(out, "\n"); else xstrcat(out, "\n\n"); - + return out; } /* - * slurm_load_partitions - issue RPC to get slurm all partition configuration - * information if changed since update_time + * slurm_load_partitions - issue RPC to get slurm all partition configuration + * information if changed since update_time * IN update_time - time of current configuration data - * IN partition_info_msg_pptr - place to store a partition configuration + * IN partition_info_msg_pptr - place to store a partition configuration * pointer * IN show_flags - partition filtering options * RET 0 or a slurm error code * NOTE: free the response using slurm_free_partition_info_msg */ -extern int slurm_load_partitions (time_t update_time, +extern int slurm_load_partitions (time_t update_time, partition_info_msg_t **resp, uint16_t show_flags) { int rc; @@ -326,18 +326,18 @@ extern int slurm_load_partitions (time_t update_time, req.show_flags = show_flags; req_msg.msg_type = REQUEST_PARTITION_INFO; req_msg.data = &req; - + if (slurm_send_recv_controller_msg(&req_msg, &resp_msg) < 0) return SLURM_ERROR; - + switch (resp_msg.msg_type) { case RESPONSE_PARTITION_INFO: *resp = (partition_info_msg_t *) resp_msg.data; break; case RESPONSE_SLURM_RC: rc = ((return_code_msg_t *) resp_msg.data)->return_code; - slurm_free_return_code_msg(resp_msg.data); - if (rc) + slurm_free_return_code_msg(resp_msg.data); + if (rc) slurm_seterrno_ret(rc); *resp = NULL; break; diff --git a/src/api/pmi.c b/src/api/pmi.c index 87082bef8e..90e8b1eb1e 100644 --- a/src/api/pmi.c +++ b/src/api/pmi.c @@ -60,15 +60,15 @@ * Software Foundation; either version 2 of the License, or (at your option) * any later version. * - * In addition, as a special exception, the copyright holders give permission + * In addition, as a special exception, the copyright holders give permission * to link the code of portions of this program with the OpenSSL library under - * certain conditions as described in each individual source file, and - * distribute linked combinations including the two. You must obey the GNU - * General Public License in all respects for all of the code used other than - * OpenSSL. If you modify file(s) with this exception, you may extend this - * exception to your version of the file(s), but you are not obligated to do + * certain conditions as described in each individual source file, and + * distribute linked combinations including the two. You must obey the GNU + * General Public License in all respects for all of the code used other than + * OpenSSL. If you modify file(s) with this exception, you may extend this + * exception to your version of the file(s), but you are not obligated to do * so. If you do not wish to do so, delete this exception statement from your - * version. If you delete this exception statement from all source files in + * version. If you delete this exception statement from all source files in * the program, then also delete it here. * * SLURM is distributed in the hope that it will be useful, but WITHOUT ANY @@ -120,7 +120,7 @@ struct kvs_rec { static void _del_kvs_rec( struct kvs_rec *kvs_ptr ); static void _init_kvs( char kvsname[] ); static void inline _kvs_dump(void); -static int _kvs_put( const char kvsname[], const char key[], +static int _kvs_put( const char kvsname[], const char key[], const char value[], int local); static void _kvs_swap(struct kvs_rec *kvs_ptr, int inx1, int inx2); @@ -163,7 +163,7 @@ Return values: Notes: Initialize PMI for this process group. The value of spawned indicates whether -this process was created by 'PMI_Spawn_multiple'. 'spawned' will be 'PMI_TRUE' +this process was created by 'PMI_Spawn_multiple'. 'spawned' will be 'PMI_TRUE' if this process group has a parent and 'PMI_FALSE' if it does not. @*/ @@ -342,7 +342,7 @@ int PMI_Get_size( int *size ) if (!pmi_init) return PMI_FAIL; } - + *size = pmi_size; return PMI_SUCCESS; } @@ -383,7 +383,7 @@ int PMI_Get_rank( int *rank ) /*@ PMI_Get_universe_size - obtain the universe size -(NOTE: "universe size" indicates the maximum recommended +(NOTE: "universe size" indicates the maximum recommended process count for the job.) Output Parameters: @@ -457,7 +457,7 @@ int PMI_Get_appnum( int *appnum ) } /*@ -PMI_Publish_name - publish a name +PMI_Publish_name - publish a name Input parameters: . service_name - string representing the service being published @@ -568,7 +568,7 @@ int PMI_Get_id( char id_str[], int length ) if (pmi_init == 0) return PMI_FAIL; - snprintf(id_str, length, "%ld.%ld", pmi_jobid, pmi_stepid); + snprintf(id_str, length, "%ld.%ld", pmi_jobid, pmi_stepid); return PMI_SUCCESS; } @@ -659,7 +659,7 @@ int PMI_Barrier( void ) fprintf(stderr, "In: PMI_Barrier\n"); /* Issue the RPC */ - if (slurm_get_kvs_comm_set(&kvs_set_ptr, pmi_rank, pmi_size) + if (slurm_get_kvs_comm_set(&kvs_set_ptr, pmi_rank, pmi_size) != SLURM_SUCCESS) return PMI_FAIL; if (kvs_set_ptr == NULL) @@ -670,8 +670,8 @@ int PMI_Barrier( void ) for (i=0; ikvs_comm_recs; i++) { kvs_ptr = kvs_set_ptr->kvs_comm_ptr[i]; for (j=0; jkvs_cnt; j++) { - k = _kvs_put(kvs_ptr->kvs_name, - kvs_ptr->kvs_keys[j], + k = _kvs_put(kvs_ptr->kvs_name, + kvs_ptr->kvs_keys[j], kvs_ptr->kvs_values[j], 0); if (k != PMI_SUCCESS) @@ -806,7 +806,7 @@ int PMI_Abort(int exit_code, const char error_msg[]) /* PMI Keymap functions */ /*@ -PMI_KVS_Get_my_name - obtain the name of the keyval space the local process +PMI_KVS_Get_my_name - obtain the name of the keyval space the local process group has access to Input Parameters: @@ -885,7 +885,7 @@ This function returns the string length required to store a keyval space name. A routine is used rather than setting a maximum value in 'pmi.h' to allow different implementations of PMI to be used with the same executable. These -different implementations may allow different maximum lengths; by using a +different implementations may allow different maximum lengths; by using a routine here, we can interface with a variety of implementations of PMI. @*/ @@ -992,7 +992,7 @@ int PMI_KVS_Create( char kvsname[], int length ) return PMI_FAIL; pthread_mutex_lock(&kvs_mutex); - size = snprintf(kvsname, length, "%ld.%ld.%d.%d", pmi_jobid, + size = snprintf(kvsname, length, "%ld.%ld.%d.%d", pmi_jobid, pmi_stepid, pmi_rank, kvs_name_sequence); if (size >= length) /* truncated */ rc = PMI_ERR_INVALID_LENGTH; @@ -1062,7 +1062,7 @@ Return values: Notes: This function puts the key/value pair in the specified keyval space. The -value is not visible to other processes until 'PMI_KVS_Commit()' is called. +value is not visible to other processes until 'PMI_KVS_Commit()' is called. The function may complete locally. After 'PMI_KVS_Commit()' is called, the value may be retrieved by calling 'PMI_KVS_Get()'. All keys put to a keyval space must be unique to the keyval space. You may not put more than once @@ -1084,7 +1084,7 @@ int PMI_KVS_Put( const char kvsname[], const char key[], const char value[]) return _kvs_put(kvsname, key, value, 1); } -static int _kvs_put( const char kvsname[], const char key[], const char value[], +static int _kvs_put( const char kvsname[], const char key[], const char value[], int local) { int i, j, rc; @@ -1096,7 +1096,7 @@ static int _kvs_put( const char kvsname[], const char key[], const char value[], continue; /* search for duplicate key */ for (j=0; jkvs_name = kvs_recs[i].kvs_name; @@ -1228,7 +1228,7 @@ int PMI_KVS_Commit( const char kvsname[] ) } /* Send the RPC */ - if (slurm_send_kvs_comm_set(&kvs_set, pmi_rank, pmi_size) + if (slurm_send_kvs_comm_set(&kvs_set, pmi_rank, pmi_size) != SLURM_SUCCESS) rc = PMI_FAIL; else @@ -1292,7 +1292,7 @@ int PMI_KVS_Get( const char kvsname[], const char key[], char value[], int lengt if (pmi_debug) fprintf(stderr, "In: PMI_KVS_Get(%s)\n", key); - + if ((kvsname == NULL) || (strlen(kvsname) > PMI_MAX_KVSNAME_LEN)) return PMI_ERR_INVALID_KVS; if ((key == NULL) || (strlen(key) >PMI_MAX_KEY_LEN)) @@ -1314,7 +1314,7 @@ int PMI_KVS_Get( const char kvsname[], const char key[], char value[], int lengt if (strlen(kvs_recs[i].kvs_values[j]) > (length-1)) rc = PMI_ERR_INVALID_LENGTH; else { - strncpy(value, kvs_recs[i].kvs_values[j], + strncpy(value, kvs_recs[i].kvs_values[j], length); rc = PMI_SUCCESS; } @@ -1391,7 +1391,7 @@ int PMI_KVS_Iter_first(const char kvsname[], char key[], int key_len, char val[] (val_len-1)) { rc = PMI_ERR_INVALID_VAL_LENGTH; } else { - strncpy(key, kvs_recs[i].kvs_keys[kvs_recs[i].kvs_inx], + strncpy(key, kvs_recs[i].kvs_keys[kvs_recs[i].kvs_inx], key_len); strncpy(val, kvs_recs[i].kvs_values[kvs_recs[i].kvs_inx], @@ -1399,7 +1399,7 @@ int PMI_KVS_Iter_first(const char kvsname[], char key[], int key_len, char val[] rc = PMI_SUCCESS; } goto fini; - } + } rc = PMI_ERR_INVALID_KVS; fini: pthread_mutex_unlock(&kvs_mutex); @@ -1428,14 +1428,14 @@ Return values: - PMI_FAIL - failed to get the next keyval pair Notes: -This function retrieves the next keyval pair from the specified keyval space. +This function retrieves the next keyval pair from the specified keyval space. 'PMI_KVS_Iter_first()' must have been previously called. The end of the keyval space is specified by returning an empty key string. The output parameters, key and val, must be at least as long as the values returned by 'PMI_KVS_Get_key_length_max()' and 'PMI_KVS_Get_value_length_max()'. @*/ -int PMI_KVS_Iter_next(const char kvsname[], char key[], int key_len, +int PMI_KVS_Iter_next(const char kvsname[], char key[], int key_len, char val[], int val_len) { int i, rc; @@ -1471,7 +1471,7 @@ int PMI_KVS_Iter_next(const char kvsname[], char key[], int key_len, } else { strncpy(key, kvs_recs[i].kvs_keys[kvs_recs[i].kvs_inx], key_len); - strncpy(val, + strncpy(val, kvs_recs[i].kvs_values[kvs_recs[i].kvs_inx], val_len); rc = PMI_SUCCESS; @@ -1494,7 +1494,7 @@ Input Parameters: . cmds - array of command strings . argvs - array of argv arrays for each command string . maxprocs - array of maximum processes to spawn for each command string -. info_keyval_sizes - array giving the number of elements in each of the +. info_keyval_sizes - array giving the number of elements in each of the 'info_keyval_vectors' . info_keyval_vectors - array of keyval vector arrays . preput_keyval_size - Number of elements in 'preput_keyval_vector' @@ -1515,7 +1515,7 @@ field refers to the size of the array parameters - 'cmd', 'argvs', 'maxprocs', to the size of the 'preput_keyval_vector' array. The 'preput_keyval_vector' contains keyval pairs that will be put in the keyval space of the newly created process group before the processes are started. The 'maxprocs' array -specifies the desired number of processes to create for each 'cmd' string. +specifies the desired number of processes to create for each 'cmd' string. The actual number of processes may be less than the numbers specified in maxprocs. The acceptable number of processes spawned may be controlled by ``soft'' keyvals in the info arrays. The ``soft'' option is specified by @@ -1567,14 +1567,14 @@ Notes: This function removes one PMI specific argument from the command line and creates the corresponding 'PMI_keyval_t' structure for it. It returns an array and size to the caller. The array must be freed by 'PMI_Free_keyvals()'. -If the first element of the args array is not a PMI specific argument, the -function returns success and sets num_parsed to zero. If there are multiple PMI -specific arguments in the args array, this function may parse more than one +If the first element of the args array is not a PMI specific argument, the +function returns success and sets num_parsed to zero. If there are multiple PMI +specific arguments in the args array, this function may parse more than one argument as long as the options are contiguous in the args array. @*/ int PMI_Parse_option(int num_args, char *args[], int *num_parsed, - PMI_keyval_t **keyvalp, + PMI_keyval_t **keyvalp, int *size) { int i, n, s, len; @@ -1645,7 +1645,7 @@ int PMI_Parse_option(int num_args, char *args[], int *num_parsed, *keyvalp = temp; *num_parsed = n; *size = s; - + return PMI_SUCCESS; } @@ -1669,7 +1669,7 @@ Notes: This function removes PMI specific arguments from the command line and creates the corresponding 'PMI_keyval_t' structures for them. It returns an array and size to the caller that can then be passed to 'PMI_Spawn_multiple()'. -The array can be freed by 'PMI_Free_keyvals()'. The routine 'free()' should +The array can be freed by 'PMI_Free_keyvals()'. The routine 'free()' should not be used to free this array as there is no requirement that the array be allocated with 'malloc()'. @@ -1682,7 +1682,7 @@ allocated with 'malloc()'. */ -int PMI_Args_to_keyval(int *argcp, char *((*argvp)[]), PMI_keyval_t **keyvalp, +int PMI_Args_to_keyval(int *argcp, char *((*argvp)[]), PMI_keyval_t **keyvalp, int *size) { int i, j, cnt; @@ -1720,7 +1720,7 @@ int PMI_Args_to_keyval(int *argcp, char *((*argvp)[]), PMI_keyval_t **keyvalp, while (cnt) { if (argv[i][0] == '-') { - temp[j].key = (char *) malloc((strlen(argv[i])+1) * + temp[j].key = (char *) malloc((strlen(argv[i])+1) * sizeof (char)); if (temp[j].key == NULL) return PMI_FAIL; @@ -1729,7 +1729,7 @@ int PMI_Args_to_keyval(int *argcp, char *((*argvp)[]), PMI_keyval_t **keyvalp, --cnt; if ((cnt) && (argv[i][0] != '-')){ temp[j].val = (char *) malloc( - (strlen(argv[i])+1) * + (strlen(argv[i])+1) * sizeof (char)); if (temp[j].val == NULL) return PMI_FAIL; @@ -1764,7 +1764,7 @@ Return values: Notes: This function frees the data returned by 'PMI_Args_to_keyval' and 'PMI_Parse_option'. - Using this routine instead of 'free' allows the PMI package to track + Using this routine instead of 'free' allows the PMI package to track allocation of storage or to use interal storage as it sees fit. @*/ int PMI_Free_keyvals(PMI_keyval_t keyvalp[], int size) @@ -1794,7 +1794,7 @@ int PMI_Free_keyvals(PMI_keyval_t keyvalp[], int size) } /*@ -PMI_Get_options - get a string of command line argument descriptions that may be printed +PMI_Get_options - get a string of command line argument descriptions that may be printed to the user Input Parameters: diff --git a/src/api/pmi_server.c b/src/api/pmi_server.c index 14867b918e..deabda8268 100644 --- a/src/api/pmi_server.c +++ b/src/api/pmi_server.c @@ -6,21 +6,21 @@ * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Morris Jette * CODE-OCEC-09-009. All rights reserved. - * + * * This file is part of SLURM, a resource management program. * For details, see . * Please also read the included file: DISCLAIMER. - * + * * SLURM is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free * Software Foundation; either version 2 of the License, or (at your option) * any later version. - * + * * SLURM is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. - * + * * You should have received a copy of the GNU General Public License along * with SLURM; if not, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. @@ -92,7 +92,7 @@ static void _print_kvs(void); /* Transmit the KVS keypairs to all tasks, waiting at a barrier * This will take some time, so we work with a copy of the KVS keypairs. - * We also work with a private copy of the barrier data and clear the + * We also work with a private copy of the barrier data and clear the * global data pointers so any new barrier requests get treated as * completely independent of this one. */ static void _kvs_xmit_tasks(void) @@ -107,7 +107,7 @@ static void _kvs_xmit_tasks(void) /* Target KVS_TIME should be about ave processing time */ debug("kvs_put processing time min=%d, max=%d ave=%d (usec)", - min_time_kvs_put, max_time_kvs_put, + min_time_kvs_put, max_time_kvs_put, (tot_time_kvs_put / barrier_cnt)); min_time_kvs_put = 1000000; max_time_kvs_put = 0; @@ -144,7 +144,7 @@ static void *_msg_thread(void *x) struct msg_arg *msg_arg_ptr = (struct msg_arg *) x; int rc, success = 0, timeout; slurm_msg_t msg_send; - + slurm_msg_t_init(&msg_send); debug2("KVS_Barrier msg to %s:%u", @@ -196,7 +196,7 @@ static void *_agent(void *x) } fanout_off_host = getenv("PMI_FANOUT_OFF_HOST"); - /* only send one message to each host, + /* only send one message to each host, * build table of the ports on each host */ START_TIMER; slurm_attr_init(&attr); @@ -208,7 +208,7 @@ static void *_agent(void *x) kvs_host_list = xmalloc(sizeof(struct kvs_hosts) * pmi_fanout); host_cnt = 0; - /* This code enables key-pair forwarding between + /* This code enables key-pair forwarding between * tasks. First task on the node gets the key-pairs * with host/port information for all other tasks on * that node it should forward the information to. */ @@ -220,9 +220,9 @@ static void *_agent(void *x) args->barrier_xmit_ptr[j].hostname)) continue; /* another host */ kvs_host_list[host_cnt].task_id = 0; /* not avail */ - kvs_host_list[host_cnt].port = + kvs_host_list[host_cnt].port = args->barrier_xmit_ptr[j].port; - kvs_host_list[host_cnt].hostname = + kvs_host_list[host_cnt].hostname = args->barrier_xmit_ptr[j].hostname; args->barrier_xmit_ptr[j].port = 0;/* don't reissue */ host_cnt++; @@ -306,14 +306,14 @@ struct kvs_comm **_kvs_comm_dup(void) rc_kvs[i] = xmalloc(sizeof(struct kvs_comm)); rc_kvs[i]->kvs_name = xstrdup(kvs_comm_ptr[i]->kvs_name); rc_kvs[i]->kvs_cnt = kvs_comm_ptr[i]->kvs_cnt; - rc_kvs[i]->kvs_keys = + rc_kvs[i]->kvs_keys = xmalloc(sizeof(char *) * rc_kvs[i]->kvs_cnt); - rc_kvs[i]->kvs_values = + rc_kvs[i]->kvs_values = xmalloc(sizeof(char *) * rc_kvs[i]->kvs_cnt); for (j=0; jkvs_cnt; j++) { - rc_kvs[i]->kvs_keys[j] = + rc_kvs[i]->kvs_keys[j] = xstrdup(kvs_comm_ptr[i]->kvs_keys[j]); - rc_kvs[i]->kvs_values[j] = + rc_kvs[i]->kvs_values[j] = xstrdup(kvs_comm_ptr[i]->kvs_values[j]); } } @@ -333,7 +333,7 @@ static struct kvs_comm *_find_kvs_by_name(char *name) return NULL; } -static void _merge_named_kvs(struct kvs_comm *kvs_orig, +static void _merge_named_kvs(struct kvs_comm *kvs_orig, struct kvs_comm *kvs_new) { int i, j; @@ -351,12 +351,12 @@ static void _merge_named_kvs(struct kvs_comm *kvs_orig, continue; /* already recorded, update */ /* append it */ kvs_orig->kvs_cnt++; - xrealloc(kvs_orig->kvs_keys, + xrealloc(kvs_orig->kvs_keys, (sizeof(char *) * kvs_orig->kvs_cnt)); - xrealloc(kvs_orig->kvs_values, + xrealloc(kvs_orig->kvs_values, (sizeof(char *) * kvs_orig->kvs_cnt)); kvs_orig->kvs_keys[kvs_orig->kvs_cnt-1] = kvs_new->kvs_keys[i]; - kvs_orig->kvs_values[kvs_orig->kvs_cnt-1] = + kvs_orig->kvs_values[kvs_orig->kvs_cnt-1] = kvs_new->kvs_values[i]; kvs_new->kvs_keys[i] = NULL; kvs_new->kvs_values[i] = NULL; @@ -381,7 +381,7 @@ static void _print_kvs(void) for (j=0; jkvs_cnt; j++) { info("KVS: %s:%s:%s", kvs_comm_ptr[i]->kvs_name, kvs_comm_ptr[i]->kvs_keys[j], - kvs_comm_ptr[i]->kvs_values[j]); + kvs_comm_ptr[i]->kvs_values[j]); } } #endif @@ -394,7 +394,7 @@ extern int pmi_kvs_put(struct kvs_comm_set *kvs_set_ptr) DEF_TIMERS; /* Merge new data with old. - * NOTE: We just move pointers rather than copy data where + * NOTE: We just move pointers rather than copy data where * possible for improved performance */ START_TIMER; pthread_mutex_lock(&kvs_mutex); @@ -402,7 +402,7 @@ extern int pmi_kvs_put(struct kvs_comm_set *kvs_set_ptr) kvs_ptr = _find_kvs_by_name(kvs_set_ptr-> kvs_comm_ptr[i]->kvs_name); if (kvs_ptr) { - _merge_named_kvs(kvs_ptr, + _merge_named_kvs(kvs_ptr, kvs_set_ptr->kvs_comm_ptr[i]); } else { _move_kvs(kvs_set_ptr->kvs_comm_ptr[i]); @@ -432,8 +432,8 @@ extern int pmi_kvs_get(kvs_get_msg_t *kvs_get_ptr) #endif #if _DEBUG - info("pmi_kvs_get: rank:%u size:%u port:%u, host:%s", - kvs_get_ptr->task_id, kvs_get_ptr->size, + info("pmi_kvs_get: rank:%u size:%u port:%u, host:%s", + kvs_get_ptr->task_id, kvs_get_ptr->size, kvs_get_ptr->port, kvs_get_ptr->hostname); #endif if (kvs_get_ptr->size == 0) { @@ -457,7 +457,7 @@ extern int pmi_kvs_get(kvs_get_msg_t *kvs_get_ptr) goto fini; } if (kvs_get_ptr->task_id >= barrier_cnt) { - error("PMK_KVS_Barrier task count(%u) >= size(%u)", + error("PMK_KVS_Barrier task count(%u) >= size(%u)", kvs_get_ptr->task_id, barrier_cnt); rc = SLURM_ERROR; goto fini; @@ -480,7 +480,7 @@ extern int pmi_kvs_get(kvs_get_msg_t *kvs_get_ptr) #endif _kvs_xmit_tasks(); } -fini: pthread_mutex_unlock(&kvs_mutex); +fini: pthread_mutex_unlock(&kvs_mutex); return rc; } diff --git a/src/api/pmi_server.h b/src/api/pmi_server.h index 386cd96032..cba627b3bd 100644 --- a/src/api/pmi_server.h +++ b/src/api/pmi_server.h @@ -6,21 +6,21 @@ * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Morris Jette * CODE-OCEC-09-009. All rights reserved. - * + * * This file is part of SLURM, a resource management program. * For details, see . * Please also read the included file: DISCLAIMER. - * + * * SLURM is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free * Software Foundation; either version 2 of the License, or (at your option) * any later version. - * + * * SLURM is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. - * + * * You should have received a copy of the GNU General Public License along * with SLURM; if not, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. diff --git a/src/api/reconfigure.c b/src/api/reconfigure.c index 8773722a97..fb4ca865d7 100644 --- a/src/api/reconfigure.c +++ b/src/api/reconfigure.c @@ -1,5 +1,5 @@ /*****************************************************************************\ - * reconfigure.c - request that slurmctld shutdown or re-read the + * reconfigure.c - request that slurmctld shutdown or re-read the * configuration files * $Id$ ***************************************************************************** @@ -8,32 +8,32 @@ * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Morris Jette et. al. * CODE-OCEC-09-009. All rights reserved. - * + * * This file is part of SLURM, a resource management program. * For details, see . * Please also read the included file: DISCLAIMER. - * + * * SLURM is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free * Software Foundation; either version 2 of the License, or (at your option) * any later version. * - * In addition, as a special exception, the copyright holders give permission + * In addition, as a special exception, the copyright holders give permission * to link the code of portions of this program with the OpenSSL library under - * certain conditions as described in each individual source file, and - * distribute linked combinations including the two. You must obey the GNU - * General Public License in all respects for all of the code used other than - * OpenSSL. If you modify file(s) with this exception, you may extend this - * exception to your version of the file(s), but you are not obligated to do + * certain conditions as described in each individual source file, and + * distribute linked combinations including the two. You must obey the GNU + * General Public License in all respects for all of the code used other than + * OpenSSL. If you modify file(s) with this exception, you may extend this + * exception to your version of the file(s), but you are not obligated to do * so. If you do not wish to do so, delete this exception statement from your - * version. If you delete this exception statement from all source files in + * version. If you delete this exception statement from all source files in * the program, then also delete it here. - * + * * SLURM is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. - * + * * You should have received a copy of the GNU General Public License along * with SLURM; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. @@ -54,12 +54,12 @@ #include "src/common/forward.h" #include "src/common/xmalloc.h" -static int _send_message_controller ( enum controller_id dest, +static int _send_message_controller ( enum controller_id dest, slurm_msg_t *request_msg ); /* * slurm_reconfigure - issue RPC to have Slurm controller (slurmctld) - * reload its configuration file + * reload its configuration file * RET 0 or a slurm error code */ int @@ -71,7 +71,7 @@ slurm_reconfigure ( void ) slurm_msg_t_init(&req); req.msg_type = REQUEST_RECONFIGURE; - + if (slurm_send_recv_controller_rc_msg(&req, &rc) < 0) return SLURM_ERROR; @@ -109,7 +109,7 @@ slurm_ping (int primary) /* * slurm_shutdown - issue RPC to have Slurm controller (slurmctld) - * cease operations, both the primary and backup controller + * cease operations, both the primary and backup controller * are shutdown. * IN options - 0: all slurm daemons are shutdown * 1: slurmctld generates a core file @@ -126,18 +126,18 @@ slurm_shutdown (uint16_t options) shutdown_msg.options = options; req_msg.msg_type = REQUEST_SHUTDOWN; req_msg.data = &shutdown_msg; - - /* - * Explicity send the message to both primary - * and backup controllers + + /* + * Explicity send the message to both primary + * and backup controllers */ (void) _send_message_controller(SECONDARY_CONTROLLER, &req_msg); return _send_message_controller(PRIMARY_CONTROLLER, &req_msg); } /* - * slurm_takeover - issue RPC to have Slurm backup controller take over the - * primary controller. REQUEST_CONTROL is sent by the backup + * slurm_takeover - issue RPC to have Slurm backup controller take over the + * primary controller. REQUEST_CONTROL is sent by the backup * to the primary controller to take control * RET 0 or a slurm error code */ @@ -148,30 +148,30 @@ slurm_takeover ( void ) slurm_msg_t_init(&req_msg); req_msg.msg_type = REQUEST_TAKEOVER; - + return _send_message_controller(SECONDARY_CONTROLLER, &req_msg); } int -_send_message_controller (enum controller_id dest, slurm_msg_t *req) +_send_message_controller (enum controller_id dest, slurm_msg_t *req) { int rc = SLURM_PROTOCOL_SUCCESS; slurm_fd fd = -1; slurm_msg_t *resp_msg = NULL; - + /* always going to one node (primary or backup per value of "dest") */ if ((fd = slurm_open_controller_conn_spec(dest)) < 0) slurm_seterrno_ret(SLURMCTLD_COMMUNICATIONS_CONNECTION_ERROR); - if (slurm_send_node_msg(fd, req) < 0) + if (slurm_send_node_msg(fd, req) < 0) slurm_seterrno_ret(SLURMCTLD_COMMUNICATIONS_SEND_ERROR); resp_msg = xmalloc(sizeof(slurm_msg_t)); slurm_msg_t_init(resp_msg); - + if((rc = slurm_receive_msg(fd, resp_msg, 0)) != 0) { return SLURMCTLD_COMMUNICATIONS_RECEIVE_ERROR; } - + if (slurm_shutdown_msg_conn(fd) != SLURM_SUCCESS) rc = SLURMCTLD_COMMUNICATIONS_SHUTDOWN_ERROR; else if (resp_msg->msg_type != RESPONSE_SLURM_RC) diff --git a/src/api/reservation_info.c b/src/api/reservation_info.c index b20ec80fa0..58de598bda 100644 --- a/src/api/reservation_info.c +++ b/src/api/reservation_info.c @@ -5,32 +5,32 @@ * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Morris Jette et. al. * CODE-OCEC-09-009. All rights reserved. - * + * * This file is part of SLURM, a resource management program. * For details, see . * Please also read the included file: DISCLAIMER. - * + * * SLURM is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free * Software Foundation; either version 2 of the License, or (at your option) * any later version. * - * In addition, as a special exception, the copyright holders give permission + * In addition, as a special exception, the copyright holders give permission * to link the code of portions of this program with the OpenSSL library under - * certain conditions as described in each individual source file, and - * distribute linked combinations including the two. You must obey the GNU - * General Public License in all respects for all of the code used other than - * OpenSSL. If you modify file(s) with this exception, you may extend this - * exception to your version of the file(s), but you are not obligated to do + * certain conditions as described in each individual source file, and + * distribute linked combinations including the two. You must obey the GNU + * General Public License in all respects for all of the code used other than + * OpenSSL. If you modify file(s) with this exception, you may extend this + * exception to your version of the file(s), but you are not obligated to do * so. If you do not wish to do so, delete this exception statement from your - * version. If you delete this exception statement from all source files in + * version. If you delete this exception statement from all source files in * the program, then also delete it here. - * + * * SLURM is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. - * + * * You should have received a copy of the GNU General Public License along * with SLURM; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. @@ -52,20 +52,20 @@ #include "src/common/xstring.h" /* - * slurm_print_reservation_info_msg - output information about all Slurm + * slurm_print_reservation_info_msg - output information about all Slurm * reservations based upon message as loaded using slurm_load_reservation * IN out - file to write to * IN resv_info_ptr - reservation information message pointer * IN one_liner - print as a single line if true */ -void slurm_print_reservation_info_msg ( FILE* out, +void slurm_print_reservation_info_msg ( FILE* out, reserve_info_msg_t * resv_info_ptr, int one_liner ) { int i ; reserve_info_t * resv_ptr = resv_info_ptr->reservation_array ; char time_str[32]; - slurm_make_time_str( (time_t *)&resv_info_ptr->last_update, time_str, + slurm_make_time_str( (time_t *)&resv_info_ptr->last_update, time_str, sizeof(time_str)); fprintf( out, "Reservation data as of %s, record count %d\n", time_str, resv_info_ptr->record_count); @@ -77,13 +77,13 @@ void slurm_print_reservation_info_msg ( FILE* out, } /* - * slurm_print_reservation_info - output information about a specific Slurm + * slurm_print_reservation_info - output information about a specific Slurm * reservation based upon message as loaded using slurm_load_reservation * IN out - file to write to * IN resv_ptr - an individual reservation information record pointer * IN one_liner - print as a single line if true */ -void slurm_print_reservation_info ( FILE* out, reserve_info_t * resv_ptr, +void slurm_print_reservation_info ( FILE* out, reserve_info_t * resv_ptr, int one_liner ) { char *print_this = slurm_sprint_reservation_info(resv_ptr, one_liner); @@ -93,14 +93,14 @@ void slurm_print_reservation_info ( FILE* out, reserve_info_t * resv_ptr, /* - * slurm_sprint_reservation_info - output information about a specific Slurm + * slurm_sprint_reservation_info - output information about a specific Slurm * reservation based upon message as loaded using slurm_load_reservations * IN resv_ptr - an individual reservation information record pointer * IN one_liner - print as a single line if true * RET out - char * containing formatted output (must be freed after call) * NULL is returned on failure. */ -char *slurm_sprint_reservation_info ( reserve_info_t * resv_ptr, +char *slurm_sprint_reservation_info ( reserve_info_t * resv_ptr, int one_liner ) { char tmp1[32], tmp2[32], *flag_str = NULL; @@ -112,8 +112,8 @@ char *slurm_sprint_reservation_info ( reserve_info_t * resv_ptr, slurm_make_time_str(&resv_ptr->end_time, tmp2, sizeof(tmp2)); snprintf(tmp_line, sizeof(tmp_line), "ReservationName=%s StartTime=%s EndTime=%s Duration=%u", - resv_ptr->name, tmp1, tmp2, - (uint32_t) (difftime(resv_ptr->end_time, + resv_ptr->name, tmp1, tmp2, + (uint32_t) (difftime(resv_ptr->end_time, resv_ptr->start_time) / 60)); xstrcat(out, tmp_line); @@ -121,11 +121,11 @@ char *slurm_sprint_reservation_info ( reserve_info_t * resv_ptr, xstrcat(out, " "); else xstrcat(out, "\n "); - + /****** Line 2 ******/ flag_str = reservation_flags_string(resv_ptr->flags); - snprintf(tmp_line, sizeof(tmp_line), + snprintf(tmp_line, sizeof(tmp_line), "Nodes=%s NodeCnt=%u Features=%s PartitionName=%s Flags=%s", resv_ptr->node_list, resv_ptr->node_cnt, resv_ptr->features, resv_ptr->partition, flag_str); @@ -135,32 +135,32 @@ char *slurm_sprint_reservation_info ( reserve_info_t * resv_ptr, xstrcat(out, " "); else xstrcat(out, "\n "); - + /****** Line 3 ******/ - snprintf(tmp_line, sizeof(tmp_line), - "Users=%s Accounts=%s Licenses=%s", + snprintf(tmp_line, sizeof(tmp_line), + "Users=%s Accounts=%s Licenses=%s", resv_ptr->users, resv_ptr->accounts, resv_ptr->licenses); xstrcat(out, tmp_line); if (one_liner) xstrcat(out, "\n"); else xstrcat(out, "\n\n"); - + return out; } /* - * slurm_load_reservations - issue RPC to get all slurm reservation - * configuration information if changed since update_time + * slurm_load_reservations - issue RPC to get all slurm reservation + * configuration information if changed since update_time * IN update_time - time of current configuration data - * IN reserve_info_msg_pptr - place to store a reservation configuration + * IN reserve_info_msg_pptr - place to store a reservation configuration * pointer * RET 0 or a slurm error code * NOTE: free the response using slurm_free_reservation_info_msg */ -extern int slurm_load_reservations (time_t update_time, +extern int slurm_load_reservations (time_t update_time, reserve_info_msg_t **resp) { int rc; @@ -174,18 +174,18 @@ extern int slurm_load_reservations (time_t update_time, req.last_update = update_time; req_msg.msg_type = REQUEST_RESERVATION_INFO; req_msg.data = &req; - + if (slurm_send_recv_controller_msg(&req_msg, &resp_msg) < 0) return SLURM_ERROR; - + switch (resp_msg.msg_type) { case RESPONSE_RESERVATION_INFO: *resp = (reserve_info_msg_t *) resp_msg.data; break; case RESPONSE_SLURM_RC: rc = ((return_code_msg_t *) resp_msg.data)->return_code; - slurm_free_return_code_msg(resp_msg.data); - if (rc) + slurm_free_return_code_msg(resp_msg.data); + if (rc) slurm_seterrno_ret(rc); *resp = NULL; break; diff --git a/src/api/signal.c b/src/api/signal.c index 7f59f7ffea..8e8b0c2ae1 100644 --- a/src/api/signal.c +++ b/src/api/signal.c @@ -6,32 +6,32 @@ * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Christopher J. Morrone . * CODE-OCEC-09-009. All rights reserved. - * + * * This file is part of SLURM, a resource management program. * For details, see . * Please also read the included file: DISCLAIMER. - * + * * SLURM is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free * Software Foundation; either version 2 of the License, or (at your option) * any later version. * - * In addition, as a special exception, the copyright holders give permission + * In addition, as a special exception, the copyright holders give permission * to link the code of portions of this program with the OpenSSL library under - * certain conditions as described in each individual source file, and - * distribute linked combinations including the two. You must obey the GNU - * General Public License in all respects for all of the code used other than - * OpenSSL. If you modify file(s) with this exception, you may extend this - * exception to your version of the file(s), but you are not obligated to do + * certain conditions as described in each individual source file, and + * distribute linked combinations including the two. You must obey the GNU + * General Public License in all respects for all of the code used other than + * OpenSSL. If you modify file(s) with this exception, you may extend this + * exception to your version of the file(s), but you are not obligated to do * so. If you do not wish to do so, delete this exception statement from your - * version. If you delete this exception statement from all source files in + * version. If you delete this exception statement from all source files in * the program, then also delete it here. - * + * * SLURM is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. - * + * * You should have received a copy of the GNU General Public License along * with SLURM; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. @@ -75,7 +75,7 @@ static int _terminate_batch_script_step( * IN signal - signal number * RET 0 on success, otherwise return -1 and set errno to indicate the error */ -extern int +extern int slurm_signal_job (uint32_t job_id, uint16_t signal) { int rc = SLURM_SUCCESS; @@ -83,7 +83,7 @@ slurm_signal_job (uint32_t job_id, uint16_t signal) signal_job_msg_t rpc; if (slurm_allocation_lookup_lite(job_id, &alloc_info)) { - rc = slurm_get_errno(); + rc = slurm_get_errno(); goto fail1; } @@ -91,7 +91,7 @@ slurm_signal_job (uint32_t job_id, uint16_t signal) rpc.job_id = job_id; rpc.signal = (uint32_t)signal; - rc = _local_send_recv_rc_msgs(alloc_info->node_list, + rc = _local_send_recv_rc_msgs(alloc_info->node_list, REQUEST_SIGNAL_JOB, &rpc); slurm_free_resource_allocation_response_msg(alloc_info); fail1: @@ -110,7 +110,7 @@ fail1: * IN signal - signal number * RET 0 on success, otherwise return -1 and set errno to indicate the error */ -extern int +extern int slurm_signal_job_step (uint32_t job_id, uint32_t step_id, uint16_t signal) { resource_allocation_response_msg_t *alloc_info = NULL; @@ -138,7 +138,7 @@ slurm_signal_job_step (uint32_t job_id, uint32_t step_id, uint16_t signal) * Otherwise, look through the list of job step info and find * the one matching step_id. Signal that step. */ - rc = slurm_get_job_steps((time_t)0, job_id, step_id, + rc = slurm_get_job_steps((time_t)0, job_id, step_id, &step_info, SHOW_ALL); if (rc != 0) { save_errno = errno; @@ -160,8 +160,8 @@ fail: return rc ? -1 : 0; } -static int -_local_send_recv_rc_msgs(const char *nodelist, slurm_msg_type_t type, +static int +_local_send_recv_rc_msgs(const char *nodelist, slurm_msg_type_t type, void *data) { List ret_list = NULL; @@ -201,7 +201,7 @@ _signal_job_step(const job_step_info_t *step, rpc.job_id = step->job_id; rpc.job_step_id = step->step_id; rpc.signal = (uint32_t)signal; - rc = _local_send_recv_rc_msgs(allocation->node_list, + rc = _local_send_recv_rc_msgs(allocation->node_list, REQUEST_SIGNAL_TASKS, &rpc); return rc; } @@ -228,7 +228,7 @@ static int _signal_batch_script_step( msg.data = &rpc; if(slurm_conf_get_addr(name, &msg.address) == SLURM_ERROR) { error("_signal_batch_script_step: " - "can't find address for host %s, check slurm.conf", + "can't find address for host %s, check slurm.conf", name); free(name); return -1; @@ -249,7 +249,7 @@ static int _signal_batch_script_step( * IN job_id - the job's id * RET 0 on success, otherwise return -1 and set errno to indicate the error */ -extern int +extern int slurm_terminate_job (uint32_t job_id) { int rc = SLURM_SUCCESS; @@ -257,14 +257,14 @@ slurm_terminate_job (uint32_t job_id) signal_job_msg_t rpc; if (slurm_allocation_lookup_lite(job_id, &alloc_info)) { - rc = slurm_get_errno(); + rc = slurm_get_errno(); goto fail1; } /* same remote procedure call for each node */ rpc.job_id = job_id; rpc.signal = (uint32_t)-1; /* not used by slurmd */ - rc = _local_send_recv_rc_msgs(alloc_info->node_list, + rc = _local_send_recv_rc_msgs(alloc_info->node_list, REQUEST_TERMINATE_JOB, &rpc); slurm_free_resource_allocation_response_msg(alloc_info); @@ -287,7 +287,7 @@ fail1: * to terminate a job's batch script * RET 0 on success, otherwise return -1 and set errno to indicate the error */ -extern int +extern int slurm_terminate_job_step (uint32_t job_id, uint32_t step_id) { resource_allocation_response_msg_t *alloc_info = NULL; @@ -299,7 +299,7 @@ slurm_terminate_job_step (uint32_t job_id, uint32_t step_id) if (slurm_allocation_lookup_lite(job_id, &alloc_info)) { return -1; } - + /* * The controller won't give us info about the batch script job step, * so we need to handle that seperately. @@ -315,7 +315,7 @@ slurm_terminate_job_step (uint32_t job_id, uint32_t step_id) * Otherwise, look through the list of job step info and find * the one matching step_id. Terminate that step. */ - rc = slurm_get_job_steps((time_t)0, job_id, step_id, + rc = slurm_get_job_steps((time_t)0, job_id, step_id, &step_info, SHOW_ALL); if (rc != 0) { save_errno = errno; @@ -357,7 +357,7 @@ _terminate_job_step(const job_step_info_t *step, rpc.job_id = step->job_id; rpc.job_step_id = step->step_id; rpc.signal = (uint32_t)-1; /* not used by slurmd */ - rc = _local_send_recv_rc_msgs(allocation->node_list, + rc = _local_send_recv_rc_msgs(allocation->node_list, REQUEST_TERMINATE_TASKS, &rpc); if (rc == -1 && errno == ESLURM_ALREADY_DONE) { rc = 0; @@ -381,7 +381,7 @@ static int _terminate_batch_script_step( allocation->node_list); return -1; } - + rpc.job_id = allocation->job_id; rpc.job_step_id = SLURM_BATCH_SCRIPT; rpc.signal = (uint32_t)-1; /* not used by slurmd */ @@ -392,7 +392,7 @@ static int _terminate_batch_script_step( if(slurm_conf_get_addr(name, &msg.address) == SLURM_ERROR) { error("_signal_batch_script_step: " - "can't find address for host %s, check slurm.conf", + "can't find address for host %s, check slurm.conf", name); free(name); return -1; @@ -406,7 +406,7 @@ static int _terminate_batch_script_step( } /* - * slurm_notify_job - send message to the job's stdout, + * slurm_notify_job - send message to the job's stdout, * usable only by user root * IN job_id - slurm job_id or 0 for all jobs * IN message - arbitrary message @@ -419,7 +419,7 @@ extern int slurm_notify_job (uint32_t job_id, char *message) job_notify_msg_t req; slurm_msg_t_init(&msg); - /* + /* * Request message: */ req.job_id = job_id; diff --git a/src/api/slurm_hostlist.c b/src/api/slurm_hostlist.c index 16e9fb06b3..01fc85e442 100644 --- a/src/api/slurm_hostlist.c +++ b/src/api/slurm_hostlist.c @@ -6,32 +6,32 @@ * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Danny Auble . * LLNL-CODE-402394. - * + * * This file is part of SLURM, a resource management program. * For details, see . * Please also read the included file: DISCLAIMER. - * + * * SLURM is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free * Software Foundation; either version 2 of the License, or (at your option) * any later version. * - * In addition, as a special exception, the copyright holders give permission - * to link the code of portions of this program with the OpenSSL library under - * certain conditions as described in each individual source file, and - * distribute linked combinations including the two. You must obey the GNU - * General Public License in all respects for all of the code used other than - * OpenSSL. If you modify file(s) with this exception, you may extend this - * exception to your version of the file(s), but you are not obligated to do + * In addition, as a special exception, the copyright holders give permission + * to link the code of portions of this program with the OpenSSL library under + * certain conditions as described in each individual source file, and + * distribute linked combinations including the two. You must obey the GNU + * General Public License in all respects for all of the code used other than + * OpenSSL. If you modify file(s) with this exception, you may extend this + * exception to your version of the file(s), but you are not obligated to do * so. If you do not wish to do so, delete this exception statement from your - * version. If you delete this exception statement from all source files in + * version. If you delete this exception statement from all source files in * the program, then also delete it here. - * + * * SLURM is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. - * + * * You should have received a copy of the GNU General Public License along * with SLURM; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. diff --git a/src/api/slurm_pmi.c b/src/api/slurm_pmi.c index f3c556d5e7..a0ab244dba 100644 --- a/src/api/slurm_pmi.c +++ b/src/api/slurm_pmi.c @@ -5,32 +5,32 @@ * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Morris Jette . * CODE-OCEC-09-009. All rights reserved. - * + * * This file is part of SLURM, a resource management program. * For details, see . * Please also read the included file: DISCLAIMER. - * + * * SLURM is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free * Software Foundation; either version 2 of the License, or (at your option) * any later version. * - * In addition, as a special exception, the copyright holders give permission - * to link the code of portions of this program with the OpenSSL library under - * certain conditions as described in each individual source file, and - * distribute linked combinations including the two. You must obey the GNU - * General Public License in all respects for all of the code used other than - * OpenSSL. If you modify file(s) with this exception, you may extend this - * exception to your version of the file(s), but you are not obligated to do + * In addition, as a special exception, the copyright holders give permission + * to link the code of portions of this program with the OpenSSL library under + * certain conditions as described in each individual source file, and + * distribute linked combinations including the two. You must obey the GNU + * General Public License in all respects for all of the code used other than + * OpenSSL. If you modify file(s) with this exception, you may extend this + * exception to your version of the file(s), but you are not obligated to do * so. If you do not wish to do so, delete this exception statement from your - * version. If you delete this exception statement from all source files in + * version. If you delete this exception statement from all source files in * the program, then also delete it here. - * + * * SLURM is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. - * + * * You should have received a copy of the GNU General Public License along * with SLURM; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. @@ -99,7 +99,7 @@ again: if (gettimeofday(&tv1, NULL)) { } /* Verify we are active at the right time. If current time is different - * from target by more than 15*pmi_time, then start over. If PMI_TIME + * from target by more than 15*pmi_time, then start over. If PMI_TIME * is set appropriately, then srun should have no more than 30 RPCs * in the queue at one time in the worst case. */ if (gettimeofday(&tv2, NULL)) @@ -113,7 +113,7 @@ again: if (gettimeofday(&tv1, NULL)) { error_time = delta_time - tot_time; if (error_time > (15*pmi_time)) { /* too far off */ #if 0 - info("delta=%u tot=%u err=%u", + info("delta=%u tot=%u err=%u", delta_time, tot_time, error_time); #endif if ((++retries) <= 2) @@ -159,7 +159,7 @@ static void _set_pmi_time(void) } /* Transmit PMI Keyval space data */ -int slurm_send_kvs_comm_set(struct kvs_comm_set *kvs_set_ptr, +int slurm_send_kvs_comm_set(struct kvs_comm_set *kvs_set_ptr, int pmi_rank, int pmi_size) { slurm_msg_t msg_send; @@ -169,19 +169,19 @@ int slurm_send_kvs_comm_set(struct kvs_comm_set *kvs_set_ptr, return EINVAL; if ((rc = _get_addr()) != SLURM_SUCCESS) - return rc; + return rc; _set_pmi_time(); slurm_msg_t_init(&msg_send); msg_send.address = srun_addr; msg_send.msg_type = PMI_KVS_PUT_REQ; msg_send.data = (void *) kvs_set_ptr; - + /* Send the RPC to the local srun communcation manager. - * Since the srun can be sent thousands of messages at - * the same time and refuse some connections, retry as - * needed. Spread out messages by task's rank. Also - * increase the timeout if many tasks since the srun + * Since the srun can be sent thousands of messages at + * the same time and refuse some connections, retry as + * needed. Spread out messages by task's rank. Also + * increase the timeout if many tasks since the srun * command is very overloaded. * We also increase the timeout (default timeout is * 10 secs). */ @@ -208,7 +208,7 @@ int slurm_send_kvs_comm_set(struct kvs_comm_set *kvs_set_ptr, } /* Wait for barrier and get full PMI Keyval space data */ -int slurm_get_kvs_comm_set(struct kvs_comm_set **kvs_set_ptr, +int slurm_get_kvs_comm_set(struct kvs_comm_set **kvs_set_ptr, int pmi_rank, int pmi_size) { int rc, srun_fd, retries = 0, timeout = 0; @@ -243,7 +243,7 @@ int slurm_get_kvs_comm_set(struct kvs_comm_set **kvs_set_ptr, } /* hostname is not set here, so slurm_get_addr fails slurm_get_addr(&slurm_addr, &port, hostname, sizeof(hostname)); */ - port = ntohs(slurm_addr.sin_port); + port = ntohs(slurm_addr.sin_port); if ((env_pmi_ifhn = getenv("SLURM_PMI_RESP_IFHN"))) { strncpy(hostname, env_pmi_ifhn, sizeof(hostname)); hostname[sizeof(hostname)-1] = 0; @@ -261,11 +261,11 @@ int slurm_get_kvs_comm_set(struct kvs_comm_set **kvs_set_ptr, msg_send.data = &data; /* Send the RPC to the local srun communcation manager. - * Since the srun can be sent thousands of messages at - * the same time and refuse some connections, retry as + * Since the srun can be sent thousands of messages at + * the same time and refuse some connections, retry as * needed. Wait until all key-pairs have been sent by * all tasks then spread out messages by task's rank. - * Also increase the message timeout if many tasks + * Also increase the message timeout if many tasks * since the srun command can get very overloaded (the * default timeout is 10 secs). */ @@ -308,7 +308,7 @@ int slurm_get_kvs_comm_set(struct kvs_comm_set **kvs_set_ptr, } if(msg_rcv.auth_cred) (void)g_slurm_auth_destroy(msg_rcv.auth_cred); - + if (msg_rcv.msg_type != PMI_KVS_GET_RESP) { error("slurm_get_kvs_comm_set msg_type=%d", msg_rcv.msg_type); slurm_close_accepted_conn(srun_fd); @@ -316,7 +316,7 @@ int slurm_get_kvs_comm_set(struct kvs_comm_set **kvs_set_ptr, } if (slurm_send_rc_msg(&msg_rcv, SLURM_SUCCESS) < 0) error("slurm_send_rc_msg: %m"); - + slurm_close_accepted_conn(srun_fd); *kvs_set_ptr = msg_rcv.data; @@ -325,7 +325,7 @@ int slurm_get_kvs_comm_set(struct kvs_comm_set **kvs_set_ptr, } /* Forward keypair info to other tasks as required. - * Clear message forward structure upon completion. + * Clear message forward structure upon completion. * The messages are forwarded sequentially. */ static int _forward_comm_set(struct kvs_comm_set *kvs_set_ptr) { diff --git a/src/api/slurm_pmi.h b/src/api/slurm_pmi.h index 675fbfae99..9aed20405f 100644 --- a/src/api/slurm_pmi.h +++ b/src/api/slurm_pmi.h @@ -5,32 +5,32 @@ * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Morris Jette . * CODE-OCEC-09-009. All rights reserved. - * + * * This file is part of SLURM, a resource management program. * For details, see . * Please also read the included file: DISCLAIMER. - * + * * SLURM is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free * Software Foundation; either version 2 of the License, or (at your option) * any later version. * - * In addition, as a special exception, the copyright holders give permission - * to link the code of portions of this program with the OpenSSL library under - * certain conditions as described in each individual source file, and - * distribute linked combinations including the two. You must obey the GNU - * General Public License in all respects for all of the code used other than - * OpenSSL. If you modify file(s) with this exception, you may extend this - * exception to your version of the file(s), but you are not obligated to do + * In addition, as a special exception, the copyright holders give permission + * to link the code of portions of this program with the OpenSSL library under + * certain conditions as described in each individual source file, and + * distribute linked combinations including the two. You must obey the GNU + * General Public License in all respects for all of the code used other than + * OpenSSL. If you modify file(s) with this exception, you may extend this + * exception to your version of the file(s), but you are not obligated to do * so. If you do not wish to do so, delete this exception statement from your - * version. If you delete this exception statement from all source files in + * version. If you delete this exception statement from all source files in * the program, then also delete it here. - * + * * SLURM is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. - * + * * You should have received a copy of the GNU General Public License along * with SLURM; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. @@ -83,7 +83,7 @@ int slurm_send_kvs_comm_set(struct kvs_comm_set *kvs_set_ptr, int pmi_rank, int pmi_size); /* Wait for barrier and get full PMI Keyval space data */ -int slurm_get_kvs_comm_set(struct kvs_comm_set **kvs_set_ptr, +int slurm_get_kvs_comm_set(struct kvs_comm_set **kvs_set_ptr, int pmi_rank, int pmi_size); /* Free kvs_comm_set returned by slurm_get_kvs_comm_set() */ diff --git a/src/api/step_ctx.c b/src/api/step_ctx.c index d956f4dd6b..19afd40562 100644 --- a/src/api/step_ctx.c +++ b/src/api/step_ctx.c @@ -6,32 +6,32 @@ * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Morris Jette . * CODE-OCEC-09-009. All rights reserved. - * + * * This file is part of SLURM, a resource management program. * For details, see . * Please also read the included file: DISCLAIMER. - * + * * SLURM is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free * Software Foundation; either version 2 of the License, or (at your option) * any later version. * - * In addition, as a special exception, the copyright holders give permission + * In addition, as a special exception, the copyright holders give permission * to link the code of portions of this program with the OpenSSL library under - * certain conditions as described in each individual source file, and - * distribute linked combinations including the two. You must obey the GNU - * General Public License in all respects for all of the code used other than - * OpenSSL. If you modify file(s) with this exception, you may extend this - * exception to your version of the file(s), but you are not obligated to do + * certain conditions as described in each individual source file, and + * distribute linked combinations including the two. You must obey the GNU + * General Public License in all respects for all of the code used other than + * OpenSSL. If you modify file(s) with this exception, you may extend this + * exception to your version of the file(s), but you are not obligated to do * so. If you do not wish to do so, delete this exception statement from your - * version. If you delete this exception statement from all source files in + * version. If you delete this exception statement from all source files in * the program, then also delete it here. - * + * * SLURM is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. - * + * * You should have received a copy of the GNU General Public License along * with SLURM; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. @@ -93,7 +93,7 @@ _job_fake_cred(struct slurm_step_ctx_struct *ctx) static job_step_create_request_msg_t *_create_step_request( const slurm_step_ctx_params_t *step_params) { - job_step_create_request_msg_t *step_req = + job_step_create_request_msg_t *step_req = xmalloc(sizeof(job_step_create_request_msg_t)); step_req->job_id = step_params->job_id; step_req->user_id = (uint32_t)step_params->uid; @@ -120,7 +120,7 @@ static job_step_create_request_msg_t *_create_step_request( } /* - * slurm_step_ctx_create - Create a job step and its context. + * slurm_step_ctx_create - Create a job step and its context. * IN step_params - job step parameters * RET the step context or NULL on failure with slurm errno set * NOTE: Free allocated memory using slurm_step_ctx_destroy. @@ -134,7 +134,7 @@ slurm_step_ctx_create (const slurm_step_ctx_params_t *step_params) int sock = -1; short port = 0; int errnum = 0; - + /* First copy the user's step_params into a step request * struct */ step_req = _create_step_request(step_params); @@ -158,7 +158,7 @@ slurm_step_ctx_create (const slurm_step_ctx_params_t *step_params) slurm_free_job_step_create_request_msg(step_req); goto fail; } - + ctx = xmalloc(sizeof(struct slurm_step_ctx_struct)); ctx->launch_state = NULL; ctx->magic = STEP_CTX_MAGIC; @@ -177,7 +177,7 @@ fail: /* * slurm_step_ctx_create_no_alloc - Create a job step and its context without - * getting an allocation. + * getting an allocation. * IN step_params - job step parameters * IN step_id - since we are faking it give me the id to use * RET the step context or NULL on failure with slurm errno set @@ -194,7 +194,7 @@ slurm_step_ctx_create_no_alloc (const slurm_step_ctx_params_t *step_params, short port = 0; int errnum = 0; int cyclic = (step_params->task_dist == SLURM_DIST_CYCLIC); - + /* First copy the user's step_params into a step request struct */ step_req = _create_step_request(step_params); @@ -216,16 +216,16 @@ slurm_step_ctx_create_no_alloc (const slurm_step_ctx_params_t *step_params, xmalloc(sizeof(job_step_create_response_msg_t)); step_resp->step_layout = fake_slurm_step_layout_create( - step_req->node_list, + step_req->node_list, NULL, NULL, step_req->node_count, step_req->num_tasks); - + if (switch_alloc_jobinfo(&step_resp->switch_job) < 0) fatal("switch_alloc_jobinfo: %m"); - if (switch_build_jobinfo(step_resp->switch_job, - step_resp->step_layout->node_list, - step_resp->step_layout->tasks, + if (switch_build_jobinfo(step_resp->switch_job, + step_resp->step_layout->node_list, + step_resp->step_layout->tasks, cyclic, step_req->network) < 0) fatal("switch_build_jobinfo: %m"); @@ -244,9 +244,9 @@ slurm_step_ctx_create_no_alloc (const slurm_step_ctx_params_t *step_params, ctx->launch_state = step_launch_state_create(ctx); ctx->launch_state->slurmctld_socket_fd = sock; - + _job_fake_cred(ctx); - + fail: errno = errnum; return (slurm_step_ctx_t *)ctx; @@ -272,7 +272,7 @@ slurm_step_ctx_get (slurm_step_ctx_t *ctx, int ctx_key, ...) switch_jobinfo_t **switch_job; int *int_ptr; int **int_array_pptr = (int **) NULL; - + if ((ctx == NULL) || (ctx->magic != STEP_CTX_MAGIC)) { slurm_seterrno(EINVAL); return SLURM_ERROR; @@ -292,7 +292,7 @@ slurm_step_ctx_get (slurm_step_ctx_t *ctx, int ctx_key, ...) uint16_array_pptr = (uint16_t **) va_arg(ap, void *); *uint16_array_pptr = ctx->step_resp->step_layout->tasks; break; - + case SLURM_STEP_CTX_TID: node_inx = va_arg(ap, uint32_t); if ((node_inx < 0) @@ -305,9 +305,9 @@ slurm_step_ctx_get (slurm_step_ctx_t *ctx, int ctx_key, ...) *uint32_array_pptr = ctx->step_resp->step_layout->tids[node_inx]; break; - + case SLURM_STEP_CTX_RESP: - step_resp_pptr = (job_step_create_response_msg_t **) + step_resp_pptr = (job_step_create_response_msg_t **) va_arg(ap, void *); *step_resp_pptr = ctx->step_resp; break; @@ -430,9 +430,9 @@ slurm_step_ctx_daemon_per_node_hack(slurm_step_ctx_t *ctx) new_layout->task_cnt = old_layout->node_cnt; new_layout->node_list = xstrdup(old_layout->node_list); slurm_step_layout_destroy(old_layout); - new_layout->tasks = (uint16_t *) xmalloc(sizeof(uint16_t) * + new_layout->tasks = (uint16_t *) xmalloc(sizeof(uint16_t) * new_layout->node_cnt); - new_layout->tids = (uint32_t **) xmalloc(sizeof(uint32_t *) * + new_layout->tids = (uint32_t **) xmalloc(sizeof(uint32_t *) * new_layout->node_cnt); for (i = 0; i < new_layout->node_cnt; i++) { new_layout->tasks[i] = 1; @@ -449,7 +449,7 @@ slurm_step_ctx_daemon_per_node_hack(slurm_step_ctx_t *ctx) return SLURM_SUCCESS; } -/* +/* * slurm_step_ctx_params_t_init - This initializes parameters * in the structure that you will pass to slurm_step_ctx_create(). * This function will NOT allocate any new memory. diff --git a/src/api/step_ctx.h b/src/api/step_ctx.h index 8ecd265978..f934d99221 100644 --- a/src/api/step_ctx.h +++ b/src/api/step_ctx.h @@ -8,21 +8,21 @@ * Written by Morris Jette , * Christopher J. Morrone * CODE-OCEC-09-009. All rights reserved. - * + * * This file is part of SLURM, a resource management program. * For details, see . * Please also read the included file: DISCLAIMER. - * + * * SLURM is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free * Software Foundation; either version 2 of the License, or (at your option) * any later version. - * + * * SLURM is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. - * + * * You should have received a copy of the GNU General Public License along * with SLURM; if not, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. diff --git a/src/api/step_io.c b/src/api/step_io.c index d6beed561b..8c41632894 100644 --- a/src/api/step_io.c +++ b/src/api/step_io.c @@ -6,21 +6,21 @@ * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Mark Grondona , et. al. * CODE-OCEC-09-009. All rights reserved. - * + * * This file is part of SLURM, a resource management program. * For details, see . * Please also read the included file: DISCLAIMER. - * + * * SLURM is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free * Software Foundation; either version 2 of the License, or (at your option) * any later version. - * + * * SLURM is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. - * + * * You should have received a copy of the GNU General Public License along * with SLURM; if not, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. @@ -123,7 +123,7 @@ struct server_io_info { bool in_eof; int remote_stdout_objs; /* active eio_obj_t's on the remote node */ int remote_stderr_objs; /* active eio_obj_t's on the remote node */ - + /* outgoing variables */ List msg_queue; struct io_buf *out_msg; @@ -181,7 +181,7 @@ struct file_read_info { /********************************************************************** * Listening socket functions **********************************************************************/ -static bool +static bool _listening_socket_readable(eio_obj_t *obj) { debug3("Called _listening_socket_readable"); @@ -211,7 +211,7 @@ static void _set_listensocks_nonblocking(client_io_t *cio) { int i; - for (i = 0; i < cio->num_listen; i++) + for (i = 0; i < cio->num_listen; i++) fd_set_nonblocking(cio->listensock[i]); } @@ -244,7 +244,7 @@ _create_server_eio_obj(int fd, client_io_t *cio, int nodeid, return eio; } -static bool +static bool _server_readable(eio_obj_t *obj) { struct server_io_info *s = (struct server_io_info *) obj->arg; @@ -265,7 +265,7 @@ _server_readable(eio_obj_t *obj) s->testing_connection) { debug4("remote_stdout_objs = %d", s->remote_stdout_objs); debug4("remote_stderr_objs = %d", s->remote_stderr_objs); - return true; + return true; } if (obj->shutdown) { @@ -302,7 +302,7 @@ _server_read(eio_obj_t *obj, List objs) n = io_hdr_read_fd(obj->fd, &s->header); if (n <= 0) { /* got eof or error on socket read */ if (s->cio->sls) - step_launch_notify_io_failure(s->cio->sls, + step_launch_notify_io_failure(s->cio->sls, s->node_id); debug3("got error or unexpected eof " "on _server_read header"); @@ -378,7 +378,7 @@ _server_read(eio_obj_t *obj, List objs) else { debug3("***** passing on eof message"); } - + /* * Route the message to the proper output */ @@ -404,7 +404,7 @@ _server_read(eio_obj_t *obj, List objs) return SLURM_SUCCESS; } -static bool +static bool _server_writable(eio_obj_t *obj) { struct server_io_info *s = (struct server_io_info *) obj->arg; @@ -449,13 +449,13 @@ _server_write(eio_obj_t *obj, List objs) debug3("_server_write: nothing in the queue"); return SLURM_SUCCESS; } - debug3(" dequeue successful, s->out_msg->length = %d", + debug3(" dequeue successful, s->out_msg->length = %d", s->out_msg->length); s->out_remaining = s->out_msg->length; } - debug3(" s->out_remaining = %d", s->out_remaining); - + debug3(" s->out_remaining = %d", s->out_remaining); + /* * Write message to socket. */ @@ -470,7 +470,7 @@ again: } else { error("_server_write write failed: %m"); if (s->cio->sls) - step_launch_notify_io_failure(s->cio->sls, + step_launch_notify_io_failure(s->cio->sls, s->node_id); s->out_eof = true; /* FIXME - perhaps we should free the message here? */ @@ -557,7 +557,7 @@ static int _file_write(eio_obj_t *obj, List objs) } info->out_remaining = info->out_msg->length; } - + /* * Write message to file. */ @@ -802,7 +802,7 @@ _read_io_init_msg(int fd, client_io_t *cio, char *host) goto fail; } if (io_init_msg_validate(&msg, cio->io_key) < 0) { - goto fail; + goto fail; } if (msg.nodeid >= cio->num_nodes) { error ("Invalid nodeid %d from %s", msg.nodeid, host); @@ -845,7 +845,7 @@ _read_io_init_msg(int fd, client_io_t *cio, char *host) } -static bool +static bool _is_fd_ready(int fd) { struct pollfd pfd[1]; @@ -872,8 +872,8 @@ _handle_io_init_msg(int fd, client_io_t *cio) struct sockaddr_in *sin; socklen_t size = sizeof(addr); char buf[INET_ADDRSTRLEN]; - - /* + + /* * Return early if fd is not now ready */ if (!_is_fd_ready(fd)) @@ -884,7 +884,7 @@ _handle_io_init_msg(int fd, client_io_t *cio) continue; if (errno == EAGAIN) /* No more connections */ return; - if ((errno == ECONNABORTED) || + if ((errno == ECONNABORTED) || (errno == EWOULDBLOCK)) { return; } @@ -895,11 +895,11 @@ _handle_io_init_msg(int fd, client_io_t *cio) sin = (struct sockaddr_in *) &addr; inet_ntop(AF_INET, &sin->sin_addr, buf, INET_ADDRSTRLEN); - debug3("Accepted IO connection: ip=%s sd=%d", buf, sd); + debug3("Accepted IO connection: ip=%s sd=%d", buf, sd); /* * On AIX the new socket [sd] seems to inherit the O_NONBLOCK - * flag from the listening socket [fd], so we need to + * flag from the listening socket [fd], so we need to * explicitly set it back to blocking mode. * (XXX: This should eventually be fixed by making * reads of IO headers nonblocking) @@ -1243,7 +1243,7 @@ client_io_handler_abort(client_io_t *cio) } -int client_io_handler_send_test_message(client_io_t *cio, int node_id, +int client_io_handler_send_test_message(client_io_t *cio, int node_id, bool *sent_message) { struct io_buf *msg; @@ -1258,8 +1258,8 @@ int client_io_handler_send_test_message(client_io_t *cio, int node_id, *sent_message = false; /* In this case, the I/O connection has not yet been established. - A problem might go undetected here, if a task appears to get - launched correctly, but fails before it can make its I/O + A problem might go undetected here, if a task appears to get + launched correctly, but fails before it can make its I/O connection. TODO: Set a timer, see if the task has checked in within some timeout, and abort the job if not. */ if (cio->ioserver[node_id] == NULL) { @@ -1272,7 +1272,7 @@ int client_io_handler_send_test_message(client_io_t *cio, int node_id, goto done; } - /* + /* * enqueue a test message, which would be ignored by the slurmstepd */ header.type = SLURM_IO_CONNECTION_TEST; diff --git a/src/api/step_io.h b/src/api/step_io.h index 370a6d9c1d..0082489b49 100644 --- a/src/api/step_io.h +++ b/src/api/step_io.h @@ -6,21 +6,21 @@ * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Christopher J. Morrone * CODE-OCEC-09-009. All rights reserved. - * + * * This file is part of SLURM, a resource management program. * For details, see . * Please also read the included file: DISCLAIMER. - * + * * SLURM is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free * Software Foundation; either version 2 of the License, or (at your option) * any later version. - * + * * SLURM is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. - * + * * You should have received a copy of the GNU General Public License along * with SLURM; if not, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. @@ -55,10 +55,10 @@ struct client_io { uint16_t *listenport; /* Array of stdio listen port numbers */ eio_handle_t *eio; /* Event IO handle for stdio traffic */ - pthread_mutex_t ioservers_lock; /* This lock protects - ioservers_ready_bits, ioservers_ready, + pthread_mutex_t ioservers_lock; /* This lock protects + ioservers_ready_bits, ioservers_ready, pointers in ioserver, all the msg_queues - in each ioserver's server_io_info, and + in each ioserver's server_io_info, and the free_incoming list. The queues are used both for normal writes and writes that verify a connection to @@ -124,12 +124,12 @@ void client_io_handler_downnodes(client_io_t *cio, const int *node_ids, int num_node_ids); /* - * Tell the client IO handler to test the communication path to a + * Tell the client IO handler to test the communication path to a * node suspected to be down by sending a message, which will be * ignored by the slurmstepd. If the write fails the step_launch_state * will be notified. */ -int client_io_handler_send_test_message(client_io_t *cio, int node_id, +int client_io_handler_send_test_message(client_io_t *cio, int node_id, bool *sent_message); /* diff --git a/src/api/step_launch.c b/src/api/step_launch.c index fa29fa3c20..2ae2402da6 100644 --- a/src/api/step_launch.c +++ b/src/api/step_launch.c @@ -6,32 +6,32 @@ * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Christopher J. Morrone * CODE-OCEC-09-009. All rights reserved. - * + * * This file is part of SLURM, a resource management program. * For details, see . * Please also read the included file: DISCLAIMER. - * + * * SLURM is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free * Software Foundation; either version 2 of the License, or (at your option) * any later version. * - * In addition, as a special exception, the copyright holders give permission + * In addition, as a special exception, the copyright holders give permission * to link the code of portions of this program with the OpenSSL library under - * certain conditions as described in each individual source file, and - * distribute linked combinations including the two. You must obey the GNU - * General Public License in all respects for all of the code used other than - * OpenSSL. If you modify file(s) with this exception, you may extend this - * exception to your version of the file(s), but you are not obligated to do + * certain conditions as described in each individual source file, and + * distribute linked combinations including the two. You must obey the GNU + * General Public License in all respects for all of the code used other than + * OpenSSL. If you modify file(s) with this exception, you may extend this + * exception to your version of the file(s), but you are not obligated to do * so. If you do not wish to do so, delete this exception statement from your - * version. If you delete this exception statement from all source files in + * version. If you delete this exception statement from all source files in * the program, then also delete it here. - * + * * SLURM is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. - * + * * You should have received a copy of the GNU General Public License along * with SLURM; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. @@ -120,7 +120,7 @@ static struct io_operations message_socket_ops = { * API functions **********************************************************************/ -/* +/* * slurm_step_launch_params_t_init - initialize a user-allocated * slurm_step_launch_params_t structure with default values. * This function will NOT allocate any new memory. @@ -215,7 +215,7 @@ int slurm_step_launch (slurm_step_ctx_t *ctx, env_array_merge(&env, (const char **)params->env); } env_array_for_step(&env, ctx->step_resp, - ctx->launch_state->resp_port[0], + ctx->launch_state->resp_port[0], params->preserve_env); env_array_merge(&env, (const char **)mpi_env); env_array_free(mpi_env); @@ -246,7 +246,7 @@ int slurm_step_launch (slurm_step_ctx_t *ctx, launch.acctg_freq = params->acctg_freq; launch.open_mode = params->open_mode; launch.options = job_options_create(); - launch.complete_nodelist = + launch.complete_nodelist = xstrdup(ctx->step_resp->step_layout->node_list); spank_set_remote_options (launch.options); launch.task_flags = 0; @@ -256,10 +256,10 @@ int slurm_step_launch (slurm_step_ctx_t *ctx, launch.tasks_to_launch = ctx->step_resp->step_layout->tasks; launch.cpus_allocated = ctx->step_resp->step_layout->tasks; launch.global_task_ids = ctx->step_resp->step_layout->tids; - + launch.user_managed_io = params->user_managed_io ? 1 : 0; ctx->launch_state->user_managed_io = params->user_managed_io; - + if (!ctx->launch_state->user_managed_io) { launch.ofname = params->remote_output_filename; launch.efname = params->remote_error_filename; @@ -280,7 +280,7 @@ int slurm_step_launch (slurm_step_ctx_t *ctx, to notify it of I/O errors. */ ctx->launch_state->io.normal->sls = ctx->launch_state; - if (client_io_handler_start(ctx->launch_state->io.normal) + if (client_io_handler_start(ctx->launch_state->io.normal) != SLURM_SUCCESS) { rc = SLURM_ERROR; goto fail1; @@ -291,7 +291,7 @@ int slurm_step_launch (slurm_step_ctx_t *ctx, launch.io_port[i] = ctx->launch_state->io.normal->listenport[i]; } - /* If the io timeout is > 0, create a flag to ping the stepds + /* If the io timeout is > 0, create a flag to ping the stepds if io_timeout seconds pass without stdio traffic to/from the node. */ ctx->launch_state->io_timeout = slurm_get_msg_timeout(); @@ -415,7 +415,7 @@ void slurm_step_launch_wait_finish(slurm_step_ctx_t *ctx) if (errnum == ETIMEDOUT) { error("Timed out waiting for job step to " "complete"); - /* + /* * Send kill again, in case steps were still * launching the first time. * FIXME - eventually the slurmd should @@ -450,9 +450,9 @@ void slurm_step_launch_wait_finish(slurm_step_ctx_t *ctx) /* task_exit_signal != 0 when srun receives a message that a task exited with a SIGTERM or SIGKILL. Without this test, a hang in srun might occur when a node gets a hard power failure, and TCP does not - indicate that the I/O connection closed. The I/O thread could + indicate that the I/O connection closed. The I/O thread could block waiting for an EOF message, even though the remote process - has died. In this case, use client_io_handler_abort to force the + has died. In this case, use client_io_handler_abort to force the I/O thread to stop listening for stdout or stderr and shutdown.*/ if (task_exit_signal && !sls->user_managed_io) { client_io_handler_abort(sls->io.normal); @@ -503,8 +503,8 @@ void slurm_step_launch_abort(slurm_step_ctx_t *ctx) pthread_cond_broadcast(&sls->cond); } -/* - * Forward a signal to all those nodes with running tasks +/* + * Forward a signal to all those nodes with running tasks */ void slurm_step_launch_fwd_signal(slurm_step_ctx_t *ctx, int signo) { @@ -519,21 +519,21 @@ void slurm_step_launch_fwd_signal(slurm_step_ctx_t *ctx, int signo) ret_data_info_t *ret_data_info = NULL; int rc = SLURM_SUCCESS; struct step_launch_state *sls = ctx->launch_state; - + debug2("forward signal %d to job %u", signo, ctx->job_id); /* common to all tasks */ msg.job_id = ctx->job_id; msg.job_step_id = ctx->step_resp->job_step_id; msg.signal = (uint32_t) signo; - + pthread_mutex_lock(&sls->lock); - + hl = hostlist_create(""); for (node_id = 0; node_id < ctx->step_resp->step_layout->node_cnt; node_id++) { - active = 0; + active = 0; num_tasks = sls->layout->tasks[node_id]; for (j = 0; j < num_tasks; j++) { if(bit_test(sls->tasks_started, @@ -545,17 +545,17 @@ void slurm_step_launch_fwd_signal(slurm_step_ctx_t *ctx, int signo) break; } } - + if (!active) continue; - + name = nodelist_nth_host(sls->layout->node_list, node_id); hostlist_push(hl, name); free(name); } pthread_mutex_unlock(&sls->lock); - + if(!hostlist_count(hl)) { hostlist_destroy(hl); goto nothing_left; @@ -563,32 +563,32 @@ void slurm_step_launch_fwd_signal(slurm_step_ctx_t *ctx, int signo) hostlist_ranged_string(hl, sizeof(buf), buf); hostlist_destroy(hl); name = xstrdup(buf); - - slurm_msg_t_init(&req); + + slurm_msg_t_init(&req); req.msg_type = REQUEST_SIGNAL_TASKS; req.data = &msg; - - debug3("sending signal %d to job %u on host %s", + + debug3("sending signal %d to job %u on host %s", signo, ctx->job_id, name); - - if (!(ret_list = slurm_send_recv_msgs(name, &req, 0, false))) { + + if (!(ret_list = slurm_send_recv_msgs(name, &req, 0, false))) { error("fwd_signal: slurm_send_recv_msgs really failed bad"); xfree(name); return; } xfree(name); - itr = list_iterator_create(ret_list); + itr = list_iterator_create(ret_list); while((ret_data_info = list_next(itr))) { - rc = slurm_get_return_code(ret_data_info->type, + rc = slurm_get_return_code(ret_data_info->type, ret_data_info->data); /* - * Report error unless it is "Invalid job id" which + * Report error unless it is "Invalid job id" which * probably just means the tasks exited in the meanwhile. */ if ((rc != 0) && (rc != ESLURM_INVALID_JOB_ID) && (rc != ESLURMD_JOB_NOTRUNNING) && (rc != ESRCH)) { - error("%s: signal: %s", - ret_data_info->node_name, + error("%s: signal: %s", + ret_data_info->node_name, slurm_strerror(rc)); } } @@ -596,7 +596,7 @@ void slurm_step_launch_fwd_signal(slurm_step_ctx_t *ctx, int signo) list_destroy(ret_list); nothing_left: debug2("All tasks have been signalled"); - + } /********************************************************************** @@ -715,7 +715,7 @@ static int _cr_notify_step_launch(slurm_step_ctx_t *ctx) rc = -1; goto out; } - if (write(fd, &ctx->step_resp->job_step_id, sizeof(uint32_t)) != + if (write(fd, &ctx->step_resp->job_step_id, sizeof(uint32_t)) != sizeof(uint32_t)) { error("failed writing job_step_id to srun_cr: %m"); rc = -1; @@ -727,7 +727,7 @@ static int _cr_notify_step_launch(slurm_step_ctx_t *ctx) rc = -1; goto out; } - if (write(fd, ctx->step_resp->step_layout->node_list, len + 1) != + if (write(fd, ctx->step_resp->step_layout->node_list, len + 1) != (len + 1)) { error("failed writing nodelist to srun_cr: %m"); rc = -1; @@ -773,7 +773,7 @@ static int _msg_thr_create(struct step_launch_state *sls, int num_nodes) sls->resp_port = xmalloc(sizeof(uint16_t) * sls->num_resp_port); /* multiple jobs (easily induced via no_alloc) and highly - * parallel jobs using PMI sometimes result in slow message + * parallel jobs using PMI sometimes result in slow message * responses and timeouts. Raise the default timeout for srun. */ if(!message_socket_ops.timeout) message_socket_ops.timeout = slurm_get_msg_timeout() * 8000; @@ -800,7 +800,7 @@ static int _msg_thr_create(struct step_launch_state *sls, int num_nodes) if (pthread_create(&sls->msg_thread, &attr, _msg_thr_internal, (void *)sls) != 0) { error("pthread_create of message thread: %m"); - + rc = SLURM_ERROR; } slurm_attr_destroy(&attr); @@ -817,8 +817,8 @@ _launch_handler(struct step_launch_state *sls, slurm_msg_t *resp) if (msg->return_code) { for (i = 0; i < msg->count_of_pids; i++) { - error("task %u launch failed: %s", - msg->task_ids[i], + error("task %u launch failed: %s", + msg->task_ids[i], slurm_strerror(msg->return_code)); bit_set(sls->tasks_started, msg->task_ids[i]); bit_set(sls->tasks_exited, msg->task_ids[i]); @@ -835,20 +835,20 @@ _launch_handler(struct step_launch_state *sls, slurm_msg_t *resp) } -static void +static void _exit_handler(struct step_launch_state *sls, slurm_msg_t *exit_msg) { task_exit_msg_t *msg = (task_exit_msg_t *) exit_msg->data; int i; - if ((msg->job_id != sls->mpi_info->jobid) || + if ((msg->job_id != sls->mpi_info->jobid) || (msg->step_id != sls->mpi_info->stepid)) { debug("Received MESSAGE_TASK_EXIT from wrong job: %u.%u", msg->job_id, msg->step_id); return; } - /* Record SIGTERM and SIGKILL termination codes to + /* Record SIGTERM and SIGKILL termination codes to * recognize abnormal termination */ if (WIFSIGNALED(msg->return_code)) { i = WTERMSIG(msg->return_code); @@ -870,12 +870,12 @@ _exit_handler(struct step_launch_state *sls, slurm_msg_t *exit_msg) pthread_mutex_unlock(&sls->lock); } -static void +static void _job_complete_handler(struct step_launch_state *sls, slurm_msg_t *complete_msg) { - srun_job_complete_msg_t *step_msg = + srun_job_complete_msg_t *step_msg = (srun_job_complete_msg_t *) complete_msg->data; - + if (step_msg->step_id == NO_VAL) { verbose("Complete job %u received", step_msg->job_id); @@ -891,7 +891,7 @@ _job_complete_handler(struct step_launch_state *sls, slurm_msg_t *complete_msg) pthread_mutex_unlock(&sls->lock); } -static void +static void _timeout_handler(struct step_launch_state *sls, slurm_msg_t *timeout_msg) { /* FIXME: does nothing yet */ @@ -969,7 +969,7 @@ _node_fail_handler(struct step_launch_state *sls, slurm_msg_t *fail_msg) /* * Receive a message when a slurmd cold starts, that the step on that node - * may have died. Verify that tasks on these nodes(s) are still alive, + * may have died. Verify that tasks on these nodes(s) are still alive, * and abort the job step if they are not. * This message could be the result of the slurmd daemon cold-starting * or a race condition when tasks are starting or terminating. @@ -989,14 +989,14 @@ _step_missing_handler(struct step_launch_state *sls, slurm_msg_t *missing_msg) int num_tasks; bool active; - debug("Step %u.%u missing from node(s) %s", + debug("Step %u.%u missing from node(s) %s", step_missing->job_id, step_missing->step_id, step_missing->nodelist); - /* Ignore this message in the unusual "user_managed_io" case. No way - to confirm a bad connection, since a test message goes straight to - the task. Aborting without checking may be too dangerous. This - choice may cause srun to not exit even though the job step has + /* Ignore this message in the unusual "user_managed_io" case. No way + to confirm a bad connection, since a test message goes straight to + the task. Aborting without checking may be too dangerous. This + choice may cause srun to not exit even though the job step has ended. */ if (sls->user_managed_io) return; @@ -1005,13 +1005,13 @@ _step_missing_handler(struct step_launch_state *sls, slurm_msg_t *missing_msg) if (!sls->io_timeout_thread_created) { if (_start_io_timeout_thread(sls)) { - /* + /* * Should I abort here, because of the inability to * make a thread to verify the connection? */ error("Cannot create thread to verify I/O " "connections."); - + sls->abort = true; pthread_cond_broadcast(&sls->cond); pthread_mutex_unlock(&sls->lock); @@ -1077,10 +1077,10 @@ _step_missing_handler(struct step_launch_state *sls, slurm_msg_t *missing_msg) sls->io_deadline[node_id] = time(NULL) + sls->io_timeout; debug("Testing connection to node %d", node_id); - if (client_io_handler_send_test_message(cio, node_id, + if (client_io_handler_send_test_message(cio, node_id, &test_message_sent)) { /* - * If unable to test a connection, assume the step + * If unable to test a connection, assume the step * is having problems and abort. If unable to test, * the system is probably having serious problems, so * aborting the step seems reasonable. @@ -1162,9 +1162,9 @@ _handle_msg(void *arg, slurm_msg_t *msg) uid_t uid = getuid(); srun_user_msg_t *um; int rc; - + if ((req_uid != slurm_uid) && (req_uid != 0) && (req_uid != uid)) { - error ("Security violation, slurm message from uid %u", + error ("Security violation, slurm message from uid %u", (unsigned int) req_uid); return; } @@ -1266,10 +1266,10 @@ static int _fail_step_tasks(slurm_step_ctx_t *ctx, char *node, int ret_code) slurm_msg_t_init(&req); req.msg_type = REQUEST_STEP_COMPLETE; req.data = &msg; - + if (slurm_send_recv_controller_rc_msg(&req, &rc) < 0) return SLURM_ERROR; - + return SLURM_SUCCESS; } @@ -1291,7 +1291,7 @@ static int _launch_tasks(slurm_step_ctx_t *ctx, int i = 0; while((name = hostlist_shift(hl))) { _print_launch_msg(launch_msg, name, i++); - free(name); + free(name); } hostlist_destroy(hl); } @@ -1299,7 +1299,7 @@ static int _launch_tasks(slurm_step_ctx_t *ctx, slurm_msg_t_init(&msg); msg.msg_type = REQUEST_LAUNCH_TASKS; msg.data = launch_msg; - + if(!(ret_list = slurm_send_recv_msgs( ctx->step_resp->step_layout->node_list, &msg, timeout, false))) { @@ -1308,7 +1308,7 @@ static int _launch_tasks(slurm_step_ctx_t *ctx, } ret_itr = list_iterator_create(ret_list); while ((ret_data = list_next(ret_itr))) { - rc = slurm_get_return_code(ret_data->type, + rc = slurm_get_return_code(ret_data->type, ret_data->data); debug("launch returned msg_rc=%d err=%d type=%d", rc, ret_data->err, ret_data->type); @@ -1317,7 +1317,7 @@ static int _launch_tasks(slurm_step_ctx_t *ctx, tot_rc = ret_data->err; else tot_rc = rc; - + _fail_step_tasks(ctx, ret_data->node_name, tot_rc); errno = tot_rc; @@ -1366,9 +1366,9 @@ static void _print_launch_msg(launch_tasks_request_msg_t *msg, } hostlist_ranged_string(hl, 4096, task_list); hostlist_destroy(hl); - - info("launching %u.%u on host %s, %u tasks: %s", - msg->job_id, msg->job_step_id, hostname, + + info("launching %u.%u on host %s, %u tasks: %s", + msg->job_id, msg->job_step_id, hostname, msg->tasks_to_launch[nodeid], task_list); debug3("uid:%ld gid:%ld cwd:%s %d", (long) msg->uid, @@ -1380,7 +1380,7 @@ void record_ppid(void) srun_ppid = getppid(); } -/* This is used to initiate an OpenMPI checkpoint program, +/* This is used to initiate an OpenMPI checkpoint program, * but is written to be general purpose */ static void _exec_prog(slurm_msg_t *msg) @@ -1394,12 +1394,12 @@ _exec_prog(slurm_msg_t *msg) srun_exec_msg_t *exec_msg = msg->data; if (exec_msg->argc > 2) { - verbose("Exec '%s %s' for %u.%u", + verbose("Exec '%s %s' for %u.%u", exec_msg->argv[0], exec_msg->argv[1], exec_msg->job_id, exec_msg->step_id); } else { - verbose("Exec '%s' for %u.%u", - exec_msg->argv[0], + verbose("Exec '%s' for %u.%u", + exec_msg->argv[0], exec_msg->job_id, exec_msg->step_id); } @@ -1459,7 +1459,7 @@ _exec_prog(slurm_msg_t *msg) fini: if (checkpoint) { now = time(NULL); if (exit_code) { - info("Checkpoint completion code %d at %s", + info("Checkpoint completion code %d at %s", exit_code, ctime(&now)); } else { info("Checkpoint completed successfully at %s", @@ -1477,7 +1477,7 @@ fini: if (checkpoint) { * Notify the step_launch_state that an I/O connection went bad. * If the node is suspected to be down, abort the job. */ -int +int step_launch_notify_io_failure(step_launch_state_t *sls, int node_id) { pthread_mutex_lock(&sls->lock); @@ -1490,7 +1490,7 @@ step_launch_notify_io_failure(step_launch_state_t *sls, int node_id) * the _step_missing_handler was called on this node. */ if (sls->io_deadline[node_id] != (time_t)NO_VAL) { - error("Aborting, io error and missing step on node %d", + error("Aborting, io error and missing step on node %d", node_id); sls->abort = true; pthread_cond_broadcast(&sls->cond); @@ -1504,13 +1504,13 @@ step_launch_notify_io_failure(step_launch_state_t *sls, int node_id) /* * This is called 1) after a node connects for the first time and 2) when - * a message comes in confirming that a connection is okay. + * a message comes in confirming that a connection is okay. * - * Just in case the node was marked questionable very early in the - * job step setup, clear this flag if/when the node makes its initial + * Just in case the node was marked questionable very early in the + * job step setup, clear this flag if/when the node makes its initial * connection. */ -int +int step_launch_clear_questionable_state(step_launch_state_t *sls, int node_id) { pthread_mutex_lock(&sls->lock); @@ -1569,7 +1569,7 @@ _check_io_timeout(void *_sls) error( "Cannot communicate with node %d. " "Aborting job.", ii); break; - } else if (next_deadline == (time_t)NO_VAL || + } else if (next_deadline == (time_t)NO_VAL || sls->io_deadline[ii] < next_deadline) { next_deadline = sls->io_deadline[ii]; } diff --git a/src/api/step_launch.h b/src/api/step_launch.h index c90d0e8bca..bfef3a10e5 100644 --- a/src/api/step_launch.h +++ b/src/api/step_launch.h @@ -7,21 +7,21 @@ * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Christopher J. Morrone * CODE-OCEC-09-009. All rights reserved. - * + * * This file is part of SLURM, a resource management program. * For details, see . * Please also read the included file: DISCLAIMER. - * + * * SLURM is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free * Software Foundation; either version 2 of the License, or (at your option) * any later version. - * + * * SLURM is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. - * + * * You should have received a copy of the GNU General Public License along * with SLURM; if not, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. @@ -53,8 +53,8 @@ typedef struct { struct step_launch_state { /* This lock protects tasks_started, tasks_exited, node_io_error, - io_deadline, abort, and abort_action_taken. The main thread - blocks on cond, waking when a tast starts or exits, or the abort + io_deadline, abort, and abort_action_taken. The main thread + blocks on cond, waking when a tast starts or exits, or the abort flag is set. */ pthread_mutex_t lock; pthread_cond_t cond; @@ -124,8 +124,8 @@ void record_ppid(void); int step_launch_notify_io_failure(step_launch_state_t *sls, int node_id); /* - * Just in case the node was marked questionable very early in the - * job step setup, clear this flag when the node makes its initial + * Just in case the node was marked questionable very early in the + * job step setup, clear this flag when the node makes its initial * connection. */ int step_launch_clear_questionable_state(step_launch_state_t *sls, int node_id); diff --git a/src/api/submit.c b/src/api/submit.c index 1de73e8108..7529c5cf11 100644 --- a/src/api/submit.c +++ b/src/api/submit.c @@ -6,32 +6,32 @@ * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Morris Jette . * CODE-OCEC-09-009. All rights reserved. - * + * * This file is part of SLURM, a resource management program. * For details, see . * Please also read the included file: DISCLAIMER. - * + * * SLURM is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free * Software Foundation; either version 2 of the License, or (at your option) * any later version. * - * In addition, as a special exception, the copyright holders give permission - * to link the code of portions of this program with the OpenSSL library under - * certain conditions as described in each individual source file, and - * distribute linked combinations including the two. You must obey the GNU - * General Public License in all respects for all of the code used other than - * OpenSSL. If you modify file(s) with this exception, you may extend this - * exception to your version of the file(s), but you are not obligated to do + * In addition, as a special exception, the copyright holders give permission + * to link the code of portions of this program with the OpenSSL library under + * certain conditions as described in each individual source file, and + * distribute linked combinations including the two. You must obey the GNU + * General Public License in all respects for all of the code used other than + * OpenSSL. If you modify file(s) with this exception, you may extend this + * exception to your version of the file(s), but you are not obligated to do * so. If you do not wish to do so, delete this exception statement from your - * version. If you delete this exception statement from all source files in + * version. If you delete this exception statement from all source files in * the program, then also delete it here. - * + * * SLURM is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. - * + * * You should have received a copy of the GNU General Public License along * with SLURM; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. @@ -63,7 +63,7 @@ extern pid_t getsid(pid_t pid); /* missing from */ * RET 0 on success, otherwise return -1 and set errno to indicate the error */ int -slurm_submit_batch_job (job_desc_msg_t *req, +slurm_submit_batch_job (job_desc_msg_t *req, submit_response_msg_t **resp ) { int rc; @@ -76,7 +76,7 @@ slurm_submit_batch_job (job_desc_msg_t *req, slurm_msg_t_init(&resp_msg); - /* + /* * set Node and session id for this request */ if (req->alloc_sid == NO_VAL) @@ -89,7 +89,7 @@ slurm_submit_batch_job (job_desc_msg_t *req, } req_msg.msg_type = REQUEST_SUBMIT_BATCH_JOB ; - req_msg.data = req; + req_msg.data = req; rc = slurm_send_recv_controller_msg(&req_msg, &resp_msg); @@ -106,7 +106,7 @@ slurm_submit_batch_job (job_desc_msg_t *req, switch (resp_msg.msg_type) { case RESPONSE_SLURM_RC: rc = ((return_code_msg_t *) resp_msg.data)->return_code; - if (rc) + if (rc) slurm_seterrno_ret(rc); *resp = NULL; break; diff --git a/src/api/suspend.c b/src/api/suspend.c index 507c8cec72..38559cbaa1 100644 --- a/src/api/suspend.c +++ b/src/api/suspend.c @@ -6,32 +6,32 @@ * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Morris Jette et. al. * CODE-OCEC-09-009. All rights reserved. - * + * * This file is part of SLURM, a resource management program. * For details, see . * Please also read the included file: DISCLAIMER. - * + * * SLURM is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free * Software Foundation; either version 2 of the License, or (at your option) * any later version. * - * In addition, as a special exception, the copyright holders give permission - * to link the code of portions of this program with the OpenSSL library under - * certain conditions as described in each individual source file, and - * distribute linked combinations including the two. You must obey the GNU - * General Public License in all respects for all of the code used other than - * OpenSSL. If you modify file(s) with this exception, you may extend this - * exception to your version of the file(s), but you are not obligated to do + * In addition, as a special exception, the copyright holders give permission + * to link the code of portions of this program with the OpenSSL library under + * certain conditions as described in each individual source file, and + * distribute linked combinations including the two. You must obey the GNU + * General Public License in all respects for all of the code used other than + * OpenSSL. If you modify file(s) with this exception, you may extend this + * exception to your version of the file(s), but you are not obligated to do * so. If you do not wish to do so, delete this exception statement from your - * version. If you delete this exception statement from all source files in + * version. If you delete this exception statement from all source files in * the program, then also delete it here. - * + * * SLURM is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. - * + * * You should have received a copy of the GNU General Public License along * with SLURM; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. @@ -92,7 +92,7 @@ extern int slurm_resume (uint32_t job_id) } /* - * slurm_requeue - re-queue a batch job, if already running + * slurm_requeue - re-queue a batch job, if already running * then terminate it first * RET 0 or a slurm error code */ diff --git a/src/api/topo_info.c b/src/api/topo_info.c index 4cfa670a7e..17118d959f 100644 --- a/src/api/topo_info.c +++ b/src/api/topo_info.c @@ -5,32 +5,32 @@ * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Morris Jette * CODE-OCEC-09-009. All rights reserved. - * + * * This file is part of SLURM, a resource management program. * For details, see . * Please also read the included file: DISCLAIMER. - * + * * SLURM is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free * Software Foundation; either version 2 of the License, or (at your option) * any later version. * - * In addition, as a special exception, the copyright holders give permission + * In addition, as a special exception, the copyright holders give permission * to link the code of portions of this program with the OpenSSL library under - * certain conditions as described in each individual source file, and - * distribute linked combinations including the two. You must obey the GNU - * General Public License in all respects for all of the code used other than - * OpenSSL. If you modify file(s) with this exception, you may extend this - * exception to your version of the file(s), but you are not obligated to do + * certain conditions as described in each individual source file, and + * distribute linked combinations including the two. You must obey the GNU + * General Public License in all respects for all of the code used other than + * OpenSSL. If you modify file(s) with this exception, you may extend this + * exception to your version of the file(s), but you are not obligated to do * so. If you do not wish to do so, delete this exception statement from your - * version. If you delete this exception statement from all source files in + * version. If you delete this exception statement from all source files in * the program, then also delete it here. - * + * * SLURM is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. - * + * * You should have received a copy of the GNU General Public License along * with SLURM; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. @@ -61,8 +61,8 @@ #include "src/common/xstring.h" /* - * slurm_load_topo - issue RPC to get slurm all switch topology configuration - * information + * slurm_load_topo - issue RPC to get slurm all switch topology configuration + * information * IN node_info_msg_pptr - place to store a node configuration pointer * RET 0 or a slurm error code * NOTE: free the response using slurm_free_topo_info_msg @@ -72,23 +72,23 @@ extern int slurm_load_topo(topo_info_response_msg_t **resp) int rc; slurm_msg_t req_msg; slurm_msg_t resp_msg; - + slurm_msg_t_init(&req_msg); slurm_msg_t_init(&resp_msg); req_msg.msg_type = REQUEST_TOPO_INFO; req_msg.data = NULL; - + if (slurm_send_recv_controller_msg(&req_msg, &resp_msg) < 0) return SLURM_ERROR; - + switch (resp_msg.msg_type) { case RESPONSE_TOPO_INFO: *resp = (topo_info_response_msg_t *) resp_msg.data; break; case RESPONSE_SLURM_RC: rc = ((return_code_msg_t *) resp_msg.data)->return_code; - slurm_free_return_code_msg(resp_msg.data); - if (rc) + slurm_free_return_code_msg(resp_msg.data); + if (rc) slurm_seterrno_ret(rc); *resp = NULL; break; @@ -101,15 +101,15 @@ extern int slurm_load_topo(topo_info_response_msg_t **resp) } /* - * slurm_print_topo_info_msg - output information about all switch topology - * configuration information based upon message as loaded using + * slurm_print_topo_info_msg - output information about all switch topology + * configuration information based upon message as loaded using * slurm_load_topo * IN out - file to write to * IN topo_info_msg_ptr - switch topology information message pointer * IN one_liner - print as a single line if not zero */ -extern void slurm_print_topo_info_msg(FILE * out, - topo_info_response_msg_t *topo_info_msg_ptr, +extern void slurm_print_topo_info_msg(FILE * out, + topo_info_response_msg_t *topo_info_msg_ptr, int one_liner) { int i; @@ -135,7 +135,7 @@ extern void slurm_print_topo_info_msg(FILE * out, * RET out - char * containing formatted output (must be freed after call) * NULL is returned on failure. */ -extern void slurm_print_topo_record(FILE * out, topo_info_t *topo_ptr, +extern void slurm_print_topo_record(FILE * out, topo_info_t *topo_ptr, int one_liner) { char tmp_line[512]; @@ -148,12 +148,12 @@ extern void slurm_print_topo_record(FILE * out, topo_info_t *topo_ptr, xstrcat(out_buf, tmp_line); if (topo_ptr->nodes && topo_ptr->nodes[0]) { - snprintf(tmp_line, sizeof(tmp_line), + snprintf(tmp_line, sizeof(tmp_line), "Nodes=%s ", topo_ptr->nodes); xstrcat(out_buf, tmp_line); } if (topo_ptr->switches && topo_ptr->switches[0]) { - snprintf(tmp_line, sizeof(tmp_line), + snprintf(tmp_line, sizeof(tmp_line), "Switches=%s ", topo_ptr->switches); xstrcat(out_buf, tmp_line); } diff --git a/src/api/triggers.c b/src/api/triggers.c index 6d03bfbaa5..20f77518b6 100644 --- a/src/api/triggers.c +++ b/src/api/triggers.c @@ -5,32 +5,32 @@ * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Morris Jette . * CODE-OCEC-09-009. All rights reserved. - * + * * This file is part of SLURM, a resource management program. * For details, see . * Please also read the included file: DISCLAIMER. - * + * * SLURM is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free * Software Foundation; either version 2 of the License, or (at your option) * any later version. * - * In addition, as a special exception, the copyright holders give permission - * to link the code of portions of this program with the OpenSSL library under - * certain conditions as described in each individual source file, and - * distribute linked combinations including the two. You must obey the GNU - * General Public License in all respects for all of the code used other than - * OpenSSL. If you modify file(s) with this exception, you may extend this - * exception to your version of the file(s), but you are not obligated to do + * In addition, as a special exception, the copyright holders give permission + * to link the code of portions of this program with the OpenSSL library under + * certain conditions as described in each individual source file, and + * distribute linked combinations including the two. You must obey the GNU + * General Public License in all respects for all of the code used other than + * OpenSSL. If you modify file(s) with this exception, you may extend this + * exception to your version of the file(s), but you are not obligated to do * so. If you do not wish to do so, delete this exception statement from your - * version. If you delete this exception statement from all source files in + * version. If you delete this exception statement from all source files in * the program, then also delete it here. - * + * * SLURM is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. - * + * * You should have received a copy of the GNU General Public License along * with SLURM; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. @@ -62,7 +62,7 @@ extern int slurm_set_trigger (trigger_info_t *trigger_set) trigger_info_msg_t req; slurm_msg_t_init(&msg); - /* + /* * Request message: */ req.record_count = 1; @@ -90,7 +90,7 @@ extern int slurm_clear_trigger (trigger_info_t *trigger_clear) trigger_info_msg_t req; slurm_msg_t_init(&msg); - /* + /* * Request message: */ req.record_count = 1; @@ -136,8 +136,8 @@ extern int slurm_get_triggers (trigger_info_msg_t ** trigger_get) break; case RESPONSE_SLURM_RC: rc = ((return_code_msg_t *) resp_msg.data)->return_code; - slurm_free_return_code_msg(resp_msg.data); - if (rc) + slurm_free_return_code_msg(resp_msg.data); + if (rc) slurm_seterrno_ret(rc); break; default: diff --git a/src/api/update_config.c b/src/api/update_config.c index 862cbb7961..be7076bc7c 100644 --- a/src/api/update_config.c +++ b/src/api/update_config.c @@ -7,32 +7,32 @@ * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Morris Jette and Kevin Tew . * CODE-OCEC-09-009. All rights reserved. - * + * * This file is part of SLURM, a resource management program. * For details, see . * Please also read the included file: DISCLAIMER. - * + * * SLURM is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free * Software Foundation; either version 2 of the License, or (at your option) * any later version. * - * In addition, as a special exception, the copyright holders give permission + * In addition, as a special exception, the copyright holders give permission * to link the code of portions of this program with the OpenSSL library under - * certain conditions as described in each individual source file, and - * distribute linked combinations including the two. You must obey the GNU - * General Public License in all respects for all of the code used other than - * OpenSSL. If you modify file(s) with this exception, you may extend this - * exception to your version of the file(s), but you are not obligated to do + * certain conditions as described in each individual source file, and + * distribute linked combinations including the two. You must obey the GNU + * General Public License in all respects for all of the code used other than + * OpenSSL. If you modify file(s) with this exception, you may extend this + * exception to your version of the file(s), but you are not obligated to do * so. If you do not wish to do so, delete this exception statement from your - * version. If you delete this exception statement from all source files in + * version. If you delete this exception statement from all source files in * the program, then also delete it here. - * + * * SLURM is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. - * + * * You should have received a copy of the GNU General Public License along * with SLURM; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. @@ -54,25 +54,25 @@ static int _slurm_update (void * data, slurm_msg_type_t msg_type); /* - * slurm_update_job - issue RPC to a job's configuration per request, + * slurm_update_job - issue RPC to a job's configuration per request, * only usable by user root or (for some parameters) the job's owner * IN job_msg - description of job updates * RET 0 on success, otherwise return -1 and set errno to indicate the error */ -int -slurm_update_job ( job_desc_msg_t * job_msg ) +int +slurm_update_job ( job_desc_msg_t * job_msg ) { return _slurm_update ((void *) job_msg, REQUEST_UPDATE_JOB); } /* - * slurm_update_node - issue RPC to a node's configuration per request, + * slurm_update_node - issue RPC to a node's configuration per request, * only usable by user root * IN node_msg - description of node updates * RET 0 on success, otherwise return -1 and set errno to indicate the error */ -int -slurm_update_node ( update_node_msg_t * node_msg ) +int +slurm_update_node ( update_node_msg_t * node_msg ) { return _slurm_update ((void *) node_msg, REQUEST_UPDATE_NODE); } @@ -82,32 +82,32 @@ slurm_update_node ( update_node_msg_t * node_msg ) * IN part_msg - description of partition configuration * RET 0 on success, otherwise return -1 and set errno to indicate the error */ -int -slurm_create_partition ( update_part_msg_t * part_msg ) +int +slurm_create_partition ( update_part_msg_t * part_msg ) { return _slurm_update ((void *) part_msg, REQUEST_CREATE_PARTITION); } /* - * slurm_update_partition - issue RPC to a partition's configuration per + * slurm_update_partition - issue RPC to a partition's configuration per * request, only usable by user root * IN part_msg - description of partition updates * RET 0 on success, otherwise return -1 and set errno to indicate the error */ -int -slurm_update_partition ( update_part_msg_t * part_msg ) +int +slurm_update_partition ( update_part_msg_t * part_msg ) { return _slurm_update ((void *) part_msg, REQUEST_UPDATE_PARTITION); } /* - * slurm_delete_partition - issue RPC to delete a partition, only usable + * slurm_delete_partition - issue RPC to delete a partition, only usable * by user root * IN part_msg - description of partition to delete * RET 0 on success, otherwise return -1 and set errno to indicate the error */ -int -slurm_delete_partition ( delete_part_msg_t * part_msg ) +int +slurm_delete_partition ( delete_part_msg_t * part_msg ) { return _slurm_update ((void *) part_msg, REQUEST_DELETE_PARTITION); } @@ -118,8 +118,8 @@ slurm_delete_partition ( delete_part_msg_t * part_msg ) * RET name of reservation on success (caller must free the memory), * otherwise return NULL and set errno to indicate the error */ -char * -slurm_create_reservation (resv_desc_msg_t * resv_msg ) +char * +slurm_create_reservation (resv_desc_msg_t * resv_msg ) { int rc; char *resv_name = NULL; @@ -131,8 +131,8 @@ slurm_create_reservation (resv_desc_msg_t * resv_msg ) slurm_msg_t_init(&resp_msg); req_msg.msg_type = REQUEST_CREATE_RESERVATION; - req_msg.data = resv_msg; - + req_msg.data = resv_msg; + rc = slurm_send_recv_controller_msg(&req_msg, &resp_msg); switch (resp_msg.msg_type) { case RESPONSE_CREATE_RESERVATION: @@ -141,7 +141,7 @@ slurm_create_reservation (resv_desc_msg_t * resv_msg ) break; case RESPONSE_SLURM_RC: rc = ((return_code_msg_t *) resp_msg.data)->return_code; - if (rc) + if (rc) slurm_seterrno(rc); break; default: @@ -152,7 +152,7 @@ slurm_create_reservation (resv_desc_msg_t * resv_msg ) } /* - * slurm_update_reservation - modify an existing reservation, only usable by + * slurm_update_reservation - modify an existing reservation, only usable by * user root * IN resv_msg - description of reservation * RET 0 on success, otherwise return -1 and set errno to indicate the error @@ -163,32 +163,32 @@ extern int slurm_update_reservation ( resv_desc_msg_t * resv_msg ) } /* - * slurm_delete_reservation - issue RPC to delete a reservation, only usable + * slurm_delete_reservation - issue RPC to delete a reservation, only usable * by user root * IN resv_msg - description of reservation to delete * RET 0 on success, otherwise return -1 and set errno to indicate the error */ -int -slurm_delete_reservation ( reservation_name_msg_t * resv_msg ) +int +slurm_delete_reservation ( reservation_name_msg_t * resv_msg ) { return _slurm_update ((void *) resv_msg, REQUEST_DELETE_RESERVATION); } /* - * slurm_update_block - issue RPC to a blocks's configuration per + * slurm_update_block - issue RPC to a blocks's configuration per * request, only usable by user root * IN block_msg - description of block updates * RET 0 on success, otherwise return -1 and set errno to indicate the error */ -int -slurm_update_block ( update_block_msg_t * block_msg ) +int +slurm_update_block ( update_block_msg_t * block_msg ) { return _slurm_update ((void *) block_msg, REQUEST_UPDATE_BLOCK); } /* _slurm_update - issue RPC for all update requests */ -static int +static int _slurm_update (void *data, slurm_msg_type_t msg_type) { int rc; @@ -196,7 +196,7 @@ _slurm_update (void *data, slurm_msg_type_t msg_type) slurm_msg_t_init(&req_msg); req_msg.msg_type = msg_type; - req_msg.data = data; + req_msg.data = data; if (slurm_send_recv_controller_rc_msg(&req_msg, &rc) < 0) return SLURM_ERROR; diff --git a/src/common/Makefile.am b/src/common/Makefile.am index 796cc4c805..473929eb33 100644 --- a/src/common/Makefile.am +++ b/src/common/Makefile.am @@ -1,21 +1,21 @@ -# Makefile for common library -# If you are linking to this lib any know you are not linking to -# anything else that will need variables here link to +# Makefile for common library +# If you are linking to this lib any know you are not linking to +# anything else that will need variables here link to # $(top_builddir)/src/common/libcommon.la # if you are linking to a stand alone program that needs all symbols link to -# $(top_builddir)/src/common/libcommon.o with -ldl added -# This avoids having multiple symbols running around when there should +# $(top_builddir)/src/common/libcommon.o with -ldl added +# This avoids having multiple symbols running around when there should # only be 1 address per symbol. If you link to the libcommon.la in # a plugin you will get 2 addresses for one symbol which could lead to problems. AUTOMAKE_OPTIONS = foreign if HAVE_UNSETENV -build_unsetenv_src = +build_unsetenv_src = extra_unsetenv_src = unsetenv.c unsetenv.h else build_unsetenv_src = unsetenv.c unsetenv.h -extra_unsetenv_src = +extra_unsetenv_src = endif INCLUDES = -I$(top_srcdir) $(BG_INCLUDES) @@ -123,27 +123,27 @@ libspank_la_SOURCES = \ plugstack.c plugstack.h \ optz.c optz.h -libcommon_la_LIBADD = -ldl +libcommon_la_LIBADD = -ldl libcommon_la_LDFLAGS = $(LIB_LDFLAGS) -module --export-dynamic -# This was made so we could export all symbols from libcommon +# This was made so we could export all symbols from libcommon # on multiple platforms -libcommon_o_SOURCES = -libcommon.o : $(libcommon_la_OBJECTS) $(libcommon_la_DEPENDENCIES) - $(LINK) $(libcommon_la_OBJECTS) +libcommon_o_SOURCES = +libcommon.o : $(libcommon_la_OBJECTS) $(libcommon_la_DEPENDENCIES) + $(LINK) $(libcommon_la_OBJECTS) -# This was made so we could export all symbols from libeio +# This was made so we could export all symbols from libeio # on multiple platforms -libeio_o_SOURCES = -libeio.o : $(libeio_la_OBJECTS) $(libeio_la_DEPENDENCIES) - $(LINK) $(libeio_la_OBJECTS) +libeio_o_SOURCES = +libeio.o : $(libeio_la_OBJECTS) $(libeio_la_DEPENDENCIES) + $(LINK) $(libeio_la_OBJECTS) -# This was made so we could export all symbols from libspank +# This was made so we could export all symbols from libspank # on multiple platforms -libspank_o_SOURCES = -libspank.o : $(libspank_la_OBJECTS) $(libspank_la_DEPENDENCIES) - $(LINK) $(libspank_la_OBJECTS) +libspank_o_SOURCES = +libspank.o : $(libspank_la_OBJECTS) $(libspank_la_DEPENDENCIES) + $(LINK) $(libspank_la_OBJECTS) global_defaults.c : $(top_builddir)/config.h Makefile diff --git a/src/common/Makefile.in b/src/common/Makefile.in index 0448257c3e..ab958f1772 100644 --- a/src/common/Makefile.in +++ b/src/common/Makefile.in @@ -15,13 +15,13 @@ @SET_MAKE@ -# Makefile for common library -# If you are linking to this lib any know you are not linking to -# anything else that will need variables here link to +# Makefile for common library +# If you are linking to this lib any know you are not linking to +# anything else that will need variables here link to # $(top_builddir)/src/common/libcommon.la # if you are linking to a stand alone program that needs all symbols link to -# $(top_builddir)/src/common/libcommon.o with -ldl added -# This avoids having multiple symbols running around when there should +# $(top_builddir)/src/common/libcommon.o with -ldl added +# This avoids having multiple symbols running around when there should # only be 1 address per symbol. If you link to the libcommon.la in # a plugin you will get 2 addresses for one symbol which could lead to problems. @@ -485,18 +485,18 @@ libspank_la_SOURCES = \ plugstack.c plugstack.h \ optz.c optz.h -libcommon_la_LIBADD = -ldl +libcommon_la_LIBADD = -ldl libcommon_la_LDFLAGS = $(LIB_LDFLAGS) -module --export-dynamic -# This was made so we could export all symbols from libcommon +# This was made so we could export all symbols from libcommon # on multiple platforms libcommon_o_SOURCES = -# This was made so we could export all symbols from libeio +# This was made so we could export all symbols from libeio # on multiple platforms libeio_o_SOURCES = -# This was made so we could export all symbols from libspank +# This was made so we could export all symbols from libspank # on multiple platforms libspank_o_SOURCES = all: all-am @@ -861,12 +861,12 @@ uninstall-am: mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags uninstall uninstall-am -libcommon.o : $(libcommon_la_OBJECTS) $(libcommon_la_DEPENDENCIES) - $(LINK) $(libcommon_la_OBJECTS) -libeio.o : $(libeio_la_OBJECTS) $(libeio_la_DEPENDENCIES) - $(LINK) $(libeio_la_OBJECTS) -libspank.o : $(libspank_la_OBJECTS) $(libspank_la_DEPENDENCIES) - $(LINK) $(libspank_la_OBJECTS) +libcommon.o : $(libcommon_la_OBJECTS) $(libcommon_la_DEPENDENCIES) + $(LINK) $(libcommon_la_OBJECTS) +libeio.o : $(libeio_la_OBJECTS) $(libeio_la_DEPENDENCIES) + $(LINK) $(libeio_la_OBJECTS) +libspank.o : $(libspank_la_OBJECTS) $(libspank_la_DEPENDENCIES) + $(LINK) $(libspank_la_OBJECTS) global_defaults.c : $(top_builddir)/config.h Makefile @( echo "/* This file autogenerated by src/common/Makefile */"; \ diff --git a/src/common/arg_desc.c b/src/common/arg_desc.c index 79bb8714b6..1d91a146ea 100644 --- a/src/common/arg_desc.c +++ b/src/common/arg_desc.c @@ -14,15 +14,15 @@ * Software Foundation; either version 2 of the License, or (at your option) * any later version. * - * In addition, as a special exception, the copyright holders give permission - * to link the code of portions of this program with the OpenSSL library under - * certain conditions as described in each individual source file, and - * distribute linked combinations including the two. You must obey the GNU - * General Public License in all respects for all of the code used other than - * OpenSSL. If you modify file(s) with this exception, you may extend this - * exception to your version of the file(s), but you are not obligated to do + * In addition, as a special exception, the copyright holders give permission + * to link the code of portions of this program with the OpenSSL library under + * certain conditions as described in each individual source file, and + * distribute linked combinations including the two. You must obey the GNU + * General Public License in all respects for all of the code used other than + * OpenSSL. If you modify file(s) with this exception, you may extend this + * exception to your version of the file(s), but you are not obligated to do * so. If you do not wish to do so, delete this exception statement from your - * version. If you delete this exception statement from all source files in + * version. If you delete this exception statement from all source files in * the program, then also delete it here. * * SLURM is distributed in the hope that it will be useful, but WITHOUT ANY @@ -40,8 +40,8 @@ #include "src/common/xassert.h" /* - * Define slurm-specific aliases for use by plugins, see slurm_xlator.h - * for details. + * Define slurm-specific aliases for use by plugins, see slurm_xlator.h + * for details. */ strong_alias(arg_count, slurm_arg_count); strong_alias(arg_idx_by_name, slurm_arg_idx_by_name); @@ -68,7 +68,7 @@ arg_idx_by_name( const arg_desc_t *desc, const char *name ) if ( desc == NULL ) return -1; if ( name == NULL ) return -1; - + for ( i = 0; desc[ i ].name != NULL; ++i ) { if ( strcmp( desc[ i ].name, name ) == 0 ) { return i; diff --git a/src/common/arg_desc.h b/src/common/arg_desc.h index 331c3fb6ed..0dce2dcfd3 100644 --- a/src/common/arg_desc.h +++ b/src/common/arg_desc.h @@ -14,15 +14,15 @@ * Software Foundation; either version 2 of the License, or (at your option) * any later version. * - * In addition, as a special exception, the copyright holders give permission - * to link the code of portions of this program with the OpenSSL library under - * certain conditions as described in each individual source file, and - * distribute linked combinations including the two. You must obey the GNU - * General Public License in all respects for all of the code used other than - * OpenSSL. If you modify file(s) with this exception, you may extend this - * exception to your version of the file(s), but you are not obligated to do + * In addition, as a special exception, the copyright holders give permission + * to link the code of portions of this program with the OpenSSL library under + * certain conditions as described in each individual source file, and + * distribute linked combinations including the two. You must obey the GNU + * General Public License in all respects for all of the code used other than + * OpenSSL. If you modify file(s) with this exception, you may extend this + * exception to your version of the file(s), but you are not obligated to do * so. If you do not wish to do so, delete this exception statement from your - * version. If you delete this exception statement from all source files in + * version. If you delete this exception statement from all source files in * the program, then also delete it here. * * SLURM is distributed in the hope that it will be useful, but WITHOUT ANY diff --git a/src/common/assoc_mgr.c b/src/common/assoc_mgr.c index 68b839c18c..cf9aa2729d 100644 --- a/src/common/assoc_mgr.c +++ b/src/common/assoc_mgr.c @@ -5,32 +5,32 @@ * Copyright (C) 2008-2009 Lawrence Livermore National Security. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Danny Auble - * + * * This file is part of SLURM, a resource management program. * For details, see . * Please also read the included file: DISCLAIMER. - * + * * SLURM is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free * Software Foundation; either version 2 of the License, or (at your option) * any later version. * - * In addition, as a special exception, the copyright holders give permission + * In addition, as a special exception, the copyright holders give permission * to link the code of portions of this program with the OpenSSL library under - * certain conditions as described in each individual source file, and - * distribute linked combinations including the two. You must obey the GNU - * General Public License in all respects for all of the code used other than - * OpenSSL. If you modify file(s) with this exception, you may extend this - * exception to your version of the file(s), but you are not obligated to do + * certain conditions as described in each individual source file, and + * distribute linked combinations including the two. You must obey the GNU + * General Public License in all respects for all of the code used other than + * OpenSSL. If you modify file(s) with this exception, you may extend this + * exception to your version of the file(s), but you are not obligated to do * so. If you do not wish to do so, delete this exception statement from your - * version. If you delete this exception statement from all source files in + * version. If you delete this exception statement from all source files in * the program, then also delete it here. - * + * * SLURM is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. - * + * * You should have received a copy of the GNU General Public License along * with SLURM; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. @@ -70,18 +70,18 @@ pthread_mutex_t assoc_mgr_file_lock = PTHREAD_MUTEX_INITIALIZER; pthread_mutex_t assoc_mgr_wckey_lock = PTHREAD_MUTEX_INITIALIZER; -/* +/* * Comparator used for sorting assocs largest cpu to smallest cpu - * + * * returns: 1: assoc_a > assoc_b -1: assoc_a < assoc_b - * + * */ static int _sort_assoc_dec(acct_association_rec_t *assoc_a, acct_association_rec_t *assoc_b) { if (assoc_a->lft > assoc_b->lft) return 1; - + return -1; } @@ -107,7 +107,7 @@ static int _addto_used_info(acct_association_rec_t *assoc1, assoc1->grp_used_cpus += assoc2->grp_used_cpus; assoc1->grp_used_nodes += assoc2->grp_used_nodes; assoc1->grp_used_wall += assoc2->grp_used_wall; - + assoc1->used_jobs += assoc2->used_jobs; assoc1->used_submit_jobs += assoc2->used_submit_jobs; assoc1->usage_raw += assoc2->usage_raw; @@ -122,7 +122,7 @@ static int _clear_used_info(acct_association_rec_t *assoc) assoc->grp_used_cpus = 0; assoc->grp_used_nodes = 0; - + assoc->used_jobs = 0; assoc->used_submit_jobs = 0; /* do not reset usage_raw or grp_used_wall. @@ -150,18 +150,18 @@ static int _grab_parents_qos(acct_association_rec_t *assoc) parent_assoc = assoc->parent_assoc_ptr; if(!parent_assoc || !parent_assoc->qos_list - || !list_count(parent_assoc->qos_list)) + || !list_count(parent_assoc->qos_list)) return SLURM_SUCCESS; - + itr = list_iterator_create(parent_assoc->qos_list); - while((qos_char = list_next(itr))) + while((qos_char = list_next(itr))) list_append(assoc->qos_list, xstrdup(qos_char)); list_iterator_destroy(itr); return SLURM_SUCCESS; } -static int _local_update_assoc_qos_list(acct_association_rec_t *assoc, +static int _local_update_assoc_qos_list(acct_association_rec_t *assoc, List new_qos_list) { ListIterator new_qos_itr = NULL, curr_qos_itr = NULL; @@ -172,11 +172,11 @@ static int _local_update_assoc_qos_list(acct_association_rec_t *assoc, error("need both new qos_list and an association to update"); return SLURM_ERROR; } - + if(!list_count(new_qos_list)) { _grab_parents_qos(assoc); return SLURM_SUCCESS; - } + } /* Even though we only use the valid_qos bitstr for things we need to keep the list around for now since we don't pack the @@ -184,7 +184,7 @@ static int _local_update_assoc_qos_list(acct_association_rec_t *assoc, */ new_qos_itr = list_iterator_create(new_qos_list); curr_qos_itr = list_iterator_create(assoc->qos_list); - + while((new_qos = list_next(new_qos_itr))) { if(new_qos[0] == '-') { while((curr_qos = list_next(curr_qos_itr))) { @@ -196,10 +196,10 @@ static int _local_update_assoc_qos_list(acct_association_rec_t *assoc, list_iterator_reset(curr_qos_itr); } else if(new_qos[0] == '+') { - while((curr_qos = list_next(curr_qos_itr))) - if(!strcmp(curr_qos, new_qos+1)) + while((curr_qos = list_next(curr_qos_itr))) + if(!strcmp(curr_qos, new_qos+1)) break; - + if(!curr_qos) { list_append(assoc->qos_list, xstrdup(new_qos+1)); @@ -214,13 +214,13 @@ static int _local_update_assoc_qos_list(acct_association_rec_t *assoc, if(!flushed) list_flush(assoc->qos_list); list_append(assoc->qos_list, xstrdup(new_qos)); - flushed = 1; + flushed = 1; } } list_iterator_destroy(curr_qos_itr); list_iterator_destroy(new_qos_itr); - return SLURM_SUCCESS; + return SLURM_SUCCESS; } /* locks should be put in place before calling this function */ @@ -234,7 +234,7 @@ static int _set_assoc_parent_and_user(acct_association_rec_t *assoc, last_acct_parent = NULL; last_parent = NULL; } - + if(!assoc || !assoc_list) { error("you didn't give me an association"); return SLURM_ERROR; @@ -247,11 +247,11 @@ static int _set_assoc_parent_and_user(acct_association_rec_t *assoc, for. Then if that isn't panning out look at the last account parent. If still we don't have it we will look for it in the list. If it isn't there we - will just add it to the parent and call it good + will just add it to the parent and call it good */ if(last_parent && assoc->parent_id == last_parent->id) { assoc->parent_assoc_ptr = last_parent; - } else if(last_acct_parent + } else if(last_acct_parent && assoc->parent_id == last_acct_parent->id) { assoc->parent_assoc_ptr = last_acct_parent; } else { @@ -260,7 +260,7 @@ static int _set_assoc_parent_and_user(acct_association_rec_t *assoc, while((assoc2 = list_next(itr))) { if(assoc2->id == assoc->parent_id) { assoc->parent_assoc_ptr = assoc2; - if(assoc->user) + if(assoc->user) last_parent = assoc2; else last_acct_parent = assoc2; @@ -270,31 +270,31 @@ static int _set_assoc_parent_and_user(acct_association_rec_t *assoc, list_iterator_destroy(itr); } if(assoc->parent_assoc_ptr && setup_childern) { - if(!assoc->parent_assoc_ptr->childern_list) - assoc->parent_assoc_ptr->childern_list = + if(!assoc->parent_assoc_ptr->childern_list) + assoc->parent_assoc_ptr->childern_list = list_create(NULL); list_append(assoc->parent_assoc_ptr->childern_list, assoc); - } - + } + if(assoc == assoc->parent_assoc_ptr) { assoc->parent_assoc_ptr = NULL; error("association %u was pointing to " "itself as it's parent"); } - } else + } else assoc_mgr_root_assoc = assoc; - + if(assoc->user) { uid_t pw_uid; if (uid_from_string (assoc->user, &pw_uid) < 0) assoc->uid = (uint32_t)NO_VAL; else - assoc->uid = pw_uid; + assoc->uid = pw_uid; /* get the qos bitmap here */ if(g_qos_count > 0) { - if(!assoc->valid_qos + if(!assoc->valid_qos || (bit_size(assoc->valid_qos) != g_qos_count)) { FREE_NULL_BITMAP(assoc->valid_qos); assoc->valid_qos = bit_alloc(g_qos_count); @@ -305,13 +305,13 @@ static int _set_assoc_parent_and_user(acct_association_rec_t *assoc, assoc->qos_list); } } else { - assoc->uid = (uint32_t)NO_VAL; + assoc->uid = (uint32_t)NO_VAL; } //log_assoc_rec(assoc); return SLURM_SUCCESS; } - + static int _post_association_list(List assoc_list) { acct_association_rec_t *assoc = NULL; @@ -321,7 +321,7 @@ static int _post_association_list(List assoc_list) if(!assoc_list) return SLURM_ERROR; - + itr = list_iterator_create(assoc_list); //START_TIMER; while((assoc = list_next(itr))) { @@ -340,16 +340,16 @@ static int _post_association_list(List assoc_list) || !list_count(assoc->childern_list)) continue; itr2 = list_iterator_create(assoc->childern_list); - while((assoc2 = list_next(itr2))) + while((assoc2 = list_next(itr2))) count += assoc2->shares_raw; list_iterator_reset(itr2); - while((assoc2 = list_next(itr2))) + while((assoc2 = list_next(itr2))) assoc2->level_shares = count; list_iterator_destroy(itr2); - } + } /* Now normalize the static shares */ list_iterator_reset(itr); - while((assoc = list_next(itr))) + while((assoc = list_next(itr))) _normalize_assoc_shares(assoc); } list_iterator_destroy(itr); @@ -423,11 +423,11 @@ static int _get_assoc_mgr_association_list(void *db_conn, int enforce) if(assoc_q.cluster_list) list_destroy(assoc_q.cluster_list); - + if(!assoc_mgr_association_list) { /* create list so we don't keep calling this if there isn't anything there */ - assoc_mgr_association_list = + assoc_mgr_association_list = list_create(destroy_acct_association_rec); slurm_mutex_unlock(&assoc_mgr_association_lock); if(enforce & ACCOUNTING_ENFORCE_ASSOCS) { @@ -439,7 +439,7 @@ static int _get_assoc_mgr_association_list(void *db_conn, int enforce) "list was given so we are giving a blank list"); return SLURM_SUCCESS; } - } + } _post_association_list(assoc_mgr_association_list); @@ -464,7 +464,7 @@ static int _get_assoc_mgr_qos_list(void *db_conn, int enforce) return SLURM_ERROR; } else { return SLURM_SUCCESS; - } + } } else { ListIterator itr = list_iterator_create(assoc_mgr_qos_list); acct_qos_rec_t *qos = NULL; @@ -474,7 +474,7 @@ static int _get_assoc_mgr_qos_list(void *db_conn, int enforce) if(qos->id > g_qos_count) g_qos_count = qos->id; - if(qos->priority > g_qos_max_priority) + if(qos->priority > g_qos_max_priority) g_qos_max_priority = qos->priority; } /* Since in the database id's don't start at 1 @@ -486,9 +486,9 @@ static int _get_assoc_mgr_qos_list(void *db_conn, int enforce) if(g_qos_max_priority) { list_iterator_reset(itr); - + while((qos = list_next(itr))) { - qos->norm_priority = (double)qos->priority + qos->norm_priority = (double)qos->priority / (double)g_qos_max_priority; } } @@ -506,7 +506,7 @@ static int _get_assoc_mgr_user_list(void *db_conn, int enforce) memset(&user_q, 0, sizeof(acct_user_cond_t)); user_q.with_coords = 1; - + slurm_mutex_lock(&assoc_mgr_user_lock); if(assoc_mgr_user_list) list_destroy(assoc_mgr_user_list); @@ -520,11 +520,11 @@ static int _get_assoc_mgr_user_list(void *db_conn, int enforce) return SLURM_ERROR; } else { return SLURM_SUCCESS; - } - } + } + } _post_user_list(assoc_mgr_user_list); - + slurm_mutex_unlock(&assoc_mgr_user_lock); return SLURM_SUCCESS; } @@ -554,10 +554,10 @@ static int _get_local_wckey_list(void *db_conn, int enforce) assoc_mgr_wckey_list = acct_storage_g_get_wckeys(db_conn, uid, &wckey_q); // END_TIMER2("get_wckeys"); - + if(wckey_q.cluster_list) list_destroy(wckey_q.cluster_list); - + if(!assoc_mgr_wckey_list) { /* create list so we don't keep calling this if there isn't anything there */ @@ -572,10 +572,10 @@ static int _get_local_wckey_list(void *db_conn, int enforce) "list was given so we are giving a blank list"); return SLURM_SUCCESS; } - } + } _post_wckey_list(assoc_mgr_wckey_list); - + slurm_mutex_unlock(&assoc_mgr_wckey_lock); return SLURM_SUCCESS; @@ -606,39 +606,39 @@ static int _refresh_assoc_mgr_association_list(void *db_conn, int enforce) current_assocs = assoc_mgr_association_list; // START_TIMER; - assoc_mgr_association_list = + assoc_mgr_association_list = acct_storage_g_get_associations(db_conn, uid, &assoc_q); // END_TIMER2("get_associations"); if(assoc_q.cluster_list) list_destroy(assoc_q.cluster_list); - + if(!assoc_mgr_association_list) { assoc_mgr_association_list = current_assocs; slurm_mutex_unlock(&assoc_mgr_association_lock); - + error("_refresh_assoc_mgr_association_list: " "no new list given back keeping cached one."); return SLURM_ERROR; } _post_association_list(assoc_mgr_association_list); - + if(!current_assocs) { slurm_mutex_unlock(&assoc_mgr_association_lock); return SLURM_SUCCESS; } - + curr_itr = list_iterator_create(current_assocs); assoc_mgr_itr = list_iterator_create(assoc_mgr_association_list); - + /* add used limits We only look for the user associations to * do the parents since a parent may have moved */ while((curr_assoc = list_next(curr_itr))) { if(!curr_assoc->user) continue; while((assoc = list_next(assoc_mgr_itr))) { - if(assoc->id == curr_assoc->id) + if(assoc->id == curr_assoc->id) break; } @@ -648,12 +648,12 @@ static int _refresh_assoc_mgr_association_list(void *db_conn, int enforce) different than the one we are updating from */ assoc = assoc->parent_assoc_ptr; } - list_iterator_reset(assoc_mgr_itr); + list_iterator_reset(assoc_mgr_itr); } - + list_iterator_destroy(curr_itr); list_iterator_destroy(assoc_mgr_itr); - + slurm_mutex_unlock(&assoc_mgr_association_lock); if(current_assocs) @@ -690,7 +690,7 @@ static int _refresh_assoc_mgr_qos_list(void *db_conn, int enforce) } /* This only gets a new list if available dropping the old one if - * needed + * needed */ static int _refresh_assoc_mgr_user_list(void *db_conn, int enforce) { @@ -700,7 +700,7 @@ static int _refresh_assoc_mgr_user_list(void *db_conn, int enforce) memset(&user_q, 0, sizeof(acct_user_cond_t)); user_q.with_coords = 1; - + current_users = acct_storage_g_get_users(db_conn, uid, &user_q); if(!current_users) { @@ -712,11 +712,11 @@ static int _refresh_assoc_mgr_user_list(void *db_conn, int enforce) slurm_mutex_lock(&assoc_mgr_user_lock); - if(assoc_mgr_user_list) + if(assoc_mgr_user_list) list_destroy(assoc_mgr_user_list); assoc_mgr_user_list = current_users; - + slurm_mutex_unlock(&assoc_mgr_user_lock); return SLURM_SUCCESS; @@ -769,9 +769,9 @@ extern int assoc_mgr_init(void *db_conn, assoc_init_args_t *args) if(!checked_prio) { char *prio = slurm_get_priority_type(); - if(prio && !strcmp(prio, "priority/multifactor")) + if(prio && !strcmp(prio, "priority/multifactor")) setup_childern = 1; - + xfree(prio); checked_prio = 1; } @@ -781,10 +781,10 @@ extern int assoc_mgr_init(void *db_conn, assoc_init_args_t *args) if(args->remove_assoc_notify) remove_assoc_notify = args->remove_assoc_notify; cache_level = args->cache_level; - assoc_mgr_refresh_lists(db_conn, args); + assoc_mgr_refresh_lists(db_conn, args); } - - if(running_cache) { + + if(running_cache) { debug4("No need to run assoc_mgr_init, " "we probably don't have a connection. " "If we do use assoc_mgr_refresh_lists instead."); @@ -799,18 +799,18 @@ extern int assoc_mgr_init(void *db_conn, assoc_init_args_t *args) /* check if we can't talk to the db yet */ if(errno == ESLURM_ACCESS_DENIED) return SLURM_ERROR; - + /* get qos before association since it is used there */ if((!assoc_mgr_qos_list) && (cache_level & ASSOC_MGR_CACHE_QOS)) if(_get_assoc_mgr_qos_list(db_conn, enforce) == SLURM_ERROR) return SLURM_ERROR; if((!assoc_mgr_association_list) - && (cache_level & ASSOC_MGR_CACHE_ASSOC)) + && (cache_level & ASSOC_MGR_CACHE_ASSOC)) if(_get_assoc_mgr_association_list(db_conn, enforce) == SLURM_ERROR) return SLURM_ERROR; - + if((!assoc_mgr_user_list) && (cache_level & ASSOC_MGR_CACHE_USER)) if(_get_assoc_mgr_user_list(db_conn, enforce) == SLURM_ERROR) return SLURM_ERROR; @@ -835,7 +835,7 @@ extern int assoc_mgr_fini(char *state_save_location) if(state_save_location) dump_assoc_mgr_state(state_save_location); - if(assoc_mgr_association_list) + if(assoc_mgr_association_list) list_destroy(assoc_mgr_association_list); if(assoc_mgr_qos_list) list_destroy(assoc_mgr_qos_list); @@ -854,7 +854,7 @@ extern int assoc_mgr_fini(char *state_save_location) extern int assoc_mgr_get_user_assocs(void *db_conn, acct_association_rec_t *assoc, - int enforce, + int enforce, List assoc_list) { ListIterator itr = NULL; @@ -866,14 +866,14 @@ extern int assoc_mgr_get_user_assocs(void *db_conn, xassert(assoc_list); if(!assoc_mgr_association_list) { - if(_get_assoc_mgr_association_list(db_conn, enforce) + if(_get_assoc_mgr_association_list(db_conn, enforce) == SLURM_ERROR) return SLURM_ERROR; } if((!assoc_mgr_association_list || !list_count(assoc_mgr_association_list)) - && !(enforce & ACCOUNTING_ENFORCE_ASSOCS)) + && !(enforce & ACCOUNTING_ENFORCE_ASSOCS)) return SLURM_SUCCESS; slurm_mutex_lock(&assoc_mgr_association_lock); @@ -900,7 +900,7 @@ extern int assoc_mgr_get_user_assocs(void *db_conn, } extern int assoc_mgr_fill_in_assoc(void *db_conn, acct_association_rec_t *assoc, - int enforce, + int enforce, acct_association_rec_t **assoc_pptr) { ListIterator itr = NULL; @@ -910,13 +910,13 @@ extern int assoc_mgr_fill_in_assoc(void *db_conn, acct_association_rec_t *assoc, if (assoc_pptr) *assoc_pptr = NULL; if(!assoc_mgr_association_list) { - if(_get_assoc_mgr_association_list(db_conn, enforce) + if(_get_assoc_mgr_association_list(db_conn, enforce) == SLURM_ERROR) return SLURM_ERROR; } if((!assoc_mgr_association_list || !list_count(assoc_mgr_association_list)) - && !(enforce & ACCOUNTING_ENFORCE_ASSOCS)) + && !(enforce & ACCOUNTING_ENFORCE_ASSOCS)) return SLURM_SUCCESS; if(!assoc->id) { @@ -936,7 +936,7 @@ extern int assoc_mgr_fill_in_assoc(void *db_conn, acct_association_rec_t *assoc, memset(&user, 0, sizeof(acct_user_rec_t)); user.uid = assoc->uid; if(assoc_mgr_fill_in_user(db_conn, &user, - enforce, NULL) + enforce, NULL) == SLURM_ERROR) { if(enforce & ACCOUNTING_ENFORCE_ASSOCS) { error("User %d not found", assoc->uid); @@ -945,7 +945,7 @@ extern int assoc_mgr_fill_in_assoc(void *db_conn, acct_association_rec_t *assoc, debug3("User %d not found", assoc->uid); return SLURM_SUCCESS; } - } + } assoc->user = user.name; if(user.default_acct) assoc->acct = user.default_acct; @@ -962,8 +962,8 @@ extern int assoc_mgr_fill_in_assoc(void *db_conn, acct_association_rec_t *assoc, return SLURM_SUCCESS; } } - } - + } + if(!assoc->cluster) assoc->cluster = assoc_mgr_cluster_name; } @@ -991,8 +991,8 @@ extern int assoc_mgr_fill_in_assoc(void *db_conn, acct_association_rec_t *assoc, assoc->uid, found_assoc->uid); continue; } - - if(found_assoc->acct + + if(found_assoc->acct && strcasecmp(assoc->acct, found_assoc->acct)) { debug4("not the right account %s != %s", assoc->acct, found_assoc->acct); @@ -1006,10 +1006,10 @@ extern int assoc_mgr_fill_in_assoc(void *db_conn, acct_association_rec_t *assoc, debug4("not the right cluster"); continue; } - + if(assoc->partition - && (!found_assoc->partition - || strcasecmp(assoc->partition, + && (!found_assoc->partition + || strcasecmp(assoc->partition, found_assoc->partition))) { ret_assoc = found_assoc; debug3("found association for no partition"); @@ -1020,10 +1020,10 @@ extern int assoc_mgr_fill_in_assoc(void *db_conn, acct_association_rec_t *assoc, break; } list_iterator_destroy(itr); - + if(!ret_assoc) { slurm_mutex_unlock(&assoc_mgr_association_lock); - if(enforce & ACCOUNTING_ENFORCE_ASSOCS) + if(enforce & ACCOUNTING_ENFORCE_ASSOCS) return SLURM_ERROR; else return SLURM_SUCCESS; @@ -1036,7 +1036,7 @@ extern int assoc_mgr_fill_in_assoc(void *db_conn, acct_association_rec_t *assoc, if(!assoc->acct) assoc->acct = ret_assoc->acct; - + if(!assoc->childern_list) assoc->childern_list = ret_assoc->childern_list; @@ -1068,7 +1068,7 @@ extern int assoc_mgr_fill_in_assoc(void *db_conn, acct_association_rec_t *assoc, if(assoc->parent_acct) { xfree(assoc->parent_acct); assoc->parent_acct = xstrdup(ret_assoc->parent_acct); - } else + } else assoc->parent_acct = ret_assoc->parent_acct; assoc->parent_assoc_ptr = ret_assoc->parent_assoc_ptr; assoc->parent_id = ret_assoc->parent_id; @@ -1116,12 +1116,12 @@ extern int assoc_mgr_fill_in_user(void *db_conn, acct_user_rec_t *user, if(user_pptr) *user_pptr = NULL; - if(!assoc_mgr_user_list) - if(_get_assoc_mgr_user_list(db_conn, enforce) == SLURM_ERROR) + if(!assoc_mgr_user_list) + if(_get_assoc_mgr_user_list(db_conn, enforce) == SLURM_ERROR) return SLURM_ERROR; if((!assoc_mgr_user_list || !list_count(assoc_mgr_user_list)) - && !(enforce & ACCOUNTING_ENFORCE_ASSOCS)) + && !(enforce & ACCOUNTING_ENFORCE_ASSOCS)) return SLURM_SUCCESS; slurm_mutex_lock(&assoc_mgr_user_lock); @@ -1130,7 +1130,7 @@ extern int assoc_mgr_fill_in_user(void *db_conn, acct_user_rec_t *user, if(user->uid != NO_VAL) { if(user->uid == found_user->uid) break; - } else if(user->name + } else if(user->name && !strcasecmp(user->name, found_user->name)) break; } @@ -1138,13 +1138,13 @@ extern int assoc_mgr_fill_in_user(void *db_conn, acct_user_rec_t *user, if(!found_user) { slurm_mutex_unlock(&assoc_mgr_user_lock); - if(enforce & ACCOUNTING_ENFORCE_ASSOCS) + if(enforce & ACCOUNTING_ENFORCE_ASSOCS) return SLURM_ERROR; else return SLURM_SUCCESS; } - debug3("found correct user"); + debug3("found correct user"); if(user_pptr) *user_pptr = found_user; @@ -1181,27 +1181,27 @@ extern int assoc_mgr_fill_in_qos(void *db_conn, acct_qos_rec_t *qos, if(qos_pptr) *qos_pptr = NULL; - if(!assoc_mgr_qos_list) + if(!assoc_mgr_qos_list) if(_get_assoc_mgr_qos_list(db_conn, enforce) == SLURM_ERROR) return SLURM_ERROR; if((!assoc_mgr_qos_list || !list_count(assoc_mgr_qos_list)) - && !(enforce & ACCOUNTING_ENFORCE_QOS)) + && !(enforce & ACCOUNTING_ENFORCE_QOS)) return SLURM_SUCCESS; slurm_mutex_lock(&assoc_mgr_qos_lock); itr = list_iterator_create(assoc_mgr_qos_list); while((found_qos = list_next(itr))) { - if(qos->id == found_qos->id) + if(qos->id == found_qos->id) break; else if(qos->name && !strcasecmp(qos->name, found_qos->name)) break; } list_iterator_destroy(itr); - + if(!found_qos) { slurm_mutex_unlock(&assoc_mgr_qos_lock); - if(enforce & ACCOUNTING_ENFORCE_QOS) + if(enforce & ACCOUNTING_ENFORCE_QOS) return SLURM_ERROR; else return SLURM_SUCCESS; @@ -1239,7 +1239,7 @@ extern int assoc_mgr_fill_in_qos(void *db_conn, acct_qos_rec_t *qos, qos->max_submit_jobs_pu = found_qos->max_submit_jobs_pu; qos->max_wall_pj = found_qos->max_wall_pj; - if(!qos->name) + if(!qos->name) qos->name = found_qos->name; qos->norm_priority = found_qos->norm_priority; @@ -1263,7 +1263,7 @@ extern int assoc_mgr_fill_in_qos(void *db_conn, acct_qos_rec_t *qos, } extern int assoc_mgr_fill_in_wckey(void *db_conn, acct_wckey_rec_t *wckey, - int enforce, + int enforce, acct_wckey_rec_t **wckey_pptr) { ListIterator itr = NULL; @@ -1277,7 +1277,7 @@ extern int assoc_mgr_fill_in_wckey(void *db_conn, acct_wckey_rec_t *wckey, return SLURM_ERROR; } if((!assoc_mgr_wckey_list || !list_count(assoc_mgr_wckey_list)) - && !(enforce & ACCOUNTING_ENFORCE_WCKEYS)) + && !(enforce & ACCOUNTING_ENFORCE_WCKEYS)) return SLURM_SUCCESS; if(!wckey->id) { @@ -1298,7 +1298,7 @@ extern int assoc_mgr_fill_in_wckey(void *db_conn, acct_wckey_rec_t *wckey, user.uid = wckey->uid; user.name = wckey->user; if(assoc_mgr_fill_in_user(db_conn, &user, - enforce, NULL) + enforce, NULL) == SLURM_ERROR) { if(enforce & ACCOUNTING_ENFORCE_WCKEYS) { error("User %d not found", wckey->uid); @@ -1325,7 +1325,7 @@ extern int assoc_mgr_fill_in_wckey(void *db_conn, acct_wckey_rec_t *wckey, return SLURM_SUCCESS; } } - + } else if(wckey->uid == (uint32_t)NO_VAL && !wckey->user) { if(enforce & ACCOUNTING_ENFORCE_WCKEYS) { error("get_wckey_id: " @@ -1336,8 +1336,8 @@ extern int assoc_mgr_fill_in_wckey(void *db_conn, acct_wckey_rec_t *wckey, return SLURM_SUCCESS; } } - - + + if(!wckey->cluster) wckey->cluster = assoc_mgr_cluster_name; } @@ -1364,9 +1364,9 @@ extern int assoc_mgr_fill_in_wckey(void *db_conn, acct_wckey_rec_t *wckey, } else if(wckey->user && strcasecmp(wckey->user, found_wckey->user)) continue; - + if(wckey->name - && (!found_wckey->name + && (!found_wckey->name || strcasecmp(wckey->name, found_wckey->name))) { debug4("not the right name %s != %s", wckey->name, found_wckey->name); @@ -1381,9 +1381,9 @@ extern int assoc_mgr_fill_in_wckey(void *db_conn, acct_wckey_rec_t *wckey, "we need one to get a wckey."); continue; } - + if(found_wckey->cluster - && strcasecmp(wckey->cluster, + && strcasecmp(wckey->cluster, found_wckey->cluster)) { debug4("not the right cluster"); continue; @@ -1394,10 +1394,10 @@ extern int assoc_mgr_fill_in_wckey(void *db_conn, acct_wckey_rec_t *wckey, break; } list_iterator_destroy(itr); - + if(!ret_wckey) { slurm_mutex_unlock(&assoc_mgr_wckey_lock); - if(enforce & ACCOUNTING_ENFORCE_WCKEYS) + if(enforce & ACCOUNTING_ENFORCE_WCKEYS) return SLURM_ERROR; else return SLURM_SUCCESS; @@ -1410,7 +1410,7 @@ extern int assoc_mgr_fill_in_wckey(void *db_conn, acct_wckey_rec_t *wckey, wckey->cluster = ret_wckey->cluster; wckey->id = ret_wckey->id; - + if(!wckey->name) wckey->name = ret_wckey->name; @@ -1429,26 +1429,26 @@ extern acct_admin_level_t assoc_mgr_get_admin_level(void *db_conn, ListIterator itr = NULL; acct_user_rec_t * found_user = NULL; - if(!assoc_mgr_user_list) + if(!assoc_mgr_user_list) if(_get_assoc_mgr_user_list(db_conn, 0) == SLURM_ERROR) return ACCT_ADMIN_NOTSET; - if(!assoc_mgr_user_list) + if(!assoc_mgr_user_list) return ACCT_ADMIN_NOTSET; slurm_mutex_lock(&assoc_mgr_user_lock); itr = list_iterator_create(assoc_mgr_user_list); while((found_user = list_next(itr))) { - if(uid == found_user->uid) + if(uid == found_user->uid) break; } list_iterator_destroy(itr); slurm_mutex_unlock(&assoc_mgr_user_lock); - - if(found_user) + + if(found_user) return found_user->admin_level; - - return ACCT_ADMIN_NOTSET; + + return ACCT_ADMIN_NOTSET; } extern int assoc_mgr_is_user_acct_coord(void *db_conn, @@ -1459,21 +1459,21 @@ extern int assoc_mgr_is_user_acct_coord(void *db_conn, acct_coord_rec_t *acct = NULL; acct_user_rec_t * found_user = NULL; - if(!assoc_mgr_user_list) + if(!assoc_mgr_user_list) if(_get_assoc_mgr_user_list(db_conn, 0) == SLURM_ERROR) return ACCT_ADMIN_NOTSET; - if(!assoc_mgr_user_list) + if(!assoc_mgr_user_list) return ACCT_ADMIN_NOTSET; slurm_mutex_lock(&assoc_mgr_user_lock); itr = list_iterator_create(assoc_mgr_user_list); while((found_user = list_next(itr))) { - if(uid == found_user->uid) + if(uid == found_user->uid) break; } list_iterator_destroy(itr); - + if(!found_user || !found_user->coord_accts) { slurm_mutex_unlock(&assoc_mgr_user_lock); return 0; @@ -1484,14 +1484,14 @@ extern int assoc_mgr_is_user_acct_coord(void *db_conn, break; } list_iterator_destroy(itr); - + if(acct) { slurm_mutex_unlock(&assoc_mgr_user_lock); return 1; } slurm_mutex_unlock(&assoc_mgr_user_lock); - return 0; + return 0; } extern List assoc_mgr_get_shares(void *db_conn, @@ -1514,11 +1514,11 @@ extern List assoc_mgr_get_shares(void *db_conn, memset(&user, 0, sizeof(acct_user_rec_t)); user.uid = uid; - - if(user_list && list_count(user_list)) + + if(user_list && list_count(user_list)) user_itr = list_iterator_create(user_list); - if(acct_list && list_count(acct_list)) + if(acct_list && list_count(acct_list)) acct_itr = list_iterator_create(acct_list); if (private_data & PRIVATE_DATA_USAGE) { @@ -1527,13 +1527,13 @@ extern List assoc_mgr_get_shares(void *db_conn, /* Check permissions of the requesting user. */ if((uid == slurm_uid || uid == 0) - || assoc_mgr_get_admin_level(db_conn, uid) - >= ACCT_ADMIN_OPERATOR) - is_admin = 1; + || assoc_mgr_get_admin_level(db_conn, uid) + >= ACCT_ADMIN_OPERATOR) + is_admin = 1; else { if(assoc_mgr_fill_in_user( db_conn, &user, - ACCOUNTING_ENFORCE_ASSOCS, NULL) + ACCOUNTING_ENFORCE_ASSOCS, NULL) == SLURM_ERROR) { debug3("User %d not found", user.uid); goto end_it; @@ -1545,7 +1545,7 @@ extern List assoc_mgr_get_shares(void *db_conn, slurm_mutex_lock(&assoc_mgr_association_lock); itr = list_iterator_create(assoc_mgr_association_list); - while((assoc = list_next(itr))) { + while((assoc = list_next(itr))) { if(user_itr && assoc->user) { while((tmp_char = list_next(user_itr))) { if(!strcasecmp(tmp_char, assoc->user)) @@ -1553,7 +1553,7 @@ extern List assoc_mgr_get_shares(void *db_conn, } list_iterator_reset(user_itr); /* not correct user */ - if(!tmp_char) + if(!tmp_char) continue; } @@ -1564,7 +1564,7 @@ extern List assoc_mgr_get_shares(void *db_conn, } list_iterator_reset(acct_itr); /* not correct account */ - if(!tmp_char) + if(!tmp_char) continue; } @@ -1573,10 +1573,10 @@ extern List assoc_mgr_get_shares(void *db_conn, ListIterator itr = NULL; acct_coord_rec_t *coord = NULL; - if(assoc->user && - !strcmp(assoc->user, user.name)) + if(assoc->user && + !strcmp(assoc->user, user.name)) goto is_user; - + if(!user.coord_accts) { debug4("This user isn't a coord."); goto bad_user; @@ -1585,20 +1585,20 @@ extern List assoc_mgr_get_shares(void *db_conn, if(!assoc->acct) { debug("No account name given " "in association."); - goto bad_user; + goto bad_user; } - + itr = list_iterator_create(user.coord_accts); while((coord = list_next(itr))) { - if(!strcasecmp(coord->name, + if(!strcasecmp(coord->name, assoc->acct)) break; } list_iterator_destroy(itr); - - if(coord) + + if(coord) goto is_user; - + bad_user: continue; } @@ -1611,9 +1611,9 @@ extern List assoc_mgr_get_shares(void *db_conn, share->assoc_id = assoc->id; share->cluster = xstrdup(assoc->cluster); - if(assoc == assoc_mgr_root_assoc) + if(assoc == assoc_mgr_root_assoc) share->shares_raw = NO_VAL; - else + else share->shares_raw = assoc->shares_raw; share->shares_norm = assoc->shares_norm; @@ -1623,16 +1623,16 @@ extern List assoc_mgr_get_shares(void *db_conn, /* We only calculate user effective usage when * we need it */ - if(assoc->usage_efctv == (long double)NO_VAL) + if(assoc->usage_efctv == (long double)NO_VAL) priority_g_set_assoc_usage(assoc); - + share->name = xstrdup(assoc->user); share->parent = xstrdup(assoc->acct); share->user = 1; } else { share->name = xstrdup(assoc->acct); if(!assoc->parent_acct && assoc->parent_assoc_ptr) - share->parent = + share->parent = xstrdup(assoc->parent_assoc_ptr->acct); else share->parent = xstrdup(assoc->parent_acct); @@ -1642,12 +1642,12 @@ extern List assoc_mgr_get_shares(void *db_conn, } list_iterator_destroy(itr); slurm_mutex_unlock(&assoc_mgr_association_lock); -end_it: - if(user_itr) +end_it: + if(user_itr) list_iterator_destroy(user_itr); - if(acct_itr) + if(acct_itr) list_iterator_destroy(acct_itr); - + return ret_list; } @@ -1668,9 +1668,9 @@ extern int assoc_mgr_update_assocs(acct_update_object_t *update) while((object = list_pop(update->objects))) { if(object->cluster && assoc_mgr_cluster_name) { /* only update the local clusters assocs */ - if(strcasecmp(object->cluster, + if(strcasecmp(object->cluster, assoc_mgr_cluster_name)) { - destroy_acct_association_rec(object); + destroy_acct_association_rec(object); continue; } } @@ -1690,18 +1690,18 @@ extern int assoc_mgr_update_assocs(acct_update_object_t *update) debug4("not the right user"); continue; } - + if(object->acct - && (!rec->acct + && (!rec->acct || strcasecmp(object->acct, rec->acct))) { debug4("not the right account"); continue; } - + if(object->partition - && (!rec->partition - || strcasecmp(object->partition, + && (!rec->partition + || strcasecmp(object->partition, rec->partition))) { debug4("not the right partition"); continue; @@ -1716,7 +1716,7 @@ extern int assoc_mgr_update_assocs(acct_update_object_t *update) continue; } break; - } + } } //info("%d assoc %u", update->type, object->id); switch(update->type) { @@ -1731,38 +1731,38 @@ extern int assoc_mgr_update_assocs(acct_update_object_t *update) if(setup_childern) { /* we need to update the shares on each sibling and child - association now + association now */ parents_changed = 1; } } - if(object->grp_cpu_mins != NO_VAL) + if(object->grp_cpu_mins != NO_VAL) rec->grp_cpu_mins = object->grp_cpu_mins; - if(object->grp_cpus != NO_VAL) + if(object->grp_cpus != NO_VAL) rec->grp_cpus = object->grp_cpus; - if(object->grp_jobs != NO_VAL) + if(object->grp_jobs != NO_VAL) rec->grp_jobs = object->grp_jobs; - if(object->grp_nodes != NO_VAL) + if(object->grp_nodes != NO_VAL) rec->grp_nodes = object->grp_nodes; - if(object->grp_submit_jobs != NO_VAL) + if(object->grp_submit_jobs != NO_VAL) rec->grp_submit_jobs = object->grp_submit_jobs; - if(object->grp_wall != NO_VAL) + if(object->grp_wall != NO_VAL) rec->grp_wall = object->grp_wall; - - if(object->max_cpu_mins_pj != NO_VAL) + + if(object->max_cpu_mins_pj != NO_VAL) rec->max_cpu_mins_pj = object->max_cpu_mins_pj; - if(object->max_cpus_pj != NO_VAL) + if(object->max_cpus_pj != NO_VAL) rec->max_cpus_pj = object->max_cpus_pj; - if(object->max_jobs != NO_VAL) + if(object->max_jobs != NO_VAL) rec->max_jobs = object->max_jobs; - if(object->max_nodes_pj != NO_VAL) + if(object->max_nodes_pj != NO_VAL) rec->max_nodes_pj = object->max_nodes_pj; - if(object->max_submit_jobs != NO_VAL) + if(object->max_submit_jobs != NO_VAL) rec->max_submit_jobs = object->max_submit_jobs; - if(object->max_wall_pj != NO_VAL) + if(object->max_wall_pj != NO_VAL) rec->max_wall_pj = object->max_wall_pj; - + if(object->parent_acct) { xfree(rec->parent_acct); @@ -1790,9 +1790,9 @@ extern int assoc_mgr_update_assocs(acct_update_object_t *update) != g_qos_count)) { FREE_NULL_BITMAP( rec->valid_qos); - rec->valid_qos = + rec->valid_qos = bit_alloc(g_qos_count); - } + } set_qos_bitstr_from_list( rec->valid_qos, rec->qos_list); } @@ -1829,7 +1829,7 @@ extern int assoc_mgr_update_assocs(acct_update_object_t *update) if(remove_assoc_notify) { /* since there are some deadlock issues while inside our lock here - we have to process a notify later + we have to process a notify later */ if(!remove_list) remove_list = list_create( @@ -1842,16 +1842,16 @@ extern int assoc_mgr_update_assocs(acct_update_object_t *update) default: break; } - - destroy_acct_association_rec(object); + + destroy_acct_association_rec(object); } - + /* We have to do this after the entire list is processed since * we may have added the parent which wasn't in the list before */ if(parents_changed) { int reset = 1; - list_sort(assoc_mgr_association_list, + list_sort(assoc_mgr_association_list, (ListCmpF)_sort_assoc_dec); list_iterator_reset(itr); @@ -1894,10 +1894,10 @@ extern int assoc_mgr_update_assocs(acct_update_object_t *update) goto is_user; itr2 = list_iterator_create( object->childern_list); - while((rec = list_next(itr2))) + while((rec = list_next(itr2))) count += rec->shares_raw; list_iterator_reset(itr2); - while((rec = list_next(itr2))) + while((rec = list_next(itr2))) rec->level_shares = count; list_iterator_destroy(itr2); } @@ -1932,20 +1932,20 @@ extern int assoc_mgr_update_assocs(acct_update_object_t *update) list_iterator_destroy(itr); slurm_mutex_unlock(&assoc_mgr_association_lock); - + /* This needs to happen outside of the assoc_mgr_association_lock */ if(remove_list) { itr = list_iterator_create(remove_list); - while((rec = list_next(itr))) + while((rec = list_next(itr))) remove_assoc_notify(rec); - + list_iterator_destroy(itr); list_destroy(remove_list); } - return rc; + return rc; } extern int assoc_mgr_update_wckeys(acct_update_object_t *update) @@ -1966,7 +1966,7 @@ extern int assoc_mgr_update_wckeys(acct_update_object_t *update) /* only update the local clusters assocs */ if(strcasecmp(object->cluster, assoc_mgr_cluster_name)) { - destroy_acct_wckey_rec(object); + destroy_acct_wckey_rec(object); continue; } } @@ -1982,15 +1982,15 @@ extern int assoc_mgr_update_wckeys(acct_update_object_t *update) debug4("not the right user"); continue; } - + if(object->name - && (!rec->name + && (!rec->name || strcasecmp(object->name, rec->name))) { debug4("not the right wckey"); continue; } - + /* only check for on the slurmdbd */ if(!assoc_mgr_cluster_name && object->cluster && (!rec->cluster @@ -2000,7 +2000,7 @@ extern int assoc_mgr_update_wckeys(acct_update_object_t *update) continue; } break; - } + } } //info("%d WCKEY %u", update->type, object->id); switch(update->type) { @@ -2036,20 +2036,20 @@ extern int assoc_mgr_update_wckeys(acct_update_object_t *update) default: break; } - - destroy_acct_wckey_rec(object); + + destroy_acct_wckey_rec(object); } list_iterator_destroy(itr); slurm_mutex_unlock(&assoc_mgr_wckey_lock); - return rc; + return rc; } extern int assoc_mgr_update_users(acct_update_object_t *update) { acct_user_rec_t * rec = NULL; acct_user_rec_t * object = NULL; - + ListIterator itr = NULL; int rc = SLURM_SUCCESS; uid_t pw_uid; @@ -2062,7 +2062,7 @@ extern int assoc_mgr_update_users(acct_update_object_t *update) while((object = list_pop(update->objects))) { list_iterator_reset(itr); while((rec = list_next(itr))) { - if(!strcasecmp(object->name, rec->name)) + if(!strcasecmp(object->name, rec->name)) break; } @@ -2086,7 +2086,7 @@ extern int assoc_mgr_update_users(acct_update_object_t *update) object->default_wckey = NULL; } - if(object->admin_level != ACCT_ADMIN_NOTSET) + if(object->admin_level != ACCT_ADMIN_NOTSET) rec->admin_level = object->admin_level; break; @@ -2132,13 +2132,13 @@ extern int assoc_mgr_update_users(acct_update_object_t *update) default: break; } - - destroy_acct_user_rec(object); + + destroy_acct_user_rec(object); } list_iterator_destroy(itr); slurm_mutex_unlock(&assoc_mgr_user_lock); - return rc; + return rc; } extern int assoc_mgr_update_qos(acct_update_object_t *update) @@ -2152,9 +2152,9 @@ extern int assoc_mgr_update_qos(acct_update_object_t *update) int rc = SLURM_SUCCESS; bool resize_qos_bitstr = 0; - if(!assoc_mgr_qos_list) + if(!assoc_mgr_qos_list) return SLURM_SUCCESS; - + slurm_mutex_lock(&assoc_mgr_qos_lock); itr = list_iterator_create(assoc_mgr_qos_list); while((object = list_pop(update->objects))) { @@ -2176,11 +2176,11 @@ extern int assoc_mgr_update_qos(acct_update_object_t *update) /* char *tmp = get_qos_complete_str_bitstr( */ /* assoc_mgr_qos_list, */ /* object->preempt_bitstr); */ - + /* info("new qos %s(%d) now preempts %s", */ /* object->name, object->id, tmp); */ /* xfree(tmp); */ - + /* Since in the database id's don't start at 1 instead of 0 we need to ignore the 0 bit and start with 1 so increase the count by 1. @@ -2189,7 +2189,7 @@ extern int assoc_mgr_update_qos(acct_update_object_t *update) resize_qos_bitstr = 1; g_qos_count = object->id+1; } - object = NULL; + object = NULL; break; case ACCT_MODIFY_QOS: if(!rec) { @@ -2197,57 +2197,57 @@ extern int assoc_mgr_update_qos(acct_update_object_t *update) break; } - if(object->grp_cpu_mins != NO_VAL) + if(object->grp_cpu_mins != NO_VAL) rec->grp_cpu_mins = object->grp_cpu_mins; - if(object->grp_cpus != NO_VAL) + if(object->grp_cpus != NO_VAL) rec->grp_cpus = object->grp_cpus; - if(object->grp_jobs != NO_VAL) + if(object->grp_jobs != NO_VAL) rec->grp_jobs = object->grp_jobs; - if(object->grp_nodes != NO_VAL) + if(object->grp_nodes != NO_VAL) rec->grp_nodes = object->grp_nodes; - if(object->grp_submit_jobs != NO_VAL) + if(object->grp_submit_jobs != NO_VAL) rec->grp_submit_jobs = object->grp_submit_jobs; - if(object->grp_wall != NO_VAL) + if(object->grp_wall != NO_VAL) rec->grp_wall = object->grp_wall; - - if(object->max_cpu_mins_pj != NO_VAL) + + if(object->max_cpu_mins_pj != NO_VAL) rec->max_cpu_mins_pj = object->max_cpu_mins_pj; - if(object->max_cpus_pj != NO_VAL) + if(object->max_cpus_pj != NO_VAL) rec->max_cpus_pj = object->max_cpus_pj; - if(object->max_jobs_pu != NO_VAL) + if(object->max_jobs_pu != NO_VAL) rec->max_jobs_pu = object->max_jobs_pu; - if(object->max_nodes_pj != NO_VAL) + if(object->max_nodes_pj != NO_VAL) rec->max_nodes_pj = object->max_nodes_pj; - if(object->max_submit_jobs_pu != NO_VAL) + if(object->max_submit_jobs_pu != NO_VAL) rec->max_submit_jobs_pu = object->max_submit_jobs_pu; - if(object->max_wall_pj != NO_VAL) + if(object->max_wall_pj != NO_VAL) rec->max_wall_pj = object->max_wall_pj; - + if(object->preempt_bitstr) { - if(rec->preempt_bitstr) + if(rec->preempt_bitstr) FREE_NULL_BITMAP(rec->preempt_bitstr); - + rec->preempt_bitstr = object->preempt_bitstr; object->preempt_bitstr = NULL; /* char *tmp = get_qos_complete_str_bitstr( */ /* assoc_mgr_qos_list, */ /* rec->preempt_bitstr); */ - + /* info("qos %s(%d) now preempts %s", */ /* rec->name, rec->id, tmp); */ /* xfree(tmp); */ } - if(object->priority != NO_VAL) + if(object->priority != NO_VAL) rec->priority = object->priority; - if(object->usage_factor != (double)NO_VAL) + if(object->usage_factor != (double)NO_VAL) rec->usage_factor = object->usage_factor; - + break; case ACCT_REMOVE_QOS: - if(rec) + if(rec) list_delete_item(itr); if(!assoc_mgr_association_list) @@ -2267,12 +2267,12 @@ extern int assoc_mgr_update_qos(acct_update_object_t *update) } list_iterator_destroy(assoc_itr); slurm_mutex_unlock(&assoc_mgr_association_lock); - + break; default: break; } - destroy_acct_qos_rec(object); + destroy_acct_qos_rec(object); } if(resize_qos_bitstr) { @@ -2280,10 +2280,10 @@ extern int assoc_mgr_update_qos(acct_update_object_t *update) qos' */ list_iterator_reset(itr); while((object = list_next(itr))) { - if(!object->preempt_bitstr) + if(!object->preempt_bitstr) continue; - object->preempt_bitstr = + object->preempt_bitstr = bit_realloc(object->preempt_bitstr, g_qos_count); } @@ -2303,10 +2303,10 @@ extern int assoc_mgr_update_qos(acct_update_object_t *update) } } list_iterator_destroy(itr); - + slurm_mutex_unlock(&assoc_mgr_qos_lock); - - return rc; + + return rc; } extern int assoc_mgr_validate_assoc_id(void *db_conn, @@ -2316,20 +2316,20 @@ extern int assoc_mgr_validate_assoc_id(void *db_conn, ListIterator itr = NULL; acct_association_rec_t * found_assoc = NULL; - if(!assoc_mgr_association_list) - if(_get_assoc_mgr_association_list(db_conn, enforce) + if(!assoc_mgr_association_list) + if(_get_assoc_mgr_association_list(db_conn, enforce) == SLURM_ERROR) return SLURM_ERROR; if((!assoc_mgr_association_list || !list_count(assoc_mgr_association_list)) - && !(enforce & ACCOUNTING_ENFORCE_ASSOCS)) + && !(enforce & ACCOUNTING_ENFORCE_ASSOCS)) return SLURM_SUCCESS; - + slurm_mutex_lock(&assoc_mgr_association_lock); itr = list_iterator_create(assoc_mgr_association_list); while((found_assoc = list_next(itr))) { - if(assoc_id == found_assoc->id) + if(assoc_id == found_assoc->id) break; } list_iterator_destroy(itr); @@ -2358,7 +2358,7 @@ extern void assoc_mgr_clear_used_info(void) slurm_mutex_unlock(&assoc_mgr_association_lock); } -extern int dump_assoc_mgr_state(char *state_save_location) +extern int dump_assoc_mgr_state(char *state_save_location) { static int high_buffer_size = (1024 * 1024); int error_code = 0, log_fd; @@ -2378,41 +2378,41 @@ extern int dump_assoc_mgr_state(char *state_save_location) msg.my_list = assoc_mgr_association_list; /* let us know what to unpack */ pack16(DBD_ADD_ASSOCS, buffer); - slurmdbd_pack_list_msg(SLURMDBD_VERSION, + slurmdbd_pack_list_msg(SLURMDBD_VERSION, DBD_ADD_ASSOCS, &msg, buffer); slurm_mutex_unlock(&assoc_mgr_association_lock); } - + if(assoc_mgr_user_list) { memset(&msg, 0, sizeof(dbd_list_msg_t)); slurm_mutex_lock(&assoc_mgr_user_lock); msg.my_list = assoc_mgr_user_list; /* let us know what to unpack */ pack16(DBD_ADD_USERS, buffer); - slurmdbd_pack_list_msg(SLURMDBD_VERSION, + slurmdbd_pack_list_msg(SLURMDBD_VERSION, DBD_ADD_USERS, &msg, buffer); slurm_mutex_unlock(&assoc_mgr_user_lock); } - if(assoc_mgr_qos_list) { + if(assoc_mgr_qos_list) { memset(&msg, 0, sizeof(dbd_list_msg_t)); slurm_mutex_lock(&assoc_mgr_qos_lock); msg.my_list = assoc_mgr_qos_list; /* let us know what to unpack */ pack16(DBD_ADD_QOS, buffer); - slurmdbd_pack_list_msg(SLURMDBD_VERSION, - DBD_ADD_QOS, &msg, buffer); + slurmdbd_pack_list_msg(SLURMDBD_VERSION, + DBD_ADD_QOS, &msg, buffer); slurm_mutex_unlock(&assoc_mgr_qos_lock); } - if(assoc_mgr_wckey_list) { + if(assoc_mgr_wckey_list) { memset(&msg, 0, sizeof(dbd_list_msg_t)); slurm_mutex_lock(&assoc_mgr_wckey_lock); msg.my_list = assoc_mgr_wckey_list; /* let us know what to unpack */ pack16(DBD_ADD_WCKEYS, buffer); - slurmdbd_pack_list_msg(SLURMDBD_VERSION, - DBD_ADD_WCKEYS, &msg, buffer); + slurmdbd_pack_list_msg(SLURMDBD_VERSION, + DBD_ADD_WCKEYS, &msg, buffer); slurm_mutex_unlock(&assoc_mgr_wckey_lock); } @@ -2420,7 +2420,7 @@ extern int dump_assoc_mgr_state(char *state_save_location) reg_file = xstrdup_printf("%s/assoc_mgr_state", state_save_location); old_file = xstrdup_printf("%s.old", reg_file); new_file = xstrdup_printf("%s.new", reg_file); - + slurm_mutex_lock(&assoc_mgr_file_lock); log_fd = creat(new_file, 0600); if (log_fd < 0) { @@ -2477,10 +2477,10 @@ extern int dump_assoc_mgr_state(char *state_save_location) while((assoc = list_next(itr))) { if(!assoc->user) continue; - + pack32(assoc->id, buffer); /* we only care about the main part here so - anything under 1 we are dropping + anything under 1 we are dropping */ pack64((uint64_t)assoc->usage_raw, buffer); pack32(assoc->grp_used_wall, buffer); @@ -2492,7 +2492,7 @@ extern int dump_assoc_mgr_state(char *state_save_location) reg_file = xstrdup_printf("%s/assoc_usage", state_save_location); old_file = xstrdup_printf("%s.old", reg_file); new_file = xstrdup_printf("%s.new", reg_file); - + log_fd = creat(new_file, 0600); if (log_fd < 0) { error("Can't save state, create file %s error %m", @@ -2548,7 +2548,7 @@ extern int dump_assoc_mgr_state(char *state_save_location) while((qos = list_next(itr))) { pack32(qos->id, buffer); /* we only care about the main part here so - anything under 1 we are dropping + anything under 1 we are dropping */ pack64((uint64_t)qos->usage_raw, buffer); pack32(qos->grp_used_wall, buffer); @@ -2560,7 +2560,7 @@ extern int dump_assoc_mgr_state(char *state_save_location) reg_file = xstrdup_printf("%s/qos_usage", state_save_location); old_file = xstrdup_printf("%s.old", reg_file); new_file = xstrdup_printf("%s.new", reg_file); - + log_fd = creat(new_file, 0600); if (log_fd < 0) { error("Can't save state, create file %s error %m", @@ -2600,7 +2600,7 @@ extern int dump_assoc_mgr_state(char *state_save_location) xfree(reg_file); xfree(new_file); slurm_mutex_unlock(&assoc_mgr_file_lock); - + free_buf(buffer); END_TIMER2("dump_assoc_mgr_state"); return error_code; @@ -2640,7 +2640,7 @@ extern int load_assoc_usage(char *state_save_location) if (errno == EINTR) continue; else { - error("Read error on %s: %m", + error("Read error on %s: %m", state_file); break; } @@ -2669,7 +2669,7 @@ extern int load_assoc_usage(char *state_save_location) } safe_unpack_time(&buf_time, buffer); - + slurm_mutex_lock(&assoc_mgr_association_lock); itr = list_iterator_create(assoc_mgr_association_list); while (remaining_buf(buffer) > 0) { @@ -2681,10 +2681,10 @@ extern int load_assoc_usage(char *state_save_location) safe_unpack32(&assoc_id, buffer); safe_unpack64(&usage_raw, buffer); safe_unpack32(&grp_used_wall, buffer); - while((assoc = list_next(itr))) + while((assoc = list_next(itr))) if(assoc->id == assoc_id) break; - + while(assoc) { assoc->grp_used_wall += grp_used_wall; assoc->usage_raw += (long double)usage_raw; @@ -2697,7 +2697,7 @@ extern int load_assoc_usage(char *state_save_location) } list_iterator_destroy(itr); slurm_mutex_unlock(&assoc_mgr_association_lock); - + free_buf(buffer); return SLURM_SUCCESS; @@ -2744,7 +2744,7 @@ extern int load_qos_usage(char *state_save_location) if (errno == EINTR) continue; else { - error("Read error on %s: %m", + error("Read error on %s: %m", state_file); break; } @@ -2773,7 +2773,7 @@ extern int load_qos_usage(char *state_save_location) } safe_unpack_time(&buf_time, buffer); - + slurm_mutex_lock(&assoc_mgr_qos_lock); itr = list_iterator_create(assoc_mgr_qos_list); while (remaining_buf(buffer) > 0) { @@ -2785,19 +2785,19 @@ extern int load_qos_usage(char *state_save_location) safe_unpack32(&qos_id, buffer); safe_unpack64(&usage_raw, buffer); safe_unpack32(&grp_used_wall, buffer); - while((qos = list_next(itr))) + while((qos = list_next(itr))) if(qos->id == qos_id) break; if(qos) { qos->grp_used_wall += grp_used_wall; qos->usage_raw += (long double)usage_raw; } - + list_iterator_reset(itr); } list_iterator_destroy(itr); slurm_mutex_unlock(&assoc_mgr_qos_lock); - + free_buf(buffer); return SLURM_SUCCESS; @@ -2822,7 +2822,7 @@ extern int load_assoc_mgr_state(char *state_save_location) Buf buffer; time_t buf_time; dbd_list_msg_t *msg = NULL; - + /* read the file */ state_file = xstrdup(state_save_location); xstrcat(state_file, "/assoc_mgr_state"); /* Always ignore .old file */ @@ -2842,7 +2842,7 @@ extern int load_assoc_mgr_state(char *state_save_location) if (errno == EINTR) continue; else { - error("Read error on %s: %m", + error("Read error on %s: %m", state_file); break; } @@ -2890,7 +2890,7 @@ extern int load_assoc_mgr_state(char *state_save_location) assoc_mgr_association_list = msg->my_list; _post_association_list(assoc_mgr_association_list); - debug("Recovered %u associations", + debug("Recovered %u associations", list_count(assoc_mgr_association_list)); slurm_mutex_unlock(&assoc_mgr_association_lock); msg->my_list = NULL; @@ -2910,7 +2910,7 @@ extern int load_assoc_mgr_state(char *state_save_location) list_destroy(assoc_mgr_user_list); assoc_mgr_user_list = msg->my_list; _post_user_list(assoc_mgr_user_list); - debug("Recovered %u users", + debug("Recovered %u users", list_count(assoc_mgr_user_list)); slurm_mutex_unlock(&assoc_mgr_user_lock); msg->my_list = NULL; @@ -2929,11 +2929,11 @@ extern int load_assoc_mgr_state(char *state_save_location) if(assoc_mgr_qos_list) list_destroy(assoc_mgr_qos_list); assoc_mgr_qos_list = msg->my_list; - debug("Recovered %u qos", + debug("Recovered %u qos", list_count(assoc_mgr_qos_list)); slurm_mutex_unlock(&assoc_mgr_qos_lock); msg->my_list = NULL; - slurmdbd_free_list_msg(SLURMDBD_VERSION, msg); + slurmdbd_free_list_msg(SLURMDBD_VERSION, msg); break; case DBD_ADD_WCKEYS: error_code = slurmdbd_unpack_list_msg( @@ -2948,11 +2948,11 @@ extern int load_assoc_mgr_state(char *state_save_location) if(assoc_mgr_wckey_list) list_destroy(assoc_mgr_wckey_list); assoc_mgr_wckey_list = msg->my_list; - debug("Recovered %u wckeys", + debug("Recovered %u wckeys", list_count(assoc_mgr_wckey_list)); slurm_mutex_unlock(&assoc_mgr_wckey_lock); msg->my_list = NULL; - slurmdbd_free_list_msg(SLURMDBD_VERSION, msg); + slurmdbd_free_list_msg(SLURMDBD_VERSION, msg); break; default: error("unknown type %u given", type); @@ -2968,7 +2968,7 @@ unpack_error: if(buffer) free_buf(buffer); return SLURM_ERROR; -} +} extern int assoc_mgr_refresh_lists(void *db_conn, assoc_init_args_t *args) { @@ -2980,7 +2980,7 @@ extern int assoc_mgr_refresh_lists(void *db_conn, assoc_init_args_t *args) cache_level = args->cache_level; return SLURM_SUCCESS; } - + if(cache_level & ASSOC_MGR_CACHE_ASSOC) { if(_refresh_assoc_mgr_association_list(db_conn, enforce) == SLURM_ERROR) @@ -3001,14 +3001,14 @@ extern int assoc_mgr_refresh_lists(void *db_conn, assoc_init_args_t *args) running_cache = 0; - return SLURM_SUCCESS; + return SLURM_SUCCESS; } extern int assoc_mgr_set_missing_uids() { uid_t pw_uid; ListIterator itr = NULL; - + if(assoc_mgr_association_list) { acct_association_rec_t *object = NULL; slurm_mutex_lock(&assoc_mgr_association_lock); @@ -3066,7 +3066,7 @@ extern int assoc_mgr_set_missing_uids() slurm_mutex_unlock(&assoc_mgr_user_lock); } - return SLURM_SUCCESS; + return SLURM_SUCCESS; } diff --git a/src/common/assoc_mgr.h b/src/common/assoc_mgr.h index facdd26711..a57f5a36ab 100644 --- a/src/common/assoc_mgr.h +++ b/src/common/assoc_mgr.h @@ -6,38 +6,38 @@ * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Danny Auble * CODE-OCEC-09-009. All rights reserved. - * + * * This file is part of SLURM, a resource management program. * For details, see . * Please also read the included file: DISCLAIMER. - * + * * SLURM is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free * Software Foundation; either version 2 of the License, or (at your option) * any later version. * - * In addition, as a special exception, the copyright holders give permission + * In addition, as a special exception, the copyright holders give permission * to link the code of portions of this program with the OpenSSL library under - * certain conditions as described in each individual source file, and - * distribute linked combinations including the two. You must obey the GNU - * General Public License in all respects for all of the code used other than - * OpenSSL. If you modify file(s) with this exception, you may extend this - * exception to your version of the file(s), but you are not obligated to do + * certain conditions as described in each individual source file, and + * distribute linked combinations including the two. You must obey the GNU + * General Public License in all respects for all of the code used other than + * OpenSSL. If you modify file(s) with this exception, you may extend this + * exception to your version of the file(s), but you are not obligated to do * so. If you do not wish to do so, delete this exception statement from your - * version. If you delete this exception statement from all source files in + * version. If you delete this exception statement from all source files in * the program, then also delete it here. - * + * * SLURM is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. - * + * * You should have received a copy of the GNU General Public License along * with SLURM; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. \*****************************************************************************/ -#ifndef _SLURM_ASSOC_MGR_H +#ifndef _SLURM_ASSOC_MGR_H #define _SLURM_ASSOC_MGR_H #ifdef HAVE_CONFIG_H @@ -75,8 +75,8 @@ extern pthread_mutex_t assoc_mgr_user_lock; extern pthread_mutex_t assoc_mgr_file_lock; extern pthread_mutex_t assoc_mgr_wckey_lock; -/* - * get info from the storage +/* + * get info from the storage * IN: assoc - acct_association_rec_t with at least cluster and * account set for account association. To get user * association set user, and optional partition. @@ -90,17 +90,17 @@ extern pthread_mutex_t assoc_mgr_wckey_lock; */ extern int assoc_mgr_get_user_assocs(void *db_conn, acct_association_rec_t *assoc, - int enforce, + int enforce, List assoc_list); -/* - * get info from the storage +/* + * get info from the storage * IN/OUT: assoc - acct_association_rec_t with at least cluster and * account set for account association. To get user * association set user, and optional partition. * Sets "id" field with the association ID. * IN: enforce - return an error if no such association exists - * IN/OUT: assoc_pptr - if non-NULL then return a pointer to the + * IN/OUT: assoc_pptr - if non-NULL then return a pointer to the * acct_association record in cache on success * DO NOT FREE. * RET: SLURM_SUCCESS on success, else SLURM_ERROR @@ -110,12 +110,12 @@ extern int assoc_mgr_fill_in_assoc(void *db_conn, int enforce, acct_association_rec_t **assoc_pptr); -/* - * get info from the storage +/* + * get info from the storage * IN/OUT: user - acct_user_rec_t with the name set of the user. * "default_account" will be filled in on * successful return DO NOT FREE. - * IN/OUT: user_pptr - if non-NULL then return a pointer to the + * IN/OUT: user_pptr - if non-NULL then return a pointer to the * acct_user record in cache on success * DO NOT FREE. * RET: SLURM_SUCCESS on success SLURM_ERROR else @@ -124,10 +124,10 @@ extern int assoc_mgr_fill_in_user(void *db_conn, acct_user_rec_t *user, int enforce, acct_user_rec_t **user_pptr); -/* - * get info from the storage +/* + * get info from the storage * IN/OUT: qos - acct_qos_rec_t with the id set of the qos. - * IN/OUT: qos_pptr - if non-NULL then return a pointer to the + * IN/OUT: qos_pptr - if non-NULL then return a pointer to the * acct_qos record in cache on success * DO NOT FREE. * RET: SLURM_SUCCESS on success SLURM_ERROR else @@ -135,13 +135,13 @@ extern int assoc_mgr_fill_in_user(void *db_conn, acct_user_rec_t *user, extern int assoc_mgr_fill_in_qos(void *db_conn, acct_qos_rec_t *qos, int enforce, acct_qos_rec_t **qos_pptr); -/* - * get info from the storage +/* + * get info from the storage * IN/OUT: wckey - acct_wckey_rec_t with the name, cluster and user - * for the wckey association. + * for the wckey association. * Sets "id" field with the wckey ID. * IN: enforce - return an error if no such wckey exists - * IN/OUT: wckey_pptr - if non-NULL then return a pointer to the + * IN/OUT: wckey_pptr - if non-NULL then return a pointer to the * acct_wckey record in cache on success * RET: SLURM_SUCCESS on success, else SLURM_ERROR */ @@ -150,16 +150,16 @@ extern int assoc_mgr_fill_in_wckey(void *db_conn, int enforce, acct_wckey_rec_t **wckey_pptr); -/* - * get admin_level of uid +/* + * get admin_level of uid * IN: uid - uid of user to check admin_level of. - * RET: admin level ACCT_ADMIN_NOTSET on error + * RET: admin level ACCT_ADMIN_NOTSET on error */ -extern acct_admin_level_t assoc_mgr_get_admin_level(void *db_conn, +extern acct_admin_level_t assoc_mgr_get_admin_level(void *db_conn, uint32_t uid); -/* - * see if user is coordinator of given acct +/* + * see if user is coordinator of given acct * IN: uid - uid of user to check. * IN: acct - name of account * RET: 0 for no, 1 for yes @@ -172,7 +172,7 @@ extern int assoc_mgr_fini(char *state_save_location); /* * get the share information from the association list in the form of - * a list containing association_share_object_t's + * a list containing association_share_object_t's * IN: uid: uid_t of user issuing the request * IN: acct_list: char * list of accounts you want (NULL for all) * IN: user_list: char * list of user names you want (NULL for all) @@ -180,47 +180,47 @@ extern int assoc_mgr_fini(char *state_save_location); extern List assoc_mgr_get_shares( void *db_conn, uid_t uid, List acct_list, List user_list); -/* - * update associations in cache +/* + * update associations in cache * IN: acct_update_object_t *object * RET: SLURM_SUCCESS on success (or not found) SLURM_ERROR else */ extern int assoc_mgr_update_assocs(acct_update_object_t *update); -/* - * update wckeys in cache +/* + * update wckeys in cache * IN: acct_update_object_t *object * RET: SLURM_SUCCESS on success (or not found) SLURM_ERROR else */ extern int assoc_mgr_update_wckeys(acct_update_object_t *update); -/* - * update qos in cache +/* + * update qos in cache * IN: acct_update_object_t *object * RET: SLURM_SUCCESS on success (or not found) SLURM_ERROR else */ extern int assoc_mgr_update_qos(acct_update_object_t *update); -/* - * update users in cache +/* + * update users in cache * IN: acct_update_object_t *object * RET: SLURM_SUCCESS on success (or not found) SLURM_ERROR else */ extern int assoc_mgr_update_users(acct_update_object_t *update); -/* - * validate that an association ID is still valid - * IN: assoc_id - association ID previously returned by - * get_assoc_id(void *db_conn, +/* + * validate that an association ID is still valid + * IN: assoc_id - association ID previously returned by + * get_assoc_id(void *db_conn, ) * RET: SLURM_SUCCESS on success SLURM_ERROR else */ -extern int assoc_mgr_validate_assoc_id(void *db_conn, +extern int assoc_mgr_validate_assoc_id(void *db_conn, uint32_t assoc_id, int enforce); /* - * clear the used_* fields from every assocation, + * clear the used_* fields from every assocation, * used on reconfiguration */ extern void assoc_mgr_clear_used_info(void); diff --git a/src/common/basil_resv_conf.c b/src/common/basil_resv_conf.c index 7f185cd7b1..d14d54307d 100644 --- a/src/common/basil_resv_conf.c +++ b/src/common/basil_resv_conf.c @@ -1,38 +1,38 @@ /*****************************************************************************\ * basil_resv_conf.h - user interface to BASIL for confirming a resource - * reservation. BASIL is Cray's Batch Application Scheduler Interface + * reservation. BASIL is Cray's Batch Application Scheduler Interface * Layer. ***************************************************************************** * Copyright (C) 2009 Lawrence Livermore National Security. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Morris Jette * CODE-OCEC-09-009. All rights reserved. - * + * * This file is part of SLURM, a resource management program. * For details, see . * Please also read the included file: DISCLAIMER. - * + * * SLURM is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free * Software Foundation; either version 2 of the License, or (at your option) * any later version. * - * In addition, as a special exception, the copyright holders give permission + * In addition, as a special exception, the copyright holders give permission * to link the code of portions of this program with the OpenSSL library under - * certain conditions as described in each individual source file, and - * distribute linked combinations including the two. You must obey the GNU - * General Public License in all respects for all of the code used other than - * OpenSSL. If you modify file(s) with this exception, you may extend this - * exception to your version of the file(s), but you are not obligated to do + * certain conditions as described in each individual source file, and + * distribute linked combinations including the two. You must obey the GNU + * General Public License in all respects for all of the code used other than + * OpenSSL. If you modify file(s) with this exception, you may extend this + * exception to your version of the file(s), but you are not obligated to do * so. If you do not wish to do so, delete this exception statement from your - * version. If you delete this exception statement from all source files in + * version. If you delete this exception statement from all source files in * the program, then also delete it here. - * + * * SLURM is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. - * + * * You should have received a copy of the GNU General Public License along * with SLURM; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. @@ -57,7 +57,7 @@ /* * basil_resv_conf - confirm a previously created BASIL resource reservation. - * This must be called from the same container from which the user + * This must be called from the same container from which the user * application is to run. The container is normally a Linux Process * Group or SGI Process Aggregate (see http://oss.sgi.com/projects/pagg). * IN reservation_id - ID of reservation conform @@ -74,7 +74,7 @@ extern int basil_resv_conf(char *reservation_id, uint32_t job_id) error("basil confirm of %s error: %s", reservation_id, "TBD"); return SLURM_ERROR; } - debug("basil confirm of reservation %s by job %u complete", + debug("basil confirm of reservation %s by job %u complete", reservation_id, job_id); #else debug("basil confirm of reservation %s by job %u complete", diff --git a/src/common/basil_resv_conf.h b/src/common/basil_resv_conf.h index ab72578f9a..928a6eaba1 100644 --- a/src/common/basil_resv_conf.h +++ b/src/common/basil_resv_conf.h @@ -1,38 +1,38 @@ /*****************************************************************************\ * basil_resv_conf.h - user interface to BASIL for confirming a resource - * reservation. BASIL is Cray's Batch Application Scheduler Interface + * reservation. BASIL is Cray's Batch Application Scheduler Interface * Layer. ***************************************************************************** * Copyright (C) 2009 Lawrence Livermore National Security. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Morris Jette * CODE-OCEC-09-009. All rights reserved. - * + * * This file is part of SLURM, a resource management program. * For details, see . * Please also read the included file: DISCLAIMER. - * + * * SLURM is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free * Software Foundation; either version 2 of the License, or (at your option) * any later version. * - * In addition, as a special exception, the copyright holders give permission + * In addition, as a special exception, the copyright holders give permission * to link the code of portions of this program with the OpenSSL library under - * certain conditions as described in each individual source file, and - * distribute linked combinations including the two. You must obey the GNU - * General Public License in all respects for all of the code used other than - * OpenSSL. If you modify file(s) with this exception, you may extend this - * exception to your version of the file(s), but you are not obligated to do + * certain conditions as described in each individual source file, and + * distribute linked combinations including the two. You must obey the GNU + * General Public License in all respects for all of the code used other than + * OpenSSL. If you modify file(s) with this exception, you may extend this + * exception to your version of the file(s), but you are not obligated to do * so. If you do not wish to do so, delete this exception statement from your - * version. If you delete this exception statement from all source files in + * version. If you delete this exception statement from all source files in * the program, then also delete it here. - * + * * SLURM is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. - * + * * You should have received a copy of the GNU General Public License along * with SLURM; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. @@ -54,7 +54,7 @@ /* * basil_resv_conf - confirm a previously created BASIL resource reservation. - * This must be called from the same container from which the user + * This must be called from the same container from which the user * application is to run. The container is normally a Linux Process * Group or SGI Process Aggregate (see http://oss.sgi.com/projects/pagg). * IN reservation_id - ID of reservation conform diff --git a/src/common/bitstring.c b/src/common/bitstring.c index 5012838244..04f5532346 100644 --- a/src/common/bitstring.c +++ b/src/common/bitstring.c @@ -1,39 +1,39 @@ /*****************************************************************************\ * bitstring.c - bitmap manipulation functions ***************************************************************************** - * See comments about origin, limitations, and internal structure in + * See comments about origin, limitations, and internal structure in * bitstring.h. * * Copyright (C) 2002 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Jim Garlick , Morris Jette * CODE-OCEC-09-009. All rights reserved. - * + * * This file is part of SLURM, a resource management program. * For details, see . * Please also read the included file: DISCLAIMER. - * + * * SLURM is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free * Software Foundation; either version 2 of the License, or (at your option) * any later version. * - * In addition, as a special exception, the copyright holders give permission + * In addition, as a special exception, the copyright holders give permission * to link the code of portions of this program with the OpenSSL library under - * certain conditions as described in each individual source file, and - * distribute linked combinations including the two. You must obey the GNU - * General Public License in all respects for all of the code used other than - * OpenSSL. If you modify file(s) with this exception, you may extend this - * exception to your version of the file(s), but you are not obligated to do + * certain conditions as described in each individual source file, and + * distribute linked combinations including the two. You must obey the GNU + * General Public License in all respects for all of the code used other than + * OpenSSL. If you modify file(s) with this exception, you may extend this + * exception to your version of the file(s), but you are not obligated to do * so. If you do not wish to do so, delete this exception statement from your - * version. If you delete this exception statement from all source files in + * version. If you delete this exception statement from all source files in * the program, then also delete it here. - * + * * SLURM is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. - * + * * You should have received a copy of the GNU General Public License along * with SLURM; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. @@ -51,8 +51,8 @@ #include "src/common/xstring.h" /* - * Define slurm-specific aliases for use by plugins, see slurm_xlator.h - * for details. + * Define slurm-specific aliases for use by plugins, see slurm_xlator.h + * for details. */ strong_alias(bit_alloc, slurm_bit_alloc); strong_alias(bit_test, slurm_bit_test); @@ -95,7 +95,7 @@ strong_alias(bit_copybits, slurm_bit_copybits); strong_alias(bit_get_bit_num, slurm_bit_get_bit_num); strong_alias(bit_get_pos_num, slurm_bit_get_pos_num); -/* +/* * Allocate a bitstring. * nbits (IN) valid bits in new bitstring, initialized to all clear * RETURN new bitstring @@ -113,9 +113,9 @@ bit_alloc(bitoff_t nbits) return new; } -/* +/* * Reallocate a bitstring (expand or contract size). - * b (IN) pointer to old bitstring + * b (IN) pointer to old bitstring * nbits (IN) valid bits in new bitstr * RETURN new bitstring */ @@ -124,7 +124,7 @@ bit_realloc(bitstr_t *b, bitoff_t nbits) { bitoff_t obits; bitstr_t *new = NULL; - + _assert_bitstr_valid(b); obits = _bitstr_bits(b); new = realloc(b, _bitstr_words(nbits) * sizeof(bitstr_t)); @@ -137,10 +137,10 @@ bit_realloc(bitstr_t *b, bitoff_t nbits) return new; } -/* +/* * Free a bitstr. * b (IN/OUT) bitstr to be freed - */ + */ void bit_free(bitstr_t *b) { @@ -162,8 +162,8 @@ bit_size(bitstr_t *b) return _bitstr_bits(b); } -/* - * Is bit N of bitstring b set? +/* + * Is bit N of bitstring b set? * b (IN) bitstring to test * bit (IN) bit position to test * RETURN 1 if bit set, 0 if clear @@ -176,7 +176,7 @@ bit_test(bitstr_t *b, bitoff_t bit) return ((b[_bit_word(bit)] & _bit_mask(bit)) ? 1 : 0); } -/* +/* * Set bit N of bitstring. * b (IN) target bitstring * bit (IN) bit position to set @@ -189,7 +189,7 @@ bit_set(bitstr_t *b, bitoff_t bit) b[_bit_word(bit)] |= _bit_mask(bit); } -/* +/* * Clear bit N of bitstring * b (IN) target bitstring * bit (IN) bit position to clear @@ -202,7 +202,7 @@ bit_clear(bitstr_t *b, bitoff_t bit) b[_bit_word(bit)] &= ~_bit_mask(bit); } -/* +/* * Set bits start ... stop in bitstring * b (IN) target bitstring * start (IN) starting (low numbered) bit position @@ -225,7 +225,7 @@ bit_nset(bitstr_t *b, bitoff_t start, bitoff_t stop) } } -/* +/* * Clear bits start ... stop in bitstring * b (IN) target bitstring * start (IN) starting (low numbered) bit position @@ -248,7 +248,7 @@ bit_nclear(bitstr_t *b, bitoff_t start, bitoff_t stop) } } -/* +/* * Find first bit clear in bitstring. * b (IN) bitstring to search * nbits (IN) number of bits to search @@ -388,12 +388,12 @@ bit_nffs(bitstr_t *b, int n) return value; } -/* +/* * Find first bit set in b. * b (IN) bitstring to search * RETURN resulting bit position (-1 if none found) */ -bitoff_t +bitoff_t bit_ffs(bitstr_t *b) { bitoff_t bit = 0, value = -1; @@ -418,12 +418,12 @@ bit_ffs(bitstr_t *b) return value; } -/* +/* * Find last bit set in b. * b (IN) bitstring to search * RETURN resulting bit position (-1 if none found) */ -bitoff_t +bitoff_t bit_fls(bitstr_t *b) { bitoff_t bit, value = -1; @@ -435,7 +435,7 @@ bit_fls(bitstr_t *b) return -1; bit = _bitstr_bits(b) - 1; /* zero origin */ - + while (bit >= 0 && /* test partitial words */ (_bit_word(bit) == _bit_word(bit + 1))) { if (bit_test(b, bit)) { @@ -461,8 +461,8 @@ bit_fls(bitstr_t *b) return value; } -/* - * set all bits between the first and last bits set (i.e. fill in the gaps +/* + * set all bits between the first and last bits set (i.e. fill in the gaps * to make set bits contiguous) */ void @@ -493,7 +493,7 @@ bit_super_set(bitstr_t *b1, bitstr_t *b2) { assert(_bitstr_bits(b1) == _bitstr_bits(b2)); for (bit = 0; bit < _bitstr_bits(b1); bit += sizeof(bitstr_t)*8) { - if (b1[_bit_word(bit)] != (b1[_bit_word(bit)] & + if (b1[_bit_word(bit)] != (b1[_bit_word(bit)] & b2[_bit_word(bit)])) return 0; } @@ -542,7 +542,7 @@ bit_and(bitstr_t *b1, bitstr_t *b2) { b1[_bit_word(bit)] &= b2[_bit_word(bit)]; } -/* +/* * b1 = ~b1 one's complement * b1 (IN/OUT) first bitmap */ @@ -556,7 +556,7 @@ bit_not(bitstr_t *b) { b[_bit_word(bit)] = ~b[_bit_word(bit)]; } -/* +/* * b1 |= b2 * b1 (IN/OUT) first bitmap * b2 (IN) second bitmap @@ -575,7 +575,7 @@ bit_or(bitstr_t *b1, bitstr_t *b2) { -/* +/* * return a copy of the supplied bitmap */ bitstr_t * @@ -618,7 +618,7 @@ static uint32_t hweight(uint32_t w) { uint32_t res; - + res = (w & 0x55555555) + ((w >> 1) & 0x55555555); res = (res & 0x33333333) + ((res >> 2) & 0x33333333); res = (res & 0x0F0F0F0F) + ((res >> 4) & 0x0F0F0F0F); @@ -635,7 +635,7 @@ static uint64_t hweight(uint64_t w) { uint64_t res; - + res = (w & 0x5555555555555555) + ((w >> 1) & 0x5555555555555555); res = (res & 0x3333333333333333) + ((res >> 2) & 0x3333333333333333); res = (res & 0x0F0F0F0F0F0F0F0F) + ((res >> 4) & 0x0F0F0F0F0F0F0F0F); @@ -650,7 +650,7 @@ hweight(uint64_t w) /* * Count the number of bits set in bitstring. * b (IN) bitstring to check - * RETURN count of set bits + * RETURN count of set bits */ int bit_set_count(bitstr_t *b) @@ -706,7 +706,7 @@ bit_overlap(bitstr_t *b1, bitstr_t *b2) /* * Count the number of bits clear in bitstring. * b (IN) bitstring to check - * RETURN count of clear bits + * RETURN count of clear bits */ int bit_clear_count(bitstr_t *b) @@ -769,7 +769,7 @@ int_and_set_count(int *i1, int ilen, bitstr_t *b2) { return(sum); } -/* +/* * rotate b1 by n bits returning a rotated copy * b1 (IN) bitmap to rotate * n (IN) rotation distance (+ = rotate left, - = rotate right) @@ -816,7 +816,7 @@ bit_rotate_copy(bitstr_t *b1, int n, bitoff_t nbits) { return(new); } -/* +/* * rotate b1 by n bits * b1 (IN/OUT) bitmap to rotate * n (IN) rotation distance (+ = rotate left, - = rotate right) @@ -864,7 +864,7 @@ bit_pick_cnt(bitstr_t *b, bitoff_t nbits) { } new_bits = hweight(b[word]); - if (((count + new_bits) <= nbits) && + if (((count + new_bits) <= nbits) && ((bit + word_size - 1) < _bitstr_bits(b))) { new[word] = b[word]; count += new_bits; @@ -887,7 +887,7 @@ bit_pick_cnt(bitstr_t *b, bitoff_t nbits) { return new; } -/* +/* * XXX the relationship between stdint types and "unsigned [long] long" * types is architecture/compiler dependent, so this may have to be tweaked. */ @@ -926,11 +926,11 @@ bit_fmt(char *str, int len, bitstr_t *b) count++; } if (bit == start) /* add single bit position */ - ret = snprintf(str+strlen(str), + ret = snprintf(str+strlen(str), len-strlen(str), BITSTR_SINGLE_FMT, start); else /* add bit position range */ - ret = snprintf(str+strlen(str), + ret = snprintf(str+strlen(str), len-strlen(str), BITSTR_RANGE_FMT, start, bit); assert(ret != -1); @@ -951,13 +951,13 @@ bit_fmt(char *str, int len, bitstr_t *b) int bit_unfmt(bitstr_t *b, char *str) { - int *intvec, rc = 0; + int *intvec, rc = 0; _assert_bitstr_valid(b); if (str[0] == '\0') /* no bits set */ return rc; intvec = bitfmt2int(str); - if (intvec == NULL) + if (intvec == NULL) return -1; rc = inx2bitstr(b, intvec); xfree(intvec); @@ -965,22 +965,22 @@ bit_unfmt(bitstr_t *b, char *str) } /* - * bitfmt2int - convert a string describing bitmap (output from bit_fmt, - * e.g. "0-30,45,50-60") into an array of integer (start/end) pairs + * bitfmt2int - convert a string describing bitmap (output from bit_fmt, + * e.g. "0-30,45,50-60") into an array of integer (start/end) pairs * terminated by -1 (e.g. "0, 30, 45, 45, 50, 60, -1") * input: bitmap string as produced by bitstring.c : bitfmt * output: an array of integers * NOTE: the caller must xfree the returned memory */ int * -bitfmt2int (char *bit_str_ptr) +bitfmt2int (char *bit_str_ptr) { int *bit_int_ptr, i, bit_inx, size, sum, start_val; - if (bit_str_ptr == NULL) + if (bit_str_ptr == NULL) return NULL; size = strlen (bit_str_ptr) + 1; - bit_int_ptr = xmalloc ( sizeof (int) * + bit_int_ptr = xmalloc ( sizeof (int) * (size * 2 + 1)); /* more than enough space */ bit_inx = sum = 0; @@ -996,7 +996,7 @@ bitfmt2int (char *bit_str_ptr) sum = 0; } - else if (bit_str_ptr[i] == ',' || + else if (bit_str_ptr[i] == ',' || bit_str_ptr[i] == '\0') { if (i == 0) break; @@ -1016,20 +1016,20 @@ bitfmt2int (char *bit_str_ptr) /* * intbitfmt - convert a array of interger (start/end) pairs * terminated by -1 (e.g. "0, 30, 45, 45, 50, 60, -1") to a - * string describing bitmap (output from bit_fmt, e.g. "0-30,45,50-60") + * string describing bitmap (output from bit_fmt, e.g. "0-30,45,50-60") * input: int array * output: char * * NOTE: the caller must xfree the returned memory */ char * -inx2bitfmt (int *inx) +inx2bitfmt (int *inx) { int j=0; char *bit_char_ptr = NULL; - if (inx == NULL) + if (inx == NULL) return NULL; - + while (inx[j] >= 0) { if(bit_char_ptr) xstrfmtcat(bit_char_ptr, ",%d-%d", inx[j], inx[j+1]); @@ -1041,10 +1041,10 @@ inx2bitfmt (int *inx) return bit_char_ptr; } -int inx2bitstr(bitstr_t *b, int *inx) +int inx2bitstr(bitstr_t *b, int *inx) { int *p, rc=0; - + assert(b); assert(inx); @@ -1055,7 +1055,7 @@ int inx2bitstr(bitstr_t *b, int *inx) rc = -1; break; } - bit_nset(b, *p, *(p + 1)); + bit_nset(b, *p, *(p + 1)); } return rc; } @@ -1082,8 +1082,8 @@ char * bit_fmt_hexmask(bitstr_t * bitmap) retstr = xmalloc(charsize + 3); - retstr[0] = '0'; - retstr[1] = 'x'; + retstr[0] = '0'; + retstr[1] = 'x'; retstr[charsize + 2] = '\0'; ptr = &retstr[charsize + 1]; for (i=0; i < bitsize;) { @@ -1112,7 +1112,7 @@ char * bit_fmt_hexmask(bitstr_t * bitmap) * bitmap (OUT) bitmap to update * str (IN) hex mask string to unformat */ -int bit_unfmt_hexmask(bitstr_t * bitmap, const char* str) +int bit_unfmt_hexmask(bitstr_t * bitmap, const char* str) { int bit_index = 0, len = strlen(str); int rc = 0; @@ -1126,7 +1126,7 @@ int bit_unfmt_hexmask(bitstr_t * bitmap, const char* str) } while(curpos >= str) { - current = (int) *curpos; + current = (int) *curpos; if (isxdigit(current)) { /* valid hex digit */ if (isdigit(current)) { current -= '0'; @@ -1142,7 +1142,7 @@ int bit_unfmt_hexmask(bitstr_t * bitmap, const char* str) if ((current & 1) && (bit_index < bitsize)) bit_set(bitmap, bit_index); if ((current & 2) && (bit_index+1 < bitsize)) - bit_set(bitmap, bit_index+1); + bit_set(bitmap, bit_index+1); if ((current & 4) && (bit_index+2 < bitsize)) bit_set(bitmap, bit_index+2); if ((current & 8) && (bit_index+3 < bitsize)) @@ -1197,7 +1197,7 @@ char * bit_fmt_binmask(bitstr_t * bitmap) * bitmap (OUT) bitmap to update * str (IN) hex mask string to unformat */ -int bit_unfmt_binmask(bitstr_t * bitmap, const char* str) +int bit_unfmt_binmask(bitstr_t * bitmap, const char* str) { int bit_index = 0, len = strlen(str); const char *curpos = str + len - 1; @@ -1205,7 +1205,7 @@ int bit_unfmt_binmask(bitstr_t * bitmap, const char* str) bitoff_t bitsize = bit_size(bitmap); while(curpos >= str) { - current = (int) *curpos; + current = (int) *curpos; current -= '0'; if ((current & 1) && (bit_index < bitsize)) bit_set(bitmap, bit_index); @@ -1228,7 +1228,7 @@ bit_get_bit_num(bitstr_t *b, int pos) bitoff_t bit; int cnt = 0; bitoff_t bit_cnt; - + _assert_bitstr_valid(b); bit_cnt = _bitstr_bits(b); assert(pos <= bit_cnt); @@ -1236,8 +1236,8 @@ bit_get_bit_num(bitstr_t *b, int pos) for (bit = 0; bit < bit_cnt; bit++) { if (bit_test(b, bit)) { /* we got one */ if(cnt == pos) - break; - cnt++; + break; + cnt++; } } @@ -1259,18 +1259,18 @@ bit_get_pos_num(bitstr_t *b, bitoff_t pos) bitoff_t bit; int cnt = -1; bitoff_t bit_cnt; - + _assert_bitstr_valid(b); bit_cnt = _bitstr_bits(b); assert(pos <= bit_cnt); - + if (!bit_test(b, pos)) { error("bit %d not set", pos); return cnt; } for (bit = 0; bit <= pos; bit++) { if (bit_test(b, bit)) { /* we got one */ - cnt++; + cnt++; } } diff --git a/src/common/bitstring.h b/src/common/bitstring.h index 386a6a6631..b1a739bfbd 100644 --- a/src/common/bitstring.h +++ b/src/common/bitstring.h @@ -2,51 +2,51 @@ * bitstring.h - definitions for bitstring.c, bitmap manipulation functions ***************************************************************************** * Reimplementation of the functionality of Paul Vixie's bitstring.h macros - * from his cron package and later contributed to 4.4BSD. Little remains, + * from his cron package and later contributed to 4.4BSD. Little remains, * though interface semantics are preserved in functions noted below. * * Copyright (C) 2002 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Jim Garlick , Morris Jette * CODE-OCEC-09-009. All rights reserved. - * + * * This file is part of SLURM, a resource management program. * For details, see . * Please also read the included file: DISCLAIMER. - * + * * SLURM is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free * Software Foundation; either version 2 of the License, or (at your option) * any later version. * - * In addition, as a special exception, the copyright holders give permission + * In addition, as a special exception, the copyright holders give permission * to link the code of portions of this program with the OpenSSL library under - * certain conditions as described in each individual source file, and - * distribute linked combinations including the two. You must obey the GNU - * General Public License in all respects for all of the code used other than - * OpenSSL. If you modify file(s) with this exception, you may extend this - * exception to your version of the file(s), but you are not obligated to do + * certain conditions as described in each individual source file, and + * distribute linked combinations including the two. You must obey the GNU + * General Public License in all respects for all of the code used other than + * OpenSSL. If you modify file(s) with this exception, you may extend this + * exception to your version of the file(s), but you are not obligated to do * so. If you do not wish to do so, delete this exception statement from your - * version. If you delete this exception statement from all source files in + * version. If you delete this exception statement from all source files in * the program, then also delete it here. - * + * * SLURM is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. - * + * * You should have received a copy of the GNU General Public License along * with SLURM; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. \*****************************************************************************/ /* - * A bitstr_t is an array of configurable size words. The first two words - * are for internal use. Word 0 is a magic cookie used to validate that the - * bitstr_t is properly initialized. Word 1 is the number of valid bits in + * A bitstr_t is an array of configurable size words. The first two words + * are for internal use. Word 0 is a magic cookie used to validate that the + * bitstr_t is properly initialized. Word 1 is the number of valid bits in * the bitstr_t This limts the capacity of a bitstr_t to 4 gigabits if using * 32 bit words. - * + * * bitstrings are zero origin * * bitstrings are always stored in a little-endian fashion. In other words, @@ -84,19 +84,19 @@ typedef int32_t bitstr_t; typedef bitstr_t bitoff_t; -/* - * internal macros / defs +/* + * internal macros / defs */ /* 2 words used for magic cookie and size */ -#define BITSTR_OVERHEAD 2 +#define BITSTR_OVERHEAD 2 /* bitstr_t signature in first word */ #define BITSTR_MAGIC 0x42434445 #define BITSTR_MAGIC_STACK 0x42434446 /* signature if on stack */ /* max bit position in word */ -#define BITSTR_MAXPOS (sizeof(bitstr_t)*8 - 1) +#define BITSTR_MAXPOS (sizeof(bitstr_t)*8 - 1) /* word of the bitstring bit is in */ #define _bit_word(bit) (((bit) >> BITSTR_SHIFT) + BITSTR_OVERHEAD) @@ -135,8 +135,8 @@ typedef bitstr_t bitoff_t; assert((bit) < _bitstr_bits(name)); \ } while (0) -/* - * external macros +/* + * external macros */ /* allocate a bitstring on the stack */ diff --git a/src/common/checkpoint.c b/src/common/checkpoint.c index 8751148e30..8c010fa51d 100644 --- a/src/common/checkpoint.c +++ b/src/common/checkpoint.c @@ -7,32 +7,32 @@ * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Morris Jette * CODE-OCEC-09-009. All rights reserved. - * + * * This file is part of SLURM, a resource management program. * For details, see . * Please also read the included file: DISCLAIMER. - * + * * SLURM is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free * Software Foundation; either version 2 of the License, or (at your option) * any later version. * - * In addition, as a special exception, the copyright holders give permission - * to link the code of portions of this program with the OpenSSL library under - * certain conditions as described in each individual source file, and - * distribute linked combinations including the two. You must obey the GNU - * General Public License in all respects for all of the code used other than - * OpenSSL. If you modify file(s) with this exception, you may extend this - * exception to your version of the file(s), but you are not obligated to do + * In addition, as a special exception, the copyright holders give permission + * to link the code of portions of this program with the OpenSSL library under + * certain conditions as described in each individual source file, and + * distribute linked combinations including the two. You must obey the GNU + * General Public License in all respects for all of the code used other than + * OpenSSL. If you modify file(s) with this exception, you may extend this + * exception to your version of the file(s), but you are not obligated to do * so. If you do not wish to do so, delete this exception statement from your - * version. If you delete this exception statement from all source files in + * version. If you delete this exception statement from all source files in * the program, then also delete it here. - * + * * SLURM is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. - * + * * You should have received a copy of the GNU General Public License along * with SLURM; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. @@ -55,17 +55,17 @@ /* * WARNING: Do not change the order of these fields or add additional * fields at the beginning of the structure. If you do, job completion - * logging plugins will stop working. If you need to add fields, add them + * logging plugins will stop working. If you need to add fields, add them * at the end of the structure. */ typedef struct slurm_checkpoint_ops { - int (*ckpt_op) (uint32_t job_id, uint32_t step_id, + int (*ckpt_op) (uint32_t job_id, uint32_t step_id, struct step_record *step_ptr, uint16_t op, uint16_t data, char *image_dir, time_t *event_time, uint32_t *error_code, char **error_msg); int (*ckpt_comp) (struct step_record * step_ptr, time_t event_time, uint32_t error_code, char *error_msg); - int (*ckpt_task_comp) (struct step_record * step_ptr, + int (*ckpt_task_comp) (struct step_record * step_ptr, uint32_t task_id, time_t event_time, uint32_t error_code, char *error_msg); @@ -114,12 +114,12 @@ _slurm_checkpoint_context_create( const char *checkpoint_type ) if ( c->checkpoint_type == NULL ) { debug3( "can't make local copy of checkpoint type" ); xfree( c ); - return NULL; + return NULL; } /* Plugin rack is demand-loaded on first reference. */ - c->plugin_list = NULL; - c->cur_plugin = PLUGIN_INVALID_HANDLE; + c->plugin_list = NULL; + c->cur_plugin = PLUGIN_INVALID_HANDLE; return c; } @@ -173,13 +173,13 @@ _slurm_checkpoint_get_ops( slurm_checkpoint_context_t c ) /* Find the correct plugin. */ c->cur_plugin = plugin_load_and_link(c->checkpoint_type, n_syms, syms, (void **) &c->ops); - if ( c->cur_plugin != PLUGIN_INVALID_HANDLE ) + if ( c->cur_plugin != PLUGIN_INVALID_HANDLE ) return &c->ops; error("Couldn't find the specified plugin name for %s " "looking at all files", c->checkpoint_type); - + /* Get the plugin list, if needed. */ if ( c->plugin_list == NULL ) { char *plugin_dir; @@ -190,21 +190,21 @@ _slurm_checkpoint_get_ops( slurm_checkpoint_context_t c ) } plugrack_set_major_type( c->plugin_list, "checkpoint" ); - plugrack_set_paranoia( c->plugin_list, - PLUGRACK_PARANOIA_NONE, + plugrack_set_paranoia( c->plugin_list, + PLUGRACK_PARANOIA_NONE, 0 ); plugin_dir = slurm_get_plugin_dir(); plugrack_read_dir( c->plugin_list, plugin_dir ); xfree(plugin_dir); } - + /* Find the correct plugin. */ - c->cur_plugin = + c->cur_plugin = plugrack_use_by_type( c->plugin_list, c->checkpoint_type ); if ( c->cur_plugin == PLUGIN_INVALID_HANDLE ) { error( "can't find a plugin for type %s", c->checkpoint_type ); return NULL; - } + } /* Dereference the API. */ if ( plugin_get_syms( c->cur_plugin, @@ -267,7 +267,7 @@ checkpoint_fini(void) /* perform some checkpoint operation */ extern int -checkpoint_op(uint32_t job_id, uint32_t step_id, +checkpoint_op(uint32_t job_id, uint32_t step_id, void *step_ptr, uint16_t op, uint16_t data, char *image_dir, time_t *event_time, uint32_t *error_code, char **error_msg) @@ -277,9 +277,9 @@ checkpoint_op(uint32_t job_id, uint32_t step_id, slurm_mutex_lock( &context_lock ); if ( g_context ) { retval = (*(g_context->ops.ckpt_op))( - job_id, step_id, + job_id, step_id, (struct step_record *) step_ptr, - op, data, image_dir, + op, data, image_dir, event_time, error_code, error_msg); } else { error ("slurm_checkpoint plugin context not initialized"); @@ -317,7 +317,7 @@ checkpoint_task_comp(void * step_ptr, uint32_t task_id, time_t event_time, slurm_mutex_lock( &context_lock ); if ( g_context ) retval = (*(g_context->ops.ckpt_task_comp))( - (struct step_record *) step_ptr, task_id, + (struct step_record *) step_ptr, task_id, event_time, error_code, error_msg); else { error ("slurm_checkpoint plugin context not initialized"); @@ -431,7 +431,7 @@ extern int checkpoint_restart_task (void *job, char *image_dir, int gtid) slurm_mutex_lock( &context_lock ); if ( g_context ) { - retval = (*(g_context->ops.ckpt_restart_task))(job, image_dir, + retval = (*(g_context->ops.ckpt_restart_task))(job, image_dir, gtid); } else { error ("slurm_checkpoint plugin context not initialized"); @@ -441,8 +441,8 @@ extern int checkpoint_restart_task (void *job, char *image_dir, int gtid) return retval; } -extern int checkpoint_tasks (uint32_t job_id, uint32_t step_id, - time_t begin_time, char *image_dir, +extern int checkpoint_tasks (uint32_t job_id, uint32_t step_id, + time_t begin_time, char *image_dir, uint16_t wait, char *nodelist) { int rc = SLURM_SUCCESS, temp_rc; diff --git a/src/common/checkpoint.h b/src/common/checkpoint.h index 13b39a98d2..d65c22f335 100644 --- a/src/common/checkpoint.h +++ b/src/common/checkpoint.h @@ -1,5 +1,5 @@ /*****************************************************************************\ - * checkpoint.h - implementation-independent checkpoint API definitions. + * checkpoint.h - implementation-independent checkpoint API definitions. * $Id$ ***************************************************************************** * Copyright (C) 2004-2007 The Regents of the University of California. @@ -7,32 +7,32 @@ * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Morris Jette * CODE-OCEC-09-009. All rights reserved. - * + * * This file is part of SLURM, a resource management program. * For details, see . * Please also read the included file: DISCLAIMER. - * + * * SLURM is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free * Software Foundation; either version 2 of the License, or (at your option) * any later version. * - * In addition, as a special exception, the copyright holders give permission - * to link the code of portions of this program with the OpenSSL library under - * certain conditions as described in each individual source file, and - * distribute linked combinations including the two. You must obey the GNU - * General Public License in all respects for all of the code used other than - * OpenSSL. If you modify file(s) with this exception, you may extend this - * exception to your version of the file(s), but you are not obligated to do + * In addition, as a special exception, the copyright holders give permission + * to link the code of portions of this program with the OpenSSL library under + * certain conditions as described in each individual source file, and + * distribute linked combinations including the two. You must obey the GNU + * General Public License in all respects for all of the code used other than + * OpenSSL. If you modify file(s) with this exception, you may extend this + * exception to your version of the file(s), but you are not obligated to do * so. If you do not wish to do so, delete this exception statement from your - * version. If you delete this exception statement from all source files in + * version. If you delete this exception statement from all source files in * the program, then also delete it here. - * + * * SLURM is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. - * + * * You should have received a copy of the GNU General Public License along * with SLURM; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. @@ -51,7 +51,7 @@ enum check_opts { CHECK_ABLE, /* able to checkpoint now */ CHECK_DISABLE, /* disable checkpointing */ CHECK_ENABLE, /* enable checkpointing */ - CHECK_CREATE, /* create a checkpoint for this job, + CHECK_CREATE, /* create a checkpoint for this job, * job continues execution afterwards */ CHECK_VACATE, /* create a checkpoint for this job, * job terminates afterwards */ @@ -73,7 +73,7 @@ extern int checkpoint_init(char *checkpoint_type); extern int checkpoint_fini(void); /* perform many checkpoint operation on job/step */ -extern int checkpoint_op(uint32_t job_id, uint32_t step_id, +extern int checkpoint_op(uint32_t job_id, uint32_t step_id, void *step_ptr, uint16_t op, uint16_t data, char *image_dir, time_t *event_time, uint32_t *error_code, char **error_msg); @@ -82,11 +82,11 @@ extern int checkpoint_op(uint32_t job_id, uint32_t step_id, extern int checkpoint_comp(void * step_ptr, time_t event_time, uint32_t error_code, char *error_msg); -extern int checkpoint_task_comp(void * step_ptr, uint32_t task_id, +extern int checkpoint_task_comp(void * step_ptr, uint32_t task_id, time_t event_time, uint32_t error_code, char *error_msg); /* gather checkpoint error info */ -extern int checkpoint_error(void * step_ptr, +extern int checkpoint_error(void * step_ptr, uint16_t *ckpt_errno, char **ckpt_strerror); /* allocate and initialize a job step's checkpoint context */ @@ -109,8 +109,8 @@ extern int checkpoint_signal_tasks (void *slurmd_job, char *image_dir); extern int checkpoint_restart_task(void *slurmd_job, char *image_dir, int gtid); /* send checkpoint request to specified job/step */ -extern int checkpoint_tasks (uint32_t job_id, uint32_t step_id, - time_t begin_time, char *image_dir, +extern int checkpoint_tasks (uint32_t job_id, uint32_t step_id, + time_t begin_time, char *image_dir, uint16_t wait, char *nodelist); #endif /*_HAVE_SLURM_CHECKPOINT_H__*/ diff --git a/src/common/daemonize.c b/src/common/daemonize.c index 0dd23427b7..dc35c7639f 100644 --- a/src/common/daemonize.c +++ b/src/common/daemonize.c @@ -6,32 +6,32 @@ * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Mark A. Grondona . * CODE-OCEC-09-009. All rights reserved. - * + * * This file is part of SLURM, a resource management program. * For details, see . * Please also read the included file: DISCLAIMER. - * + * * SLURM is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free * Software Foundation; either version 2 of the License, or (at your option) * any later version. * - * In addition, as a special exception, the copyright holders give permission + * In addition, as a special exception, the copyright holders give permission * to link the code of portions of this program with the OpenSSL library under - * certain conditions as described in each individual source file, and - * distribute linked combinations including the two. You must obey the GNU - * General Public License in all respects for all of the code used other than - * OpenSSL. If you modify file(s) with this exception, you may extend this - * exception to your version of the file(s), but you are not obligated to do + * certain conditions as described in each individual source file, and + * distribute linked combinations including the two. You must obey the GNU + * General Public License in all respects for all of the code used other than + * OpenSSL. If you modify file(s) with this exception, you may extend this + * exception to your version of the file(s), but you are not obligated to do * so. If you do not wish to do so, delete this exception statement from your - * version. If you delete this exception statement from all source files in + * version. If you delete this exception statement from all source files in * the program, then also delete it here. - * + * * SLURM is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. - * + * * You should have received a copy of the GNU General Public License along * with SLURM; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. @@ -57,7 +57,7 @@ closeall(int fd) { int fdlimit = sysconf(_SC_OPEN_MAX); - while (fd < fdlimit) + while (fd < fdlimit) close(fd++); } @@ -99,7 +99,7 @@ daemon(int nochdir, int noclose) dup2(0, STDOUT_FILENO); dup2(0, STDERR_FILENO); } else { - /* + /* * Otherwise, dup stdin, stdout, and stderr onto /dev/null */ int devnull = open("/dev/null", O_RDWR); @@ -133,10 +133,10 @@ read_pidfile(const char *pidfile, int *pidfd) unsigned long pid; pid_t lpid; - if ((fd = open(pidfile, O_RDONLY)) < 0) + if ((fd = open(pidfile, O_RDONLY)) < 0) return ((pid_t) 0); - if (!(fp = fdopen(fd, "r")) && (errno != ENOENT)) + if (!(fp = fdopen(fd, "r")) && (errno != ENOENT)) error ("Unable to access old pidfile at `%s': %m", pidfile); if (fscanf(fp, "%lu", &pid) < 1) { @@ -151,13 +151,13 @@ read_pidfile(const char *pidfile, int *pidfd) return ((pid_t) 0); } - if (lpid != (pid_t) pid) + if (lpid != (pid_t) pid) fatal ("pidfile locked by %lu but contains pid=%lu", (unsigned long) lpid, (unsigned long) pid); if (pidfd != NULL) *pidfd = fd; - else + else (void) close(fd); return (lpid); @@ -191,7 +191,7 @@ create_pidfile(const char *pidfile) } fflush(fp); - + return (fileno(fp)); error: @@ -200,7 +200,7 @@ create_pidfile(const char *pidfile) return -1; } -void +void test_core_limit(void) { #ifdef RLIMIT_CORE @@ -210,7 +210,7 @@ test_core_limit(void) else if (rlim->rlim_cur != RLIM_INFINITY) { rlim->rlim_cur /= 1024; /* bytes to KB */ if (rlim->rlim_cur < 2048) { - verbose("Warning: Core limit is only %u KB", + verbose("Warning: Core limit is only %u KB", rlim->rlim_cur); } } diff --git a/src/common/daemonize.h b/src/common/daemonize.h index 1d8bb8cd11..b0ad174b2e 100644 --- a/src/common/daemonize.h +++ b/src/common/daemonize.h @@ -6,32 +6,32 @@ * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Mark Grondona . * CODE-OCEC-09-009. All rights reserved. - * + * * This file is part of SLURM, a resource management program. * For details, see . * Please also read the included file: DISCLAIMER. - * + * * SLURM is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free * Software Foundation; either version 2 of the License, or (at your option) * any later version. * - * In addition, as a special exception, the copyright holders give permission + * In addition, as a special exception, the copyright holders give permission * to link the code of portions of this program with the OpenSSL library under - * certain conditions as described in each individual source file, and - * distribute linked combinations including the two. You must obey the GNU - * General Public License in all respects for all of the code used other than - * OpenSSL. If you modify file(s) with this exception, you may extend this - * exception to your version of the file(s), but you are not obligated to do + * certain conditions as described in each individual source file, and + * distribute linked combinations including the two. You must obey the GNU + * General Public License in all respects for all of the code used other than + * OpenSSL. If you modify file(s) with this exception, you may extend this + * exception to your version of the file(s), but you are not obligated to do * so. If you do not wish to do so, delete this exception statement from your - * version. If you delete this exception statement from all source files in + * version. If you delete this exception statement from all source files in * the program, then also delete it here. - * + * * SLURM is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. - * + * * You should have received a copy of the GNU General Public License along * with SLURM; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. diff --git a/src/common/eio.c b/src/common/eio.c index d10c41915e..af98c7ca00 100644 --- a/src/common/eio.c +++ b/src/common/eio.c @@ -5,39 +5,39 @@ * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Mark Grondona . * CODE-OCEC-09-009. All rights reserved. - * + * * This file is part of SLURM, a resource management program. * For details, see . * Please also read the included file: DISCLAIMER. - * + * * SLURM is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free * Software Foundation; either version 2 of the License, or (at your option) * any later version. * - * In addition, as a special exception, the copyright holders give permission - * to link the code of portions of this program with the OpenSSL library under - * certain conditions as described in each individual source file, and - * distribute linked combinations including the two. You must obey the GNU - * General Public License in all respects for all of the code used other than - * OpenSSL. If you modify file(s) with this exception, you may extend this - * exception to your version of the file(s), but you are not obligated to do + * In addition, as a special exception, the copyright holders give permission + * to link the code of portions of this program with the OpenSSL library under + * certain conditions as described in each individual source file, and + * distribute linked combinations including the two. You must obey the GNU + * General Public License in all respects for all of the code used other than + * OpenSSL. If you modify file(s) with this exception, you may extend this + * exception to your version of the file(s), but you are not obligated to do * so. If you do not wish to do so, delete this exception statement from your - * version. If you delete this exception statement from all source files in + * version. If you delete this exception statement from all source files in * the program, then also delete it here. - * + * * SLURM is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. - * + * * You should have received a copy of the GNU General Public License along * with SLURM; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. \*****************************************************************************/ #if HAVE_CONFIG_H # include -#endif +#endif #include #include @@ -124,7 +124,7 @@ bool eio_message_socket_readable(eio_obj_t *obj) } return false; } - return true; + return true; } int eio_message_socket_accept(eio_obj_t *obj, List objs) @@ -191,7 +191,7 @@ cleanup: int eio_signal_shutdown(eio_handle_t *eio) { char c = 1; - if (write(eio->fds[1], &c, sizeof(char)) != 1) + if (write(eio->fds[1], &c, sizeof(char)) != 1) return error("eio_handle_signal_shutdown: write; %m"); return 0; } @@ -199,7 +199,7 @@ int eio_signal_shutdown(eio_handle_t *eio) int eio_signal_wakeup(eio_handle_t *eio) { char c = 0; - if (write(eio->fds[1], &c, sizeof(char)) != 1) + if (write(eio->fds[1], &c, sizeof(char)) != 1) return error("eio_handle_signal_wake: write; %m"); return 0; } @@ -256,15 +256,15 @@ int eio_handle_mainloop(eio_handle_t *eio) maxnfds = n; xrealloc(pollfds, (maxnfds+1) * sizeof(struct pollfd)); xrealloc(map, maxnfds * sizeof(eio_obj_t * )); - /* - * Note: xrealloc() also handles initial malloc + /* + * Note: xrealloc() also handles initial malloc */ } - debug4("eio: handling events for %d objects", + debug4("eio: handling events for %d objects", list_count(eio->obj_list)); nfds = _poll_setup_pollfds(pollfds, map, eio->obj_list); - if (nfds <= 0) + if (nfds <= 0) goto done; /* @@ -279,7 +279,7 @@ int eio_handle_mainloop(eio_handle_t *eio) if (_poll_internal(pollfds, nfds) < 0) goto error; - if (pollfds[nfds-1].revents & POLLIN) + if (pollfds[nfds-1].revents & POLLIN) _eio_wakeup_handler(eio); _poll_dispatch(pollfds, nfds-1, map, eio->obj_list); @@ -288,14 +288,14 @@ int eio_handle_mainloop(eio_handle_t *eio) retval = -1; done: xfree(pollfds); - xfree(map); + xfree(map); return retval; } static int _poll_internal(struct pollfd *pfds, unsigned int nfds) -{ - int n; +{ + int n; while ((n = poll(pfds, nfds, -1)) < 0) { switch (errno) { case EINTR : return 0; @@ -353,7 +353,7 @@ _poll_setup_pollfds(struct pollfd *pfds, eio_obj_t *map[], List l) } static void -_poll_dispatch(struct pollfd *pfds, unsigned int nfds, eio_obj_t *map[], +_poll_dispatch(struct pollfd *pfds, unsigned int nfds, eio_obj_t *map[], List objList) { int i; @@ -475,7 +475,7 @@ void eio_new_initial_obj(eio_handle_t *eio, eio_obj_t *obj) { xassert(eio != NULL); xassert(eio->magic == EIO_MAGIC); - + list_enqueue(eio->obj_list, obj); } diff --git a/src/common/eio.h b/src/common/eio.h index 549e5e9304..2db2beb492 100644 --- a/src/common/eio.h +++ b/src/common/eio.h @@ -5,21 +5,21 @@ * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Mark Grondona . * CODE-OCEC-09-009. All rights reserved. - * + * * This file is part of SLURM, a resource management program. * For details, see . * Please also read the included file: DISCLAIMER. - * + * * SLURM is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free * Software Foundation; either version 2 of the License, or (at your option) * any later version. - * + * * SLURM is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. - * + * * You should have received a copy of the GNU General Public License along * with SLURM; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. @@ -52,8 +52,8 @@ typedef struct eio_handle_components eio_handle_t; * file descriptor will continue to be polled. */ struct io_operations { - bool (*readable )(eio_obj_t *); - bool (*writable )(eio_obj_t *); + bool (*readable )(eio_obj_t *); + bool (*writable )(eio_obj_t *); void (*handle_msg )(void *arg, slurm_msg_t *msg); int (*handle_read )(eio_obj_t *, List); int (*handle_write)(eio_obj_t *, List); diff --git a/src/common/env.c b/src/common/env.c index 02a14d2974..82d16f9005 100644 --- a/src/common/env.c +++ b/src/common/env.c @@ -6,32 +6,32 @@ * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Mark Grondona , Danny Auble . * CODE-OCEC-09-009. All rights reserved. - * + * * This file is part of SLURM, a resource management program. * For details, see . * Please also read the included file: DISCLAIMER. - * + * * SLURM is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free * Software Foundation; either version 2 of the License, or (at your option) * any later version. * - * In addition, as a special exception, the copyright holders give permission + * In addition, as a special exception, the copyright holders give permission * to link the code of portions of this program with the OpenSSL library under - * certain conditions as described in each individual source file, and - * distribute linked combinations including the two. You must obey the GNU - * General Public License in all respects for all of the code used other than - * OpenSSL. If you modify file(s) with this exception, you may extend this - * exception to your version of the file(s), but you are not obligated to do + * certain conditions as described in each individual source file, and + * distribute linked combinations including the two. You must obey the GNU + * General Public License in all respects for all of the code used other than + * OpenSSL. If you modify file(s) with this exception, you may extend this + * exception to your version of the file(s), but you are not obligated to do * so. If you do not wish to do so, delete this exception statement from your - * version. If you delete this exception statement from all source files in + * version. If you delete this exception statement from all source files in * the program, then also delete it here. - * + * * SLURM is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. - * + * * You should have received a copy of the GNU General Public License along * with SLURM; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. @@ -39,7 +39,7 @@ #if HAVE_CONFIG_H # include "config.h" -#endif +#endif #include #include @@ -65,8 +65,8 @@ #include "src/common/slurm_step_layout.h" /* - * Define slurm-specific aliases for use by plugins, see slurm_xlator.h - * for details. + * Define slurm-specific aliases for use by plugins, see slurm_xlator.h + * for details. */ strong_alias(setenvf, slurm_setenvpf); strong_alias(unsetenvp, slurm_unsetenvp); @@ -97,7 +97,7 @@ _find_name_in_env(char **env, const char *name) while (*ep != NULL) { size_t cnt = 0; - while ( ((*ep)[cnt] == name[cnt]) + while ( ((*ep)[cnt] == name[cnt]) && ( name[cnt] != '\0') && ((*ep)[cnt] != '\0') ) ++cnt; @@ -126,7 +126,7 @@ _extend_env(char ***envp) (*envp)[newcnt - 1] = NULL; ep = &((*envp)[newcnt - 2]); - /* + /* * Find last non-NULL entry */ while (*ep == NULL) @@ -135,7 +135,7 @@ _extend_env(char ***envp) return (++ep); } -/* return true if the environment variables should not be set for +/* return true if the environment variables should not be set for * srun's --get-user-env option */ static bool _discard_env(char *name, char *value) { @@ -192,7 +192,7 @@ static void _set_distribution(task_dist_states_t distribution, /* * Return the number of elements in the environment `env' */ -int +int envcount (char **env) { int envc = 0; @@ -219,14 +219,14 @@ setenvfs(const char *fmt, ...) va_start(ap, fmt); vsnprintf(buf, ENV_BUFSIZE, fmt, ap); va_end(ap); - + bufcpy = xstrdup(buf); xfree(buf); rc = putenv(bufcpy); return rc; } -int +int setenvf(char ***envp, const char *name, const char *fmt, ...) { char **ep = NULL; @@ -241,19 +241,19 @@ setenvf(char ***envp, const char *name, const char *fmt, ...) va_end(ap); bufcpy = xstrdup(buf); xfree(buf); - + xstrfmtcat (str, "%s=%s", name, bufcpy); xfree(bufcpy); - if(envp && *envp) { + if(envp && *envp) { ep = _find_name_in_env (*envp, name); - - if (*ep != NULL) + + if (*ep != NULL) xfree (*ep); else ep = _extend_env (envp); - + *ep = str; - + return (0); } else { rc = putenv(str); @@ -262,10 +262,10 @@ setenvf(char ***envp, const char *name, const char *fmt, ...) } /* - * Remove environment variable `name' from "environment" + * Remove environment variable `name' from "environment" * contained in `env' * - * [ This was taken almost verbatim from glibc's + * [ This was taken almost verbatim from glibc's * unsetenv() code. ] */ void unsetenvp(char **env, const char *name) @@ -279,7 +279,7 @@ void unsetenvp(char **env, const char *name) while ((ep = _find_name_in_env (ep, name)) && (*ep != NULL)) { char **dp = ep; xfree (*ep); - do + do dp[0] = dp[1]; while (*dp++); @@ -313,7 +313,7 @@ int setup_env(env_t *env, bool preserve_env) if (env == NULL) return SLURM_ERROR; - + if (env->task_pid && setenvf(&env->env, "SLURM_TASK_PID", "%d", (int)env->task_pid)) { error("Unable to set SLURM_TASK_PID environment variable"); @@ -324,65 +324,65 @@ int setup_env(env_t *env, bool preserve_env) && setenvf(&env->env, "SLURM_NPROCS", "%d", env->nprocs)) { error("Unable to set SLURM_NPROCS environment variable"); rc = SLURM_FAILURE; - } - - if (env->cpus_per_task - && setenvf(&env->env, "SLURM_CPUS_PER_TASK", "%d", + } + + if (env->cpus_per_task + && setenvf(&env->env, "SLURM_CPUS_PER_TASK", "%d", env->cpus_per_task) ) { error("Unable to set SLURM_CPUS_PER_TASK"); rc = SLURM_FAILURE; - } - - if (env->ntasks_per_node - && setenvf(&env->env, "SLURM_NTASKS_PER_NODE", "%d", + } + + if (env->ntasks_per_node + && setenvf(&env->env, "SLURM_NTASKS_PER_NODE", "%d", env->ntasks_per_node) ) { error("Unable to set SLURM_NTASKS_PER_NODE"); rc = SLURM_FAILURE; - } - - if (env->ntasks_per_socket - && setenvf(&env->env, "SLURM_NTASKS_PER_SOCKET", "%d", + } + + if (env->ntasks_per_socket + && setenvf(&env->env, "SLURM_NTASKS_PER_SOCKET", "%d", env->ntasks_per_socket) ) { error("Unable to set SLURM_NTASKS_PER_SOCKET"); rc = SLURM_FAILURE; - } + } - if (env->ntasks_per_core - && setenvf(&env->env, "SLURM_NTASKS_PER_CORE", "%d", + if (env->ntasks_per_core + && setenvf(&env->env, "SLURM_NTASKS_PER_CORE", "%d", env->ntasks_per_core) ) { error("Unable to set SLURM_NTASKS_PER_CORE"); rc = SLURM_FAILURE; - } + } - if (env->cpus_on_node - && setenvf(&env->env, "SLURM_CPUS_ON_NODE", "%d", + if (env->cpus_on_node + && setenvf(&env->env, "SLURM_CPUS_ON_NODE", "%d", env->cpus_on_node) ) { error("Unable to set SLURM_CPUS_ON_NODE"); rc = SLURM_FAILURE; - } + } _set_distribution(env->distribution, &dist, &lllp_dist); - if(dist) + if(dist) if (setenvf(&env->env, "SLURM_DISTRIBUTION", "%s", dist)) { error("Can't set SLURM_DISTRIBUTION env variable"); rc = SLURM_FAILURE; } - if(env->distribution == SLURM_DIST_PLANE) - if (setenvf(&env->env, "SLURM_DIST_PLANESIZE", "%u", + if(env->distribution == SLURM_DIST_PLANE) + if (setenvf(&env->env, "SLURM_DIST_PLANESIZE", "%u", env->plane_size)) { error("Can't set SLURM_DIST_PLANESIZE " "env variable"); rc = SLURM_FAILURE; } - + if(lllp_dist) if (setenvf(&env->env, "SLURM_DIST_LLLP", "%s", lllp_dist)) { error("Can't set SLURM_DIST_LLLP env variable"); rc = SLURM_FAILURE; } - - + + if (env->cpu_bind_type) { char *str_verbose, *str_bind_type, *str_bind_list; char *str_bind; @@ -580,7 +580,7 @@ int setup_env(env_t *env, bool preserve_env) } } - if (env->overcommit + if (env->overcommit && (setenvf(&env->env, "SLURM_OVERCOMMIT", "1"))) { error("Unable to set SLURM_OVERCOMMIT environment variable"); rc = SLURM_FAILURE; @@ -592,7 +592,7 @@ int setup_env(env_t *env, bool preserve_env) rc = SLURM_FAILURE; } - if (env->labelio + if (env->labelio && setenvf(&env->env, "SLURM_LABELIO", "1")) { error("Unable to set SLURM_LABELIO environment variable"); rc = SLURM_FAILURE; @@ -601,49 +601,49 @@ int setup_env(env_t *env, bool preserve_env) if(env->select_jobinfo) { #ifdef HAVE_BG char *bgl_part_id = NULL; - select_g_select_jobinfo_get(env->select_jobinfo, + select_g_select_jobinfo_get(env->select_jobinfo, SELECT_JOBDATA_BLOCK_ID, &bgl_part_id); if (bgl_part_id) { #ifndef HAVE_BGL uint16_t conn_type = (uint16_t)NO_VAL; - select_g_select_jobinfo_get(env->select_jobinfo, + select_g_select_jobinfo_get(env->select_jobinfo, SELECT_JOBDATA_CONN_TYPE, &conn_type); if(conn_type > SELECT_SMALL) { - if(setenvf(&env->env, + if(setenvf(&env->env, "SUBMIT_POOL", "%s", bgl_part_id)) rc = SLURM_FAILURE; } #endif - if(setenvf(&env->env, + if(setenvf(&env->env, "MPIRUN_PARTITION", "%s", bgl_part_id)) rc = SLURM_FAILURE; - + if(setenvf(&env->env, "MPIRUN_NOFREE", "%d", 1)) rc = SLURM_FAILURE; if(setenvf(&env->env, "MPIRUN_NOALLOCATE", "%d", 1)) rc = SLURM_FAILURE; xfree(bgl_part_id); - } else + } else rc = SLURM_FAILURE; - + if(rc == SLURM_FAILURE) error("Can't set MPIRUN_PARTITION " "environment variable"); - + #endif #ifdef HAVE_CRAY_XT char *resv_id = NULL; - select_g_select_jobinfo_get(env->select_jobinfo, + select_g_select_jobinfo_get(env->select_jobinfo, SELECT_JOBDATA_RESV_ID, &resv_id); if (resv_id) { - if(setenvf(&env->env, + if(setenvf(&env->env, "BASIL_RESVERATION_ID", "%s", resv_id)) rc = SLURM_FAILURE; - } else + } else rc = SLURM_FAILURE; - + if(rc == SLURM_FAILURE) error("Can't set BASIL_RESVERATION_ID " "environment variable"); @@ -662,19 +662,19 @@ int setup_env(env_t *env, bool preserve_env) rc = SLURM_FAILURE; } } - + if (env->nodeid >= 0 && setenvf(&env->env, "SLURM_NODEID", "%d", env->nodeid)) { error("Unable to set SLURM_NODEID environment"); rc = SLURM_FAILURE; } - + if (env->procid >= 0 && setenvf(&env->env, "SLURM_PROCID", "%d", env->procid)) { error("Unable to set SLURM_PROCID environment"); rc = SLURM_FAILURE; } - + if (env->localid >= 0 && setenvf(&env->env, "SLURM_LOCALID", "%d", env->localid)) { error("Unable to set SLURM_LOCALID environment"); @@ -686,7 +686,7 @@ int setup_env(env_t *env, bool preserve_env) error("Unable to set SLURM_STEPID environment"); rc = SLURM_FAILURE; } - + if (!preserve_env && env->nhosts && setenvf(&env->env, "SLURM_NNODES", "%d", env->nhosts)) { error("Unable to set SLURM_NNODES environment var"); @@ -698,29 +698,29 @@ int setup_env(env_t *env, bool preserve_env) error("Unable to set SLURM_NODELIST environment var."); rc = SLURM_FAILURE; } - - if (!preserve_env && env->task_count - && setenvf (&env->env, + + if (!preserve_env && env->task_count + && setenvf (&env->env, "SLURM_TASKS_PER_NODE", "%s", env->task_count)) { error ("Can't set SLURM_TASKS_PER_NODE env variable"); rc = SLURM_FAILURE; } - + if (env->comm_port - && setenvf (&env->env, "SLURM_SRUN_COMM_PORT", "%u", + && setenvf (&env->env, "SLURM_SRUN_COMM_PORT", "%u", env->comm_port)) { error ("Can't set SLURM_SRUN_COMM_PORT env variable"); rc = SLURM_FAILURE; } if (env->cli) { - + slurm_print_slurm_addr (env->cli, addrbuf, INET_ADDRSTRLEN); - /* + /* * XXX: Eventually, need a function for slurm_addrs that * returns just the IP address (not addr:port) - */ + */ if ((dist = strchr (addrbuf, ':')) != NULL) *dist = '\0'; @@ -731,8 +731,8 @@ int setup_env(env_t *env, bool preserve_env) && setenvf(&env->env, "SLURM_GTIDS", "%s", env->sgtids)) { error("Unable to set SLURM_GTIDS environment variable"); rc = SLURM_FAILURE; - } - + } + #ifdef HAVE_AIX { char res_env[128]; @@ -749,7 +749,7 @@ int setup_env(env_t *env, bool preserve_env) debug_num = atoi(debug_env); snprintf(res_env, sizeof(res_env), "SLURM_LL_API_DEBUG=%d", debug_num); - + /* Required for AIX/POE systems indicating pre-allocation */ setenvf(&env->env, "LOADLBATCH", "yes"); setenvf(&env->env, "LOADL_ACTIVE", "3.2.0"); @@ -771,8 +771,8 @@ int setup_env(env_t *env, bool preserve_env) error("Can't set SLURM_PTY_WIN_ROW env variable"); rc = SLURM_FAILURE; } - if (env->ckpt_dir - && setenvf(&env->env, "SLURM_CHECKPOINT_IMAGE_DIR", "%s", + if (env->ckpt_dir + && setenvf(&env->env, "SLURM_CHECKPOINT_IMAGE_DIR", "%s", env->ckpt_dir)) { error("Can't set SLURM_CHECKPOINT_IMAGE_DIR env variable"); rc = SLURM_FAILURE; @@ -831,7 +831,7 @@ static char *_uint16_array_to_str(int array_len, const uint16_t *array) } previous = 0; } - + return str; } @@ -890,7 +890,7 @@ extern char *uint32_compressed_to_str(uint32_t array_len, * SLURM_JOBID * SLURM_NNODES * SLURM_NODELIST - * SLURM_TASKS_PER_NODE + * SLURM_TASKS_PER_NODE */ int env_array_for_job(char ***dest, const resource_allocation_response_msg_t *alloc, @@ -907,7 +907,7 @@ env_array_for_job(char ***dest, const resource_allocation_response_msg_t *alloc, uint32_t node_cnt = alloc->node_cnt; #ifdef HAVE_BG - select_g_select_jobinfo_get(alloc->select_jobinfo, + select_g_select_jobinfo_get(alloc->select_jobinfo, SELECT_JOBDATA_NODE_CNT, &node_cnt); if(!node_cnt) @@ -921,16 +921,16 @@ env_array_for_job(char ***dest, const resource_allocation_response_msg_t *alloc, alloc->node_list); _set_distribution(desc->task_dist, &dist, &lllp_dist); - if(dist) + if(dist) env_array_overwrite_fmt(dest, "SLURM_DISTRIBUTION", "%s", dist); - - if(desc->task_dist == SLURM_DIST_PLANE) + + if(desc->task_dist == SLURM_DIST_PLANE) env_array_overwrite_fmt(dest, "SLURM_DIST_PLANESIZE", "%u", desc->plane_size); - + if(lllp_dist) - env_array_overwrite_fmt(dest, "SLURM_DIST_LLLP", "%s", + env_array_overwrite_fmt(dest, "SLURM_DIST_LLLP", "%s", lllp_dist); tmp = uint32_compressed_to_str(alloc->num_cpu_groups, @@ -952,7 +952,7 @@ env_array_for_job(char ***dest, const resource_allocation_response_msg_t *alloc, if (tmp) { #ifndef HAVE_BGL uint16_t conn_type = (uint16_t)NO_VAL; - select_g_select_jobinfo_get(alloc->select_jobinfo, + select_g_select_jobinfo_get(alloc->select_jobinfo, SELECT_JOBDATA_CONN_TYPE, &conn_type); if(conn_type > SELECT_SMALL) { env_array_overwrite_fmt(dest, "SUBMIT_POOL", "%s", @@ -982,7 +982,7 @@ env_array_for_job(char ***dest, const resource_allocation_response_msg_t *alloc, env_array_overwrite_fmt(dest, "SLURM_JOBID", "%u", alloc->job_id); env_array_overwrite_fmt(dest, "SLURM_NNODES", "%u", node_cnt); env_array_overwrite_fmt(dest, "SLURM_NODELIST", "%s", alloc->node_list); - + if(num_tasks == NO_VAL) { /* If we know how many tasks we are going to do then we set SLURM_TASKS_PER_NODE */ @@ -990,17 +990,17 @@ env_array_for_job(char ***dest, const resource_allocation_response_msg_t *alloc, /* If no tasks were given we can figure it out here * by totalling up the cpus and then dividing by the * number of cpus per task */ - + num_tasks = 0; for (i = 0; i < alloc->num_cpu_groups; i++) { - num_tasks += alloc->cpu_count_reps[i] + num_tasks += alloc->cpu_count_reps[i] * alloc->cpus_per_node[i]; } - if((int)desc->cpus_per_task > 1 + if((int)desc->cpus_per_task > 1 && desc->cpus_per_task != (uint16_t)NO_VAL) num_tasks /= desc->cpus_per_task; //num_tasks = desc->num_procs; - } + } if(desc->task_dist == SLURM_DIST_ARBITRARY) { tmp = desc->req_nodes; @@ -1016,9 +1016,9 @@ env_array_for_job(char ***dest, const resource_allocation_response_msg_t *alloc, num_tasks, desc->cpus_per_task, desc->task_dist, - desc->plane_size))) + desc->plane_size))) return SLURM_ERROR; - + tmp = _uint16_array_to_str(step_layout->node_cnt, step_layout->tasks); slurm_step_layout_destroy(step_layout); @@ -1048,7 +1048,7 @@ env_array_for_job(char ***dest, const resource_allocation_response_msg_t *alloc, * SLURM_NNODES * SLURM_NODELIST * SLURM_NPROCS - * SLURM_TASKS_PER_NODE + * SLURM_TASKS_PER_NODE */ extern int env_array_for_batch_job(char ***dest, const batch_job_launch_msg_t *batch, @@ -1095,8 +1095,8 @@ env_array_for_batch_job(char ***dest, const batch_job_launch_msg_t *batch, env_array_overwrite_fmt(dest, "SLURM_JOBID", "%u", batch->job_id); env_array_overwrite_fmt(dest, "SLURM_NNODES", "%u", num_nodes); env_array_overwrite_fmt(dest, "SLURM_NODELIST", "%s", batch->nodes); - if(num_tasks) - env_array_overwrite_fmt(dest, "SLURM_NPROCS", "%u", + if(num_tasks) + env_array_overwrite_fmt(dest, "SLURM_NPROCS", "%u", num_tasks); if((batch->cpus_per_task != 0) && @@ -1108,7 +1108,7 @@ env_array_for_batch_job(char ***dest, const batch_job_launch_msg_t *batch, env_array_overwrite_fmt(dest, "SLURM_CPUS_PER_TASK", "%u", cpus_per_task); } - + if((tmp = getenvp(*dest, "SLURM_ARBITRARY_NODELIST"))) { task_dist = SLURM_DIST_ARBITRARY; num_tasks = batch->nprocs; @@ -1166,7 +1166,7 @@ env_array_for_batch_job(char ***dest, const batch_job_launch_msg_t *batch, * */ void -env_array_for_step(char ***dest, +env_array_for_step(char ***dest, const job_step_create_response_msg_t *step, uint16_t launcher_port, bool preserve_env) @@ -1197,7 +1197,7 @@ env_array_for_step(char ***dest, "%hu", step->step_layout->node_cnt); env_array_overwrite_fmt(dest, "SLURM_NPROCS", "%u", step->step_layout->task_cnt); - env_array_overwrite_fmt(dest, "SLURM_TASKS_PER_NODE", "%s", + env_array_overwrite_fmt(dest, "SLURM_TASKS_PER_NODE", "%s", tmp); } env_array_overwrite_fmt(dest, "SLURM_SRUN_COMM_PORT", @@ -1275,7 +1275,7 @@ int env_array_append_fmt(char ***array_ptr, const char *name, xfree(buf); ep = _extend_env(array_ptr); *ep = str; - + return 1; } @@ -1305,7 +1305,7 @@ int env_array_append(char ***array_ptr, const char *name, xstrfmtcat (str, "%s=%s", name, value); ep = _extend_env(array_ptr); *ep = str; - + return 1; } @@ -1337,7 +1337,7 @@ int env_array_overwrite_fmt(char ***array_ptr, const char *name, va_start(ap, value_fmt); vsnprintf (buf, ENV_BUFSIZE, value_fmt, ap); va_end(ap); - + xstrfmtcat (str, "%s=%s", name, buf); xfree(buf); ep = _find_name_in_env(*array_ptr, name); @@ -1348,7 +1348,7 @@ int env_array_overwrite_fmt(char ***array_ptr, const char *name, } *ep = str; - + return 1; } @@ -1383,12 +1383,12 @@ int env_array_overwrite(char ***array_ptr, const char *name, } *ep = str; - + return 1; } -/* - * Copy env_array must be freed by env_array_free +/* + * Copy env_array must be freed by env_array_free */ char **env_array_copy(const char **array) { @@ -1555,7 +1555,7 @@ static char **_load_env_cache(const char *username) int i; state_save_loc = slurm_get_state_save_location(); - i = snprintf(fname, sizeof(fname), "%s/env_cache/%s", state_save_loc, + i = snprintf(fname, sizeof(fname), "%s/env_cache/%s", state_save_loc, username); xfree(state_save_loc); if (i < 0) { @@ -1576,7 +1576,7 @@ static char **_load_env_cache(const char *username) if (!fgets(line, ENV_BUFSIZE, fp)) break; _strip_cr_nl(line); - if (_env_array_entry_splitter(line, name, sizeof(name), + if (_env_array_entry_splitter(line, name, sizeof(name), value, ENV_BUFSIZE) && (!_discard_env(name, value))) { if (value[0] == '(') { @@ -1606,14 +1606,14 @@ static char **_load_env_cache(const char *username) /* * Return an array of strings representing the specified user's default - * environment variables following a two-prongged approach. + * environment variables following a two-prongged approach. * 1. Execute (more or less): "/bin/su - -c /usr/bin/env" * Depending upon the user's login scripts, this may take a very * long time to complete or possibly never return * 2. Load the user environment from a cache file. This is used * in the event that option 1 times out. * - * timeout value is in seconds or zero for default (2 secs) + * timeout value is in seconds or zero for default (2 secs) * mode is 1 for short ("su "), 2 for long ("su - ") * On error, returns NULL. * @@ -1640,7 +1640,7 @@ char **env_array_user_default(const char *username, int timeout, int mode) return NULL; } - snprintf(stepd_path, sizeof(stepd_path), "%s/sbin/slurmstepd", + snprintf(stepd_path, sizeof(stepd_path), "%s/sbin/slurmstepd", SLURM_PREFIX); config_timeout = slurm_get_env_timeout(); if (config_timeout == 0) /* just read directly from cache */ @@ -1767,13 +1767,13 @@ char **env_array_user_default(const char *username, int timeout, int mode) break; if (config_timeout >= 2) { /* Non-killable processes are indicative of file system - * problems. The process will remain as a zombie, but + * problems. The process will remain as a zombie, but * slurmd/salloc/moab will not otherwise be effected. */ error("Failed to kill program loading user environment"); break; } } - + if (!found) { error("Failed to load current user environment variables"); xfree(buffer); @@ -1808,7 +1808,7 @@ char **env_array_user_default(const char *username, int timeout, int mode) found = 1; break; } - if (_env_array_entry_splitter(line, name, sizeof(name), + if (_env_array_entry_splitter(line, name, sizeof(name), value, ENV_BUFSIZE) && (!_discard_env(name, value))) { if (value[0] == '(') { diff --git a/src/common/env.h b/src/common/env.h index 46aec6c252..a13f4a5254 100644 --- a/src/common/env.h +++ b/src/common/env.h @@ -5,21 +5,21 @@ * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Mark Grondona . * CODE-OCEC-09-009. All rights reserved. - * + * * This file is part of SLURM, a resource management program. * For details, see . * Please also read the included file: DISCLAIMER. - * + * * SLURM is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free * Software Foundation; either version 2 of the License, or (at your option) * any later version. - * + * * SLURM is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. - * + * * You should have received a copy of the GNU General Public License along * with SLURM; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. @@ -69,7 +69,7 @@ typedef struct env_options { int ntasks_per_core; /* --ntasks-per-core=n */ int cpus_on_node; pid_t task_pid; - char *sgtids; /* global ranks array of integers */ + char *sgtids; /* global ranks array of integers */ uint16_t pty_port; /* used to communicate window size changes */ uint8_t ws_col; /* window size, columns */ uint8_t ws_row; /* window size, row count */ @@ -133,7 +133,7 @@ int env_array_for_job(char ***dest, * SLURM_TASKS_PER_NODE <- poorly named, really CPUs per node * ? probably only needed for users... */ -extern int env_array_for_batch_job(char ***dest, +extern int env_array_for_batch_job(char ***dest, const batch_job_launch_msg_t *batch, const char* node_name); @@ -184,8 +184,8 @@ char **env_array_create(void); */ void env_array_merge(char ***dest_array, const char **src_array); -/* - * Copy env_array must be freed by env_array_free +/* + * Copy env_array must be freed by env_array_free */ char **env_array_copy(const char **array); @@ -267,7 +267,7 @@ char **env_array_user_default(const char *username, int timeout, int mode); /* * The cpus-per-node representation in SLURM (and perhaps tasks-per-node * in the future) is stored in a compressed format comprised of two - * equal-length arrays, and an integer holding the array length. In one + * equal-length arrays, and an integer holding the array length. In one * array an element represents a count (number of cpus, number of tasks, * etc.), and the corresponding element in the other array contains the * number of times the count is repeated sequentially in the uncompressed diff --git a/src/common/forward.c b/src/common/forward.c index 7ccce549d3..c9373ccd77 100644 --- a/src/common/forward.c +++ b/src/common/forward.c @@ -6,32 +6,32 @@ * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Danny Auble . * CODE-OCEC-09-009. All rights reserved. - * + * * This file is part of SLURM, a resource management program. * For details, see . * Please also read the included file: DISCLAIMER. - * + * * SLURM is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free * Software Foundation; either version 2 of the License, or (at your option) * any later version. * - * In addition, as a special exception, the copyright holders give permission + * In addition, as a special exception, the copyright holders give permission * to link the code of portions of this program with the OpenSSL library under - * certain conditions as described in each individual source file, and - * distribute linked combinations including the two. You must obey the GNU - * General Public License in all respects for all of the code used other than - * OpenSSL. If you modify file(s) with this exception, you may extend this - * exception to your version of the file(s), but you are not obligated to do + * certain conditions as described in each individual source file, and + * distribute linked combinations including the two. You must obey the GNU + * General Public License in all respects for all of the code used other than + * OpenSSL. If you modify file(s) with this exception, you may extend this + * exception to your version of the file(s), but you are not obligated to do * so. If you do not wish to do so, delete this exception statement from your - * version. If you delete this exception statement from all source files in + * version. If you delete this exception statement from all source files in * the program, then also delete it here. - * + * * SLURM is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. - * + * * You should have received a copy of the GNU General Public License along * with SLURM; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. @@ -94,8 +94,8 @@ void *_forward_thread(void *arg) char buf[8196]; int steps = 0; int start_timeout = fwd_msg->timeout; - - /* repeat until we are sure the message was sent */ + + /* repeat until we are sure the message was sent */ while((name = hostlist_shift(hl))) { if(slurm_conf_get_addr(name, &addr) == SLURM_ERROR) { error("forward_thread: can't find address for host " @@ -108,7 +108,7 @@ void *_forward_thread(void *arg) slurm_mutex_unlock(fwd_msg->forward_mutex); continue; } - goto cleanup; + goto cleanup; } if ((fd = slurm_open_msg_conn(&addr)) < 0) { error("forward_thread to %s: %m", name); @@ -122,7 +122,7 @@ void *_forward_thread(void *arg) slurm_mutex_unlock(fwd_msg->forward_mutex); continue; } - goto cleanup; + goto cleanup; } hostlist_ranged_string(hl, sizeof(buf), buf); @@ -137,42 +137,42 @@ void *_forward_thread(void *arg) name, fwd_msg->header.forward.nodelist); } else debug3("forward: send to %s ", name); - + pack_header(&fwd_msg->header, buffer); - + /* add forward data to buffer */ if (remaining_buf(buffer) < fwd_msg->buf_len) { buffer->size += (fwd_msg->buf_len + BUF_SIZE); xrealloc(buffer->head, buffer->size); } if (fwd_msg->buf_len) { - memcpy(&buffer->head[buffer->processed], + memcpy(&buffer->head[buffer->processed], fwd_msg->buf, fwd_msg->buf_len); buffer->processed += fwd_msg->buf_len; } - + /* * forward message */ - if(_slurm_msg_sendto(fd, - get_buf_data(buffer), + if(_slurm_msg_sendto(fd, + get_buf_data(buffer), get_buf_offset(buffer), SLURM_PROTOCOL_NO_SEND_RECV_FLAGS ) < 0) { error("forward_thread: slurm_msg_sendto: %m"); - + slurm_mutex_lock(fwd_msg->forward_mutex); - mark_as_failed_forward(&fwd_msg->ret_list, name, + mark_as_failed_forward(&fwd_msg->ret_list, name, errno); free(name); if(hostlist_count(hl) > 0) { - free_buf(buffer); + free_buf(buffer); buffer = init_buf(fwd_msg->buf_len); slurm_mutex_unlock(fwd_msg->forward_mutex); slurm_close_accepted_conn(fd); fd = -1; continue; } - goto cleanup; + goto cleanup; } if ((fwd_msg->header.msg_type == REQUEST_SHUTDOWN) || @@ -184,7 +184,7 @@ void *_forward_thread(void *arg) free(name); i=0; while((name = hostlist_shift(hl))) { - ret_data_info = + ret_data_info = xmalloc(sizeof(ret_data_info_t)); list_push(fwd_msg->ret_list, ret_data_info); ret_data_info->node_name = xstrdup(name); @@ -196,7 +196,7 @@ void *_forward_thread(void *arg) if(fwd_msg->header.forward.cnt > 0) { static int message_timeout = -1; if (message_timeout < 0) - message_timeout = + message_timeout = slurm_get_msg_timeout() * 1000; steps = (fwd_msg->header.forward.cnt+1) / slurm_get_tree_width(); @@ -205,29 +205,29 @@ void *_forward_thread(void *arg) steps++; fwd_msg->timeout += (start_timeout*steps); /* info("now + %d*%d = %d", start_timeout, steps, fwd_msg->timeout); */ - } - + } + ret_list = slurm_receive_msgs(fd, steps, fwd_msg->timeout); /* info("sent %d forwards got %d back", */ /* fwd_msg->header.forward.cnt, list_count(ret_list)); */ - - if(!ret_list || (fwd_msg->header.forward.cnt != 0 + + if(!ret_list || (fwd_msg->header.forward.cnt != 0 && list_count(ret_list) <= 1)) { slurm_mutex_lock(fwd_msg->forward_mutex); - mark_as_failed_forward(&fwd_msg->ret_list, name, + mark_as_failed_forward(&fwd_msg->ret_list, name, errno); free(name); if(ret_list) list_destroy(ret_list); if (hostlist_count(hl) > 0) { - free_buf(buffer); + free_buf(buffer); buffer = init_buf(fwd_msg->buf_len); slurm_mutex_unlock(fwd_msg->forward_mutex); slurm_close_accepted_conn(fd); fd = -1; continue; } - goto cleanup; + goto cleanup; } else if((fwd_msg->header.forward.cnt+1) != list_count(ret_list)) { /* this should never be called since the above @@ -263,15 +263,15 @@ void *_forward_thread(void *arg) if(!node_found) { mark_as_failed_forward( &fwd_msg->ret_list, - tmp, - SLURM_COMMUNICATIONS_CONNECTION_ERROR); + tmp, + SLURM_COMMUNICATIONS_CONNECTION_ERROR); } free(tmp); } hostlist_iterator_destroy(host_itr); if(!first_node_found) { mark_as_failed_forward(&fwd_msg->ret_list, - name, + name, SLURM_COMMUNICATIONS_CONNECTION_ERROR); } } @@ -295,7 +295,7 @@ cleanup: error ("close(%d): %m", fd); hostlist_destroy(hl); destroy_forward(&fwd_msg->header.forward); - free_buf(buffer); + free_buf(buffer); pthread_cond_signal(fwd_msg->notify); slurm_mutex_unlock(fwd_msg->forward_mutex); @@ -308,13 +308,13 @@ void *_fwd_tree_thread(void *arg) List ret_list = NULL; char *name = NULL; char buf[8196]; - slurm_msg_t send_msg; - + slurm_msg_t send_msg; + slurm_msg_t_init(&send_msg); send_msg.msg_type = fwd_tree->orig_msg->msg_type; send_msg.data = fwd_tree->orig_msg->data; - /* repeat until we are sure the message was sent */ + /* repeat until we are sure the message was sent */ while((name = hostlist_shift(fwd_tree->tree_hl))) { if(slurm_conf_get_addr(name, &send_msg.address) == SLURM_ERROR) { @@ -326,20 +326,20 @@ void *_fwd_tree_thread(void *arg) pthread_cond_signal(fwd_tree->notify); slurm_mutex_unlock(fwd_tree->tree_mutex); free(name); - + continue; } - + send_msg.forward.timeout = fwd_tree->timeout; if((send_msg.forward.cnt = hostlist_count(fwd_tree->tree_hl))) { - hostlist_ranged_string(fwd_tree->tree_hl, + hostlist_ranged_string(fwd_tree->tree_hl, sizeof(buf), buf); send_msg.forward.nodelist = xstrdup(buf); } else send_msg.forward.nodelist = NULL; if (send_msg.forward.nodelist && send_msg.forward.nodelist[0]) { - debug3("Tree sending to %s along with %s", + debug3("Tree sending to %s along with %s", name, send_msg.forward.nodelist); } else debug3("Tree sending to %s", name); @@ -368,21 +368,21 @@ void *_fwd_tree_thread(void *arg) pthread_cond_signal(fwd_tree->notify); slurm_mutex_unlock(fwd_tree->tree_mutex); free(name); - + continue; } free(name); - + /* check for error and try again */ - if(errno == SLURM_COMMUNICATIONS_CONNECTION_ERROR) - continue; - + if(errno == SLURM_COMMUNICATIONS_CONNECTION_ERROR) + continue; + break; } _destroy_tree_fwd(fwd_tree); - + return NULL; } @@ -420,7 +420,7 @@ extern void forward_init(forward_t *forward, forward_t *from) * needing to be forwarded. * RET: SLURM_SUCCESS - int */ -extern int forward_msg(forward_struct_t *forward_struct, +extern int forward_msg(forward_struct_t *forward_struct, header_t *header) { int j = 0; @@ -437,45 +437,45 @@ extern int forward_msg(forward_struct_t *forward_struct, xfree(span); return SLURM_ERROR; } - hl = hostlist_create(header->forward.nodelist); + hl = hostlist_create(header->forward.nodelist); hostlist_uniq(hl); - + while((name = hostlist_shift(hl))) { pthread_attr_t attr_agent; pthread_t thread_agent; char buf[8192]; - + slurm_attr_init(&attr_agent); if (pthread_attr_setdetachstate (&attr_agent, PTHREAD_CREATE_DETACHED)) error("pthread_attr_setdetachstate error %m"); - + forward_msg = &forward_struct->forward_msg[thr_count]; forward_msg->ret_list = forward_struct->ret_list; - + forward_msg->timeout = forward_struct->timeout; - + if(forward_msg->timeout <= 0) { /* convert secs to msec */ - forward_msg->timeout = slurm_get_msg_timeout() * 1000; + forward_msg->timeout = slurm_get_msg_timeout() * 1000; } forward_msg->notify = &forward_struct->notify; forward_msg->forward_mutex = &forward_struct->forward_mutex; forward_msg->buf_len = forward_struct->buf_len; forward_msg->buf = forward_struct->buf; - - memcpy(&forward_msg->header.orig_addr, - &header->orig_addr, + + memcpy(&forward_msg->header.orig_addr, + &header->orig_addr, sizeof(slurm_addr)); - + forward_msg->header.version = header->version; forward_msg->header.flags = header->flags; forward_msg->header.msg_type = header->msg_type; forward_msg->header.body_length = header->body_length; forward_msg->header.ret_list = NULL; forward_msg->header.ret_cnt = 0; - + forward_hl = hostlist_create(name); free(name); for(j = 0; j < span[thr_count]; j++) { @@ -491,7 +491,7 @@ extern int forward_msg(forward_struct_t *forward_struct, forward_init(&forward_msg->header.forward, NULL); forward_msg->header.forward.nodelist = xstrdup(buf); while(pthread_create(&thread_agent, &attr_agent, - _forward_thread, + _forward_thread, (void *)forward_msg)) { error("pthread_create error %m"); if (++retries > MAX_RETRIES) @@ -499,7 +499,7 @@ extern int forward_msg(forward_struct_t *forward_struct, sleep(1); /* sleep and try again */ } slurm_attr_destroy(&attr_agent); - thr_count++; + thr_count++; } hostlist_destroy(hl); xfree(span); @@ -533,7 +533,7 @@ extern List start_msg_tree(hostlist_t hl, slurm_msg_t *msg, int timeout) xassert(hl); xassert(msg); - hostlist_uniq(hl); + hostlist_uniq(hl); host_count = hostlist_count(hl); span = set_span(host_count, 0); @@ -542,7 +542,7 @@ extern List start_msg_tree(hostlist_t hl, slurm_msg_t *msg, int timeout) pthread_cond_init(¬ify, NULL); ret_list = list_create(destroy_data_info); - + while((name = hostlist_shift(hl))) { pthread_attr_t attr_agent; pthread_t thread_agent; @@ -562,7 +562,7 @@ extern List start_msg_tree(hostlist_t hl, slurm_msg_t *msg, int timeout) if(fwd_tree->timeout <= 0) { /* convert secs to msec */ - fwd_tree->timeout = slurm_get_msg_timeout() * 1000; + fwd_tree->timeout = slurm_get_msg_timeout() * 1000; } fwd_tree->tree_hl = hostlist_create(name); @@ -583,10 +583,10 @@ extern List start_msg_tree(hostlist_t hl, slurm_msg_t *msg, int timeout) sleep(1); /* sleep and try again */ } slurm_attr_destroy(&attr_agent); - thr_count++; + thr_count++; } xfree(span); - + slurm_mutex_lock(&tree_mutex); count = list_count(ret_list); @@ -613,45 +613,45 @@ extern List start_msg_tree(hostlist_t hl, slurm_msg_t *msg, int timeout) * IN: err - int - error message from attempt * */ -extern void mark_as_failed_forward(List *ret_list, char *node_name, int err) +extern void mark_as_failed_forward(List *ret_list, char *node_name, int err) { ret_data_info_t *ret_data_info = NULL; - + debug3("problems with %s", node_name); - if(!*ret_list) + if(!*ret_list) *ret_list = list_create(destroy_data_info); - + ret_data_info = xmalloc(sizeof(ret_data_info_t)); ret_data_info->node_name = xstrdup(node_name); ret_data_info->type = RESPONSE_FORWARD_FAILED; ret_data_info->err = err; list_push(*ret_list, ret_data_info); - + return; } extern void forward_wait(slurm_msg_t * msg) { int count = 0; - + /* wait for all the other messages on the tree under us */ if(msg->forward_struct) { debug2("looking for %d", msg->forward_struct->fwd_cnt); slurm_mutex_lock(&msg->forward_struct->forward_mutex); count = 0; - if (msg->ret_list != NULL) + if (msg->ret_list != NULL) count = list_count(msg->ret_list); - + debug2("Got back %d", count); while((count < msg->forward_struct->fwd_cnt)) { - pthread_cond_wait(&msg->forward_struct->notify, + pthread_cond_wait(&msg->forward_struct->notify, &msg->forward_struct->forward_mutex); - + if (msg->ret_list != NULL) { count = list_count(msg->ret_list); } debug2("Got back %d", count); - + } debug2("Got them all"); slurm_mutex_unlock(&msg->forward_struct->forward_mutex); @@ -664,14 +664,14 @@ void destroy_data_info(void *object) { ret_data_info_t *ret_data_info = (ret_data_info_t *)object; if(ret_data_info) { - slurm_free_msg_data(ret_data_info->type, - ret_data_info->data); + slurm_free_msg_data(ret_data_info->type, + ret_data_info->data); xfree(ret_data_info->node_name); xfree(ret_data_info); } } -void destroy_forward(forward_t *forward) +void destroy_forward(forward_t *forward) { if(forward->init == FORWARD_INIT) { xfree(forward->nodelist); diff --git a/src/common/forward.h b/src/common/forward.h index da707a5712..31e12f8a43 100644 --- a/src/common/forward.h +++ b/src/common/forward.h @@ -7,32 +7,32 @@ * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Danny Auble * CODE-OCEC-09-009. All rights reserved. - * + * * This file is part of SLURM, a resource management program. * For details, see . * Please also read the included file: DISCLAIMER. - * + * * SLURM is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free * Software Foundation; either version 2 of the License, or (at your option) * any later version. * - * In addition, as a special exception, the copyright holders give permission + * In addition, as a special exception, the copyright holders give permission * to link the code of portions of this program with the OpenSSL library under - * certain conditions as described in each individual source file, and - * distribute linked combinations including the two. You must obey the GNU - * General Public License in all respects for all of the code used other than - * OpenSSL. If you modify file(s) with this exception, you may extend this - * exception to your version of the file(s), but you are not obligated to do + * certain conditions as described in each individual source file, and + * distribute linked combinations including the two. You must obey the GNU + * General Public License in all respects for all of the code used other than + * OpenSSL. If you modify file(s) with this exception, you may extend this + * exception to your version of the file(s), but you are not obligated to do * so. If you do not wish to do so, delete this exception statement from your - * version. If you delete this exception statement from all source files in + * version. If you delete this exception statement from all source files in * the program, then also delete it here. - * + * * SLURM is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. - * + * * You should have received a copy of the GNU General Public License along * with SLURM; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. @@ -45,7 +45,7 @@ #include "src/common/slurm_protocol_api.h" /* - * forward_init - initilize forward structure + * forward_init - initilize forward structure * IN: forward - forward_t * - struct to store forward info * IN: from - forward_t * - (OPTIONAL) can be NULL, can be used to * init the forward to this state @@ -59,21 +59,21 @@ extern void forward_init(forward_t *forward, forward_t *from); * the forwarded message * * IN: forward_struct - forward_struct_t * - holds information about message - * that needs to be forwarded to + * that needs to be forwarded to * childern processes * IN: header - header_t - header from message that came in * needing to be forwarded. * RET: SLURM_SUCCESS - int */ /********************************************************************* -// Code taken from common/slurm_protocol_api.c +// Code taken from common/slurm_protocol_api.c // Set up the forward_struct using the remainder of the buffer being received, // right after header has been removed form the original buffer forward_struct = xmalloc(sizeof(forward_struct_t)); forward_struct->buf_len = remaining_buf(buffer); forward_struct->buf = xmalloc(sizeof(char) * forward_struct->buf_len); -memcpy(forward_struct->buf, &buffer->head[buffer->processed], +memcpy(forward_struct->buf, &buffer->head[buffer->processed], forward_struct->buf_len); forward_struct->ret_list = ret_list; @@ -85,7 +85,7 @@ if (forward_msg(forward_struct, &header) == SLURM_ERROR) { } *********************************************************************/ -extern int forward_msg(forward_struct_t *forward_struct, +extern int forward_msg(forward_struct_t *forward_struct, header_t *header); @@ -111,20 +111,20 @@ extern List start_msg_tree(hostlist_t hl, slurm_msg_t *msg, int timeout); * IN: err - int - error message from attempt * */ -extern void mark_as_failed_forward(List *ret_list, char *node_name, int err); +extern void mark_as_failed_forward(List *ret_list, char *node_name, int err); extern void forward_wait(slurm_msg_t *msg); /* - * no_resp_forward - Used to respond for nodes not able to respond since + * no_resp_forward - Used to respond for nodes not able to respond since * the parent had failed in some way - * IN: forward - forward_t * - - * IN: ret_list - List * - + * IN: forward - forward_t * - + * IN: ret_list - List * - * IN: err - int - type of error from parent * RET: SLURM_SUCCESS - int */ /********************************************************************* -Code taken from common/slurm_protocol_api.c +Code taken from common/slurm_protocol_api.c //This function should only be used after a message is recieved. // a call to slurm_receive_msg will fill in a ret_list @@ -133,7 +133,7 @@ Code taken from common/slurm_protocol_api.c // if ret_list is null or list_count is 0 means there may have been an error // this fuction will check to make sure if there were supposed to be forwards -// we handle the return code for the messages +// we handle the return code for the messages if(!ret_list || list_count(ret_list) == 0) { no_resp_forwards(&req->forward, &ret_list, errno); } @@ -144,5 +144,5 @@ if(!ret_list || list_count(ret_list) == 0) { extern void destroy_data_info(void *object); extern void destroy_forward(forward_t *forward); extern void destroy_forward_struct(forward_struct_t *forward_struct); - + #endif diff --git a/src/common/getopt.c b/src/common/getopt.c index 8a2f95b77a..b0f9c2460d 100644 --- a/src/common/getopt.c +++ b/src/common/getopt.c @@ -20,7 +20,7 @@ License along with the GNU C Library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ - + /* This tells Alpha OSF/1 not to define a getopt prototype in . Ditto for AIX 3.2 and . */ #ifndef _NO_PROTO @@ -189,7 +189,7 @@ static enum /* Value of POSIXLY_CORRECT environment variable. */ static char *posixly_correct; - + #ifdef __GNU_LIBRARY__ /* We want to avoid inclusion of string.h with non-GNU libraries because there are many ways it can cause trouble. @@ -239,7 +239,7 @@ extern int strlen (const char *); #endif /* __GNUC__ */ #endif /* not __GNU_LIBRARY__ */ - + /* Handle permutation of arguments. */ /* Describe the part of ARGV that contains non-options that have @@ -445,7 +445,7 @@ _getopt_initialize (argc, argv, optstring) return optstring; } - + /* Scan elements of ARGV (whose length is ARGC) for option characters given in OPTSTRING. @@ -514,7 +514,7 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only) int print_errors = opterr; if (optstring[0] == ':') print_errors = 0; - + if (argc < 1) return -1; @@ -981,7 +981,7 @@ getopt (argc, argv, optstring) } #endif /* Not ELIDE_CODE. */ - + #ifdef TEST /* Compile with -DTEST to make an executable for use in testing diff --git a/src/common/getopt1.c b/src/common/getopt1.c index 53aabec594..0895272500 100644 --- a/src/common/getopt1.c +++ b/src/common/getopt1.c @@ -17,7 +17,7 @@ License along with the GNU C Library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ - + #ifdef HAVE_CONFIG_H #include #endif @@ -92,7 +92,7 @@ getopt_long_only (argc, argv, options, long_options, opt_index) #endif /* Not ELIDE_CODE. */ - + #ifdef TEST #include diff --git a/src/common/hostlist.c b/src/common/hostlist.c index 0009dde0a8..1ee2eb8f8f 100644 --- a/src/common/hostlist.c +++ b/src/common/hostlist.c @@ -7,32 +7,32 @@ * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Mark Grondona * CODE-OCEC-09-009. All rights reserved. - * + * * This file is part of SLURM, a resource management program. * For details, see . * Please also read the included file: DISCLAIMER. - * + * * SLURM is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free * Software Foundation; either version 2 of the License, or (at your option) * any later version. * - * In addition, as a special exception, the copyright holders give permission + * In addition, as a special exception, the copyright holders give permission * to link the code of portions of this program with the OpenSSL library under - * certain conditions as described in each individual source file, and - * distribute linked combinations including the two. You must obey the GNU - * General Public License in all respects for all of the code used other than - * OpenSSL. If you modify file(s) with this exception, you may extend this - * exception to your version of the file(s), but you are not obligated to do + * certain conditions as described in each individual source file, and + * distribute linked combinations including the two. You must obey the GNU + * General Public License in all respects for all of the code used other than + * OpenSSL. If you modify file(s) with this exception, you may extend this + * exception to your version of the file(s), but you are not obligated to do * so. If you do not wish to do so, delete this exception statement from your - * version. If you delete this exception statement from all source files in + * version. If you delete this exception statement from all source files in * the program, then also delete it here. - * + * * SLURM is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. - * + * * You should have received a copy of the GNU General Public License along * with SLURM; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. @@ -76,8 +76,8 @@ #include "src/common/xassert.h" /* - * Define slurm-specific aliases for use by plugins, see slurm_xlator.h - * for details. + * Define slurm-specific aliases for use by plugins, see slurm_xlator.h + * for details. */ strong_alias(hostlist_create, slurm_hostlist_create); strong_alias(hostlist_copy, slurm_hostlist_copy); @@ -157,7 +157,7 @@ extern void * lsd_nomem_error(char *file, int line, char *mesg); return(lsd_nomem_error(__FILE__, __LINE__, mesg)); \ } while (0) -/* +/* * Some constants and tunables: */ @@ -303,19 +303,19 @@ static pthread_mutex_t multi_dim_lock = PTHREAD_MUTEX_INITIALIZER; static void _parse_int_to_array(int in, int out[SYSTEM_DIMENSIONS]); static int _tell_if_used(int dim, int curr, int start[SYSTEM_DIMENSIONS], - int end[SYSTEM_DIMENSIONS], + int end[SYSTEM_DIMENSIONS], int last[SYSTEM_DIMENSIONS], int *found); static int _get_next_box(int start[SYSTEM_DIMENSIONS], int end[SYSTEM_DIMENSIONS]); static int _get_boxes(char *buf, int max_len); -static void _set_box_in_grid(int dim, int curr, +static void _set_box_in_grid(int dim, int curr, int start[SYSTEM_DIMENSIONS], int end[SYSTEM_DIMENSIONS], bool value); static int _add_box_ranges(int dim, int curr, int start[SYSTEM_DIMENSIONS], - int end[SYSTEM_DIMENSIONS], + int end[SYSTEM_DIMENSIONS], int pos[SYSTEM_DIMENSIONS], struct _range *ranges, int len, int *count); @@ -326,8 +326,8 @@ static void _set_min_max_of_grid(int dim, int curr, int max[SYSTEM_DIMENSIONS], int pos[SYSTEM_DIMENSIONS]); static void _set_grid(unsigned long start, unsigned long end); -static bool _test_box_in_grid(int dim, int curr, - int start[SYSTEM_DIMENSIONS], +static bool _test_box_in_grid(int dim, int curr, + int start[SYSTEM_DIMENSIONS], int end[SYSTEM_DIMENSIONS]); static bool _test_box(int start[SYSTEM_DIMENSIONS], int end[SYSTEM_DIMENSIONS]); #endif @@ -363,7 +363,7 @@ static char * hostrange_shift(hostrange_t); static int hostrange_join(hostrange_t, hostrange_t); static hostrange_t hostrange_intersect(hostrange_t, hostrange_t); static int hostrange_hn_within(hostrange_t, hostname_t); -static size_t hostrange_to_string(hostrange_t hr, size_t, char *, +static size_t hostrange_to_string(hostrange_t hr, size_t, char *, char *); static size_t hostrange_numstr(hostrange_t, size_t, char *); @@ -451,7 +451,7 @@ static int hostset_find_host(hostset_t, const char *); #define UNLOCK_HOSTLIST(_hl) \ do { \ mutex_unlock(&(_hl)->mutex); \ - } while (0) + } while (0) #define seterrno_ret(_errno, _rc) \ do { \ @@ -475,7 +475,7 @@ static void _error(char *file, int line, char *msg, ...) va_start(ap, msg); len = vsnprintf(buf, 1024, msg, ap); - if ((len < 0) || (len > 1024)) + if ((len < 0) || (len > 1024)) buf[1023] = '\0'; lsd_fatal_error(file, line, buf); @@ -484,8 +484,8 @@ static void _error(char *file, int line, char *msg, ...) return; } -/* - * Helper function for host list string parsing routines +/* + * Helper function for host list string parsing routines * Returns a pointer to the next token; additionally advance *str * to the next separator. * @@ -517,7 +517,7 @@ static char * _next_tok(char *sep, char **str) if ((memchr(tok, '[', *str - tok) != NULL) && (memchr(tok, ']', *str - tok) == NULL)) { char *q = strchr(*str, ']'); - + if (q && (memchr(*str, '[', q - *str) == NULL)) *str = ++q; @@ -555,12 +555,12 @@ static int _zero_padded(unsigned long num, int width) } /* test whether two format `width' parameters are "equivalent" - * The width arguments "wn" and "wm" for integers "n" and "m" + * The width arguments "wn" and "wm" for integers "n" and "m" * are equivalent if: - * + * * o wn == wm OR * - * o applying the same format width (either wn or wm) to both of + * o applying the same format width (either wn or wm) to both of * 'n' and 'm' will not change the zero padding of *either* 'm' nor 'n'. * * If this function returns 1 (or true), the appropriate width value @@ -602,7 +602,7 @@ static int _width_equiv(unsigned long n, int *wn, unsigned long m, int *wm) /* ----[ hostname_t functions ]---- */ -/* +/* * return the location of the last char in the hostname prefix */ static int host_prefix_end(const char *hostname) @@ -627,13 +627,13 @@ static int host_prefix_end(const char *hostname) return -1; idx = len - 1; - while (idx >= 0 && isdigit((char) hostname[idx])) + while (idx >= 0 && isdigit((char) hostname[idx])) idx--; #endif return idx; } -/* +/* * create a hostname_t object from a string hostname */ static hostname_t hostname_create(const char *hostname) @@ -666,7 +666,7 @@ static hostname_t hostname_create(const char *hostname) } hn->suffix = hn->hostname + idx + 1; -#if (SYSTEM_DIMENSIONS > 1) +#if (SYSTEM_DIMENSIONS > 1) if(strlen(hn->suffix) != SYSTEM_DIMENSIONS) hostlist_base = 10; #endif @@ -704,7 +704,7 @@ static void hostname_destroy(hostname_t hn) free(hn); } -/* return true if the hostname has a valid numeric suffix +/* return true if the hostname has a valid numeric suffix */ static int hostname_suffix_is_valid(hostname_t hn) { @@ -726,12 +726,12 @@ static int hostname_suffix_width(hostname_t hn) /* ----[ hostrange_t functions ]---- */ -/* allocate a new hostrange object +/* allocate a new hostrange object */ static hostrange_t hostrange_new(void) { hostrange_t new = (hostrange_t) malloc(sizeof(*new)); - if (!new) + if (!new) out_of_memory("hostrange create"); return new; } @@ -861,7 +861,7 @@ static hostrange_t hostrange_delete_host(hostrange_t hr, unsigned long n) /* hostrange_cmp() is used to sort hostrange objects. It will * sort based on the following (in order): * o result of strcmp on prefixes - * o if widths are compatible, then: + * o if widths are compatible, then: * sort based on lowest suffix in range * else * sort based on width */ @@ -880,11 +880,11 @@ static int hostrange_cmp(hostrange_t h1, hostrange_t h2) } -/* compare the prefixes of two hostrange objects. +/* compare the prefixes of two hostrange objects. * returns: * < 0 if h1 prefix is less than h2 OR h2 == NULL. * - * 0 if h1's prefix and h2's prefix match, + * 0 if h1's prefix and h2's prefix match, * UNLESS, either h1 or h2 (NOT both) do not have a valid suffix. * * > 0 if h1's prefix is greater than h2's OR h1 == NULL. */ @@ -918,7 +918,7 @@ static int hostrange_within_range(hostrange_t h1, hostrange_t h2) } -/* compare two hostrange objects to determine if they are width +/* compare two hostrange objects to determine if they are width * compatible, returns: * 1 if widths can safely be combined * 0 if widths cannot be safely combined @@ -955,7 +955,7 @@ static char *hostrange_pop(hostrange_t hr) hr->lo++; /* effectively set count == 0 */ host = strdup(hr->prefix); } else if (hostrange_count(hr) > 0) { - size = strlen(hr->prefix) + hr->width + 16; + size = strlen(hr->prefix) + hr->width + 16; if (!(host = (char *) malloc(size * sizeof(char)))) out_of_memory("hostrange pop"); #if (SYSTEM_DIMENSIONS > 1) @@ -974,11 +974,11 @@ static char *hostrange_pop(hostrange_t hr) hr->hi--; host[len] = '\0'; } else { - snprintf(host, size, "%s%0*lu", hr->prefix, + snprintf(host, size, "%s%0*lu", hr->prefix, hr->width, hr->hi--); } #else - snprintf(host, size, "%s%0*lu", hr->prefix, + snprintf(host, size, "%s%0*lu", hr->prefix, hr->width, hr->hi--); #endif } @@ -1021,7 +1021,7 @@ static char *hostrange_shift(hostrange_t hr) snprintf(host, size, "%s%0*lu", hr->prefix, hr->width, hr->lo++); } -#else +#else snprintf(host, size, "%s%0*lu", hr->prefix, hr->width, hr->lo++); #endif @@ -1037,7 +1037,7 @@ static char *hostrange_shift(hostrange_t hr) * * -1 if ranges do not overlap (including incompatible zero padding) * 0 if ranges join perfectly - * >0 number of hosts that were duplicated in h1 and h2 + * >0 number of hosts that were duplicated in h1 and h2 * * h2 will be coalesced into h1 if rc >= 0 * @@ -1091,7 +1091,7 @@ static hostrange_t hostrange_intersect(hostrange_t h1, hostrange_t h2) assert(hostrange_cmp(h1, h2) <= 0); if ((hostrange_prefix_cmp(h1, h2) == 0) - && (h1->hi > h2->lo) + && (h1->hi > h2->lo) && (hostrange_width_combine(h1, h2))) { if (!(new = hostrange_copy(h1))) @@ -1109,24 +1109,24 @@ static hostrange_t hostrange_intersect(hostrange_t h1, hostrange_t h2) static int hostrange_hn_within(hostrange_t hr, hostname_t hn) { if (hr->singlehost) { - /* - * If the current hostrange [hr] is a `singlehost' (no valid + /* + * If the current hostrange [hr] is a `singlehost' (no valid * numeric suffix (lo and hi)), then the hostrange [hr] * stores just one host with name == hr->prefix. - * + * * Thus the full hostname in [hn] must match hr->prefix, in - * which case we return true. Otherwise, there is no + * which case we return true. Otherwise, there is no * possibility that [hn] matches [hr]. */ if (strcmp (hn->hostname, hr->prefix) == 0) return 1; - else + else return 0; } /* * Now we know [hr] is not a "singlehost", so hostname - * better have a valid numeric suffix, or there is no + * better have a valid numeric suffix, or there is no * way we can match */ if (!hostname_suffix_is_valid (hn)) @@ -1136,7 +1136,7 @@ static int hostrange_hn_within(hostrange_t hr, hostname_t hn) * If hostrange and hostname prefixes don't match, then * there is way the hostname falls within the range [hr]. */ - if (strcmp(hr->prefix, hn->prefix) != 0) + if (strcmp(hr->prefix, hn->prefix) != 0) return 0; /* @@ -1166,7 +1166,7 @@ hostrange_to_string(hostrange_t hr, size_t n, char *buf, char *separator) if (n == 0) return 0; - + assert(hr != NULL); if (hr->singlehost) @@ -1191,7 +1191,7 @@ hostrange_to_string(hostrange_t hr, size_t n, char *buf, char *separator) ret = snprintf(buf + len, m, "%s%0*lu", hr->prefix, hr->width, i); } -#else +#else ret = snprintf(buf + len, m, "%s%0*lu", hr->prefix, hr->width, i); #endif @@ -1230,18 +1230,18 @@ static size_t hostrange_numstr(hostrange_t hr, size_t n, char *buf) if (hr->width == SYSTEM_DIMENSIONS) { int i2=0; int coord[SYSTEM_DIMENSIONS]; - + _parse_int_to_array(hr->lo, coord); - + for(i2 = 0; i2width, hr->lo); } -#else +#else len = snprintf(buf, n, "%0*lu", hr->width, hr->lo); #endif @@ -1251,7 +1251,7 @@ static size_t hostrange_numstr(hostrange_t hr, size_t n, char *buf) if (hr->width == SYSTEM_DIMENSIONS) { int i2=0; int coord[SYSTEM_DIMENSIONS]; - + _parse_int_to_array(hr->hi, coord); buf[len++] = '-'; @@ -1259,15 +1259,15 @@ static size_t hostrange_numstr(hostrange_t hr, size_t n, char *buf) if(len <= n) buf[len++] = alpha_num[coord[i2]]; } - buf[len] = '\0'; + buf[len] = '\0'; } else { - len2 = snprintf(buf+len, n-len, "-%0*lu", + len2 = snprintf(buf+len, n-len, "-%0*lu", hr->width, hr->hi); } -#else +#else len2 = snprintf(buf+len, n-len, "-%0*lu", hr->width, hr->hi); #endif - if (len2 < 0) + if (len2 < 0) len = -1; else len += len2; @@ -1279,7 +1279,7 @@ static size_t hostrange_numstr(hostrange_t hr, size_t n, char *buf) /* ----[ hostlist functions ]---- */ -/* Create a new hostlist object. +/* Create a new hostlist object. * Returns an empty hostlist, or NULL if memory allocation fails. */ static hostlist_t hostlist_new(void) @@ -1316,9 +1316,9 @@ fail1: /* Resize the internal array used to store the list of hostrange objects. * * returns 1 for a successful resize, - * 0 if call to _realloc fails + * 0 if call to _realloc fails * - * It is assumed that the caller has the hostlist hl locked + * It is assumed that the caller has the hostlist hl locked */ static int hostlist_resize(hostlist_t hl, size_t newsize) { @@ -1329,7 +1329,7 @@ static int hostlist_resize(hostlist_t hl, size_t newsize) oldsize = hl->size; hl->size = newsize; hl->hr = realloc((void *) hl->hr, hl->size*sizeof(hostrange_t)); - if (!(hl->hr)) + if (!(hl->hr)) return 0; for (i = oldsize; i < newsize; i++) @@ -1392,7 +1392,7 @@ error: /* Same as hostlist_push_range() above, but prefix, lo, hi, and width - * are passed as args + * are passed as args */ static int hostlist_push_hr(hostlist_t hl, char *prefix, unsigned long lo, @@ -1495,7 +1495,7 @@ hostlist_t _hostlist_create(const char *hostlist, char *sep, char *r_op) "Bluegene or Sun Constellation systems!!!!"); #endif orig = str = strdup(hostlist); - + /* return an empty list if an empty string was passed in */ if (str == NULL || strlen(str) == 0) goto done; @@ -1511,23 +1511,23 @@ hostlist_t _hostlist_create(const char *hostlist, char *sep, char *r_op) high = low = 0; - /* find end of alpha part + /* find end of alpha part * do this by finding last occurence of range_op in str */ pos = strlen(tok) - 1; if (strstr(tok, r_op) != '\0') { - while (pos >= 0 && (char) tok[pos] != range_op) + while (pos >= 0 && (char) tok[pos] != range_op) pos--; } /* now back up past any digits */ while (pos >= 0 && isdigit((char) tok[--pos])) {;} - /* Check for valid x-y range (x must be a digit) + /* Check for valid x-y range (x must be a digit) * Reset pos if the range is not valid */ if (!isdigit((char) tok[++pos])) pos = strlen(tok) - 1; - /* create prefix string + /* create prefix string * if prefix will be zero length, but prefix already exists * use the previous prefix and fmt */ @@ -1547,7 +1547,7 @@ hostlist_t _hostlist_create(const char *hostlist, char *sep, char *r_op) } else tok += pos; -#if (SYSTEM_DIMENSIONS > 1) +#if (SYSTEM_DIMENSIONS > 1) if(strlen(tok) != SYSTEM_DIMENSIONS) hostlist_base = 10; else @@ -1595,7 +1595,7 @@ hostlist_t _hostlist_create(const char *hostlist, char *sep, char *r_op) high = 0; /* special case, ugh. */ } - /* error if: + /* error if: * 1. we are not at end of string * 2. upper bound equals lower bound */ @@ -1622,7 +1622,7 @@ done: #else /* !WANT_RECKLESS_HOSTRANGE_EXPANSION */ -hostlist_t _hostlist_create(const char *hostlist, char *sep, char *r_op) +hostlist_t _hostlist_create(const char *hostlist, char *sep, char *r_op) { return _hostlist_create_bracketed(hostlist, sep, r_op); } @@ -1634,7 +1634,7 @@ hostlist_t _hostlist_create(const char *hostlist, char *sep, char *r_op) static int _parse_box_range(char *str, struct _range *ranges, int len, int *count) { - + #if (SYSTEM_DIMENSIONS > 1) int start[SYSTEM_DIMENSIONS], end[SYSTEM_DIMENSIONS], pos[SYSTEM_DIMENSIONS]; @@ -1642,10 +1642,10 @@ static int _parse_box_range(char *str, struct _range *ranges, char coord2[SYSTEM_DIMENSIONS+1]; int i, a; - if ((str[SYSTEM_DIMENSIONS] != 'x') || - (str[(SYSTEM_DIMENSIONS * 2) + 1] != '\0')) + if ((str[SYSTEM_DIMENSIONS] != 'x') || + (str[(SYSTEM_DIMENSIONS * 2) + 1] != '\0')) return 0; - + for(i = 0; i= '0') && (str[i] <= '9')) start[i] = str[i] - '0'; @@ -1679,7 +1679,7 @@ static int _parse_box_range(char *str, struct _range *ranges, #endif } -/* Grab a single range from str +/* Grab a single range from str * returns 1 if str contained a valid number or range, * 0 if conversion of str to a range failed. */ @@ -1689,39 +1689,39 @@ static int _parse_single_range(const char *str, struct _range *range) char *orig = strdup(str); int hostlist_base = HOSTLIST_BASE; - if (!orig) + if (!orig) seterrno_ret(ENOMEM, 0); - - if ((p = strchr(str, 'x'))) + + if ((p = strchr(str, 'x'))) goto error; /* do NOT allow boxes here */ - + if ((p = strchr(str, '-'))) { *p++ = '\0'; if (*p == '-') /* do NOT allow negative numbers */ goto error; } - + range->width = strlen(str); - + #if (SYSTEM_DIMENSIONS > 1) /* If we get something here where the width is not SYSTEM_DIMENSIONS we need to treat it as a regular number since that is how it will be treated in the future. */ - if(range->width != SYSTEM_DIMENSIONS) - hostlist_base = 10; + if(range->width != SYSTEM_DIMENSIONS) + hostlist_base = 10; #endif range->lo = strtoul(str, &q, hostlist_base); - if (q == str) + if (q == str) goto error; - + range->hi = (p && *p) ? strtoul(p, &q, hostlist_base) : range->lo; - if (q == p || *q != '\0') + if (q == p || *q != '\0') goto error; - - if (range->lo > range->hi) + + if (range->lo > range->hi) goto error; if (range->hi - range->lo + 1 > MAX_RANGE ) { @@ -1733,7 +1733,7 @@ static int _parse_single_range(const char *str, struct _range *range) free(orig); return 1; - + error: errno = EINVAL; _error(__FILE__, __LINE__, "Invalid range: `%s'", orig); @@ -1743,7 +1743,7 @@ error: /* * Convert 'str' containing comma separated digits and ranges into an array - * of struct _range types (max 'len' elements). + * of struct _range types (max 'len' elements). * * Return number of ranges created, or -1 on error. */ @@ -1764,14 +1764,14 @@ static int _parse_range_list(char *str, struct _range *ranges, int len) *p++ = '\0'; /* info("looking at %s", str); */ if ((SYSTEM_DIMENSIONS > 1) && - (str[SYSTEM_DIMENSIONS] == 'x') && + (str[SYSTEM_DIMENSIONS] == 'x') && (strlen(str) == (SYSTEM_DIMENSIONS * 2 + 1))) { - if (!_parse_box_range(str, ranges, len, &count)) - return -1; + if (!_parse_box_range(str, ranges, len, &count)) + return -1; } else { - if (!_parse_single_range(str, &ranges[count++])) - return -1; - } + if (!_parse_single_range(str, &ranges[count++])) + return -1; + } str = p; } return count; @@ -1810,7 +1810,7 @@ _push_range_list(hostlist_t hl, char *prefix, struct _range *range, } for (j = pre_range->lo; j <= pre_range->hi; j++) { snprintf(new_prefix, sizeof(new_prefix), - "%s%0*lu%s", tmp_prefix, + "%s%0*lu%s", tmp_prefix, pre_range->width, j, q); range = saved_range; for (k = 0; k < n; k++) { @@ -1826,7 +1826,7 @@ _push_range_list(hostlist_t hl, char *prefix, struct _range *range, } for (k = 0; k < n; k++) { - hostlist_push_hr(hl, prefix, + hostlist_push_hr(hl, prefix, range->lo, range->hi, range->width); range++; } @@ -1834,10 +1834,10 @@ _push_range_list(hostlist_t hl, char *prefix, struct _range *range, } /* - * Create a hostlist from a string with brackets '[' ']' to aid + * Create a hostlist from a string with brackets '[' ']' to aid * detection of ranges and compressed lists */ -static hostlist_t +static hostlist_t _hostlist_create_bracketed(const char *hostlist, char *sep, char *r_op) { hostlist_t new = hostlist_new(); @@ -1853,7 +1853,7 @@ _hostlist_create_bracketed(const char *hostlist, char *sep, char *r_op) hostlist_destroy(new); return NULL; } - + while ((tok = _next_tok(sep, &str)) != NULL) { strncpy(cur_tok, tok, 1024); if ((p = strrchr(tok, '[')) != NULL) { @@ -1865,13 +1865,13 @@ _hostlist_create_bracketed(const char *hostlist, char *sep, char *r_op) goto error; *q = '\0'; nr = _parse_range_list(p, ranges, MAX_RANGES); - if (nr < 0) + if (nr < 0) goto error; if (_push_range_list(new, prefix, ranges, nr)) goto error; } else { /* The hostname itself contains a '[' - * (no ']' found). + * (no ']' found). * Not likely what the user * wanted. We will just tack one on * the end. */ @@ -1883,7 +1883,7 @@ _hostlist_create_bracketed(const char *hostlist, char *sep, char *r_op) } - } else + } else hostlist_push_host(new, cur_tok); } @@ -1984,7 +1984,7 @@ int hostlist_push_host(hostlist_t hl, const char *str) hostname_suffix_width(hn)); else hr = hostrange_create_single(str); - + hostlist_push_range(hl, hr); hostrange_destroy(hr); @@ -2018,7 +2018,7 @@ char *hostlist_pop(hostlist_t hl) error("hostlist_pop: no hostlist given"); return NULL; } - + LOCK_HOSTLIST(hl); if (hl->nhosts > 0) { hostrange_t hr = hl->hr[hl->nranges - 1]; @@ -2033,7 +2033,7 @@ char *hostlist_pop(hostlist_t hl) return host; } -/* find all iterators affected by a shift (or deletion) at +/* find all iterators affected by a shift (or deletion) at * hl->hr[idx], depth, with the deletion of n ranges */ static void hostlist_shift_iterators(hostlist_t hl, int idx, int depth, int n) @@ -2142,7 +2142,7 @@ char *hostlist_shift_range(hostlist_t hl) do { hostlist_push_range(hltmp, hl->hr[i]); hostrange_destroy(hl->hr[i]); - } while ( (++i < hl->nranges) + } while ( (++i < hl->nranges) && hostrange_within_range(hltmp->hr[0], hl->hr[i]) ); hostlist_shift_iterators(hl, i, 0, hltmp->nranges); @@ -2171,7 +2171,7 @@ int hostlist_delete(hostlist_t hl, const char *hosts) hostlist_t hltmp; if(!hl) return -1; - + if (!(hltmp = hostlist_create(hosts))) seterrno_ret(EINVAL, 0); @@ -2211,7 +2211,7 @@ _hostrange_string(hostrange_t hr, int depth) if (hr->width == SYSTEM_DIMENSIONS) { int i2=0; int coord[SYSTEM_DIMENSIONS]; - + _parse_int_to_array((hr->lo+depth), coord); for(i2 = 0; i2width, hr->lo + depth); } #else - snprintf(buf+len, MAXHOSTNAMELEN+15 - len, "%0*lu", + snprintf(buf+len, MAXHOSTNAMELEN+15 - len, "%0*lu", hr->width, hr->lo + depth); #endif } @@ -2336,7 +2336,7 @@ done: return ret; } -/* hostrange compare with void * arguments to allow use with +/* hostrange compare with void * arguments to allow use with * libc qsort() */ int _cmp(const void *hr1, const void *hr2) @@ -2370,7 +2370,7 @@ void hostlist_sort(hostlist_t hl) } -/* search through hostlist for ranges that can be collapsed +/* search through hostlist for ranges that can be collapsed * does =not= delete any hosts */ static void hostlist_collapse(hostlist_t hl) @@ -2392,7 +2392,7 @@ static void hostlist_collapse(hostlist_t hl) UNLOCK_HOSTLIST(hl); } -/* search through hostlist (hl) for intersecting ranges +/* search through hostlist (hl) for intersecting ranges * split up duplicates and coalesce ranges where possible */ static void hostlist_coalesce(hostlist_t hl) @@ -2584,21 +2584,21 @@ static void _parse_int_to_array(int in, int out[SYSTEM_DIMENSIONS]) static int my_start_pow = 0; int my_pow_minus = my_start_pow_minus; int my_pow = my_start_pow; - + if(!my_start_pow) { /* this will never change so just calculate it once */ my_start_pow = 1; - + /* To avoid having to use the pow function and include the math lib everywhere just do this. */ - for(a = 0; a end[i]) return false; @@ -3004,11 +3004,11 @@ ssize_t hostlist_ranged_string(hostlist_t hl, size_t n, char *buf) /* compute things that only need to be calculated once */ if(dim_grid_size == -1) { - int i; + int i; dim_grid_size = sizeof(grid_start); /* the last one is always 1 */ offset[SYSTEM_DIMENSIONS-1] = 1; - for(i=(SYSTEM_DIMENSIONS-2); i>=0; i--) + for(i=(SYSTEM_DIMENSIONS-2); i>=0; i--) offset[i] = offset[i+1] * HOSTLIST_BASE; } @@ -3045,7 +3045,7 @@ ssize_t hostlist_ranged_string(hostlist_t hl, size_t n, char *buf) "%d chars long", SYSTEM_DIMENSIONS, i, hl->hr[i]->width); } - goto notbox; + goto notbox; } _set_grid(hl->hr[i]->lo, hl->hr[i]->hi); } @@ -3082,7 +3082,7 @@ ssize_t hostlist_ranged_string(hostlist_t hl, size_t n, char *buf) too_long: len = n; /* truncated */ box = true; - + notbox: #endif if (!box) { @@ -3095,7 +3095,7 @@ notbox: } UNLOCK_HOSTLIST(hl); - + /* NUL terminate */ if (len >= n) { truncated = 1; @@ -3116,7 +3116,7 @@ notbox: static hostlist_iterator_t hostlist_iterator_new(void) { hostlist_iterator_t i = (hostlist_iterator_t) malloc(sizeof(*i)); - if (!i) + if (!i) return NULL; i->hl = NULL; i->hr = NULL; @@ -3239,7 +3239,7 @@ char *hostlist_next(hostlist_iterator_t i) if(len <= (MAXHOSTNAMELEN + 15)) buf[len++] = alpha_num[coord[i2]]; } - buf[len] = '\0'; + buf[len] = '\0'; } else { snprintf(buf + len, MAXHOSTNAMELEN + 15 - len, "%0*lu", i->hr->width, i->hr->lo + i->depth); @@ -3347,7 +3347,7 @@ void hostset_destroy(hostset_t set) free(set); } -/* inserts a single range object into a hostset +/* inserts a single range object into a hostset * Assumes that the set->hl lock is already held * Updates hl->nhosts */ @@ -3369,7 +3369,7 @@ static int hostset_insert_range(hostset_t set, hostrange_t hr) for (i = 0; i < hl->nranges; i++) { if (hostrange_cmp(hr, hl->hr[i]) <= 0) { - if ((ndups = hostrange_join(hr, hl->hr[i])) >= 0) + if ((ndups = hostrange_join(hr, hl->hr[i])) >= 0) hostlist_delete_range(hl, i); else if (ndups < 0) ndups = 0; @@ -3412,7 +3412,7 @@ int hostset_insert(hostset_t set, const char *hosts) hostlist_uniq(hl); LOCK_HOSTLIST(set->hl); - for (i = 0; i < hl->nranges; i++) + for (i = 0; i < hl->nranges; i++) n += hostset_insert_range(set, hl->hr[i]); UNLOCK_HOSTLIST(set->hl); hostlist_destroy(hl); @@ -3543,7 +3543,7 @@ int hostset_find(hostset_t set, const char *hostname) return hostlist_find(set->hl, hostname); } -#if TEST_MAIN +#if TEST_MAIN int hostlist_nranges(hostlist_t hl) { @@ -3617,7 +3617,7 @@ int main(int ac, char **av) exit(1); } - /* build a temporary hostlist, remove duplicates, + /* build a temporary hostlist, remove duplicates, * use it to make the hostset */ if (!(hl2 = hostlist_create(ac > 1 ? av[1] : NULL))) { perror("hostlist_create"); diff --git a/src/common/hostlist.h b/src/common/hostlist.h index 047cfc6356..e0031980c8 100644 --- a/src/common/hostlist.h +++ b/src/common/hostlist.h @@ -7,32 +7,32 @@ * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Mark Grondona * CODE-OCEC-09-009. All rights reserved. - * + * * This file is part of SLURM, a resource management program. * For details, see . * Please also read the included file: DISCLAIMER. - * + * * SLURM is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free * Software Foundation; either version 2 of the License, or (at your option) * any later version. * - * In addition, as a special exception, the copyright holders give permission - * to link the code of portions of this program with the OpenSSL library under - * certain conditions as described in each individual source file, and - * distribute linked combinations including the two. You must obey the GNU - * General Public License in all respects for all of the code used other than - * OpenSSL. If you modify file(s) with this exception, you may extend this - * exception to your version of the file(s), but you are not obligated to do + * In addition, as a special exception, the copyright holders give permission + * to link the code of portions of this program with the OpenSSL library under + * certain conditions as described in each individual source file, and + * distribute linked combinations including the two. You must obey the GNU + * General Public License in all respects for all of the code used other than + * OpenSSL. If you modify file(s) with this exception, you may extend this + * exception to your version of the file(s), but you are not obligated to do * so. If you do not wish to do so, delete this exception statement from your - * version. If you delete this exception statement from all source files in + * version. If you delete this exception statement from all source files in * the program, then also delete it here. - * + * * SLURM is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. - * + * * You should have received a copy of the GNU General Public License along * with SLURM; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. @@ -71,7 +71,7 @@ extern char *alpha_num; * #define lsd_fatal_error(file,line,mesg) \ * error("%s:%s %s\n",file,line,mesg); * - * If WITH_LSD_NOMEM_ERROR_FUNC is defined, the linker will expect to + * If WITH_LSD_NOMEM_ERROR_FUNC is defined, the linker will expect to * find an external lsd_nomem_error(file,line,mesg) function. By default, * lsd_nomem_error(file,line,mesg) is a macro definition that returns NULL. * This macro may be redefined to invoke another routine instead. @@ -80,9 +80,9 @@ extern char *alpha_num; * */ -/* The hostlist opaque data type +/* The hostlist opaque data type * - * A hostlist is a list of hostnames optimized for a prefixXXXX style + * A hostlist is a list of hostnames optimized for a prefixXXXX style * naming convention, where XXXX is a decimal, numeric suffix. */ #ifndef __hostlist_t_defined @@ -93,7 +93,7 @@ extern char *alpha_num; /* A hostset is a special case of a hostlist. It: * * 1. never contains duplicates - * 2. is always sorted + * 2. is always sorted * (Note: sort occurs first on alphanumeric prefix -- where prefix * matches, numeric suffixes will be sorted *by value*) */ @@ -101,7 +101,7 @@ typedef struct hostset * hostset_t; /* The hostlist iterator type (may be used with a hostset as well) * used for non-destructive access to hostlist members. - * + * */ typedef struct hostlist_iterator * hostlist_iterator_t; @@ -112,39 +112,39 @@ typedef struct hostlist_iterator * hostlist_iterator_t; //int set_grid(hostlist_t hl, int count); int set_grid(int start, int end, int count); /* - * hostlist_create(): + * hostlist_create(): * - * Create a new hostlist from a string representation. + * Create a new hostlist from a string representation. * * The string representation may contain one or more hostnames or - * bracketed hostlists separated by either `,' or whitespace (e.g. - * "alpha,beta,gamma"). A bracketed hostlist is denoted by a common + * bracketed hostlists separated by either `,' or whitespace (e.g. + * "alpha,beta,gamma"). A bracketed hostlist is denoted by a common * prefix followed by a list of numeric ranges contained within brackets - * (e.g. "tux[0-5,12,20-25]"). Note that the numeric ranges can include - * one or more leading zeros to indicate the numeric portion has a - * fixed number of digits (e.g. "linux[0000-1023]"). + * (e.g. "tux[0-5,12,20-25]"). Note that the numeric ranges can include + * one or more leading zeros to indicate the numeric portion has a + * fixed number of digits (e.g. "linux[0000-1023]"). * * To support the BlueGene system's 3-D topology, a node name prefix - * is followed by three digits identifying the node's position in + * is followed by three digits identifying the node's position in * the X, Y and Z positions respectively. For example "bgl123" represents * the node or midplane with an X position of 1, Y of 2, and Z of 3. * A rectangular prism may be described using two endpoint locations - * separated by "x" (e.g. "bgl[123x456]" selects all nodes with X - * positions between 1 and 4 inclusive, Y between 2 and 5, and Z between - * 3 and 6 for a total of 4*4*4=64 nodes). Two or more rectangular + * separated by "x" (e.g. "bgl[123x456]" selects all nodes with X + * positions between 1 and 4 inclusive, Y between 2 and 5, and Z between + * 3 and 6 for a total of 4*4*4=64 nodes). Two or more rectangular * prisms may be specified using comma separators within the brackets * (e.g. "bgl[000x133,400x533]"). * * Note: if this module is compiled with WANT_RECKLESS_HOSTRANGE_EXPANSION - * defined, a much more loose interpretation of host ranges is used. - * Reckless hostrange expansion allows all of the following (in addition to + * defined, a much more loose interpretation of host ranges is used. + * Reckless hostrange expansion allows all of the following (in addition to * bracketed hostlists): * * o tux0-5,tux12,tux20-25 * o tux0-tux5,tux12,tux20-tux25 * o tux0-5,12,20-25 * - * If str is NULL, and empty hostlist is created and returned. + * If str is NULL, and empty hostlist is created and returned. * * If the create fails, hostlist_create() returns NULL. * @@ -153,7 +153,7 @@ int set_grid(int start, int end, int count); */ hostlist_t hostlist_create(const char *hostlist); -/* hostlist_copy(): +/* hostlist_copy(): * * Allocate a copy of a hostlist object. Returned hostlist must be freed * with hostlist_destroy. @@ -175,7 +175,7 @@ void hostlist_destroy(hostlist_t hl); * * The hosts argument may take the same form as in hostlist_create() * - * Returns the number of hostnames inserted into the list, + * Returns the number of hostnames inserted into the list, * or 0 on failure. */ int hostlist_push(hostlist_t hl, const char *hosts); @@ -183,7 +183,7 @@ int hostlist_push(hostlist_t hl, const char *hosts); /* hostlist_push_host(): * - * Push a single host onto the hostlist hl. + * Push a single host onto the hostlist hl. * This function is more efficient than hostlist_push() for a single * hostname, since the argument does not need to be checked for ranges. * @@ -251,8 +251,8 @@ char * hostlist_shift_range(hostlist_t hl); /* hostlist_find(): * - * Searches hostlist hl for the first host matching hostname - * and returns position in list if found. + * Searches hostlist hl for the first host matching hostname + * and returns position in list if found. * * Returns -1 if host is not found. * @@ -271,7 +271,7 @@ int hostlist_delete(hostlist_t hl, const char *hosts); /* hostlist_delete_host(): * * Deletes the first host that matches `hostname' from the hostlist hl. - * Note: "hostname" argument cannot contain a range of hosts + * Note: "hostname" argument cannot contain a range of hosts * (see hostlist_delete() for this functionality.) * * Returns 1 if successful, 0 if hostname is not found in list. @@ -292,7 +292,7 @@ int hostlist_delete_nth(hostlist_t hl, int n); /* hostlist_count(): * * Return the number of hosts in hostlist hl. - */ + */ int hostlist_count(hostlist_t hl); /* hostlist_is_empty(): return true if hostlist is empty. */ @@ -301,7 +301,7 @@ int hostlist_count(hostlist_t hl); /* ----[ Other hostlist operations ]---- */ /* hostlist_sort(): - * + * * Sort the hostlist hl. * */ @@ -310,7 +310,7 @@ void hostlist_sort(hostlist_t hl); /* hostlist_uniq(): * * Sort the hostlist hl and remove duplicate entries. - * + * */ void hostlist_uniq(hostlist_t hl); @@ -330,7 +330,7 @@ void hostlist_uniq(hostlist_t hl); * the list. * * The result will be NULL terminated. - * + * * hostlist_ranged_string() will write a bracketed hostlist representation * where possible. */ @@ -388,11 +388,11 @@ void hostlist_iterator_reset(hostlist_iterator_t i); /* hostlist_next(): * - * Returns a pointer to the next hostname on the hostlist + * Returns a pointer to the next hostname on the hostlist * or NULL at the end of the list * * The caller is responsible for freeing the returned memory. - */ + */ char * hostlist_next(hostlist_iterator_t i); @@ -482,8 +482,8 @@ int hostset_count(hostset_t set); /* hostset_find(): * - * Searches hostset set for a host matching hostname - * and returns position in list if found. + * Searches hostset set for a host matching hostname + * and returns position in list if found. * * Returns -1 if host is not found. */ diff --git a/src/common/io_hdr.c b/src/common/io_hdr.c index 09056fba03..da7b2315e9 100644 --- a/src/common/io_hdr.c +++ b/src/common/io_hdr.c @@ -6,32 +6,32 @@ * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Mark A. Grondona . * CODE-OCEC-09-009. All rights reserved. - * + * * This file is part of SLURM, a resource management program. * For details, see . * Please also read the included file: DISCLAIMER. - * + * * SLURM is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free * Software Foundation; either version 2 of the License, or (at your option) * any later version. * - * In addition, as a special exception, the copyright holders give permission - * to link the code of portions of this program with the OpenSSL library under - * certain conditions as described in each individual source file, and - * distribute linked combinations including the two. You must obey the GNU - * General Public License in all respects for all of the code used other than - * OpenSSL. If you modify file(s) with this exception, you may extend this - * exception to your version of the file(s), but you are not obligated to do + * In addition, as a special exception, the copyright holders give permission + * to link the code of portions of this program with the OpenSSL library under + * certain conditions as described in each individual source file, and + * distribute linked combinations including the two. You must obey the GNU + * General Public License in all respects for all of the code used other than + * OpenSSL. If you modify file(s) with this exception, you may extend this + * exception to your version of the file(s), but you are not obligated to do * so. If you do not wish to do so, delete this exception statement from your - * version. If you delete this exception statement from all source files in + * version. If you delete this exception statement from all source files in * the program, then also delete it here. - * + * * SLURM is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. - * + * * You should have received a copy of the GNU General Public License along * with SLURM; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. @@ -84,7 +84,7 @@ io_hdr_unpack(io_hdr_t *hdr, Buf buffer) return SLURM_ERROR; } -int +int io_hdr_packed_size() { return sizeof(uint32_t) + 3*sizeof(uint16_t); @@ -149,7 +149,7 @@ fail: -int +int io_init_msg_validate(struct slurm_io_init_msg *msg, const char *sig) { debug2("Entering io_init_msg_validate"); @@ -224,7 +224,7 @@ io_init_msg_write_to_fd(int fd, struct slurm_io_init_msg *msg) Buf buf; void *ptr; int n; - + xassert(msg); debug2("Entering io_init_msg_write_to_fd"); @@ -232,7 +232,7 @@ io_init_msg_write_to_fd(int fd, struct slurm_io_init_msg *msg) buf = init_buf(io_init_msg_packed_size()); debug2(" msg->nodeid = %d", msg->nodeid); io_init_msg_pack(msg, buf); - + ptr = get_buf_data(buf); again: if ((n = write(fd, ptr, io_init_msg_packed_size())) < 0) { @@ -259,7 +259,7 @@ io_init_msg_read_from_fd(int fd, struct slurm_io_init_msg *msg) Buf buf; void *ptr; int n; - + xassert(msg); debug2("Entering io_init_msg_read_from_fd"); diff --git a/src/common/io_hdr.h b/src/common/io_hdr.h index 5ea908464d..f5eb6f6b6e 100644 --- a/src/common/io_hdr.h +++ b/src/common/io_hdr.h @@ -6,32 +6,32 @@ * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Mark A. Grondona . * CODE-OCEC-09-009. All rights reserved. - * + * * This file is part of SLURM, a resource management program. * For details, see . * Please also read the included file: DISCLAIMER. - * + * * SLURM is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free * Software Foundation; either version 2 of the License, or (at your option) * any later version. * - * In addition, as a special exception, the copyright holders give permission - * to link the code of portions of this program with the OpenSSL library under - * certain conditions as described in each individual source file, and - * distribute linked combinations including the two. You must obey the GNU - * General Public License in all respects for all of the code used other than - * OpenSSL. If you modify file(s) with this exception, you may extend this - * exception to your version of the file(s), but you are not obligated to do + * In addition, as a special exception, the copyright holders give permission + * to link the code of portions of this program with the OpenSSL library under + * certain conditions as described in each individual source file, and + * distribute linked combinations including the two. You must obey the GNU + * General Public License in all respects for all of the code used other than + * OpenSSL. If you modify file(s) with this exception, you may extend this + * exception to your version of the file(s), but you are not obligated to do * so. If you do not wish to do so, delete this exception statement from your - * version. If you delete this exception statement from all source files in + * version. If you delete this exception statement from all source files in * the program, then also delete it here. - * + * * SLURM is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. - * + * * You should have received a copy of the GNU General Public License along * with SLURM; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. @@ -68,7 +68,7 @@ struct slurm_io_init_msg { uint16_t version; - unsigned char cred_signature[SLURM_IO_KEY_SIZE]; + unsigned char cred_signature[SLURM_IO_KEY_SIZE]; uint32_t nodeid; uint32_t stdout_objs; uint32_t stderr_objs; diff --git a/src/common/job_options.c b/src/common/job_options.c index 5d8e468819..00ac72bfc2 100644 --- a/src/common/job_options.c +++ b/src/common/job_options.c @@ -1,37 +1,37 @@ /*****************************************************************************\ - * src/common/job_options.c - Extra job options + * src/common/job_options.c - Extra job options * $Id$ ***************************************************************************** * Copyright (C) 2002 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Mark Grondona . * CODE-OCEC-09-009. All rights reserved. - * + * * This file is part of SLURM, a resource management program. * For details, see . * Please also read the included file: DISCLAIMER. - * + * * SLURM is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free * Software Foundation; either version 2 of the License, or (at your option) * any later version. * - * In addition, as a special exception, the copyright holders give permission - * to link the code of portions of this program with the OpenSSL library under - * certain conditions as described in each individual source file, and - * distribute linked combinations including the two. You must obey the GNU - * General Public License in all respects for all of the code used other than - * OpenSSL. If you modify file(s) with this exception, you may extend this - * exception to your version of the file(s), but you are not obligated to do + * In addition, as a special exception, the copyright holders give permission + * to link the code of portions of this program with the OpenSSL library under + * certain conditions as described in each individual source file, and + * distribute linked combinations including the two. You must obey the GNU + * General Public License in all respects for all of the code used other than + * OpenSSL. If you modify file(s) with this exception, you may extend this + * exception to your version of the file(s), but you are not obligated to do * so. If you do not wish to do so, delete this exception statement from your - * version. If you delete this exception statement from all source files in + * version. If you delete this exception statement from all source files in * the program, then also delete it here. - * + * * SLURM is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. - * + * * You should have received a copy of the GNU General Public License along * with SLURM; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. @@ -62,7 +62,7 @@ struct job_options { }; -static struct job_option_info * +static struct job_option_info * job_option_info_create (int type, const char *opt, const char *optarg) { struct job_option_info *ji = xmalloc (sizeof (*ji)); @@ -113,7 +113,7 @@ static struct job_option_info * job_option_info_unpack (Buf buf) /* * Create generic job options container. */ -job_options_t job_options_create (void) +job_options_t job_options_create (void) { job_options_t j = xmalloc (sizeof (*j)); @@ -128,7 +128,7 @@ job_options_t job_options_create (void) /* * Destroy container, freeing all data associated with options. */ -void job_options_destroy (job_options_t opts) +void job_options_destroy (job_options_t opts) { xassert (opts != NULL); xassert (opts->magic == JOB_OPTIONS_MAGIC); @@ -144,7 +144,7 @@ void job_options_destroy (job_options_t opts) /* * Append option of type `type' and its argument to job options */ -int job_options_append (job_options_t opts, int type, const char *opt, +int job_options_append (job_options_t opts, int type, const char *opt, const char *optarg) { xassert (opts != NULL); @@ -181,7 +181,7 @@ int job_options_pack (job_options_t opts, Buf buf) i = list_iterator_create (opts->options); - while ((opt = list_next (i))) + while ((opt = list_next (i))) job_option_info_pack (opt, buf); list_iterator_destroy (i); @@ -232,7 +232,7 @@ const struct job_option_info * job_options_next (job_options_t opts) xassert (opts->magic == JOB_OPTIONS_MAGIC); xassert (opts->options != NULL); xassert (opts->iterator != NULL); - + return (list_next (opts->iterator)); } @@ -244,6 +244,6 @@ void job_options_iterator_reset (job_options_t opts) xassert (opts->magic == JOB_OPTIONS_MAGIC); xassert (opts->options != NULL); xassert (opts->iterator != NULL); - + list_iterator_reset (opts->iterator); } diff --git a/src/common/job_options.h b/src/common/job_options.h index 09da3139a6..6ec2b35502 100644 --- a/src/common/job_options.h +++ b/src/common/job_options.h @@ -1,37 +1,37 @@ /*****************************************************************************\ - * src/common/job_options.h - Extra job options + * src/common/job_options.h - Extra job options * $Id$ ***************************************************************************** * Copyright (C) 2002 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Mark Grondona . * CODE-OCEC-09-009. All rights reserved. - * + * * This file is part of SLURM, a resource management program. * For details, see . * Please also read the included file: DISCLAIMER. - * + * * SLURM is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free * Software Foundation; either version 2 of the License, or (at your option) * any later version. * - * In addition, as a special exception, the copyright holders give permission - * to link the code of portions of this program with the OpenSSL library under - * certain conditions as described in each individual source file, and - * distribute linked combinations including the two. You must obey the GNU - * General Public License in all respects for all of the code used other than - * OpenSSL. If you modify file(s) with this exception, you may extend this - * exception to your version of the file(s), but you are not obligated to do + * In addition, as a special exception, the copyright holders give permission + * to link the code of portions of this program with the OpenSSL library under + * certain conditions as described in each individual source file, and + * distribute linked combinations including the two. You must obey the GNU + * General Public License in all respects for all of the code used other than + * OpenSSL. If you modify file(s) with this exception, you may extend this + * exception to your version of the file(s), but you are not obligated to do * so. If you do not wish to do so, delete this exception statement from your - * version. If you delete this exception statement from all source files in + * version. If you delete this exception statement from all source files in * the program, then also delete it here. - * + * * SLURM is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. - * + * * You should have received a copy of the GNU General Public License along * with SLURM; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. @@ -67,7 +67,7 @@ void job_options_destroy (job_options_t opts); /* * Append option of type `type' and its argument to job options */ -int job_options_append (job_options_t opts, int type, const char *opt, +int job_options_append (job_options_t opts, int type, const char *opt, const char *optarg); /* diff --git a/src/common/job_resources.c b/src/common/job_resources.c index 2af33fb1ac..dff30bc77c 100644 --- a/src/common/job_resources.c +++ b/src/common/job_resources.c @@ -5,32 +5,32 @@ * Copyright (C) 2008 Lawrence Livermore National Security. * Written by Morris Jette . * CODE-OCEC-09-009. All rights reserved. - * + * * This file is part of SLURM, a resource management program. * For details, see . * Please also read the included file: DISCLAIMER. - * + * * SLURM is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free * Software Foundation; either version 2 of the License, or (at your option) * any later version. - * - * In addition, as a special exception, the copyright holders give permission + * + * In addition, as a special exception, the copyright holders give permission * to link the code of portions of this program with the OpenSSL library under - * certain conditions as described in each individual source file, and - * distribute linked combinations including the two. You must obey the GNU - * General Public License in all respects for all of the code used other than - * OpenSSL. If you modify file(s) with this exception, you may extend this - * exception to your version of the file(s), but you are not obligated to do + * certain conditions as described in each individual source file, and + * distribute linked combinations including the two. You must obey the GNU + * General Public License in all respects for all of the code used other than + * OpenSSL. If you modify file(s) with this exception, you may extend this + * exception to your version of the file(s), but you are not obligated to do * so. If you do not wish to do so, delete this exception statement from your - * version. If you delete this exception statement from all source files in + * version. If you delete this exception statement from all source files in * the program, then also delete it here. - * + * * SLURM is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. - * + * * You should have received a copy of the GNU General Public License along * with SLURM; if not, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. @@ -600,7 +600,7 @@ extern void pack_job_resources(job_resources_t *job_resrcs_ptr, Buf buffer) #endif } -extern int unpack_job_resources(job_resources_t **job_resrcs_pptr, +extern int unpack_job_resources(job_resources_t **job_resrcs_pptr, char *nodelist, Buf buffer) { char *bit_fmt = NULL; diff --git a/src/common/job_resources.h b/src/common/job_resources.h index 334d1ccce2..7702cf5c90 100644 --- a/src/common/job_resources.h +++ b/src/common/job_resources.h @@ -5,32 +5,32 @@ * Copyright (C) 2008 Lawrence Livermore National Security. * Written by Morris Jette . * CODE-OCEC-09-009. All rights reserved. - * + * * This file is part of SLURM, a resource management program. * For details, see . * Please also read the included file: DISCLAIMER. - * + * * SLURM is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free * Software Foundation; either version 2 of the License, or (at your option) * any later version. - * - * In addition, as a special exception, the copyright holders give permission + * + * In addition, as a special exception, the copyright holders give permission * to link the code of portions of this program with the OpenSSL library under - * certain conditions as described in each individual source file, and - * distribute linked combinations including the two. You must obey the GNU - * General Public License in all respects for all of the code used other than - * OpenSSL. If you modify file(s) with this exception, you may extend this - * exception to your version of the file(s), but you are not obligated to do + * certain conditions as described in each individual source file, and + * distribute linked combinations including the two. You must obey the GNU + * General Public License in all respects for all of the code used other than + * OpenSSL. If you modify file(s) with this exception, you may extend this + * exception to your version of the file(s), but you are not obligated to do * so. If you do not wish to do so, delete this exception statement from your - * version. If you delete this exception statement from all source files in + * version. If you delete this exception statement from all source files in * the program, then also delete it here. - * + * * SLURM is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. - * + * * You should have received a copy of the GNU General Public License along * with SLURM; if not, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. diff --git a/src/common/jobacct_common.c b/src/common/jobacct_common.c index 18dad29120..cb89f76911 100644 --- a/src/common/jobacct_common.c +++ b/src/common/jobacct_common.c @@ -5,32 +5,32 @@ * Copyright (C) 2005 Hewlett-Packard Development Company, L.P. * Written by Danny Auble, * CODE-OCEC-09-009. All rights reserved. - * + * * This file is part of SLURM, a resource management program. * For details, see . * Please also read the included file: DISCLAIMER. - * + * * SLURM is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free * Software Foundation; either version 2 of the License, or (at your option) * any later version. * - * In addition, as a special exception, the copyright holders give permission + * In addition, as a special exception, the copyright holders give permission * to link the code of portions of this program with the OpenSSL library under - * certain conditions as described in each individual source file, and - * distribute linked combinations including the two. You must obey the GNU - * General Public License in all respects for all of the code used other than - * OpenSSL. If you modify file(s) with this exception, you may extend this - * exception to your version of the file(s), but you are not obligated to do + * certain conditions as described in each individual source file, and + * distribute linked combinations including the two. You must obey the GNU + * General Public License in all respects for all of the code used other than + * OpenSSL. If you modify file(s) with this exception, you may extend this + * exception to your version of the file(s), but you are not obligated to do * so. If you do not wish to do so, delete this exception statement from your - * version. If you delete this exception statement from all source files in + * version. If you delete this exception statement from all source files in * the program, then also delete it here. - * + * * SLURM is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. - * + * * You should have received a copy of the GNU General Public License along * with SLURM; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. @@ -80,7 +80,7 @@ static void _pack_sacct(sacct_t *sacct, Buf buffer) pack16((uint16_t) 0, buffer); } return; - } + } pack32(sacct->max_vsize, buffer); temp = sacct->ave_vsize * mult; @@ -206,7 +206,7 @@ extern void destroy_jobacct_selected_step(void *object) } } - + extern void pack_jobacct_job_rec(void *object, uint16_t rpc_version, Buf buffer) { jobacct_job_rec_t *job = (jobacct_job_rec_t *)object; @@ -542,8 +542,8 @@ unpack_error: *job = NULL; return SLURM_ERROR; } - -extern void pack_jobacct_step_rec(jobacct_step_rec_t *step, + +extern void pack_jobacct_step_rec(jobacct_step_rec_t *step, uint16_t rpc_version, Buf buffer) { uint32_t uint32_tmp = NO_VAL; @@ -593,7 +593,7 @@ extern void pack_jobacct_step_rec(jobacct_step_rec_t *step, } } -extern int unpack_jobacct_step_rec(jobacct_step_rec_t **step, +extern int unpack_jobacct_step_rec(jobacct_step_rec_t **step, uint16_t rpc_version, Buf buffer) { uint32_t uint32_tmp; @@ -656,7 +656,7 @@ unpack_error: destroy_jobacct_step_rec(step_ptr); *step = NULL; return SLURM_ERROR; -} +} extern void pack_jobacct_selected_step(jobacct_selected_step_t *step, uint16_t rpc_version, Buf buffer) @@ -670,7 +670,7 @@ extern int unpack_jobacct_selected_step(jobacct_selected_step_t **step, { jobacct_selected_step_t *step_ptr = xmalloc(sizeof(jobacct_selected_step_t)); - + *step = step_ptr; safe_unpack32(&step_ptr->jobid, buffer); @@ -684,7 +684,7 @@ unpack_error: return SLURM_ERROR; } -extern int jobacct_common_init_struct(struct jobacctinfo *jobacct, +extern int jobacct_common_init_struct(struct jobacctinfo *jobacct, jobacct_id_t *jobacct_id) { if(!jobacct_id) { @@ -711,7 +711,7 @@ extern int jobacct_common_init_struct(struct jobacctinfo *jobacct, jobacct->min_cpu = (uint32_t)NO_VAL; memcpy(&jobacct->min_cpu_id, jobacct_id, sizeof(jobacct_id_t)); jobacct->tot_cpu = 0; - + return SLURM_SUCCESS; } @@ -729,7 +729,7 @@ extern void jobacct_common_free_jobacct(void *object) xfree(jobacct); } -extern int jobacct_common_setinfo(struct jobacctinfo *jobacct, +extern int jobacct_common_setinfo(struct jobacctinfo *jobacct, enum jobacct_data_type type, void *data) { int rc = SLURM_SUCCESS; @@ -790,7 +790,7 @@ extern int jobacct_common_setinfo(struct jobacctinfo *jobacct, jobacct->tot_cpu = *uint32; break; default: - debug("jobacct_g_set_setinfo data_type %d invalid", + debug("jobacct_g_set_setinfo data_type %d invalid", type); } slurm_mutex_unlock(&jobacct_lock); @@ -798,10 +798,10 @@ extern int jobacct_common_setinfo(struct jobacctinfo *jobacct, rwfail: slurm_mutex_unlock(&jobacct_lock); return SLURM_ERROR; - + } -extern int jobacct_common_getinfo(struct jobacctinfo *jobacct, +extern int jobacct_common_getinfo(struct jobacctinfo *jobacct, enum jobacct_data_type type, void *data) { int rc = SLURM_SUCCESS; @@ -863,7 +863,7 @@ extern int jobacct_common_getinfo(struct jobacctinfo *jobacct, *uint32 = jobacct->tot_cpu; break; default: - debug("jobacct_g_set_setinfo data_type %d invalid", + debug("jobacct_g_set_setinfo data_type %d invalid", type); } slurm_mutex_unlock(&jobacct_lock); @@ -874,7 +874,7 @@ rwfail: } -extern void jobacct_common_aggregate(struct jobacctinfo *dest, +extern void jobacct_common_aggregate(struct jobacctinfo *dest, struct jobacctinfo *from) { xassert(dest); @@ -886,19 +886,19 @@ extern void jobacct_common_aggregate(struct jobacctinfo *dest, dest->max_vsize_id = from->max_vsize_id; } dest->tot_vsize += from->tot_vsize; - + if(dest->max_rss < from->max_rss) { dest->max_rss = from->max_rss; dest->max_rss_id = from->max_rss_id; } dest->tot_rss += from->tot_rss; - + if(dest->max_pages < from->max_pages) { dest->max_pages = from->max_pages; dest->max_pages_id = from->max_pages_id; } dest->tot_pages += from->tot_pages; - if((dest->min_cpu > from->min_cpu) + if((dest->min_cpu > from->min_cpu) || (dest->min_cpu == (uint32_t)NO_VAL)) { if(from->min_cpu == (uint32_t)NO_VAL) from->min_cpu = 0; @@ -906,7 +906,7 @@ extern void jobacct_common_aggregate(struct jobacctinfo *dest, dest->min_cpu_id = from->min_cpu_id; } dest->tot_cpu += from->tot_cpu; - + if(dest->max_vsize_id.taskid == (uint16_t)NO_VAL) dest->max_vsize_id = from->max_vsize_id; @@ -932,7 +932,7 @@ extern void jobacct_common_aggregate(struct jobacctinfo *dest, dest->sys_cpu_usec -= 1E6; } - slurm_mutex_unlock(&jobacct_lock); + slurm_mutex_unlock(&jobacct_lock); } extern void jobacct_common_2_sacct(sacct_t *sacct, struct jobacctinfo *jobacct) @@ -965,7 +965,7 @@ extern void jobacct_common_pack(struct jobacctinfo *jobacct, Buf buffer) for(i=0; i<4; i++) pack16((uint16_t) 0, buffer); return; - } + } slurm_mutex_lock(&jobacct_lock); pack32((uint32_t)jobacct->user_cpu_sec, buffer); pack32((uint32_t)jobacct->user_cpu_usec, buffer); @@ -1007,7 +1007,7 @@ extern int jobacct_common_unpack(struct jobacctinfo **jobacct, Buf buffer) safe_unpack32(&(*jobacct)->tot_pages, buffer); safe_unpack32(&(*jobacct)->min_cpu, buffer); safe_unpack32(&(*jobacct)->tot_cpu, buffer); - if(_unpack_jobacct_id(&(*jobacct)->max_vsize_id, buffer) + if(_unpack_jobacct_id(&(*jobacct)->max_vsize_id, buffer) != SLURM_SUCCESS) goto unpack_error; if(_unpack_jobacct_id(&(*jobacct)->max_rss_id, buffer) @@ -1032,7 +1032,7 @@ extern int jobacct_common_set_proctrack_container_id(uint32_t id) if(pgid_plugin) return SLURM_SUCCESS; - if(cont_id != (uint32_t)NO_VAL) + if(cont_id != (uint32_t)NO_VAL) info("Warning: jobacct: set_proctrack_container_id: " "cont_id is already set to %d you are setting it to %d", cont_id, id); @@ -1063,7 +1063,7 @@ extern int jobacct_common_set_mem_limit(uint32_t job_id, uint32_t mem_limit) extern int jobacct_common_add_task(pid_t pid, jobacct_id_t *jobacct_id) { struct jobacctinfo *jobacct = jobacct_common_alloc_jobacct(jobacct_id); - + slurm_mutex_lock(&jobacct_lock); if(pid <= 0) { error("invalid pid given (%d) for task acct", pid); @@ -1075,7 +1075,7 @@ extern int jobacct_common_add_task(pid_t pid, jobacct_id_t *jobacct_id) jobacct->pid = pid; jobacct->min_cpu = 0; - debug2("adding task %u pid %d on node %u to jobacct", + debug2("adding task %u pid %d on node %u to jobacct", jobacct_id->taskid, pid, jobacct_id->nodeid); list_push(task_list, jobacct); slurm_mutex_unlock(&jobacct_lock); @@ -1092,7 +1092,7 @@ extern struct jobacctinfo *jobacct_common_stat_task(pid_t pid) struct jobacctinfo *jobacct = NULL; struct jobacctinfo *ret_jobacct = NULL; ListIterator itr = NULL; - + slurm_mutex_lock(&jobacct_lock); if (!task_list) { error("no task list created!"); @@ -1100,7 +1100,7 @@ extern struct jobacctinfo *jobacct_common_stat_task(pid_t pid) } itr = list_iterator_create(task_list); - while((jobacct = list_next(itr))) { + while((jobacct = list_next(itr))) { if(jobacct->pid == pid) break; } @@ -1127,7 +1127,7 @@ extern struct jobacctinfo *jobacct_common_remove_task(pid_t pid) } itr = list_iterator_create(task_list); - while((jobacct = list_next(itr))) { + while((jobacct = list_next(itr))) { if(jobacct->pid == pid) { list_remove(itr); break; @@ -1135,7 +1135,7 @@ extern struct jobacctinfo *jobacct_common_remove_task(pid_t pid) } list_iterator_destroy(itr); if(jobacct) { - debug2("removing task %u pid %d from jobacct", + debug2("removing task %u pid %d from jobacct", jobacct->max_vsize_id.taskid, jobacct->pid); } else { error("pid(%d) not being watched in jobacct!", pid); diff --git a/src/common/jobacct_common.h b/src/common/jobacct_common.h index 9439cdc48c..bacb25d5f7 100644 --- a/src/common/jobacct_common.h +++ b/src/common/jobacct_common.h @@ -5,32 +5,32 @@ * Copyright (C) 2005 Hewlett-Packard Development Company, L.P. * Written by Danny Auble, * CODE-OCEC-09-009. All rights reserved. - * + * * This file is part of SLURM, a resource management program. * For details, see . * Please also read the included file: DISCLAIMER. - * + * * SLURM is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free * Software Foundation; either version 2 of the License, or (at your option) * any later version. * - * In addition, as a special exception, the copyright holders give permission + * In addition, as a special exception, the copyright holders give permission * to link the code of portions of this program with the OpenSSL library under - * certain conditions as described in each individual source file, and - * distribute linked combinations including the two. You must obey the GNU - * General Public License in all respects for all of the code used other than - * OpenSSL. If you modify file(s) with this exception, you may extend this - * exception to your version of the file(s), but you are not obligated to do + * certain conditions as described in each individual source file, and + * distribute linked combinations including the two. You must obey the GNU + * General Public License in all respects for all of the code used other than + * OpenSSL. If you modify file(s) with this exception, you may extend this + * exception to your version of the file(s), but you are not obligated to do * so. If you do not wish to do so, delete this exception statement from your - * version. If you delete this exception statement from all source files in + * version. If you delete this exception statement from all source files in * the program, then also delete it here. - * + * * SLURM is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. - * + * * You should have received a copy of the GNU General Public License along * with SLURM; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. @@ -69,11 +69,11 @@ typedef struct { uint16_t taskid; /* contains which task number it was on */ - uint32_t nodeid; /* contains which node number it was on */ + uint32_t nodeid; /* contains which node number it was on */ } jobacct_id_t; typedef struct { - uint32_t max_vsize; + uint32_t max_vsize; jobacct_id_t max_vsize_id; float ave_vsize; uint32_t max_rss; @@ -84,7 +84,7 @@ typedef struct { float ave_pages; float min_cpu; jobacct_id_t min_cpu_id; - float ave_cpu; + float ave_cpu; } sacct_t; typedef struct { @@ -98,7 +98,7 @@ typedef struct { time_t eligible; time_t end; int32_t exitcode; - void *first_step_ptr; /* this pointer to a jobacct_step_rec_t + void *first_step_ptr; /* this pointer to a jobacct_step_rec_t is set up on the client side so does not need to be packed */ @@ -174,19 +174,19 @@ struct jobacctinfo { uint32_t user_cpu_usec; uint32_t max_vsize; /* max size of virtual memory */ jobacct_id_t max_vsize_id; /* contains which task number it was on */ - uint32_t tot_vsize; /* total virtual memory + uint32_t tot_vsize; /* total virtual memory (used to figure out ave later) */ uint32_t max_rss; /* max Resident Set Size */ jobacct_id_t max_rss_id; /* contains which task it was on */ - uint32_t tot_rss; /* total rss + uint32_t tot_rss; /* total rss (used to figure out ave later) */ uint32_t max_pages; /* max pages */ jobacct_id_t max_pages_id; /* contains which task it was on */ uint32_t tot_pages; /* total pages - (used to figure out ave later) */ + (used to figure out ave later) */ uint32_t min_cpu; /* min cpu time */ jobacct_id_t min_cpu_id; /* contains which task it was on */ - uint32_t tot_cpu; /* total cpu time + uint32_t tot_cpu; /* total cpu time (used to figure out ave later) */ }; @@ -205,12 +205,12 @@ extern void destroy_jobacct_selected_step(void *object); extern void pack_jobacct_job_rec(void *object, uint16_t rpc_version, Buf buffer); -extern int unpack_jobacct_job_rec(void **object, uint16_t rpc_version, +extern int unpack_jobacct_job_rec(void **object, uint16_t rpc_version, Buf buffer); - -extern void pack_jobacct_step_rec(jobacct_step_rec_t *step, + +extern void pack_jobacct_step_rec(jobacct_step_rec_t *step, uint16_t rpc_version, Buf buffer); -extern int unpack_jobacct_step_rec(jobacct_step_rec_t **step, +extern int unpack_jobacct_step_rec(jobacct_step_rec_t **step, uint16_t rpc_version, Buf buffer); extern void pack_jobacct_selected_step(jobacct_selected_step_t *step, @@ -219,16 +219,16 @@ extern int unpack_jobacct_selected_step(jobacct_selected_step_t **step, uint16_t rpc_version, Buf buffer); /* These should only be called from the jobacct-gather plugin */ -extern int jobacct_common_init_struct(struct jobacctinfo *jobacct, +extern int jobacct_common_init_struct(struct jobacctinfo *jobacct, jobacct_id_t *jobacct_id); extern struct jobacctinfo *jobacct_common_alloc_jobacct( jobacct_id_t *jobacct_id); extern void jobacct_common_free_jobacct(void *object); -extern int jobacct_common_setinfo(struct jobacctinfo *jobacct, +extern int jobacct_common_setinfo(struct jobacctinfo *jobacct, enum jobacct_data_type type, void *data); -extern int jobacct_common_getinfo(struct jobacctinfo *jobacct, +extern int jobacct_common_getinfo(struct jobacctinfo *jobacct, enum jobacct_data_type type, void *data); -extern void jobacct_common_aggregate(struct jobacctinfo *dest, +extern void jobacct_common_aggregate(struct jobacctinfo *dest, struct jobacctinfo *from); extern void jobacct_common_2_sacct(sacct_t *sacct, struct jobacctinfo *jobacct); diff --git a/src/common/log.c b/src/common/log.c index aba157ba9f..de87c8cf42 100644 --- a/src/common/log.c +++ b/src/common/log.c @@ -6,8 +6,8 @@ * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Mark Grondona * CODE-OCEC-09-009. All rights reserved. - * - * Much of this code was derived or adapted from the log.c component of + * + * Much of this code was derived or adapted from the log.c component of * openssh which contains the following notices: ***************************************************************************** * Author: Tatu Ylonen @@ -84,8 +84,8 @@ #endif /* -** Define slurm-specific aliases for use by plugins, see slurm_xlator.h -** for details. +** Define slurm-specific aliases for use by plugins, see slurm_xlator.h +** for details. */ strong_alias(log_init, slurm_log_init); strong_alias(log_reinit, slurm_log_reinit); @@ -109,7 +109,7 @@ strong_alias(debug, slurm_debug); strong_alias(debug2, slurm_debug2); strong_alias(debug3, slurm_debug3); -/* +/* ** struct defining a "log" type */ typedef struct { @@ -135,16 +135,16 @@ static log_t *log = NULL; /* define a default argv0 */ #if HAVE_PROGRAM_INVOCATION_NAME -/* This used to use program_invocation_short_name, but on some systems +/* This used to use program_invocation_short_name, but on some systems * that gets truncated at 16 bytes, too short for our needs. */ extern char * program_invocation_name; # define default_name program_invocation_name -#else +#else # define default_name "" #endif -/* +/* * pthread_atfork handlers: */ #ifdef WITH_PTHREADS @@ -157,31 +157,31 @@ static bool at_forked = false; pthread_atfork(_atfork_prep, _atfork_parent, _atfork_child); \ at_forked = true; \ } -#else +#else # define atfork_install_handlers() (NULL) #endif static void _log_flush(); /* - * Initialize log with + * Initialize log with * prog = program name to tag error messages with * opt = log_options_t specifying max log levels for syslog, stderr, and file * fac = log facility for syslog (unused if syslog level == LOG_QUIET) * logfile = * logfile name if logfile level > LOG_QUIET */ -static int +static int _log_init(char *prog, log_options_t opt, log_facility_t fac, char *logfile ) { int rc = 0; - + if (!log) { log = (log_t *)xmalloc(sizeof(log_t)); log->logfp = NULL; log->argv0 = NULL; log->buf = NULL; log->fbuf = NULL; - log->fpfx = NULL; + log->fpfx = NULL; atfork_install_handlers(); } @@ -203,7 +203,7 @@ _log_init(char *prog, log_options_t opt, log_facility_t fac, char *logfile ) log->opt = opt; - if (log->buf) + if (log->buf) cbuf_destroy(log->buf); if (log->fbuf) cbuf_destroy(log->fbuf); @@ -217,7 +217,7 @@ _log_init(char *prog, log_options_t opt, log_facility_t fac, char *logfile ) log->facility = fac; if (logfile && (log->opt.logfile_level > LOG_LEVEL_QUIET)) { - FILE *fp; + FILE *fp; fp = safeopen(logfile, "a", SAFEOPEN_LINK_OK); @@ -225,13 +225,13 @@ _log_init(char *prog, log_options_t opt, log_facility_t fac, char *logfile ) char *errmsg = NULL; slurm_mutex_unlock(&log_lock); xslurm_strerrorcat(errmsg); - fprintf(stderr, + fprintf(stderr, "%s: log_init(): Unable to open logfile" "`%s': %s\n", prog, logfile, errmsg); xfree(errmsg); rc = errno; goto out; - } + } if (log->logfp) fclose(log->logfp); /* Ignore errors */ @@ -310,7 +310,7 @@ void log_set_argv0(char *argv0) xfree(log->argv0); if (!argv0) log->argv0 = xstrdup(""); - else + else log->argv0 = xstrdup(argv0); slurm_mutex_unlock(&log_lock); } @@ -319,7 +319,7 @@ void log_set_argv0(char *argv0) * the log mutex */ int log_alter(log_options_t opt, log_facility_t fac, char *logfile) -{ +{ int rc = 0; slurm_mutex_lock(&log_lock); rc = _log_init(NULL, opt, fac, logfile); @@ -343,13 +343,13 @@ FILE *log_fp(void) /* return a heap allocated string formed from fmt and ap arglist * returned string is allocated with xmalloc, so must free with xfree. - * + * * args are like printf, with the addition of the following format chars: * - %m expands to strerror(errno) * - %t expands to strftime("%x %X") [ locally preferred short date/time ] * - %T expands to rfc822 date time [ "dd Mon yyyy hh:mm:ss GMT offset" ] * - * simple format specifiers are handled explicitly to avoid calls to + * simple format specifiers are handled explicitly to avoid calls to * vsnprintf and allow dynamic sizing of the message buffer. If a call * is made to vsnprintf, however, the message will be limited to 1024 bytes. * (inc. newline) @@ -366,7 +366,7 @@ static char *vxstrfmt(const char *fmt, va_list ap) while (*fmt != '\0') { - if ((p = (char *)strchr(fmt, '%')) == NULL) { + if ((p = (char *)strchr(fmt, '%')) == NULL) { /* no more format chars */ xstrcat(buf, fmt); break; @@ -376,7 +376,7 @@ static char *vxstrfmt(const char *fmt, va_list ap) /* take difference from fmt to just before `%' */ len = (size_t) ((long)(p) - (long)fmt); - /* append from fmt to p into buf if there's + /* append from fmt to p into buf if there's * anythere there */ if (len > 0) { @@ -394,11 +394,11 @@ static char *vxstrfmt(const char *fmt, va_list ap) xslurm_strerrorcat(buf); break; - case 't': /* "%t" => locally preferred date/time*/ + case 't': /* "%t" => locally preferred date/time*/ xstrftimecat(buf, "%x %X"); break; case 'T': /* "%T" => "dd Mon yyyy hh:mm:ss off" */ - xstrftimecat(buf, "%a %d %b %Y %H:%M:%S %z"); + xstrftimecat(buf, "%a %d %b %Y %H:%M:%S %z"); break; #ifdef USE_ISO_8601 case 'M': /* "%M" => "yyyy-mm-ddThh:mm:ss" */ @@ -411,7 +411,7 @@ static char *vxstrfmt(const char *fmt, va_list ap) #endif case 's': /* "%s" => append string */ /* we deal with this case for efficiency */ - if (unprocessed == 0) + if (unprocessed == 0) xstrcat(buf, va_arg(ap, char *)); else xstrcat(buf, "%s"); @@ -446,15 +446,15 @@ static char *vxstrfmt(const char *fmt, va_list ap) long_long = 1; p++; } - + if ((unprocessed == 0) && (*(p+1) == 'u')) { if(long_long) { snprintf(tmp, sizeof(tmp), - "%llu", + "%llu", va_arg(ap, long long unsigned)); long_long = 0; - } else + } else snprintf(tmp, sizeof(tmp), "%lu", va_arg(ap, @@ -464,7 +464,7 @@ static char *vxstrfmt(const char *fmt, va_list ap) } else if ((unprocessed==0) && (*(p+1)=='d')) { if(long_long) { snprintf(tmp, sizeof(tmp), - "%lld", + "%lld", va_arg(ap, long long int)); long_long = 0; @@ -478,7 +478,7 @@ static char *vxstrfmt(const char *fmt, va_list ap) if(long_long) { xstrcat(buf, "%llf"); long_long = 0; - } else + } else snprintf(tmp, sizeof(tmp), "%lf", va_arg(ap, double)); @@ -487,7 +487,7 @@ static char *vxstrfmt(const char *fmt, va_list ap) } else if ((unprocessed==0) && (*(p+1)=='x')) { if(long_long) { snprintf(tmp, sizeof(tmp), - "%llx", + "%llx", va_arg(ap, long long int)); long_long = 0; @@ -502,10 +502,10 @@ static char *vxstrfmt(const char *fmt, va_list ap) long_long = 0; } else xstrcat(buf, "%l"); - break; + break; case 'L': if ((unprocessed==0) && (*(p+1)=='f')) { - snprintf(tmp, sizeof(tmp), "%Lf", + snprintf(tmp, sizeof(tmp), "%Lf", va_arg(ap, long double)); xstrcat(buf, tmp); p++; @@ -552,7 +552,7 @@ static void xlogfmtcat(char **dst, const char *fmt, ...) } static void -_log_printf(cbuf_t cb, FILE *stream, const char *fmt, ...) +_log_printf(cbuf_t cb, FILE *stream, const char *fmt, ...) { va_list ap; @@ -563,7 +563,7 @@ _log_printf(cbuf_t cb, FILE *stream, const char *fmt, ...) char *buf = vxstrfmt(fmt, ap); int len = strlen(buf); int dropped; - cbuf_write(cb, buf, len, &dropped); + cbuf_write(cb, buf, len, &dropped); cbuf_read_to_fd(cb, fileno(stream), -1); xfree(buf); } else { @@ -574,7 +574,7 @@ _log_printf(cbuf_t cb, FILE *stream, const char *fmt, ...) } /* - * log a message at the specified level to facilities that have been + * log a message at the specified level to facilities that have been * configured to receive messages at that level */ static void log_msg(log_level_t level, const char *fmt, va_list args) @@ -590,8 +590,8 @@ static void log_msg(log_level_t level, const char *fmt, va_list args) _log_init(NULL, opts, 0, NULL); } - if (level > log->opt.syslog_level && - level > log->opt.logfile_level && + if (level > log->opt.syslog_level && + level > log->opt.logfile_level && level > log->opt.stderr_level) { slurm_mutex_unlock(&log_lock); return; @@ -653,16 +653,16 @@ static void log_msg(log_level_t level, const char *fmt, va_list args) if (level <= log->opt.stderr_level) { fflush(stdout); if (strlen(buf) > 0 && buf[strlen(buf) - 1] == '\n') - _log_printf( log->buf, stderr, "%s: %s%s", + _log_printf( log->buf, stderr, "%s: %s%s", log->argv0, pfx, buf); else - _log_printf( log->buf, stderr, "%s: %s%s\n", + _log_printf( log->buf, stderr, "%s: %s%s\n", log->argv0, pfx, buf); fflush(stderr); } if (level <= log->opt.logfile_level && log->logfp != NULL) { - xlogfmtcat(&msgbuf, "[%M] %s%s%s", + xlogfmtcat(&msgbuf, "[%M] %s%s%s", log->fpfx, pfx, buf); if (strlen(buf) > 0 && buf[strlen(buf) - 1] == '\n') @@ -706,7 +706,7 @@ _log_flush() if (!log->opt.buffered) return; - if (log->opt.stderr_level) + if (log->opt.stderr_level) cbuf_read_to_fd(log->buf, fileno(stderr), -1); else if (log->logfp && (fileno(log->logfp) > 0)) cbuf_read_to_fd(log->fbuf, fileno(log->logfp), -1); @@ -846,13 +846,13 @@ struct fatal_cleanup { /* static variables */ #ifdef WITH_PTHREADS - static pthread_mutex_t fatal_lock = PTHREAD_MUTEX_INITIALIZER; + static pthread_mutex_t fatal_lock = PTHREAD_MUTEX_INITIALIZER; #else static int fatal_lock; #endif /* WITH_PTHREADS */ static struct fatal_cleanup *fatal_cleanups = NULL; -/* Registers a cleanup function to be called by fatal() for this thread +/* Registers a cleanup function to be called by fatal() for this thread ** before exiting. */ void fatal_add_cleanup(void (*proc) (void *), void *context) @@ -869,7 +869,7 @@ fatal_add_cleanup(void (*proc) (void *), void *context) slurm_mutex_unlock(&fatal_lock); } -/* Registers a cleanup function to be called by fatal() for all threads +/* Registers a cleanup function to be called by fatal() for all threads ** of the job. */ void fatal_add_cleanup_job(void (*proc) (void *), void *context) @@ -897,7 +897,7 @@ fatal_remove_cleanup(void (*proc) (void *context), void *context) for (cup = &fatal_cleanups; *cup; cup = &cu->next) { cu = *cup; if (cu->thread_id == my_thread_id && - cu->proc == proc && + cu->proc == proc && cu->context == context) { *cup = cu->next; xfree(cu); @@ -910,7 +910,7 @@ fatal_remove_cleanup(void (*proc) (void *context), void *context) (u_long) proc, (u_long) context); } -/* Removes a cleanup frunction to be called at fatal() for all threads of +/* Removes a cleanup frunction to be called at fatal() for all threads of ** the job. */ void fatal_remove_cleanup_job(void (*proc) (void *context), void *context) @@ -921,7 +921,7 @@ fatal_remove_cleanup_job(void (*proc) (void *context), void *context) for (cup = &fatal_cleanups; *cup; cup = &cu->next) { cu = *cup; if (cu->thread_id == 0 && - cu->proc == proc && + cu->proc == proc && cu->context == context) { *cup = cu->next; xfree(cu); @@ -934,7 +934,7 @@ fatal_remove_cleanup_job(void (*proc) (void *context), void *context) "0x%lx 0x%lx", (u_long) proc, (u_long) context); } -/* Execute cleanup functions, first thread-specific then those for the +/* Execute cleanup functions, first thread-specific then those for the ** whole job */ void fatal_cleanup(void) @@ -976,7 +976,7 @@ dump_cleanup_list(void) for (cup = &fatal_cleanups; *cup; cup = &cu->next) { cu = *cup; info ("loc=%ld thread_id=%ld proc=%ld, context=%ld, next=%ld", - (long)cu, (long)cu->thread_id, (long)cu->proc, + (long)cu, (long)cu->thread_id, (long)cu->proc, (long)cu->context, (long)cu->next); } slurm_mutex_unlock(&fatal_lock); diff --git a/src/common/log.h b/src/common/log.h index 99d936f915..9ef143c716 100644 --- a/src/common/log.h +++ b/src/common/log.h @@ -5,8 +5,8 @@ * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Mark Grondona * CODE-OCEC-09-009. All rights reserved. - * - * Much of this code was derived or adapted from the log.c component of + * + * Much of this code was derived or adapted from the log.c component of * openssh which contains the following notices: ***************************************************************************** * Author: Tatu Ylonen @@ -53,7 +53,7 @@ # include #endif -#include +#include #include #include "src/common/macros.h" @@ -66,7 +66,7 @@ typedef enum { SYSLOG_FACILITY_AUTH = LOG_AUTH, #ifdef LOG_AUTHPRIV SYSLOG_FACILITY_AUTHPRIV = LOG_AUTHPRIV, -#endif +#endif SYSLOG_FACILITY_LOCAL0 = LOG_LOCAL0, SYSLOG_FACILITY_LOCAL1 = LOG_LOCAL1, SYSLOG_FACILITY_LOCAL2 = LOG_LOCAL2, @@ -74,7 +74,7 @@ typedef enum { SYSLOG_FACILITY_LOCAL4 = LOG_LOCAL4, SYSLOG_FACILITY_LOCAL5 = LOG_LOCAL5, SYSLOG_FACILITY_LOCAL6 = LOG_LOCAL6, - SYSLOG_FACILITY_LOCAL7 = LOG_LOCAL7 + SYSLOG_FACILITY_LOCAL7 = LOG_LOCAL7 } log_facility_t; /* @@ -113,12 +113,12 @@ typedef struct { { LOG_LEVEL_INFO, LOG_LEVEL_INFO, LOG_LEVEL_INFO, 1, 0 } #define LOG_OPTS_SYSLOG_DEFAULT \ - { LOG_LEVEL_QUIET, LOG_LEVEL_INFO, LOG_LEVEL_QUIET, 1, 0 } + { LOG_LEVEL_QUIET, LOG_LEVEL_INFO, LOG_LEVEL_QUIET, 1, 0 } #define LOG_OPTS_STDERR_ONLY \ { LOG_LEVEL_INFO, LOG_LEVEL_QUIET, LOG_LEVEL_QUIET, 1, 0 } -/* +/* * initialize log module (called only once) * * example: @@ -134,7 +134,7 @@ typedef struct { * * log function automatically takes the basename() of argv0. */ -int log_init(char *argv0, log_options_t opts, +int log_init(char *argv0, log_options_t opts, log_facility_t fac, char *logfile); /* reinitialize log module. @@ -144,13 +144,13 @@ int log_init(char *argv0, log_options_t opts, */ void log_reinit(void); -/* +/* * Close log and free associated memory */ void log_fini(void); /* Alter log facility, options are like log_init() above, except that - * an argv0 argument is not passed. + * an argv0 argument is not passed. * * This function may be called multiple times. */ @@ -161,7 +161,7 @@ int log_alter(log_options_t opts, log_facility_t fac, char *logfile); */ void log_set_fpfx(char *pfx); -/* +/* * (re)set argv0 string prepended to all log messages */ void log_set_argv0(char *pfx); @@ -171,10 +171,10 @@ void log_set_argv0(char *pfx); */ FILE *log_fp(void); -/* +/* * Buffered log functions: - * - * log_has_data() returns true if there is data in the + * + * log_has_data() returns true if there is data in the * internal log buffer */ bool log_has_data(void); @@ -185,7 +185,7 @@ bool log_has_data(void); */ void log_flush(void); -/* +/* * the following log a message to the log facility at the appropriate level: * * Messages do not need a newline! @@ -195,7 +195,7 @@ void log_flush(void); * fmt expands to * ~~~~ ~~~~~~~~~~~ * "%m" => strerror(errno) - * "%t" => strftime "%x %X" (locally preferred short date/time) + * "%t" => strftime "%x %X" (locally preferred short date/time) * "%T" => strftime "%a %d %b %Y %H:%M:%S %z" (rfc822 date/time) */ diff --git a/src/common/macros.h b/src/common/macros.h index 768aa04128..6fa9a29ebe 100644 --- a/src/common/macros.h +++ b/src/common/macros.h @@ -6,32 +6,32 @@ * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Mark Grondona . * CODE-OCEC-09-009. All rights reserved. - * + * * This file is part of SLURM, a resource management program. * For details, see . * Please also read the included file: DISCLAIMER. - * + * * SLURM is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free * Software Foundation; either version 2 of the License, or (at your option) * any later version. * - * In addition, as a special exception, the copyright holders give permission - * to link the code of portions of this program with the OpenSSL library under - * certain conditions as described in each individual source file, and - * distribute linked combinations including the two. You must obey the GNU - * General Public License in all respects for all of the code used other than - * OpenSSL. If you modify file(s) with this exception, you may extend this - * exception to your version of the file(s), but you are not obligated to do + * In addition, as a special exception, the copyright holders give permission + * to link the code of portions of this program with the OpenSSL library under + * certain conditions as described in each individual source file, and + * distribute linked combinations including the two. You must obey the GNU + * General Public License in all respects for all of the code used other than + * OpenSSL. If you modify file(s) with this exception, you may extend this + * exception to your version of the file(s), but you are not obligated to do * so. If you do not wish to do so, delete this exception statement from your - * version. If you delete this exception statement from all source files in + * version. If you delete this exception statement from all source files in * the program, then also delete it here. - * + * * SLURM is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. - * + * * You should have received a copy of the GNU General Public License along * with SLURM; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. @@ -46,7 +46,7 @@ #ifndef NULL # include /* for NULL */ -#endif +#endif #if HAVE_STDBOOL_H # include @@ -70,7 +70,7 @@ typedef enum {false, true} bool; #endif #ifndef MAX -# define MAX(a,b) ((a) > (b) ? (a) : (b)) +# define MAX(a,b) ((a) > (b) ? (a) : (b)) #endif #ifndef MIN @@ -110,13 +110,13 @@ typedef enum {false, true} bool; -/* -** define __CURRENT_FUNC__ macro for returning current function +/* +** define __CURRENT_FUNC__ macro for returning current function */ #if defined (__GNUC__) && (__GNUC__ < 3) # define __CURRENT_FUNC__ __PRETTY_FUNCTION__ #else /* !__GNUC__ */ -# ifdef _AIX +# ifdef _AIX # define __CURRENT_FUNC__ __func__ # else # define __CURRENT_FUNC__ "" diff --git a/src/common/mpi.c b/src/common/mpi.c index eeea9fb396..283f73da5e 100644 --- a/src/common/mpi.c +++ b/src/common/mpi.c @@ -5,32 +5,32 @@ * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Mark Grondona . * CODE-OCEC-09-009. All rights reserved. - * + * * This file is part of SLURM, a resource management program. * For details, see . * Please also read the included file: DISCLAIMER. - * + * * SLURM is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free * Software Foundation; either version 2 of the License, or (at your option) * any later version. * - * In addition, as a special exception, the copyright holders give permission - * to link the code of portions of this program with the OpenSSL library under - * certain conditions as described in each individual source file, and - * distribute linked combinations including the two. You must obey the GNU - * General Public License in all respects for all of the code used other than - * OpenSSL. If you modify file(s) with this exception, you may extend this - * exception to your version of the file(s), but you are not obligated to do + * In addition, as a special exception, the copyright holders give permission + * to link the code of portions of this program with the OpenSSL library under + * certain conditions as described in each individual source file, and + * distribute linked combinations including the two. You must obey the GNU + * General Public License in all respects for all of the code used other than + * OpenSSL. If you modify file(s) with this exception, you may extend this + * exception to your version of the file(s), but you are not obligated to do * so. If you do not wish to do so, delete this exception statement from your - * version. If you delete this exception statement from all source files in + * version. If you delete this exception statement from all source files in * the program, then also delete it here. - * + * * SLURM is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. - * + * * You should have received a copy of the GNU General Public License along * with SLURM; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. @@ -55,7 +55,7 @@ /* * WARNING: Do not change the order of these fields or add additional * fields at the beginning of the structure. If you do, MPI plugins - * will stop working. If you need to add fields, add them + * will stop working. If you need to add fields, add them * at the end of the structure. */ typedef struct slurm_mpi_ops { @@ -134,7 +134,7 @@ _slurm_mpi_context_destroy( slurm_mpi_context_t c ) /* * Resolve the operations from the plugin. */ -static slurm_mpi_ops_t * +static slurm_mpi_ops_t * _slurm_mpi_get_ops( slurm_mpi_context_t c ) { /* @@ -149,23 +149,23 @@ _slurm_mpi_get_ops( slurm_mpi_context_t c ) }; int n_syms = sizeof( syms ) / sizeof( char * ); char *plugin_dir = NULL; - + /* Find the correct plugin. */ c->cur_plugin = plugin_load_and_link(c->mpi_type, n_syms, syms, (void **) &c->ops); - if ( c->cur_plugin != PLUGIN_INVALID_HANDLE ) + if ( c->cur_plugin != PLUGIN_INVALID_HANDLE ) return &c->ops; error("Couldn't find the specified plugin name for %s " "looking at all files", c->mpi_type); - + /* Get the plugin list, if needed. */ if ( c->plugin_list == NULL ) { c->plugin_list = plugrack_create(); if ( c->plugin_list == NULL ) { error("Unable to create a plugin manager"); - return NULL; + return NULL; } plugrack_set_major_type(c->plugin_list, "mpi"); @@ -176,16 +176,16 @@ _slurm_mpi_get_ops( slurm_mpi_context_t c ) plugrack_read_dir(c->plugin_list, plugin_dir); xfree(plugin_dir); } - - if (strcasecmp (c->mpi_type, "mpi/list") == 0) { + + if (strcasecmp (c->mpi_type, "mpi/list") == 0) { plugrack_print_all_plugin(c->plugin_list); exit(0); } else { /* Find the correct plugin. */ - c->cur_plugin = plugrack_use_by_type(c->plugin_list, + c->cur_plugin = plugrack_use_by_type(c->plugin_list, c->mpi_type); if ( c->cur_plugin == PLUGIN_INVALID_HANDLE ) { - error("can't find a valid plugin for type %s", + error("can't find a valid plugin for type %s", c->mpi_type); return NULL; } @@ -213,7 +213,7 @@ int _mpi_init (char *mpi_type) if ( g_context ) goto done; - + if (mpi_type == NULL) { mpi_type = slurm_get_mpi_default(); got_default = 1; @@ -221,13 +221,13 @@ int _mpi_init (char *mpi_type) if (mpi_type == NULL) { error("No MPI default set."); retval = SLURM_ERROR; - goto done; + goto done; } setenvf (NULL, "SLURM_MPI_TYPE", "%s", mpi_type); - + full_type = xmalloc(sizeof(char) * (strlen(mpi_type)+5)); sprintf(full_type,"mpi/%s",mpi_type); - + g_context = _slurm_mpi_context_create(full_type); xfree(full_type); if ( g_context == NULL ) { @@ -242,8 +242,8 @@ int _mpi_init (char *mpi_type) g_context = NULL; retval = SLURM_ERROR; } - - + + done: if(got_default) xfree(mpi_type); @@ -254,19 +254,19 @@ done: int mpi_hook_slurmstepd_init (char ***env) { char *mpi_type = getenvp (*env, "SLURM_MPI_TYPE"); - + debug("mpi type = %s", mpi_type); - if(_mpi_init(mpi_type) == SLURM_ERROR) + if(_mpi_init(mpi_type) == SLURM_ERROR) return SLURM_ERROR; - + unsetenvp (*env, "SLURM_MPI_TYPE"); return SLURM_SUCCESS; } int mpi_hook_slurmstepd_task (const mpi_plugin_task_info_t *job, char ***env) -{ +{ if (mpi_hook_slurmstepd_init(env) == SLURM_ERROR) return SLURM_ERROR; @@ -276,10 +276,10 @@ int mpi_hook_slurmstepd_task (const mpi_plugin_task_info_t *job, char ***env) int mpi_hook_client_init (char *mpi_type) { debug("mpi type = %s", mpi_type); - - if(_mpi_init(mpi_type) == SLURM_ERROR) + + if(_mpi_init(mpi_type) == SLURM_ERROR) return SLURM_ERROR; - + return SLURM_SUCCESS; } @@ -288,7 +288,7 @@ mpi_hook_client_prelaunch(const mpi_plugin_client_info_t *job, char ***env) { if (_mpi_init(NULL) < 0) return NULL; - + return (*(g_context->ops.client_prelaunch))(job, env); } @@ -296,7 +296,7 @@ bool mpi_hook_client_single_task_per_node (void) { if (_mpi_init(NULL) < 0) return SLURM_ERROR; - + return (*(g_context->ops.client_single_task))(); } @@ -304,7 +304,7 @@ int mpi_hook_client_fini (mpi_plugin_client_state_t *state) { if (_mpi_init(NULL) < 0) return SLURM_ERROR; - + return (*(g_context->ops.client_fini))(state); } diff --git a/src/common/mpi.h b/src/common/mpi.h index 2fa2e2b27c..7adced49c5 100644 --- a/src/common/mpi.h +++ b/src/common/mpi.h @@ -5,32 +5,32 @@ * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Mark Grondona . * CODE-OCEC-09-009. All rights reserved. - * + * * This file is part of SLURM, a resource management program. * For details, see . * Please also read the included file: DISCLAIMER. - * + * * SLURM is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free * Software Foundation; either version 2 of the License, or (at your option) * any later version. * - * In addition, as a special exception, the copyright holders give permission + * In addition, as a special exception, the copyright holders give permission * to link the code of portions of this program with the OpenSSL library under - * certain conditions as described in each individual source file, and - * distribute linked combinations including the two. You must obey the GNU - * General Public License in all respects for all of the code used other than - * OpenSSL. If you modify file(s) with this exception, you may extend this - * exception to your version of the file(s), but you are not obligated to do + * certain conditions as described in each individual source file, and + * distribute linked combinations including the two. You must obey the GNU + * General Public License in all respects for all of the code used other than + * OpenSSL. If you modify file(s) with this exception, you may extend this + * exception to your version of the file(s), but you are not obligated to do * so. If you do not wish to do so, delete this exception statement from your - * version. If you delete this exception statement from all source files in + * version. If you delete this exception statement from all source files in * the program, then also delete it here. - * + * * SLURM is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. - * + * * You should have received a copy of the GNU General Public License along * with SLURM; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. @@ -41,7 +41,7 @@ #if HAVE_CONFIG_H # include "config.h" -#endif +#endif #include #include diff --git a/src/common/net.c b/src/common/net.c index a65b9831b8..e292904610 100644 --- a/src/common/net.c +++ b/src/common/net.c @@ -3,35 +3,35 @@ ***************************************************************************** * Copyright (C) 2002 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). - * Written by Mark Grondona , Kevin Tew , + * Written by Mark Grondona , Kevin Tew , * et. al. * CODE-OCEC-09-009. All rights reserved. - * + * * This file is part of SLURM, a resource management program. * For details, see . * Please also read the included file: DISCLAIMER. - * + * * SLURM is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free * Software Foundation; either version 2 of the License, or (at your option) * any later version. * - * In addition, as a special exception, the copyright holders give permission - * to link the code of portions of this program with the OpenSSL library under - * certain conditions as described in each individual source file, and - * distribute linked combinations including the two. You must obey the GNU - * General Public License in all respects for all of the code used other than - * OpenSSL. If you modify file(s) with this exception, you may extend this - * exception to your version of the file(s), but you are not obligated to do + * In addition, as a special exception, the copyright holders give permission + * to link the code of portions of this program with the OpenSSL library under + * certain conditions as described in each individual source file, and + * distribute linked combinations including the two. You must obey the GNU + * General Public License in all respects for all of the code used other than + * OpenSSL. If you modify file(s) with this exception, you may extend this + * exception to your version of the file(s), but you are not obligated to do * so. If you do not wish to do so, delete this exception statement from your - * version. If you delete this exception statement from all source files in + * version. If you delete this exception statement from all source files in * the program, then also delete it here. - * + * * SLURM is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. - * + * * You should have received a copy of the GNU General Public License along * with SLURM; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. @@ -56,8 +56,8 @@ #include "src/common/net.h" /* - * Define slurm-specific aliases for use by plugins, see slurm_xlator.h - * for details. + * Define slurm-specific aliases for use by plugins, see slurm_xlator.h + * for details. */ strong_alias(net_stream_listen, slurm_net_stream_listen); strong_alias(net_accept_stream, slurm_net_accept_stream); @@ -65,7 +65,7 @@ strong_alias(net_set_low_water, slurm_net_set_low_water); #ifndef NET_DEFAULT_BACKLOG # define NET_DEFAULT_BACKLOG 1024 -#endif +#endif /* * Returns the port number in host byte order. @@ -88,7 +88,7 @@ static short _sock_bind_wild(int sockfd) return ntohs(sin.sin_port); } -/* open a stream socket on an ephemereal port and put it into +/* open a stream socket on an ephemereal port and put it into * the listen state. fd and port are filled in with the new * socket's file descriptor and port #. * @@ -104,7 +104,7 @@ int net_stream_listen(int *fd, short *port) val = 1; rc = setsockopt(*fd, SOL_SOCKET, SO_REUSEADDR, &val, sizeof(int)); - if (rc > 0) + if (rc > 0) goto cleanup; *port = _sock_bind_wild(*fd); @@ -164,7 +164,7 @@ int readn(int fd, void *buf, size_t nbytes) int net_set_low_water(int sock, size_t size) { - if (setsockopt(sock, SOL_SOCKET, SO_RCVLOWAT, + if (setsockopt(sock, SOL_SOCKET, SO_RCVLOWAT, (const void *) &size, sizeof(size)) < 0) { error("Unable to set low water socket option: %m"); return -1; diff --git a/src/common/net.h b/src/common/net.h index ef19ce2562..75c5baa6d5 100644 --- a/src/common/net.h +++ b/src/common/net.h @@ -16,15 +16,15 @@ * Software Foundation; either version 2 of the License, or (at your option) * any later version. * - * In addition, as a special exception, the copyright holders give permission - * to link the code of portions of this program with the OpenSSL library under - * certain conditions as described in each individual source file, and - * distribute linked combinations including the two. You must obey the GNU - * General Public License in all respects for all of the code used other than - * OpenSSL. If you modify file(s) with this exception, you may extend this - * exception to your version of the file(s), but you are not obligated to do + * In addition, as a special exception, the copyright holders give permission + * to link the code of portions of this program with the OpenSSL library under + * certain conditions as described in each individual source file, and + * distribute linked combinations including the two. You must obey the GNU + * General Public License in all respects for all of the code used other than + * OpenSSL. If you modify file(s) with this exception, you may extend this + * exception to your version of the file(s), but you are not obligated to do * so. If you do not wish to do so, delete this exception statement from your - * version. If you delete this exception statement from all source files in + * version. If you delete this exception statement from all source files in * the program, then also delete it here. * * SLURM is distributed in the hope that it will be useful, but WITHOUT ANY @@ -44,7 +44,7 @@ #include "src/common/macros.h" -/* open a stream socket on an ephemereal port and put it into +/* open a stream socket on an ephemereal port and put it into * the listen state. fd and port are filled in with the new * socket's file descriptor and port #. * diff --git a/src/common/node_conf.c b/src/common/node_conf.c index e202d4bfe8..5b1bee1f13 100644 --- a/src/common/node_conf.c +++ b/src/common/node_conf.c @@ -1,9 +1,9 @@ /*****************************************************************************\ * node_conf.c - partially manage the node records of slurm - * (see src/slurmctld/node_mgr.c for the set of functionalities + * (see src/slurmctld/node_mgr.c for the set of functionalities * related to slurmctld usage of nodes) - * Note: there is a global node table (node_record_table_ptr), its - * hash table (node_hash_table), time stamp (last_node_update) and + * Note: there is a global node table (node_record_table_ptr), its + * hash table (node_hash_table), time stamp (last_node_update) and * configuration list (config_list) ***************************************************************************** * Copyright (C) 2002-2007 The Regents of the University of California. @@ -11,32 +11,32 @@ * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Morris Jette et. al. * CODE-OCEC-09-009. All rights reserved. - * + * * This file is part of SLURM, a resource management program. * For details, see . * Please also read the included file: DISCLAIMER. - * + * * SLURM is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free * Software Foundation; either version 2 of the License, or (at your option) * any later version. * - * In addition, as a special exception, the copyright holders give permission + * In addition, as a special exception, the copyright holders give permission * to link the code of portions of this program with the OpenSSL library under - * certain conditions as described in each individual source file, and - * distribute linked combinations including the two. You must obey the GNU - * General Public License in all respects for all of the code used other than - * OpenSSL. If you modify file(s) with this exception, you may extend this - * exception to your version of the file(s), but you are not obligated to do + * certain conditions as described in each individual source file, and + * distribute linked combinations including the two. You must obey the GNU + * General Public License in all respects for all of the code used other than + * OpenSSL. If you modify file(s) with this exception, you may extend this + * exception to your version of the file(s), but you are not obligated to do * so. If you do not wish to do so, delete this exception statement from your - * version. If you delete this exception statement from all source files in + * version. If you delete this exception statement from all source files in * the program, then also delete it here. - * + * * SLURM is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. - * + * * You should have received a copy of the GNU General Public License along * with SLURM; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. @@ -110,7 +110,7 @@ static void _add_config_feature(char *feature, bitstr_t *node_bitmap) feature_iter = list_iterator_create(feature_list); if (feature_iter == NULL) fatal("list_iterator_create malloc failure"); - while ((feature_ptr = (struct features_record *) + while ((feature_ptr = (struct features_record *) list_next(feature_iter))) { if (strcmp(feature, feature_ptr->name)) continue; @@ -130,7 +130,7 @@ static void _add_config_feature(char *feature, bitstr_t *node_bitmap) } -/* +/* * _build_single_nodeline_info - From the slurm.conf reader, build table, * and set values * RET 0 if no error, error code otherwise @@ -244,7 +244,7 @@ cleanup: * RET 0 if no error, errno otherwise * global: config_list - list of all configuration records */ -static int _delete_config_record (void) +static int _delete_config_record (void) { last_node_update = time (NULL); (void) list_delete_all (config_list, &_list_find_config, NULL); @@ -254,13 +254,13 @@ static int _delete_config_record (void) #if _DEBUG -/* +/* * _dump_hash - print the node_hash_table contents, used for debugging - * or analysis of hash technique + * or analysis of hash technique * global: node_record_table_ptr - pointer to global node table * node_hash_table - table of hash indecies */ -static void _dump_hash (void) +static void _dump_hash (void) { int i, inx; struct node_record *node_ptr; @@ -279,36 +279,36 @@ static void _dump_hash (void) } #endif -/* +/* * _find_alias_node_record - find a record for node with the alias of * the specified name supplied - * input: name - name to be aliased of the desired node + * input: name - name to be aliased of the desired node * output: return pointer to node record or NULL if not found * global: node_record_table_ptr - pointer to global node table * node_hash_table - table of hash indecies */ -static struct node_record *_find_alias_node_record (char *name) +static struct node_record *_find_alias_node_record (char *name) { int i; char *alias = NULL; - + if ((name == NULL) || (name[0] == '\0')) { info("_find_alias_node_record: passed NULL name"); return NULL; } /* Get the alias we have just to make sure the user isn't * trying to use the real hostname to run on something that has - * been aliased. + * been aliased. */ alias = slurm_conf_get_nodename(name); - + if (!alias) return NULL; - + /* try to find via hash table, if it exists */ if (node_hash_table) { struct node_record *node_ptr; - + i = _hash_index (alias); node_ptr = node_hash_table[i]; while (node_ptr) { @@ -320,7 +320,7 @@ static struct node_record *_find_alias_node_record (char *name) node_ptr = node_ptr->node_next; } error ("_find_alias_node_record: lookup failure for %s", name); - } + } /* revert to sequential search */ else { @@ -328,7 +328,7 @@ static struct node_record *_find_alias_node_record (char *name) if (!strcmp (alias, node_record_table_ptr[i].name)) { xfree(alias); return (&node_record_table_ptr[i]); - } + } } } @@ -336,12 +336,12 @@ static struct node_record *_find_alias_node_record (char *name) return (struct node_record *) NULL; } -/* - * _hash_index - return a hash table index for the given node name +/* + * _hash_index - return a hash table index for the given node name * IN name = the node's name * RET the hash table index */ -static int _hash_index (char *name) +static int _hash_index (char *name) { int index = 0; int j; @@ -357,15 +357,15 @@ static int _hash_index (char *name) for (j = 1; *name; name++, j++) index += (int)*name * j; index %= node_record_count; - + return index; } -/* _list_delete_config - delete an entry from the config list, +/* _list_delete_config - delete an entry from the config list, * see list.h for documentation */ -static void _list_delete_config (void *config_entry) +static void _list_delete_config (void *config_entry) { - struct config_record *config_ptr = (struct config_record *) + struct config_record *config_ptr = (struct config_record *) config_entry; xassert(config_ptr); @@ -377,11 +377,11 @@ static void _list_delete_config (void *config_entry) xfree (config_ptr); } -/* _list_delete_feature - delete an entry from the feature list, +/* _list_delete_feature - delete an entry from the feature list, * see list.h for documentation */ -static void _list_delete_feature (void *feature_entry) +static void _list_delete_feature (void *feature_entry) { - struct features_record *feature_ptr = (struct features_record *) + struct features_record *feature_ptr = (struct features_record *) feature_entry; xassert(feature_ptr); @@ -391,13 +391,13 @@ static void _list_delete_feature (void *feature_entry) xfree (feature_ptr); } -/* - * _list_find_config - find an entry in the config list, see list.h for - * documentation +/* + * _list_find_config - find an entry in the config list, see list.h for + * documentation * IN key - is NULL for all config * RET 1 if key == NULL, 0 otherwise */ -static int _list_find_config (void *config_entry, void *key) +static int _list_find_config (void *config_entry, void *key) { if (key == NULL) return 1; @@ -405,14 +405,14 @@ static int _list_find_config (void *config_entry, void *key) } /* - * bitmap2node_name - given a bitmap, build a list of comma separated node + * bitmap2node_name - given a bitmap, build a list of comma separated node * names. names may include regular expressions (e.g. "lx[01-10]") * IN bitmap - bitmap pointer - * RET pointer to node list or NULL on error + * RET pointer to node list or NULL on error * globals: node_record_table_ptr - pointer to node table * NOTE: the caller must xfree the memory at node_list when no longer required */ -char * bitmap2node_name (bitstr_t *bitmap) +char * bitmap2node_name (bitstr_t *bitmap) { int i, first, last; hostlist_t hl; @@ -441,13 +441,13 @@ char * bitmap2node_name (bitstr_t *bitmap) return xstrdup(buf); } -/* - * _list_find_feature - find an entry in the feature list, see list.h for - * documentation +/* + * _list_find_feature - find an entry in the feature list, see list.h for + * documentation * IN key - is feature name or NULL for all features * RET 1 if found, 0 otherwise */ -static int _list_find_feature (void *feature_entry, void *key) +static int _list_find_feature (void *feature_entry, void *key) { struct features_record *feature_ptr; @@ -460,7 +460,7 @@ static int _list_find_feature (void *feature_entry, void *key) return 0; } -/* +/* * _build_all_nodeline_info - get a array of slurm_conf_node_t structures * from the slurm.conf reader, build table, and set values * IN set_bitmap - if true, set node_bitmap in config record (used by slurmd) @@ -503,7 +503,7 @@ extern int build_all_nodeline_info (bool set_bitmap) fatal ("memory allocation failure"); while ((config_ptr = (struct config_record *) list_next(config_iterator))) { - node_name2bitmap(config_ptr->nodes, true, + node_name2bitmap(config_ptr->nodes, true, &config_ptr->node_bitmap); } list_iterator_destroy(config_iterator); @@ -526,7 +526,7 @@ extern void build_config_feature_list(struct config_record *config_ptr) if (feature_iter == NULL) fatal("list_iterator_create malloc failure"); bit_not(config_ptr->node_bitmap); - while ((feature_ptr = (struct features_record *) + while ((feature_ptr = (struct features_record *) list_next(feature_iter))) { bit_and(feature_ptr->node_bitmap, config_ptr->node_bitmap); } @@ -553,15 +553,15 @@ extern void build_config_feature_list(struct config_record *config_ptr) } /* - * create_config_record - create a config_record entry and set is values to - * the defaults. each config record corresponds to a line in the - * slurm.conf file and typically describes the configuration of a + * create_config_record - create a config_record entry and set is values to + * the defaults. each config record corresponds to a line in the + * slurm.conf file and typically describes the configuration of a * large number of nodes * RET pointer to the config_record - * NOTE: memory allocated will remain in existence until + * NOTE: memory allocated will remain in existence until * _delete_config_record() is called to delete all configuration records */ -extern struct config_record * create_config_record (void) +extern struct config_record * create_config_record (void) { struct config_record *config_ptr; @@ -579,34 +579,34 @@ extern struct config_record * create_config_record (void) return config_ptr; } -/* +/* * create_node_record - create a node record and set its values to defaults * IN config_ptr - pointer to node's configuration information * IN node_name - name of the node * RET pointer to the record or NULL if error - * NOTE: allocates memory at node_record_table_ptr that must be xfreed when + * NOTE: allocates memory at node_record_table_ptr that must be xfreed when * the global node table is no longer required */ extern struct node_record *create_node_record ( - struct config_record *config_ptr, char *node_name) + struct config_record *config_ptr, char *node_name) { struct node_record *node_ptr; int old_buffer_size, new_buffer_size; last_node_update = time (NULL); xassert(config_ptr); - xassert(node_name); + xassert(node_name); /* round up the buffer size to reduce overhead of xrealloc */ old_buffer_size = (node_record_count) * sizeof (struct node_record); - old_buffer_size = + old_buffer_size = ((int) ((old_buffer_size / BUF_SIZE) + 1)) * BUF_SIZE; - new_buffer_size = + new_buffer_size = (node_record_count + 1) * sizeof (struct node_record); - new_buffer_size = + new_buffer_size = ((int) ((new_buffer_size / BUF_SIZE) + 1)) * BUF_SIZE; if (!node_record_table_ptr) { - node_record_table_ptr = + node_record_table_ptr = (struct node_record *) xmalloc (new_buffer_size); } else if (old_buffer_size != new_buffer_size) xrealloc (node_record_table_ptr, new_buffer_size); @@ -626,24 +626,24 @@ extern struct node_record *create_node_record ( } -/* +/* * find_node_record - find a record for node with specified name - * input: name - name of the desired node + * input: name - name of the desired node * output: return pointer to node record or NULL if not found */ -extern struct node_record *find_node_record (char *name) +extern struct node_record *find_node_record (char *name) { int i; - + if ((name == NULL) || (name[0] == '\0')) { info("find_node_record passed NULL name"); return NULL; } - + /* try to find via hash table, if it exists */ if (node_hash_table) { struct node_record *node_ptr; - + i = _hash_index (name); node_ptr = node_hash_table[i]; while (node_ptr) { @@ -657,32 +657,32 @@ extern struct node_record *find_node_record (char *name) if ((node_record_count == 1) && (strcmp(node_record_table_ptr[0].name, "localhost") == 0)) return (&node_record_table_ptr[0]); - + error ("find_node_record: lookup failure for %s", name); - } + } /* revert to sequential search */ else { for (i = 0; i < node_record_count; i++) { if (!strcmp (name, node_record_table_ptr[i].name)) { return (&node_record_table_ptr[i]); - } + } } } - + /* look for the alias node record if the user put this in instead of what slurm sees the node name as */ return _find_alias_node_record (name); } -/* - * init_node_conf - initialize the node configuration tables and values. - * this should be called before creating any node or configuration +/* + * init_node_conf - initialize the node configuration tables and values. + * this should be called before creating any node or configuration * entries. * RET 0 if no error, otherwise an error code */ -extern int init_node_conf (void) +extern int init_node_conf (void) { last_node_update = time (NULL); int i; @@ -733,16 +733,16 @@ extern void node_fini2 (void) /* - * node_name2bitmap - given a node name regular expression, build a bitmap + * node_name2bitmap - given a node name regular expression, build a bitmap * representation * IN node_names - list of nodes - * IN best_effort - if set don't return an error on invalid node name entries - * OUT bitmap - set to bitmap, may not have all bits set on error + * IN best_effort - if set don't return an error on invalid node name entries + * OUT bitmap - set to bitmap, may not have all bits set on error * RET 0 if no error, otherwise EINVAL * NOTE: the caller must bit_free() memory at bitmap when no longer required */ -extern int node_name2bitmap (char *node_names, bool best_effort, - bitstr_t **bitmap) +extern int node_name2bitmap (char *node_names, bool best_effort, + bitstr_t **bitmap) { int rc = SLURM_SUCCESS; char *this_node_name; @@ -753,7 +753,7 @@ extern int node_name2bitmap (char *node_names, bool best_effort, if (my_bitmap == NULL) fatal("bit_alloc malloc failure"); *bitmap = my_bitmap; - + if (node_names == NULL) { info("node_name2bitmap: node_names is NULL"); return rc; @@ -771,7 +771,7 @@ extern int node_name2bitmap (char *node_names, bool best_effort, struct node_record *node_ptr; node_ptr = find_node_record (this_node_name); if (node_ptr) { - bit_set (my_bitmap, (bitoff_t) (node_ptr - + bit_set (my_bitmap, (bitoff_t) (node_ptr - node_record_table_ptr)); } else { error ("node_name2bitmap: invalid node specified %s", @@ -801,17 +801,17 @@ extern void purge_node_rec (struct node_record *node_ptr) } -/* - * rehash_node - build a hash table of the node_record entries. +/* + * rehash_node - build a hash table of the node_record entries. * NOTE: manages memory for node_hash_table */ -extern void rehash_node (void) +extern void rehash_node (void) { int i, inx; struct node_record *node_ptr = node_record_table_ptr; xfree (node_hash_table); - node_hash_table = xmalloc (sizeof (struct node_record *) * + node_hash_table = xmalloc (sizeof (struct node_record *) * node_record_count); for (i = 0; i < node_record_count; i++, node_ptr++) { diff --git a/src/common/node_conf.h b/src/common/node_conf.h index 3951382e5f..75cdb1179d 100644 --- a/src/common/node_conf.h +++ b/src/common/node_conf.h @@ -1,5 +1,5 @@ /*****************************************************************************\ - * node_conf.h - definitions for reading the node part of slurm configuration + * node_conf.h - definitions for reading the node part of slurm configuration * file and work with the corresponding structures ***************************************************************************** * Copyright (C) 2002-2007 The Regents of the University of California. @@ -7,32 +7,32 @@ * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Morris Jette et. al. * CODE-OCEC-09-009. All rights reserved. - * + * * This file is part of SLURM, a resource management program. * For details, see . * Please also read the included file: DISCLAIMER. - * + * * SLURM is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free * Software Foundation; either version 2 of the License, or (at your option) * any later version. * - * In addition, as a special exception, the copyright holders give permission + * In addition, as a special exception, the copyright holders give permission * to link the code of portions of this program with the OpenSSL library under - * certain conditions as described in each individual source file, and - * distribute linked combinations including the two. You must obey the GNU - * General Public License in all respects for all of the code used other than - * OpenSSL. If you modify file(s) with this exception, you may extend this - * exception to your version of the file(s), but you are not obligated to do + * certain conditions as described in each individual source file, and + * distribute linked combinations including the two. You must obey the GNU + * General Public License in all respects for all of the code used other than + * OpenSSL. If you modify file(s) with this exception, you may extend this + * exception to your version of the file(s), but you are not obligated to do * so. If you do not wish to do so, delete this exception statement from your - * version. If you delete this exception statement from all source files in + * version. If you delete this exception statement from all source files in * the program, then also delete it here. - * + * * SLURM is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. - * + * * You should have received a copy of the GNU General Public License along * with SLURM; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. @@ -71,7 +71,7 @@ struct config_record { uint16_t threads; /* number of threads per core */ uint32_t real_memory; /* MB real memory on the node */ uint32_t tmp_disk; /* MB total storage in TMP_FS file system */ - uint32_t weight; /* arbitrary priority of node for + uint32_t weight; /* arbitrary priority of node for * scheduling work on */ char *feature; /* arbitrary list of features associated */ char **feature_array; /* array of feature names */ @@ -90,10 +90,10 @@ extern List feature_list; /* list of features_record entries */ struct node_record { uint32_t magic; /* magic cookie for data integrity */ char *name; /* name of the node. NULL==defunct */ - uint16_t node_state; /* enum node_states, ORed with - * NODE_STATE_NO_RESPOND if not + uint16_t node_state; /* enum node_states, ORed with + * NODE_STATE_NO_RESPOND if not * responding */ - bool not_responding; /* set if fails to respond, + bool not_responding; /* set if fails to respond, * clear after logging this */ time_t last_response; /* last response from the node */ time_t last_idle; /* time node last become idle */ @@ -106,7 +106,7 @@ struct node_record { uint32_t up_time; /* seconds since node boot */ struct config_record *config_ptr; /* configuration spec ptr */ uint16_t part_cnt; /* number of associated partitions */ - struct part_record **part_pptr; /* array of pointers to partitions + struct part_record **part_pptr; /* array of pointers to partitions * associated with this node*/ char *comm_name; /* communications path name to node */ uint16_t port; /* TCP port number of the slurmd */ @@ -140,16 +140,16 @@ extern time_t last_node_update; /* time of last node record update */ /* - * bitmap2node_name - given a bitmap, build a list of comma separated node + * bitmap2node_name - given a bitmap, build a list of comma separated node * names. names may include regular expressions (e.g. "lx[01-10]") * IN bitmap - bitmap pointer - * RET pointer to node list or NULL on error + * RET pointer to node list or NULL on error * globals: node_record_table_ptr - pointer to node table * NOTE: the caller must xfree the memory at node_list when no longer required */ char * bitmap2node_name (bitstr_t *bitmap); -/* +/* * _build_all_nodeline_info - get a array of slurm_conf_node_t structures * from the slurm.conf reader, build table, and set values * IN set_bitmap - if true, set node_bitmap in config record (used by slurmd) @@ -161,38 +161,38 @@ extern int build_all_nodeline_info (bool set_bitmap); extern void build_config_feature_list (struct config_record *config_ptr); /* - * create_config_record - create a config_record entry and set is values to - * the defaults. each config record corresponds to a line in the - * slurm.conf file and typically describes the configuration of a + * create_config_record - create a config_record entry and set is values to + * the defaults. each config record corresponds to a line in the + * slurm.conf file and typically describes the configuration of a * large number of nodes * RET pointer to the config_record - * NOTE: memory allocated will remain in existence until + * NOTE: memory allocated will remain in existence until * _delete_config_record() is called to delete all configuration records */ extern struct config_record *create_config_record (void); -/* +/* * create_node_record - create a node record and set its values to defaults * IN config_ptr - pointer to node's configuration information * IN node_name - name of the node * RET pointer to the record or NULL if error - * NOTE: allocates memory at node_record_table_ptr that must be xfreed when + * NOTE: allocates memory at node_record_table_ptr that must be xfreed when * the global node table is no longer required */ extern struct node_record *create_node_record ( struct config_record *config_ptr, char *node_name); -/* +/* * find_node_record - find a record for node with specified name - * input: name - name of the desired node + * input: name - name of the desired node * output: return pointer to node record or NULL if not found * node_hash_table - table of hash indecies */ extern struct node_record *find_node_record (char *name); -/* - * init_node_conf - initialize the node configuration tables and values. - * this should be called before creating any node or configuration +/* + * init_node_conf - initialize the node configuration tables and values. + * this should be called before creating any node or configuration * entries. * RET 0 if no error, otherwise an error code */ @@ -202,22 +202,22 @@ extern int init_node_conf (void); extern void node_fini2 (void); /* - * node_name2bitmap - given a node name regular expression, build a bitmap + * node_name2bitmap - given a node name regular expression, build a bitmap * representation * IN node_names - list of nodes - * IN best_effort - if set don't return an error on invalid node name entries - * OUT bitmap - set to bitmap, may not have all bits set on error + * IN best_effort - if set don't return an error on invalid node name entries + * OUT bitmap - set to bitmap, may not have all bits set on error * RET 0 if no error, otherwise EINVAL * NOTE: the caller must bit_free() memory at bitmap when no longer required */ -extern int node_name2bitmap (char *node_names, bool best_effort, +extern int node_name2bitmap (char *node_names, bool best_effort, bitstr_t **bitmap); /* Purge the contents of a node record */ extern void purge_node_rec (struct node_record *node_ptr); -/* - * rehash_node - build a hash table of the node_record entries. +/* + * rehash_node - build a hash table of the node_record entries. * NOTE: manages memory for node_hash_table */ extern void rehash_node (void); diff --git a/src/common/node_select.c b/src/common/node_select.c index b68e762129..b83b2a3083 100644 --- a/src/common/node_select.c +++ b/src/common/node_select.c @@ -1,12 +1,12 @@ /*****************************************************************************\ * node_select.c - node selection plugin wrapper. * - * NOTE: The node selection plugin itself is intimately tied to slurmctld - * functions and data structures. Some related functions (e.g. data structure - * un/packing, environment variable setting) are required by most SLURM + * NOTE: The node selection plugin itself is intimately tied to slurmctld + * functions and data structures. Some related functions (e.g. data structure + * un/packing, environment variable setting) are required by most SLURM * commands. Since some of these commands must be executed on the BlueGene - * front-end nodes, the functions they require are here rather than within - * the plugin. This is because functions required by the plugin can not be + * front-end nodes, the functions they require are here rather than within + * the plugin. This is because functions required by the plugin can not be * resolved on the front-end nodes, so we can't load the plugins there. ***************************************************************************** * Copyright (C) 2002-2007 The Regents of the University of California. @@ -14,32 +14,32 @@ * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Morris Jette . * CODE-OCEC-09-009. All rights reserved. - * + * * This file is part of SLURM, a resource management program. * For details, see . * Please also read the included file: DISCLAIMER. - * + * * SLURM is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free * Software Foundation; either version 2 of the License, or (at your option) * any later version. * - * In addition, as a special exception, the copyright holders give permission + * In addition, as a special exception, the copyright holders give permission * to link the code of portions of this program with the OpenSSL library under - * certain conditions as described in each individual source file, and - * distribute linked combinations including the two. You must obey the GNU - * General Public License in all respects for all of the code used other than - * OpenSSL. If you modify file(s) with this exception, you may extend this - * exception to your version of the file(s), but you are not obligated to do + * certain conditions as described in each individual source file, and + * distribute linked combinations including the two. You must obey the GNU + * General Public License in all respects for all of the code used other than + * OpenSSL. If you modify file(s) with this exception, you may extend this + * exception to your version of the file(s), but you are not obligated to do * so. If you do not wish to do so, delete this exception statement from your - * version. If you delete this exception statement from all source files in + * version. If you delete this exception statement from all source files in * the program, then also delete it here. - * + * * SLURM is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. - * + * * You should have received a copy of the GNU General Public License along * with SLURM; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. @@ -78,8 +78,8 @@ typedef struct slurm_select_ops { int node_cnt); int (*block_init) (List block_list); int (*job_test) (struct job_record *job_ptr, - bitstr_t *bitmap, - uint32_t min_nodes, + bitstr_t *bitmap, + uint32_t min_nodes, uint32_t max_nodes, uint32_t req_nodes, uint16_t mode, @@ -92,9 +92,9 @@ typedef struct slurm_select_ops { int (*job_resume) (struct job_record *job_ptr); int (*pack_select_info) (time_t last_query_time, Buf *buffer_ptr); - int (*nodeinfo_pack) (select_nodeinfo_t *nodeinfo, + int (*nodeinfo_pack) (select_nodeinfo_t *nodeinfo, Buf buffer); - int (*nodeinfo_unpack) (select_nodeinfo_t **nodeinfo, + int (*nodeinfo_unpack) (select_nodeinfo_t **nodeinfo, Buf buffer); select_nodeinfo_t *(*nodeinfo_alloc) (uint32_t size); int (*nodeinfo_free) (select_nodeinfo_t *nodeinfo); @@ -102,13 +102,13 @@ typedef struct slurm_select_ops { int (*nodeinfo_set) (struct job_record *job_ptr); int (*nodeinfo_get) (select_nodeinfo_t *nodeinfo, enum - select_nodedata_type dinfo, + select_nodedata_type dinfo, enum node_states state, void *data); select_jobinfo_t *(*jobinfo_alloc) (); int (*jobinfo_free) (select_jobinfo_t *jobinfo); int (*jobinfo_set) (select_jobinfo_t *jobinfo, - enum + enum select_jobdata_type data_type, void *data); int (*jobinfo_get) (select_jobinfo_t *jobinfo, @@ -125,11 +125,11 @@ typedef struct slurm_select_ops { int mode); char * (*jobinfo_xstrdup) (select_jobinfo_t *jobinfo, int mode); - int (*update_block) (update_block_msg_t + int (*update_block) (update_block_msg_t *block_desc_ptr); int (*update_sub_node) (update_block_msg_t *block_desc_ptr); - int (*get_info_from_plugin)(enum + int (*get_info_from_plugin)(enum select_plugindata_info dinfo, struct job_record *job_ptr, void *data); @@ -149,7 +149,7 @@ typedef struct slurm_select_context { } slurm_select_context_t; static slurm_select_context_t * g_select_context = NULL; -static pthread_mutex_t g_select_context_lock = +static pthread_mutex_t g_select_context_lock = PTHREAD_MUTEX_INITIALIZER; #ifdef HAVE_CRAY_XT /* node selection specific logic */ @@ -217,13 +217,13 @@ static slurm_select_ops_t * _select_get_ops(slurm_select_context_t *c) /* Find the correct plugin. */ c->cur_plugin = plugin_load_and_link(c->select_type, n_syms, syms, (void **) &c->ops); - if ( c->cur_plugin != PLUGIN_INVALID_HANDLE ) + if ( c->cur_plugin != PLUGIN_INVALID_HANDLE ) return &c->ops; error("Couldn't find the specified plugin name for %s " "looking at all files", c->select_type); - + /* Get plugin list. */ if ( c->plugin_list == NULL ) { char *plugin_dir; @@ -243,7 +243,7 @@ static slurm_select_ops_t * _select_get_ops(slurm_select_context_t *c) c->cur_plugin = plugrack_use_by_type( c->plugin_list, c->select_type ); if ( c->cur_plugin == PLUGIN_INVALID_HANDLE ) { - error( "cannot find node selection plugin for %s", + error( "cannot find node selection plugin for %s", c->select_type ); return NULL; } @@ -321,19 +321,19 @@ static void _free_block_info(block_info_t *block_info) } } -/* NOTE: The matching pack functions are directly in the select/bluegene - * plugin. The unpack functions can not be there since the plugin is - * dependent upon libraries which do not exist on the BlueGene front-end +/* NOTE: The matching pack functions are directly in the select/bluegene + * plugin. The unpack functions can not be there since the plugin is + * dependent upon libraries which do not exist on the BlueGene front-end * nodes. */ static int _unpack_block_info(block_info_t *block_info, Buf buffer) { uint32_t uint32_tmp; char *bp_inx_str = NULL; - + safe_unpackstr_xmalloc(&block_info->bg_block_id, &uint32_tmp, buffer); #ifdef HAVE_BGL - safe_unpackstr_xmalloc(&block_info->blrtsimage, + safe_unpackstr_xmalloc(&block_info->blrtsimage, &uint32_tmp, buffer); #endif safe_unpackstr_xmalloc(&bp_inx_str, &uint32_tmp, buffer); @@ -344,7 +344,7 @@ static int _unpack_block_info(block_info_t *block_info, Buf buffer) xfree(bp_inx_str); } safe_unpack16(&block_info->conn_type, buffer); - safe_unpackstr_xmalloc(&(block_info->ionodes), + safe_unpackstr_xmalloc(&(block_info->ionodes), &uint32_tmp, buffer); safe_unpackstr_xmalloc(&bp_inx_str, &uint32_tmp, buffer); if (bp_inx_str == NULL) { @@ -368,7 +368,7 @@ static int _unpack_block_info(block_info_t *block_info, Buf buffer) safe_unpackstr_xmalloc(&block_info->ramdiskimage, &uint32_tmp, buffer); safe_unpack16(&block_info->state, buffer); - + return SLURM_SUCCESS; unpack_error: @@ -392,7 +392,7 @@ extern void node_select_pack_block_info(block_info_t *block_info, Buf buffer) packnull(buffer); #ifdef HAVE_BGL packnull(buffer); -#endif +#endif pack16((uint16_t)NO_VAL, buffer); packnull(buffer); @@ -407,7 +407,7 @@ extern void node_select_pack_block_info(block_info_t *block_info, Buf buffer) pack32(NO_VAL, buffer); #ifdef HAVE_BGL pack16((uint16_t)NO_VAL, buffer); -#endif +#endif packnull(buffer); packnull(buffer); @@ -416,7 +416,7 @@ extern void node_select_pack_block_info(block_info_t *block_info, Buf buffer) packstr(block_info->bg_block_id, buffer); #ifdef HAVE_BGL packstr(block_info->blrtsimage, buffer); -#endif +#endif if(block_info->bp_inx) { char *bitfmt = inx2bitfmt(block_info->bp_inx); @@ -424,11 +424,11 @@ extern void node_select_pack_block_info(block_info_t *block_info, Buf buffer) xfree(bitfmt); } else packnull(buffer); - + pack16(block_info->conn_type, buffer); packstr(block_info->ionodes, buffer); - + if(block_info->ionode_inx) { char *bitfmt = inx2bitfmt(block_info->ionode_inx); packstr(bitfmt, buffer); @@ -437,13 +437,13 @@ extern void node_select_pack_block_info(block_info_t *block_info, Buf buffer) packnull(buffer); pack32(block_info->job_running, buffer); - + packstr(block_info->linuximage, buffer); packstr(block_info->mloaderimage, buffer); packstr(block_info->nodes, buffer); pack32(block_info->node_cnt, buffer); #ifdef HAVE_BGL - pack16(block_info->node_use, buffer); + pack16(block_info->node_use, buffer); #endif packstr(block_info->owner_name, buffer); packstr(block_info->ramdiskimage, buffer); @@ -495,10 +495,10 @@ extern int node_select_block_info_msg_unpack( buf = xmalloc(sizeof(block_info_msg_t)); safe_unpack32(&(buf->record_count), buffer); safe_unpack_time(&(buf->last_update), buffer); - buf->block_array = xmalloc(sizeof(block_info_t) * + buf->block_array = xmalloc(sizeof(block_info_t) * buf->record_count); for(i=0; irecord_count; i++) { - if (_unpack_block_info(&(buf->block_array[i]), buffer)) + if (_unpack_block_info(&(buf->block_array[i]), buffer)) goto unpack_error; } *block_info_msg_pptr = buf; @@ -506,7 +506,7 @@ extern int node_select_block_info_msg_unpack( unpack_error: node_select_block_info_msg_free(&buf); - *block_info_msg_pptr = NULL; + *block_info_msg_pptr = NULL; return SLURM_ERROR; } @@ -518,7 +518,7 @@ extern int slurm_select_init(void) { int retval = SLURM_SUCCESS; char *select_type = NULL; - + slurm_mutex_lock( &g_select_context_lock ); if ( g_select_context ) @@ -634,30 +634,30 @@ extern int select_g_block_init(List block_list) * SELECT_MODE_TEST_ONLY: test if job can ever run * SELECT_MODE_WILL_RUN: determine when and where job can run * IN preemptee_candidates - List of pointers to jobs which can bee preempted - * IN/OUT preemptee_job_list - Pointer to list of job pointers. These are the - * jobs to be preempted to initiate the pending job. Not set + * IN/OUT preemptee_job_list - Pointer to list of job pointers. These are the + * jobs to be preempted to initiate the pending job. Not set * if mode=SELECT_MODE_TEST_ONLY or input pointer is NULL. * Existing list is appended to. * RET zero on success, EINVAL otherwise */ extern int select_g_job_test(struct job_record *job_ptr, bitstr_t *bitmap, - uint32_t min_nodes, uint32_t max_nodes, - uint32_t req_nodes, uint16_t mode, + uint32_t min_nodes, uint32_t max_nodes, + uint32_t req_nodes, uint16_t mode, List preemptee_candidates, List *preemptee_job_list) { if (slurm_select_init() < 0) return SLURM_ERROR; - return (*(g_select_context->ops.job_test))(job_ptr, bitmap, - min_nodes, max_nodes, + return (*(g_select_context->ops.job_test))(job_ptr, bitmap, + min_nodes, max_nodes, req_nodes, mode, preemptee_candidates, preemptee_job_list); } /* - * Note initiation of job is about to begin. Called immediately + * Note initiation of job is about to begin. Called immediately * after select_g_job_test(). Executed from slurmctld. * IN job_ptr - pointer to job being initiated */ @@ -672,7 +672,7 @@ extern int select_g_job_begin(struct job_record *job_ptr) /* * determine if job is ready to execute per the node select plugin * IN job_ptr - pointer to job being tested - * RET: -2 fatal error, -1 try again, 1 if ready to execute, + * RET: -2 fatal error, -1 try again, 1 if ready to execute, * 0 not ready to execute */ extern int select_g_job_ready(struct job_record *job_ptr) @@ -725,26 +725,26 @@ extern int select_g_pack_select_info(time_t last_query_time, Buf *buffer) { if (slurm_select_init() < 0) return SLURM_ERROR; - + return (*(g_select_context->ops.pack_select_info)) (last_query_time, buffer); } -extern int select_g_select_nodeinfo_pack(select_nodeinfo_t *nodeinfo, +extern int select_g_select_nodeinfo_pack(select_nodeinfo_t *nodeinfo, Buf buffer) { if (slurm_select_init() < 0) return SLURM_ERROR; - + return (*(g_select_context->ops.nodeinfo_pack))(nodeinfo, buffer); } -extern int select_g_select_nodeinfo_unpack(select_nodeinfo_t **nodeinfo, +extern int select_g_select_nodeinfo_unpack(select_nodeinfo_t **nodeinfo, Buf buffer) { if (slurm_select_init() < 0) return SLURM_ERROR; - + return (*(g_select_context->ops.nodeinfo_unpack))(nodeinfo, buffer); } @@ -752,7 +752,7 @@ extern select_nodeinfo_t *select_g_select_nodeinfo_alloc(uint32_t size) { if (slurm_select_init() < 0) return NULL; - + return (*(g_select_context->ops.nodeinfo_alloc))(size); } @@ -760,7 +760,7 @@ extern int select_g_select_nodeinfo_free(select_nodeinfo_t *nodeinfo) { if (slurm_select_init() < 0) return SLURM_ERROR; - + return (*(g_select_context->ops.nodeinfo_free))(nodeinfo); } @@ -768,7 +768,7 @@ extern int select_g_select_nodeinfo_set_all(time_t last_query_time) { if (slurm_select_init() < 0) return SLURM_ERROR; - + return (*(g_select_context->ops.nodeinfo_set_all))(last_query_time); } @@ -776,12 +776,12 @@ extern int select_g_select_nodeinfo_set(struct job_record *job_ptr) { if (slurm_select_init() < 0) return SLURM_ERROR; - + return (*(g_select_context->ops.nodeinfo_set))(job_ptr); } -extern int select_g_select_nodeinfo_get(select_nodeinfo_t *nodeinfo, - enum select_nodedata_type dinfo, +extern int select_g_select_nodeinfo_get(select_nodeinfo_t *nodeinfo, + enum select_nodedata_type dinfo, enum node_states state, void *data) { @@ -861,7 +861,7 @@ extern int select_g_select_jobinfo_set (select_jobinfo_t *jobinfo, jobinfo->reservation_id = xstrdup(tmp_char); break; default: - debug("select_g_select_jobinfo_set data_type %d invalid", + debug("select_g_select_jobinfo_set data_type %d invalid", data_type); } @@ -871,11 +871,11 @@ extern int select_g_select_jobinfo_set (select_jobinfo_t *jobinfo, /* get data from a select job credential * IN jobinfo - updated select job credential * IN data_type - type of data to enter into job credential - * OUT data - the data to get from job credential, caller must xfree - * data for data_tyep == SELECT_DATA_BLOCK_ID + * OUT data - the data to get from job credential, caller must xfree + * data for data_tyep == SELECT_DATA_BLOCK_ID */ extern int select_g_select_jobinfo_get (select_jobinfo_t *jobinfo, - enum select_jobdata_type data_type, + enum select_jobdata_type data_type, void *data) { int rc = SLURM_SUCCESS; @@ -899,10 +899,10 @@ extern int select_g_select_jobinfo_get (select_jobinfo_t *jobinfo, *tmp_char = xstrdup(jobinfo->reservation_id); break; default: - /* There is some use of BlueGene specific params that + /* There is some use of BlueGene specific params that * are not supported on the Cray, but requested on * all systems */ - debug2("select_g_select_jobinfo_get data_type %d invalid", + debug2("select_g_select_jobinfo_get data_type %d invalid", data_type); return SLURM_ERROR; } @@ -918,7 +918,7 @@ extern int select_g_select_jobinfo_get (select_jobinfo_t *jobinfo, extern select_jobinfo_t *select_g_select_jobinfo_copy(select_jobinfo_t *jobinfo) { struct select_jobinfo *rc = NULL; - + if (jobinfo == NULL) ; else if (jobinfo->magic != JOBINFO_MAGIC) @@ -940,7 +940,7 @@ extern select_jobinfo_t *select_g_select_jobinfo_copy(select_jobinfo_t *jobinfo) extern int select_g_select_jobinfo_pack(select_jobinfo_t *jobinfo, Buf buffer) { if (jobinfo) { - /* NOTE: If new elements are added here, make sure to + /* NOTE: If new elements are added here, make sure to * add equivalant pack of zeros below for NULL pointer */ packstr(jobinfo->reservation_id, buffer); } else { @@ -986,7 +986,7 @@ unpack_error: extern char *select_g_select_jobinfo_sprint(select_jobinfo_t *jobinfo, char *buf, size_t size, int mode) { - + if (buf == NULL) { error("select_g_select_jobinfo_sprint: buf is null"); return NULL; @@ -1011,25 +1011,25 @@ extern char *select_g_select_jobinfo_sprint(select_jobinfo_t *jobinfo, "RESV_ID"); break; case SELECT_PRINT_DATA: - snprintf(buf, size, + snprintf(buf, size, "%7s", jobinfo->reservation_id); break; case SELECT_PRINT_MIXED: - snprintf(buf, size, + snprintf(buf, size, "Resv_ID=%s", jobinfo->reservation_id); break; case SELECT_PRINT_RESV_ID: snprintf(buf, size, "%s", jobinfo->reservation_id); - break; + break; default: /* likely a BlueGene specific mode */ error("select_g_select_jobinfo_sprint: bad mode %d", mode); if (size > 0) buf[0] = '\0'; } - + return buf; } @@ -1042,7 +1042,7 @@ extern char *select_g_select_jobinfo_xstrdup( select_jobinfo_t *jobinfo, int mode) { char *buf = NULL; - + if ((mode != SELECT_PRINT_DATA) && jobinfo && (jobinfo->magic != JOBINFO_MAGIC)) { error("select_g_select_jobinfo_xstrdup: jobinfo magic bad"); @@ -1058,16 +1058,16 @@ extern char *select_g_select_jobinfo_xstrdup( switch (mode) { case SELECT_PRINT_HEAD: - xstrcat(buf, + xstrcat(buf, "RESV_ID"); break; case SELECT_PRINT_DATA: - xstrfmtcat(buf, + xstrfmtcat(buf, "%7s", jobinfo->reservation_id); break; case SELECT_PRINT_MIXED: - xstrfmtcat(buf, + xstrfmtcat(buf, "Resv_ID=%s", jobinfo->reservation_id); break; @@ -1077,7 +1077,7 @@ extern char *select_g_select_jobinfo_xstrdup( default: error("select_g_select_jobinfo_xstrdup: bad mode %d", mode); } - + return buf; } @@ -1087,7 +1087,7 @@ extern select_jobinfo_t *select_g_select_jobinfo_alloc() { if (slurm_select_init() < 0) return NULL; - + return (*(g_select_context->ops.jobinfo_alloc))(); } @@ -1098,7 +1098,7 @@ extern int select_g_select_jobinfo_free(select_jobinfo_t *jobinfo) { if (slurm_select_init() < 0) return SLURM_ERROR; - + return (*(g_select_context->ops.jobinfo_free))(jobinfo); } @@ -1108,7 +1108,7 @@ extern int select_g_select_jobinfo_set(select_jobinfo_t *jobinfo, { if (slurm_select_init() < 0) return SLURM_ERROR; - + return (*(g_select_context->ops.jobinfo_set))(jobinfo, data_type, data); } @@ -1118,12 +1118,12 @@ extern int select_g_select_jobinfo_set(select_jobinfo_t *jobinfo, * IN/OUT data - the data to enter into job credential */ extern int select_g_select_jobinfo_get(select_jobinfo_t *jobinfo, - enum select_jobdata_type data_type, + enum select_jobdata_type data_type, void *data) { if (slurm_select_init() < 0) return SLURM_ERROR; - + return (*(g_select_context->ops.jobinfo_get))(jobinfo, data_type, data); } @@ -1136,7 +1136,7 @@ extern select_jobinfo_t *select_g_select_jobinfo_copy(select_jobinfo_t *jobinfo) { if (slurm_select_init() < 0) return NULL; - + return (*(g_select_context->ops.jobinfo_copy))(jobinfo); } @@ -1149,7 +1149,7 @@ extern int select_g_select_jobinfo_pack(select_jobinfo_t *jobinfo, Buf buffer) { if (slurm_select_init() < 0) return SLURM_ERROR; - + return (*(g_select_context->ops.jobinfo_pack))(jobinfo, buffer); } @@ -1164,7 +1164,7 @@ extern int select_g_select_jobinfo_unpack( { if (slurm_select_init() < 0) return SLURM_ERROR; - + return (*(g_select_context->ops.jobinfo_unpack))(jobinfo, buffer); } @@ -1180,7 +1180,7 @@ extern char *select_g_select_jobinfo_sprint(select_jobinfo_t *jobinfo, { if (slurm_select_init() < 0) return NULL; - + return (*(g_select_context->ops.jobinfo_sprint)) (jobinfo, buf, size, mode); } @@ -1194,14 +1194,14 @@ extern char *select_g_select_jobinfo_xstrdup( { if (slurm_select_init() < 0) return NULL; - + return (*(g_select_context->ops.jobinfo_xstrdup))(jobinfo, mode); } #endif /* HAVE_CRAY_XT */ -/* - * Update specific block (usually something has gone wrong) +/* + * Update specific block (usually something has gone wrong) * IN block_desc_ptr - information about the block */ extern int select_g_update_block (update_block_msg_t *block_desc_ptr) @@ -1212,8 +1212,8 @@ extern int select_g_update_block (update_block_msg_t *block_desc_ptr) return (*(g_select_context->ops.update_block))(block_desc_ptr); } -/* - * Update specific sub nodes (usually something has gone wrong) +/* + * Update specific sub nodes (usually something has gone wrong) * IN block_desc_ptr - information about the block */ extern int select_g_update_sub_node (update_block_msg_t *block_desc_ptr) @@ -1224,13 +1224,13 @@ extern int select_g_update_sub_node (update_block_msg_t *block_desc_ptr) return (*(g_select_context->ops.update_sub_node))(block_desc_ptr); } -/* +/* * Get select data from a plugin - * IN dinfo - type of data to get from the node record + * IN dinfo - type of data to get from the node record * (see enum select_plugindata_info) * IN/OUT data - the data to get from node record */ -extern int select_g_get_info_from_plugin (enum select_plugindata_info dinfo, +extern int select_g_get_info_from_plugin (enum select_plugindata_info dinfo, struct job_record *job_ptr, void *data) { @@ -1255,7 +1255,7 @@ extern int select_g_update_node_config (int index) return (*(g_select_context->ops.update_node_config))(index); } -/* +/* * Updated a node state in the plugin, this should happen when a node is * drained or put into a down state then changed back. * IN index - index into the node record list @@ -1270,7 +1270,7 @@ extern int select_g_update_node_state (int index, uint16_t state) return (*(g_select_context->ops.update_node_state))(index, state); } -/* +/* * Alter the node count for a job given the type of system we are on * IN/OUT job_desc - current job desc */ @@ -1283,7 +1283,7 @@ extern int select_g_alter_node_cnt (enum select_node_cnt type, void *data) /* default to one, so most plugins don't have to */ uint32_t *nodes = (uint32_t *)data; *nodes = 1; - } + } return (*(g_select_context->ops.alter_node_cnt))(type, data); } @@ -1294,7 +1294,7 @@ extern int select_g_reconfigure (void) { if (slurm_select_init() < 0) return SLURM_ERROR; - + return (*(g_select_context->ops.reconfigure))(); } diff --git a/src/common/node_select.h b/src/common/node_select.h index 448b368265..378ad7ed0a 100644 --- a/src/common/node_select.h +++ b/src/common/node_select.h @@ -6,38 +6,38 @@ * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Morris Jette * CODE-OCEC-09-009. All rights reserved. - * + * * This file is part of SLURM, a resource management program. * For details, see . * Please also read the included file: DISCLAIMER. - * + * * SLURM is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free * Software Foundation; either version 2 of the License, or (at your option) * any later version. * - * In addition, as a special exception, the copyright holders give permission + * In addition, as a special exception, the copyright holders give permission * to link the code of portions of this program with the OpenSSL library under - * certain conditions as described in each individual source file, and - * distribute linked combinations including the two. You must obey the GNU - * General Public License in all respects for all of the code used other than - * OpenSSL. If you modify file(s) with this exception, you may extend this - * exception to your version of the file(s), but you are not obligated to do + * certain conditions as described in each individual source file, and + * distribute linked combinations including the two. You must obey the GNU + * General Public License in all respects for all of the code used other than + * OpenSSL. If you modify file(s) with this exception, you may extend this + * exception to your version of the file(s), but you are not obligated to do * so. If you do not wish to do so, delete this exception statement from your - * version. If you delete this exception statement from all source files in + * version. If you delete this exception statement from all source files in * the program, then also delete it here. - * + * * SLURM is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. - * + * * You should have received a copy of the GNU General Public License along * with SLURM; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. \*****************************************************************************/ -#ifndef _NODE_SELECT_H +#ifndef _NODE_SELECT_H #define _NODE_SELECT_H #include @@ -70,7 +70,7 @@ extern void node_select_pack_block_info(block_info_t *block_info, Buf buffer); extern int node_select_unpack_block_info(block_info_t **block_info, Buf buffer); /* - * node_select_block_info_msg_free - free buffer returned by + * node_select_block_info_msg_free - free buffer returned by * slurm_load_node_select * IN block_info_msg_pptr - data is freed and pointer is set to NULL * RET 0 or a slurm error code @@ -105,8 +105,8 @@ extern int select_g_state_save(char *dir_name); */ extern int select_g_state_restore(char *dir_name); -/* - * Note the initialization of job records, issued upon restart of +/* + * Note the initialization of job records, issued upon restart of * slurmctld and used to synchronize any job state. */ extern int select_g_job_init(List job_list); @@ -124,39 +124,39 @@ extern int select_g_node_init(struct node_record *node_ptr, int node_cnt); */ extern int select_g_block_init(List part_list); -/* - * Update specific block (usually something has gone wrong) +/* + * Update specific block (usually something has gone wrong) * IN block_desc_ptr - information about the block */ extern int select_g_update_block (update_block_msg_t *block_desc_ptr); -/* - * Update specific sub nodes (usually something has gone wrong) +/* + * Update specific sub nodes (usually something has gone wrong) * IN block_desc_ptr - information about the block */ extern int select_g_update_sub_node (update_block_msg_t *block_desc_ptr); -/* +/* * Get select data from a plugin * IN node_pts - current node record - * IN dinfo - type of data to get from the node record + * IN dinfo - type of data to get from the node record * (see enum select_plugindata_info) * IN job_ptr - pointer to the job that's related to this query (may be NULL) * IN/OUT data - the data to get from node record */ -extern int select_g_get_info_from_plugin (enum select_plugindata_info dinfo, +extern int select_g_get_info_from_plugin (enum select_plugindata_info dinfo, struct job_record *job_ptr, void *data); -/* - * Updated a node configuration. This happens when a node registers with +/* + * Updated a node configuration. This happens when a node registers with * more resources than originally configured (e.g. memory). * IN index - index into the node record list * RETURN SLURM_SUCCESS on success || SLURM_ERROR else wise */ extern int select_g_update_node_config (int index); -/* +/* * Updated a node state in the plugin, this should happen when a node is * drained or put into a down state then changed back. * IN index - index into the node record list @@ -165,7 +165,7 @@ extern int select_g_update_node_config (int index); */ extern int select_g_update_node_state (int index, uint16_t state); -/* +/* * Alter the node count for a job given the type of system we are on * IN/OUT job_desc - current job desc */ @@ -219,20 +219,20 @@ extern int select_g_alter_node_cnt (enum select_node_cnt type, void *data); * SELECT_MODE_TEST_ONLY: test if job can ever run * SELECT_MODE_WILL_RUN: determine when and where job can run * IN preemptee_candidates - List of pointers to jobs which can bee preempted - * IN/OUT preemptee_job_list - Pointer to list of job pointers. These are the - * jobs to be preempted to initiate the pending job. Not set + * IN/OUT preemptee_job_list - Pointer to list of job pointers. These are the + * jobs to be preempted to initiate the pending job. Not set * if mode=SELECT_MODE_TEST_ONLY or input pointer is NULL. * Existing list is appended to. * RET zero on success, EINVAL otherwise */ extern int select_g_job_test(struct job_record *job_ptr, bitstr_t *bitmap, - uint32_t min_nodes, uint32_t max_nodes, - uint32_t req_nodes, uint16_t mode, + uint32_t min_nodes, uint32_t max_nodes, + uint32_t req_nodes, uint16_t mode, List preemptee_candidates, List *preemptee_job_list); /* - * Note initiation of job is about to begin. Called immediately + * Note initiation of job is about to begin. Called immediately * after select_g_job_test(). Executed from slurmctld. * IN job_ptr - pointer to job being initiated */ @@ -283,7 +283,7 @@ extern int select_g_select_jobinfo_free(select_jobinfo_t *jobinfo); * IN data - the data to enter into job credential */ extern int select_g_select_jobinfo_set(select_jobinfo_t *jobinfo, - enum select_jobdata_type data_type, + enum select_jobdata_type data_type, void *data); /* get data from a select job credential @@ -357,9 +357,9 @@ extern int select_g_select_nodeinfo_set_all(time_t last_query_time); extern int select_g_select_nodeinfo_set(struct job_record *job_ptr); -extern int select_g_select_nodeinfo_get(select_nodeinfo_t *nodeinfo, +extern int select_g_select_nodeinfo_get(select_nodeinfo_t *nodeinfo, enum select_nodedata_type dinfo, - enum node_states state, + enum node_states state, void *data); @@ -367,7 +367,7 @@ extern int select_g_select_nodeinfo_get(select_nodeinfo_t *nodeinfo, * NODE-SELECT PLUGIN SPECIFIC INFORMATION FUNCTIONS * \******************************************************/ -/* pack node-select plugin specific information into a buffer in +/* pack node-select plugin specific information into a buffer in * machine independent form * IN last_update_time - time of latest information consumer has * OUT buffer - location to hold the data, consumer must free diff --git a/src/common/optz.c b/src/common/optz.c index 61d562d4f0..79106f0ee2 100644 --- a/src/common/optz.c +++ b/src/common/optz.c @@ -4,32 +4,32 @@ * Copyright (C) 2002 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * CODE-OCEC-09-009. All rights reserved. - * + * * This file is part of SLURM, a resource management program. * For details, see . * Please also read the included file: DISCLAIMER. - * + * * SLURM is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free * Software Foundation; either version 2 of the License, or (at your option) * any later version. * - * In addition, as a special exception, the copyright holders give permission - * to link the code of portions of this program with the OpenSSL library under - * certain conditions as described in each individual source file, and - * distribute linked combinations including the two. You must obey the GNU - * General Public License in all respects for all of the code used other than - * OpenSSL. If you modify file(s) with this exception, you may extend this - * exception to your version of the file(s), but you are not obligated to do + * In addition, as a special exception, the copyright holders give permission + * to link the code of portions of this program with the OpenSSL library under + * certain conditions as described in each individual source file, and + * distribute linked combinations including the two. You must obey the GNU + * General Public License in all respects for all of the code used other than + * OpenSSL. If you modify file(s) with this exception, you may extend this + * exception to your version of the file(s), but you are not obligated to do * so. If you do not wish to do so, delete this exception statement from your - * version. If you delete this exception statement from all source files in + * version. If you delete this exception statement from all source files in * the program, then also delete it here. - * + * * SLURM is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. - * + * * You should have received a copy of the GNU General Public License along * with SLURM; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. diff --git a/src/common/optz.h b/src/common/optz.h index 5eedcc07ba..37d14278c6 100644 --- a/src/common/optz.h +++ b/src/common/optz.h @@ -4,32 +4,32 @@ * Copyright (C) 2005 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * CODE-OCEC-09-009. All rights reserved. - * + * * This file is part of SLURM, a resource management program. * For details, see . * Please also read the included file: DISCLAIMER. - * + * * SLURM is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free * Software Foundation; either version 2 of the License, or (at your option) * any later version. * - * In addition, as a special exception, the copyright holders give permission - * to link the code of portions of this program with the OpenSSL library under - * certain conditions as described in each individual source file, and - * distribute linked combinations including the two. You must obey the GNU - * General Public License in all respects for all of the code used other than - * OpenSSL. If you modify file(s) with this exception, you may extend this - * exception to your version of the file(s), but you are not obligated to do + * In addition, as a special exception, the copyright holders give permission + * to link the code of portions of this program with the OpenSSL library under + * certain conditions as described in each individual source file, and + * distribute linked combinations including the two. You must obey the GNU + * General Public License in all respects for all of the code used other than + * OpenSSL. If you modify file(s) with this exception, you may extend this + * exception to your version of the file(s), but you are not obligated to do * so. If you do not wish to do so, delete this exception statement from your - * version. If you delete this exception statement from all source files in + * version. If you delete this exception statement from all source files in * the program, then also delete it here. - * + * * SLURM is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. - * + * * You should have received a copy of the GNU General Public License along * with SLURM; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. diff --git a/src/common/pack.c b/src/common/pack.c index afda7603bc..b4a2aa5b2a 100644 --- a/src/common/pack.c +++ b/src/common/pack.c @@ -5,35 +5,35 @@ * Copyright (C) 2002-2007 The Regents of the University of California. * Copyright (C) 2008 Lawrence Livermore National Security. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). - * Written by Jim Garlick , + * Written by Jim Garlick , * Morris Jette , et. al. * CODE-OCEC-09-009. All rights reserved. - * + * * This file is part of SLURM, a resource management program. * For details, see . * Please also read the included file: DISCLAIMER. - * + * * SLURM is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free * Software Foundation; either version 2 of the License, or (at your option) * any later version. * - * In addition, as a special exception, the copyright holders give permission - * to link the code of portions of this program with the OpenSSL library under - * certain conditions as described in each individual source file, and - * distribute linked combinations including the two. You must obey the GNU - * General Public License in all respects for all of the code used other than - * OpenSSL. If you modify file(s) with this exception, you may extend this - * exception to your version of the file(s), but you are not obligated to do + * In addition, as a special exception, the copyright holders give permission + * to link the code of portions of this program with the OpenSSL library under + * certain conditions as described in each individual source file, and + * distribute linked combinations including the two. You must obey the GNU + * General Public License in all respects for all of the code used other than + * OpenSSL. If you modify file(s) with this exception, you may extend this + * exception to your version of the file(s), but you are not obligated to do * so. If you do not wish to do so, delete this exception statement from your - * version. If you delete this exception statement from all source files in + * version. If you delete this exception statement from all source files in * the program, then also delete it here. - * + * * SLURM is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. - * + * * You should have received a copy of the GNU General Public License along * with SLURM; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. @@ -63,8 +63,8 @@ #define MAX_PACK_STR_LEN (16 * 1024 * 1024) /* - * Define slurm-specific aliases for use by plugins, see slurm_xlator.h - * for details. + * Define slurm-specific aliases for use by plugins, see slurm_xlator.h + * for details. */ strong_alias(create_buf, slurm_create_buf); strong_alias(free_buf, slurm_free_buf); @@ -218,7 +218,7 @@ void packdouble(double val, Buf buffer) this is here to correct it. */ uint64_t nl = HTON_uint64(nl1); - + if (remaining_buf(buffer) < sizeof(nl)) { if (buffer->size > (MAX_BUF_SIZE - BUF_SIZE)) { error("pack64: buffer size too large"); @@ -235,7 +235,7 @@ void packdouble(double val, Buf buffer) /* * Given a buffer containing a network byte order 64-bit integer, - * typecast as double, and divide by FLOAT_MULT + * typecast as double, and divide by FLOAT_MULT * store a host double at 'valp', and adjust buffer counters. */ int unpackdouble(double *valp, Buf buffer) @@ -243,7 +243,7 @@ int unpackdouble(double *valp, Buf buffer) uint64_t nl; if (remaining_buf(buffer) < sizeof(nl)) return SLURM_ERROR; - + memcpy(&nl, &buffer->head[buffer->processed], sizeof(nl)); *valp = (double)NTOH_uint64(nl) / (double)FLOAT_MULT; @@ -281,7 +281,7 @@ int unpack64(uint64_t * valp, Buf buffer) uint64_t nl; if (remaining_buf(buffer) < sizeof(nl)) return SLURM_ERROR; - + memcpy(&nl, &buffer->head[buffer->processed], sizeof(nl)); *valp = NTOH_uint64(nl); buffer->processed += sizeof(nl); @@ -318,7 +318,7 @@ int unpack32(uint32_t * valp, Buf buffer) uint32_t nl; if (remaining_buf(buffer) < sizeof(nl)) return SLURM_ERROR; - + memcpy(&nl, &buffer->head[buffer->processed], sizeof(nl)); *valp = ntohl(nl); buffer->processed += sizeof(nl); @@ -455,8 +455,8 @@ int unpack8(uint8_t * valp, Buf buffer) } /* - * Given a pointer to memory (valp) and a size (size_val), convert - * size_val to network byte order and store at buffer followed by + * Given a pointer to memory (valp) and a size (size_val), convert + * size_val to network byte order and store at buffer followed by * the data at valp. Adjust buffer counters. */ void packmem(char *valp, uint32_t size_val, Buf buffer) @@ -484,10 +484,10 @@ void packmem(char *valp, uint32_t size_val, Buf buffer) /* * Given a buffer containing a network byte order 16-bit integer, - * and an arbitrary data string, return a pointer to the - * data string in 'valp'. Also return the sizes of 'valp' in bytes. + * and an arbitrary data string, return a pointer to the + * data string in 'valp'. Also return the sizes of 'valp' in bytes. * Adjust buffer counters. - * NOTE: valp is set to point into the buffer bufp, a copy of + * NOTE: valp is set to point into the buffer bufp, a copy of * the data is not made */ int unpackmem_ptr(char **valp, uint32_t * size_valp, Buf buffer) @@ -508,7 +508,7 @@ int unpackmem_ptr(char **valp, uint32_t * size_valp, Buf buffer) return SLURM_ERROR; *valp = &buffer->head[buffer->processed]; buffer->processed += *size_valp; - } else + } else *valp = NULL; return SLURM_SUCCESS; } @@ -516,10 +516,10 @@ int unpackmem_ptr(char **valp, uint32_t * size_valp, Buf buffer) /* * Given a buffer containing a network byte order 16-bit integer, - * and an arbitrary data string, copy the data string into the location - * specified by valp. Also return the sizes of 'valp' in bytes. + * and an arbitrary data string, copy the data string into the location + * specified by valp. Also return the sizes of 'valp' in bytes. * Adjust buffer counters. - * NOTE: The caller is responsible for the management of valp and + * NOTE: The caller is responsible for the management of valp and * insuring it has sufficient size */ int unpackmem(char *valp, uint32_t * size_valp, Buf buffer) @@ -540,17 +540,17 @@ int unpackmem(char *valp, uint32_t * size_valp, Buf buffer) return SLURM_ERROR; memcpy(valp, &buffer->head[buffer->processed], *size_valp); buffer->processed += *size_valp; - } else + } else *valp = 0; return SLURM_SUCCESS; } /* * Given a buffer containing a network byte order 16-bit integer, - * and an arbitrary data string, copy the data string into the location - * specified by valp. Also return the sizes of 'valp' in bytes. + * and an arbitrary data string, copy the data string into the location + * specified by valp. Also return the sizes of 'valp' in bytes. * Adjust buffer counters. - * NOTE: valp is set to point into a newly created buffer, + * NOTE: valp is set to point into a newly created buffer, * the caller is responsible for calling xfree() on *valp * if non-NULL (set to NULL on zero size buffer value) */ @@ -581,10 +581,10 @@ int unpackmem_xmalloc(char **valp, uint32_t * size_valp, Buf buffer) /* * Given a buffer containing a network byte order 16-bit integer, - * and an arbitrary data string, copy the data string into the location - * specified by valp. Also return the sizes of 'valp' in bytes. + * and an arbitrary data string, copy the data string into the location + * specified by valp. Also return the sizes of 'valp' in bytes. * Adjust buffer counters. - * NOTE: valp is set to point into a newly created buffer, + * NOTE: valp is set to point into a newly created buffer, * the caller is responsible for calling free() on *valp * if non-NULL (set to NULL on zero size buffer value) */ @@ -613,9 +613,9 @@ int unpackmem_malloc(char **valp, uint32_t * size_valp, Buf buffer) } /* - * Given a pointer to array of char * (char ** or char *[] ) and a size - * (size_val), convert size_val to network byte order and store in the - * buffer followed by the data at valp. Adjust buffer counters. + * Given a pointer to array of char * (char ** or char *[] ) and a size + * (size_val), convert size_val to network byte order and store in the + * buffer followed by the data at valp. Adjust buffer counters. */ void packstr_array(char **valp, uint32_t size_val, Buf buffer) { @@ -644,7 +644,7 @@ void packstr_array(char **valp, uint32_t size_val, Buf buffer) * Given 'buffer' pointing to a network byte order 16-bit integer * (size) and a array of strings store the number of strings in * 'size_valp' and the array of strings in valp - * NOTE: valp is set to point into a newly created buffer, + * NOTE: valp is set to point into a newly created buffer, * the caller is responsible for calling xfree on *valp * if non-NULL (set to NULL on zero size buffer value) */ @@ -678,7 +678,7 @@ int unpackstr_array(char ***valp, uint32_t * size_valp, Buf buffer) /* * Given a pointer to memory (valp), size (size_val), and buffer, - * store the memory contents into the buffer + * store the memory contents into the buffer */ void packmem_array(char *valp, uint32_t size_val, Buf buffer) { @@ -697,7 +697,7 @@ void packmem_array(char *valp, uint32_t size_val, Buf buffer) /* * Given a pointer to memory (valp), size (size_val), and buffer, - * store the buffer contents into memory + * store the buffer contents into memory */ int unpackmem_array(char *valp, uint32_t size_valp, Buf buffer) { diff --git a/src/common/pack.h b/src/common/pack.h index 3b16d15adc..9636b2d1f3 100644 --- a/src/common/pack.h +++ b/src/common/pack.h @@ -1,5 +1,5 @@ /****************************************************************************\ - * pack.h - definitions for lowest level un/pack functions. all functions + * pack.h - definitions for lowest level un/pack functions. all functions * utilize a Buf structure. Call init_buf, un/pack, and free_buf ***************************************************************************** * Copyright (C) 2002-2007 The Regents of the University of California. @@ -7,32 +7,32 @@ * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Kevin Tew , Morris Jette , et. al. * CODE-OCEC-09-009. All rights reserved. - * + * * This file is part of SLURM, a resource management program. * For details, see . * Please also read the included file: DISCLAIMER. - * + * * SLURM is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free * Software Foundation; either version 2 of the License, or (at your option) * any later version. * - * In addition, as a special exception, the copyright holders give permission - * to link the code of portions of this program with the OpenSSL library under - * certain conditions as described in each individual source file, and - * distribute linked combinations including the two. You must obey the GNU - * General Public License in all respects for all of the code used other than - * OpenSSL. If you modify file(s) with this exception, you may extend this - * exception to your version of the file(s), but you are not obligated to do + * In addition, as a special exception, the copyright holders give permission + * to link the code of portions of this program with the OpenSSL library under + * certain conditions as described in each individual source file, and + * distribute linked combinations including the two. You must obey the GNU + * General Public License in all respects for all of the code used other than + * OpenSSL. If you modify file(s) with this exception, you may extend this + * exception to your version of the file(s), but you are not obligated to do * so. If you do not wish to do so, delete this exception statement from your - * version. If you delete this exception statement from all source files in + * version. If you delete this exception statement from all source files in * the program, then also delete it here. - * + * * SLURM is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. - * + * * You should have received a copy of the GNU General Public License along * with SLURM; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. @@ -208,7 +208,7 @@ int unpackmem_array(char *valp, uint32_t size_valp, Buf buffer); assert(size_val == 0 || array != NULL); \ assert(buf->magic == BUF_MAGIC); \ pack32_array(array,size_val,buf); \ -} while (0) +} while (0) #define safe_unpack16_array(valp,size_valp,buf) do { \ assert(valp != NULL); \ @@ -276,7 +276,7 @@ int unpackmem_array(char *valp, uint32_t size_valp, Buf buffer); packmem(_tmp_str,_size,buf); \ } else \ packmem(NULL,(uint32_t)0,buf); \ -} while (0) +} while (0) #define safe_packstr(str,max_len,buf) do { \ uint32_t _size; \ @@ -292,7 +292,7 @@ int unpackmem_array(char *valp, uint32_t size_valp, Buf buffer); tmp_str[max_len - 1] = (char) NULL; \ packmem(tmp_str,max_len,buf); \ } \ -} while (0) +} while (0) #define packstr(str,buf) do { \ uint32_t _size = 0; \ @@ -302,7 +302,7 @@ int unpackmem_array(char *valp, uint32_t size_valp, Buf buffer); assert(_size <= 0xffffffff); \ assert(buf->magic == BUF_MAGIC); \ packmem(str,(uint32_t)_size,buf); \ -} while (0) +} while (0) #define packnull(buf) do { \ assert(buf != NULL); \ @@ -321,7 +321,7 @@ int unpackmem_array(char *valp, uint32_t size_valp, Buf buffer); } else \ packmem(NULL,(uint32_t)0,buf); \ } while (0) - + #define pack_bit_str(bitmap,buf) do { \ assert(buf->magic == BUF_MAGIC); \ if (bitmap) { \ @@ -334,8 +334,8 @@ int unpackmem_array(char *valp, uint32_t size_valp, Buf buffer); packmem(_tmp_str,_size,buf); \ } else \ pack32(NO_VAL, buf); \ -} while (0) - +} while (0) + #define unpack_bit_str(bitmap,buf) do { \ assert(bitmap != NULL); \ assert(*bitmap == NULL); \ @@ -352,7 +352,7 @@ int unpackmem_array(char *valp, uint32_t size_valp, Buf buffer); } else \ *bitmap = NULL; \ } \ -} while (0) +} while (0) #define unpackstr_ptr \ unpackmem_ptr @@ -374,7 +374,7 @@ int unpackmem_array(char *valp, uint32_t size_valp, Buf buffer); assert(sizeof(*size_valp) == sizeof(uint32_t)); \ assert(buf->magic == BUF_MAGIC); \ packstr_array(array,size_val,buf); \ -} while (0) +} while (0) #define safe_unpackstr_array(valp,size_valp,buf) do { \ assert(valp != NULL); \ diff --git a/src/common/parse_config.c b/src/common/parse_config.c index 9a36b13745..0649b6ea8f 100644 --- a/src/common/parse_config.c +++ b/src/common/parse_config.c @@ -8,32 +8,32 @@ * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Christopher J. Morrone . * CODE-OCEC-09-009. All rights reserved. - * + * * This file is part of SLURM, a resource management program. * For details, see . * Please also read the included file: DISCLAIMER. - * + * * SLURM is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free * Software Foundation; either version 2 of the License, or (at your option) * any later version. * - * In addition, as a special exception, the copyright holders give permission + * In addition, as a special exception, the copyright holders give permission * to link the code of portions of this program with the OpenSSL library under - * certain conditions as described in each individual source file, and - * distribute linked combinations including the two. You must obey the GNU - * General Public License in all respects for all of the code used other than - * OpenSSL. If you modify file(s) with this exception, you may extend this - * exception to your version of the file(s), but you are not obligated to do + * certain conditions as described in each individual source file, and + * distribute linked combinations including the two. You must obey the GNU + * General Public License in all respects for all of the code used other than + * OpenSSL. If you modify file(s) with this exception, you may extend this + * exception to your version of the file(s), but you are not obligated to do * so. If you do not wish to do so, delete this exception statement from your - * version. If you delete this exception statement from all source files in + * version. If you delete this exception statement from all source files in * the program, then also delete it here. - * + * * SLURM is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. - * + * * You should have received a copy of the GNU General Public License along * with SLURM; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. @@ -147,7 +147,7 @@ s_p_hashtbl_t *s_p_hashtbl_create( len = CONF_HASH_LEN * sizeof(s_p_values_t *); hashtbl = (s_p_hashtbl_t *)xmalloc(len); memset(hashtbl, 0, len); - + for (op = options; op->key != NULL; op++) { value = xmalloc(sizeof(s_p_values_t)); value->key = xstrdup(op->key); @@ -236,7 +236,7 @@ static int _keyvalue_regex(const char *line, *value = NULL; *remaining = (char *)line; memset(pmatch, 0, sizeof(regmatch_t)*nmatch); - + if (regexec(&keyvalue_re, line, nmatch, pmatch, 0) == REG_NOMATCH) { return -1; @@ -369,7 +369,7 @@ static int _get_next_line(char *buf, int buf_size, FILE *file) } /* _strip_cr_nl(buf); */ /* not necessary */ _strip_escapes(buf); - + return lines; } @@ -377,7 +377,7 @@ static int _handle_string(s_p_values_t *v, const char *value, const char *line, char **leftover) { if (v->data_count != 0) { - error("%s specified more than once, latest value used", + error("%s specified more than once, latest value used", v->key); xfree(v->data); v->data_count = 0; @@ -402,7 +402,7 @@ static int _handle_long(s_p_values_t *v, const char *value, const char *line, char **leftover) { if (v->data_count != 0) { - error("%s specified more than once, latest value used", + error("%s specified more than once, latest value used", v->key); xfree(v->data); v->data_count = 0; @@ -445,7 +445,7 @@ static int _handle_uint16(s_p_values_t *v, const char *value, const char *line, char **leftover) { if (v->data_count != 0) { - error("%s specified more than once, latest value used", + error("%s specified more than once, latest value used", v->key); xfree(v->data); v->data_count = 0; @@ -470,7 +470,7 @@ static int _handle_uint16(s_p_values_t *v, || strcasecmp(value, "INFINITE") == 0) { num = (uint16_t) INFINITE; } else { - error("%s value \"%s\" is not a valid number", + error("%s value \"%s\" is not a valid number", v->key, value); return -1; } @@ -478,7 +478,7 @@ static int _handle_uint16(s_p_values_t *v, error("%s value (%s) is out of range", v->key, value); return -1; } else if (value[0] == '-') { - error("%s value (%s) is less than zero", v->key, + error("%s value (%s) is less than zero", v->key, value); return -1; } else if (num > 0xffff) { @@ -498,7 +498,7 @@ static int _handle_uint32(s_p_values_t *v, const char *value, const char *line, char **leftover) { if (v->data_count != 0) { - error("%s specified more than once, latest value used", + error("%s specified more than once, latest value used", v->key); xfree(v->data); v->data_count = 0; @@ -527,7 +527,7 @@ static int _handle_uint32(s_p_values_t *v, (strcasecmp(value, "INFINITE") == 0)) { num = (uint32_t) INFINITE; } else { - error("%s value (%s) is not a valid number", + error("%s value (%s) is not a valid number", v->key, value); return -1; } @@ -535,11 +535,11 @@ static int _handle_uint32(s_p_values_t *v, error("%s value (%s) is out of range", v->key, value); return -1; } else if (value[0] == '-') { - error("%s value (%s) is less than zero", v->key, + error("%s value (%s) is less than zero", v->key, value); return -1; } else if (num > 0xffffffff) { - error("%s value (%s) is greater than 4294967295", + error("%s value (%s) is greater than 4294967295", v->key, value); return -1; } @@ -552,7 +552,7 @@ static int _handle_uint32(s_p_values_t *v, } static int _handle_pointer(s_p_values_t *v, - const char *value, const char *line, + const char *value, const char *line, char **leftover) { if (v->handler != NULL) { @@ -601,11 +601,11 @@ static int _handle_array(s_p_values_t *v, } static int _handle_boolean(s_p_values_t *v, - const char *value, const char *line, + const char *value, const char *line, char **leftover) { if (v->data_count != 0) { - error("%s specified more than once, latest value used", + error("%s specified more than once, latest value used", v->key); xfree(v->data); v->data_count = 0; @@ -823,9 +823,9 @@ int s_p_parse_file(s_p_hashtbl_t *hashtbl, char *filename) error("s_p_parse_file: No filename given."); return SLURM_ERROR; } - + _keyvalue_regex_init(); - + f = fopen(filename, "r"); if (f == NULL) { error("s_p_parse_file: unable to read \"%s\": %m", @@ -1083,7 +1083,7 @@ int s_p_get_pointer(void **ptr, const char *key, const s_p_hashtbl_t *hashtbl) * Returns 1 when a value was set for "key" during parsing and both * "ptr_array" and "count" were successfully set, otherwise returns 0. */ -int s_p_get_array(void **ptr_array[], int *count, +int s_p_get_array(void **ptr_array[], int *count, const char *key, const s_p_hashtbl_t *hashtbl) { s_p_values_t *p; diff --git a/src/common/parse_config.h b/src/common/parse_config.h index 0f71360338..b9e8026d28 100644 --- a/src/common/parse_config.h +++ b/src/common/parse_config.h @@ -13,28 +13,28 @@ * This file is part of SLURM, a resource management program. * For details, see . * Please also read the included file: DISCLAIMER. - * + * * SLURM is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free * Software Foundation; either version 2 of the License, or (at your option) * any later version. * - * In addition, as a special exception, the copyright holders give permission - * to link the code of portions of this program with the OpenSSL library under - * certain conditions as described in each individual source file, and - * distribute linked combinations including the two. You must obey the GNU - * General Public License in all respects for all of the code used other than - * OpenSSL. If you modify file(s) with this exception, you may extend this - * exception to your version of the file(s), but you are not obligated to do + * In addition, as a special exception, the copyright holders give permission + * to link the code of portions of this program with the OpenSSL library under + * certain conditions as described in each individual source file, and + * distribute linked combinations including the two. You must obey the GNU + * General Public License in all respects for all of the code used other than + * OpenSSL. If you modify file(s) with this exception, you may extend this + * exception to your version of the file(s), but you are not obligated to do * so. If you do not wish to do so, delete this exception statement from your - * version. If you delete this exception statement from all source files in + * version. If you delete this exception statement from all source files in * the program, then also delete it here. - * + * * SLURM is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. - * + * * You should have received a copy of the GNU General Public License along * with SLURM; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. @@ -290,7 +290,7 @@ int s_p_get_pointer(void **ptr, const char *key, const s_p_hashtbl_t *hashtbl); * Returns 1 when a value was set for "key" during parsing and "ptr" * was successfully set, otherwise returns 0; */ -int s_p_get_array(void **ptr_array[], int *count, +int s_p_get_array(void **ptr_array[], int *count, const char *key, const s_p_hashtbl_t *hashtbl); /* diff --git a/src/common/parse_spec.c b/src/common/parse_spec.c index 01c1dbbae6..d07abc120d 100644 --- a/src/common/parse_spec.c +++ b/src/common/parse_spec.c @@ -6,32 +6,32 @@ * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Morris Jette * CODE-OCEC-09-009. All rights reserved. - * + * * This file is part of SLURM, a resource management program. * For details, see . * Please also read the included file: DISCLAIMER. - * + * * SLURM is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free * Software Foundation; either version 2 of the License, or (at your option) * any later version. * - * In addition, as a special exception, the copyright holders give permission - * to link the code of portions of this program with the OpenSSL library under - * certain conditions as described in each individual source file, and - * distribute linked combinations including the two. You must obey the GNU - * General Public License in all respects for all of the code used other than - * OpenSSL. If you modify file(s) with this exception, you may extend this - * exception to your version of the file(s), but you are not obligated to do + * In addition, as a special exception, the copyright holders give permission + * to link the code of portions of this program with the OpenSSL library under + * certain conditions as described in each individual source file, and + * distribute linked combinations including the two. You must obey the GNU + * General Public License in all respects for all of the code used other than + * OpenSSL. If you modify file(s) with this exception, you may extend this + * exception to your version of the file(s), but you are not obligated to do * so. If you do not wish to do so, delete this exception statement from your - * version. If you delete this exception statement from all source files in + * version. If you delete this exception statement from all source files in * the program, then also delete it here. - * + * * SLURM is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. - * + * * You should have received a copy of the GNU General Public License along * with SLURM; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. @@ -66,20 +66,20 @@ static int _load_long (long *destination, char *keyword, char *in_line) ; static int _load_integer (int *destination, char *keyword, char *in_line) ; static int _load_float (float *destination, char *keyword, char *in_line) ; -/* +/* * slurm_parser - parse the supplied specification into keyword/value pairs - * only the keywords supplied will be searched for. The supplied - * specification is altered, overwriting the keyword and value pairs + * only the keywords supplied will be searched for. The supplied + * specification is altered, overwriting the keyword and value pairs * with spaces. - * spec - pointer to the string of specifications, sets of three values - * (as many sets as required): keyword, type, value - * IN keyword - string with the keyword to search for including equal sign + * spec - pointer to the string of specifications, sets of three values + * (as many sets as required): keyword, type, value + * IN keyword - string with the keyword to search for including equal sign * (e.g. "name=") * IN type - char with value 'd'==int, 'f'==float, 's'==string, 'l'==long * IN/OUT value - pointer to storage location for value (char **) for type 's' * RET 0 if no error, otherwise errno code * NOTE: terminate with a keyword value of "END" - * NOTE: values of type (char *) are xfreed if non-NULL. caller must xfree any + * NOTE: values of type (char *) are xfreed if non-NULL. caller must xfree any * returned value */ int @@ -90,7 +90,7 @@ slurm_parser (char *spec, ...) int error_code, *int_ptr, type; long *long_ptr; float *float_ptr; - + error_code = 0; va_start(ap, spec); while (error_code == 0) { @@ -125,17 +125,17 @@ slurm_parser (char *spec, ...) /* - * _load_float - parse a string for a keyword, value pair, and load the float + * _load_float - parse a string for a keyword, value pair, and load the float * value * IN keyword - string to search for - * IN/OUT in_line - string to search for keyword, the keyword and value + * IN/OUT in_line - string to search for keyword, the keyword and value * (if present) are overwritten by spaces * OUT destination - set to value, no change if value not found * RET 0 if no error, otherwise an error code * NOTE: in_line is overwritten, do not use a constant */ -static int -_load_float (float *destination, char *keyword, char *in_line) +static int +_load_float (float *destination, char *keyword, char *in_line) { char scratch[BUFFER_SIZE]; /* scratch area for parsing the input line */ char *str_ptr1, *str_ptr2, *str_ptr3; @@ -146,7 +146,7 @@ _load_float (float *destination, char *keyword, char *in_line) str_len1 = strlen (keyword); strcpy (scratch, str_ptr1 + str_len1); if ((scratch[0] < '0') && (scratch[0] > '9')) { - error ("_load_float: bad value for keyword %s", + error ("_load_float: bad value for keyword %s", keyword); return EINVAL; } @@ -162,18 +162,18 @@ _load_float (float *destination, char *keyword, char *in_line) /* - * _load_integer - parse a string for a keyword, value pair, and load the + * _load_integer - parse a string for a keyword, value pair, and load the * integer value * OUT destination - location into which result is stored - * set to 1 if keyword found without value, + * set to 1 if keyword found without value, * set to -1 if keyword followed by "unlimited" * IN keyword - string to search for - * IN/OUT in_line - string to search for keyword, the keyword and value + * IN/OUT in_line - string to search for keyword, the keyword and value * (if present) are overwritten by spaces * RET 0 if no error, otherwise an error code */ -static int -_load_integer (int *destination, char *keyword, char *in_line) +static int +_load_integer (int *destination, char *keyword, char *in_line) { char scratch[BUFFER_SIZE]; /* scratch area for parsing the input line */ char *str_ptr1, *str_ptr2, *str_ptr3; @@ -183,22 +183,22 @@ _load_integer (int *destination, char *keyword, char *in_line) if (str_ptr1 != NULL) { str_len1 = strlen (keyword); strcpy (scratch, str_ptr1 + str_len1); - if ((scratch[0] == '\0') || + if ((scratch[0] == '\0') || (isspace ((int) scratch[0]))) { /* keyword with no value set */ *destination = 1; str_len2 = 0; } else { - str_ptr2 = (char *) strtok_r (scratch, SEPCHARS, + str_ptr2 = (char *) strtok_r (scratch, SEPCHARS, &str_ptr3); str_len2 = strlen (str_ptr2); if (strcasecmp (str_ptr2, "UNLIMITED") == 0) *destination = -1; - else if ((str_ptr2[0] >= '0') && + else if ((str_ptr2[0] >= '0') && (str_ptr2[0] <= '9')) { - *destination = (int) strtol (scratch, - (char **) NULL, + *destination = (int) strtol (scratch, + (char **) NULL, 10); } else { @@ -217,20 +217,20 @@ _load_integer (int *destination, char *keyword, char *in_line) /* - * _load_long - parse a string for a keyword, value pair, and load the + * _load_long - parse a string for a keyword, value pair, and load the * long value - * IN/OUT destination - location into which result is stored, set to value, - * no change if value not found, - * set to 1 if keyword found without value, + * IN/OUT destination - location into which result is stored, set to value, + * no change if value not found, + * set to 1 if keyword found without value, * set to -1 if keyword followed by "unlimited" * IN keyword - string to search for - * IN/OUR in_line - string to search for keyword, the keyword and value + * IN/OUR in_line - string to search for keyword, the keyword and value * (if present) are overwritten by spaces * RET 0 if no error, otherwise an error code * NOTE: in_line is overwritten, do not use a constant */ -static int -_load_long (long *destination, char *keyword, char *in_line) +static int +_load_long (long *destination, char *keyword, char *in_line) { char scratch[BUFFER_SIZE]; /* scratch area for parsing the input line */ char *str_ptr1, *str_ptr2, *str_ptr3; @@ -240,22 +240,22 @@ _load_long (long *destination, char *keyword, char *in_line) if (str_ptr1 != NULL) { str_len1 = strlen (keyword); strcpy (scratch, str_ptr1 + str_len1); - if ((scratch[0] == '\0') || - (isspace ((int) scratch[0]))) { + if ((scratch[0] == '\0') || + (isspace ((int) scratch[0]))) { /* keyword with no value set */ *destination = 1; str_len2 = 0; } else { - str_ptr2 = (char *) strtok_r (scratch, SEPCHARS, + str_ptr2 = (char *) strtok_r (scratch, SEPCHARS, &str_ptr3); str_len2 = strlen (str_ptr2); if (strcasecmp (str_ptr2, "UNLIMITED") == 0) *destination = -1L; - else if ((str_ptr2[0] == '-') || - ((str_ptr2[0] >= '0') && + else if ((str_ptr2[0] == '-') || + ((str_ptr2[0] >= '0') && (str_ptr2[0] <= '9'))) { - *destination = strtol (scratch, + *destination = strtol (scratch, (char **) NULL, 10); } else { @@ -274,21 +274,21 @@ _load_long (long *destination, char *keyword, char *in_line) /* - * load_string - parse a string for a keyword, value pair, and load the + * load_string - parse a string for a keyword, value pair, and load the * char value - * IN/OUT destination - location into which result is stored, set to value, - * no change if value not found, if destination had previous value, + * IN/OUT destination - location into which result is stored, set to value, + * no change if value not found, if destination had previous value, * that memory location is automatically freed * IN keyword - string to search for - * IN/OUT in_line - string to search for keyword, the keyword and value + * IN/OUT in_line - string to search for keyword, the keyword and value * (if present) are overwritten by spaces * RET 0 if no error, otherwise an error code * NOTE: destination must be free when no longer required - * NOTE: if destination is non-NULL at function call time, it will be freed + * NOTE: if destination is non-NULL at function call time, it will be freed * NOTE: in_line is overwritten, do not use a constant */ -int -load_string (char **destination, char *keyword, char *in_line) +int +load_string (char **destination, char *keyword, char *in_line) { char scratch[BUFFER_SIZE];/* scratch area for parsing the input line */ char *str_ptr1, *str_ptr2, *str_ptr3; @@ -307,7 +307,7 @@ load_string (char **destination, char *keyword, char *in_line) str_ptr2 = strtok_r (scratch, SEPCHARS, &str_ptr3); if ((str_ptr2 == NULL) || ((str_len2 = strlen (str_ptr2))== 0)){ - info ("load_string : keyword %s lacks value", + info ("load_string : keyword %s lacks value", keyword); return EINVAL; } diff --git a/src/common/parse_spec.h b/src/common/parse_spec.h index c8f5009f7b..6db55110f4 100644 --- a/src/common/parse_spec.h +++ b/src/common/parse_spec.h @@ -5,32 +5,32 @@ * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Morris Jette * CODE-OCEC-09-009. All rights reserved. - * + * * This file is part of SLURM, a resource management program. * For details, see . * Please also read the included file: DISCLAIMER. - * + * * SLURM is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free * Software Foundation; either version 2 of the License, or (at your option) * any later version. * - * In addition, as a special exception, the copyright holders give permission - * to link the code of portions of this program with the OpenSSL library under - * certain conditions as described in each individual source file, and - * distribute linked combinations including the two. You must obey the GNU - * General Public License in all respects for all of the code used other than - * OpenSSL. If you modify file(s) with this exception, you may extend this - * exception to your version of the file(s), but you are not obligated to do + * In addition, as a special exception, the copyright holders give permission + * to link the code of portions of this program with the OpenSSL library under + * certain conditions as described in each individual source file, and + * distribute linked combinations including the two. You must obey the GNU + * General Public License in all respects for all of the code used other than + * OpenSSL. If you modify file(s) with this exception, you may extend this + * exception to your version of the file(s), but you are not obligated to do * so. If you do not wish to do so, delete this exception statement from your - * version. If you delete this exception statement from all source files in + * version. If you delete this exception statement from all source files in * the program, then also delete it here. - * + * * SLURM is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. - * + * * You should have received a copy of the GNU General Public License along * with SLURM; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. @@ -52,36 +52,36 @@ # include #endif /* HAVE_CONFIG_H */ -/* +/* * slurm_parser - parse the supplied specification into keyword/value pairs - * only the keywords supplied will be searched for. the supplied - * specification is altered, overwriting the keyword and value pairs + * only the keywords supplied will be searched for. the supplied + * specification is altered, overwriting the keyword and value pairs * with spaces. - * spec - pointer to the string of specifications, sets of three values - * (as many sets as required): keyword, type, value - * IN keyword - string with the keyword to search for including equal sign + * spec - pointer to the string of specifications, sets of three values + * (as many sets as required): keyword, type, value + * IN keyword - string with the keyword to search for including equal sign * (e.g. "name=") * IN type - char with value 'd'==int, 'f'==float, 's'==string, 'l'==long * IN/OUT value - pointer to storage location for value (char **) for type 's' * RET 0 if no error, otherwise errno code * NOTE: terminate with a keyword value of "END" - * NOTE: values of type (char *) are xfreed if non-NULL. caller must xfree any + * NOTE: values of type (char *) are xfreed if non-NULL. caller must xfree any * returned value */ extern int slurm_parser (char *spec, ...) ; /* - * load_string - parse a string for a keyword, value pair, and load the + * load_string - parse a string for a keyword, value pair, and load the * char value - * IN/OUT destination - location into which result is stored, set to value, - * no change if value not found, if destination had previous value, + * IN/OUT destination - location into which result is stored, set to value, + * no change if value not found, if destination had previous value, * that memory location is automatically freed * IN keyword - string to search for - * IN/OUT in_line - string to search for keyword, the keyword and value + * IN/OUT in_line - string to search for keyword, the keyword and value * (if present) are overwritten by spaces * RET 0 if no error, otherwise an error code * NOTE: destination must be free when no longer required - * NOTE: if destination is non-NULL at function call time, it will be freed + * NOTE: if destination is non-NULL at function call time, it will be freed * NOTE: in_line is overwritten, do not use a constant */ extern int load_string (char **destination, char *keyword, char *in_line) ; diff --git a/src/common/parse_time.c b/src/common/parse_time.c index 96e99cbc34..9033550b2b 100644 --- a/src/common/parse_time.c +++ b/src/common/parse_time.c @@ -5,32 +5,32 @@ * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Morris Jette . * CODE-OCEC-09-009. All rights reserved. - * + * * This file is part of SLURM, a resource management program. * For details, see . * Please also read the included file: DISCLAIMER. - * + * * SLURM is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free * Software Foundation; either version 2 of the License, or (at your option) * any later version. * - * In addition, as a special exception, the copyright holders give permission - * to link the code of portions of this program with the OpenSSL library under - * certain conditions as described in each individual source file, and - * distribute linked combinations including the two. You must obey the GNU - * General Public License in all respects for all of the code used other than - * OpenSSL. If you modify file(s) with this exception, you may extend this - * exception to your version of the file(s), but you are not obligated to do + * In addition, as a special exception, the copyright holders give permission + * to link the code of portions of this program with the OpenSSL library under + * certain conditions as described in each individual source file, and + * distribute linked combinations including the two. You must obey the GNU + * General Public License in all respects for all of the code used other than + * OpenSSL. If you modify file(s) with this exception, you may extend this + * exception to your version of the file(s), but you are not obligated to do * so. If you do not wish to do so, delete this exception statement from your - * version. If you delete this exception statement from all source files in + * version. If you delete this exception statement from all source files in * the program, then also delete it here. - * + * * SLURM is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. - * + * * You should have received a copy of the GNU General Public License along * with SLURM; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. @@ -118,7 +118,7 @@ static int _get_delta(char *time_str, int *pos, long *delta) * hour, minute, second (out): numberic values * RET: -1 on error, 0 otherwise */ -static int +static int _get_time(char *time_str, int *pos, int *hour, int *minute, int * second) { int hr, min, sec; @@ -229,9 +229,9 @@ static int _get_date(char *time_str, int *pos, int *month, int *mday, int *year) if ((time_str[offset] < '0') || (time_str[offset] > '9')) goto prob; yr = (yr * 10) + time_str[offset++] - '0'; - + offset++; // for the - - + /* get month */ mon = time_str[offset++] - '0'; if ((time_str[offset] >= '0') && (time_str[offset] <= '9')) @@ -240,9 +240,9 @@ static int _get_date(char *time_str, int *pos, int *month, int *mday, int *year) offset -= 2; goto prob; } - + offset++; // for the - - + /* get day */ if ((time_str[offset] < '0') || (time_str[offset] > '9')) goto prob; @@ -253,7 +253,7 @@ static int _get_date(char *time_str, int *pos, int *month, int *mday, int *year) offset -= 2; goto prob; } - + *pos = offset - 1; *month = mon - 1; /* zero origin */ *mday = day; @@ -261,7 +261,7 @@ static int _get_date(char *time_str, int *pos, int *month, int *mday, int *year) happy 1900 == "00" */ return 0; } - + /* get month */ mon = time_str[offset++] - '0'; if ((time_str[offset] >= '0') && (time_str[offset] <= '9')) @@ -317,7 +317,7 @@ static int _get_date(char *time_str, int *pos, int *month, int *mday, int *year) * YYYY-MM-DD[THH:MM[:SS]] * * now + count [minutes | hours | days | weeks] - * + * * Invalid input results in message to stderr and return value of zero * NOTE: not thread safe * NOTE: by default this will look into the future for the next time. @@ -334,7 +334,7 @@ extern time_t parse_time(char *time_str, int past) time_now_tm = localtime(&time_now); for (pos=0; ((time_str[pos] != '\0')&&(time_str[pos] != '\n')); pos++) { - if (isblank(time_str[pos]) || (time_str[pos] == '-') + if (isblank(time_str[pos]) || (time_str[pos] == '-') || (time_str[pos] == 'T')) continue; if (strncasecmp(time_str+pos, "today", 5) == 0) { @@ -381,14 +381,14 @@ extern time_t parse_time(char *time_str, int past) struct tm *later_tm; for (i=(pos+3); ; i++) { if (time_str[i] == '+') { - pos += i; + pos += i; if (_get_delta(time_str, &pos, &delta)) goto prob; break; } if (isblank(time_str[i])) continue; - if ((time_str[i] == '\0') + if ((time_str[i] == '\0') || (time_str[i] == '\n')) { pos += (i-1); break; @@ -416,7 +416,7 @@ extern time_t parse_time(char *time_str, int past) goto prob; continue; } - + if (_get_date(time_str, &pos, &month, &mday, &year)) goto prob; } @@ -429,10 +429,10 @@ extern time_t parse_time(char *time_str, int past) hour = 0; minute = 0; } - else if ((hour != -1) && (month == -1)) { + else if ((hour != -1) && (month == -1)) { /* time, no date implies soonest day */ if (past || (hour > time_now_tm->tm_hour) - || ((hour == time_now_tm->tm_hour) + || ((hour == time_now_tm->tm_hour) && (minute > time_now_tm->tm_min))) { /* today */ month = time_now_tm->tm_mon; @@ -456,14 +456,14 @@ extern time_t parse_time(char *time_str, int past) year = time_now_tm->tm_year; } } else if ((month > time_now_tm->tm_mon) - || ((month == time_now_tm->tm_mon) + || ((month == time_now_tm->tm_mon) && (mday > time_now_tm->tm_mday)) - || ((month == time_now_tm->tm_mon) + || ((month == time_now_tm->tm_mon) && (mday == time_now_tm->tm_mday) - && (hour > time_now_tm->tm_hour)) - || ((month == time_now_tm->tm_mon) + && (hour > time_now_tm->tm_hour)) + || ((month == time_now_tm->tm_mon) && (mday == time_now_tm->tm_mday) - && (hour == time_now_tm->tm_hour) + && (hour == time_now_tm->tm_hour) && (minute > time_now_tm->tm_min))) { /* this year */ year = time_now_tm->tm_year; @@ -515,7 +515,7 @@ int main(int argc, char *argv[]) * * IN time - a time stamp * OUT string - pointer user defined buffer - * IN size - length of string buffer, we recommend a size of 32 bytes to + * IN size - length of string buffer, we recommend a size of 32 bytes to * easily support different site-specific formats */ extern void @@ -533,8 +533,8 @@ slurm_make_time_str (time_t *time, char *string, int size) * schedulers management of SLURM. */ snprintf(string, size, "%4.4u-%2.2u-%2.2uT%2.2u:%2.2u:%2.2u", - (time_tm.tm_year + 1900), (time_tm.tm_mon+1), - time_tm.tm_mday, time_tm.tm_hour, time_tm.tm_min, + (time_tm.tm_year + 1900), (time_tm.tm_mon+1), + time_tm.tm_mday, time_tm.tm_hour, time_tm.tm_min, time_tm.tm_sec); #else /* Format MM/DD-HH:MM:SS */ @@ -636,7 +636,7 @@ extern void secs2time_str(time_t time, char *string, int size) days, hours, minutes, seconds); else snprintf(string, size, - "%2.2ld:%2.2ld:%2.2ld", + "%2.2ld:%2.2ld:%2.2ld", hours, minutes, seconds); } } @@ -658,7 +658,7 @@ extern void mins2time_str(uint32_t time, char *string, int size) days, hours, minutes, seconds); else snprintf(string, size, - "%2.2ld:%2.2ld:%2.2ld", + "%2.2ld:%2.2ld:%2.2ld", hours, minutes, seconds); } } diff --git a/src/common/parse_time.h b/src/common/parse_time.h index c2af20d3e4..cd31d81e13 100644 --- a/src/common/parse_time.h +++ b/src/common/parse_time.h @@ -6,32 +6,32 @@ * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Morris Jette . * CODE-OCEC-09-009. All rights reserved. - * + * * This file is part of SLURM, a resource management program. * For details, see . * Please also read the included file: DISCLAIMER. - * + * * SLURM is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free * Software Foundation; either version 2 of the License, or (at your option) * any later version. * - * In addition, as a special exception, the copyright holders give permission + * In addition, as a special exception, the copyright holders give permission * to link the code of portions of this program with the OpenSSL library under - * certain conditions as described in each individual source file, and - * distribute linked combinations including the two. You must obey the GNU - * General Public License in all respects for all of the code used other than - * OpenSSL. If you modify file(s) with this exception, you may extend this - * exception to your version of the file(s), but you are not obligated to do + * certain conditions as described in each individual source file, and + * distribute linked combinations including the two. You must obey the GNU + * General Public License in all respects for all of the code used other than + * OpenSSL. If you modify file(s) with this exception, you may extend this + * exception to your version of the file(s), but you are not obligated to do * so. If you do not wish to do so, delete this exception statement from your - * version. If you delete this exception statement from all source files in + * version. If you delete this exception statement from all source files in * the program, then also delete it here. - * + * * SLURM is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. - * + * * You should have received a copy of the GNU General Public License along * with SLURM; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. @@ -77,7 +77,7 @@ extern time_t parse_time(char *time_str, int past); * IN size - length of string buffer, we recommend a size of 32 bytes to * easily support different site-specific formats */ -extern void slurm_make_time_str (time_t *time, char *string, int size); +extern void slurm_make_time_str (time_t *time, char *string, int size); /* Convert a string to an equivalent time value * input formats: @@ -91,8 +91,8 @@ extern void slurm_make_time_str (time_t *time, char *string, int size); */ extern int time_str2mins(char *string); -/* Convert a time value into a string that can be converted back by - * time_str2mins. +/* Convert a time value into a string that can be converted back by + * time_str2mins. * fill in string with HH:MM:SS or D-HH:MM:SS */ extern void secs2time_str(time_t time, char *string, int size); diff --git a/src/common/plugin.c b/src/common/plugin.c index 9a0d6ff2b2..49321008bb 100644 --- a/src/common/plugin.c +++ b/src/common/plugin.c @@ -6,32 +6,32 @@ * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Jay Windley . * CODE-OCEC-09-009. All rights reserved. - * + * * This file is part of SLURM, a resource management program. * For details, see . * Please also read the included file: DISCLAIMER. - * + * * SLURM is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free * Software Foundation; either version 2 of the License, or (at your option) * any later version. * - * In addition, as a special exception, the copyright holders give permission + * In addition, as a special exception, the copyright holders give permission * to link the code of portions of this program with the OpenSSL library under - * certain conditions as described in each individual source file, and - * distribute linked combinations including the two. You must obey the GNU - * General Public License in all respects for all of the code used other than - * OpenSSL. If you modify file(s) with this exception, you may extend this - * exception to your version of the file(s), but you are not obligated to do + * certain conditions as described in each individual source file, and + * distribute linked combinations including the two. You must obey the GNU + * General Public License in all respects for all of the code used other than + * OpenSSL. If you modify file(s) with this exception, you may extend this + * exception to your version of the file(s), but you are not obligated to do * so. If you do not wish to do so, delete this exception statement from your - * version. If you delete this exception statement from all source files in + * version. If you delete this exception statement from all source files in * the program, then also delete it here. - * + * * SLURM is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. - * + * * You should have received a copy of the GNU General Public License along * with SLURM; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. @@ -108,7 +108,7 @@ plugin_peek( const char *fq_path, plugin_handle_t plug; char *type; uint32_t *version; - + plug = dlopen( fq_path, RTLD_LAZY ); if ( plug == NULL ) { debug3( "plugin_peek: dlopen(%s): %s", fq_path, _dlerror() ); @@ -118,13 +118,13 @@ plugin_peek( const char *fq_path, if ( plugin_type != NULL ) { strncpy( plugin_type, type, type_len ); } - } else { + } else { dlclose( plug ); /* could be vestigial library, don't treat as an error */ verbose( "%s: not a SLURM plugin", fq_path ); return SLURM_ERROR; } - + if ( ( version = (uint32_t *) dlsym( plug, PLUGIN_VERSION ) ) != NULL ) { if ( plugin_version != NULL ) { *plugin_version = *version; @@ -161,9 +161,9 @@ plugin_load_from_file(plugin_handle_t *p, const char *fq_path) /* * Try to open the shared object. * - * Use RTLD_LAZY to allow plugins to use symbols that may be + * Use RTLD_LAZY to allow plugins to use symbols that may be * defined in only one slurm entity (e.g. srun and not slurmd), - * when the use of that symbol is restricted to within the + * when the use of that symbol is restricted to within the * entity from which it is available. (i.e. srun symbols are only * used in the context of srun, not slurmd.) * @@ -208,7 +208,7 @@ plugin_load_and_link(const char *type_name, int n_syms, char *head=NULL, *dir_array=NULL, *so_name = NULL, *file_name=NULL; int i=0; - + if (!type_name) return plug; @@ -224,16 +224,16 @@ plugin_load_and_link(const char *type_name, int n_syms, xfree(so_name); return plug; } - + head = dir_array; for (i=0; ; i++) { bool got_colon = 0; if (dir_array[i] == ':') { dir_array[i] = '\0'; got_colon = 1; - } else if(dir_array[i] != '\0') + } else if(dir_array[i] != '\0') continue; - + file_name = xstrdup_printf("%s/%s", head, so_name); debug3("Trying to load plugin %s", file_name); if ((stat(file_name, &st) < 0) || (!S_ISREG(st.st_mode))) { @@ -243,20 +243,20 @@ plugin_load_and_link(const char *type_name, int n_syms, } else { plugin_load_from_file(&plug, file_name); xfree(file_name); - if (plugin_get_syms(plug, n_syms, names, ptrs) >= + if (plugin_get_syms(plug, n_syms, names, ptrs) >= n_syms) { debug3("Success."); break; - } else + } else plug = PLUGIN_INVALID_HANDLE; } if (got_colon) { head = dir_array + i + 1; - } else + } else break; } - + xfree(dir_array); xfree(so_name); return plug; @@ -271,7 +271,7 @@ void plugin_unload( plugin_handle_t plug ) { void (*fini)(void); - + if ( plug != PLUGIN_INVALID_HANDLE ) { if ( ( fini = dlsym( plug, "fini" ) ) != NULL ) { (*fini)(); @@ -313,7 +313,7 @@ plugin_get_version( plugin_handle_t plug ) { uint32_t *ptr; - if ( plug == PLUGIN_INVALID_HANDLE ) return 0; + if ( plug == PLUGIN_INVALID_HANDLE ) return 0; ptr = (uint32_t *) dlsym( plug, PLUGIN_VERSION ); return ptr ? *ptr : 0; } @@ -329,9 +329,9 @@ plugin_get_syms( plugin_handle_t plug, count = 0; for ( i = 0; i < n_syms; ++i ) { ptrs[ i ] = dlsym( plug, names[ i ] ); - if ( ptrs[ i ] ) + if ( ptrs[ i ] ) ++count; - else + else debug3("Couldn't find sym '%s' in the plugin", names[ i ]); } diff --git a/src/common/plugin.h b/src/common/plugin.h index 1e5c3fbc8e..06f6d44f36 100644 --- a/src/common/plugin.h +++ b/src/common/plugin.h @@ -5,32 +5,32 @@ * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Jay Windlay . * CODE-OCEC-09-009. All rights reserved. - * + * * This file is part of SLURM, a resource management program. * For details, see . * Please also read the included file: DISCLAIMER. - * + * * SLURM is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free * Software Foundation; either version 2 of the License, or (at your option) * any later version. * - * In addition, as a special exception, the copyright holders give permission - * to link the code of portions of this program with the OpenSSL library under - * certain conditions as described in each individual source file, and - * distribute linked combinations including the two. You must obey the GNU - * General Public License in all respects for all of the code used other than - * OpenSSL. If you modify file(s) with this exception, you may extend this - * exception to your version of the file(s), but you are not obligated to do + * In addition, as a special exception, the copyright holders give permission + * to link the code of portions of this program with the OpenSSL library under + * certain conditions as described in each individual source file, and + * distribute linked combinations including the two. You must obey the GNU + * General Public License in all respects for all of the code used other than + * OpenSSL. If you modify file(s) with this exception, you may extend this + * exception to your version of the file(s), but you are not obligated to do * so. If you do not wish to do so, delete this exception statement from your - * version. If you delete this exception statement from all source files in + * version. If you delete this exception statement from all source files in * the program, then also delete it here. - * + * * SLURM is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. - * + * * You should have received a copy of the GNU General Public License along * with SLURM; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. diff --git a/src/common/plugrack.c b/src/common/plugrack.c index 9df07b1558..b7543ce04b 100644 --- a/src/common/plugrack.c +++ b/src/common/plugrack.c @@ -5,32 +5,32 @@ * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Jay Windley . * CODE-OCEC-09-009. All rights reserved. - * + * * This file is part of SLURM, a resource management program. * For details, see . * Please also read the included file: DISCLAIMER. - * + * * SLURM is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free * Software Foundation; either version 2 of the License, or (at your option) * any later version. * - * In addition, as a special exception, the copyright holders give permission + * In addition, as a special exception, the copyright holders give permission * to link the code of portions of this program with the OpenSSL library under - * certain conditions as described in each individual source file, and - * distribute linked combinations including the two. You must obey the GNU - * General Public License in all respects for all of the code used other than - * OpenSSL. If you modify file(s) with this exception, you may extend this - * exception to your version of the file(s), but you are not obligated to do + * certain conditions as described in each individual source file, and + * distribute linked combinations including the two. You must obey the GNU + * General Public License in all respects for all of the code used other than + * OpenSSL. If you modify file(s) with this exception, you may extend this + * exception to your version of the file(s), but you are not obligated to do * so. If you do not wish to do so, delete this exception statement from your - * version. If you delete this exception statement from all source files in + * version. If you delete this exception statement from all source files in * the program, then also delete it here. - * + * * SLURM is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. - * + * * You should have received a copy of the GNU General Public License along * with SLURM; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. @@ -144,7 +144,7 @@ static void plugrack_entry_destructor( void *v ) { plugrack_entry_t *victim = v; - + if ( victim == NULL ) return; /* @@ -155,7 +155,7 @@ plugrack_entry_destructor( void *v ) xassert( victim->refcount == 0 ); xfree( victim->full_type ); xfree( victim->fq_path ); - if ( victim->plug != PLUGIN_INVALID_HANDLE ) + if ( victim->plug != PLUGIN_INVALID_HANDLE ) plugin_unload( victim->plug ); xfree( victim ); } @@ -181,12 +181,12 @@ accept_path_paranoia( plugrack_t rack, /* Internal function, so assert rather than fail gracefully. */ xassert( rack ); xassert( fq_path ); - + if ( stat( fq_path, &st ) < 0 ) { debug3( "accept_path_paranoia: stat(%s) failed", fq_path ); return 0; } - + /* Is path owned by authorized user? */ if ( check_own ) { if ( st.st_uid != rack->uid ) { @@ -198,9 +198,9 @@ accept_path_paranoia( plugrack_t rack, /* Is path writable by others? */ if ( check_write ) { - if ( ( st.st_mode & S_IWGRP ) + if ( ( st.st_mode & S_IWGRP ) || ( st.st_mode & S_IWOTH ) ) { - debug3( "accept_path_paranoia: %s writable by others", + debug3( "accept_path_paranoia: %s writable by others", fq_path ); return 0; } @@ -231,7 +231,7 @@ plugrack_destroy( plugrack_t rack ) { ListIterator it; plugrack_entry_t *e; - + if ( ! rack ) return SLURM_ERROR; /* @@ -276,7 +276,7 @@ plugrack_set_major_type( plugrack_t rack, const char *type ) return SLURM_ERROR; } } - + return SLURM_SUCCESS; } @@ -304,7 +304,7 @@ plugrack_add_plugin_path( plugrack_t rack, const char *fq_path ) { plugrack_entry_t *e; - + if ( ! rack ) return SLURM_ERROR; if ( ! fq_path ) return SLURM_ERROR; @@ -319,7 +319,7 @@ plugrack_add_plugin_path( plugrack_t rack, return SLURM_SUCCESS; } - + /* test for the plugin in the various colon separated directories */ int plugrack_read_dir( plugrack_t rack, const char *dir ) @@ -381,18 +381,18 @@ _plugrack_read_single_dir( plugrack_t rack, char *dir ) tail = &fq_path[ strlen( dir ) ]; *tail = '/'; ++tail; - + /* Check whether we should be paranoid about this directory. */ if ( ! accept_path_paranoia( rack, dir, - rack->paranoia & + rack->paranoia & PLUGRACK_PARANOIA_DIR_OWN, - rack->paranoia & + rack->paranoia & PLUGRACK_PARANOIA_DIR_WRITABLE ) ) { xfree( fq_path ); return SLURM_ERROR; } - + /* Open the directory. */ dirp = opendir( dir ); if ( dirp == NULL ) { @@ -400,20 +400,20 @@ _plugrack_read_single_dir( plugrack_t rack, char *dir ) xfree( fq_path ); return SLURM_ERROR; } - + while ( 1 ) { e = readdir( dirp ); if ( e == NULL ) break; /* - * Compose file name. Where NAME_MAX is defined it represents + * Compose file name. Where NAME_MAX is defined it represents * the largest file name given in a dirent. This macro is used - * in the allocation of "tail" above, so this unbounded copy + * in the allocation of "tail" above, so this unbounded copy * should work. */ strcpy( tail, e->d_name ); - + /* Check only regular files. */ if ( (strncmp(e->d_name, ".", 1) == 0) || (stat( fq_path, &st ) < 0) @@ -425,25 +425,25 @@ _plugrack_read_single_dir( plugrack_t rack, char *dir ) continue; /* file's prefix must match specified major_type - * to avoid having some program try to open a - * plugin designed for a different program and + * to avoid having some program try to open a + * plugin designed for a different program and * discovering undefined symbols */ - if ((rack->major_type) && - (!_match_major(e->d_name, rack->major_type))) + if ((rack->major_type) && + (!_match_major(e->d_name, rack->major_type))) continue; - + /* See if we should be paranoid about this file. */ if (!accept_path_paranoia( rack, fq_path, - rack->paranoia & + rack->paranoia & PLUGRACK_PARANOIA_FILE_OWN, - rack->paranoia & + rack->paranoia & PLUGRACK_PARANOIA_FILE_WRITABLE )) { debug3( "plugin_read_dir: skipping %s for security " "reasons", fq_path ); continue; } - + /* Test the type. */ if ( plugin_peek( fq_path, plugin_type, @@ -451,14 +451,14 @@ _plugrack_read_single_dir( plugrack_t rack, char *dir ) NULL ) == SLURM_ERROR ) { continue; } - - if ( rack->major_type + + if ( rack->major_type && ( strncmp( rack->major_type, plugin_type, strlen( rack->major_type ) ) != 0 ) ) { continue; } - + /* Add it to the list. */ (void) plugrack_add_plugin_path( rack, plugin_type, fq_path ); } @@ -469,25 +469,25 @@ _plugrack_read_single_dir( plugrack_t rack, char *dir ) return SLURM_SUCCESS; } -/* Return TRUE if the specified pathname is recognized as that of a shared +/* Return TRUE if the specified pathname is recognized as that of a shared * object (i.e. containing ".so\0") */ static bool _so_file ( char *file_name ) { int i; - if (file_name == NULL) + if (file_name == NULL) return false; for (i=0; file_name[i] ;i++) { - if ( (file_name[i] == '.') && (file_name[i+1] == 's') && + if ( (file_name[i] == '.') && (file_name[i+1] == 's') && (file_name[i+2] == 'o') && (file_name[i+3] == '\0') ) return true; } return false; } -/* Return TRUE of the specified major_type is a prefix of the shared object +/* Return TRUE of the specified major_type is a prefix of the shared object * pathname (i.e. either "..." or "lib...") */ static bool _match_major ( const char *path_name, const char *major_type ) @@ -510,7 +510,7 @@ plugrack_read_cache( plugrack_t rack, const char *cache_file ) { /* Don't care for now. */ - + return SLURM_ERROR; } @@ -520,7 +520,7 @@ plugrack_purge_idle( plugrack_t rack ) { ListIterator it; plugrack_entry_t *e; - + if ( ! rack ) return SLURM_ERROR; it = list_iterator_create( rack->entries ); @@ -562,7 +562,7 @@ plugrack_write_cache( plugrack_t rack, const char *cache ) { /* Not implemented. */ - + return SLURM_SUCCESS; } @@ -572,28 +572,28 @@ plugrack_use_by_type( plugrack_t rack, { ListIterator it; plugrack_entry_t *e; - + if (!rack) return PLUGIN_INVALID_HANDLE; if (!full_type) return PLUGIN_INVALID_HANDLE; - + it = list_iterator_create(rack->entries); while ((e = list_next(it))) { plugin_err_t err; if (strcmp(full_type, e->full_type) != 0) continue; - + /* See if plugin is loaded. */ if (e->plug == PLUGIN_INVALID_HANDLE && (err = plugin_load_from_file(&e->plug, e->fq_path))) error ("%s: %s\n", e->fq_path, plugin_strerror (err)); - + /* If load was successful, increment the reference count. */ if (e->plug != PLUGIN_INVALID_HANDLE) e->refcount++; - + /* * Return the plugin, even if it failed to load -- this serves * as an error return value. @@ -601,7 +601,7 @@ plugrack_use_by_type( plugrack_t rack, list_iterator_destroy(it); return e->plug; } - + /* Couldn't find a suitable plugin. */ list_iterator_destroy(it); return PLUGIN_INVALID_HANDLE; diff --git a/src/common/plugrack.h b/src/common/plugrack.h index 2fd3a85026..285bca14e3 100644 --- a/src/common/plugrack.h +++ b/src/common/plugrack.h @@ -5,32 +5,32 @@ * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Jay Windley . * CODE-OCEC-09-009. All rights reserved. - * + * * This file is part of SLURM, a resource management program. * For details, see . * Please also read the included file: DISCLAIMER. - * + * * SLURM is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free * Software Foundation; either version 2 of the License, or (at your option) * any later version. * - * In addition, as a special exception, the copyright holders give permission - * to link the code of portions of this program with the OpenSSL library under - * certain conditions as described in each individual source file, and - * distribute linked combinations including the two. You must obey the GNU - * General Public License in all respects for all of the code used other than - * OpenSSL. If you modify file(s) with this exception, you may extend this - * exception to your version of the file(s), but you are not obligated to do + * In addition, as a special exception, the copyright holders give permission + * to link the code of portions of this program with the OpenSSL library under + * certain conditions as described in each individual source file, and + * distribute linked combinations including the two. You must obey the GNU + * General Public License in all respects for all of the code used other than + * OpenSSL. If you modify file(s) with this exception, you may extend this + * exception to your version of the file(s), but you are not obligated to do * so. If you do not wish to do so, delete this exception statement from your - * version. If you delete this exception statement from all source files in + * version. If you delete this exception statement from all source files in * the program, then also delete it here. - * + * * SLURM is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. - * + * * You should have received a copy of the GNU General Public License along * with SLURM; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. diff --git a/src/common/plugstack.c b/src/common/plugstack.c index 549d73e174..aad5bfd3ee 100644 --- a/src/common/plugstack.c +++ b/src/common/plugstack.c @@ -15,15 +15,15 @@ * Software Foundation; either version 2 of the License, or (at your option) * any later version. * - * In addition, as a special exception, the copyright holders give permission + * In addition, as a special exception, the copyright holders give permission * to link the code of portions of this program with the OpenSSL library under - * certain conditions as described in each individual source file, and - * distribute linked combinations including the two. You must obey the GNU - * General Public License in all respects for all of the code used other than - * OpenSSL. If you modify file(s) with this exception, you may extend this - * exception to your version of the file(s), but you are not obligated to do + * certain conditions as described in each individual source file, and + * distribute linked combinations including the two. You must obey the GNU + * General Public License in all respects for all of the code used other than + * OpenSSL. If you modify file(s) with this exception, you may extend this + * exception to your version of the file(s), but you are not obligated to do * so. If you do not wish to do so, delete this exception statement from your - * version. If you delete this exception statement from all source files in + * version. If you delete this exception statement from all source files in * the program, then also delete it here. * * SLURM is distributed in the hope that it will be useful, but WITHOUT ANY @@ -104,7 +104,7 @@ struct spank_plugin { }; /* - * SPANK Plugin options + * SPANK Plugin options */ #define SPANK_OPTION_ENV_PREFIX "_SLURM_SPANK_OPTION_" @@ -236,7 +236,7 @@ _plugin_stack_parse_line(char *line, char **plugin, int *acp, char ***argv, if (!(option = strtok_r(line, separators, &sp))) return (0); - if (((*type) = _plugin_stack_line_type(option)) == CF_ERROR) + if (((*type) = _plugin_stack_line_type(option)) == CF_ERROR) return (-1); if (!(path = strtok_r(NULL, separators, &sp))) @@ -317,7 +317,7 @@ void _spank_plugin_destroy(struct spank_plugin *sp) static char * _spank_plugin_find (const char *path, const char *file) { - char dir [4096]; + char dir [4096]; char *p, *entry; int pathlen = strlen (path); @@ -388,11 +388,11 @@ _spank_stack_process_line(const char *file, int line, char *buf, List *stackp) required = (type == CF_REQUIRED); if (!(p = _spank_plugin_create(path, ac, argv, required))) { if (required) - error ("spank: %s:%d:" + error ("spank: %s:%d:" " Failed to load plugin %s. Aborting.", file, line, path); else - verbose ("spank: %s:%d:" + verbose ("spank: %s:%d:" "Failed to load optional plugin %s. Ignored.", file, line, path); return (required ? -1 : 0); @@ -400,7 +400,7 @@ _spank_stack_process_line(const char *file, int line, char *buf, List *stackp) if (*stackp == NULL) *stackp = list_create((ListDelF) _spank_plugin_destroy); - verbose ("spank: %s:%d: Loaded plugin %s", + verbose ("spank: %s:%d: Loaded plugin %s", file, line, xbasename (p->fq_path)); list_append (*stackp, p); @@ -459,7 +459,7 @@ _spank_conf_include (const char *file, int lineno, const char *pattern, return (SLURM_ERROR); } - if (pattern[0] != '/') { + if (pattern[0] != '/') { char *dirc = xstrdup (file); char *dname = dirname (dirc); @@ -471,13 +471,13 @@ _spank_conf_include (const char *file, int lineno, const char *pattern, } verbose ("%s: %d: include \"%s\"", file, lineno, pattern); - + rc = glob (pattern, 0, NULL, &gl); switch (rc) { case 0: for (i = 0; i < gl.gl_pathc; i++) { rc = _spank_stack_create (gl.gl_pathv[i], stackp); - if (rc < 0) + if (rc < 0) break; } break; @@ -588,7 +588,7 @@ static int _do_call_stack(step_fn_t type, void * job, int taskid) break; case LOCAL_USER_INIT: if (sp->ops.local_user_init) { - rc = (*sp->ops.local_user_init) (spank, sp->ac, + rc = (*sp->ops.local_user_init) (spank, sp->ac, sp->argv); debug2("spank: %s: %s = %d\n", name, fn_name, rc); @@ -876,16 +876,16 @@ _spank_option_register(struct spank_plugin *p, struct spank_option *opt) list_create((ListDelF) _spank_plugin_opt_destroy); } - spopt = list_find_first(option_cache, + spopt = list_find_first(option_cache, (ListFindF) _opt_by_name, opt->name); if (spopt) { struct spank_plugin *q = spopt->plugin; - info("spank: option \"%s\" provided by both %s and %s", - opt->name, xbasename(p->fq_path), + info("spank: option \"%s\" provided by both %s and %s", + opt->name, xbasename(p->fq_path), xbasename(q->fq_path)); /* * Disable this option, but still cache it, in case - * options are loaded in a different order on the + * options are loaded in a different order on the * remote side. */ disabled = 1; @@ -942,11 +942,11 @@ static int _add_one_option(struct option **optz, struct spank_plugin_opt *spopt) if (optz_add(optz, &opt) < 0) { if (errno == EEXIST) { error ("Ingoring conflicting option \"%s\" " - "in plugin \"%s\"", + "in plugin \"%s\"", opt.name, spopt->plugin->name); } else { error("Unable to add option \"%s\" " - "from plugin \"%s\"", + "from plugin \"%s\"", opt.name, spopt->plugin->name); } @@ -1015,7 +1015,7 @@ int spank_process_option(int optval, const char *arg) return (rc); /* - * Set optarg and "found" so that option will be forwarded + * Set optarg and "found" so that option will be forwarded * to remote side. */ if (opt->opt->has_arg) @@ -1025,13 +1025,13 @@ int spank_process_option(int optval, const char *arg) return (0); } -static char * +static char * _find_word_boundary(char *str, char *from, char **next) { char *p = from; - /* - * Back up past any non-whitespace if we are pointing in + /* + * Back up past any non-whitespace if we are pointing in * the middle of a word. */ while ((p != str) && !isspace (*p)) @@ -1056,7 +1056,7 @@ _find_word_boundary(char *str, char *from, char **next) return (p+1); } -static char * +static char * _get_next_segment (char **from, int width, char *buf, int bufsiz) { int len; @@ -1072,7 +1072,7 @@ _get_next_segment (char **from, int width, char *buf, int bufsiz) } if (!(p = _find_word_boundary (seg, *from + width, from))) { - /* + /* * Need to break up a word. Use user-supplied buffer. */ strlcpy (buf, seg, width+1); @@ -1090,7 +1090,7 @@ _get_next_segment (char **from, int width, char *buf, int bufsiz) return (seg); } -static int +static int _term_columns () { char *val; @@ -1136,7 +1136,7 @@ _spank_opt_print(struct spank_option *opt, FILE * fp, int left_pad, int width) snprintf(p, len + 1, "%s", trunc); } - + q = buf; strlcpy (buf, opt->usage, sizeof (buf)); @@ -1149,7 +1149,7 @@ _spank_opt_print(struct spank_option *opt, FILE * fp, int left_pad, int width) /* Get remaining line-wrapped lines. */ - while ((p = _get_next_segment (&q, descrsiz, seg, sizeof (seg)))) + while ((p = _get_next_segment (&q, descrsiz, seg, sizeof (seg)))) fprintf(fp, "%*s%s\n", width, "", p); return; @@ -1383,7 +1383,7 @@ int spank_get_remote_options(job_options_t opts) return (0); } -/* +/* * Return a task info structure corresponding to pid. */ static slurmd_task_info_t * job_task_info_by_pid (slurmd_job_t *job, pid_t pid) @@ -1419,7 +1419,7 @@ global_to_local_id (slurmd_job_t *job, uint32_t gid, uint32_t *p2uint32) } return (ESPANK_NOEXIST); } - + /* * Return 1 if spank_item_t is valid for S_TYPE_LOCAL @@ -1428,7 +1428,7 @@ static int _valid_in_local_context (spank_item_t item) { int rc = 0; switch (item) { - case S_JOB_UID: + case S_JOB_UID: case S_JOB_GID: case S_JOB_ID: case S_JOB_STEPID: @@ -1585,7 +1585,7 @@ spank_err_t spank_get_item(spank_t spank, spank_item_t item, ...) slurmd_task_info_t *task; slurmd_job_t *slurmd_job = NULL; struct spank_launcher_job_info *launcher_job = NULL; - va_list vargs; + va_list vargs; spank_err_t rc = ESPANK_SUCCESS; if ((spank == NULL) || (spank->magic != SPANK_MAGIC)) @@ -1743,7 +1743,7 @@ spank_err_t spank_get_item(spank_t spank, spank_item_t item, ...) rc = ESPANK_NOT_EXECD; else if (!(task = job_task_info_by_pid (slurmd_job, pid))) rc = ESPANK_NOEXIST; - else + else *p2uint32 = task->gtid; break; case S_JOB_PID_TO_LOCAL_ID: @@ -1755,7 +1755,7 @@ spank_err_t spank_get_item(spank_t spank, spank_item_t item, ...) rc = ESPANK_NOT_EXECD; else if (!(task = job_task_info_by_pid (slurmd_job, pid))) rc = ESPANK_NOEXIST; - else + else *p2uint32 = task->id; break; case S_JOB_LOCAL_TO_GLOBAL_ID: @@ -1766,7 +1766,7 @@ spank_err_t spank_get_item(spank_t spank, spank_item_t item, ...) if ((uint32 <= slurmd_job->ntasks) && slurmd_job->task && slurmd_job->task[uint32]) { *p2uint32 = slurmd_job->task[uint32]->gtid; - } else + } else rc = ESPANK_NOEXIST; break; case S_JOB_GLOBAL_TO_LOCAL_ID: @@ -1875,6 +1875,6 @@ spank_err_t spank_unsetenv (spank_t spank, const char *var) return (ESPANK_BAD_ARG); unsetenvp(((slurmd_job_t *) spank->job)->env, var); - + return (ESPANK_SUCCESS); } diff --git a/src/common/plugstack.h b/src/common/plugstack.h index 1ac51e2ec2..5d1d5977a0 100644 --- a/src/common/plugstack.h +++ b/src/common/plugstack.h @@ -4,32 +4,32 @@ * Copyright (C) 2005 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * CODE-OCEC-09-009. All rights reserved. - * + * * This file is part of SLURM, a resource management program. * For details, see . * Please also read the included file: DISCLAIMER. - * + * * SLURM is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free * Software Foundation; either version 2 of the License, or (at your option) * any later version. * - * In addition, as a special exception, the copyright holders give permission - * to link the code of portions of this program with the OpenSSL library under - * certain conditions as described in each individual source file, and - * distribute linked combinations including the two. You must obey the GNU - * General Public License in all respects for all of the code used other than - * OpenSSL. If you modify file(s) with this exception, you may extend this - * exception to your version of the file(s), but you are not obligated to do + * In addition, as a special exception, the copyright holders give permission + * to link the code of portions of this program with the OpenSSL library under + * certain conditions as described in each individual source file, and + * distribute linked combinations including the two. You must obey the GNU + * General Public License in all respects for all of the code used other than + * OpenSSL. If you modify file(s) with this exception, you may extend this + * exception to your version of the file(s), but you are not obligated to do * so. If you do not wish to do so, delete this exception statement from your - * version. If you delete this exception statement from all source files in + * version. If you delete this exception statement from all source files in * the program, then also delete it here. - * + * * SLURM is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. - * + * * You should have received a copy of the GNU General Public License along * with SLURM; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. @@ -91,7 +91,7 @@ int spank_fini (slurmd_job_t *job); /* * Create a struct option table (suitable for passing to getopt_long()) * from SPANK plugin provided options, optionally prepending an existing - * table of options `orig_options' Result must be freed by + * table of options `orig_options' Result must be freed by * spank_option_table_destroy(). * * If any options in orig_options conflict with internal spank options, @@ -101,7 +101,7 @@ int spank_fini (slurmd_job_t *job); struct option *spank_option_table_create (const struct option *orig_options); /* - * Free memory associated with an option table created by + * Free memory associated with an option table created by * spank_p[tion_table_create. */ void spank_option_table_destroy (struct option *opt_table); @@ -115,7 +115,7 @@ void spank_option_table_destroy (struct option *opt_table); * the option belongs to a *required* plugin, and the plugin's callback * for that option fails. */ -int spank_process_option (int optval, const char *optarg); +int spank_process_option (int optval, const char *optarg); /* * Generate --help style output on stream `fp' for all internal spank @@ -126,7 +126,7 @@ int spank_process_option (int optval, const char *optarg); */ int spank_print_options (FILE *fp, int width, int left_pad); -/* Set all registered remote options (i.e. those passed to +/* Set all registered remote options (i.e. those passed to * spank_process_option) in the job options `options'. */ int spank_set_remote_options (job_options_t options); diff --git a/src/common/print_fields.c b/src/common/print_fields.c index 0681f70dad..3a11e7527e 100644 --- a/src/common/print_fields.c +++ b/src/common/print_fields.c @@ -6,32 +6,32 @@ * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Danny Auble * CODE-OCEC-09-009. All rights reserved. - * + * * This file is part of SLURM, a resource management program. * For details, see . * Please also read the included file: DISCLAIMER. - * + * * SLURM is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free * Software Foundation; either version 2 of the License, or (at your option) * any later version. * - * In addition, as a special exception, the copyright holders give permission + * In addition, as a special exception, the copyright holders give permission * to link the code of portions of this program with the OpenSSL library under - * certain conditions as described in each individual source file, and - * distribute linked combinations including the two. You must obey the GNU - * General Public License in all respects for all of the code used other than - * OpenSSL. If you modify file(s) with this exception, you may extend this - * exception to your version of the file(s), but you are not obligated to do + * certain conditions as described in each individual source file, and + * distribute linked combinations including the two. You must obey the GNU + * General Public License in all respects for all of the code used other than + * OpenSSL. If you modify file(s) with this exception, you may extend this + * exception to your version of the file(s), but you are not obligated to do * so. If you do not wish to do so, delete this exception statement from your - * version. If you delete this exception statement from all source files in + * version. If you delete this exception statement from all source files in * the program, then also delete it here. - * + * * SLURM is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. - * + * * You should have received a copy of the GNU General Public License along * with SLURM; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. @@ -50,7 +50,7 @@ static int _sort_char_list(char *name_a, char *name_b) return -1; else if (diff > 0) return 1; - + return 0; } @@ -71,7 +71,7 @@ extern void print_fields_header(List print_fields_list) int curr_inx = 1; int field_count = 0; - if(!print_fields_list || !print_fields_have_header) + if(!print_fields_list || !print_fields_have_header) return; field_count = list_count(print_fields_list); @@ -81,7 +81,7 @@ extern void print_fields_header(List print_fields_list) if(print_fields_parsable_print == PRINT_FIELDS_PARSABLE_NO_ENDING && (curr_inx == field_count)) - printf("%s", field->name); + printf("%s", field->name); else if(print_fields_parsable_print) printf("%s|", field->name); else { @@ -96,11 +96,11 @@ extern void print_fields_header(List print_fields_list) return; while((field = list_next(itr))) { int abs_len = abs(field->len); - printf("%*.*s ", abs_len, abs_len, + printf("%*.*s ", abs_len, abs_len, "-----------------------------------------------------"); } list_iterator_destroy(itr); - printf("\n"); + printf("\n"); } extern void print_fields_date(print_field_t *field, time_t value, int last) @@ -114,13 +114,13 @@ extern void print_fields_date(print_field_t *field, time_t value, int last) slurm_make_time_str(&value, (char *)temp_char, sizeof(temp_char)); if(print_fields_parsable_print == PRINT_FIELDS_PARSABLE_NO_ENDING && last) - printf("%s", temp_char); + printf("%s", temp_char); else if(print_fields_parsable_print) printf("%s|", temp_char); else if(field->len == abs_len) printf("%*.*s ", abs_len, abs_len, temp_char); else - printf("%-*.*s ", abs_len, abs_len, temp_char); + printf("%-*.*s ", abs_len, abs_len, temp_char); } extern void print_fields_str(print_field_t *field, char *value, int last) @@ -135,17 +135,17 @@ extern void print_fields_str(print_field_t *field, char *value, int last) print_this = " "; } else print_this = value; - + if(print_fields_parsable_print == PRINT_FIELDS_PARSABLE_NO_ENDING && last) - printf("%s", print_this); + printf("%s", print_this); else if(print_fields_parsable_print) printf("%s|", print_this); else { if(value) { memcpy(&temp_char, value, abs_len); - - if(strlen(value) > abs_len) + + if(strlen(value) > abs_len) temp_char[abs_len-1] = '+'; print_this = temp_char; } @@ -162,21 +162,21 @@ extern void print_fields_int(print_field_t *field, int value, int last) int abs_len = abs(field->len); /* (value == unset) || (value == cleared) */ if((value == NO_VAL) || (value == INFINITE)) { - if(print_fields_parsable_print + if(print_fields_parsable_print == PRINT_FIELDS_PARSABLE_NO_ENDING && last) ; else if(print_fields_parsable_print) - printf("|"); - else + printf("|"); + else printf("%*s ", abs_len, " "); } else { if(print_fields_parsable_print == PRINT_FIELDS_PARSABLE_NO_ENDING && last) - printf("%d", value); + printf("%d", value); else if(print_fields_parsable_print) - printf("%d|", value); + printf("%d|", value); else if(field->len == abs_len) printf("%*d ", abs_len, value); else @@ -189,21 +189,21 @@ extern void print_fields_uint32(print_field_t *field, uint32_t value, int last) int abs_len = abs(field->len); /* (value == unset) || (value == cleared) */ if((value == NO_VAL) || (value == INFINITE)) { - if(print_fields_parsable_print + if(print_fields_parsable_print == PRINT_FIELDS_PARSABLE_NO_ENDING && last) ; else if(print_fields_parsable_print) - printf("|"); - else + printf("|"); + else printf("%*s ", field->len, " "); } else { if(print_fields_parsable_print == PRINT_FIELDS_PARSABLE_NO_ENDING && last) - printf("%u", value); + printf("%u", value); else if(print_fields_parsable_print) - printf("%u|", value); + printf("%u|", value); else if(field->len == abs_len) printf("%*u ", abs_len, value); else @@ -216,21 +216,21 @@ extern void print_fields_uint64(print_field_t *field, uint64_t value, int last) int abs_len = abs(field->len); /* (value == unset) || (value == cleared) */ if((value == NO_VAL) || (value == INFINITE)) { - if(print_fields_parsable_print + if(print_fields_parsable_print == PRINT_FIELDS_PARSABLE_NO_ENDING && last) ; else if(print_fields_parsable_print) - printf("|"); - else + printf("|"); + else printf("%*s ", field->len, " "); } else { if(print_fields_parsable_print == PRINT_FIELDS_PARSABLE_NO_ENDING && last) - printf("%llu", (long long unsigned) value); + printf("%llu", (long long unsigned) value); else if(print_fields_parsable_print) - printf("%llu|", (long long unsigned) value); + printf("%llu|", (long long unsigned) value); else if(field->len == abs_len) printf("%*llu ", abs_len, (long long unsigned) value); else @@ -243,21 +243,21 @@ extern void print_fields_double(print_field_t *field, double value, int last) int abs_len = abs(field->len); /* (value == unset) || (value == cleared) */ if((value == NO_VAL) || (value == INFINITE)) { - if(print_fields_parsable_print + if(print_fields_parsable_print == PRINT_FIELDS_PARSABLE_NO_ENDING && last) ; else if(print_fields_parsable_print) - printf("|"); - else + printf("|"); + else printf("%*s ", field->len, " "); } else { if(print_fields_parsable_print == PRINT_FIELDS_PARSABLE_NO_ENDING && last) - printf("%f", value); + printf("%f", value); else if(print_fields_parsable_print) - printf("%f|", value); + printf("%f|", value); else if(field->len == abs_len) printf("%*f ", abs_len, value); else @@ -271,21 +271,21 @@ extern void print_fields_long_double( int abs_len = abs(field->len); /* (value == unset) || (value == cleared) */ if((value == NO_VAL) || (value == INFINITE)) { - if(print_fields_parsable_print + if(print_fields_parsable_print == PRINT_FIELDS_PARSABLE_NO_ENDING && last) ; else if(print_fields_parsable_print) - printf("|"); - else + printf("|"); + else printf("%*s ", field->len, " "); } else { if(print_fields_parsable_print == PRINT_FIELDS_PARSABLE_NO_ENDING && last) - printf("%Lf", value); + printf("%Lf", value); else if(print_fields_parsable_print) - printf("%Lf|", value); + printf("%Lf|", value); else if(field->len == abs_len) printf("%*Lf ", abs_len, value); else @@ -299,18 +299,18 @@ extern void print_fields_time(print_field_t *field, uint32_t value, int last) int abs_len = abs(field->len); /* (value == unset) || (value == cleared) */ if((value == NO_VAL) || (value == INFINITE)) { - if(print_fields_parsable_print + if(print_fields_parsable_print == PRINT_FIELDS_PARSABLE_NO_ENDING && last) ; else if(print_fields_parsable_print) - printf("|"); + printf("|"); else printf("%*s ", field->len, " "); } else { char time_buf[32]; mins2time_str((time_t) value, time_buf, sizeof(time_buf)); - if(print_fields_parsable_print + if(print_fields_parsable_print == PRINT_FIELDS_PARSABLE_NO_ENDING && last) printf("%s", time_buf); @@ -323,24 +323,24 @@ extern void print_fields_time(print_field_t *field, uint32_t value, int last) } } -extern void print_fields_time_from_secs(print_field_t *field, +extern void print_fields_time_from_secs(print_field_t *field, uint32_t value, int last) { int abs_len = abs(field->len); /* (value == unset) || (value == cleared) */ if((value == NO_VAL) || (value == INFINITE)) { - if(print_fields_parsable_print + if(print_fields_parsable_print == PRINT_FIELDS_PARSABLE_NO_ENDING && last) ; else if(print_fields_parsable_print) - printf("|"); + printf("|"); else printf("%*s ", field->len, " "); } else { char time_buf[32]; secs2time_str((time_t) value, time_buf, sizeof(time_buf)); - if(print_fields_parsable_print + if(print_fields_parsable_print == PRINT_FIELDS_PARSABLE_NO_ENDING && last) printf("%s", time_buf); @@ -359,7 +359,7 @@ extern void print_fields_char_list(print_field_t *field, List value, int last) ListIterator itr = NULL; char *print_this = NULL; char *object = NULL; - + if(!value || !list_count(value)) { if(print_fields_parsable_print) print_this = xstrdup(""); @@ -369,23 +369,23 @@ extern void print_fields_char_list(print_field_t *field, List value, int last) list_sort(value, (ListCmpF)_sort_char_list); itr = list_iterator_create(value); while((object = list_next(itr))) { - if(print_this) + if(print_this) xstrfmtcat(print_this, ",%s", object); - else + else print_this = xstrdup(object); } list_iterator_destroy(itr); } - + if(print_fields_parsable_print == PRINT_FIELDS_PARSABLE_NO_ENDING && last) printf("%s", print_this); else if(print_fields_parsable_print) printf("%s|", print_this); else { - if(strlen(print_this) > abs_len) + if(strlen(print_this) > abs_len) print_this[abs_len-1] = '+'; - + if(field->len == abs_len) printf("%*.*s ", abs_len, abs_len, print_this); else diff --git a/src/common/print_fields.h b/src/common/print_fields.h index 95cdf62049..a6fea8e395 100644 --- a/src/common/print_fields.h +++ b/src/common/print_fields.h @@ -6,32 +6,32 @@ * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Danny Auble * CODE-OCEC-09-009. All rights reserved. - * + * * This file is part of SLURM, a resource management program. * For details, see . * Please also read the included file: DISCLAIMER. - * + * * SLURM is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free * Software Foundation; either version 2 of the License, or (at your option) * any later version. * - * In addition, as a special exception, the copyright holders give permission + * In addition, as a special exception, the copyright holders give permission * to link the code of portions of this program with the OpenSSL library under - * certain conditions as described in each individual source file, and - * distribute linked combinations including the two. You must obey the GNU - * General Public License in all respects for all of the code used other than - * OpenSSL. If you modify file(s) with this exception, you may extend this - * exception to your version of the file(s), but you are not obligated to do + * certain conditions as described in each individual source file, and + * distribute linked combinations including the two. You must obey the GNU + * General Public License in all respects for all of the code used other than + * OpenSSL. If you modify file(s) with this exception, you may extend this + * exception to your version of the file(s), but you are not obligated to do * so. If you do not wish to do so, delete this exception statement from your - * version. If you delete this exception statement from all source files in + * version. If you delete this exception statement from all source files in * the program, then also delete it here. - * + * * SLURM is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. - * + * * You should have received a copy of the GNU General Public License along * with SLURM; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. @@ -69,7 +69,7 @@ #include "src/common/list.h" typedef struct { - int len; /* what is the width of the print */ + int len; /* what is the width of the print */ char *name; /* name to be printed in header */ void (*print_routine) (); /* what is the function to print with */ uint16_t type; /* defined in the local function */ @@ -98,7 +98,7 @@ extern void print_fields_uint64( print_field_t *field, uint64_t value, int last); extern void print_fields_time_from_mins(print_field_t *field, uint32_t value, int last); -extern void print_fields_time_from_secs(print_field_t *field, +extern void print_fields_time_from_secs(print_field_t *field, uint32_t value, int last); extern void print_fields_char_list(print_field_t *field, List value, int last); diff --git a/src/common/proc_args.c b/src/common/proc_args.c index 3539115cbc..49a2c00083 100644 --- a/src/common/proc_args.c +++ b/src/common/proc_args.c @@ -4,33 +4,33 @@ ***************************************************************************** * Copyright (C) 2007 Hewlett-Packard Development Company, L.P. * Written by Christopher Holmes , who borrowed heavily - * from existing SLURM source code, particularly src/srun/opt.c - * + * from existing SLURM source code, particularly src/srun/opt.c + * * This file is part of SLURM, a resource management program. * For details, see . * Please also read the included file: DISCLAIMER. - * + * * SLURM is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free * Software Foundation; either version 2 of the License, or (at your option) * any later version. * - * In addition, as a special exception, the copyright holders give permission + * In addition, as a special exception, the copyright holders give permission * to link the code of portions of this program with the OpenSSL library under - * certain conditions as described in each individual source file, and - * distribute linked combinations including the two. You must obey the GNU - * General Public License in all respects for all of the code used other than - * OpenSSL. If you modify file(s) with this exception, you may extend this - * exception to your version of the file(s), but you are not obligated to do + * certain conditions as described in each individual source file, and + * distribute linked combinations including the two. You must obey the GNU + * General Public License in all respects for all of the code used other than + * OpenSSL. If you modify file(s) with this exception, you may extend this + * exception to your version of the file(s), but you are not obligated to do * so. If you do not wish to do so, delete this exception statement from your - * version. If you delete this exception statement from all source files in + * version. If you delete this exception statement from all source files in * the program, then also delete it here. - * + * * SLURM is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. - * + * * You should have received a copy of the GNU General Public License along * with SLURM; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. @@ -86,7 +86,7 @@ void print_slurm_version(void) printf("%s %s\n", PACKAGE, SLURM_VERSION); } -/* +/* * verify that a distribution type in arg is of a known form * returns the task_dist_states, or -1 if state is unknown */ @@ -290,7 +290,7 @@ _str_to_nodes(const char *num_str, char **leftover) if (endptr == num_str) { /* no valid digits */ *leftover = (char *)num_str; return 0; - } + } if (*endptr != '\0' && (*endptr == 'k' || *endptr == 'K')) { num *= 1024; endptr++; @@ -300,7 +300,7 @@ _str_to_nodes(const char *num_str, char **leftover) return (int)num; } -/* +/* * verify that a node count in arg is of a known form (count or min-max) * OUT min, max specified minimum and maximum node counts * RET true if valid @@ -309,7 +309,7 @@ bool verify_node_count(const char *arg, int *min_nodes, int *max_nodes) { char *ptr, *min_str, *max_str; char *leftover; - + /* Does the string contain a "-" character? If so, treat as a range. * otherwise treat as an absolute node count. */ if ((ptr = index(arg, '-')) != NULL) { @@ -356,7 +356,7 @@ bool verify_node_count(const char *arg, int *min_nodes, int *max_nodes) } /* - * If the node list supplied is a file name, translate that into + * If the node list supplied is a file name, translate that into * a list of nodes, we orphan the data pointed to * RET true if the node list is a valid one */ @@ -364,7 +364,7 @@ bool verify_node_list(char **node_list_pptr, enum task_dist_states dist, int task_count) { char *nodelist = NULL; - + xassert (node_list_pptr); xassert (*node_list_pptr); @@ -374,12 +374,12 @@ bool verify_node_list(char **node_list_pptr, enum task_dist_states dist, /* If we are using Arbitrary grab count out of the hostfile using them exactly the way we read it in since we are saying, lay it out this way! */ - if(dist == SLURM_DIST_ARBITRARY) + if(dist == SLURM_DIST_ARBITRARY) nodelist = slurm_read_hostfile(*node_list_pptr, task_count); else nodelist = slurm_read_hostfile(*node_list_pptr, NO_VAL); - - if (!nodelist) + + if (!nodelist) return false; xfree(*node_list_pptr); @@ -389,7 +389,7 @@ bool verify_node_list(char **node_list_pptr, enum task_dist_states dist, return true; } -/* +/* * get either 1 or 2 integers for a resource count in the form of either * (count, min-max, or '*') * A partial error message is passed in via the 'what' param. @@ -400,7 +400,7 @@ bool verify_node_list(char **node_list_pptr, enum task_dist_states dist, * IN isFatal - if set, exit on error * RET true if valid */ -bool get_resource_arg_range(const char *arg, const char *what, int* min, +bool get_resource_arg_range(const char *arg, const char *what, int* min, int *max, bool isFatal) { char *p; @@ -450,7 +450,7 @@ bool get_resource_arg_range(const char *arg, const char *what, int* min, result *= 1048576; p++; } - + if (((*p != '\0') && (*p != '-')) || (result <= 0L)) { error ("Invalid numeric value \"%s\" for %s.", arg, what); if (isFatal) @@ -469,13 +469,13 @@ bool get_resource_arg_range(const char *arg, const char *what, int* min, return true; } -/* - * verify that a resource counts in arg are of a known form X, X:X, X:X:X, or +/* + * verify that a resource counts in arg are of a known form X, X:X, X:X:X, or * X:X:X:X, where X is defined as either (count, min-max, or '*') * RET true if valid */ -bool verify_socket_core_thread_count(const char *arg, int *min_sockets, - int *min_cores, int *min_threads, +bool verify_socket_core_thread_count(const char *arg, int *min_sockets, + int *min_cores, int *min_threads, cpu_bind_type_t *cpu_bind_type) { bool tmp_val,ret_val; @@ -486,7 +486,7 @@ bool verify_socket_core_thread_count(const char *arg, int *min_sockets, buf[1][0] = '\0'; buf[2][0] = '\0'; - for (j=0;j<3;j++) { + for (j=0;j<3;j++) { for (i=0;i<47;i++) { if (*cur_ptr == '\0' || *cur_ptr ==':') break; @@ -515,24 +515,24 @@ bool verify_socket_core_thread_count(const char *arg, int *min_sockets, buf[j][i] = '\0'; ret_val = true; - tmp_val = get_resource_arg_range(&buf[0][0], "first arg of -B", + tmp_val = get_resource_arg_range(&buf[0][0], "first arg of -B", min_sockets, NULL, true); ret_val = ret_val && tmp_val; - tmp_val = get_resource_arg_range(&buf[1][0], "second arg of -B", + tmp_val = get_resource_arg_range(&buf[1][0], "second arg of -B", min_cores, NULL, true); ret_val = ret_val && tmp_val; - tmp_val = get_resource_arg_range(&buf[2][0], "third arg of -B", + tmp_val = get_resource_arg_range(&buf[2][0], "third arg of -B", min_threads, NULL, true); ret_val = ret_val && tmp_val; return ret_val; } -/* +/* * verify that a hint is valid and convert it into the implied settings * RET true if valid */ -bool verify_hint(const char *arg, int *min_sockets, int *min_cores, +bool verify_hint(const char *arg, int *min_sockets, int *min_cores, int *min_threads, cpu_bind_type_t *cpu_bind_type) { char *buf, *p, *tok; @@ -667,7 +667,7 @@ search_path(char *cwd, char *cmd, bool check_current_dir, int access_mode) ListIterator i = NULL; char *path, *fullpath = NULL; - if ( (cmd[0] == '.' || cmd[0] == '/') + if ( (cmd[0] == '.' || cmd[0] == '/') && (access(cmd, access_mode) == 0 ) ) { if (cmd[0] == '.') xstrfmtcat(fullpath, "%s/", cwd); @@ -679,7 +679,7 @@ search_path(char *cwd, char *cmd, bool check_current_dir, int access_mode) if (l == NULL) return NULL; - if (check_current_dir) + if (check_current_dir) list_prepend(l, xstrdup(cwd)); i = list_iterator_create(l); @@ -734,7 +734,7 @@ char *print_geometry(const uint16_t *geometry) return rc; } -/* Translate a signal option string "--signal=[@