Skip to content
Snippets Groups Projects

Parallelization fixes (WS Side)

Merged Jim Sheckard requested to merge cube_parallel_updates into main
1 file
+ 145
0
Compare changes
  • Side-by-side
  • Inline
# Copyright (C) 2021 Associated Universities, Inc. Washington DC, USA.
#
# This file is part of NRAO Workspaces.
#
# Workspaces is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Workspaces is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Workspaces. If not, see <https://www.gnu.org/licenses/>.
"""cube parallelization
Revision ID: 1bf29ab04f27
Revises: 85f659bf1425
Create Date: 2022-09-07 11:54:54.064234
"""
import sqlalchemy as sa
from alembic import op
# revision identifiers, used by Alembic.
revision = "1bf29ab04f27"
down_revision = "85f659bf1425"
branch_labels = None
depends_on = None
old_envoy_condor = """executable = vlass_coarse_envoy.sh
arguments = metadata.json PPR.xml
output = vlass_coarse_envoy.out
error = vlass_coarse_envoy.err
log = condor.log
VLASS_DIR = {{data_location}}
SBIN_PATH = /lustre/aoc/cluster/pipeline/$ENV(CAPO_PROFILE)/workspaces/sbin
should_transfer_files = yes
transfer_input_files = $ENV(HOME)/.ssh/condor_transfer, nraorsync://$(SBIN_PATH)/.matplotlib, nraorsync://$(SBIN_PATH)/pycapo, nraorsync://$(SBIN_PATH)/framework.sh, nraorsync://$(SBIN_PATH)/vela, nraorsync://$(SBIN_PATH)/casa_envoy, nraorsync://$(VLASS_DIR)/working, nraorsync://$(VLASS_DIR)/rawdata, nraorsync://$(VLASS_DIR)/products, nraorsync://$(VLASS_DIR)/{{profile}}.properties, nraorsync://$(VLASS_DIR)/PPR.xml, nraorsync://$(VLASS_DIR)/metadata.json
when_to_transfer_output = ON_EXIT
transfer_output_files = .job.ad
+nrao_output_files = "rawdata working products"
output_destination = nraorsync://$(VLASS_DIR)
+WantIOProxy = True
request_memory = 50G
request_disk = 850G
getenv = True
environment = "CAPO_PATH=."
{{#remote}}
requirements = (VLASS == True)
+partition = "VLASS"
Rank = (TARGET.VLASS == True) + (TARGET.VLASSTEST =!= True)
{{/remote}}
queue
"""
old_envoy_shell = """#!/bin/sh
export HOME=$TMPDIR
set -o errexit
./casa_envoy --vlass-img $1 $2
"""
new_envoy_condor = """executable = vlass_coarse_envoy.sh
arguments = metadata.json PPR.xml {{requested_parallel}}
output = vlass_coarse_envoy.out
error = vlass_coarse_envoy.err
log = condor.log
VLASS_DIR = {{data_location}}
SBIN_PATH = /lustre/aoc/cluster/pipeline/$ENV(CAPO_PROFILE)/workspaces/sbin
should_transfer_files = yes
transfer_input_files = $ENV(HOME)/.ssh/condor_transfer, nraorsync://$(SBIN_PATH)/.matplotlib, nraorsync://$(SBIN_PATH)/pycapo, nraorsync://$(SBIN_PATH)/framework.sh, nraorsync://$(SBIN_PATH)/vela, nraorsync://$(SBIN_PATH)/casa_envoy, nraorsync://$(VLASS_DIR)/working, nraorsync://$(VLASS_DIR)/rawdata, nraorsync://$(VLASS_DIR)/products, nraorsync://$(VLASS_DIR)/{{profile}}.properties, nraorsync://$(VLASS_DIR)/PPR.xml, nraorsync://$(VLASS_DIR)/metadata.json
when_to_transfer_output = ON_EXIT
transfer_output_files = .job.ad
+nrao_output_files = "rawdata working products"
output_destination = nraorsync://$(VLASS_DIR)
+WantIOProxy = True
request_cpus = {{requested_parallel}}
request_memory = 150G
request_disk = 850G
getenv = True
environment = "CAPO_PATH=."
{{#remote}}
requirements = (VLASS == True)
+partition = "VLASS"
Rank = (TARGET.VLASS == True) + (TARGET.VLASSTEST =!= True)
{{/remote}}
queue
"""
new_envoy_shell = """#!/bin/sh
export HOME=$TMPDIR
set -o errexit
./casa_envoy --vlass-img $1 $2 --parallel $3
"""
def upgrade():
op.execute(
f"""
UPDATE workflow_templates
SET content=E'{new_envoy_condor}' WHERE filename='vlass_coarse_envoy.condor'
"""
)
op.execute(
f"""
UPDATE workflow_templates
SET content=E'{new_envoy_shell}' WHERE filename='vlass_coarse_envoy.sh'
"""
)
def downgrade():
op.execute(
f"""
UPDATE workflow_templates
SET content=E'{old_envoy_condor}' WHERE filename='vlass_coarse_envoy.condor'
"""
)
op.execute(
f"""
UPDATE workflow_templates
SET content=E'{old_envoy_shell}' WHERE filename='vlass_coarse_envoy.sh'
"""
)
Loading