Skip to content

Commit

Permalink
first file
Browse files Browse the repository at this point in the history
  • Loading branch information
seanpearsonuk committed Apr 3, 2024
1 parent ce0a455 commit a2fbc85
Showing 1 changed file with 98 additions and 0 deletions.
98 changes: 98 additions & 0 deletions mesh_demo/slurm.ipynb
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
}

0 comments on commit a2fbc85

Please sign in to comment.