-
Notifications
You must be signed in to change notification settings - Fork 19
[Pasqal, Docs] add example and instructions for CUDA-Q jobs #173
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
awennersteen
wants to merge
7
commits into
main
Choose a base branch
from
aw/cuda-q-support-pasqal
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
3901bc7
[Pasqal] add example and instructions for CUDA-Q jobs
awennersteen f365fe3
Improve uneeded files and notice
awennersteen 53908ca
Removal of openssl dependencies
ohtanim bc90255
stash
awennersteen ef0b8ac
Update example files to match qrmi repo
awennersteen c19308c
Clean up environment setup in run_cudaq_pasqal.sh
awennersteen 19dbe8d
Change sbatch command for Pasqal Qiskit job
awennersteen File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| #!/bin/bash | ||
|
|
||
| #SBATCH --job-name=cudaq_pasqal_job | ||
| #SBATCH --output=/data/job_%j.out | ||
| #SBATCH --error=/data/job_%j.out | ||
| #SBATCH --ntasks=1 | ||
| #SBATCH --cpus-per-task=1 | ||
| #SBATCH --qpu=EMU_FREE | ||
|
|
||
| source /shared/pyenv/bin/activate | ||
|
|
||
| srun python /shared/qrmi/examples/qrmi/python/cudaq/pasqal.py |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,10 +1,11 @@ | ||
| #!/bin/bash | ||
|
|
||
| #SBATCH --job-name=pasqal_job | ||
| #SBATCH --output=/data/job_%j.out | ||
| #SBATCH --error=/data/job_%j.out | ||
| #SBATCH --ntasks=1 | ||
| #SBATCH --cpus-per-task=1 | ||
| #SBATCH --qpu=FRESNEL | ||
| #SBATCH --qpu=EMU_FREE | ||
|
|
||
| # Your script goes here | ||
| source /shared/pyenv/bin/activate | ||
| srun python /shared/qrmi/examples/pulser_backend/pulser_backend.py | ||
| srun python /shared/qrmi/examples/pulser/pasqal/pulser_qrmi.py |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| #!/bin/bash | ||
|
|
||
| #SBATCH --job-name=pasqal_qpp_sampler_v2 | ||
| #SBATCH --output=/data/job_%j.out | ||
| #SBATCH --error=/data/job_%j.out | ||
| #SBATCH --ntasks=1 | ||
| #SBATCH --cpus-per-task=1 | ||
| #SBATCH --qpu=EMU_FREE | ||
|
|
||
| source /shared/pyenv/bin/activate | ||
| srun python /shared/qrmi/examples/qiskit_primitives/pasqal/sampler.py |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -56,22 +56,6 @@ static void acquired_resource_destroy(void *object); | |
| static qpu_resource_t *_acquire_qpu(spank_t spank_ctxt, char *name, QrmiResourceType type); | ||
| static void _release_qpu(qpu_resource_t *res); | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. revert file |
||
|
|
||
| /* | ||
| * @function _dump_environ | ||
| * | ||
| * Dumps all environment variables set for the current process. | ||
| */ | ||
| static void _dump_environ() { | ||
| char **s = environ; | ||
| int pid = (int)getpid(); | ||
| int uid = (int)getuid(); | ||
|
|
||
| slurm_debug("%s(%d, %d): environment variables ---", plugin_name, pid, uid); | ||
| for (; *s; s++) { | ||
| slurm_debug("%s(%d, %d): %s", plugin_name, pid, uid, *s); | ||
| } | ||
| } | ||
|
|
||
| /* | ||
| * @function _starts_with | ||
| * | ||
|
|
@@ -192,7 +176,7 @@ int slurm_spank_init_post_opt(spank_t spank_ctxt, int argc, char **argv) { | |
|
|
||
| if (g_qpu_names_opt == NULL) { | ||
| /* noop if this is not QPU job */ | ||
| return SLURM_ERROR; | ||
| return SLURM_SUCCESS; | ||
| } | ||
|
|
||
| /* | ||
|
|
@@ -329,8 +313,6 @@ int slurm_spank_init_post_opt(spank_t spank_ctxt, int argc, char **argv) { | |
| spank_setenv(spank_ctxt, keybuf.buffer, envvar.value, KEEP_IF_EXISTS); | ||
| } | ||
|
|
||
| _dump_environ(); | ||
|
|
||
| /* | ||
| * Acquire QPU resource. | ||
| */ | ||
|
|
@@ -419,11 +401,15 @@ int slurm_spank_task_init(spank_t spank_ctxt, int argc, char **argv) { | |
|
|
||
| char *optargp = NULL; | ||
| if (spank_option_getopt(spank_ctxt, &spank_qrmi_options[0], &optargp) != ESPANK_SUCCESS) { | ||
| /* if spank_qrmi plugin is not registered, simply returns an error. */ | ||
| return SLURM_ERROR; | ||
| /* noop if this is not QPU job */ | ||
| return SLURM_SUCCESS; | ||
| } | ||
| if (optargp == NULL) { | ||
| /* noop if this is not QPU job */ | ||
| return SLURM_SUCCESS; | ||
| } | ||
| size_t optlen = strlen(optargp); | ||
| if ((optargp == NULL) || optlen == 0) { | ||
| if (optlen == 0) { | ||
| /* noop if this is not QPU job */ | ||
| return SLURM_SUCCESS; | ||
| } | ||
|
|
@@ -568,6 +554,9 @@ int slurm_spank_exit(spank_t spank_ctxt, int argc, char **argv) { | |
| */ | ||
| static qpu_resource_t *_acquired_resource_create(char *name, QrmiResourceType type, | ||
| const char *token) { | ||
| if (token == NULL) { | ||
| return NULL; | ||
| } | ||
| /* | ||
| * use strcpy() to fix the error - ‘strncpy’ specified bound depends on the length of the | ||
| * source argument - caused by some C compilers. | ||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
revert file