Skip to content
Snippets Groups Projects
Select Git revision
  • 7c70c3b6e42c7558c8e5ac5c8c145e224f10acf7
  • 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

cpu_sched.cpp

Blame
    • David Anderson's avatar
      58417461
      - client: multi-thread jobs were being given too high priority; · 58417461
      David Anderson authored
          in particular, they were preempting jobs in the middle of time slice.
          Solution:
          1) don't use MT in the sort order defined by more_important().
          2) add a 2nd reordering in which MT jobs are moved ahead
              of non-MT jobs, but only if #CPUs used is < #CPUs
              (see promote_multi_thread_jobs())
      
      svn path=/trunk/boinc/; revision=19312
      58417461
      History
      - client: multi-thread jobs were being given too high priority;
      David Anderson authored
          in particular, they were preempting jobs in the middle of time slice.
          Solution:
          1) don't use MT in the sort order defined by more_important().
          2) add a 2nd reordering in which MT jobs are moved ahead
              of non-MT jobs, but only if #CPUs used is < #CPUs
              (see promote_multi_thread_jobs())
      
      svn path=/trunk/boinc/; revision=19312
    Run_Setup.ipynb 6.95 KiB
    In [4]:
    """
    Created by Sumit Kumar on 2020-03-08 && modified by Xisco on 2021-04
    Last modified:
    """
    
    import os, sys, numpy, glob, argparse
    from datetime import date
    import subprocess
    from subprocess import call
    import re
    from configparser import ConfigParser
    
    today = date.today()
    date = today.strftime("%Y%m%d")
    
    runname='run_0_mock'
    nmax = 0
    config_file ='config_n0_to_1_mock.ini'
    overwrite = True
    
    ######
    times = '(0 0.2 0.4 0.8 1.2 2 2.5 5 7.5 10 12 15 18 20)'
    accounting_group = 'cbc.test.pe_ringdown'
    cpus=8
    nlive_points = 2000
    req_memory="16GB"
    not_user='frjifo@aei.mpg.de'
    pythonfile='/work/francisco.jimenez/sio/git/rdstackingproject/code_new/RD_Fits.py'
    pythonscript='/work/francisco.jimenez/venv/bin/python'
    #######################################################
    
    pwd = os.getcwd()
    run_dir = '%s/%s'%(pwd,runname)
    logs_dir = '%s/logs'%run_dir
    
    os.system('mkdir -p %s'%logs_dir)
    os.system('cp %s %s/'%(config_file,run_dir))
    
    ###########################################################################
    # Creating Condor submit file
    ###########################################################################
    filename1 = '%s/%s'%(run_dir,'condor_submit')
    text_file1 = open(filename1 + ".sub", "w")
    text_file1.write("universe   = vanilla\n")
    text_file1.write("getenv     = true\n")
    text_file1.write("# run script -- make sure that condor has execute permission for this file (chmod a+x script.py)\n")
    text_file1.write("executable = "'%s/%s'%(run_dir,runname+'.sh \n'))
    text_file1.write("# file to dump stdout (this directory should exist)\n")
    text_file1.write("output     = %s/%s-$(Process).out\n"%(logs_dir,runname))
    text_file1.write("# file to dump stderr\n")
    text_file1.write("error     = %s/%s-$(Process).err\n"%(logs_dir,runname))
    text_file1.write("# condor logs\n")
    text_file1.write("log     = %s/%s-$(Process).log\n"%(logs_dir,runname))
    text_file1.write("initialdir = %s \n"%run_dir)
    text_file1.write("notify_user ="+not_user+' \n')
    text_file1.write("notification = Complete\n")
    text_file1.write('''arguments  = "-processid $(Process)" \n''')
    text_file1.write("request_memory = "+str(req_memory)+"\n")
    text_file1.write("request_cpus = "+str(cpus)+"\n") 
    text_file1.write("on_exit_remove = (ExitBySignal == False) || ((ExitBySignal == True) && (ExitSignal != 11))\n")
    text_file1.write("accounting_group = %s\n"%accounting_group)
    text_file1.write("queue 1\n")
    text_file1.write("\n")
    text_file1.close()
    
    ###########################################################
    # Creating python executable file
    ############################################################
    filename2 = run_dir+'/'+runname+'.sh'
    text_file2 = open(filename2, "w") 
    text_file2.write("#! /bin/bash \n")
    text_file2.write("\n")
    text_file2.write("times="+times+"\n")
    text_file2.write("config_file="+config_file+"\n")
    text_file2.write("pythonfile="+pythonfile+"\n")
    text_file2.write("pythonscript="+pythonscript+"\n")
    text_file2.write("\n")
    text_file2.write("for i in ${times[@]}; do\n")
    text_file2.write("   awk -v  a=\"$i\" '/^tshift/ && $3 != \"supplied\" { $3=a } { print }' $config_file > tmp && mv tmp $config_file\n")
    text_file2.write("   $pythonscript $pythonfile -c $config_file \n")
    text_file2.write("done\n")
    text_file2.write("awk -v  a=\"0\" '/^tshift/ && $3 != \"supplied\" { $3=a } { print }' $config_file > tmp && mv tmp $config_file \n")
    text_file2.write("\n")
    text_file2.close()
    os.system('chmod u+x %s'%filename2)
    
    os.system('cp '+runname+'.sh %s/'%run_dir)
    os.system('chmod u+x ./'+runname+'.sh')
    os.system('cd '+run_dir)
    
    ###########################################################
    # Checking the configuration file and adding some important replacements
    ############################################################
    
    filename3 = '%s/%s'%(run_dir,config_file)
    # change the number of cores
    bashCommand = "awk -v  a="+str(cpus)+" '/^nb_cores/ && $3 != \"supplied\" { $3=a } { print }' "+str(config_file)+" > tmp && mv tmp "+str(config_file);
    subprocess.call(bashCommand,shell=True)
    
    filename3 = '%s/%s'%(run_dir,config_file)
    # change the number of nmax
    bashCommand = "awk -v  a="+str(nmax)+" '/^nmax/ && $3 != \"supplied\" { $3=a } { print }' "+str(config_file)+" > tmp && mv tmp "+str(config_file);
    subprocess.call(bashCommand,shell=True)
    
    filename3 = '%s/%s'%(run_dir,config_file)
    # change the number of nmax
    bashCommand = "awk -v  a="+str(nlive_points)+" '/^npoints/ && $3 != \"supplied\" { $3=a } { print }' "+str(config_file)+" > tmp && mv tmp "+str(config_file);
    subprocess.call(bashCommand,shell=True)
    
    # change the overwrite parameter
    bashCommand = "awk -v  a="+str(overwrite)+" '/^overwrite/ && $3 != \"supplied\" { $3=a } { print }' "+str(config_file)+" > tmp && mv tmp "+str(config_file);
    subprocess.call(bashCommand,shell=True)
      
    
    ###########################################################
    # Submit the job
    ############################################################
    filename4 = '%s/%s'%(run_dir,'condor_submit.sub')
    bashCommand = ['condor_submit', str(filename4)]
    process = subprocess.Popen(bashCommand, stdout=subprocess.PIPE,stderr=subprocess.PIPE);
    output,error = process.communicate()
    error
    Out [4]:
    b''