Skip to content
Snippets Groups Projects
Select Git revision
  • c2799eaa958fdc489eee7b6de31b84de735d06ec
  • master default protected
  • fix_Makefile.mingw#2
  • update_Makefile.mingw
  • fix_Makefile.mingw
  • fix_API_for_C_apps
  • fix_procinfo_mac
  • boinccmd_gpu_mode_always_until_sigterm
  • fgrp_osx_hotfix
  • fix_boinc_master@f8250782
  • eah_wrapper_improvements
  • diagnostics_win-hotfix
  • diagnostics_win-hotfix-old
  • current_fgrp_apps
  • testing_gw_apps
  • gw_app_darwin_15
  • current_brp_apps
  • current_brp_apps_android10
  • current_gfx_apps
  • current_server
  • current_gw_apps
  • previous_fgrp_apps
  • previous_gw_apps
  • testing_brp_apps
  • apps_FGRP3_1.07
  • apps_FGRP3_1.08
26 results

boinc_api.h

Blame
    • David Anderson's avatar
      d5a8f6f1
      - API: add boinc_init_parallel(). · d5a8f6f1
      David Anderson authored
          This is like boinc_init() but for multithread apps.
          Unlike boinc_init(), it suspends/resumes all threads in the app,
          not just one.
          In Unix, this is done by forking,
          and having the parent process handle suspend/resume messages
          and suspend/resume the child using signals
          On Win, there's some nasty code that enumerates all
          threads in the whole system, and suspends/resumes
          those in a particular process.
      
      
      svn path=/trunk/boinc/; revision=20054
      d5a8f6f1
      History
      - API: add boinc_init_parallel().
      David Anderson authored
          This is like boinc_init() but for multithread apps.
          Unlike boinc_init(), it suspends/resumes all threads in the app,
          not just one.
          In Unix, this is done by forking,
          and having the parent process handle suspend/resume messages
          and suspend/resume the child using signals
          On Win, there's some nasty code that enumerates all
          threads in the whole system, and suspends/resumes
          those in a particular process.
      
      
      svn path=/trunk/boinc/; revision=20054
    asc_pd_phase.py NaN GiB
    import copy
    import sys
    import scipy.optimize
    
    from pykat import finesse
    
    def run(tmpkat):
    
        kat = copy.deepcopy(tmpkat)
        
        code_det = """
        pd1 PDrefl_q 9M 90 nWFS1
        %scale 2 PDrefl_q
        """
        
        kat.parseKatCode(code_det)
        kat.noxaxis= True
    
        # function for root finding
        def PD_q_test(x):
            kat.PDrefl_q.phi[0]=x
            out = kat.run(printout=0,printerr=0)
            print '\r root finding: function value %g                    ' % out.y,
            sys.stdout.flush()
            return out.y
    
        # do root finding
        xtol=1e-8
        (result, info)=scipy.optimize.bisect(PD_q_test,80.0,100.0, xtol=xtol, maxiter=500, full_output=True)
    
        print ""
        if info.converged:
            p_phase=result-90.0
            q_phase=result
            print " Root has been found:"
            print " p_phase %8f" % (p_phase)
            print " q_phase %8f" % (q_phase)
            print " (%d iterations, %g tolerance)" % (info.iterations, xtol)
            return (p_phase, q_phase)
        else:
            raise Exception("Root has not been found")