def test_MPI_local(self): """"Test the MPI class with the local scheduler""" # options m = MympirunOption() m.args = ['echo', 'foo'] # should not throw an error mpi_instance = getinstance(MPI, Local, m) mpi_instance.main() # check for correct .mpd.conf file mpdconffn = os.path.expanduser('~/.mpd.conf') self.assertEqual(stat.S_IMODE(os.stat(mpdconffn).st_mode), 0400)
def test_MPI_local(self): """"Test the MPI class with the local scheduler""" # options m = MympirunOption() m.args = ['echo', 'foo'] # should not throw an error mpi_instance = getinstance(MPI, Local, m) mpi_instance.main() # check for correct .mpd.conf file mpdconffn = os.path.expanduser('~/.mpd.conf') perms = stat.S_IMODE(os.stat(mpdconffn).st_mode) self.assertEqual(perms, 0400, msg='permissions %0o for mpd.conf %s' % (perms, mpdconffn))
def main(): """Main function""" try: m = getinstance(*get_mpi_and_sched_and_options()) m.main() ec = 0 except ExitException: ec = 0 except: # # TODO: cleanup, only catch known exceptions if os.environ.get('MYMPIRUN_MAIN_EXCEPTION', 0) == '1': _logger.exception("Main failed") ec = 1 sys.exit(ec)