Source
#casalog.post("Deleting : " + namelist + ' from ' + self.getworkdir(imagename, node) + ' starting with ' + imagename)
from __future__ import absolute_import
import os
import math
import shutil
import string
import time
import re;
import copy
from casatasks.private.casa_transition import is_CASA6
if is_CASA6:
from casatools import synthesisutils
from casatasks import casalog
else:
from taskinit import *
synthesisutils = casac.synthesisutils
'''
A set of helper functions for the tasks tclean
Summary...
'''
#############################################
### Parallel Imager Helper.
#############################################
#casalog.post('Using clustermanager from MPIInterface', 'WARN')
try:
if is_CASA6:
from casampi.MPIInterface import MPIInterface as mpi_clustermanager
mpi_available = True
else:
from mpi4casa.MPIInterface import MPIInterface as mpi_clustermanager
mpi_available = True
except ImportError:
mpi_available = False
class PyParallelImagerHelper():
def __init__(self):
############### Cluster Info
self.CL=None
self.sc=None
self.nodeList=None;
# Initialize cluster, and partitioning.
############### Number of nodes to parallelize on
# self.nodeList gets filled by setupCluster()
self.NN = self.setupCluster()
def getNodeList(self):
return self.nodeList;
#############################################
def chunkify(self,lst,n):
return [ lst[i::n] for i in range(n) ]
def partitionCFCacheList(self,gridPars):
cfcName = gridPars['cfcache'];