Commits

Bob Garwood authored be934039fb2
CAS-12667: added casampi imports for CASA6 case for 2 imports done in functions

gcwrap/python/scripts/imagerhelpers/testhelper_imager.py

Modified
693 693 hasmodcol = ( (_tb.colnames()).count('MODEL_DATA')>0 )
694 694 modsum=0.0
695 695 if hasmodcol:
696 696 dat = _tb.getcol('MODEL_DATA')[:,chan,:]
697 697 modsum=dat.mean()
698 698 _tb.close()
699 699 ##print(modsum)
700 700 return modsum
701 701
702 702 def checkMPI(self):
703 - from mpi4casa.MPIInterface import MPIInterface as mpi_clustermanager
703 + if is_CASA6:
704 + from casampi.MPIInterface import MPIInterface as mpi_clustermanager
705 + else:
706 + from mpi4casa.MPIInterface import MPIInterface as mpi_clustermanager
704 707 try:
705 708 self.nproc = len(mpi_clustermanager.getCluster()._cluster.get_engines())
706 709 return True
707 710 except Exception:
708 711 self.nproc = 0
709 712 return False
710 713
711 714
712 715 def getNParts(self,imprefix='', imexts=[]):
713 -
714 - from mpi4casa.MPIInterface import MPIInterface as mpi_clustermanager
716 + if is_CASA6:
717 + from casampi.MPIInterface import MPIInterface as mpi_clustermanager
718 + else:
719 + from mpi4casa.MPIInterface import MPIInterface as mpi_clustermanager
715 720 try:
716 721 self.nproc = len(mpi_clustermanager.getCluster()._cluster.get_engines())
717 722 except Exception:
718 723 self.nproc = 0
719 724
720 725 if( self.nproc>0 ):
721 726
722 727 imlist=[];
723 728 for imext in imexts:
724 729 for part in range(1,self.nproc+1):

Everything looks good. We'll let you know here if there's anything you should know about.

Add shortcut