From ef89a95a5d23ffb39fab629a924c82492abcfe03 Mon Sep 17 00:00:00 2001 From: Ali Asgari Date: Thu, 14 Apr 2022 08:44:57 -0700 Subject: [PATCH] Update scripts for AD --- ad_sdc.sh | 2 +- build_singularity.sh | 8 ++++++++ linearcode/analyze.py | 4 ++-- 3 files changed, 11 insertions(+), 3 deletions(-) create mode 100755 build_singularity.sh diff --git a/ad_sdc.sh b/ad_sdc.sh index 3b3f5ee..37f11e1 100755 --- a/ad_sdc.sh +++ b/ad_sdc.sh @@ -10,7 +10,7 @@ mkdir -p $DIRECTORY/home mkdir -p $DIRECTORY/results mkdir -p $DIRECTORY/data -docker build -t dsn2022paper165/sc . +#docker build -t dsn2022paper165/sc . #JOBS=`docker run --env SHARD=$SHARD --env INJECTIONS_RANGE="0-$INJECTIONS-1" dsn2022paper165/sc python ./array_count.py` #docker run -v $DIRECTORY/home/:/root/ -v $DIRECTORY/results/:/code/linearcode/results/ --env SHARD=$SHARD --env INJECTIONS_RANGE="0-$INJECTIONS-1" dsn2022paper165/sc ./pseudo_slurm_map.sh $JOBS diff --git a/build_singularity.sh b/build_singularity.sh new file mode 100755 index 0000000..7739f16 --- /dev/null +++ b/build_singularity.sh @@ -0,0 +1,8 @@ +#!/bin/bash +set -e + +SLURM_WORKING_DIRECTORY=aasgarik@cedar.computecanada.ca:/home/aasgarik/projects/def-karthikp/aasgarik/reasilience/ + +singularity build sc.sif docker://dsn2022paper165/sc:latest +scp sc.sif $SLURM_WORKING_DIRECTORY/sc.sif +scp linearcode/script.sh $SLURM_WORKING_DIRECTORY/script.sh diff --git a/linearcode/analyze.py b/linearcode/analyze.py index 90a84a9..80fc4bb 100755 --- a/linearcode/analyze.py +++ b/linearcode/analyze.py @@ -745,9 +745,9 @@ def ecc_protection(): coded[0][1] = perturbed[1] erasure = ec.erasure(coded, checksum, dim=1) corrected = sc.decode(coded, erasure=erasure, dim=1) - print(corrected[0][0], file=open(get_storage_filename({'txt': 'chipkill_example_corrected_1', }, + print(float(corrected[0][0]), file=open(get_storage_filename({'txt': 'chipkill_example_corrected_1', }, extension='.tex', storage='../thesis/data/'), mode='w')) - print(corrected[0][1], file=open(get_storage_filename({'txt': 'chipkill_example_corrected_2', }, + print(float(corrected[0][1]), file=open(get_storage_filename({'txt': 'chipkill_example_corrected_2', }, extension='.tex', storage='../thesis/data/'), mode='w'))