Posts: 157
Threads: 47
Joined: Nov 2021
sorry for my bad English,
This about the previous discussionl :
if you have thousands of [raw data] that need and urgently to be processed with Python,
but you know, after certain hour(s), the program will do weird things,
what will you do to make sure all [raw data] that process at night will be done in the morning?
Posts: 4,787
Threads: 76
Joined: Jan 2018
(Sep-02-2024, 02:45 PM)kucingkembar Wrote: but you know, after certain hour(s), the program will do weird things, The first strategy would be to try to understand WHY the program does weird things after some hours. Normally when you have a bug, try to understand why it occurs.
I remember a Python program which started behaving poorly after some time and the reason was a memory leak. When it ran for a long time, the program consumed more and more memory and it slowed down etc.
If you don't find the bug, you could perhaps divide the job to do into several processes. The program would handle a certain amount of data, then it would exit and another process would be launched to handle more data etc.
« We can solve any problem by introducing an extra level of indirection »
Posts: 157
Threads: 47
Joined: Nov 2021
(Sep-02-2024, 05:12 PM)Gribouillis Wrote: The first strategy would be to try to understand WHY the program does weird things after some hours. Normally when you have a bug, try to understand why it occurs.
I remember a Python program which started behaving poorly after some time and the reason was a memory leak. When it ran for a long time, the program consumed more and more memory and it slowed down etc.
If you don't find the bug, you could perhaps divide the job to do into several processes. The program would handle a certain amount of data, then it would exit and another process would be launched to handle more data etc.
i am not that smart, i do not have ability to detect the error that occurs some hour(s) later,
anyway can you explain how to "divide the job to do into several processes"?
but remember : i urgently need to get all of the files done in the morning
Posts: 4,787
Threads: 76
Joined: Jan 2018
Sep-02-2024, 07:14 PM
(This post was last modified: Sep-02-2024, 07:49 PM by Gribouillis.)
(Sep-02-2024, 05:27 PM)kucingkembar Wrote: anyway can you explain how to "divide the job to do into several processes"?
but remember : i urgently need to get all of the files done in the morning If you are processing files, you could for example make 10 directories, each containing one tenth of the files, then you launch ten programs, each handling one of the directories.
« We can solve any problem by introducing an extra level of indirection »
Posts: 157
Threads: 47
Joined: Nov 2021
@ Gribouillis i expect better answer...
Posts: 4,787
Threads: 76
Joined: Jan 2018
Sep-03-2024, 07:25 AM
(This post was last modified: Sep-03-2024, 07:26 AM by Gribouillis.)
(Sep-03-2024, 04:08 AM)kucingkembar Wrote: i expect better answer... What's wrong with my answer? You could perhaps explain what your program is doing in a more detailed way.
« We can solve any problem by introducing an extra level of indirection »
Posts: 157
Threads: 47
Joined: Nov 2021
(Sep-03-2024, 07:25 AM)Gribouillis Wrote: What's wrong with my answer? You could perhaps explain what your program is doing in a more detailed way. I do not mean to prank you,
I write as clues : thousands of [raw data] , process at night will be done in the morning
based on this info, each [raw data] need some time to proceed = need huge resources(cpu+gpu) to process,
if I put your code to run 10 programs at once, i don't know who came first, the correct output or BSOD
Posts: 4,787
Threads: 76
Joined: Jan 2018
(Sep-03-2024, 09:03 AM)kucingkembar Wrote: I write as clues : thousands of [raw data] , process at night will be done in the morning
based on this info, each [raw data] need some time to proceed = need huge resources(cpu+gpu) to process,
if I put your code to run 10 programs at once, i don't know who came first, the correct output or BSOD I don't know what [raw data] means. One of your post seems to imply that it is a lot of files.
You said that the program fails after a few hours, so if instead of one program that lasts 10 hours you start 10 programs that last 1 hour, none of the programs will run a few hours. If you can't start the 10 programs concurrently, start them one after the other.
For the BSOD, just uninstall Windows. I never use it, I never have a BSOD.
« We can solve any problem by introducing an extra level of indirection »
Posts: 157
Threads: 47
Joined: Nov 2021
(Sep-03-2024, 09:42 AM)Gribouillis Wrote: For the BSOD, just uninstall Windows. I never use it, I never have a BSOD. it same as = if not enjoy life just unlife yourself
Posts: 2,125
Threads: 11
Joined: May 2017
(Sep-03-2024, 04:08 AM)kucingkembar Wrote: @Gribouillis i expect better answer... How do I get no help?
Asking questions without providing the appropriate context and then insulting the volunteers.
|