![]() |
[QUOTE=Chuck;531305]My kaggle account was blocked tonight in the middle of a session. I have been running only mfaktc.[/QUOTE]
Hmmm... Ditto for me. I have sent another email, quoting their above-posted response, protesting the blockage and asking for further clarification. Oh, well... At least Colab have now introduced the (relatively readily) availability of P100s themselves. |
[QUOTE=chalsall;530988]Could you please PM me an example?[/QUOTE]
Did you get PM from me? |
[QUOTE=bayanne;531316]Did you get PM from me?[/QUOTE]
Yeah... Sorry... I'm not even allowed to talk about half the things I'm juggling right now (and with only two screens!). In the (shortening) queue... |
Introducing tf1G.py v0.06:
No changes functionally, however, the script will now check to see if user ID and computer ID are set prior to starting. This is to reflect the new requirement on [URL]https://www.mersenne.ca/tf1G[/URL]. [CODE]#Script to automate trial factoring of Mersennes above 1G, using mfaktx. #Requires wget and curl. #version history: #v0.01 - Testing version. #v0.02 - First public release. #v0.04 - Stop trying to fetch if there are no assignments of that type. #- Count number of exponents tested and factored. #v0.05 - subprocess.run returns a CompletedProcess object, so the number of factored exponents was not updating. So I fixed the analyze_for_factors function. #- some smelling mistakes fixed. #v0.06 - Added a check for V5UserID and ComputerID, as well as a time check to comply with mersenne.ca's new requirements. #import needed packages import sys, os, subprocess, signal, time #set path to mfaktx mfaktx_path = "C:\\Users\\Dylan\\Desktop\\mfaktc\\mfaktc-0.21\\" #names of executables, change if needed MFAKTX = 'mfaktc.exe' WGET = 'wget.exe' CURL = 'curl.exe' #name of ini file, change if needed INI = 'mfaktc.ini' #specify certain parameters for later, when we go and fetch assignments: TF_LIMIT = str(71) TF_MIN = str(68) MAXASSIGNMENTS = str(1) BIGGEST = str(1) #changes should not be needed below print ("---------------------------------") print ("This is tf1G.py v0.06, a Python script to automate Mersenne trial factoring for exponents above 1 billion.") print ("It is copyleft, 2019, by Dylan Delgado.") print ("---------------------------------") #run checks to see if we have the paths correct if not os.path.exists(mfaktx_path): print("The path for Mfaktx does not exist. Check your setting for mfaktx_path.") sys.exit() else: #do we have mfaktx? if not os.path.exists(mfaktx_path + MFAKTX): print("Mfaktx does not exist. Check your path or name of your executable.") sys.exit() #run checks to check if the ini file exists, and has V5UserID and ComputerID set if not os.path.exists(mfaktx_path + INI): print("The ini file for Mfaktx does not exist. Check your path or name of your ini file.") sys.exit() else: #check the ini file for the lines "V5UserID=" and "ComputerID=" inifile = open(mfaktx_path + INI,"r") to_match1 = "V5UserID=" to_match2 = "ComputerID=" #initally assume the ID's are not set v5useridset = 0 computeridset = 0 for line in inifile: #scan each line for the lines mentioned above. If found, set the flags v5useridset and computeridset to 1. if to_match1 in line: v5useridset = 1 if to_match2 in line: computeridset = 1 #Now check if either of the flags are still set to 0. If they are, we check the time. If after midnight Jan 1, 2020, kill the script. If not, print a warning. if v5useridset == 0 or computeridset == 0: #get the current time currenttime = time.time() #Jan 1, 2020 00:00 has Unix Timestamp 1577836800 if currenttime < 1577836800: #warn the user, but let the script continue print("One of the following flags is unset in mfaktx.ini: V5UserID, ComputerID.") print("We will continue the script for now, but you should set these before Jan 1, 2020, otherwise James Heinrich") print("will not accept the results.") else: #warn the user, and kill the script print("One of the following flags is unset in mfaktx.ini: V5UserID, ComputerID.") print("Please set these, then relaunch the script.") sys.exit() #Now we define our URL URL = "https://www.mersenne.ca/tf1G.php?download_worktodo=1&tf_limit=" + TF_LIMIT + "&tf_min=" + TF_MIN + "&max_assignments=" + MAXASSIGNMENTS + "&biggest=" + BIGGEST print(URL) #delete a file (code courtesy of Brian Gladman) def delete_file(fn): if os.path.exists(fn): try: os.unlink(fn) except WindowsError: pass #submit work to mersenne.ca def submit_results(): print("Submitting work...") subprocess.run([CURL, "-F", "results_file=@results.txt", "https://www.mersenne.ca/bulk-factors.php"]) delete_file(mfaktx_path + "results.txt") #analyze a file for factors for statistics def analyze_for_factors(file): exp_with_factors = 0 #use re and look for the phrase "has a factor:" in file. If it exists, increment exp_with_factors and print the line. g = open(file,"r") to_match = ["has a factor:"] for line in g: for each_to_match in to_match: if each_to_match in line: print(line) exp_with_factors += 1 continue return exp_with_factors #main loop - fetch work with wget, run mfaktx, and submit results exp_tested = 0 exp_factored = 0 while(True): #check if we have a worktodo.txt if not os.path.exists(mfaktx_path + 'worktodo.txt'): print("No work to do, fetching more work in 5 seconds...") time.sleep(5) #No need to check for factors since this is presumably the first time we are running the script... submit_results() subprocess.run([WGET, URL, "-Oworktodo.txt"]) if os.stat(mfaktx_path + "worktodo.txt").st_size == 0: #no assignments were fetched raise Error("No assignments were fetched, check your parameters for TF_LIMIT, TF_MIN or MAXASSIGNMENTS.") #check if worktodo.txt is empty elif os.stat(mfaktx_path + "worktodo.txt").st_size == 0: print("No work to do, fetching more work in 5 seconds...") time.sleep(5) exp_with_factors = analyze_for_factors(mfaktx_path + "results.txt") exp_tested = exp_tested + int(MAXASSIGNMENTS) exp_factored = exp_factored + int(exp_with_factors) print("Number of exponents tested: " + str(exp_tested)) print("Number of exponents factored: " + str(exp_factored)) submit_results() subprocess.run([WGET, URL, "-Oworktodo.txt"]) if os.stat(mfaktx_path + "worktodo.txt").st_size == 0: #no assignments were fetched raise Error("No assignments were fetched, check your parameters for TF_LIMIT, TF_MIN or MAXASSIGNMENTS.") #run mfaktx subprocess.run([mfaktx_path + MFAKTX])[/CODE] |
[QUOTE=chalsall;531315]Hmmm... Ditto for me.
I have sent another email, quoting their above-posted response, protesting the blockage and asking for further clarification. Oh, well... At least Colab have now introduced the (relatively readily) availability of P100s themselves.[/QUOTE] Both of my Kaggle accounts were blocked early this evening. Only running mfaktc. Colab still going though. |
1 Attachment(s)
Introducing tf1G.py v0.08:
Per James Heinrich's suggestion, I have modified the script to fetch assignments based on the amount of GHz-days. You can still run the script using the old method, by uncommenting lines 29 and 86, and commenting lines 31 and 88. Also, the program will print the link to the project and the link to my profile, if you want to PM me here. Due to the length of the script, the code is attached (remove the .txt extension before running). |
[QUOTE=Dylan14;531355]Introducing tf1G.py v0.08:
Due to the length of the script, the code is attached[/QUOTE]Thanks Dylan for the code. The latest version of his tf1G.py will always be available at the top of the [url=https://www.mersenne.ca/tf1G]tf1G page[/url]. |
[QUOTE=chalsall;531315]I have sent another email, quoting their above-posted response, protesting the blockage and asking for further clarification.[/QUOTE]
They didn't reply to my protest, but my account was unblocked this morning. |
Well, I started up this morning on Kaggle and ran for 15 minutes or so and then it stopped. I tried to restart and got the account is blocked message.
|
[QUOTE=linament;531425]I tried to restart and got the account is blocked message.[/QUOTE]
Hmmm... Mine lasted 1:34, and then stopped. Restart attempt resulted in the blocked message again... Sigh... :sad: |
Colab still working here (all 4 instances running mprime, from 4 different Google accounts).
|
| All times are UTC. The time now is 23:05. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.