Example #1
0
 def run(self):
     global test_name
     attached = False
     try:
         attach_args, attach_kw_args, attach_function = self.attach_options
         sys.stdout.write('%s test beginning...\n' %(self.name))
         time.sleep(self.sleep_time)
         pid_arg = str(self.app.pid)
         if (attach_function == serial_attach):
             proctab = get_proctab(self.app.proctab_file_path)
             pid_list = []
             for rank, host, serial_pid, exe_index in proctab.process_list:
                 if rank % 3 == 0:
                     pid_list.append('%s@%s:%d' %(proctab.executable_paths[exe_index], host, serial_pid))
             pid_arg = pid_list
         attach_args = (pid_arg,) + attach_args
         apply(attach_function, attach_args, attach_kw_args)
         attached = True
         resume()
         for kw_args in self.sample_options_list:
             kw_args['alt_dot_filename'] = test_name.replace(' ', '_')
             ret = apply(sample, (), kw_args)
         detach()
     except Exception as e:
         sys.stderr.write('%s test failed: %s\n' %(self.name, repr(e)))
         traceback.print_exc()
         if attached == True:
             detach()
         return False
     sys.stdout.write('%s test complete\n' %(self.name))
     return True
Example #2
0
 def run(self):
     global test_name
     attached = False
     try:
         attach_args, attach_kw_args, attach_function = self.attach_options
         sys.stdout.write('%s test beginning...\n' % (self.name))
         time.sleep(self.sleep_time)
         pid_arg = str(self.app.pid)
         if (attach_function == serial_attach):
             proctab = get_proctab(self.app.proctab_file_path)
             pid_list = []
             for rank, host, serial_pid, exe_index in proctab.process_list:
                 if rank % 3 == 0:
                     pid_list.append('%s@%s:%d' %
                                     (proctab.executable_paths[exe_index],
                                      host, serial_pid))
             pid_arg = pid_list
         attach_args = (pid_arg, ) + attach_args
         apply(attach_function, attach_args, attach_kw_args)
         attached = True
         resume()
         for kw_args in self.sample_options_list:
             kw_args['alt_dot_filename'] = test_name.replace(' ', '_')
             ret = apply(sample, (), kw_args)
         detach()
     except Exception as e:
         sys.stderr.write('%s test failed: %s\n' % (self.name, repr(e)))
         traceback.print_exc()
         if attached == True:
             detach()
         return False
     sys.stdout.write('%s test complete\n' % (self.name))
     return True
Example #3
0
 def launch(self):
     global test_name
     launch_args = [self.launcher] + self.launcher_args + [self.exe] + self.exe_args
     try:
         launch(launch_args)
         self.stat_fe = get_stat_fe()
         self.pid = self.stat_fe.getLauncherPid()
         out_dir = self.stat_fe.getOutDir()
         file_prefix = self.stat_fe.getFilePrefix()
         self.proctab_file_path = out_dir + '/' + file_prefix + '.ptab'
         sample(alt_dot_filename = test_name.replace(' ', '_'))
         detach()
         del self.stat_fe
     except Exception as e:
         sys.stderr.write('launch %s failed: %s\n' %(repr(launch_args), e))
         self.terminate()
         return False
     return True
Example #4
0
 def launch(self):
     global test_name
     launch_args = [self.launcher] + self.launcher_args + [self.exe
                                                           ] + self.exe_args
     try:
         launch(launch_args)
         self.stat_fe = get_stat_fe()
         self.pid = self.stat_fe.getLauncherPid()
         out_dir = self.stat_fe.getOutDir()
         file_prefix = self.stat_fe.getFilePrefix()
         self.proctab_file_path = out_dir + '/' + file_prefix + '.ptab'
         sample(alt_dot_filename=test_name.replace(' ', '_'))
         detach()
         del self.stat_fe
     except Exception as e:
         sys.stderr.write('launch %s failed: %s\n' % (repr(launch_args), e))
         self.terminate()
         return False
     return True