Jump to content

Jud

Members
  • Content Count

    118
  • Joined

  • Last visited

Posts posted by Jud


  1. Well, I downloaded FastMM5, put it at the first of my ISES, did a build, and I get the error message:

     

    FastMM cannot be installed, because the default memory manager has already been used to allocate memory.  I exited Delphi, restarted it, did a build, got the same thing.

     

    ADDED: Right after I wrote that I realized that it should go in USES in the DPROJ file instead of DPR file.  That got rid of the error message.  But I did a test on an quad-core i7, so 8 threads, and it is no faster.


  2. Thank you both for the replies.  I don't have the knowledge to write a memory manager, so I'll stick with what I'm doing now.

     

    Delphi is a little behind with support for 64-bit systems with large memories and/or multiple CPU chips.

     

    BTW, the dual-Xeon systems do well on multi-threaded computation-intensive tasks, but if it is memory intensive, it is more like two independent xeons.


  3. Here is the problem (a bit of a long message) - I'm writing a threaded program to run on workstations with dual Xeons.  Each of the Xeons has eight hyperthreaded cores.  

    (I've read https://www.delphipraxis.net/113427-beginthreadaffinity-setthreadaffinity.html but I don't think it helps me.)

     

    Dual-Xeon systems have Non-Uniform Memory Access (NUMA) - each of the Xeons have direct access to their own memory, but they can access memory on the other Xeon - but it takes a long time for a thread running on one Xeon to access memory on the other Xeon.  The bottleneck in the program is accessing memory.

     

    I have the program set so I can adjust the number of threads it is running.  As I test from 1 up to 16 threads, performance improves.  TaskManager/performance/Resource meter shows that all 16 threads are running on one Xeon.  But if I go to 17 threads or more, it hurts performance (compared to 16 threads on one Xeon).  What must be happening is that threads 17 and above are executing on the second Xeon but their memory must be on the first Xeon.

     

    That's the problem.

     

    I've tried to set the affinity for each thread to a particular CPU and hope it uses that CPU for its memory, but setting the affinity inside a thread isn't working at all (even with only one thread, it runs on all CPUs.)  

    What I have right now is I limit an instance of the program to running 16 threads and I have the affinity set to run on the first Xeon.  Then I start a second instance of the program - it checks to see if the first instance is running, and if so, it sets its affinity to run on the second Xeon.  Then I merge the results later (which isn't an ideal situation).

     

    This is working, with double the performance of running on one Xeon, but it is no different from running on two computers, each with one Xeon.

     

    So is there a way to get one instance to use all 32 available CPUs with full performance?

     

    (If I could assign each thread and its memory to a particular CPU, that should fix the problem, but I haven't been able to do that.)

     

     


  4. Well the problem with local variables is only with subroutines called in the threads.  But just about all of the work is inside threads!

     

    The problem with refactor/rename and Find Declaration went away but now they are back.  I found someone discussing this problem on a much earlier version, XE7 I think, and what they said to do doesn't apply here.  Does anyone have a solution?


  5. On 10/19/2020 at 3:49 AM, Lars Fosdal said:

    If you are going to copy/paste a form from an old project to a new project - why rename the form at all? 

    Can't the form be reused or be made to be reusable?

     

     

    The purpose of renaming the form is that in the original project, the forms have specific names.  Starting a new VCL project names it Form1, etc.  If you just paste code into the new one, every reference to the old form name will cause an error.  The best way I know to avoid that is to rename the new form from Form1 to the same name as the old form - that avoids all of the errors.   And generally there will be changes to the form once it is in the new project.

     

    Thanks for all of the replies.


  6. The main things I work on are multi-threaded on the 64-bit platform.  When I first got Delphi 10.4, I had problems in the IDE:

     

    1. Refactor/rename would not work - it would change only the one at the cursor and none of the others.

     

    2. Find Declaration would not work.

     

    3. Worst of all, after a break, I could not examine variables.  Putting the cursor over the variable didn't work.  Local variables aren't shown in their window.

     

    I had to go back to 10.3.  When I got 10.4.1 (about 2 days after release), the problems were gone - until yesterday.  Now they are all back.  Also, before I think Ctrl-F7 would work to examine a variable, but now it doesn't work.  It says "E2003 undeclared identifier". (When debugging, I have {$O-} to make sure it doesn't optimize away any variables.)

     

    One thing about my program is that I have a compiler directive to use or not use multi-threading.  (I can also set the number of threads from 1 to the number of virtual cores.)

    I found that if I use the compiler directive to turn off the multi-threading, it doesn't have the problems.  If I turn multi-threading back on, the problems are back.

     

    I haven't been able to find a solution.  Does anyone know how to fix this?

     

    ADDED: I went back to an earlier project. and it didn't have the problems. Then I went back to the project with the problems, and it still has them.

     

    ALSO: I since it is specific to the project, I deleted the DSK file.  Find Declaration works and examining global variables works, but not local variables.

     


  7. Sorry, I was overwhelmed by the number of responses and haven't been able to get to them (yet).  I know that you can't simply copy the files to another folder and rename them.  I know that you don't need the DSK file because the IDS will make a new one.  Also, saving the project with a new name doesn't work because of problems with file names.

     

    The day after I posted the question, I needed to do this.  This is what works for me, but it should be easier:

     1. Start a new Windows VCL app
      2. Save it with the new name in a new folder
      3: Compile to generate the RES file (etc)
      4. Temporarily rename the forms to the same name as the old ones
      5. copy and paste the VCL components from the old forms to the new forms
      6. Compile for good measure, to make sure all is OK (probably not necessary)
      7. Copy and paste the source code after the UNIT statement to the new source
         files; delete what was in the new file except for the UNIT statement.
      8. Compile for good measure
      9. Rename the forms as desired
      10. Set the events - make sure the OnClick of buttons go to the right place, etc
      11. Compile
      12. Make changes to the new project

     


  8. What is the best way to take an existing project, leave it exactly as it is, and start a new project (with a new name) from that point?  Save As a new project name doesn't work (files are shared).  You can't just put the files in another folder and rename them.  I've been doing this by starting a new project (VCL) and copy and paste from the old project to the new one, but that is cumbersome. 

     

    Is there a better way?


  9. I have Delphi 10.4.1.  I've used GetIt to download patches (worked very well).  Now I'm trying to download a package from GetHub.  I have a GitHub account.  When I try to use GetIt to install a package, I get the message:

     

    Loading EULAS...

     (X) Cannot load data from the server: "RADStudio.josn" metadata file does not exist.

    (X) Setup cannot continue due to a corrupted installation file

    (I) - A problem occurred during the process.

     

    Is there something that I'm not doing correctly, or haven't done?


  10. Thank you for the replies.

     

    I have two other IDE issues (in 10.4), which may be related.  (I have all three patches installed.)

     

    (1) Sometimes Refactor/rename works but most of the time the top few items on the refactor menu are disabled.

     

    (2) Sometimes Find Declaration works but most of the time it doesn't.

     

    I know that for both of these need to have a good compile to work, but I do that.  Are these problems related to the first one?

     

×