Skip to content

Commit

Permalink
added python_script.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
DanPorter committed Aug 13, 2024
1 parent c8c7e3e commit f7d0dbb
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions python_script.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
apiVersion: argoproj.io/v1alpha1
kind: ClusterWorkflowTemplate
metadata:
name: mmg_test_python
spec:
entrypoint: mmg_test_python
templates:
- name: mmg_test_python
inputs:
parameters:
- name: size
value: 2000
- name: memory
value: 20Gi
script:
image: ghcr.io/diamondlightsource/magnetic-materials-workflows:0.1.0-rc1
command: ["python"]
source: |
import numpy as np
import time
n = int("{{ inputs.parameters.size }}")
A = np.random.randn(n,n).astype('float64')
B = np.random.randn(n,n).astype('float64')
start_time = time.time()
nrm = np.linalg.norm(A@B)
print(" took {} seconds ".format(time.time() - start_time))
print(" norm = ",nrm)
print(np.__config__.show())

0 comments on commit f7d0dbb

Please sign in to comment.