LSW Dear user, I would be happy to review your .geo file. Please send it by email at fbeaudoin@nanoacademic.com
My device is quite large (1500 nm * 900 nm * 55nm) and it needs large computing time and memory. And refined mesh file has almost 30 millions nodes and 200 millions total elements.
Normally, what should matter the most is not the device dimensions but its complexity, i.e., how many gates and features it has.
There is a significant chance that you can reduce the final mesh size by fine-tuning your strategy and adaptive mesh parameters. For example, we strongly recommend starting with a very coarse mesh, maybe with a few thousand nodes or less. This will help the adaptive mesher to explore scenarios with less nodes, otherwise there is a chance that the adaptive meshing scheme misses coarser mesh configurations that still converge.
In addition, if you have not done so already, I recommend that you try playing with the adaptive-mesh parameters and also potentially the tolerance of the solver. Some of these parameters are explained in the adaptive-mesh tutorial.
You can also look into the API reference of the SolverParams class. Here are the most relevant solver parameters for you
- initial_ref_factor (float between 0 and 1) – The refinement factor rate initially used by the adaptive-mesh Poisson solver. The lower the number the more refined the output mesh will be. Default: 0.1.
- final_ref_factor (float between 0 and 1) – The refinement factor rate used in the final refinements of the adaptive-mesh Poisson solver. Default: 0.75.
- maxiter_adapt (int) – maximal number of iterations permitted before the mesh is adapted. Default value is -1, indicating that there is no maximum.
- dot_region (list of strings and/or lists of tuples or list of 2 – tuples or single string): Regions where we would like to set the maximal value of the characteristic length. Defaults to None, in which case no maximal characteristic length will be set in any region
- h_dot (float or list of floats) – Maximal value of the characteristic length in each of the regions defined in dot_region.
- max_nodes (int) – Maximal number of nodes permitted for an adaptive iteration to be performed. If the maximum is exceeded no aditional adaptive iterations will take place. (Default is 1e6)
- min_nodes (int) – Minimal number of nodes allowed by the solver. If Poisson solver converges with less nodes, then the initial mesh will be uniformly refined and the adaptive procedure will restart. (Default is 1e5)
You could try increasing the initial refinement factor (initial_ref_factor) to something like 0.2 or even 0.3 or more to refine less dramatically in the beginning.
The main computational bottleneck of QTCAD are already parallelized, so that if you can run the code on a workstation which has multiple cores, this may accelerate your computations significantly. However, we do not support GPU acceleration for the moment, but it would be a great idea to do so in the future.
Before upgrade my computer, is there a way to optimize my code? It takes up nearly 200GB of memory just by loading refined mesh file using Mesh method and it make memory errors.
I would like to refer you to the above suggestions, it may be possible to converge with less nodes, but I would need to see your .geo file and your .py script to be sure. If you can send them to me by email at fbeaudoin@nanoacademic.com in a .zip file (Outlook will filter out Python scripts otherwise), then I will be happy to help you with this.