diff --git a/NEWS b/NEWS index c34b01e554d6362f87bc12824c2294fce2709b38..fdb9ce022f994e1147fda2af57b66be6d42c589c 100644 --- a/NEWS +++ b/NEWS @@ -6,6 +6,15 @@ documents those changes that are of interest to users and admins. -- sview - added ability to see database configuration. -- sview - added ability to remove visible tabs. -- sview - change way grid highlighting takes place on selected objects. + -- Added infrastructure to support allocation of generic node resources. + -Added node configuration parameter of Gres=. + -Added ability to view/modify a node's gres using scontrol, sinfo and sview. + -Added salloc, sbatch and srun --gres option. + -Added ability to view a job or job step's gres using scontrol, squeue and + sview. + -Added new configuration parameter GresPlugins to define plugins used to + manage generic resources. + -Added framework for gres plugins. * Changes in SLURM 2.2.0.pre5 ============================= diff --git a/RELEASE_NOTES b/RELEASE_NOTES index 8e6bebbf61e22116ddde80be58e5307a0c515fc0..22ef7dbe584c986ef896fdaa9ae09fd1f86e9005 100644 --- a/RELEASE_NOTES +++ b/RELEASE_NOTES @@ -80,6 +80,8 @@ CONFIGURATION FILE CHANGES (see "man slurm.conf" for details) to set default job parameters or perform other site-configurable actions at job submit time. +* Added new configuration parameter GresPlugins which manages generic resources. + * Added "--enable-partial-attach" option to configure (build) script. * Added support for new partition states of DRAIN and INACTIVE and new partition @@ -152,15 +154,21 @@ slurm_step_ctx_params_t * Added the following struct definitions: job_info_t + gres resize_time time_min job_desc_msg_t + gres max_cpus time_min +job_step_info_t + gres + node_info_t boot_time + gres reason_time reason_uid slurmd_start_time @@ -169,9 +177,11 @@ partition_info_t alternate slurm_step_ctx_params_t + gres max_nodes update_node_msg_t + gres reason_uid * Changed the following enums diff --git a/configure b/configure index d29e4d23ad62452a9c7bf59c4d18565e32d4fd2e..3869f99151a502a2d6a5cc8233697de3d35e5453 100755 --- a/configure +++ b/configure @@ -20202,7 +20202,7 @@ fi -ac_config_files="$ac_config_files Makefile config.xml auxdir/Makefile contribs/Makefile contribs/pam/Makefile contribs/perlapi/Makefile contribs/perlapi/libslurm/Makefile contribs/perlapi/libslurm/perl/Makefile.PL contribs/perlapi/libslurmdb/Makefile contribs/perlapi/libslurmdb/perl/Makefile.PL contribs/torque/Makefile contribs/phpext/Makefile contribs/phpext/slurm_php/config.m4 contribs/slurmdb-direct/Makefile src/Makefile src/api/Makefile src/common/Makefile src/db_api/Makefile src/database/Makefile src/sacct/Makefile src/sacctmgr/Makefile src/sreport/Makefile src/sstat/Makefile src/sshare/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/slurmdbd/Makefile src/slurmctld/Makefile src/sbcast/Makefile src/scontrol/Makefile src/scancel/Makefile src/squeue/Makefile src/sinfo/Makefile src/smap/Makefile src/strigger/Makefile src/sview/Makefile src/plugins/Makefile src/plugins/accounting_storage/Makefile src/plugins/accounting_storage/common/Makefile src/plugins/accounting_storage/filetxt/Makefile src/plugins/accounting_storage/mysql/Makefile src/plugins/accounting_storage/pgsql/Makefile src/plugins/accounting_storage/none/Makefile src/plugins/accounting_storage/slurmdbd/Makefile src/plugins/auth/Makefile src/plugins/auth/authd/Makefile src/plugins/auth/munge/Makefile src/plugins/auth/none/Makefile src/plugins/checkpoint/Makefile src/plugins/checkpoint/aix/Makefile src/plugins/checkpoint/none/Makefile src/plugins/checkpoint/ompi/Makefile src/plugins/checkpoint/xlch/Makefile src/plugins/checkpoint/blcr/Makefile src/plugins/checkpoint/blcr/cr_checkpoint.sh src/plugins/checkpoint/blcr/cr_restart.sh src/plugins/crypto/Makefile src/plugins/crypto/munge/Makefile src/plugins/crypto/openssl/Makefile src/plugins/jobacct_gather/Makefile src/plugins/jobacct_gather/linux/Makefile src/plugins/jobacct_gather/aix/Makefile src/plugins/jobacct_gather/none/Makefile src/plugins/jobcomp/Makefile src/plugins/jobcomp/filetxt/Makefile src/plugins/jobcomp/none/Makefile src/plugins/jobcomp/script/Makefile src/plugins/jobcomp/mysql/Makefile src/plugins/jobcomp/pgsql/Makefile src/plugins/job_submit/Makefile src/plugins/job_submit/defaults/Makefile src/plugins/job_submit/logging/Makefile src/plugins/job_submit/partition/Makefile src/plugins/preempt/Makefile src/plugins/preempt/none/Makefile src/plugins/preempt/partition_prio/Makefile src/plugins/preempt/qos/Makefile src/plugins/priority/Makefile src/plugins/priority/basic/Makefile src/plugins/priority/multifactor/Makefile src/plugins/proctrack/Makefile src/plugins/proctrack/aix/Makefile src/plugins/proctrack/pgid/Makefile src/plugins/proctrack/linuxproc/Makefile src/plugins/proctrack/rms/Makefile src/plugins/proctrack/sgi_job/Makefile src/plugins/proctrack/cgroup/Makefile src/plugins/proctrack/lua/Makefile src/plugins/sched/Makefile src/plugins/sched/backfill/Makefile src/plugins/sched/builtin/Makefile src/plugins/sched/hold/Makefile src/plugins/sched/wiki/Makefile src/plugins/sched/wiki2/Makefile src/plugins/select/Makefile src/plugins/select/bluegene/Makefile src/plugins/select/bluegene/block_allocator/Makefile src/plugins/select/bluegene/plugin/Makefile src/plugins/select/cons_res/Makefile src/plugins/select/linear/Makefile src/plugins/switch/Makefile src/plugins/switch/elan/Makefile src/plugins/switch/none/Makefile src/plugins/switch/federation/Makefile src/plugins/mpi/Makefile src/plugins/mpi/mpich1_p4/Makefile src/plugins/mpi/mpich1_shmem/Makefile src/plugins/mpi/mpichgm/Makefile src/plugins/mpi/mpichmx/Makefile src/plugins/mpi/mvapich/Makefile src/plugins/mpi/lam/Makefile src/plugins/mpi/none/Makefile src/plugins/mpi/openmpi/Makefile src/plugins/task/Makefile src/plugins/task/affinity/Makefile src/plugins/task/none/Makefile src/plugins/topology/Makefile src/plugins/topology/3d_torus/Makefile src/plugins/topology/none/Makefile src/plugins/topology/tree/Makefile doc/Makefile doc/man/Makefile doc/html/Makefile doc/html/configurator.html testsuite/Makefile testsuite/expect/Makefile testsuite/slurm_unit/Makefile testsuite/slurm_unit/api/Makefile testsuite/slurm_unit/api/manual/Makefile testsuite/slurm_unit/common/Makefile testsuite/slurm_unit/slurmctld/Makefile testsuite/slurm_unit/slurmd/Makefile testsuite/slurm_unit/slurmdbd/Makefile" +ac_config_files="$ac_config_files Makefile config.xml auxdir/Makefile contribs/Makefile contribs/pam/Makefile contribs/perlapi/Makefile contribs/perlapi/libslurm/Makefile contribs/perlapi/libslurm/perl/Makefile.PL contribs/perlapi/libslurmdb/Makefile contribs/perlapi/libslurmdb/perl/Makefile.PL contribs/torque/Makefile contribs/phpext/Makefile contribs/phpext/slurm_php/config.m4 contribs/slurmdb-direct/Makefile src/Makefile src/api/Makefile src/common/Makefile src/db_api/Makefile src/database/Makefile src/sacct/Makefile src/sacctmgr/Makefile src/sreport/Makefile src/sstat/Makefile src/sshare/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/slurmdbd/Makefile src/slurmctld/Makefile src/sbcast/Makefile src/scontrol/Makefile src/scancel/Makefile src/squeue/Makefile src/sinfo/Makefile src/smap/Makefile src/strigger/Makefile src/sview/Makefile src/plugins/Makefile src/plugins/accounting_storage/Makefile src/plugins/accounting_storage/common/Makefile src/plugins/accounting_storage/filetxt/Makefile src/plugins/accounting_storage/mysql/Makefile src/plugins/accounting_storage/pgsql/Makefile src/plugins/accounting_storage/none/Makefile src/plugins/accounting_storage/slurmdbd/Makefile src/plugins/auth/Makefile src/plugins/auth/authd/Makefile src/plugins/auth/munge/Makefile src/plugins/auth/none/Makefile src/plugins/checkpoint/Makefile src/plugins/checkpoint/aix/Makefile src/plugins/checkpoint/none/Makefile src/plugins/checkpoint/ompi/Makefile src/plugins/checkpoint/xlch/Makefile src/plugins/checkpoint/blcr/Makefile src/plugins/checkpoint/blcr/cr_checkpoint.sh src/plugins/checkpoint/blcr/cr_restart.sh src/plugins/crypto/Makefile src/plugins/crypto/munge/Makefile src/plugins/crypto/openssl/Makefile src/plugins/gres/Makefile src/plugins/gres/gpu/Makefile src/plugins/jobacct_gather/Makefile src/plugins/jobacct_gather/linux/Makefile src/plugins/jobacct_gather/aix/Makefile src/plugins/jobacct_gather/none/Makefile src/plugins/jobcomp/Makefile src/plugins/jobcomp/filetxt/Makefile src/plugins/jobcomp/none/Makefile src/plugins/jobcomp/script/Makefile src/plugins/jobcomp/mysql/Makefile src/plugins/jobcomp/pgsql/Makefile src/plugins/job_submit/Makefile src/plugins/job_submit/defaults/Makefile src/plugins/job_submit/logging/Makefile src/plugins/job_submit/partition/Makefile src/plugins/preempt/Makefile src/plugins/preempt/none/Makefile src/plugins/preempt/partition_prio/Makefile src/plugins/preempt/qos/Makefile src/plugins/priority/Makefile src/plugins/priority/basic/Makefile src/plugins/priority/multifactor/Makefile src/plugins/proctrack/Makefile src/plugins/proctrack/aix/Makefile src/plugins/proctrack/pgid/Makefile src/plugins/proctrack/linuxproc/Makefile src/plugins/proctrack/rms/Makefile src/plugins/proctrack/sgi_job/Makefile src/plugins/proctrack/cgroup/Makefile src/plugins/proctrack/lua/Makefile src/plugins/sched/Makefile src/plugins/sched/backfill/Makefile src/plugins/sched/builtin/Makefile src/plugins/sched/hold/Makefile src/plugins/sched/wiki/Makefile src/plugins/sched/wiki2/Makefile src/plugins/select/Makefile src/plugins/select/bluegene/Makefile src/plugins/select/bluegene/block_allocator/Makefile src/plugins/select/bluegene/plugin/Makefile src/plugins/select/cons_res/Makefile src/plugins/select/linear/Makefile src/plugins/switch/Makefile src/plugins/switch/elan/Makefile src/plugins/switch/none/Makefile src/plugins/switch/federation/Makefile src/plugins/mpi/Makefile src/plugins/mpi/mpich1_p4/Makefile src/plugins/mpi/mpich1_shmem/Makefile src/plugins/mpi/mpichgm/Makefile src/plugins/mpi/mpichmx/Makefile src/plugins/mpi/mvapich/Makefile src/plugins/mpi/lam/Makefile src/plugins/mpi/none/Makefile src/plugins/mpi/openmpi/Makefile src/plugins/task/Makefile src/plugins/task/affinity/Makefile src/plugins/task/none/Makefile src/plugins/topology/Makefile src/plugins/topology/3d_torus/Makefile src/plugins/topology/none/Makefile src/plugins/topology/tree/Makefile doc/Makefile doc/man/Makefile doc/html/Makefile doc/html/configurator.html testsuite/Makefile testsuite/expect/Makefile testsuite/slurm_unit/Makefile testsuite/slurm_unit/api/Makefile testsuite/slurm_unit/api/manual/Makefile testsuite/slurm_unit/common/Makefile testsuite/slurm_unit/slurmctld/Makefile testsuite/slurm_unit/slurmd/Makefile testsuite/slurm_unit/slurmdbd/Makefile" cat >confcache <<\_ACEOF @@ -21433,6 +21433,8 @@ do "src/plugins/crypto/Makefile") CONFIG_FILES="$CONFIG_FILES src/plugins/crypto/Makefile" ;; "src/plugins/crypto/munge/Makefile") CONFIG_FILES="$CONFIG_FILES src/plugins/crypto/munge/Makefile" ;; "src/plugins/crypto/openssl/Makefile") CONFIG_FILES="$CONFIG_FILES src/plugins/crypto/openssl/Makefile" ;; + "src/plugins/gres/Makefile") CONFIG_FILES="$CONFIG_FILES src/plugins/gres/Makefile" ;; + "src/plugins/gres/gpu/Makefile") CONFIG_FILES="$CONFIG_FILES src/plugins/gres/gpu/Makefile" ;; "src/plugins/jobacct_gather/Makefile") CONFIG_FILES="$CONFIG_FILES src/plugins/jobacct_gather/Makefile" ;; "src/plugins/jobacct_gather/linux/Makefile") CONFIG_FILES="$CONFIG_FILES src/plugins/jobacct_gather/linux/Makefile" ;; "src/plugins/jobacct_gather/aix/Makefile") CONFIG_FILES="$CONFIG_FILES src/plugins/jobacct_gather/aix/Makefile" ;; diff --git a/configure.ac b/configure.ac index f90929fce0b1ba494daf493d1e4cb5f3211d7fd8..1037ace426413f1da0507dc36cdc5ad68dfd4763 100644 --- a/configure.ac +++ b/configure.ac @@ -378,6 +378,8 @@ AC_CONFIG_FILES([Makefile src/plugins/crypto/Makefile src/plugins/crypto/munge/Makefile src/plugins/crypto/openssl/Makefile + src/plugins/gres/Makefile + src/plugins/gres/gpu/Makefile src/plugins/jobacct_gather/Makefile src/plugins/jobacct_gather/linux/Makefile src/plugins/jobacct_gather/aix/Makefile diff --git a/contribs/perlapi/libslurm/perl/conf.c b/contribs/perlapi/libslurm/perl/conf.c index 6097762b08e2e6b51546e38f7d7d5d834035f71a..625127c2ec60f71b05fea156b1774ada5a27627a 100644 --- a/contribs/perlapi/libslurm/perl/conf.c +++ b/contribs/perlapi/libslurm/perl/conf.c @@ -59,6 +59,8 @@ slurm_ctl_conf_to_hv(slurm_ctl_conf_t* conf, HV* hv) STORE_FIELD(hv, conf, epilog_slurmctld, charp); STORE_FIELD(hv, conf, fast_schedule, uint16_t); STORE_FIELD(hv, conf, first_job_id, uint32_t); + if(conf->gres_plugins) + STORE_FIELD(hv, conf, gres_plugins, charp); STORE_FIELD(hv, conf, group_info, uint16_t); STORE_FIELD(hv, conf, health_check_interval, uint16_t); if(conf->health_check_program) diff --git a/contribs/perlapi/libslurm/perl/job.c b/contribs/perlapi/libslurm/perl/job.c index 5b11f1ae90ed55b6d65dc83dffe4eb306aeb856e..755b16899ef56b5b3d09f7570a96fae7a9ef4d78 100644 --- a/contribs/perlapi/libslurm/perl/job.c +++ b/contribs/perlapi/libslurm/perl/job.c @@ -130,6 +130,8 @@ job_info_to_hv(job_info_t* job_info, HV* hv) STORE_FIELD(hv, job_info, wckey, charp); if(job_info->work_dir) STORE_FIELD(hv, job_info, work_dir, charp); + if(job_info->gres) + STORE_FIELD(hv, job_info, gres, charp); return 0; } @@ -171,6 +173,8 @@ job_step_info_to_hv(job_step_info_t* step_info, HV* hv) if(step_info->ckpt_dir) STORE_FIELD(hv, step_info, ckpt_dir, charp); + if(step_info->gres) + STORE_FIELD(hv, step_info, gres, charp); STORE_FIELD(hv, step_info, ckpt_interval, uint16_t); STORE_FIELD(hv, step_info, job_id, uint32_t); if(step_info->name) diff --git a/contribs/perlapi/libslurm/perl/launch.c b/contribs/perlapi/libslurm/perl/launch.c index 64841c740d21432cc568bc546ccc808bcee3da9d..c69548dfbf36464e25a52f7d71f34020f08666c1 100644 --- a/contribs/perlapi/libslurm/perl/launch.c +++ b/contribs/perlapi/libslurm/perl/launch.c @@ -20,6 +20,8 @@ hv_to_slurm_step_ctx_params(HV* hv, slurm_step_ctx_params_t* params) FETCH_FIELD(hv, params, job_id, uint32_t, TRUE); FETCH_FIELD(hv, params, uid, uint32_t, FALSE); FETCH_FIELD(hv, params, name, charp, FALSE); + FETCH_FIELD(hv, params, ckpt_dir, charp, FALSE); + FETCH_FIELD(hv, params, gres, charp, FALSE); FETCH_FIELD(hv, params, min_nodes, uint32_t, FALSE); FETCH_FIELD(hv, params, max_nodes, uint32_t, FALSE); FETCH_FIELD(hv, params, cpu_count, uint32_t, FALSE); diff --git a/doc/html/configurator.html.in b/doc/html/configurator.html.in index d1906a6a07a151c5af665e6b08cc82d424112b5b..8f19cf78fdc527dc0c2f46758207949b9aa2e922 100644 --- a/doc/html/configurator.html.in +++ b/doc/html/configurator.html.in @@ -152,13 +152,15 @@ function displayfile() get_field("Epilog",document.config.epilog) + "<br>" + "#PrologSlurmctld= <br>" + "#FirstJobId=1 <br>" + + "#GresPlugins= <br>" + + "#GroupUpdateForce=0 <br>" + + "#GroupUpdateTime=600 <br>" "#JobCheckpointDir=/var/slurm/checkpoint <br>" + get_field("JobCredentialPrivateKey", document.config.private_key) + "<br>" + get_field("JobCredentialPublicCertificate", document.config.public_key) + "<br>" + - "#JobFileAppend=0 <br>" + - "#GroupUpdateForce=0 <br>" + - "#GroupUpdateTime=600 <br>" + + "#JobFileAppend=0 <br>" ++ "#JobRequeue=1 <br>" + + "#JobSubmitPlugins=1 <br>" + "#KillOnBadExit=0 <br>" + "#Licenses=foo*4,bar <br>" + "#MailProg=/bin/mail <br>" + diff --git a/doc/man/man1/salloc.1 b/doc/man/man1/salloc.1 index c1fb4881e1daf92d8455fe738a012c3e511004f7..9f8cba46f36f240ef486db53ecb1c844a76aa48e 100644 --- a/doc/man/man1/salloc.1 +++ b/doc/man/man1/salloc.1 @@ -1,4 +1,4 @@ -.TH "salloc" "1" "SLURM 2.2" "February 2010" "SLURM Commands" +.TH "salloc" "1" "SLURM 2.2" "April 2010" "SLURM Commands" .SH "NAME" salloc \- Obtain a SLURM job allocation (a set of nodes), execute a command, @@ -354,6 +354,21 @@ If \fBsalloc\fR is run as root, and the \fB\-\-gid\fR option is used, submit the job with \fIgroup\fR's group access permissions. \fIgroup\fR may be the group name or the numerical group ID. +.TP +\fB\-\-gres\fR=<\fIlist\fR> +Specifies a comma delimited list of generic consumable resources. +The format of each entry on the list is "name[:count[*cpu]]". +The name is that of the consumable resource. +The count is the number of those resources with a default value of 1. +The specified resources will be allocated to the job on each node +allocated unless "*cpu" is appended, in which case the resources +will be allocated on a per cpu basis. +The available generic consumable resources is configurable by the system +administrator. +A list of available generic consumable resources will be printed and the +command will exit if the option argument is "help". +Examples of use include "\-\-gres=gpus:2*cpu,disk=40G" and "\-\-gres=help". + .TP \fB\-h\fR, \fB\-\-help\fR Display help information and exit. diff --git a/doc/man/man1/sbatch.1 b/doc/man/man1/sbatch.1 index 688f3197a7f7fe1ccef6a0e25f31cd6408b813be..e5a6be60edb230b01543e1cb3654261d3acf994c 100644 --- a/doc/man/man1/sbatch.1 +++ b/doc/man/man1/sbatch.1 @@ -1,4 +1,4 @@ -.TH "sbatch" "1" "SLURM 2.2" "February 2010" "SLURM Commands" +.TH "sbatch" "1" "SLURM 2.2" "April 2010" "SLURM Commands" .SH "NAME" sbatch \- Submit a batch script to SLURM. @@ -369,6 +369,21 @@ If \fBsbatch\fR is run as root, and the \fB\-\-gid\fR option is used, submit the job with \fIgroup\fR's group access permissions. \fIgroup\fR may be the group name or the numerical group ID. +.TP +\fB\-\-gres\fR=<\fIlist\fR> +Specifies a comma delimited list of generic consumable resources. +The format of each entry on the list is "name[:count[*cpu]]". +The name is that of the consumable resource. +The count is the number of those resources with a default value of 1. +The specified resources will be allocated to the job on each node +allocated unless "*cpu" is appended, in which case the resources +will be allocated on a per cpu basis. +The available generic consumable resources is configurable by the system +administrator. +A list of available generic consumable resources will be printed and the +command will exit if the option argument is "help". +Examples of use include "\-\-gres=gpus:2*cpu,disk=40G" and "\-\-gres=help". + .TP \fB\-h\fR, \fB\-\-help\fR Display help information and exit. diff --git a/doc/man/man1/scontrol.1 b/doc/man/man1/scontrol.1 index 77231a255abd9064ee2eaccf0fb5b2869491003d..fc1bbabc59e3dfc7c467d7cbe61e5ac2cfb72161 100644 --- a/doc/man/man1/scontrol.1 +++ b/doc/man/man1/scontrol.1 @@ -389,6 +389,7 @@ Exit status reported for the job by the wait() function. The first number is the exit code, typically as set by the exit() function. The second number of the signal that caused the process to terminate if it was terminated by a signal. + .TP \fIFeatures\fP=<features> Set the job's required node features. @@ -418,6 +419,22 @@ Reset the required job geometry. On Blue Gene the value should be three digits separated by "x" or ",". The digits represent the allocation size in X, Y and Z dimensions (e.g. "2x3x4"). + +.TP +\fIGres\fP=<list> +Specifies a comma delimited list of generic consumable resources. +The format of each entry on the list is "name[:count[*cpu]]". +The name is that of the consumable resource. +The count is the number of those resources with a default value of 1. +The specified resources will be allocated to the job on each node +allocated unless "*cpu" is appended, in which case the resources +will be allocated on a per cpu basis. +The available generic consumable resources is configurable by the system +administrator. +A list of available generic consumable resources will be printed and the +command will exit if the option argument is "help". +Examples of use include "Gres=gpus:2*cpu,disk=40G" and "Gres=help". + .TP \fIJobId\fP=<id> Identify the job to be updated. This specification is required. @@ -639,6 +656,20 @@ preserved or slurmctld's receipt of a SIGHUP. Update slurm.conf with any changes meant to be persistent across normal restarts of slurmctld or the execution of \fBscontrol reconfig\fR. +.TP +\fIGres\fP=<gres> +Identify generic resources to be associated with the specified node. Any +previously defined generic resources will be overwritten with the new value. +Specifications for multiple generic resources should be comma separated. +Each resource specification consists of a name followed by an optional +colon with a numeric value (default value is one) +(e.g. "Gres=bandwidth:10000,gpus"). +Generic resources assigned via \fBscontrol\fR will only persist across the +restart of the slurmctld daemon with the \fI\-R\fR option and state files +preserved or slurmctld's receipt of a SIGHUP. +Update slurm.conf with any changes meant to be persistent across normal +restarts of slurmctld or the execution of \fBscontrol reconfig\fR. + .TP \fIReason\fP=<reason> Identify the reason the node is in a "DOWN" or "DRAINED", "DRAINING", @@ -819,6 +850,13 @@ This parameter is required for update and is the only parameter for delete. For create, if you do not want to give a reservation name, use "scontrol create res ..." and a name will be created automatically. +.TP +\fIAccounts\fP=<account list> +List of accounts permitted to use the reserved nodes. +E.g. Accounts=physcode1,physcode2. A user in any of the accounts +may use the reserved nodes. +A new reservation must specify Users and/or Accounts. + .TP \fILicenses\fP=<license> Specification of licenses (or other resources available on all @@ -921,13 +959,6 @@ List of users permitted to use the reserved nodes. E.g. Users=jones1,smith2. A new reservation must specify Users and/or Accounts. -.TP -\fIAccounts\fP=<account list> -List of accounts permitted to use the reserved nodes. -E.g. Accounts=physcode1,physcode2. A user in any of the accounts -may use the reserved nodes. -A new reservation must specify Users and/or Accounts. - .TP \fBSPECIFICATIONS FOR UPDATE, BLOCK \fR .TP diff --git a/doc/man/man1/sinfo.1 b/doc/man/man1/sinfo.1 index cb8eeec013d2507e0a2ab44f207170dcaf8fd10c..a0fb36f57d4b8e6a026edec9d92aceb3a25fd0f3 100644 --- a/doc/man/man1/sinfo.1 +++ b/doc/man/man1/sinfo.1 @@ -147,6 +147,9 @@ be placed on separate lines. \fB%g\fR Groups which may use the nodes .TP +\fB%G\fR +Generic resources (gres) associated with the nodes +.TP \fB%h\fR Jobs may share nodes, "yes", "no", or "force" .TP diff --git a/doc/man/man1/squeue.1 b/doc/man/man1/squeue.1 index d528284d20acaa63c1dd88995c475fe46f73abf8..6c7e9848ef48915a907acf7077984051892e1f5f 100644 --- a/doc/man/man1/squeue.1 +++ b/doc/man/man1/squeue.1 @@ -108,6 +108,10 @@ Number of tasks created by a job step. This reports the value of the \fBsrun \-\-ntasks\fR option. (Valid for job steps only) .TP +\fB%b\fR +Generic resources (gres) required by the job or step. +(Valid for jobs and job steps) +.TP \fB%c\fR Minimum number of CPUs (processors) per node requested by the job. This reports the value of the \fBsrun \-\-mincpus\fR option with a diff --git a/doc/man/man1/srun.1 b/doc/man/man1/srun.1 index 8fc6dd375ecf8a709c8bf1b5bc68b35a600204d7..0d5b3d8cf34b3e490dea5bdb0653a559e5c84b3c 100644 --- a/doc/man/man1/srun.1 +++ b/doc/man/man1/srun.1 @@ -1,4 +1,4 @@ -.TH "srun" "1" "SLURM 2.2" "February 2010" "SLURM Commands" +.TH "srun" "1" "SLURM 2.2" "April 2010" "SLURM Commands" .SH "NAME" srun \- Run parallel jobs @@ -387,6 +387,21 @@ If \fBsrun\fR is run as root, and the \fB\-\-gid\fR option is used, submit the job with \fIgroup\fR's group access permissions. \fIgroup\fR may be the group name or the numerical group ID. +.TP +\fB\-\-gres\fR=<\fIlist\fR> +Specifies a comma delimited list of generic consumable resources. +The format of each entry on the list is "name[:count[*cpu]]". +The name is that of the consumable resource. +The count is the number of those resources with a default value of 1. +The specified resources will be allocated to the job on each node +allocated unless "*cpu" is appended, in which case the resources +will be allocated on a per cpu basis. +The available generic consumable resources is configurable by the system +administrator. +A list of available generic consumable resources will be printed and the +command will exit if the option argument is "help". +Examples of use include "\-\-gres=gpus:2*cpu,disk=40G" and "\-\-gres=help". + .\".TP .\"NOTE: Do not document feature until user release mechanism is available. .\"\-H, \-\-hold diff --git a/doc/man/man5/slurm.conf.5 b/doc/man/man5/slurm.conf.5 index 42e8f43ac7011874d49308419ea82c0fce0c6986..f424cf99e462902fee273006d6ea76e2f74f999d 100644 --- a/doc/man/man5/slurm.conf.5 +++ b/doc/man/man5/slurm.conf.5 @@ -1,4 +1,4 @@ -.TH "slurm.conf" "5" "February 2010" "slurm.conf 2.2" "Slurm configuration file" +.TH "slurm.conf" "5" "April 2010" "slurm.conf 2.2" "Slurm configuration file" .SH "NAME" slurm.conf \- Slurm configuration file @@ -462,6 +462,12 @@ load it from a cache file. Applies when the srun or sbatch the user's environment from the cache file. The default value is 2 seconds. +.TP +\fBGresPlugins\fR +A comma delimited list of generic resource management plugins to be used. +The specified plugins will be executed in the order listed. +No plugins are used by default. + .TP \fBGroupUpdateForce\fR If set to a non\-zero value, then information about which users are members @@ -2053,6 +2059,16 @@ either has a feature or it does not. If desired a feature may contain a numeric component indicating, for example, processor speed. By default a node has no features. +Also see \fBGres\fR. + +.TP +\fBGres\fR +A comma delimited list of generic resources specifications for a node. +Each resource specification consists of a name followed by an optional +colon with a numeric value (default value is one) +(e.g. "Gres=bandwidth:10000,gpus"). +By default a node has no generic resources. +Also see \fBFeature\fR. .TP \fBProcs\fR diff --git a/slurm.spec b/slurm.spec index ddda4e76e81b659bd387b7477b8726b365cee080..888222a85a819b3247a818ea78d3e84bc3b9c6d6 100644 --- a/slurm.spec +++ b/slurm.spec @@ -623,6 +623,7 @@ rm -rf $RPM_BUILD_ROOT %{_libdir}/slurm/checkpoint_none.so %{_libdir}/slurm/checkpoint_ompi.so %{_libdir}/slurm/checkpoint_xlch.so +%{_libdir}/slurm/gres_gpu.so %{_libdir}/slurm/jobacct_gather_aix.so %{_libdir}/slurm/jobacct_gather_linux.so %{_libdir}/slurm/jobacct_gather_none.so diff --git a/slurm/slurm.h.in b/slurm/slurm.h.in index 2f001254981e40856930511db31b041bf3c60267..667e05cef041b4317d7b1ca73164682dc45208d3 100644 --- a/slurm/slurm.h.in +++ b/slurm/slurm.h.in @@ -577,6 +577,8 @@ typedef struct job_descriptor { /* For submit, allocate, and update requests */ * from job's allocation, default NONE */ char *features; /* comma separated list of required features, * default NONE */ + char *gres; /* comma separated list of required generic + * resources, default NONE */ uint32_t group_id; /* group to assume, if run as root. */ uint16_t immediate; /* 1 if allocate to run or fail immediately, * 0 if to be queued awaiting resources */ @@ -706,6 +708,7 @@ typedef struct job_info { * start_range_2, .., -1 */ uint32_t exit_code; /* exit code for job (status from wait call) */ char *features; /* comma separated list of required features */ + char *gres; /* comma separated list of generic resources */ uint32_t group_id; /* group job sumitted as */ uint32_t job_id; /* job ID */ uint16_t job_state; /* state of the job, see enum job_states */ @@ -861,6 +864,7 @@ typedef struct { uint32_t mem_per_cpu; /* memory required per CPU (MB), * use job limit if 0 */ char *ckpt_dir; /* directory to store checkpoint image files */ + char *gres; /* generic resources needed */ char *name; /* name of the job step */ char *network; /* network use spec */ uint8_t no_kill; /* 1 if no kill on node failure */ @@ -949,6 +953,7 @@ typedef struct { typedef struct { char *ckpt_dir; /* path to store checkpoint image files */ uint16_t ckpt_interval; /* checkpoint interval in minutes */ + char *gres; /* generic resources required */ uint32_t job_id; /* job ID */ char *name; /* name of job step */ char *network; /* network specs for job step */ @@ -979,7 +984,8 @@ typedef struct node_info { uint16_t cores; /* number of cores per CPU */ uint16_t cpus; /* configured count of cpus running on * the node */ - char *features; /* arbitrary list of features for node */ + char *features; /* list of a node's features */ + char *gres; /* list of a node's generic resources */ char *name; /* node name */ uint16_t node_state; /* see enum node_states */ char *os; /* operating system currently running */ @@ -1322,6 +1328,7 @@ typedef struct slurm_ctl_conf { * (only check configuration file, faster) */ uint32_t first_job_id; /* first slurm generated job_id to assign */ uint16_t get_env_timeout; /* timeout for srun --get-user-env option */ + char * gres_plugins; /* list of generic resource plugins */ uint16_t group_info; /* see GROUP_* fields above */ uint32_t hash_val; /* Hash value of the slurm.conf file */ uint16_t health_check_interval; /* secs between health checks */ @@ -1492,6 +1499,7 @@ typedef struct submit_response_msg { typedef struct slurm_update_node_msg { char *features; /* new feature for node */ + char *gres; /* new generic resources for node */ char *node_names; /* comma separated list of required nodes */ uint16_t node_state; /* see enum node_states */ char *reason; /* reason for node being DOWN or DRAINING */ diff --git a/slurm/slurm_errno.h b/slurm/slurm_errno.h index fdd1132ba25b2d7eda9a01e3de41fc0250719e05..d2624c72e906b88de3b3ceae6e4853f4841fd118 100644 --- a/slurm/slurm_errno.h +++ b/slurm/slurm_errno.h @@ -183,6 +183,7 @@ enum { ESLURM_INVALID_CPU_COUNT, ESLURM_PARTITION_NOT_AVAIL, ESLURM_CIRCULAR_DEPENDENCY, + ESLURM_INVALID_GRES, /* switch specific error codes, specific values defined in plugin module */ ESLURM_SWITCH_MIN = 3000, diff --git a/src/api/config_info.c b/src/api/config_info.c index ec54ef0fd613b41369ce4fd7387e6bafcdcc0b6f..ef0b3dcc4ab1557d53df016b78a19d3b2afd55aa 100644 --- a/src/api/config_info.c +++ b/src/api/config_info.c @@ -399,6 +399,12 @@ 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); + + key_pair = xmalloc(sizeof(config_key_pair_t)); + key_pair->name = xstrdup("GresPlugins"); + key_pair->value = xstrdup(slurm_ctl_conf_ptr->gres_plugins); + list_append(ret_list, key_pair); + key_pair = xmalloc(sizeof(config_key_pair_t)); key_pair->name = xstrdup("GroupUpdateForce"); if (slurm_ctl_conf_ptr->group_info & GROUP_FORCE) diff --git a/src/api/job_info.c b/src/api/job_info.c index 704820dc521877a4949d0a0002b56fd58d2dd68b..0cfe3b1999ce7bfc6ad4e48eb942fecf86123d09 100644 --- a/src/api/job_info.c +++ b/src/api/job_info.c @@ -603,8 +603,8 @@ line14: /****** Line 16 ******/ snprintf(tmp_line, sizeof(tmp_line), - "Features=%s Reservation=%s", - job_ptr->features, job_ptr->resv_name); + "Features=%s Gres=%s Reservation=%s", + job_ptr->features, job_ptr->gres, job_ptr->resv_name); xstrcat(out, tmp_line); if (one_liner) xstrcat(out, " "); diff --git a/src/api/job_step_info.c b/src/api/job_step_info.c index 003a4ac3785a269e0ebb4f83bddf1e943d26fc31..15d349ffab867c83076bdf73316fb90f1987791f 100644 --- a/src/api/job_step_info.c +++ b/src/api/job_step_info.c @@ -3,10 +3,9 @@ * $Id$ ***************************************************************************** * Copyright (C) 2002-2006 The Regents of the University of California. - * Copyright (C) 2008-2009 Lawrence Livermore National Security. + * Copyright (C) 2008-2010 Lawrence Livermore National Security. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). - * Written by Morris Jette <jette1@llnl.gov>, - * Joey Ekstrom <ekstrom1@llnl.gov>, et. al. + * Written by Morris Jette <jette1@llnl.gov>, et. al. * CODE-OCEC-09-009. All rights reserved. * * This file is part of SLURM, a resource management program. @@ -135,8 +134,18 @@ 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 Gres=%s", job_step_ptr->partition, job_step_ptr->nodes, + job_step_ptr->gres); + xstrcat(out, tmp_line); + if (one_liner) + xstrcat(out, " "); + else + xstrcat(out, "\n "); + + /****** Line 3 ******/ + snprintf(tmp_line, sizeof(tmp_line), + "Tasks=%u Name=%s Network=%s", job_step_ptr->num_tasks, job_step_ptr->name, job_step_ptr->network); xstrcat(out, tmp_line); @@ -145,7 +154,7 @@ slurm_sprint_job_step_info ( job_step_info_t * job_step_ptr, else xstrcat(out, "\n "); - /****** Line 3 ******/ + /****** Line 4 ******/ snprintf(tmp_line, sizeof(tmp_line), "ResvPorts=%s Checkpoint=%u CheckpointDir=%s\n\n", job_step_ptr->resv_ports, diff --git a/src/api/node_info.c b/src/api/node_info.c index 18e03c59433fd64fe16f472f7f2e588d3f636f07..ab3ebcb84c9d06fa043e13cfc8c3b64417201d57 100644 --- a/src/api/node_info.c +++ b/src/api/node_info.c @@ -3,7 +3,7 @@ * $Id$ ***************************************************************************** * Copyright (C) 2002-2007 The Regents of the University of California. - * Copyright (C) 2008 Lawrence Livermore National Security. + * Copyright (C) 2008-2010 Lawrence Livermore National Security. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Morris Jette <jette1@llnl.gov> et. al. * CODE-OCEC-09-009. All rights reserved. @@ -190,7 +190,6 @@ slurm_sprint_node_table (node_info_t * node_ptr, xstrcat(out, "\n "); /****** Line 2 ******/ - snprintf(tmp_line, sizeof(tmp_line), "CPUAlloc=%u CPUErr=%u CPUTot=%u Features=%s", alloc_cpus, err_cpus, node_ptr->cpus, node_ptr->features); @@ -201,6 +200,14 @@ slurm_sprint_node_table (node_info_t * node_ptr, xstrcat(out, "\n "); /****** Line 3 ******/ + snprintf(tmp_line, sizeof(tmp_line), "Gres=%s",node_ptr->gres); + xstrcat(out, tmp_line); + if (one_liner) + xstrcat(out, " "); + else + xstrcat(out, "\n "); + + /****** Line 4 ******/ if (node_ptr->os) { snprintf(tmp_line, sizeof(tmp_line), "OS=%s ", node_ptr->os); xstrcat(out, tmp_line); @@ -213,7 +220,7 @@ slurm_sprint_node_table (node_info_t * node_ptr, else xstrcat(out, "\n "); - /****** Line 4 ******/ + /****** Line 5 ******/ snprintf(tmp_line, sizeof(tmp_line), "State=%s%s%s%s ThreadsPerCore=%u TmpDisk=%u Weight=%u", @@ -225,7 +232,7 @@ slurm_sprint_node_table (node_info_t * node_ptr, else xstrcat(out, "\n "); - /****** Line 5 ******/ + /****** Line 6 ******/ if (node_ptr->boot_time) { slurm_make_time_str ((time_t *)&node_ptr->boot_time, time_str, sizeof(time_str)); @@ -248,7 +255,7 @@ slurm_sprint_node_table (node_info_t * node_ptr, else xstrcat(out, "\n "); - /****** Line 6 ******/ + /****** Line 7 ******/ if (node_ptr->reason_time) { char *user_name = uid_to_string(node_ptr->reason_uid); slurm_make_time_str ((time_t *)&node_ptr->reason_time, diff --git a/src/api/step_ctx.c b/src/api/step_ctx.c index c826c0610ec7831ff8bfc4423423fd15d8add3eb..6f7df72e99c590bf474aaeb9388d093a80953611 100644 --- a/src/api/step_ctx.c +++ b/src/api/step_ctx.c @@ -115,6 +115,7 @@ static job_step_create_request_msg_t *_create_step_request( step_req->immediate = step_params->immediate; step_req->ckpt_interval = step_params->ckpt_interval; step_req->ckpt_dir = xstrdup(step_params->ckpt_dir); + step_req->gres = xstrdup(step_params->gres); step_req->task_dist = step_params->task_dist; step_req->plane_size = step_params->plane_size; step_req->node_list = xstrdup(step_params->node_list); diff --git a/src/common/Makefile.am b/src/common/Makefile.am index f689c76f884baef6a53239039f386544135cd699..987253e5fb29c49a67dfd8d8e45ef83d46fc46e0 100644 --- a/src/common/Makefile.am +++ b/src/common/Makefile.am @@ -107,7 +107,8 @@ libcommon_la_SOURCES = \ write_labelled_message.h \ proc_args.c proc_args.h \ slurm_strcasestr.c slurm_strcasestr.h \ - node_conf.h node_conf.c + node_conf.h node_conf.c \ + gres.h gres.c EXTRA_libcommon_la_SOURCES = \ $(extra_unsetenv_src) diff --git a/src/common/Makefile.in b/src/common/Makefile.in index 27464b27d0140f6bfa747e70f07cf52d2a77530f..c99167437b8add589fd6e8670e5e1839b2cfe51d 100644 --- a/src/common/Makefile.in +++ b/src/common/Makefile.in @@ -127,7 +127,7 @@ am__libcommon_la_SOURCES_DIST = assoc_mgr.c assoc_mgr.h \ global_defaults.c timers.c timers.h slurm_xlator.h stepd_api.c \ stepd_api.h write_labelled_message.c write_labelled_message.h \ proc_args.c proc_args.h slurm_strcasestr.c slurm_strcasestr.h \ - node_conf.h node_conf.c + node_conf.h node_conf.c gres.h gres.c @HAVE_UNSETENV_FALSE@am__objects_1 = unsetenv.lo am_libcommon_la_OBJECTS = assoc_mgr.lo basil_resv_conf.lo xmalloc.lo \ xassert.lo xstring.lo xsignal.lo forward.lo strlcpy.lo list.lo \ @@ -147,7 +147,7 @@ am_libcommon_la_OBJECTS = assoc_mgr.lo basil_resv_conf.lo xmalloc.lo \ checkpoint.lo job_resources.lo parse_time.lo job_options.lo \ global_defaults.lo timers.lo stepd_api.lo \ write_labelled_message.lo proc_args.lo slurm_strcasestr.lo \ - node_conf.lo + node_conf.lo gres.lo am__EXTRA_libcommon_la_SOURCES_DIST = unsetenv.c unsetenv.h libcommon_la_OBJECTS = $(am_libcommon_la_OBJECTS) libcommon_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ @@ -472,7 +472,8 @@ libcommon_la_SOURCES = \ write_labelled_message.h \ proc_args.c proc_args.h \ slurm_strcasestr.c slurm_strcasestr.h \ - node_conf.h node_conf.c + node_conf.h node_conf.c \ + gres.h gres.c EXTRA_libcommon_la_SOURCES = \ $(extra_unsetenv_src) @@ -585,6 +586,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getopt.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getopt1.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/global_defaults.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gres.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hostlist.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/io_hdr.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/job_options.Plo@am__quote@ diff --git a/src/common/gres.c b/src/common/gres.c new file mode 100644 index 0000000000000000000000000000000000000000..deb3d7f943e209b2e1a424140c09fe9fb3489fb3 --- /dev/null +++ b/src/common/gres.c @@ -0,0 +1,306 @@ +/*****************************************************************************\ + * gres.c - driver for gres plugin + ***************************************************************************** + * Copyright (C) 2010 Lawrence Livermore National Security. + * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). + * Written by Morris Jette <jette1@llnl.gov> + * CODE-OCEC-09-009. All rights reserved. + * + * This file is part of SLURM, a resource management program. + * For details, see <https://computing.llnl.gov/linux/slurm/>. + * 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 + * 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 + * 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 "config.h" +# if STDC_HEADERS +# include <string.h> +# endif +# if HAVE_SYS_TYPES_H +# include <sys/types.h> +# endif /* HAVE_SYS_TYPES_H */ +# if HAVE_UNISTD_H +# include <unistd.h> +# endif +# if HAVE_INTTYPES_H +# include <inttypes.h> +# else /* ! HAVE_INTTYPES_H */ +# if HAVE_STDINT_H +# include <stdint.h> +# endif +# endif /* HAVE_INTTYPES_H */ +#else /* ! HAVE_CONFIG_H */ +# include <sys/types.h> +# include <unistd.h> +# include <stdint.h> +# include <string.h> +#endif /* HAVE_CONFIG_H */ + +#include <stdio.h> +#include <slurm/slurm.h> +#include <slurm/slurm_errno.h> + +#include "src/common/macros.h" +#include "src/common/plugin.h" +#include "src/common/plugrack.h" +#include "src/common/slurm_protocol_api.h" +#include "src/common/xmalloc.h" +#include "src/common/xstring.h" + +typedef struct slurm_gres_ops { + int (*help_msg) ( char *msg, int msg_size ); +} slurm_gres_ops_t; + +typedef struct slurm_gres_context { + char *sched_type; + plugrack_t plugin_list; + plugin_handle_t cur_plugin; + int sched_errno; + slurm_gres_ops_t ops; +} slurm_gres_context_t; + +static int gres_context_cnt = -1; +static slurm_gres_context_t *gres_context = NULL; +static char *gres_plugin_list = NULL; +static pthread_mutex_t gres_context_lock = PTHREAD_MUTEX_INITIALIZER; + +static int _load_gres_plugin(char *plugin_name, + slurm_gres_context_t *plugin_context) +{ + /* + * Must be synchronized with slurm_gres_ops_t above. + */ + static const char *syms[] = { + "help_msg" + }; + int n_syms = sizeof(syms) / sizeof(char *); + + /* Find the correct plugin */ + plugin_context->sched_type = xstrdup("gres/"); + xstrcat(plugin_context->sched_type, plugin_name); + plugin_context->plugin_list = NULL; + plugin_context->cur_plugin = PLUGIN_INVALID_HANDLE; + plugin_context->sched_errno = SLURM_SUCCESS; + + plugin_context->cur_plugin = plugin_load_and_link( + plugin_context->sched_type, + n_syms, syms, + (void **) &plugin_context->ops); + if (plugin_context->cur_plugin != PLUGIN_INVALID_HANDLE) + return SLURM_SUCCESS; + + error("gres: Couldn't find the specified plugin name for %s " + "looking at all files", + plugin_context->sched_type); + + /* Get plugin list */ + if (plugin_context->plugin_list == NULL) { + char *plugin_dir; + plugin_context->plugin_list = plugrack_create(); + if (plugin_context->plugin_list == NULL) { + error("gres: cannot create plugin manager"); + return SLURM_ERROR; + } + plugrack_set_major_type(plugin_context->plugin_list, + "gres"); + plugrack_set_paranoia(plugin_context->plugin_list, + PLUGRACK_PARANOIA_NONE, 0); + plugin_dir = slurm_get_plugin_dir(); + plugrack_read_dir(plugin_context->plugin_list, plugin_dir); + xfree(plugin_dir); + } + + plugin_context->cur_plugin = plugrack_use_by_type( + plugin_context->plugin_list, + plugin_context->sched_type ); + if (plugin_context->cur_plugin == PLUGIN_INVALID_HANDLE) { + error("gres: cannot find scheduler plugin for %s", + plugin_context->sched_type); + return SLURM_ERROR; + } + + /* Dereference the API. */ + if (plugin_get_syms(plugin_context->cur_plugin, + n_syms, syms, + (void **) &plugin_context->ops ) < n_syms ) { + error("gres: incomplete plugin detected"); + return SLURM_ERROR; + } + return SLURM_SUCCESS; +} + +static int _unload_gres_plugin(slurm_gres_context_t *plugin_context) +{ + int rc; + + /* + * Must check return code here because plugins might still + * be loaded and active. + */ + if (plugin_context->plugin_list) + rc = plugrack_destroy(plugin_context->plugin_list); + else { + rc = SLURM_SUCCESS; + plugin_unload(plugin_context->cur_plugin); + } + xfree(plugin_context->sched_type); + + return rc; +} + +/* + * Initialize the gres plugin. + * + * Returns a SLURM errno. + */ +extern int gres_plugin_init(void) +{ + int rc = SLURM_SUCCESS; + char *last = NULL, *names, *one_name; + + slurm_mutex_lock(&gres_context_lock); + if (gres_context_cnt >= 0) + goto fini; + + gres_plugin_list = slurm_get_gres_plugins(); + gres_context_cnt = 0; + if ((gres_plugin_list == NULL) || (gres_plugin_list[0] == '\0')) + goto fini; + + gres_context_cnt = 0; + names = xstrdup(gres_plugin_list); + one_name = strtok_r(names, ",", &last); + while (one_name) { + xrealloc(gres_context, (sizeof(slurm_gres_context_t) * + (gres_context_cnt + 1))); + rc = _load_gres_plugin(one_name, gres_context+gres_context_cnt); + if (rc != SLURM_SUCCESS) + break; + gres_context_cnt++; + one_name = strtok_r(NULL, ",", &last); + } + xfree(names); + +fini: slurm_mutex_unlock(&gres_context_lock); + return rc; +} + +/* + * Terminate the gres plugin. Free memory. + * + * Returns a SLURM errno. + */ +extern int gres_plugin_fini(void) +{ + int i, j, rc = SLURM_SUCCESS; + + slurm_mutex_lock(&gres_context_lock); + if (gres_context_cnt < 0) + goto fini; + + for (i=0; i<gres_context_cnt; i++) { + j = _unload_gres_plugin(gres_context + i); + if (j != SLURM_SUCCESS) + rc = j; + } + xfree(gres_context); + xfree(gres_plugin_list); + gres_context_cnt = -1; + +fini: slurm_mutex_unlock(&gres_context_lock); + return rc; +} + +/* + ************************************************************************** + * P L U G I N C A L L S * + ************************************************************************** + */ + +/* + * Perform reconfig, re-read any configuration files + */ +extern int gres_plugin_reconfig(void) +{ + int rc = SLURM_SUCCESS; + char *plugin_names = slurm_get_gres_plugins(); + bool plugin_change; + + if (!plugin_names && !gres_plugin_list) + return rc; + + slurm_mutex_lock(&gres_context_lock); + if (plugin_names && gres_plugin_list && + strcmp(plugin_names, gres_plugin_list)) + plugin_change = true; + else + plugin_change = false; + slurm_mutex_unlock(&gres_context_lock); + + if (plugin_change) { + info("GresPlugins changed to %s", plugin_names); + rc = gres_plugin_fini(); + if (rc == SLURM_SUCCESS) + rc = gres_plugin_init(); + } + xfree(plugin_names); + + return rc; +} + +/* + * Provide a plugin-specific help message + * IN/OUT msg - buffer provided by caller and filled in by plugin + * IN msg_size - size of msg in bytes + */ +extern int gres_plugin_help_msg(char *msg, int msg_size) +{ + int i, rc; + char *tmp_msg; + + if (msg_size < 1) + return EINVAL; + msg[0] = '\0'; + tmp_msg = xmalloc(msg_size); + rc = gres_plugin_init(); + + slurm_mutex_lock(&gres_context_lock); + for (i=0; ((i < gres_context_cnt) && (rc == SLURM_SUCCESS)); i++) { + rc = (*(gres_context[i].ops.help_msg))(tmp_msg, msg_size); + if ((rc != SLURM_SUCCESS) || (tmp_msg[0] == '\0')) + continue; + if (msg[0]) + strcat(msg, "\n"); + strcat(msg, tmp_msg); + tmp_msg[0] = '\0'; + } + slurm_mutex_unlock(&gres_context_lock); + + xfree(tmp_msg); + return rc; +} diff --git a/src/common/gres.h b/src/common/gres.h new file mode 100644 index 0000000000000000000000000000000000000000..5d6dd8e9cf9f94137259e3a165d58121be59aa8d --- /dev/null +++ b/src/common/gres.h @@ -0,0 +1,75 @@ +/*****************************************************************************\ + * gres.h - driver for gres plugin + ***************************************************************************** + * Copyright (C) 2010 Lawrence Livermore National Security. + * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). + * Written by Morris Jette <jette1@llnl.gov> + * CODE-OCEC-09-009. All rights reserved. + * + * This file is part of SLURM, a resource management program. + * For details, see <https://computing.llnl.gov/linux/slurm/>. + * 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 + * 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 + * 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 _GRES_H +#define _GRES_H + +#include <slurm/slurm.h> + +/* + * Initialize the gres plugin. + * + * Returns a SLURM errno. + */ +extern int gres_plugin_init(void); + +/* + * Terminate the gres plugin. Free memory. + * + * Returns a SLURM errno. + */ +extern int gres_plugin_fini(void); + +/* + ************************************************************************** + * P L U G I N C A L L S * + ************************************************************************** + */ + +/* + * Perform reconfig, re-read any configuration files + */ +extern int gres_plugin_reconfig(void); + +/* + * Provide a plugin-specific help message + * IN/OUT msg - buffer provided by caller and filled in by plugin + * IN msg_size - size of msg in bytes + */ +extern int gres_plugin_help_msg(char *msg, int msg_size); +#endif /* !_GRES_H */ diff --git a/src/common/node_conf.c b/src/common/node_conf.c index 5b1bee1f131bf50101a09471982a51ffb45f835b..be681e122caf2040a1f6b4b4a769962ffcfe9386 100644 --- a/src/common/node_conf.c +++ b/src/common/node_conf.c @@ -7,7 +7,7 @@ * configuration list (config_list) ***************************************************************************** * Copyright (C) 2002-2007 The Regents of the University of California. - * Copyright (C) 2008-2009 Lawrence Livermore National Security. + * Copyright (C) 2008-2010 Lawrence Livermore National Security. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Morris Jette <jette1@llnl.gov> et. al. * CODE-OCEC-09-009. All rights reserved. @@ -214,9 +214,11 @@ static int _build_single_nodeline_info(slurm_conf_node_t *node_ptr, node_rec->node_state = state_val; node_rec->last_response = (time_t) 0; node_rec->comm_name = xstrdup(address); - - node_rec->port = node_ptr->port; - node_rec->reason = xstrdup(node_ptr->reason); + node_rec->port = node_ptr->port; + node_rec->weight = node_ptr->weight; + node_rec->features = xstrdup(node_ptr->feature); + node_rec->gres = xstrdup(node_ptr->gres); + node_rec->reason = xstrdup(node_ptr->reason); } else { /* FIXME - maybe should be fatal? */ error("reconfiguration for node %s, ignoring!", alias); @@ -489,8 +491,10 @@ extern int build_all_nodeline_info (bool set_bitmap) config_ptr->real_memory = node->real_memory; config_ptr->tmp_disk = node->tmp_disk; config_ptr->weight = node->weight; - if (node->feature) + if (node->feature && node->feature[0]) config_ptr->feature = xstrdup(node->feature); + if (node->gres && node->gres[0]) + config_ptr->gres = xstrdup(node->gres); rc = _build_single_nodeline_info(node, config_ptr); max_rc = MAX(max_rc, rc); @@ -793,6 +797,7 @@ extern void purge_node_rec (struct node_record *node_ptr) xfree(node_ptr->arch); xfree(node_ptr->comm_name); xfree(node_ptr->features); + xfree(node_ptr->gres); xfree(node_ptr->name); xfree(node_ptr->os); xfree(node_ptr->part_pptr); diff --git a/src/common/node_conf.h b/src/common/node_conf.h index bceda0261631a0d477f7c17c96af405c3a871be4..4d0a67e058fd4a2bc640108d4c3469982517c120 100644 --- a/src/common/node_conf.h +++ b/src/common/node_conf.h @@ -3,7 +3,7 @@ * file and work with the corresponding structures ***************************************************************************** * Copyright (C) 2002-2007 The Regents of the University of California. - * Copyright (C) 2008-2009 Lawrence Livermore National Security. + * Copyright (C) 2008-2010 Lawrence Livermore National Security. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Morris Jette <jette1@llnl.gov> et. al. * CODE-OCEC-09-009. All rights reserved. @@ -73,8 +73,9 @@ struct config_record { uint32_t tmp_disk; /* MB total storage in TMP_FS file system */ uint32_t weight; /* arbitrary priority of node for * scheduling work on */ - char *feature; /* arbitrary list of features associated */ + char *feature; /* arbitrary list of node's features */ char **feature_array; /* array of feature names */ + char *gres; /* arbitrary list of node's generic resources */ char *nodes; /* name of nodes with this configuration */ bitstr_t *node_bitmap; /* bitmap of nodes with this configuration */ }; @@ -123,7 +124,10 @@ struct node_record { * set, ignore if no reason is set. */ uint32_t reason_uid; /* User that set the reason, ignore if * no reason is set. */ - char *features; /* associated features, used only + char *features; /* node's features, used only + * for state save/restore, DO NOT + * use for scheduling purposes */ + char *gres; /* node's generic resources, used only * for state save/restore, DO NOT * use for scheduling purposes */ uint32_t weight; /* orignal weight, used only for state diff --git a/src/common/proc_args.c b/src/common/proc_args.c index eb47b1889d3554e41845312ae54f6f2c5ca146af..b48899a802b47f85bb07f2df784217d1e66d116a 100644 --- a/src/common/proc_args.c +++ b/src/common/proc_args.c @@ -71,14 +71,12 @@ #include <sys/types.h> #include <sys/utsname.h> +#include "src/common/gres.h" #include "src/common/list.h" +#include "src/common/proc_args.h" #include "src/common/xmalloc.h" #include "src/common/xstring.h" -#include "src/common/proc_args.h" - - - /* print this version of SLURM */ void print_slurm_version(void) @@ -86,6 +84,18 @@ void print_slurm_version(void) printf("%s %s\n", PACKAGE, SLURM_VERSION_STRING); } +/* print the available gres options */ +void print_gres_help(void) +{ + char help_msg[1024] = ""; + + gres_plugin_help_msg(help_msg, sizeof(help_msg)); + if (help_msg[0]) + printf("%s\n", help_msg); + else + printf("No gres help is available\n"); +} + /* * verify that a distribution type in arg is of a known form * returns the task_dist_states, or -1 if state is unknown diff --git a/src/common/proc_args.h b/src/common/proc_args.h index 201377a0e19f0b931008f333ee5444afe1e71d12..db8f66321ab04f16bba690f28d4981911c41af43 100644 --- a/src/common/proc_args.h +++ b/src/common/proc_args.h @@ -65,6 +65,9 @@ /* print this version of SLURM */ void print_slurm_version(void); +/* print the available gres options */ +void print_gres_help(void); + /* verify the requested distribution type */ task_dist_states_t verify_dist_type(const char *arg, uint32_t *plane_size); diff --git a/src/common/read_config.c b/src/common/read_config.c index 4d70d2a8f91d8f35ee16f65854715fbe27272e12..ae1a0c2bc3cbdcde339ef3e8118bce5c2efbee90 100644 --- a/src/common/read_config.c +++ b/src/common/read_config.c @@ -172,6 +172,7 @@ s_p_options_t slurm_conf_options[] = { {"FastSchedule", S_P_UINT16}, {"FirstJobId", S_P_UINT32}, {"GetEnvTimeout", S_P_UINT16}, + {"GresPlugins", S_P_STRING}, {"GroupUpdateForce", S_P_UINT16}, {"GroupUpdateTime", S_P_UINT16}, {"HashBase", S_P_LONG, _defunct_option}, @@ -409,6 +410,7 @@ static int _parse_nodename(void **dest, slurm_parser_enum_t type, static s_p_options_t _nodename_options[] = { {"CoresPerSocket", S_P_UINT16}, {"Feature", S_P_STRING}, + {"Gres", S_P_STRING}, {"NodeAddr", S_P_STRING}, {"NodeHostname", S_P_STRING}, {"Port", S_P_UINT16}, @@ -477,6 +479,9 @@ static int _parse_nodename(void **dest, slurm_parser_enum_t type, if (!s_p_get_string(&n->feature, "Feature", tbl)) s_p_get_string(&n->feature, "Feature", dflt); + if (!s_p_get_string(&n->gres, "Gres", tbl)) + s_p_get_string(&n->gres, "Gres", dflt); + if (!s_p_get_uint16(&n->port, "Port", tbl) && !s_p_get_uint16(&n->port, "Port", dflt)) { /* This gets resolved in slurm_conf_get_port() @@ -589,6 +594,7 @@ static void _destroy_nodename(void *ptr) xfree(n->hostnames); xfree(n->addresses); xfree(n->feature); + xfree(n->gres); xfree(n->reason); xfree(n->state); xfree(ptr); @@ -1426,6 +1432,7 @@ free_slurm_conf (slurm_ctl_conf_t *ctl_conf_ptr, bool purge_node_hash) xfree (ctl_conf_ptr->crypto_type); xfree (ctl_conf_ptr->epilog); xfree (ctl_conf_ptr->epilog_slurmctld); + xfree (ctl_conf_ptr->gres_plugins); xfree (ctl_conf_ptr->health_check_program); xfree (ctl_conf_ptr->job_acct_gather_type); xfree (ctl_conf_ptr->job_ckpt_dir); @@ -1523,6 +1530,7 @@ init_slurm_conf (slurm_ctl_conf_t *ctl_conf_ptr) ctl_conf_ptr->fast_schedule = (uint16_t) NO_VAL; ctl_conf_ptr->first_job_id = (uint32_t) NO_VAL; ctl_conf_ptr->get_env_timeout = 0; + xfree(ctl_conf_ptr->gres_plugins); ctl_conf_ptr->group_info = (uint16_t) NO_VAL; ctl_conf_ptr->hash_val = (uint32_t) NO_VAL; ctl_conf_ptr->health_check_interval = 0; @@ -1967,6 +1975,8 @@ _validate_and_set_defaults(slurm_ctl_conf_t *conf, s_p_hashtbl_t *hashtbl) if (!s_p_get_uint32(&conf->first_job_id, "FirstJobId", hashtbl)) conf->first_job_id = DEFAULT_FIRST_JOB_ID; + s_p_get_string(&conf->gres_plugins, "GresPlugins", hashtbl); + if (s_p_get_uint16(&conf->inactive_limit, "InactiveLimit", hashtbl)) { #ifdef HAVE_BG /* Inactive limit must be zero on Blue Gene */ diff --git a/src/common/read_config.h b/src/common/read_config.h index 86aa47a6911fe481de86831624fb0e33ca24ce4a..fc01156e55b66b7b225b23db0ae1f439d4a6fdb0 100644 --- a/src/common/read_config.h +++ b/src/common/read_config.h @@ -146,7 +146,8 @@ typedef struct slurm_conf_node { char *nodenames; char *hostnames; char *addresses; - char *feature; /* arbitrary list of features associated */ + char *gres; /* arbitrary list of node's generic resources */ + char *feature; /* arbitrary list of node's features */ uint16_t port; uint16_t cpus; /* count of cpus running on the node */ uint16_t sockets; /* number of sockets per node */ diff --git a/src/common/slurm_errno.c b/src/common/slurm_errno.c index 8bf38d1e25157040c6e5e81ec27a135487e76cfb..34fa60b350f89141749ccc24e73d9c1b07dc6210 100644 --- a/src/common/slurm_errno.c +++ b/src/common/slurm_errno.c @@ -268,6 +268,8 @@ static slurm_errtab_t slurm_errtab[] = { "Required partition not available (inactive or drain)"}, { ESLURM_CIRCULAR_DEPENDENCY, "Circular job dependency" }, + { ESLURM_INVALID_GRES, + "Invalid generic resource (gres) specification" }, /* slurmd error codes */ diff --git a/src/common/slurm_protocol_api.c b/src/common/slurm_protocol_api.c index e9e1384b189b1114573a67d68f5e84dc9b8fee99..4fb4f71a6a55b6f811798e30712c5bfe02706dd7 100644 --- a/src/common/slurm_protocol_api.c +++ b/src/common/slurm_protocol_api.c @@ -947,6 +947,26 @@ char *slurm_get_health_check_program(void) return health_check_program; } +/* slurm_get_gres_plugins + * get gres_plugins from slurmctld_conf object from + * slurmctld_conf object + * RET char * - gres_plugins, MUST be xfreed by caller + */ +char *slurm_get_gres_plugins(void) +{ + char *gres_plugins = NULL; + slurm_ctl_conf_t *conf; + + if(slurmdbd_conf) { + } else { + conf = slurm_conf_lock(); + gres_plugins = xstrdup(conf->gres_plugins); + slurm_conf_unlock(); + } + return gres_plugins; +} + + /* slurm_get_job_submit_plugins * get job_submit_plugins from slurmctld_conf object from * slurmctld_conf object diff --git a/src/common/slurm_protocol_api.h b/src/common/slurm_protocol_api.h index 26d455c58d896051531fe4994a462c4a222e3d84..3a0d22db8a4514b8643ef194d2d5bf892e7d0a57 100644 --- a/src/common/slurm_protocol_api.h +++ b/src/common/slurm_protocol_api.h @@ -196,6 +196,13 @@ uint32_t slurm_get_hash_val(void); */ char *slurm_get_health_check_program(void); +/* slurm_get_gres_plugins + * get gres_plugins from slurmctld_conf object from + * slurmctld_conf object + * RET char * - gres_plugins, MUST be xfreed by caller + */ +char *slurm_get_gres_plugins(void); + /* slurm_get_job_submit_plugins * get job_submit_plugins from slurmctld_conf object from * slurmctld_conf object diff --git a/src/common/slurm_protocol_defs.c b/src/common/slurm_protocol_defs.c index 68091f491d8f8251f1a5af099bf87c778c0a3df6..28afda27fb2b97bf0690d61cad3f4555637b5366 100644 --- a/src/common/slurm_protocol_defs.c +++ b/src/common/slurm_protocol_defs.c @@ -371,6 +371,7 @@ void slurm_free_job_desc_msg(job_desc_msg_t * msg) xfree(msg->std_err); xfree(msg->exc_nodes); xfree(msg->features); + xfree(msg->gres); xfree(msg->std_in); xfree(msg->licenses); xfree(msg->linuximage); @@ -452,6 +453,7 @@ void slurm_free_job_info_members(job_info_t * job) xfree(job->exc_nodes); xfree(job->exc_node_inx); xfree(job->features); + xfree(job->gres); xfree(job->licenses); xfree(job->name); xfree(job->network); @@ -489,6 +491,7 @@ void slurm_free_update_node_msg(update_node_msg_t * msg) { if (msg) { xfree(msg->features); + xfree(msg->gres); xfree(msg->node_names); xfree(msg->reason); xfree(msg); @@ -542,6 +545,7 @@ void slurm_free_job_step_create_request_msg(job_step_create_request_msg_t * msg) { if (msg) { + xfree(msg->gres); xfree(msg->host); xfree(msg->name); xfree(msg->network); diff --git a/src/common/slurm_protocol_defs.h b/src/common/slurm_protocol_defs.h index c84dfb15828f1f22a8089d7aa1ac8e16ba8deed9..5e76bd78ca74f3efa4d3a56fc8cfbbf99c7f156f 100644 --- a/src/common/slurm_protocol_defs.h +++ b/src/common/slurm_protocol_defs.h @@ -558,6 +558,7 @@ typedef struct job_step_specs { char *ckpt_dir; /* path to store checkpoint image files */ uint32_t cpu_count; /* count of required processors */ uint16_t exclusive; /* 1 if CPUs not shared with other steps */ + char *gres; /* generic resources required */ char *host; /* host to contact initiating srun */ uint16_t immediate; /* 1 if allocate to run or fail immediately, * 0 if to be queued awaiting resources */ diff --git a/src/common/slurm_protocol_pack.c b/src/common/slurm_protocol_pack.c index 15706504a34fd23e4af94e332c70bb220acfd8fa..a215c826fffd60a529445a02d0430856b135dea1 100644 --- a/src/common/slurm_protocol_pack.c +++ b/src/common/slurm_protocol_pack.c @@ -2006,6 +2006,7 @@ _pack_update_node_msg(update_node_msg_t * msg, Buf buffer, packstr(msg->node_names, buffer); pack16(msg->node_state, buffer); packstr(msg->features, buffer); + packstr(msg->gres, buffer); packstr(msg->reason, buffer); pack32(msg->weight, buffer); pack32(msg->reason_uid, buffer); @@ -2035,6 +2036,7 @@ _unpack_update_node_msg(update_node_msg_t ** msg, Buf buffer, &uint32_tmp, buffer); safe_unpack16(&tmp_ptr->node_state, buffer); safe_unpackstr_xmalloc(&tmp_ptr->features, &uint32_tmp, buffer); + safe_unpackstr_xmalloc(&tmp_ptr->gres, &uint32_tmp, buffer); safe_unpackstr_xmalloc(&tmp_ptr->reason, &uint32_tmp, buffer); safe_unpack32(&tmp_ptr->weight, buffer); safe_unpack32(&tmp_ptr->reason_uid, buffer); @@ -2531,6 +2533,7 @@ _unpack_node_info_members(node_info_t * node, Buf buffer, safe_unpackstr_xmalloc(&node->arch, &uint32_tmp, buffer); safe_unpackstr_xmalloc(&node->features, &uint32_tmp, buffer); + safe_unpackstr_xmalloc(&node->gres, &uint32_tmp, buffer); safe_unpackstr_xmalloc(&node->os, &uint32_tmp, buffer); safe_unpackstr_xmalloc(&node->reason, &uint32_tmp, buffer); } else { @@ -2876,6 +2879,7 @@ _pack_job_step_create_request_msg(job_step_create_request_msg_t packstr(msg->network, buffer); packstr(msg->node_list, buffer); packstr(msg->ckpt_dir, buffer); + packstr(msg->gres, buffer); pack8(msg->no_kill, buffer); pack8(msg->overcommit, buffer); @@ -2949,6 +2953,7 @@ _unpack_job_step_create_request_msg(job_step_create_request_msg_t ** msg, buffer); safe_unpackstr_xmalloc(&(tmp_ptr->ckpt_dir), &uint32_tmp, buffer); + safe_unpackstr_xmalloc(&(tmp_ptr->gres), &uint32_tmp, buffer); safe_unpack8(&(tmp_ptr->no_kill), buffer); safe_unpack8(&(tmp_ptr->overcommit), buffer); @@ -3416,17 +3421,44 @@ _unpack_job_step_info_members(job_step_info_t * step, Buf buffer, uint32_t uint32_tmp = 0; char *node_inx_str; - if(protocol_version >= SLURM_2_1_PROTOCOL_VERSION) { + if(protocol_version >= SLURM_2_2_PROTOCOL_VERSION) { safe_unpack32(&step->job_id, buffer); safe_unpack32(&step->step_id, buffer); safe_unpack16(&step->ckpt_interval, buffer); safe_unpack32(&step->user_id, buffer); safe_unpack32(&step->num_cpus, buffer); safe_unpack32(&step->num_tasks, buffer); + safe_unpack32(&step->time_limit, buffer); + + safe_unpack_time(&step->start_time, buffer); + safe_unpack_time(&step->run_time, buffer); + safe_unpackstr_xmalloc(&step->partition, &uint32_tmp, buffer); + safe_unpackstr_xmalloc(&step->resv_ports, &uint32_tmp, buffer); + safe_unpackstr_xmalloc(&step->nodes, &uint32_tmp, buffer); + safe_unpackstr_xmalloc(&step->name, &uint32_tmp, buffer); + safe_unpackstr_xmalloc(&step->network, &uint32_tmp, buffer); + safe_unpackstr_xmalloc(&node_inx_str, &uint32_tmp, buffer); + safe_unpackstr_xmalloc(&step->ckpt_dir, &uint32_tmp, buffer); + safe_unpackstr_xmalloc(&step->gres, &uint32_tmp, buffer); + if (node_inx_str == NULL) + step->node_inx = bitfmt2int(""); + else { + step->node_inx = bitfmt2int(node_inx_str); + xfree(node_inx_str); + } + } else { + safe_unpack32(&step->job_id, buffer); + safe_unpack32(&step->step_id, buffer); + safe_unpack16(&step->ckpt_interval, buffer); + safe_unpack32(&step->user_id, buffer); + safe_unpack32(&step->num_cpus, buffer); + safe_unpack32(&step->num_tasks, buffer); safe_unpack32(&step->time_limit, buffer); + safe_unpack_time(&step->start_time, buffer); safe_unpack_time(&step->run_time, buffer); + safe_unpackstr_xmalloc(&step->partition, &uint32_tmp, buffer); safe_unpackstr_xmalloc(&step->resv_ports, &uint32_tmp, buffer); safe_unpackstr_xmalloc(&step->nodes, &uint32_tmp, buffer); @@ -3564,6 +3596,7 @@ _unpack_job_info_members(job_info_t * job, Buf buffer, safe_unpackstr_xmalloc(&job->account, &uint32_tmp, buffer); safe_unpackstr_xmalloc(&job->network, &uint32_tmp, buffer); safe_unpackstr_xmalloc(&job->comment, &uint32_tmp, buffer); + safe_unpackstr_xmalloc(&job->gres, &uint32_tmp, buffer); safe_unpackstr_xmalloc(&job->qos, &uint32_tmp, buffer); safe_unpackstr_xmalloc(&job->licenses, &uint32_tmp, buffer); safe_unpackstr_xmalloc(&job->state_desc, &uint32_tmp, buffer); @@ -3794,6 +3827,7 @@ _pack_slurm_ctl_conf_msg(slurm_ctl_conf_info_msg_t * build_ptr, Buf buffer, pack32(build_ptr->first_job_id, buffer); pack16(build_ptr->get_env_timeout, buffer); + packstr(build_ptr->gres_plugins, buffer); pack16(build_ptr->group_info, buffer); pack32(build_ptr->hash_val, buffer); @@ -4218,6 +4252,8 @@ _unpack_slurm_ctl_conf_msg(slurm_ctl_conf_info_msg_t **build_buffer_ptr, safe_unpack32(&build_ptr->first_job_id, buffer); safe_unpack16(&build_ptr->get_env_timeout, buffer); + safe_unpackstr_xmalloc(&build_ptr->gres_plugins, + &uint32_tmp, buffer); safe_unpack16(&build_ptr->group_info, buffer); safe_unpack32(&build_ptr->hash_val, buffer); @@ -4717,6 +4753,7 @@ _pack_job_desc_msg(job_desc_msg_t * job_desc_ptr, Buf buffer, pack16(job_desc_ptr->task_dist, buffer); pack16(job_desc_ptr->kill_on_node_fail, buffer); packstr(job_desc_ptr->features, buffer); + packstr(job_desc_ptr->gres, buffer); pack32(job_desc_ptr->job_id, buffer); packstr(job_desc_ptr->name, buffer); @@ -5019,6 +5056,7 @@ _unpack_job_desc_msg(job_desc_msg_t ** job_desc_buffer_ptr, Buf buffer, safe_unpack16(&job_desc_ptr->kill_on_node_fail, buffer); safe_unpackstr_xmalloc(&job_desc_ptr->features, &uint32_tmp, buffer); + safe_unpackstr_xmalloc(&job_desc_ptr->gres, &uint32_tmp,buffer); safe_unpack32(&job_desc_ptr->job_id, buffer); safe_unpackstr_xmalloc(&job_desc_ptr->name, &uint32_tmp, buffer); diff --git a/src/plugins/Makefile.am b/src/plugins/Makefile.am index dad6c3e8409233fcf797f836dc70f6d26da9f39d..c17ce381816f32cf25b779636605c0ce42223b62 100644 --- a/src/plugins/Makefile.am +++ b/src/plugins/Makefile.am @@ -3,6 +3,7 @@ SUBDIRS = \ auth \ checkpoint \ crypto \ + gres \ jobacct_gather \ jobcomp \ job_submit \ diff --git a/src/plugins/Makefile.in b/src/plugins/Makefile.in index edfd40733e8d71b175258791260ec34de36a3362..6ddb4dc359bcf6ecf511692343f07ba8982e60a2 100644 --- a/src/plugins/Makefile.in +++ b/src/plugins/Makefile.in @@ -309,6 +309,7 @@ SUBDIRS = \ auth \ checkpoint \ crypto \ + gres \ jobacct_gather \ jobcomp \ job_submit \ diff --git a/src/plugins/gres/Makefile.am b/src/plugins/gres/Makefile.am new file mode 100644 index 0000000000000000000000000000000000000000..86865a3d6e8679b9b9a4f8458fa8c72aa17647d6 --- /dev/null +++ b/src/plugins/gres/Makefile.am @@ -0,0 +1,3 @@ +# Makefile for gres plugins + +SUBDIRS = gpu diff --git a/src/plugins/gres/Makefile.in b/src/plugins/gres/Makefile.in new file mode 100644 index 0000000000000000000000000000000000000000..f47b5b054cf403ae68eea4f3cba777da46781d94 --- /dev/null +++ b/src/plugins/gres/Makefile.in @@ -0,0 +1,659 @@ +# Makefile.in generated by automake 1.11 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +# Makefile for gres plugins +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +target_triplet = @target@ +subdir = src/plugins/gres +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.m4 \ + $(top_srcdir)/auxdir/libtool.m4 \ + $(top_srcdir)/auxdir/ltoptions.m4 \ + $(top_srcdir)/auxdir/ltsugar.m4 \ + $(top_srcdir)/auxdir/ltversion.m4 \ + $(top_srcdir)/auxdir/lt~obsolete.m4 \ + $(top_srcdir)/auxdir/slurm.m4 \ + $(top_srcdir)/auxdir/x_ac__system_configuration.m4 \ + $(top_srcdir)/auxdir/x_ac_affinity.m4 \ + $(top_srcdir)/auxdir/x_ac_aix.m4 \ + $(top_srcdir)/auxdir/x_ac_blcr.m4 \ + $(top_srcdir)/auxdir/x_ac_bluegene.m4 \ + $(top_srcdir)/auxdir/x_ac_cflags.m4 \ + $(top_srcdir)/auxdir/x_ac_cray.m4 \ + $(top_srcdir)/auxdir/x_ac_databases.m4 \ + $(top_srcdir)/auxdir/x_ac_debug.m4 \ + $(top_srcdir)/auxdir/x_ac_elan.m4 \ + $(top_srcdir)/auxdir/x_ac_env.m4 \ + $(top_srcdir)/auxdir/x_ac_federation.m4 \ + $(top_srcdir)/auxdir/x_ac_gpl_licensed.m4 \ + $(top_srcdir)/auxdir/x_ac_iso.m4 \ + $(top_srcdir)/auxdir/x_ac_lua.m4 \ + $(top_srcdir)/auxdir/x_ac_munge.m4 \ + $(top_srcdir)/auxdir/x_ac_ncurses.m4 \ + $(top_srcdir)/auxdir/x_ac_pam.m4 \ + $(top_srcdir)/auxdir/x_ac_printf_null.m4 \ + $(top_srcdir)/auxdir/x_ac_ptrace.m4 \ + $(top_srcdir)/auxdir/x_ac_readline.m4 \ + $(top_srcdir)/auxdir/x_ac_setpgrp.m4 \ + $(top_srcdir)/auxdir/x_ac_setproctitle.m4 \ + $(top_srcdir)/auxdir/x_ac_sgi_job.m4 \ + $(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \ + $(top_srcdir)/auxdir/x_ac_sun_const.m4 \ + $(top_srcdir)/auxdir/x_ac_xcpu.m4 $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h $(top_builddir)/slurm/slurm.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +SOURCES = +DIST_SOURCES = +RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ + html-recursive info-recursive install-data-recursive \ + install-dvi-recursive install-exec-recursive \ + install-html-recursive install-info-recursive \ + install-pdf-recursive install-ps-recursive install-recursive \ + installcheck-recursive installdirs-recursive pdf-recursive \ + ps-recursive uninstall-recursive +RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ + distclean-recursive maintainer-clean-recursive +AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ + $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ + distdir +ETAGS = etags +CTAGS = ctags +DIST_SUBDIRS = $(SUBDIRS) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +am__relativize = \ + dir0=`pwd`; \ + sed_first='s,^\([^/]*\)/.*$$,\1,'; \ + sed_rest='s,^[^/]*/*,,'; \ + sed_last='s,^.*/\([^/]*\)$$,\1,'; \ + sed_butlast='s,/*[^/]*$$,,'; \ + while test -n "$$dir1"; do \ + first=`echo "$$dir1" | sed -e "$$sed_first"`; \ + if test "$$first" != "."; then \ + if test "$$first" = ".."; then \ + dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ + dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ + else \ + first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ + if test "$$first2" = "$$first"; then \ + dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ + else \ + dir2="../$$dir2"; \ + fi; \ + dir0="$$dir0"/"$$first"; \ + fi; \ + fi; \ + dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ + done; \ + reldir="$$dir2" +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTHD_CFLAGS = @AUTHD_CFLAGS@ +AUTHD_LIBS = @AUTHD_LIBS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BG_INCLUDES = @BG_INCLUDES@ +BLCR_CPPFLAGS = @BLCR_CPPFLAGS@ +BLCR_HOME = @BLCR_HOME@ +BLCR_LDFLAGS = @BLCR_LDFLAGS@ +BLCR_LIBS = @BLCR_LIBS@ +BLUEGENE_LOADED = @BLUEGENE_LOADED@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CMD_LDFLAGS = @CMD_LDFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +ELAN_LIBS = @ELAN_LIBS@ +EXEEXT = @EXEEXT@ +FEDERATION_LDFLAGS = @FEDERATION_LDFLAGS@ +FGREP = @FGREP@ +GREP = @GREP@ +GTK_CFLAGS = @GTK_CFLAGS@ +GTK_LIBS = @GTK_LIBS@ +HAVEMYSQLCONFIG = @HAVEMYSQLCONFIG@ +HAVEPGCONFIG = @HAVEPGCONFIG@ +HAVE_AIX = @HAVE_AIX@ +HAVE_ELAN = @HAVE_ELAN@ +HAVE_FEDERATION = @HAVE_FEDERATION@ +HAVE_OPENSSL = @HAVE_OPENSSL@ +HAVE_SOME_CURSES = @HAVE_SOME_CURSES@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIB_LDFLAGS = @LIB_LDFLAGS@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +MUNGE_CPPFLAGS = @MUNGE_CPPFLAGS@ +MUNGE_LDFLAGS = @MUNGE_LDFLAGS@ +MUNGE_LIBS = @MUNGE_LIBS@ +MYSQL_CFLAGS = @MYSQL_CFLAGS@ +MYSQL_LIBS = @MYSQL_LIBS@ +NCURSES = @NCURSES@ +NM = @NM@ +NMEDIT = @NMEDIT@ +NUMA_LIBS = @NUMA_LIBS@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PAM_DIR = @PAM_DIR@ +PAM_LIBS = @PAM_LIBS@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PGSQL_CFLAGS = @PGSQL_CFLAGS@ +PGSQL_LIBS = @PGSQL_LIBS@ +PKG_CONFIG = @PKG_CONFIG@ +PROCTRACKDIR = @PROCTRACKDIR@ +PROJECT = @PROJECT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ +RANLIB = @RANLIB@ +READLINE_LIBS = @READLINE_LIBS@ +RELEASE = @RELEASE@ +SED = @SED@ +SEMAPHORE_LIBS = @SEMAPHORE_LIBS@ +SEMAPHORE_SOURCES = @SEMAPHORE_SOURCES@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SLURMCTLD_PORT = @SLURMCTLD_PORT@ +SLURMDBD_PORT = @SLURMDBD_PORT@ +SLURMD_PORT = @SLURMD_PORT@ +SLURM_API_AGE = @SLURM_API_AGE@ +SLURM_API_CURRENT = @SLURM_API_CURRENT@ +SLURM_API_MAJOR = @SLURM_API_MAJOR@ +SLURM_API_REVISION = @SLURM_API_REVISION@ +SLURM_API_VERSION = @SLURM_API_VERSION@ +SLURM_MAJOR = @SLURM_MAJOR@ +SLURM_MICRO = @SLURM_MICRO@ +SLURM_MINOR = @SLURM_MINOR@ +SLURM_PREFIX = @SLURM_PREFIX@ +SLURM_VERSION_NUMBER = @SLURM_VERSION_NUMBER@ +SLURM_VERSION_STRING = @SLURM_VERSION_STRING@ +SO_LDFLAGS = @SO_LDFLAGS@ +SSL_CPPFLAGS = @SSL_CPPFLAGS@ +SSL_LDFLAGS = @SSL_LDFLAGS@ +SSL_LIBS = @SSL_LIBS@ +STRIP = @STRIP@ +UTIL_LIBS = @UTIL_LIBS@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ +lua_CFLAGS = @lua_CFLAGS@ +lua_LIBS = @lua_LIBS@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target = @target@ +target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +SUBDIRS = gpu +all: all-recursive + +.SUFFIXES: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/plugins/gres/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu src/plugins/gres/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +# This directory's subdirectories are mostly independent; you can cd +# into them and run `make' without going through this Makefile. +# To change the values of `make' variables: instead of editing Makefiles, +# (1) if the variable is set in `config.status', edit `config.status' +# (which will cause the Makefiles to be regenerated when you run `make'); +# (2) otherwise, pass the desired values on the `make' command line. +$(RECURSIVE_TARGETS): + @failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + dot_seen=yes; \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" + +$(RECURSIVE_CLEAN_TARGETS): + @failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + dot_seen=no; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + rev=''; for subdir in $$list; do \ + if test "$$subdir" = "."; then :; else \ + rev="$$subdir $$rev"; \ + fi; \ + done; \ + rev="$$rev ."; \ + target=`echo $@ | sed s/-recursive//`; \ + for subdir in $$rev; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done && test -z "$$fail" +tags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ + done +ctags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ + done + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + set x; \ + here=`pwd`; \ + if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ + include_option=--etags-include; \ + empty_fix=.; \ + else \ + include_option=--include; \ + empty_fix=; \ + fi; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test ! -f $$subdir/TAGS || \ + set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ + fi; \ + done; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: CTAGS +CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ + fi; \ + done + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ + $(am__relativize); \ + new_distdir=$$reldir; \ + dir1=$$subdir; dir2="$(top_distdir)"; \ + $(am__relativize); \ + new_top_distdir=$$reldir; \ + echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ + echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ + ($(am__cd) $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$$new_top_distdir" \ + distdir="$$new_distdir" \ + am__remove_distdir=: \ + am__skip_length_check=: \ + am__skip_mode_fix=: \ + distdir) \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-recursive +all-am: Makefile +installdirs: installdirs-recursive +installdirs-am: +install: install-recursive +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-recursive +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-recursive + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-recursive + -rm -f Makefile +distclean-am: clean-am distclean-generic distclean-tags + +dvi: dvi-recursive + +dvi-am: + +html: html-recursive + +html-am: + +info: info-recursive + +info-am: + +install-data-am: + +install-dvi: install-dvi-recursive + +install-dvi-am: + +install-exec-am: + +install-html: install-html-recursive + +install-html-am: + +install-info: install-info-recursive + +install-info-am: + +install-man: + +install-pdf: install-pdf-recursive + +install-pdf-am: + +install-ps: install-ps-recursive + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-recursive + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-recursive + +pdf-am: + +ps: ps-recursive + +ps-am: + +uninstall-am: + +.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \ + install-am install-strip tags-recursive + +.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ + all all-am check check-am clean clean-generic clean-libtool \ + ctags ctags-recursive distclean distclean-generic \ + distclean-libtool distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs installdirs-am maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \ + uninstall uninstall-am + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/src/plugins/gres/gpu/Makefile.am b/src/plugins/gres/gpu/Makefile.am new file mode 100644 index 0000000000000000000000000000000000000000..6eeda8494a8e7628bd3544bc9d342c11b001b11d --- /dev/null +++ b/src/plugins/gres/gpu/Makefile.am @@ -0,0 +1,13 @@ +# Makefile for gres/gpu plugin + +AUTOMAKE_OPTIONS = foreign + +PLUGIN_FLAGS = -module -avoid-version --export-dynamic + +INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/src/common + +pkglib_LTLIBRARIES = gres_gpu.la + +# Gres GPU plugin. +gres_gpu_la_SOURCES = gres_gpu.c +gres_gpu_la_LDFLAGS = $(SO_LDFLAGS) $(PLUGIN_FLAGS) diff --git a/src/plugins/gres/gpu/Makefile.in b/src/plugins/gres/gpu/Makefile.in new file mode 100644 index 0000000000000000000000000000000000000000..d56ea1f9c38d85d055b1cb9ff9c2beb7453fdf05 --- /dev/null +++ b/src/plugins/gres/gpu/Makefile.in @@ -0,0 +1,629 @@ +# Makefile.in generated by automake 1.11 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +# Makefile for gres/gpu plugin + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +target_triplet = @target@ +subdir = src/plugins/gres/gpu +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.m4 \ + $(top_srcdir)/auxdir/libtool.m4 \ + $(top_srcdir)/auxdir/ltoptions.m4 \ + $(top_srcdir)/auxdir/ltsugar.m4 \ + $(top_srcdir)/auxdir/ltversion.m4 \ + $(top_srcdir)/auxdir/lt~obsolete.m4 \ + $(top_srcdir)/auxdir/slurm.m4 \ + $(top_srcdir)/auxdir/x_ac__system_configuration.m4 \ + $(top_srcdir)/auxdir/x_ac_affinity.m4 \ + $(top_srcdir)/auxdir/x_ac_aix.m4 \ + $(top_srcdir)/auxdir/x_ac_blcr.m4 \ + $(top_srcdir)/auxdir/x_ac_bluegene.m4 \ + $(top_srcdir)/auxdir/x_ac_cflags.m4 \ + $(top_srcdir)/auxdir/x_ac_cray.m4 \ + $(top_srcdir)/auxdir/x_ac_databases.m4 \ + $(top_srcdir)/auxdir/x_ac_debug.m4 \ + $(top_srcdir)/auxdir/x_ac_elan.m4 \ + $(top_srcdir)/auxdir/x_ac_env.m4 \ + $(top_srcdir)/auxdir/x_ac_federation.m4 \ + $(top_srcdir)/auxdir/x_ac_gpl_licensed.m4 \ + $(top_srcdir)/auxdir/x_ac_iso.m4 \ + $(top_srcdir)/auxdir/x_ac_lua.m4 \ + $(top_srcdir)/auxdir/x_ac_munge.m4 \ + $(top_srcdir)/auxdir/x_ac_ncurses.m4 \ + $(top_srcdir)/auxdir/x_ac_pam.m4 \ + $(top_srcdir)/auxdir/x_ac_printf_null.m4 \ + $(top_srcdir)/auxdir/x_ac_ptrace.m4 \ + $(top_srcdir)/auxdir/x_ac_readline.m4 \ + $(top_srcdir)/auxdir/x_ac_setpgrp.m4 \ + $(top_srcdir)/auxdir/x_ac_setproctitle.m4 \ + $(top_srcdir)/auxdir/x_ac_sgi_job.m4 \ + $(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \ + $(top_srcdir)/auxdir/x_ac_sun_const.m4 \ + $(top_srcdir)/auxdir/x_ac_xcpu.m4 $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h $(top_builddir)/slurm/slurm.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__installdirs = "$(DESTDIR)$(pkglibdir)" +LTLIBRARIES = $(pkglib_LTLIBRARIES) +gres_gpu_la_LIBADD = +am_gres_gpu_la_OBJECTS = gres_gpu.lo +gres_gpu_la_OBJECTS = $(am_gres_gpu_la_OBJECTS) +gres_gpu_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(gres_gpu_la_LDFLAGS) $(LDFLAGS) -o $@ +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) -I$(top_builddir)/slurm +depcomp = $(SHELL) $(top_srcdir)/auxdir/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +SOURCES = $(gres_gpu_la_SOURCES) +DIST_SOURCES = $(gres_gpu_la_SOURCES) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTHD_CFLAGS = @AUTHD_CFLAGS@ +AUTHD_LIBS = @AUTHD_LIBS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BG_INCLUDES = @BG_INCLUDES@ +BLCR_CPPFLAGS = @BLCR_CPPFLAGS@ +BLCR_HOME = @BLCR_HOME@ +BLCR_LDFLAGS = @BLCR_LDFLAGS@ +BLCR_LIBS = @BLCR_LIBS@ +BLUEGENE_LOADED = @BLUEGENE_LOADED@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CMD_LDFLAGS = @CMD_LDFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +ELAN_LIBS = @ELAN_LIBS@ +EXEEXT = @EXEEXT@ +FEDERATION_LDFLAGS = @FEDERATION_LDFLAGS@ +FGREP = @FGREP@ +GREP = @GREP@ +GTK_CFLAGS = @GTK_CFLAGS@ +GTK_LIBS = @GTK_LIBS@ +HAVEMYSQLCONFIG = @HAVEMYSQLCONFIG@ +HAVEPGCONFIG = @HAVEPGCONFIG@ +HAVE_AIX = @HAVE_AIX@ +HAVE_ELAN = @HAVE_ELAN@ +HAVE_FEDERATION = @HAVE_FEDERATION@ +HAVE_OPENSSL = @HAVE_OPENSSL@ +HAVE_SOME_CURSES = @HAVE_SOME_CURSES@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIB_LDFLAGS = @LIB_LDFLAGS@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +MUNGE_CPPFLAGS = @MUNGE_CPPFLAGS@ +MUNGE_LDFLAGS = @MUNGE_LDFLAGS@ +MUNGE_LIBS = @MUNGE_LIBS@ +MYSQL_CFLAGS = @MYSQL_CFLAGS@ +MYSQL_LIBS = @MYSQL_LIBS@ +NCURSES = @NCURSES@ +NM = @NM@ +NMEDIT = @NMEDIT@ +NUMA_LIBS = @NUMA_LIBS@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PAM_DIR = @PAM_DIR@ +PAM_LIBS = @PAM_LIBS@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PGSQL_CFLAGS = @PGSQL_CFLAGS@ +PGSQL_LIBS = @PGSQL_LIBS@ +PKG_CONFIG = @PKG_CONFIG@ +PROCTRACKDIR = @PROCTRACKDIR@ +PROJECT = @PROJECT@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ +RANLIB = @RANLIB@ +READLINE_LIBS = @READLINE_LIBS@ +RELEASE = @RELEASE@ +SED = @SED@ +SEMAPHORE_LIBS = @SEMAPHORE_LIBS@ +SEMAPHORE_SOURCES = @SEMAPHORE_SOURCES@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SLURMCTLD_PORT = @SLURMCTLD_PORT@ +SLURMDBD_PORT = @SLURMDBD_PORT@ +SLURMD_PORT = @SLURMD_PORT@ +SLURM_API_AGE = @SLURM_API_AGE@ +SLURM_API_CURRENT = @SLURM_API_CURRENT@ +SLURM_API_MAJOR = @SLURM_API_MAJOR@ +SLURM_API_REVISION = @SLURM_API_REVISION@ +SLURM_API_VERSION = @SLURM_API_VERSION@ +SLURM_MAJOR = @SLURM_MAJOR@ +SLURM_MICRO = @SLURM_MICRO@ +SLURM_MINOR = @SLURM_MINOR@ +SLURM_PREFIX = @SLURM_PREFIX@ +SLURM_VERSION_NUMBER = @SLURM_VERSION_NUMBER@ +SLURM_VERSION_STRING = @SLURM_VERSION_STRING@ +SO_LDFLAGS = @SO_LDFLAGS@ +SSL_CPPFLAGS = @SSL_CPPFLAGS@ +SSL_LDFLAGS = @SSL_LDFLAGS@ +SSL_LIBS = @SSL_LIBS@ +STRIP = @STRIP@ +UTIL_LIBS = @UTIL_LIBS@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ +lua_CFLAGS = @lua_CFLAGS@ +lua_LIBS = @lua_LIBS@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target = @target@ +target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +AUTOMAKE_OPTIONS = foreign +PLUGIN_FLAGS = -module -avoid-version --export-dynamic +INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/src/common +pkglib_LTLIBRARIES = gres_gpu.la + +# Gres GPU plugin. +gres_gpu_la_SOURCES = gres_gpu.c +gres_gpu_la_LDFLAGS = $(SO_LDFLAGS) $(PLUGIN_FLAGS) +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/plugins/gres/gpu/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign src/plugins/gres/gpu/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): +install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES) + @$(NORMAL_INSTALL) + test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" + @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ + list2=; for p in $$list; do \ + if test -f $$p; then \ + list2="$$list2 $$p"; \ + else :; fi; \ + done; \ + test -z "$$list2" || { \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \ + } + +uninstall-pkglibLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ + for p in $$list; do \ + $(am__strip_dir) \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \ + done + +clean-pkglibLTLIBRARIES: + -test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES) + @list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \ + dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ + test "$$dir" != "$$p" || dir=.; \ + echo "rm -f \"$${dir}/so_locations\""; \ + rm -f "$${dir}/so_locations"; \ + done +gres_gpu.la: $(gres_gpu_la_OBJECTS) $(gres_gpu_la_DEPENDENCIES) + $(gres_gpu_la_LINK) -rpath $(pkglibdir) $(gres_gpu_la_OBJECTS) $(gres_gpu_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gres_gpu.Plo@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c $< + +.c.obj: +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + set x; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(LTLIBRARIES) +installdirs: + for dir in "$(DESTDIR)$(pkglibdir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool clean-pkglibLTLIBRARIES \ + mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: install-pkglibLTLIBRARIES + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-pkglibLTLIBRARIES + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libtool clean-pkglibLTLIBRARIES ctags distclean \ + distclean-compile distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-pkglibLTLIBRARIES \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags uninstall uninstall-am uninstall-pkglibLTLIBRARIES + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/src/plugins/gres/gpu/gres_gpu.c b/src/plugins/gres/gpu/gres_gpu.c new file mode 100644 index 0000000000000000000000000000000000000000..cef50caffbe607012d6f8c243e41078926eda536 --- /dev/null +++ b/src/plugins/gres/gpu/gres_gpu.c @@ -0,0 +1,112 @@ +/*****************************************************************************\ + * gres_gpu.c - Support GPUs as a generic resources. + ***************************************************************************** + * Copyright (C) 2010 Lawrence Livermore National Security. + * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). + * Written by Morris Jette <jette1@llnl.gov> + * CODE-OCEC-09-009. All rights reserved. + * + * This file is part of SLURM, a resource management program. + * For details, see <https://computing.llnl.gov/linux/slurm/>. + * 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 + * 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 + * 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 "config.h" +# if STDC_HEADERS +# include <string.h> +# endif +# if HAVE_SYS_TYPES_H +# include <sys/types.h> +# endif /* HAVE_SYS_TYPES_H */ +# if HAVE_UNISTD_H +# include <unistd.h> +# endif +# if HAVE_INTTYPES_H +# include <inttypes.h> +# else /* ! HAVE_INTTYPES_H */ +# if HAVE_STDINT_H +# include <stdint.h> +# endif +# endif /* HAVE_INTTYPES_H */ +#else /* ! HAVE_CONFIG_H */ +# include <sys/types.h> +# include <unistd.h> +# include <stdint.h> +# include <string.h> +#endif /* HAVE_CONFIG_H */ + +#include <stdio.h> + +#include <slurm/slurm.h> +#include <slurm/slurm_errno.h> +#include "src/common/slurm_xlator.h" +#include "src/slurmctld/slurmctld.h" + +/* + * These variables are required by the generic plugin interface. If they + * are not found in the plugin, the plugin loader will ignore it. + * + * plugin_name - a string giving a human-readable description of the + * plugin. There is no maximum length, but the symbol must refer to + * a valid string. + * + * plugin_type - a string suggesting the type of the plugin or its + * applicability to a particular form of data or method of data handling. + * If the low-level plugin API is used, the contents of this string are + * unimportant and may be anything. SLURM uses the higher-level plugin + * interface which requires this string to be of the form + * + * <application>/<method> + * + * where <application> is a description of the intended application of + * the plugin (e.g., "auth" for SLURM authentication) and <method> is a + * description of how this plugin satisfies that application. SLURM will + * only load authentication plugins if the plugin_type string has a prefix + * of "auth/". + * + * plugin_version - specifies the version number of the plugin. + * min_plug_version - specifies the minumum version number of incoming + * messages that this plugin can accept + */ +const char plugin_name[] = "Gres GPU plugin"; +const char plugin_type[] = "gres/gpu"; +const uint32_t plugin_version = 100; +const uint32_t min_plug_version = 100; + +extern int help_msg (char *msg, int msg_size) +{ + char *response = "gpu[:count[*cpu]]"; + int resp_len = strlen(response) + 1; + + if (msg_size < resp_len) + return SLURM_ERROR; + + memcpy(msg, response, resp_len); + return SLURM_SUCCESS; +} diff --git a/src/salloc/opt.c b/src/salloc/opt.c index c1afa41bfb778322d308f9ce96a97a311d3b5ab6..939e3561bc44269b319f9d172450b811081f36c6 100644 --- a/src/salloc/opt.c +++ b/src/salloc/opt.c @@ -158,6 +158,7 @@ #define LONG_OPT_RESERVATION 0x13e #define LONG_OPT_SIGNAL 0x13f #define LONG_OPT_TIME_MIN 0x140 +#define LONG_OPT_GRES 0x141 /*---- global variables, defined in opt.h ----*/ opt_t opt; @@ -329,6 +330,7 @@ static void _opt_default() opt.hold = false; opt.constraints = NULL; + opt.gres = NULL; opt.contiguous = false; opt.nodelist = NULL; opt.exc_nodes = NULL; @@ -612,6 +614,7 @@ void set_options(const int argc, char **argv) {"exclusive", no_argument, 0, LONG_OPT_EXCLUSIVE}, {"get-user-env", optional_argument, 0, LONG_OPT_GET_USER_ENV}, {"gid", required_argument, 0, LONG_OPT_GID}, + {"gres", required_argument, 0, LONG_OPT_GRES}, {"hint", required_argument, 0, LONG_OPT_HINT}, {"ioload-image", required_argument, 0, LONG_OPT_RAMDISK_IMAGE}, {"jobid", required_argument, 0, LONG_OPT_JOBID}, @@ -1086,6 +1089,14 @@ void set_options(const int argc, char **argv) xfree(opt.time_min_str); opt.time_min_str = xstrdup(optarg); break; + case LONG_OPT_GRES: + if (!strcasecmp(optarg, "help")) { + print_gres_help(); + exit(0); + } + xfree(opt.gres); + opt.gres = xstrdup(optarg); + break; default: if (spank_process_option(opt_char, optarg) < 0) { error("Unrecognized command line parameter %c", @@ -1631,6 +1642,8 @@ static void _opt_list() info("account : %s", opt.account); info("comment : %s", opt.comment); info("dependency : %s", opt.dependency); + if (opt.gres != NULL) + info("gres : %s", opt.gres); info("network : %s", opt.network); info("qos : %s", opt.qos); str = print_constraints(); @@ -1711,7 +1724,7 @@ static void _usage(void) " [--nodefile=file] [--nodelist=hosts] [--exclude=hosts]\n" " [--network=type] [--mem-per-cpu=MB] [--qos=qos]\n" " [--cpu_bind=...] [--mem_bind=...] [--reservation=name]\n" -" [--time-min=minutes]\n" +" [--time-min=minutes] [--gres=list]\n" " [executable [args...]]\n"); } @@ -1732,6 +1745,7 @@ static void _help(void) " -D, --chdir=path change working directory\n" " --get-user-env used by Moab. See srun man page.\n" " --gid=group_id group ID to run job as (user root only)\n" +" --gres=list required generic resources\n" " -H, --hold submit job in held state\n" " -I, --immediate[=secs] exit if resources not available in \"secs\"\n" " --jobid=id specify jobid to use\n" diff --git a/src/salloc/opt.h b/src/salloc/opt.h index 22cf9ccf66efcf9eefcb0e28533f3972134e4ebb..f54a5d71f8b6138604252367972e278154636754 100644 --- a/src/salloc/opt.h +++ b/src/salloc/opt.h @@ -127,6 +127,7 @@ typedef struct salloc_options { int realmem; /* --mem=n */ long tmpdisk; /* --tmp=n */ char *constraints; /* --constraints=, -C constraint*/ + char *gres; /* --gres */ bool contiguous; /* --contiguous */ char *nodelist; /* --nodelist=node1,node2,... */ char *exc_nodes; /* --exclude=node1,node2,... -x */ diff --git a/src/salloc/salloc.c b/src/salloc/salloc.c index 4ba500cfa112e6b4148d4d6d39e4bfb75a11e1a7..c93fec1859f94b6cc2e39b9696a04122ca82114d 100644 --- a/src/salloc/salloc.c +++ b/src/salloc/salloc.c @@ -451,6 +451,7 @@ static int _fill_job_desc_from_opts(job_desc_msg_t *desc) { desc->contiguous = opt.contiguous ? 1 : 0; desc->features = opt.constraints; + desc->gres = opt.gres; if (opt.immediate == 1) desc->immediate = 1; desc->name = xstrdup(opt.job_name); diff --git a/src/sbatch/opt.c b/src/sbatch/opt.c index fd35469b6d4f14350b605020401f6bf67ba44a50..964ad65427b51a3170130efc70c34942d3eac966 100644 --- a/src/sbatch/opt.c +++ b/src/sbatch/opt.c @@ -161,6 +161,7 @@ #define LONG_OPT_CHECKPOINT_DIR 0x14c #define LONG_OPT_SIGNAL 0x14d #define LONG_OPT_TIME_MIN 0x14e +#define LONG_OPT_GRES 0x14f /*---- global variables, defined in opt.h ----*/ opt_t opt; @@ -332,6 +333,7 @@ static void _opt_default() opt.hold = false; opt.constraints = NULL; + opt.gres = NULL; opt.contiguous = false; opt.nodelist = NULL; opt.exc_nodes = NULL; @@ -666,6 +668,7 @@ static struct option long_options[] = { {"cpu_bind", required_argument, 0, LONG_OPT_CPU_BIND}, {"exclusive", no_argument, 0, LONG_OPT_EXCLUSIVE}, {"get-user-env", optional_argument, 0, LONG_OPT_GET_USER_ENV}, + {"gres", required_argument, 0, LONG_OPT_GRES}, {"gid", required_argument, 0, LONG_OPT_GID}, {"hint", required_argument, 0, LONG_OPT_HINT}, {"ioload-image", required_argument, 0, LONG_OPT_RAMDISK_IMAGE}, @@ -1547,6 +1550,14 @@ static void _set_options(int argc, char **argv) xfree(opt.time_min_str); opt.time_min_str = xstrdup(optarg); break; + case LONG_OPT_GRES: + if (!strcasecmp(optarg, "help")) { + print_gres_help(); + exit(0); + } + xfree(opt.gres); + opt.gres = xstrdup(optarg); + break; default: if (spank_process_option (opt_char, optarg) < 0) { error("Unrecognized command line parameter %c", @@ -2543,6 +2554,8 @@ static void _opt_list() info("account : %s", opt.account); info("comment : %s", opt.comment); info("dependency : %s", opt.dependency); + if (opt.gres) + info("gres : %s", opt.gres); info("qos : %s", opt.qos); str = print_constraints(); info("constraints : %s", str); @@ -2625,7 +2638,7 @@ static void _usage(void) " [--mail-type=type] [--mail-user=user][--nice[=value]]\n" " [--requeue] [--no-requeue] [--ntasks-per-node=n] [--propagate]\n" " [--nodefile=file] [--nodelist=hosts] [--exclude=hosts]\n" -" [--network=type] [--mem-per-cpu=MB] [--qos=qos]\n" +" [--network=type] [--mem-per-cpu=MB] [--qos=qos] [--gres=list]\n" " [--cpu_bind=...] [--mem_bind=...] [--reservation=name]\n" " executable [args...]\n"); } @@ -2647,6 +2660,7 @@ static void _help(void) " -e, --error=err file for batch script's standard error\n" " --get-user-env used by Moab. See srun man page.\n" " --gid=group_id group ID to run job as (user root only)\n" +" --gres=list required generic resources\n" " -H, --hold submit job in held state\n" " -i, --input=in file for batch script's standard input\n" " -I, --immediate exit if resources are not immediately available\n" diff --git a/src/sbatch/opt.h b/src/sbatch/opt.h index 204a582bf9aebe99a088f4d6a548da44735f3a55..ff464ac3328ef74941d21befc80b4133b406b626 100644 --- a/src/sbatch/opt.h +++ b/src/sbatch/opt.h @@ -135,6 +135,7 @@ typedef struct sbatch_options { int realmem; /* --mem=n */ long tmpdisk; /* --tmp=n */ char *constraints; /* --constraints=, -C constraint*/ + char *gres; /* --gres */ bool contiguous; /* --contiguous */ char *nodelist; /* --nodelist=node1,node2,... */ char *exc_nodes; /* --exclude=node1,node2,... -x */ diff --git a/src/sbatch/sbatch.c b/src/sbatch/sbatch.c index b21f28c19845d12111775b034ae8298229a98034..049d813bb9580fe395af553e2859151aa169e1b0 100644 --- a/src/sbatch/sbatch.c +++ b/src/sbatch/sbatch.c @@ -185,6 +185,7 @@ static int fill_job_desc_from_opts(job_desc_msg_t *desc) desc->contiguous = opt.contiguous ? 1 : 0; desc->features = opt.constraints; desc->immediate = opt.immediate; + desc->gres = opt.gres; if (opt.job_name != NULL) desc->name = xstrdup(opt.job_name); else diff --git a/src/scontrol/update_job.c b/src/scontrol/update_job.c index 37116d83be7393a86a88d777a26508ea9c33cb9d..195ab194bc150207bf5fb79183e4287b5337faea 100644 --- a/src/scontrol/update_job.c +++ b/src/scontrol/update_job.c @@ -482,6 +482,10 @@ scontrol_update_job (int argc, char *argv[]) job_msg.features = val; update_cnt++; } + else if (strncasecmp(tag, "Gres", MAX(taglen, 2)) == 0) { + job_msg.gres = val; + update_cnt++; + } else if (strncasecmp(tag, "Account", MAX(taglen, 1)) == 0) { job_msg.account = val; update_cnt++; @@ -491,7 +495,7 @@ scontrol_update_job (int argc, char *argv[]) update_cnt++; } #ifdef HAVE_BG - else if (strncasecmp(tag, "Geometry", MAX(taglen, 1)) == 0) { + else if (strncasecmp(tag, "Geometry", MAX(taglen, 2)) == 0) { char* token, *delimiter = ",x", *next_ptr; int j, rc = 0; uint16_t geo[SYSTEM_DIMENSIONS]; diff --git a/src/scontrol/update_node.c b/src/scontrol/update_node.c index 0594bfeb023796fd0ff755582b0b5a4e3074b122..83c88a85101d53f290af31c4ffd5069c80155b1d 100644 --- a/src/scontrol/update_node.c +++ b/src/scontrol/update_node.c @@ -2,6 +2,7 @@ * update_node.c - node update function for scontrol. ***************************************************************************** * Copyright (C) 2002-2007 The Regents of the University of California. + * Copyright (C) 2008-2010 Lawrence Livermore National Security. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Morris Jette <jette1@llnl.gov> * CODE-OCEC-09-009. All rights reserved. @@ -76,6 +77,9 @@ scontrol_update_node (int argc, char *argv[]) else if (strncasecmp(tag, "Features", MAX(taglen, 1)) == 0) { node_msg.features = val; update_cnt++; + } else if (strncasecmp(tag, "Gres", MAX(taglen, 1)) == 0) { + node_msg.gres = val; + update_cnt++; } else if (strncasecmp(tag, "Weight", MAX(taglen,1)) == 0) { /* Logic borrowed from function _handle_uint32 */ char *endptr; diff --git a/src/sinfo/opts.c b/src/sinfo/opts.c index 564dc083ad3b320d27f8fbde8a6e269d1614fa2a..6940dfa76fc781f34ed94a49b7670e918e2f46e7 100644 --- a/src/sinfo/opts.c +++ b/src/sinfo/opts.c @@ -520,6 +520,12 @@ _parse_format( char* format ) field_size, right_justify, suffix ); + } else if (field[0] == 'G') { + params.match_flags.gres_flag = true; + format_add_gres( params.format_list, + field_size, + right_justify, + suffix ); } else if (field[0] == 'h') { params.match_flags.share_flag = true; format_add_share( params.format_list, @@ -744,6 +750,8 @@ void _print_options( void ) "true" : "false"); printf("groups_flag = %s\n", params.match_flags.groups_flag ? "true" : "false"); + printf("gres_flag = %s\n", params.match_flags.gres_flag ? + "true" : "false"); printf("job_size_flag = %s\n", params.match_flags.job_size_flag ? "true" : "false"); printf("max_time_flag = %s\n", params.match_flags.max_time_flag ? diff --git a/src/sinfo/print.c b/src/sinfo/print.c index 655c4217f10eee758d22230c70dcdc3dc6501cb3..8e8ba7ea83db83305db72af1561d9ff55fa78bf7 100644 --- a/src/sinfo/print.c +++ b/src/sinfo/print.c @@ -475,6 +475,19 @@ int _print_features(sinfo_data_t * sinfo_data, int width, return SLURM_SUCCESS; } +int _print_gres(sinfo_data_t * sinfo_data, int width, + bool right_justify, char *suffix) +{ + if (sinfo_data) + _print_str(sinfo_data->gres, width, right_justify, true); + else + _print_str("GRES", width, right_justify, true); + + if (suffix) + printf("%s", suffix); + return SLURM_SUCCESS; +} + int _print_groups(sinfo_data_t * sinfo_data, int width, bool right_justify, char *suffix) { diff --git a/src/sinfo/print.h b/src/sinfo/print.h index 9074c0d09b68779b3f4de6da43ccf24ec0b7fc4f..d844bfeeea4c5ffeb6de489e416993dd70e5cae0 100644 --- a/src/sinfo/print.h +++ b/src/sinfo/print.h @@ -1,7 +1,8 @@ /*****************************************************************************\ * print.h - sinfo print job definitions ***************************************************************************** - * Copyright (C) 2002-2006 The Regents of the University of California. + * Copyright (C) 2002-2007 The Regents of the University of California. + * Copyright (C) 2008-2010 Lawrence Livermore National Security. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Joey Ekstrom <ekstrom1@llnl.gov> * CODE-OCEC-09-009. All rights reserved. @@ -87,6 +88,8 @@ int print_sinfo_list(List sinfo_list); format_add_function(list,wid,right,suffix,_print_features) #define format_add_groups(list,wid,right,suffix) \ format_add_function(list,wid,right,suffix,_print_groups) +#define format_add_gres(list,wid,right,suffix) \ + format_add_function(list,wid,right,suffix,_print_gres) #define format_add_memory(list,wid,right,suffix) \ format_add_function(list,wid,right,suffix,_print_memory) #define format_add_node_list(list,wid,right,suffix) \ @@ -154,6 +157,8 @@ int _print_features(sinfo_data_t * sinfo_data, int width, bool right_justify, char *suffix); int _print_groups(sinfo_data_t * sinfo_data, int width, bool right_justify, char *suffix); +int _print_gres(sinfo_data_t * sinfo_data, int width, + bool right_justify, char *suffix); int _print_memory(sinfo_data_t * sinfo_data, int width, bool right_justify, char *suffix); int _print_node_list(sinfo_data_t * sinfo_data, int width, diff --git a/src/sinfo/sinfo.c b/src/sinfo/sinfo.c index b387f55e335f8af429bffd87d036db07e1fc844f..7c24050e1bd99c7557e72c9cec629d7b95ebb573 100644 --- a/src/sinfo/sinfo.c +++ b/src/sinfo/sinfo.c @@ -2,7 +2,7 @@ * sinfo.c - Report overall state the system ***************************************************************************** * Copyright (C) 2002-2007 The Regents of the University of California. - * Copyright (C) 2008-2009 Lawrence Livermore National Security. + * Copyright (C) 2008-2010 Lawrence Livermore National Security. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Joey Ekstrom <ekstrom1@llnl.gov>, Morris Jette <jette1@llnl.gov> * CODE-OCEC-09-009. All rights reserved. @@ -516,6 +516,11 @@ static bool _match_node_data(sinfo_data_t *sinfo_ptr, (_strcmp(node_ptr->features, sinfo_ptr->features))) return false; + if (sinfo_ptr->nodes && + params.match_flags.gres_flag && + (_strcmp(node_ptr->gres, sinfo_ptr->gres))) + return false; + if (sinfo_ptr->nodes && params.match_flags.reason_flag && (_strcmp(node_ptr->reason, sinfo_ptr->reason))) @@ -632,6 +637,7 @@ static void _update_sinfo(sinfo_data_t *sinfo_ptr, node_info_t *node_ptr, if (sinfo_ptr->nodes_total == 0) { /* first node added */ sinfo_ptr->node_state = node_ptr->node_state; sinfo_ptr->features = node_ptr->features; + sinfo_ptr->gres = node_ptr->gres; sinfo_ptr->reason = node_ptr->reason; sinfo_ptr->reason_time= node_ptr->reason_time; sinfo_ptr->reason_uid = node_ptr->reason_uid; diff --git a/src/sinfo/sinfo.h b/src/sinfo/sinfo.h index 3633b61e96fa5301354444e58a2d4bbf958aa81d..89168519e5880e4ba4dd263ed417830e0e2c7c53 100644 --- a/src/sinfo/sinfo.h +++ b/src/sinfo/sinfo.h @@ -3,7 +3,8 @@ * * $Id$ ***************************************************************************** - * Copyright (C) 2002-2006 The Regents of the University of California. + * Copyright (C) 2002-2007 The Regents of the University of California. + * Copyright (C) 2008-2010 Lawrence Livermore National Security. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Joey Ekstrom <ekstrom1@llnl.gov>, Morris Jette <jette1@llnl.gov> * CODE-OCEC-09-009. All rights reserved. @@ -99,6 +100,7 @@ typedef struct { uint32_t max_weight; char *features; + char *gres; char *reason; time_t reason_time; uint32_t reason_uid; @@ -125,6 +127,7 @@ struct sinfo_match_flags { bool disk_flag; bool features_flag; bool groups_flag; + bool gres_flag; bool job_size_flag; bool default_time_flag; bool max_time_flag; diff --git a/src/slurmctld/job_mgr.c b/src/slurmctld/job_mgr.c index c5a6e77900380c79f1cf40b03b3907f8567d759e..d8bf81f8b8f58e03cd857cd7aea52a982ee9972f 100644 --- a/src/slurmctld/job_mgr.c +++ b/src/slurmctld/job_mgr.c @@ -754,6 +754,7 @@ static void _dump_job_state(struct job_record *dump_job_ptr, Buf buffer) packstr(dump_job_ptr->alloc_node, buffer); packstr(dump_job_ptr->account, buffer); packstr(dump_job_ptr->comment, buffer); + packstr(dump_job_ptr->gres, buffer); packstr(dump_job_ptr->network, buffer); packstr(dump_job_ptr->licenses, buffer); packstr(dump_job_ptr->mail_user, buffer); @@ -807,7 +808,7 @@ static int _load_job_state(Buf buffer, uint16_t protocol_version) char *account = NULL, *network = NULL, *mail_user = NULL; char *comment = NULL, *nodes_completing = NULL, *alloc_node = NULL; char *licenses = NULL, *state_desc = NULL, *wckey = NULL; - char *resv_name = NULL; + char *resv_name = NULL, *gres = NULL; char **spank_job_env = (char **) NULL; struct job_record *job_ptr; struct part_record *part_ptr; @@ -905,6 +906,7 @@ static int _load_job_state(Buf buffer, uint16_t protocol_version) safe_unpackstr_xmalloc(&alloc_node, &name_len, buffer); safe_unpackstr_xmalloc(&account, &name_len, buffer); safe_unpackstr_xmalloc(&comment, &name_len, buffer); + safe_unpackstr_xmalloc(&gres, &name_len, buffer); safe_unpackstr_xmalloc(&network, &name_len, buffer); safe_unpackstr_xmalloc(&licenses, &name_len, buffer); safe_unpackstr_xmalloc(&mail_user, &name_len, buffer); @@ -1118,6 +1120,9 @@ static int _load_job_state(Buf buffer, uint16_t protocol_version) xfree(job_ptr->comment); job_ptr->comment = comment; comment = NULL; /* reused, nothing left to free */ + xfree(job_ptr->gres); + job_ptr->gres = gres; + gres = NULL; /* reused, nothing left to free */ job_ptr->direct_set_prio = direct_set_prio; job_ptr->db_index = db_index; job_ptr->end_time = end_time; @@ -1268,6 +1273,7 @@ unpack_error: xfree(alloc_node); xfree(account); xfree(comment); + xfree(gres); xfree(resp_host); xfree(licenses); xfree(mail_user); @@ -1923,8 +1929,8 @@ void dump_job_desc(job_desc_msg_t * job_specs) debug3(" immediate=%ld features=%s reservation=%s", immediate, job_specs->features, job_specs->reservation); - debug3(" req_nodes=%s exc_nodes=%s", - job_specs->req_nodes, job_specs->exc_nodes); + debug3(" req_nodes=%s exc_nodes=%s gres=%s", + job_specs->req_nodes, job_specs->exc_nodes, job_specs->gres); time_limit = (job_specs->time_limit != NO_VAL) ? (long) job_specs->time_limit : -1L; @@ -3037,6 +3043,10 @@ static int _job_create(job_desc_msg_t * job_desc, int allocate, int will_run, error_code = ESLURM_INVALID_FEATURE; goto cleanup_fail; } + if (build_gres_list(job_ptr)) { + error_code = ESLURM_INVALID_GRES; + goto cleanup_fail; + } if ((error_code = validate_job_resv(job_ptr))) goto cleanup_fail; @@ -3142,6 +3152,7 @@ static int _validate_job_create_req(job_desc_msg_t * job_desc) _test_strlen(job_desc->dependency, "dependency", 1024) || _test_strlen(job_desc->exc_nodes, "exc_nodes", 1024) || _test_strlen(job_desc->features, "features", 1024) || + _test_strlen(job_desc->gres, "gres", 1024) || _test_strlen(job_desc->licenses, "licenses", 1024) || _test_strlen(job_desc->linuximage, "linuximage", 1024) || _test_strlen(job_desc->mail_user, "mail_user", 1024) || @@ -3645,6 +3656,7 @@ _copy_job_desc_to_job_record(job_desc_msg_t * job_desc, job_ptr->alloc_sid = job_desc->alloc_sid; job_ptr->alloc_node = xstrdup(job_desc->alloc_node); job_ptr->account = xstrdup(job_desc->account); + job_ptr->gres = xstrdup(job_desc->gres); job_ptr->network = xstrdup(job_desc->network); job_ptr->resv_name = xstrdup(job_desc->reservation); job_ptr->comment = xstrdup(job_desc->comment); @@ -4282,6 +4294,7 @@ static void _list_delete_job(void *job_entry) xfree(job_ptr->account); xfree(job_ptr->alloc_node); xfree(job_ptr->comment); + xfree(job_ptr->gres); xfree(job_ptr->licenses); if (job_ptr->license_list) list_destroy(job_ptr->license_list); @@ -4547,13 +4560,13 @@ void pack_job(struct job_record *dump_job_ptr, uint16_t show_flags, Buf buffer, packstr(dump_job_ptr->account, buffer); packstr(dump_job_ptr->network, buffer); packstr(dump_job_ptr->comment, buffer); + packstr(dump_job_ptr->gres, buffer); slurm_mutex_lock(&assoc_mgr_qos_lock); - if (assoc_mgr_qos_list) + if (assoc_mgr_qos_list) { packstr(slurmdb_qos_str(assoc_mgr_qos_list, - dump_job_ptr->qos), - buffer); - else + dump_job_ptr->qos), buffer); + } else packnull(buffer); slurm_mutex_unlock(&assoc_mgr_qos_lock); @@ -5901,6 +5914,26 @@ int update_job(job_desc_msg_t * job_specs, uid_t uid) } } + if (job_specs->gres) { + if ((!IS_JOB_PENDING(job_ptr)) || (detail_ptr == NULL)) + error_code = ESLURM_DISABLED; + else if (job_specs->gres[0] != '\0') { +//FIXME: Validate input + info("sched: update_job: setting gres to " + "%s for job_id %u", + job_specs->gres, job_specs->job_id); + xfree(job_ptr->gres); + job_ptr->gres = job_specs->gres; + job_specs->gres = NULL; +//FIXME: rebuild struct + } else { + info("sched: update_job: cleared gres for job %u", + job_specs->job_id); + xfree(job_ptr->gres); +//FIXME: clear struct + } + } + if (job_specs->name) { if (!IS_JOB_PENDING(job_ptr)) error_code = ESLURM_DISABLED; @@ -8559,6 +8592,7 @@ _copy_job_record_to_job_desc(struct job_record *job_ptr) &job_desc->env_size); job_desc->exc_nodes = xstrdup(details->exc_nodes); job_desc->features = xstrdup(details->features); + job_desc->gres = xstrdup(job_ptr->gres); job_desc->group_id = job_ptr->group_id; job_desc->immediate = 0; /* nowhere to get this value */ job_desc->job_id = job_ptr->job_id; diff --git a/src/slurmctld/job_scheduler.c b/src/slurmctld/job_scheduler.c index 3551e95c1cb807fcbe95c3b4759bc0178c29ba3e..760bc1b11853297fae6104607b159ee6e189ffe4 100644 --- a/src/slurmctld/job_scheduler.c +++ b/src/slurmctld/job_scheduler.c @@ -1660,3 +1660,15 @@ static int _valid_node_feature(char *feature) return rc; } + +/* + * build_gres_list - Translate a job's gres string into a gres_list + * IN job_ptr->gres + * OUT job_ptr->gres_list + * RET error code + */ +extern int build_gres_list(struct job_record *job_ptr) +{ + error("construction of a job's gres list TBD"); + return SLURM_SUCCESS; +} diff --git a/src/slurmctld/job_scheduler.h b/src/slurmctld/job_scheduler.h index a1f39fd575be3e2c770d83a6603bed58c31271c7..be6e6e3c92bbfbed68890da04904a08cd0235b34 100644 --- a/src/slurmctld/job_scheduler.h +++ b/src/slurmctld/job_scheduler.h @@ -58,6 +58,14 @@ struct job_queue { */ extern int build_feature_list(struct job_record *job_ptr); +/* + * build_gres_list - Translate a job's gres string into a gres_list + * IN job_ptr->gres + * OUT job_ptr->gres_list + * RET error code + */ +extern int build_gres_list(struct job_record *job_ptr); + /* * build_job_queue - build (non-priority ordered) list of pending jobs * OUT job_queue - pointer to job queue diff --git a/src/slurmctld/node_mgr.c b/src/slurmctld/node_mgr.c index 6c7ac3a7812d21a78b84459d1d9bf4c00d855042..50a9427069a9d34d19b049c22e9fc1c41488cffd 100644 --- a/src/slurmctld/node_mgr.c +++ b/src/slurmctld/node_mgr.c @@ -102,6 +102,7 @@ static void _sync_bitmaps(struct node_record *node_ptr, int job_count); static void _update_config_ptr(bitstr_t *bitmap, struct config_record *config_ptr); static int _update_node_features(char *node_names, char *features); +static int _update_node_gres(char *node_names, char *gres); static int _update_node_weight(char *node_names, uint32_t weight); static bool _valid_node_state_change(uint16_t old, uint16_t new); #ifndef HAVE_FRONT_END @@ -204,7 +205,8 @@ _dump_node_state (struct node_record *dump_node_ptr, Buf buffer) { packstr (dump_node_ptr->name, buffer); packstr (dump_node_ptr->reason, buffer); - packstr (dump_node_ptr->config_ptr->feature, buffer); + packstr (dump_node_ptr->features, buffer); + packstr (dump_node_ptr->gres, buffer); pack16 (dump_node_ptr->node_state, buffer); pack16 (dump_node_ptr->cpus, buffer); pack16 (dump_node_ptr->sockets, buffer); @@ -250,14 +252,15 @@ static int _open_node_state_file(char **state_file) * load_all_node_state - Load the node state from file, recover on slurmctld * restart. Execute this after loading the configuration file data. * Data goes into common storage. - * IN state_only - if true, overwrite only node state, features and reason + * IN state_only - if true, overwrite only node state and reason * Use this to overwrite the "UNKNOWN state typically used in slurm.conf * RET 0 or error code * NOTE: READ lock_slurmctld config before entry */ extern int load_all_node_state ( bool state_only ) { - char *node_name, *reason = NULL, *data = NULL, *state_file, *features; + char *node_name, *reason = NULL, *data = NULL, *state_file; + char *features, *gres; int data_allocated, data_read = 0, error_code = 0, node_cnt = 0; uint16_t node_state; uint16_t cpus = 1, sockets = 1, cores = 1, threads = 1; @@ -337,6 +340,7 @@ extern int load_all_node_state ( bool state_only ) safe_unpackstr_xmalloc (&node_name, &name_len, buffer); safe_unpackstr_xmalloc (&reason, &name_len, buffer); safe_unpackstr_xmalloc (&features, &name_len, buffer); + safe_unpackstr_xmalloc (&gres, &name_len, buffer); safe_unpack16 (&node_state, buffer); safe_unpack16 (&cpus, buffer); safe_unpack16 (&sockets, buffer); @@ -387,6 +391,7 @@ extern int load_all_node_state ( bool state_only ) error ("Node %s has vanished from configuration", node_name); xfree(features); + xfree(gres); xfree(reason); } else if (state_only) { uint16_t orig_flags; @@ -428,8 +433,8 @@ extern int load_all_node_state ( bool state_only ) node_ptr->reason_uid = reason_uid; } else xfree(reason); - xfree(node_ptr->features); - node_ptr->features = features; + xfree(features); + xfree(gres); } else { node_cnt++; if ((!power_save_mode) && @@ -449,6 +454,8 @@ extern int load_all_node_state ( bool state_only ) node_ptr->reason_uid = reason_uid; xfree(node_ptr->features); node_ptr->features = features; + xfree(node_ptr->gres); + node_ptr->gres = gres; node_ptr->part_cnt = 0; xfree(node_ptr->part_pptr); node_ptr->cpus = cpus; @@ -462,10 +469,11 @@ extern int load_all_node_state ( bool state_only ) } xfree (node_name); - if(node_ptr) + if (node_ptr) { select_g_update_node_state( (node_ptr - node_record_table_ptr), node_ptr->node_state); + } } fini: info("Recovered state of %d nodes", node_cnt); @@ -642,7 +650,8 @@ static void _pack_node (struct node_record *dump_node_ptr, Buf buffer, buffer, protocol_version); packstr(dump_node_ptr->arch, buffer); - packstr(dump_node_ptr->config_ptr->feature, buffer); + packstr(dump_node_ptr->features, buffer); + packstr(dump_node_ptr->gres, buffer); packstr(dump_node_ptr->os, buffer); packstr(dump_node_ptr->reason, buffer); } else if(protocol_version >= SLURM_2_1_PROTOCOL_VERSION) { @@ -671,7 +680,7 @@ static void _pack_node (struct node_record *dump_node_ptr, Buf buffer, buffer, protocol_version); packstr(dump_node_ptr->arch, buffer); - packstr(dump_node_ptr->config_ptr->feature, buffer); + packstr(dump_node_ptr->features, buffer); packstr(dump_node_ptr->os, buffer); packstr(dump_node_ptr->reason, buffer); } else { @@ -756,6 +765,21 @@ int update_node ( update_node_msg_t * update_node_msg ) break; } + if (update_node_msg->features) { + xfree(node_ptr->features); + if (update_node_msg->features[0]) + node_ptr->features = xstrdup(update_node_msg-> + features); + /* _update_node_features() logs and udates config */ + } + + if (update_node_msg->gres) { + xfree(node_ptr->gres); + if (update_node_msg->gres[0]) + node_ptr->gres = xstrdup(update_node_msg->gres); + /* _update_node_gres() logs and udates config */ + } + if ((update_node_msg -> reason) && (update_node_msg -> reason[0])) { xfree(node_ptr->reason); @@ -924,11 +948,13 @@ int update_node ( update_node_msg_t * update_node_msg ) hostlist_destroy (host_list); if ((error_code == 0) && (update_node_msg->features)) { - error_code = _update_node_features( - update_node_msg->node_names, - update_node_msg->features); + error_code = _update_node_features(update_node_msg->node_names, + update_node_msg->features); + } + if ((error_code == 0) && (update_node_msg->gres)) { + error_code = _update_node_gres(update_node_msg->node_names, + update_node_msg->gres); } - /* Update weight. Weight is part of config_ptr, * hence do the splitting if required */ @@ -944,58 +970,94 @@ int update_node ( update_node_msg_t * update_node_msg ) return error_code; } +/* variation of strcmp that accepts NULL pointers */ +static int _strcmp(char *str1, char *str2) +{ + if (!str1 && !str2) + return 0; + if (str1 && !str2) + return 1; + if (!str1 && str2) + return -1; + return strcmp(str1, str2); +} + /* - * restore_node_features - Restore node Features and Weight based upon state - * previously in memory (preserves interactive updates) + * restore_node_features - Make node and config (from slurm.conf) fields + * consistent for Features, Gres and Weight + * IN recover - + * 0, 1 - use data from config record, built using slurm.conf + * 2 = use data from node record, built from saved state */ -extern void restore_node_features(void) +extern void restore_node_features(int recover) { - int i, j; - char *node_list; - struct node_record *node_ptr1, *node_ptr2; - hostlist_t hl; + int i; + struct node_record *node_ptr; - for (i=0, node_ptr1=node_record_table_ptr; i<node_record_count; - i++, node_ptr1++) { + for (i=0, node_ptr=node_record_table_ptr; i<node_record_count; + i++, node_ptr++) { - if (node_ptr1->weight != node_ptr1->config_ptr->weight) { + if (node_ptr->weight != node_ptr->config_ptr->weight) { error("Node %s Weight(%u) differ from slurm.conf", - node_ptr1->name, node_ptr1->weight); - _update_node_weight(node_ptr1->name, - node_ptr1->weight); + node_ptr->name, node_ptr->weight); + if (recover == 2) { + _update_node_weight(node_ptr->name, + node_ptr->weight); + } else { + node_ptr->weight = node_ptr->config_ptr-> + weight; + } } - if (!node_ptr1->config_ptr->feature && !node_ptr1->features) - continue; /* No feature to preserve */ - if (node_ptr1->config_ptr->feature && node_ptr1->features && - !strcmp(node_ptr1->config_ptr->feature, - node_ptr1->features)) { - continue; /* Identical feature value */ + if (_strcmp(node_ptr->config_ptr->feature, node_ptr->features)){ + error("Node %s Features(%s) differ from slurm.conf", + node_ptr->name, node_ptr->features); + if (recover == 2) { + _update_node_features(node_ptr->name, + node_ptr->features); + } else { + xfree(node_ptr->features); + node_ptr->features = xstrdup(node_ptr-> + config_ptr-> + feature); + } } - hl = hostlist_create(node_ptr1->name); - for (j=(i+1), node_ptr2=(node_ptr1+1); j<node_record_count; - j++, node_ptr2++) { - if ((!node_ptr1->features && !node_ptr2->features) || - ( node_ptr1->features && node_ptr2->features && - !strcmp(node_ptr1->features, - node_ptr2->features))) { - /* Reset this job's feature at same time */ - hostlist_push(hl, node_ptr2->name); + if (_strcmp(node_ptr->config_ptr->gres, node_ptr->gres)) { + error("Node %s Gres(%s) differ from slurm.conf", + node_ptr->name, node_ptr->gres); + if (recover == 2) { + _update_node_gres(node_ptr->name, + node_ptr->gres); + } else { + xfree(node_ptr->gres); + node_ptr->gres = xstrdup(node_ptr->config_ptr-> + gres); } } - - node_list = xmalloc(2048); - hostlist_ranged_string(hl, 2048, node_list); - error("Node %s Features(%s) differ from slurm.conf", - node_list, node_ptr1->features); - _update_node_features(node_list, node_ptr1->features); - xfree(node_ptr1->features); - xfree(node_list); - hostlist_destroy(hl); } } +/* Duplicate a configuration record except for the node names & bitmap */ +struct config_record * _dup_config(struct config_record *config_ptr) +{ + struct config_record *new_config_ptr; + + new_config_ptr = create_config_record(); + new_config_ptr->magic = config_ptr->magic; + new_config_ptr->cpus = config_ptr->cpus; + new_config_ptr->sockets = config_ptr->sockets; + new_config_ptr->cores = config_ptr->cores; + new_config_ptr->threads = config_ptr->threads; + new_config_ptr->real_memory = config_ptr->real_memory; + new_config_ptr->tmp_disk = config_ptr->tmp_disk; + new_config_ptr->weight = config_ptr->weight; + new_config_ptr->feature = xstrdup(config_ptr->feature); + new_config_ptr->gres = xstrdup(config_ptr->gres); + + return new_config_ptr; +} + /* * _update_node_weight - Update weight associated with nodes * build new config list records as needed @@ -1039,25 +1101,14 @@ static int _update_node_weight(char *node_names, uint32_t weight) config_ptr->weight = weight; } else { /* partial update, split config_record */ - new_config_ptr = create_config_record(); + new_config_ptr = _dup_config(config_ptr); if (first_new == NULL); first_new = new_config_ptr; - new_config_ptr->magic = config_ptr->magic; - new_config_ptr->cpus = config_ptr->cpus; - new_config_ptr->sockets = config_ptr->sockets; - new_config_ptr->cores = config_ptr->cores; - new_config_ptr->threads = config_ptr->threads; - new_config_ptr->real_memory = config_ptr->real_memory; - new_config_ptr->tmp_disk = config_ptr->tmp_disk; /* Change weight for the given node */ new_config_ptr->weight = weight; - if (config_ptr->feature) { - new_config_ptr->feature = xstrdup(config_ptr-> - feature); - } new_config_ptr->node_bitmap = bit_copy(tmp_bitmap); - new_config_ptr->nodes = - bitmap2node_name(tmp_bitmap); + new_config_ptr->nodes = bitmap2node_name(tmp_bitmap); + build_config_feature_list(new_config_ptr); _update_config_ptr(tmp_bitmap, new_config_ptr); @@ -1121,27 +1172,18 @@ static int _update_node_features(char *node_names, char *features) xfree(config_ptr->feature); if (features && features[0]) config_ptr->feature = xstrdup(features); - else - config_ptr->feature = NULL; build_config_feature_list(config_ptr); } else { /* partial update, split config_record */ - new_config_ptr = create_config_record(); + new_config_ptr = _dup_config(config_ptr); if (first_new == NULL); first_new = new_config_ptr; - new_config_ptr->magic = config_ptr->magic; - new_config_ptr->cpus = config_ptr->cpus; - new_config_ptr->sockets = config_ptr->sockets; - new_config_ptr->cores = config_ptr->cores; - new_config_ptr->threads = config_ptr->threads; - new_config_ptr->real_memory = config_ptr->real_memory; - new_config_ptr->tmp_disk = config_ptr->tmp_disk; - new_config_ptr->weight = config_ptr->weight; + xfree(new_config_ptr->feature); if (features && features[0]) new_config_ptr->feature = xstrdup(features); new_config_ptr->node_bitmap = bit_copy(tmp_bitmap); - new_config_ptr->nodes = - bitmap2node_name(tmp_bitmap); + new_config_ptr->nodes = bitmap2node_name(tmp_bitmap); + build_config_feature_list(new_config_ptr); _update_config_ptr(tmp_bitmap, new_config_ptr); @@ -1149,8 +1191,8 @@ static int _update_node_features(char *node_names, char *features) bit_not(tmp_bitmap); bit_and(config_ptr->node_bitmap, tmp_bitmap); xfree(config_ptr->nodes); - config_ptr->nodes = bitmap2node_name( - config_ptr->node_bitmap); + config_ptr->nodes = bitmap2node_name(config_ptr-> + node_bitmap); } bit_free(tmp_bitmap); } @@ -1162,6 +1204,80 @@ static int _update_node_features(char *node_names, char *features) return SLURM_SUCCESS; } +/* + * _update_node_gres - Update generic resources associated with nodes + * build new config list records as needed + * IN node_names - List of nodes to update + * IN gres - New gres value + * RET: SLURM_SUCCESS or error code + */ +static int _update_node_gres(char *node_names, char *gres) +{ + bitstr_t *node_bitmap = NULL, *tmp_bitmap; + ListIterator config_iterator; + struct config_record *config_ptr, *new_config_ptr; + struct config_record *first_new = NULL; + int rc, config_cnt, tmp_cnt; + + rc = node_name2bitmap(node_names, false, &node_bitmap); + if (rc) { + info("_update_node_gres: invalid node_name"); + return rc; + } + + /* For each config_record with one of these nodes, + * update it (if all nodes updated) or split it into + * a new entry */ + config_iterator = list_iterator_create(config_list); + if (config_iterator == NULL) + fatal("list_iterator_create malloc failure"); + while ((config_ptr = (struct config_record *) + list_next(config_iterator))) { + if (config_ptr == first_new) + break; /* done with all original records */ + + tmp_bitmap = bit_copy(node_bitmap); + bit_and(tmp_bitmap, config_ptr->node_bitmap); + config_cnt = bit_set_count(config_ptr->node_bitmap); + tmp_cnt = bit_set_count(tmp_bitmap); + if (tmp_cnt == 0) { + /* no overlap, leave alone */ + } else if (tmp_cnt == config_cnt) { + /* all nodes changed, update in situ */ + xfree(config_ptr->gres); + if (gres && gres[0]) + config_ptr->gres = xstrdup(gres); +//FIXME build_config_feature_list(config_ptr); + } else { + /* partial update, split config_record */ + new_config_ptr = _dup_config(config_ptr); + if (first_new == NULL); + first_new = new_config_ptr; + xfree(new_config_ptr->gres); + if (gres && gres[0]) + new_config_ptr->gres = xstrdup(gres); + new_config_ptr->node_bitmap = bit_copy(tmp_bitmap); + new_config_ptr->nodes = bitmap2node_name(tmp_bitmap); + +//FIXME build_config_feature_list(new_config_ptr); + _update_config_ptr(tmp_bitmap, new_config_ptr); + + /* Update remaining records */ + bit_not(tmp_bitmap); + bit_and(config_ptr->node_bitmap, tmp_bitmap); + xfree(config_ptr->nodes); + config_ptr->nodes = bitmap2node_name(config_ptr-> + node_bitmap); + } + bit_free(tmp_bitmap); + } + list_iterator_destroy(config_iterator); + bit_free(node_bitmap); + + info("_update_node_gres: nodes %s gres set to: %s", node_names, gres); + return SLURM_SUCCESS; +} + /* Reset the config pointer for updated jobs */ static void _update_config_ptr(bitstr_t *bitmap, struct config_record *config_ptr) diff --git a/src/slurmctld/proc_req.c b/src/slurmctld/proc_req.c index ed0c278fda2cd5a6b4925db4082e5b014c5ba724..be8ba8cfe363872691fb4c26e7380f7e95026854 100644 --- a/src/slurmctld/proc_req.c +++ b/src/slurmctld/proc_req.c @@ -450,6 +450,7 @@ void _fill_ctld_conf(slurm_ctl_conf_t * conf_ptr) conf_ptr->fast_schedule = conf->fast_schedule; conf_ptr->first_job_id = conf->first_job_id; + conf_ptr->gres_plugins = xstrdup(conf->gres_plugins); conf_ptr->group_info = conf->group_info; conf_ptr->inactive_limit = conf->inactive_limit; diff --git a/src/slurmctld/read_config.c b/src/slurmctld/read_config.c index 49bbd44480f3e73aa0f629a2e8325e3659cb13db..20fa0bc1d0ad30e2da1fde79b2c3eb7e6db619cc 100644 --- a/src/slurmctld/read_config.c +++ b/src/slurmctld/read_config.c @@ -760,13 +760,12 @@ int read_slurm_conf(int recover, bool reconfig) if (reconfig) { load_all_resv_state(0); - if (recover == 2) - restore_node_features(); } else { load_all_resv_state(recover); if (recover >= 1) (void) trigger_state_restore(); } + restore_node_features(recover); /* sort config_list by weight for scheduling */ list_sort(config_list, &list_compare_config); @@ -886,6 +885,9 @@ static int _restore_node_state(int recover, xfree(node_ptr->features); node_ptr->features = old_node_ptr->features; old_node_ptr->features = NULL; + xfree(node_ptr->gres); + node_ptr->gres = old_node_ptr->gres; + old_node_ptr->gres = NULL; } if (old_node_ptr->arch) { xfree(node_ptr->arch); diff --git a/src/slurmctld/slurmctld.h b/src/slurmctld/slurmctld.h index f650653326efe0a0d76eabf1f5f778904a3796b1..af2f5ffc26c81bb5f40c22d8dae27e4e6fa988bc 100644 --- a/src/slurmctld/slurmctld.h +++ b/src/slurmctld/slurmctld.h @@ -392,6 +392,7 @@ struct job_record { * actual or expected */ uint32_t exit_code; /* exit code for job (status from * wait call) */ + char *gres; /* generic resources */ uint32_t group_id; /* group submitted under */ uint32_t job_id; /* job ID */ struct job_record *job_next; /* next entry with same hash index */ @@ -500,6 +501,7 @@ struct step_record { uint16_t exclusive; /* dedicated resources for the step */ uint32_t exit_code; /* highest exit code from any task */ bitstr_t *exit_node_bitmap; /* bitmap of exited nodes */ + char *gres; /* generic resources required */ char *host; /* host for srun communications */ struct job_record* job_ptr; /* ptr to the job that owns the step */ jobacctinfo_t *jobacct; /* keep track of process info in the @@ -1115,7 +1117,7 @@ extern int load_all_job_state ( void ); * load_all_node_state - Load the node state from file, recover on slurmctld * restart. Execute this after loading the configuration file data. * Data goes into common storage. - * IN state_only - if true over-write only node state, features and reason + * IN state_only - if true over-write only node state, features, gres and reason * RET 0 or error code */ extern int load_all_node_state ( bool state_only ); @@ -1351,10 +1353,13 @@ extern void reset_job_bitmaps (void); extern void reset_job_priority(void); /* - * restore_node_features - Restore node features based upon state - * saved (preserves interactive updates) + * restore_node_features - Make node and config (from slurm.conf) fields + * consistent for Features, Gres and Weight + * IN recover - + * 0, 1 - use data from config record, built using slurm.conf + * 2 = use data from node record, built from saved state */ -extern void restore_node_features(void); +extern void restore_node_features(int recover); /* Update time stamps for job step resume */ extern void resume_job_step(struct job_record *job_ptr); diff --git a/src/slurmctld/step_mgr.c b/src/slurmctld/step_mgr.c index d63dddde451aa4b77291e08f370e956b8595afe5..282ca8d0426220cea157c9ebd9cced962850d4f1 100644 --- a/src/slurmctld/step_mgr.c +++ b/src/slurmctld/step_mgr.c @@ -115,7 +115,6 @@ static struct step_record * _create_step_record(struct job_record *job_ptr) step_ptr->start_time = time(NULL) ; step_ptr->time_limit = INFINITE ; step_ptr->jobacct = jobacct_gather_g_create(NULL); - step_ptr->ckpt_dir = NULL; step_ptr->requid = -1; if (list_append (job_ptr->step_list, step_ptr) == NULL) @@ -174,6 +173,7 @@ static void _free_step_rec(struct step_record *step_ptr) xfree(step_ptr->resv_ports); xfree(step_ptr->network); xfree(step_ptr->ckpt_dir); + xfree(step_ptr->gres); xfree(step_ptr); } @@ -243,8 +243,8 @@ dump_step_desc(job_step_create_request_msg_t *step_spec) debug3(" mem_per_cpu=%u resv_port_cnt=%u immediate=%u no_kill=%u", step_spec->mem_per_cpu, step_spec->resv_port_cnt, step_spec->immediate, step_spec->no_kill); - debug3(" overcommit=%d time_limit=%u", - step_spec->overcommit, step_spec->time_limit); + debug3(" overcommit=%d time_limit=%u gres=%s", + step_spec->overcommit, step_spec->time_limit, step_spec->gres); } @@ -1348,6 +1348,7 @@ step_create(job_step_create_request_msg_t *step_specs, } if (_test_strlen(step_specs->ckpt_dir, "ckpt_dir", 1024) || + _test_strlen(step_specs->gres, "gres", 1024) || _test_strlen(step_specs->host, "host", 1024) || _test_strlen(step_specs->name, "name", 1024) || _test_strlen(step_specs->network, "network", 1024) || @@ -1462,6 +1463,7 @@ step_create(job_step_create_request_msg_t *step_specs, step_ptr->exit_code = NO_VAL; step_ptr->exclusive = step_specs->exclusive; step_ptr->ckpt_dir = xstrdup(step_specs->ckpt_dir); + step_ptr->gres = xstrdup(step_specs->gres); step_ptr->no_kill = step_specs->no_kill; /* step's name and network default to job's values if not @@ -1718,8 +1720,8 @@ static void _pack_ctld_job_step_info(struct step_record *step_ptr, Buf buffer) pack32(step_ptr->cpu_count, buffer); #endif pack32(task_cnt, buffer); - pack32(step_ptr->time_limit, buffer); + pack_time(step_ptr->start_time, buffer); if (IS_JOB_SUSPENDED(step_ptr->job_ptr)) { run_time = step_ptr->pre_sus_time; @@ -1730,6 +1732,7 @@ static void _pack_ctld_job_step_info(struct step_record *step_ptr, Buf buffer) difftime(time(NULL), begin_time); } pack_time(run_time, buffer); + packstr(step_ptr->job_ptr->partition, buffer); packstr(step_ptr->resv_ports, buffer); packstr(node_list, buffer); @@ -1737,6 +1740,7 @@ static void _pack_ctld_job_step_info(struct step_record *step_ptr, Buf buffer) packstr(step_ptr->network, buffer); pack_bit_fmt(pack_bitstr, buffer); packstr(step_ptr->ckpt_dir, buffer); + packstr(step_ptr->gres, buffer); } /* @@ -2364,6 +2368,7 @@ extern void dump_job_step_state(struct step_record *step_ptr, Buf buffer) packstr(step_ptr->name, buffer); packstr(step_ptr->network, buffer); packstr(step_ptr->ckpt_dir, buffer); + packstr(step_ptr->gres, buffer); pack16(step_ptr->batch_step, buffer); if (!step_ptr->batch_step) { pack_slurm_step_layout(step_ptr->step_layout, buffer, @@ -2391,12 +2396,70 @@ extern int load_step_state(struct job_record *job_ptr, Buf buffer, time_t start_time, pre_sus_time, tot_sus_time, ckpt_time; char *host = NULL, *ckpt_dir = NULL, *core_job = NULL; char *resv_ports = NULL, *name = NULL, *network = NULL; - char *bit_fmt = NULL; + char *bit_fmt = NULL, *gres = NULL; switch_jobinfo_t *switch_tmp = NULL; check_jobinfo_t check_tmp = NULL; slurm_step_layout_t *step_layout = NULL; - if(protocol_version >= SLURM_2_1_PROTOCOL_VERSION) { + if(protocol_version >= SLURM_2_2_PROTOCOL_VERSION) { + safe_unpack32(&step_id, buffer); + safe_unpack16(&cyclic_alloc, buffer); + safe_unpack16(&port, buffer); + safe_unpack16(&ckpt_interval, buffer); + safe_unpack16(&cpus_per_task, buffer); + safe_unpack16(&resv_port_cnt, buffer); + + safe_unpack8(&no_kill, buffer); + + safe_unpack32(&cpu_count, buffer); + safe_unpack32(&mem_per_cpu, buffer); + safe_unpack32(&exit_code, buffer); + if (exit_code != NO_VAL) { + safe_unpackstr_xmalloc(&bit_fmt, &name_len, buffer); + safe_unpack16(&bit_cnt, buffer); + } + safe_unpack32(&core_size, buffer); + if (core_size) + safe_unpackstr_xmalloc(&core_job, &name_len, buffer); + + safe_unpack32(&time_limit, buffer); + safe_unpack_time(&start_time, buffer); + safe_unpack_time(&pre_sus_time, buffer); + safe_unpack_time(&tot_sus_time, buffer); + safe_unpack_time(&ckpt_time, buffer); + + safe_unpackstr_xmalloc(&host, &name_len, buffer); + safe_unpackstr_xmalloc(&resv_ports, &name_len, buffer); + safe_unpackstr_xmalloc(&name, &name_len, buffer); + safe_unpackstr_xmalloc(&network, &name_len, buffer); + safe_unpackstr_xmalloc(&ckpt_dir, &name_len, buffer); + safe_unpackstr_xmalloc(&gres, &name_len, buffer); + + safe_unpack16(&batch_step, buffer); + if (!batch_step) { + if (unpack_slurm_step_layout(&step_layout, buffer, + protocol_version)) + goto unpack_error; + switch_alloc_jobinfo(&switch_tmp); + if (switch_unpack_jobinfo(switch_tmp, buffer)) + goto unpack_error; + } + checkpoint_alloc_jobinfo(&check_tmp); + if (checkpoint_unpack_jobinfo(check_tmp, buffer)) + goto unpack_error; + + /* validity test as possible */ + if (cyclic_alloc > 1) { + error("Invalid data for job %u.%u: cyclic_alloc=%u", + job_ptr->job_id, step_id, cyclic_alloc); + goto unpack_error; + } + if (no_kill > 1) { + error("Invalid data for job %u.%u: no_kill=%u", + job_ptr->job_id, step_id, no_kill); + goto unpack_error; + } + } else { safe_unpack32(&step_id, buffer); safe_unpack16(&cyclic_alloc, buffer); safe_unpack16(&port, buffer); @@ -2470,6 +2533,7 @@ extern int load_step_state(struct job_record *job_ptr, Buf buffer, step_ptr->network = network; step_ptr->no_kill = no_kill; step_ptr->ckpt_dir = ckpt_dir; + step_ptr->gres = gres; step_ptr->port = port; step_ptr->ckpt_interval= ckpt_interval; step_ptr->mem_per_cpu = mem_per_cpu; @@ -2526,6 +2590,7 @@ extern int load_step_state(struct job_record *job_ptr, Buf buffer, xfree(name); xfree(network); xfree(ckpt_dir); + xfree(gres); xfree(bit_fmt); xfree(core_job); if (switch_tmp) diff --git a/src/squeue/opts.c b/src/squeue/opts.c index 660be3012b397acbeb12ea6f1b5a7427756bf997..d6be40bd4d5101bfa3710e51efb1047c46596007 100644 --- a/src/squeue/opts.c +++ b/src/squeue/opts.c @@ -4,7 +4,7 @@ * $Id$ ***************************************************************************** * Copyright (C) 2002-2007 The Regents of the University of California. - * Copyright (C) 2008-2009 Lawrence Livermore National Security. + * Copyright (C) 2008-2010 Lawrence Livermore National Security. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Joey Ekstrom <ekstrom1@llnl.gov>, Morris Jette <jette1@llnl.gov> * CODE-OCEC-09-009. All rights reserved. @@ -445,6 +445,10 @@ extern int parse_format( char* format ) field_size, right_justify, suffix ); + else if (field[0] == 'b') + step_format_add_gres( params.format_list, + field_size, + right_justify, suffix ); else if (field[0] == 'i') step_format_add_id( params.format_list, field_size, @@ -500,6 +504,10 @@ extern int parse_format( char* format ) field_size, right_justify, suffix ); + else if (field[0] == 'b') + job_format_add_gres( params.format_list, + field_size, right_justify, + suffix ); else if (field[0] == 'c') job_format_add_min_cpus( params.format_list, field_size, @@ -536,16 +544,15 @@ extern int parse_format( char* format ) field_size, right_justify, suffix ); - else if (field[0] == 'G') - job_format_add_group_id( params.format_list, - field_size, - right_justify, - suffix ); else if (field[0] == 'g') job_format_add_group_name( params.format_list, field_size, right_justify, suffix ); + else if (field[0] == 'G') + job_format_add_gres( params.format_list, + field_size, right_justify, + suffix ); else if (field[0] == 'h') job_format_add_shared( params.format_list, field_size, diff --git a/src/squeue/print.c b/src/squeue/print.c index 54d4468dfd9562bfe4de2b7c674c3f422104a2cb..3957ad286c194099a7ba5dde7c580e3a8bf7e1c0 100644 --- a/src/squeue/print.c +++ b/src/squeue/print.c @@ -2,10 +2,9 @@ * print.c - squeue print job functions ***************************************************************************** * Copyright (C) 2002-2007 The Regents of the University of California. - * Copyright (C) 2008-2009 Lawrence Livermore National Security. + * Copyright (C) 2008-2010 Lawrence Livermore National Security. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). - * Written by Joey Ekstrom <ekstrom1@llnl.gov>, - * Morris Jette <jette1@llnl.gov>, et. al. + * Written by Joey Ekstrom <ekstrom1@llnl.gov>, et. al. * CODE-OCEC-09-009. All rights reserved. * * This file is part of SLURM, a resource management program. @@ -394,6 +393,17 @@ int _print_job_user_name(job_info_t * job, int width, bool right, char* suffix) return SLURM_SUCCESS; } +int _print_job_gres(job_info_t * job, int width, bool right, char* suffix) +{ + if (job == NULL) /* Print the Header instead */ + _print_str("GRES", width, right, true); + else + _print_str(job->gres, width, right, true); + if (suffix) + printf("%s", suffix); + return SLURM_SUCCESS; +} + int _print_job_group_id(job_info_t * job, int width, bool right, char* suffix) { if (job == NULL) /* Print the Header instead */ @@ -1249,6 +1259,18 @@ int _print_step_num_tasks(job_step_info_t * step, int width, bool right, return SLURM_SUCCESS; } +int _print_step_gres(job_step_info_t * step, int width, bool right, + char* suffix) +{ + if (step == NULL) /* Print the Header instead */ + _print_str("GRES", width, right, true); + else + _print_str(step->gres, width, right, true); + if (suffix) + printf("%s", suffix); + return SLURM_SUCCESS; +} + /* filter job records per input specifications, * returns >0 if job should be filter out (not printed) */ static int _filter_job(job_info_t * job) diff --git a/src/squeue/print.h b/src/squeue/print.h index 5a06e2b72b38ae1cda3fbfaf5444c467b2b18f73..a63cac5be7e9c1cde336dde0e60b4bb832494a60 100644 --- a/src/squeue/print.h +++ b/src/squeue/print.h @@ -2,7 +2,7 @@ * print.h - squeue print job definitions ***************************************************************************** * Copyright (C) 2002-2007 The Regents of the University of California. - * Copyright (C) 2008-2009 Lawrence Livermore National Security + * Copyright (C) 2008-2010 Lawrence Livermore National Security * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Joey Ekstrom <ekstrom1@llnl.gov> * CODE-OCEC-09-009. All rights reserved. @@ -99,6 +99,8 @@ int job_format_add_function(List list, int width, bool right_justify, job_format_add_function(list,wid,right,suffix,_print_job_user_name) #define job_format_add_user_id(list,wid,right,suffix) \ job_format_add_function(list,wid,right,suffix,_print_job_user_id) +#define job_format_add_gres(list,wid,right,suffix) \ + job_format_add_function(list,wid,right,suffix,_print_job_gres) #define job_format_add_group_name(list,wid,right,suffix) \ job_format_add_function(list,wid,right,suffix,_print_job_group_name) #define job_format_add_group_id(list,wid,right,suffix) \ @@ -194,6 +196,8 @@ int _print_job_user_id(job_info_t * job, int width, bool right_justify, char* suffix); int _print_job_user_name(job_info_t * job, int width, bool right_justify, char* suffix); +int _print_job_gres(job_info_t * job, int width, bool right_justify, + char* suffix); int _print_job_group_id(job_info_t * job, int width, bool right_justify, char* suffix); int _print_job_group_name(job_info_t * job, int width, bool right_justify, @@ -296,6 +300,8 @@ int step_format_add_function(List list, int width, bool right_justify, step_format_add_function(list,wid,right,suffix,_print_step_name) #define step_format_add_num_tasks(list,wid,right,suffix) \ step_format_add_function(list,wid,right,suffix,_print_step_num_tasks) +#define step_format_add_gres(list,wid,right,suffix) \ + step_format_add_function(list,wid,right,suffix,_print_step_gres) /***************************************************************************** * Step Line Print Functions @@ -322,5 +328,7 @@ int _print_step_nodes(job_step_info_t * step, int width, bool right_justify, char *suffix); int _print_step_num_tasks(job_step_info_t * step, int width, bool right_justify, char *suffix); +int _print_step_gres(job_step_info_t * step, int width, + bool right_justify, char *suffix); #endif diff --git a/src/squeue/sort.c b/src/squeue/sort.c index cd16b053a1fd2d3c5db37de2925f6749e89d080a..ed7bf22ff4745ac3d8779d3d020e38d6dc575c01 100644 --- a/src/squeue/sort.c +++ b/src/squeue/sort.c @@ -2,7 +2,7 @@ * sort.c - squeue sorting functions ***************************************************************************** * Copyright (C) 2002-2007 The Regents of the University of California. - * Copyright (C) 2008-2009 Lawrence Livermore National Security. + * Copyright (C) 2008-2010 Lawrence Livermore National Security. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Morris Jette <jette1@llnl.gov>, et. al. * CODE-OCEC-09-009. All rights reserved. @@ -51,6 +51,7 @@ static bool reverse_order; +static int _sort_job_by_gres(void *void1, void *void2); static int _sort_job_by_group_id(void *void1, void *void2); static int _sort_job_by_group_name(void *void1, void *void2); static int _sort_job_by_id(void *void1, void *void2); @@ -77,6 +78,7 @@ static int _sort_job_by_user_id(void *void1, void *void2); static int _sort_job_by_user_name(void *void1, void *void2); static int _sort_job_by_reservation(void *void1, void *void2); +static int _sort_step_by_gres(void *void1, void *void2); static int _sort_step_by_id(void *void1, void *void2); static int _sort_step_by_node_list(void *void1, void *void2); static int _sort_step_by_partition(void *void1, void *void2); @@ -105,7 +107,9 @@ void sort_job_list(List job_list) if ((i > 0) && (params.sort[i-1] == '-')) reverse_order = true; - if (params.sort[i] == 'c') + if (params.sort[i] == 'b') + list_sort(job_list, _sort_job_by_gres); + else if (params.sort[i] == 'c') ; /* sort_job_by_min_cpus_per_node */ else if (params.sort[i] == 'C') list_sort(job_list, _sort_job_by_num_cpus); @@ -194,7 +198,9 @@ void sort_step_list(List step_list) if ((i > 0) && (params.sort[i-1] == '-')) reverse_order = true; - if (params.sort[i] == 'i') + if (params.sort[i] == 'b') + list_sort(step_list, _sort_step_by_gres); + else if (params.sort[i] == 'i') list_sort(step_list, _sort_step_by_id); else if (params.sort[i] == 'N') list_sort(step_list, _sort_step_by_node_list); @@ -216,6 +222,24 @@ void sort_step_list(List step_list) /***************************************************************************** * Local Job Sort Functions *****************************************************************************/ +static int _sort_job_by_gres(void *void1, void *void2) +{ + int diff; + job_info_t *job1 = (job_info_t *) void1; + job_info_t *job2 = (job_info_t *) void2; + char *val1 = "", *val2 = ""; + + if (job1->gres) + val1 = job1->gres; + if (job2->gres) + val2 = job2->gres; + diff = strcmp(val1, val2); + + if (reverse_order) + diff = -diff; + return diff; +} + static int _sort_job_by_group_id(void *void1, void *void2) { int diff; @@ -668,6 +692,24 @@ static int _sort_job_by_reservation(void *void1, void *void2) /***************************************************************************** * Local Step Sort Functions *****************************************************************************/ +static int _sort_step_by_gres(void *void1, void *void2) +{ + int diff; + job_step_info_t *step1 = (job_step_info_t *) void1; + job_step_info_t *step2 = (job_step_info_t *) void2; + char *val1 = "", *val2 = ""; + + if (step1->gres) + val1 = step1->gres; + if (step2->gres) + val2 = step2->gres; + diff = strcmp(val1, val2); + + if (reverse_order) + diff = -diff; + return diff; +} + static int _sort_step_by_id(void *void1, void *void2) { int diff; diff --git a/src/srun/allocate.c b/src/srun/allocate.c index 593632905b999672ef333d038a5de7d7ac435d4a..3d5fed6f2af631d12ee59c460fb43821bb959e78 100644 --- a/src/srun/allocate.c +++ b/src/srun/allocate.c @@ -529,6 +529,7 @@ job_desc_msg_create_from_opts (void) j->contiguous = opt.contiguous; j->features = opt.constraints; + j->gres = opt.gres; if (opt.immediate == 1) j->immediate = opt.immediate; if (opt.job_name) @@ -752,6 +753,7 @@ create_job_step(srun_job_t *job, bool use_all_cpus) if (opt.mem_per_cpu != NO_VAL) job->ctx_params.mem_per_cpu = opt.mem_per_cpu; + job->ctx_params.gres = opt.gres; if (use_all_cpus) job->ctx_params.cpu_count = job->cpu_count; @@ -763,6 +765,7 @@ create_job_step(srun_job_t *job, bool use_all_cpus) job->ctx_params.relative = (uint16_t)opt.relative; job->ctx_params.ckpt_interval = (uint16_t)opt.ckpt_interval; job->ctx_params.ckpt_dir = opt.ckpt_dir; + job->ctx_params.gres = opt.gres; job->ctx_params.exclusive = (uint16_t)opt.exclusive; if (opt.immediate == 1) job->ctx_params.immediate = (uint16_t)opt.immediate; diff --git a/src/srun/opt.c b/src/srun/opt.c index 40fee0d6c80987b62747c112b6d6c0629003d83e..6c332b7c3ed69c769a0c1a80462f8d8fed44d268 100644 --- a/src/srun/opt.c +++ b/src/srun/opt.c @@ -182,6 +182,7 @@ #define LONG_OPT_SIGNAL 0x14e #define LONG_OPT_DEBUG_SLURMD 0x14f #define LONG_OPT_TIME_MIN 0x150 +#define LONG_OPT_GRES 0x151 /*---- global variables, defined in opt.h ----*/ int _verbose; @@ -401,6 +402,7 @@ static void _opt_default() opt.hold = false; opt.constraints = NULL; + opt.gres = NULL; opt.contiguous = false; opt.nodelist = NULL; opt.exc_nodes = NULL; @@ -774,6 +776,7 @@ static void set_options(const int argc, char **argv) {"exclusive", no_argument, 0, LONG_OPT_EXCLUSIVE}, {"get-user-env", optional_argument, 0, LONG_OPT_GET_USER_ENV}, {"gid", required_argument, 0, LONG_OPT_GID}, + {"gres", required_argument, 0, LONG_OPT_GRES}, {"help", no_argument, 0, LONG_OPT_HELP}, {"hint", required_argument, 0, LONG_OPT_HINT}, {"ioload-image", required_argument, 0, LONG_OPT_RAMDISK_IMAGE}, @@ -1433,6 +1436,14 @@ static void set_options(const int argc, char **argv) xfree(opt.time_min_str); opt.time_min_str = xstrdup(optarg); break; + case LONG_OPT_GRES: + if (!strcasecmp(optarg, "help")) { + print_gres_help(); + exit(0); + } + xfree(opt.gres); + opt.gres = xstrdup(optarg); + break; default: if (spank_process_option (opt_char, optarg) < 0) { exit(error_exit); @@ -2151,6 +2162,8 @@ static void _opt_list() info("comment : %s", opt.comment); info("dependency : %s", opt.dependency); + if (opt.gres) + info("gres : %s", opt.gres); info("exclusive : %s", tf_(opt.exclusive)); info("qos : %s", opt.qos); if (opt.shared != (uint16_t) NO_VAL) @@ -2230,7 +2243,7 @@ static void _usage(void) " [-c ncpus] [-r n] [-p partition] [--hold] [-t minutes]\n" " [-D path] [--immediate[=secs]] [--overcommit] [--no-kill]\n" " [--share] [--label] [--unbuffered] [-m dist] [-J jobname]\n" -" [--jobid=id] [--verbose] [--slurmd_debug=#]\n" +" [--jobid=id] [--verbose] [--slurmd_debug=#] [--gres=list]\n" " [--core=type] [-T threads] [-W sec] [--checkpoint=time]\n" " [--checkpoint-dir=dir] [--licenses=names]\n" " [--restart-dir=dir] [--qos=qos] [--time-min=minutes]\n" @@ -2281,6 +2294,7 @@ static void _help(void) " -E, --preserve-env env vars for node and task counts override\n" " command-line flags\n" " --get-user-env used by Moab. See srun man page.\n" +" --gres=list required generic resources\n" " -H, --hold submit job in held state\n" " -i, --input=in location of stdin redirection\n" " -I, --immediate[=secs] exit if resources not available in \"secs\"\n" diff --git a/src/srun/opt.h b/src/srun/opt.h index 0c4cf14b2e51b7266b1865f9e4577b1d37019479..388579bc0a602b8f76bc0bf80d361263a88c236c 100644 --- a/src/srun/opt.h +++ b/src/srun/opt.h @@ -185,6 +185,7 @@ typedef struct srun_options { int32_t mem_per_cpu; /* --mem-per-cpu=n */ long pn_min_tmp_disk; /* --tmp=n */ char *constraints; /* --constraints=, -C constraint*/ + char *gres; /* --gres= */ bool contiguous; /* --contiguous */ char *nodelist; /* --nodelist=node1,node2,... */ char *alloc_nodelist; /* grabbed from the environment */ diff --git a/src/sview/job_info.c b/src/sview/job_info.c index b963ec07fda4a4859805009b5fe9e8e335e22bba..ffe030e9ebbd1ea3922ffa49983b40eaee195887 100644 --- a/src/sview/job_info.c +++ b/src/sview/job_info.c @@ -97,6 +97,7 @@ enum { #ifdef HAVE_BG SORTID_GEOMETRY, #endif + SORTID_GRES, SORTID_GROUP_ID, #ifdef HAVE_BG #ifdef HAVE_BGL @@ -321,6 +322,8 @@ static display_data_t display_data_job[] = { FALSE, EDIT_NONE, refresh_job, create_model_job, admin_edit_job}, {G_TYPE_STRING, SORTID_FEATURES, "Features", FALSE, EDIT_TEXTBOX, refresh_job, create_model_job, admin_edit_job}, + {G_TYPE_STRING, SORTID_GRES, "Gres", + FALSE, EDIT_TEXTBOX, refresh_job, create_model_job, admin_edit_job}, {G_TYPE_STRING, SORTID_LICENSES, "Licenses", FALSE, EDIT_TEXTBOX, refresh_job, create_model_job, admin_edit_job}, {G_TYPE_STRING, SORTID_DEPENDENCY, "Dependency", @@ -812,6 +815,10 @@ static const char *_set_job_msg(job_desc_msg_t *job_msg, const char *new_text, job_msg->features = xstrdup(new_text); type = "features"; break; + case SORTID_GRES: + job_msg->gres = xstrdup(new_text); + type = "gres"; + break; case SORTID_LICENSES: job_msg->licenses = xstrdup(new_text); type = "licenses"; @@ -1310,6 +1317,11 @@ static void _layout_job_record(GtkTreeView *treeview, SORTID_FEATURES), job_ptr->features); + add_display_treestore_line(update, treestore, &iter, + find_col_name(display_data_job, + SORTID_GRES), + job_ptr->gres); + #ifdef HAVE_BG add_display_treestore_line(update, treestore, &iter, find_col_name(display_data_job, @@ -1955,6 +1967,8 @@ static void _update_job_record(sview_job_info_t *sview_job_info_ptr, gtk_tree_store_set(treestore, iter, SORTID_FEATURES, job_ptr->features, -1); + gtk_tree_store_set(treestore, iter, + SORTID_GRES, job_ptr->gres, -1); gtk_tree_store_set(treestore, iter, SORTID_LICENSES, job_ptr->licenses, -1); if (job_ptr->state_desc) @@ -2029,6 +2043,11 @@ static void _layout_step_record(GtkTreeView *treeview, SORTID_JOBID), tmp_char); + add_display_treestore_line(update, treestore, &iter, + find_col_name(display_data_job, + SORTID_GRES), + step_ptr->gres); + add_display_treestore_line(update, treestore, &iter, find_col_name(display_data_job, SORTID_NAME), @@ -2141,6 +2160,8 @@ static void _update_step_record(job_step_info_t *step_ptr, SORTID_JOBID, step_ptr->step_id, -1); gtk_tree_store_set(treestore, iter, SORTID_PARTITION, step_ptr->partition, -1); + gtk_tree_store_set(treestore, iter, + SORTID_GRES, step_ptr->gres, -1); /* #ifdef HAVE_BG */ /* gtk_tree_store_set(treestore, iter, */ /* SORTID_BLOCK, */ diff --git a/src/sview/node_info.c b/src/sview/node_info.c index 084cfbc463bb9aef1a1b9a8ee2aa292d8e8e30aa..9cf68224a1ff322e29724422ec855151fc1e6c98 100644 --- a/src/sview/node_info.c +++ b/src/sview/node_info.c @@ -3,7 +3,7 @@ * mode of sview. ***************************************************************************** * Copyright (C) 2004-2007 The Regents of the University of California. - * Copyright (C) 2008-2009 Lawrence Livermore National Security. + * Copyright (C) 2008-2010 Lawrence Livermore National Security. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Danny Auble <da@llnl.gov> * @@ -45,6 +45,7 @@ enum { SORTID_DISK, SORTID_ERR_CPUS, SORTID_FEATURES, + SORTID_GRES, SORTID_MEMORY, SORTID_NAME, SORTID_REASON, @@ -90,6 +91,8 @@ static display_data_t display_data_node[] = { create_model_node, admin_edit_node}, {G_TYPE_STRING, SORTID_FEATURES, "Features", FALSE, EDIT_TEXTBOX, refresh_node, create_model_node, admin_edit_node}, + {G_TYPE_STRING, SORTID_GRES, "Gres", FALSE, + EDIT_TEXTBOX, refresh_node, create_model_node, admin_edit_node}, {G_TYPE_STRING, SORTID_BOOT_TIME, "BootTime", FALSE, EDIT_NONE, refresh_node, create_model_node, admin_edit_node}, {G_TYPE_STRING, SORTID_SLURMD_START_TIME, "SlurmdStartTime", FALSE, @@ -118,6 +121,7 @@ static display_data_t options_data_node[] = { {G_TYPE_STRING, NODE_PAGE, "Make Node Idle", TRUE, ADMIN_PAGE}, #endif {G_TYPE_STRING, NODE_PAGE, "Update Features", TRUE, ADMIN_PAGE}, + {G_TYPE_STRING, NODE_PAGE, "Update Gres", TRUE, ADMIN_PAGE}, {G_TYPE_STRING, JOB_PAGE, "Jobs", TRUE, NODE_PAGE}, #ifdef HAVE_BG {G_TYPE_STRING, BLOCK_PAGE, "Blocks", TRUE, NODE_PAGE}, @@ -244,6 +248,10 @@ static void _layout_node_record(GtkTreeView *treeview, find_col_name(display_data_node, SORTID_FEATURES), node_ptr->features); + add_display_treestore_line(update, treestore, &iter, + find_col_name(display_data_node, + SORTID_GRES), + node_ptr->gres); add_display_treestore_line(update, treestore, &iter, find_col_name(display_data_node, SORTID_BOOT_TIME), @@ -336,6 +344,8 @@ static void _update_node_record(sview_node_info_t *sview_node_info_ptr, node_ptr->weight, -1); gtk_tree_store_set(treestore, iter, SORTID_FEATURES, node_ptr->features, -1); + gtk_tree_store_set(treestore, iter, SORTID_GRES, + node_ptr->gres, -1); gtk_tree_store_set(treestore, iter, SORTID_BOOT_TIME, sview_node_info_ptr->boot_time, -1); gtk_tree_store_set(treestore, iter, SORTID_SLURMD_START_TIME, @@ -781,6 +791,92 @@ end_it: return rc; } +extern int update_gres_node(GtkDialog *dialog, const char *nodelist, + const char *old_gres) +{ + char tmp_char[100]; + char *edit = NULL; + GtkWidget *entry = NULL; + GtkWidget *label = NULL; + update_node_msg_t *node_msg = xmalloc(sizeof(update_node_msg_t)); + int response = 0; + int no_dialog = 0; + int rc = SLURM_SUCCESS; + + if(!dialog) { + snprintf(tmp_char, sizeof(tmp_char), + "Update Gres for Node(s) %s?", nodelist); + + dialog = GTK_DIALOG( + gtk_dialog_new_with_buttons( + tmp_char, + GTK_WINDOW(main_window), + GTK_DIALOG_MODAL + | GTK_DIALOG_DESTROY_WITH_PARENT, + NULL)); + no_dialog = 1; + } + label = gtk_dialog_add_button(dialog, + GTK_STOCK_YES, GTK_RESPONSE_OK); + gtk_window_set_default(GTK_WINDOW(dialog), label); + gtk_dialog_add_button(dialog, + GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL); + + node_msg->node_names = xstrdup(nodelist); + node_msg->gres = NULL; + node_msg->reason = NULL; + node_msg->node_state = (uint16_t) NO_VAL; + + snprintf(tmp_char, sizeof(tmp_char), + "Gres for Node(s) %s?", nodelist); + label = gtk_label_new(tmp_char); + gtk_box_pack_start(GTK_BOX(dialog->vbox), + label, FALSE, FALSE, 0); + + entry = create_entry(); + if(!entry) + goto end_it; + + if(old_gres) + gtk_entry_set_text(GTK_ENTRY(entry), old_gres); + + gtk_box_pack_start(GTK_BOX(dialog->vbox), entry, TRUE, TRUE, 0); + gtk_widget_show_all(GTK_WIDGET(dialog)); + + response = gtk_dialog_run(dialog); + if (response == GTK_RESPONSE_OK) { + node_msg->gres = + xstrdup(gtk_entry_get_text(GTK_ENTRY(entry))); + if(!node_msg->gres) { + edit = g_strdup_printf("No gres given."); + display_edit_note(edit); + g_free(edit); + goto end_it; + } + if(slurm_update_node(node_msg) == SLURM_SUCCESS) { + edit = g_strdup_printf( + "Nodes %s updated successfully.", + nodelist); + display_edit_note(edit); + g_free(edit); + + } else { + edit = g_strdup_printf( + "Problem updating nodes %s.", + nodelist); + display_edit_note(edit); + g_free(edit); + } + } + +end_it: + slurm_free_update_node_msg(node_msg); + if(no_dialog) + gtk_widget_destroy(GTK_WIDGET(dialog)); + + return rc; +} + extern int update_state_node(GtkDialog *dialog, const char *nodelist, const char *type) { @@ -811,6 +907,7 @@ extern int update_state_node(GtkDialog *dialog, GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL); node_msg->features = NULL; + node_msg->gres = NULL; node_msg->reason = NULL; node_msg->node_names = xstrdup(nodelist); @@ -1416,24 +1513,28 @@ extern void admin_menu_node_name(char *name, GdkEventButton *event) extern void admin_node(GtkTreeModel *model, GtkTreeIter *iter, char *type) { char *name = NULL; - char *old_features = NULL; + char *old_value = NULL; gtk_tree_model_get(model, iter, SORTID_NAME, &name, -1); - if(!strcasecmp("Update Features", type)) /* get old features */ + if(!strcasecmp("Update Features", type)) { /* get old features */ gtk_tree_model_get(model, iter, SORTID_FEATURES, - &old_features, -1); + &old_value, -1); + } else if(!strcasecmp("Update Gres", type)) { /* get old gres */ + gtk_tree_model_get(model, iter, SORTID_GRES, + &old_value, -1); + } - admin_node_name(name, old_features, type); + admin_node_name(name, old_value, type); if(name) g_free(name); - if(old_features) - g_free(old_features); + if(old_value) + g_free(old_value); return; } -extern void admin_node_name(char *name, char *old_features, char *type) +extern void admin_node_name(char *name, char *old_value, char *type) { GtkWidget *popup = gtk_dialog_new_with_buttons( type, @@ -1443,7 +1544,9 @@ extern void admin_node_name(char *name, char *old_features, char *type) gtk_window_set_transient_for(GTK_WINDOW(popup), NULL); if(!strcasecmp("Update Features", type)) { /* update features */ - update_features_node(GTK_DIALOG(popup), name, old_features); + update_features_node(GTK_DIALOG(popup), name, old_value); + } else if(!strcasecmp("Update Gres", type)) { /* update gres */ + update_gres_node(GTK_DIALOG(popup), name, old_value); } else /* something that has to deal with a node state change */ update_state_node(GTK_DIALOG(popup), name, type); diff --git a/src/sview/sview.h b/src/sview/sview.h index 9d4bd00a0deaa0c1ba3b1ff258c4777c864004b4..7aff8fe6082a9e992cb413d166ccdc1fcee45c80 100644 --- a/src/sview/sview.h +++ b/src/sview/sview.h @@ -400,7 +400,7 @@ extern void popup_all_node(GtkTreeModel *model, GtkTreeIter *iter, int id); extern void popup_all_node_name(char *name, int id); extern void admin_menu_node_name(char *name, GdkEventButton *event); extern void admin_node(GtkTreeModel *model, GtkTreeIter *iter, char *type); -extern void admin_node_name(char *name, char *old_features, char *type); +extern void admin_node_name(char *name, char *old_value, char *type); // resv_info.c extern void refresh_resv(GtkAction *action, gpointer user_data);