Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/ux.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ srun ...

HPC applications use the Slurm QPU resources assigned to the Slurm job.

Environment variables provide more details for use by the appliction, e.g. `SLURM_JOB_QPU_RESOURCES` listing the quantum resource names (comma separated if there are several provided).
Environment variables provide more details for use by the appliction, e.g. `QRMI_JOB_QPU_RESOURCES` listing the quantum resource names (comma separated if there are several provided). `SLURM_JOB_QPU_RESOURCES` is still exported as a legacy alias.
These variables will be used by QRMI.
See the README files in the various QRMI flavor directories ([ibm](https://github.com/qiskit-community/qrmi/blob/main/examples/qiskit_primitives/ibm/README.md), [pasqal](https://github.com/qiskit-community/qrmi/blob/main/examples/qiskit_primitives/pasqal/README.md)) for details.

Expand Down
6 changes: 4 additions & 2 deletions plugins/spank_qrmi/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -208,8 +208,10 @@ This plugin also set the following 2 environment variables which will be referre

| environment varilables | descriptions |
| ---- | ---- |
| SLURM_JOB_QPU_RESOURCES | Comma separated list of QPU resources to use at runtime. Undocumented resources will be filtered out. For example, `qpu1,qpu2`. |
| SLURM_JOB_QPU_TYPES | Comma separated list of Resource type (`ibm-quantum-system`, `qiskit-runtime-service` and `pasqal-cloud`). For example, `ibm-quantum-system,ibm-quantum-system` |
| QRMI_JOB_QPU_RESOURCES | Comma separated list of QPU resources to use at runtime. Undocumented resources will be filtered out. For example, `qpu1,qpu2`. |
| QRMI_JOB_QPU_TYPES | Comma separated list of Resource type (`ibm-quantum-system`, `qiskit-runtime-service` and `pasqal-cloud`). For example, `ibm-quantum-system,ibm-quantum-system` |
| SLURM_JOB_QPU_RESOURCES | Legacy alias for `QRMI_JOB_QPU_RESOURCES`. |
| SLURM_JOB_QPU_TYPES | Legacy alias for `QRMI_JOB_QPU_TYPES`. |

> [!IMPORTANT]
> The IBM Direct Access API has been renamed to the IBM Quantum System API.
Expand Down
7 changes: 7 additions & 0 deletions plugins/spank_qrmi/spank_qrmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,8 @@ int slurm_spank_init_post_opt(spank_t spank_ctxt, int argc, char **argv) {
spank_setenv(spank_ctxt, "QRMI_JOB_ID", id_str, OVERWRITE);
setenv("QRMI_JOB_ID", id_str, 1);

spank_setenv(spank_ctxt, "QRMI_JOB_QPU_RESOURCES", "", OVERWRITE);
spank_setenv(spank_ctxt, "QRMI_JOB_QPU_TYPES", "", OVERWRITE);
spank_setenv(spank_ctxt, "SLURM_JOB_QPU_RESOURCES", "", OVERWRITE);
spank_setenv(spank_ctxt, "SLURM_JOB_QPU_TYPES", "", OVERWRITE);

Expand Down Expand Up @@ -383,6 +385,11 @@ int slurm_spank_init_post_opt(spank_t spank_ctxt, int argc, char **argv) {
}
slurm_list_iterator_destroy(sessions_iter);

spank_setenv(spank_ctxt, "QRMI_JOB_QPU_RESOURCES", qpu_resources_envvar.buffer, OVERWRITE);
slurm_debug("%s: setenv(%s, %s)", plugin_name, "QRMI_JOB_QPU_RESOURCES",
qpu_resources_envvar.buffer);
spank_setenv(spank_ctxt, "QRMI_JOB_QPU_TYPES", qpu_types_envvar.buffer, OVERWRITE);
slurm_debug("%s: setenv(%s, %s)", plugin_name, "QRMI_JOB_QPU_TYPES", qpu_types_envvar.buffer);
spank_setenv(spank_ctxt, "SLURM_JOB_QPU_RESOURCES", qpu_resources_envvar.buffer, OVERWRITE);
slurm_debug("%s: setenv(%s, %s)", plugin_name, "SLURM_JOB_QPU_RESOURCES",
qpu_resources_envvar.buffer);
Expand Down
Loading