-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ce0a455
commit a2fbc85
Showing
1 changed file
with
98 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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,98 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "markdown", | ||
"id": "a535ec22-0152-4b5e-9441-6ff0f322e5de", | ||
"metadata": {}, | ||
"source": [ | ||
"Launch PyFluent with Slurm options" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "4dc730d9-87fc-412f-8062-dc84006ae3ac", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"slurm = pyfluent.launch_fluent(scheduler_options={\"scheduler\": \"slurm\"}, ...)" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"id": "e91be6b5-8dff-4485-9428-e98386212619", | ||
"metadata": {}, | ||
"source": [ | ||
"Check if job has started" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "7ba4f56b-ab02-4e5c-a119-ad799945a9af", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"slurm.pending(), slurm.running(), slurm.done()" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"id": "3bb7e298-92c4-478b-80ca-8b0f6344ef1c", | ||
"metadata": {}, | ||
"source": [ | ||
"Obtain and use running session " | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "0c76b861-f9e3-4b26-8d87-bb9b9a5ab51e", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"session = slurm.result()\n", | ||
"session.file.read_case(file_name=case_file_name)" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"id": "6cf21a81-5c88-40a8-9a21-d5e53109cbc8", | ||
"metadata": {}, | ||
"source": [ | ||
"Register a callback to automate " | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "b9416492-acaf-4b58-ad03-935efe3c9d7e", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"slurm.add_done_callback(lambda session: setup_and_solve(session))" | ||
] | ||
} | ||
], | ||
"metadata": { | ||
"kernelspec": { | ||
"display_name": "Python 3 (ipykernel)", | ||
"language": "python", | ||
"name": "python3" | ||
}, | ||
"language_info": { | ||
"codemirror_mode": { | ||
"name": "ipython", | ||
"version": 3 | ||
}, | ||
"file_extension": ".py", | ||
"mimetype": "text/x-python", | ||
"name": "python", | ||
"nbconvert_exporter": "python", | ||
"pygments_lexer": "ipython3", | ||
"version": "3.10.11" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 5 | ||
} |