Commit 35d9084d authored by Seema Mirchandaney's avatar Seema Mirchandaney
Browse files

legion updates

parent 7d27aec9
......@@ -54,18 +54,17 @@ test_mpi:
tags:
- batch
# TODO: Skip for now till MPI version is stable
#test_legion:
# stage: test
# before_script:
# - cd ${EXTERNAL_WORKDIR}
# - mkdir -p ${OUT_DIR}
# - source ./setup/env.sh
# - export PYTHONPATH=${PYTHONPATH}:${EXTERNAL_WORKDIR}
# script:
# - PYTHONPATH="$PYTHONPATH:$PWD/mpi4py_poison_wrapper" jsrun -n1 -a1 -g1 legion_python -ll:py 1 -ll:csize 8192 legion_main.py --default-settings=summit_ci.toml --mode=legion
# tags:
# - batch
test_legion:
stage: test
before_script:
- cd ${EXTERNAL_WORKDIR}
- mkdir -p ${OUT_DIR}
- source ./setup/env.sh
- export PYTHONPATH=${PYTHONPATH}:${EXTERNAL_WORKDIR}
script:
- PYTHONPATH="$PYTHONPATH:$PWD/mpi4py_poison_wrapper" jsrun -n1 -a1 -g1 legion_python -ll:py 1 -ll:csize 8192 legion_main.py --default-settings=summit_ci.toml --mode=legion
tags:
- batch
# TODO: suggest deprecating
#test_sequential:
......
......@@ -296,30 +296,10 @@ def select_ac(generation, summary):
# Take corner of L-curve: min (v1+v2)
iref = np.argmin(summary.v1+summary.v2)
ref_rank = summary.rank[iref]
fig, axes = plt.subplots(figsize=(6.0, 8.0), nrows=3, ncols=1)
axes[0].loglog(summary.rlambda, summary.v1)
axes[0].loglog(summary.rlambda[iref], summary.v1[iref], "rD")
axes[0].set_xlabel("$\lambda_{r}$")
axes[0].set_ylabel("$||x_{\lambda_{r}}||_{2}$")
axes[1].loglog(summary.rlambda, summary.v2)
axes[1].loglog(summary.rlambda[iref], summary.v2[iref], "rD")
axes[1].set_xlabel("$\lambda_{r}$")
axes[1].set_ylabel("$||W \lambda_{r}-d||_{2}$")
axes[2].loglog(summary.v2, summary.v1) # L-curve
axes[2].loglog(summary.v2[iref], summary.v1[iref], "rD")
axes[2].set_xlabel("Residual norm $||W \lambda_{r}-d||_{2}$")
axes[2].set_ylabel("Solution norm $||x_{\lambda_{r}}||_{2}$")
fig.tight_layout()
plt.savefig(settings.out_dir / f"summary_{generation}.png")
plt.close('all')
print(f"Keeping result from rank {ref_rank}.", flush=True)
return iref
@nvtx.annotate("legion/autocorrelation.py", is_prefix=True)
def solve_ac(generation,
pixel_position,
......
import pygion
import socket
import PyNVTX as nvtx
from pygion import task, RO, WD, IndexLaunch, Tunable
from pygion import task, RO, WD, IndexLaunch, Tunable, LayoutConstraint, SOA_C
from spinifel import settings
from spinifel.sequential.orientation_matching import slicing_and_match as sequential_match
......@@ -10,8 +10,11 @@ from . import utils as lgutils
@task(privileges=[
RO("ac"), RO("data"), WD("quaternions"), RO("reciprocal"), RO("reciprocal")])
@task(privileges=[RO("ac"), RO("data"), WD("quaternions"), RO("reciprocal"), RO("reciprocal")], layout=[LayoutConstraint(order=SOA_C, dim=4),
LayoutConstraint(order=SOA_C, dim=4),
LayoutConstraint(order=SOA_C, dim=4),
LayoutConstraint(order=SOA_C, dim=4),
LayoutConstraint(order=SOA_C, dim=4)])
@lgutils.gpu_task_wrapper
@nvtx.annotate("legion/orientation_matching.py", is_prefix=True)
def match_task(phased, slices, orientations, pixel_position, pixel_distance):
......
......@@ -5,7 +5,7 @@
#SBATCH -t 2:00:00
#SBATCH -n 8
#SBATCH --ntasks-per-node=4
#SBATCH -c 10
#SBATCH -c 20
#SBATCH --gpus-per-task=1
#SBATCH -J RunSpinifel
#SBATCH -o RunSpinifel.%J
......@@ -18,7 +18,7 @@ source setup/env.sh
export SLURM_CPU_BIND="cores"
#srun python -m spinifel --default-settings=cgpu_legion.toml --mode=legion -g 0
srun legion_python -ll:py 1 -ll:pyomp 4 -ll:csize 16384 legion_main.py --default-settings=cgpu_legion.toml --mode=legion -g 0
srun legion_python -ll:py 1 -ll:pyomp 8 -ll:csize 16384 legion_main.py --default-settings=cgpu_legion.toml --mode=legion -g 0
t_end=`date +%s`
echo PSJobCompleted TotalElapsed $((t_end-t_start)) $t_start $t_end
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment