|
97 | 97 | "# =================================\n", |
98 | 98 | "\n", |
99 | 99 | "from getpass import getpass\n", |
| 100 | + "\n", |
100 | 101 | "# from tapipy.tapis import Tapis\n", |
101 | 102 | "\n", |
102 | 103 | "t = Tapis(\n", |
103 | | - " base_url = \"https://designsafe.tapis.io\",\n", |
104 | | - " username = getpass('input username: '),\n", |
105 | | - " password = getpass('input password: '))\n", |
| 104 | + " base_url=\"https://designsafe.tapis.io\",\n", |
| 105 | + " username=getpass(\"input username: \"),\n", |
| 106 | + " password=getpass(\"input password: \"),\n", |
| 107 | + ")\n", |
106 | 108 | "t.get_tokens()" |
107 | 109 | ] |
108 | 110 | }, |
|
116 | 118 | "import os\n", |
117 | 119 | "import uuid\n", |
118 | 120 | "from datetime import date\n", |
119 | | - "from DS_GenFunctionsV3 import * #General python functions useful for DesignSafe\n", |
| 121 | + "from DS_GenFunctionsV3 import * # General python functions useful for DesignSafe\n", |
| 122 | + "\n", |
120 | 123 | "# ---------------------------------------------------------------------------------\n", |
121 | 124 | "# Identify folder with input file in DesignSafe\n", |
122 | | - "cur_dir = os.getcwd()\n", |
123 | | - "input_uri = DS_GetDir(cur_dir, t)" |
| 125 | + "cur_dir = os.getcwd()\n", |
| 126 | + "input_uri = DS_GetDir(cur_dir, t)" |
124 | 127 | ] |
125 | 128 | }, |
126 | 129 | { |
|
135 | 138 | "\n", |
136 | 139 | "# ---------------------------------------------------------------------------------\n", |
137 | 140 | "# Select tapis-app\n", |
138 | | - "app_id = \"opensees-mp-s3\"\n", |
139 | | - "app_version = \"3.7.0\"\n", |
| 141 | + "app_id = \"opensees-mp-s3\"\n", |
| 142 | + "app_version = \"3.7.0\"\n", |
140 | 143 | "\n", |
141 | 144 | "# ---------------------------------------------------------------------------------\n", |
142 | 145 | "# Define file to run\n", |
143 | 146 | "input_filename = \"Main_multiMotion.tcl\"\n", |
144 | 147 | "\n", |
145 | 148 | "# ---------------------------------------------------------------------------------\n", |
146 | 149 | "# Define control tapis-app variables\n", |
147 | | - "control_storage_id = \"designsafe.storage.default\"\n", |
148 | | - "control_execSystem = \"stampede3\" #\"frontera\", \"stampede3-simcenter\"\n", |
149 | | - "control_allocation = \"-A DesignSafe-SimCenter\" # MUST USE YOUR OWN ALLOCATION !!\n", |
150 | | - "control_exec_Dir = \"DS_input\" # Folder with files including input_filename\n", |
151 | | - "control_nodeCount = 1\n", |
152 | | - "control_corespernode = 16\n", |
153 | | - "control_memoryMB = 1000\n", |
154 | | - "control_maxMinutes = 60\n", |
| 150 | + "control_storage_id = \"designsafe.storage.default\"\n", |
| 151 | + "control_execSystem = \"stampede3\" # \"frontera\", \"stampede3-simcenter\"\n", |
| 152 | + "control_allocation = \"-A DesignSafe-SimCenter\" # MUST USE YOUR OWN ALLOCATION !!\n", |
| 153 | + "control_exec_Dir = \"DS_input\" # Folder with files including input_filename\n", |
| 154 | + "control_nodeCount = 1\n", |
| 155 | + "control_corespernode = 16\n", |
| 156 | + "control_memoryMB = 1000\n", |
| 157 | + "control_maxMinutes = 60\n", |
155 | 158 | "\n", |
156 | 159 | "if control_execSystem == \"frontera\":\n", |
157 | | - " control_batchQueue = \"development\" #\"normal\"\n", |
158 | | - "elif control_execSystem == \"stampede3\" :\n", |
159 | | - " control_batchQueue = \"skx-dev\" # \"skx\"\n", |
| 160 | + " control_batchQueue = \"development\" # \"normal\"\n", |
| 161 | + "elif control_execSystem == \"stampede3\":\n", |
| 162 | + " control_batchQueue = \"skx-dev\" # \"skx\"\n", |
160 | 163 | "elif control_execSystem == \"stampede3-simcenter\":\n", |
161 | 164 | " control_batchQueue = \"simcenter\"\n", |
162 | 165 | "else:\n", |
|
171 | 174 | "source": [ |
172 | 175 | "# -------------------------------------------------------------------------------\n", |
173 | 176 | "# Define inputs\n", |
174 | | - "fileInputs = [{\"name\": \"Input Directory\", \"sourceUrl\": f\"{input_uri}/{control_exec_Dir}\"}]\n", |
| 177 | + "fileInputs = [\n", |
| 178 | + " {\"name\": \"Input Directory\", \"sourceUrl\": f\"{input_uri}/{control_exec_Dir}\"}\n", |
| 179 | + "]\n", |
175 | 180 | "\n", |
176 | 181 | "# -------------------------------------------------------------------------------\n", |
177 | 182 | "# Define parameters\n", |
178 | | - "parameterSet = {\"appArgs\":[]}\n", |
| 183 | + "parameterSet = {\"appArgs\": []}\n", |
179 | 184 | "parameterSet[\"appArgs\"].append({\"name\": \"Main Script\", \"arg\": input_filename})\n", |
180 | 185 | "parameterSet[\"schedulerOptions\"] = [{\"arg\": control_allocation}]" |
181 | 186 | ] |
|
199 | 204 | "job_description[\"execSystemExecDir\"] = \"${JobWorkingDir}\"\n", |
200 | 205 | "\n", |
201 | 206 | "job_description[\"archiveSystemId\"] = control_storage_id\n", |
202 | | - "job_description[\"archiveSystemDir\"] = \"${EffectiveUserId}/tapis-jobs-archive/${JobCreateDate}/${JobUUID}\"\n", |
| 207 | + "job_description[\n", |
| 208 | + " \"archiveSystemDir\"\n", |
| 209 | + "] = \"${EffectiveUserId}/tapis-jobs-archive/${JobCreateDate}/${JobUUID}\"\n", |
203 | 210 | "\n", |
204 | 211 | "job_description[\"maxMinutes\"] = control_maxMinutes\n", |
205 | 212 | "job_description[\"nodeCount\"] = control_nodeCount\n", |
|
233 | 240 | "source": [ |
234 | 241 | "# Submit job\n", |
235 | 242 | "job = t.jobs.submitJob(**job_description)\n", |
236 | | - "jobUuid=job.uuid\n", |
| 243 | + "jobUuid = job.uuid\n", |
237 | 244 | "\n", |
238 | 245 | "print(\" Job launched. Status provided below\")\n", |
239 | | - "print(\" Can also check in DedignSafe portal under - Workspace > Tools & Application > Job Status\")" |
| 246 | + "print(\n", |
| 247 | + " \" Can also check in DedignSafe portal under - Workspace > Tools & Application > Job Status\"\n", |
| 248 | + ")" |
240 | 249 | ] |
241 | 250 | }, |
242 | 251 | { |
|
264 | 273 | } |
265 | 274 | ], |
266 | 275 | "source": [ |
267 | | - "#Check status\n", |
| 276 | + "# Check status\n", |
268 | 277 | "status = DS_GetStatus(t, jobUuid, tlapse=1)\n", |
269 | 278 | "\n", |
270 | 279 | "# Check Runtime\n", |
|
323 | 332 | } |
324 | 333 | ], |
325 | 334 | "source": [ |
326 | | - "os.chdir(jobinfo.archiveSystemDir.replace(user,'/home/jupyter/MyData'))\n", |
| 335 | + "os.chdir(jobinfo.archiveSystemDir.replace(user, \"/home/jupyter/MyData\"))\n", |
327 | 336 | "# os.chdir(control_exec_Dir)\n", |
328 | 337 | "os.chdir(\"inputDirectory\")" |
329 | 338 | ] |
|
367 | 376 | "outputs": [], |
368 | 377 | "source": [ |
369 | 378 | "from plotAcc import plot_acc\n", |
| 379 | + "\n", |
370 | 380 | "plot_acc()" |
371 | 381 | ] |
372 | 382 | } |
|
0 commit comments