Author Topic: Trouble with Segmentation fault  (Read 7252 times)

0 Members and 1 Guest are viewing this topic.

Offline BlackBarrel

  • Heavy QuantumATK user
  • ***
  • Posts: 28
  • Country: cn
  • Reputation: 0
    • View Profile
Trouble with Segmentation fault
« on: June 18, 2011, 16:14 »
Recently I calculated a system with ATK DFT pack. I wrote a script for the system with a controllable channel length to learn the dependence of transmission spectrum on it. It works well with any length <= 19 cells, whereas systems with lengths above 19 cells encounter the segmentation fault just after equivalent bulk calculation and before device SCF.
Code
+------------------------------------------------------------------------------+
|                                                                              |
| Atomistix ToolKit 11.2.0 [Build 3044]                                        |
|                                                                              |
+------------------------------------------------------------------------------+

.....omitted for the maximum allowed length of this message^_^

Calculating Eigenvalues    : ==================================================
Calculating Density Matrix : ==================================================

+------------------------------------------------------------------------------+
| Density Matrix Report                             DM        DD               |
+------------------------------------------------------------------------------+
|   0  Si   [   15.666 ,   15.465 ,    0.000 ]    4.00008   0.00008            |
|   1  Si   [   16.119 ,   17.398 ,    1.116 ]    3.99996  -0.00004            |
|   2  Si   [   15.666 ,   17.398 ,    3.348 ]    4.00000   0.00000            |
|   3  Si   [   16.119 ,   15.465 ,    4.464 ]    4.00001   0.00001            |
|   4  Si   [   15.666 ,   15.465 ,    6.696 ]    4.00003   0.00003            |
|   5  Si   [   16.119 ,   17.398 ,    7.812 ]    3.99992  -0.00008            |
|   6  Si   [   15.666 ,   17.398 ,   10.044 ]    4.00006   0.00006            |
|   7  Si   [   16.119 ,   15.465 ,   11.160 ]    3.99997  -0.00003            |
|   8  Si   [   15.666 ,   15.465 ,   13.392 ]    4.00003   0.00003            |
|   9  Si   [   16.119 ,   17.398 ,   14.508 ]    3.99999  -0.00001            |
|  10  Si   [   15.666 ,   17.398 ,   16.740 ]    3.99999  -0.00001            |
|  11  Si   [   16.119 ,   15.465 ,   17.856 ]    3.99996  -0.00004            |
|  12  Si   [   15.666 ,   15.465 ,   20.088 ]    4.00008   0.00008            |
|  13  Si   [   16.119 ,   17.398 ,   21.204 ]    3.99994  -0.00006            |
|  14  Si   [   15.666 ,   17.398 ,   23.436 ]    4.00002   0.00002            |
|  15  Si   [   16.119 ,   15.465 ,   24.552 ]    4.00002   0.00002            |
|  16  Si   [   15.666 ,   15.465 ,   26.784 ]    4.00002   0.00002            |
|  17  Si   [   16.119 ,   17.398 ,   27.900 ]    3.99994  -0.00006            |
|  18  Si   [   15.666 ,   17.398 ,   30.132 ]    4.00005   0.00005            |
|  19  Si   [   16.119 ,   15.465 ,   31.249 ]    3.99996  -0.00004            |
|  20  Si   [   15.666 ,   15.465 ,   33.481 ]    4.00005   0.00005            |
|  21  Si   [   16.119 ,   17.398 ,   34.597 ]    3.99999  -0.00001            |
|  22  Si   [   15.666 ,   17.398 ,   36.829 ]    3.99998  -0.00002            |
|  23  Si   [   16.119 ,   15.465 ,   37.945 ]    3.99997  -0.00003            |
|  24  Si   [   15.666 ,   15.465 ,   40.177 ]    4.00007   0.00007            |
|  25  Si   [   16.119 ,   17.398 ,   41.293 ]    3.99993  -0.00007            |
|  26  Si   [   15.666 ,   17.398 ,   43.525 ]    4.00003   0.00003            |
|  27  Si   [   16.119 ,   15.465 ,   44.641 ]    4.00001   0.00001            |
|  28  Si   [   15.666 ,   15.465 ,   46.873 ]    4.00001   0.00001            |
|  29  Si   [   16.119 ,   17.398 ,   47.989 ]    3.99995  -0.00005            |
|  30  Si   [   15.666 ,   17.398 ,   50.221 ]    4.00004   0.00004            |
|  31  Si   [   16.119 ,   15.465 ,   51.337 ]    3.99995  -0.00005            |
|  32  Si   [   15.666 ,   15.465 ,   53.569 ]    4.00007   0.00007            |
|  33  Si   [   16.119 ,   17.398 ,   54.685 ]    3.99998  -0.00002            |
|  34  Si   [   15.666 ,   17.398 ,   56.917 ]    3.99998  -0.00002            |
|  35  Si   [   16.119 ,   15.465 ,   58.033 ]    3.99999  -0.00001            |
|  36  Si   [   15.666 ,   15.465 ,   60.265 ]    4.00006   0.00006            |
|  37  Si   [   16.119 ,   17.398 ,   61.381 ]    3.99992  -0.00008            |
|  38  Si   [   15.666 ,   17.398 ,   63.613 ]    4.00005   0.00005            |
|  39  Si   [   16.119 ,   15.465 ,   64.729 ]    4.00000   0.00000            |
|  40  Si   [   15.666 ,   15.465 ,   66.961 ]    4.00001   0.00001            |
|  41  Si   [   16.119 ,   17.398 ,   68.077 ]    3.99997  -0.00003            |
|  42  Si   [   15.666 ,   17.398 ,   70.309 ]    4.00002   0.00002            |
|  43  Si   [   16.119 ,   15.465 ,   71.425 ]    3.99994  -0.00006            |
|  44  Si   [   15.666 ,   15.465 ,   73.657 ]    4.00008   0.00008            |
|  45  Si   [   16.119 ,   17.398 ,   74.773 ]    3.99997  -0.00003            |
|  46  Si   [   15.666 ,   17.398 ,   77.005 ]    3.99999  -0.00001            |
|  47  Si   [   16.119 ,   15.465 ,   78.121 ]    4.00000   0.00000            |
|  48  Si   [   15.666 ,   15.465 ,   80.353 ]    4.00004   0.00004            |
|  49  Si   [   16.119 ,   17.398 ,   81.469 ]    3.99992  -0.00008            |
|  50  Si   [   15.666 ,   17.398 ,   83.701 ]    4.00006   0.00006            |
|  51  Si   [   16.119 ,   15.465 ,   84.817 ]    3.99999  -0.00001            |
|  52  Si   [   15.666 ,   15.465 ,   87.049 ]    4.00002   0.00002            |
|  53  Si   [   16.119 ,   17.398 ,   88.165 ]    3.99998  -0.00002            |
|  54  Si   [   15.666 ,   17.398 ,   90.397 ]    4.00001   0.00001            |
|  55  Si   [   16.119 ,   15.465 ,   91.514 ]    3.99995  -0.00005            |
|  56  Si   [   15.666 ,   15.465 ,   93.746 ]    4.00008   0.00008            |
|  57  Si   [   16.119 ,   17.398 ,   94.862 ]    3.99996  -0.00004            |
|  58  Si   [   15.666 ,   17.398 ,   97.094 ]    4.00000   0.00000            |
|  59  Si   [   16.119 ,   15.465 ,   98.210 ]    4.00001   0.00001            |
|  60  Si   [   15.666 ,   15.465 ,  100.442 ]    4.00003   0.00003            |
|  61  Si   [   16.119 ,   17.398 ,  101.558 ]    3.99992  -0.00008            |
|  62  Si   [   15.666 ,   17.398 ,  103.790 ]    4.00006   0.00006            |
|  63  Si   [   16.119 ,   15.465 ,  104.906 ]    3.99997  -0.00003            |
|  64  Si   [   15.666 ,   15.465 ,  107.138 ]    4.00003   0.00003            |
|  65  Si   [   16.119 ,   17.398 ,  108.254 ]    3.99999  -0.00001            |
|  66  Si   [   15.666 ,   17.398 ,  110.486 ]    3.99999  -0.00001            |
|  67  Si   [   16.119 ,   15.465 ,  111.602 ]    3.99996  -0.00004            |
|  68  Si   [   15.666 ,   15.465 ,  113.834 ]    4.00008   0.00008            |
|  69  Si   [   16.119 ,   17.398 ,  114.950 ]    3.99994  -0.00006            |
|  70  Si   [   15.666 ,   17.398 ,  117.182 ]    4.00002   0.00002            |
|  71  Si   [   16.119 ,   15.465 ,  118.298 ]    4.00002   0.00002            |
|  72  Si   [   15.666 ,   15.465 ,  120.530 ]    4.00002   0.00002            |
|  73  Si   [   16.119 ,   17.398 ,  121.646 ]    3.99994  -0.00006            |
|  74  Si   [   15.666 ,   17.398 ,  123.878 ]    4.00005   0.00005            |
|  75  Si   [   16.119 ,   15.465 ,  124.994 ]    3.99996  -0.00004            |
|  76  Si   [   15.666 ,   15.465 ,  127.226 ]    4.00005   0.00005            |
|  77  Si   [   16.119 ,   17.398 ,  128.342 ]    3.99999  -0.00001            |
|  78  Si   [   15.666 ,   17.398 ,  130.574 ]    3.99998  -0.00002            |
|  79  Si   [   16.119 ,   15.465 ,  131.690 ]    3.99997  -0.00003            |
|  80  Si   [   15.666 ,   15.465 ,  133.922 ]    4.00007   0.00007            |
|  81  Si   [   16.119 ,   17.398 ,  135.038 ]    3.99993  -0.00007            |
|  82  Si   [   15.666 ,   17.398 ,  137.270 ]    4.00003   0.00003            |
|  83  Si   [   16.119 ,   15.465 ,  138.386 ]    4.00001   0.00001            |
|  84  Si   [   15.666 ,   15.465 ,  140.618 ]    4.00001   0.00001            |
|  85  Si   [   16.119 ,   17.398 ,  141.734 ]    3.99995  -0.00005            |
|  86  Si   [   15.666 ,   17.398 ,  143.966 ]    4.00004   0.00004            |
|  87  Si   [   16.119 ,   15.465 ,  145.082 ]    3.99995  -0.00005            |
|  88  Si   [   15.666 ,   15.465 ,  147.314 ]    4.00007   0.00007            |
|  89  Si   [   16.119 ,   17.398 ,  148.430 ]    3.99998  -0.00002            |
|  90  Si   [   15.666 ,   17.398 ,  150.662 ]    3.99998  -0.00002            |
|  91  Si   [   16.119 ,   15.465 ,  151.779 ]    3.99999  -0.00001            |
|  92  Si   [   15.666 ,   15.465 ,  154.011 ]    4.00006   0.00006            |
|  93  Si   [   16.119 ,   17.398 ,  155.127 ]    3.99992  -0.00008            |
|  94  Si   [   15.666 ,   17.398 ,  157.359 ]    4.00005   0.00005            |
|  95  Si   [   16.119 ,   15.465 ,  158.475 ]    4.00000   0.00000            |
|  96  Si   [   15.666 ,   15.465 ,  160.707 ]    4.00001   0.00001            |
|  97  Si   [   16.119 ,   17.398 ,  161.823 ]    3.99997  -0.00003            |
|  98  Si   [   15.666 ,   17.398 ,  164.055 ]    4.00002   0.00002            |
|  99  Si   [   16.119 ,   15.465 ,  165.171 ]    3.99994  -0.00006            |
|  100  Si   [   15.666 ,   15.465 ,  167.403 ]    4.00008   0.00008           |
|  101  Si   [   16.119 ,   17.398 ,  168.519 ]    3.99997  -0.00003           |
|  102  Si   [   15.666 ,   17.398 ,  170.751 ]    3.99999  -0.00001           |
|  103  Si   [   16.119 ,   15.465 ,  171.867 ]    4.00000   0.00000           |
|  104  Si   [   15.666 ,   15.465 ,  174.099 ]    4.00004   0.00004           |
|  105  Si   [   16.119 ,   17.398 ,  175.215 ]    3.99992  -0.00008           |
|  106  Si   [   15.666 ,   17.398 ,  177.447 ]    4.00006   0.00006           |
|  107  Si   [   16.119 ,   15.465 ,  178.563 ]    3.99999  -0.00001           |
|  108  Si   [   15.666 ,   15.465 ,  180.795 ]    4.00002   0.00002           |
|  109  Si   [   16.119 ,   17.398 ,  181.911 ]    3.99998  -0.00002           |
|  110  Si   [   15.666 ,   17.398 ,  184.143 ]    4.00001   0.00001           |
|  111  Si   [   16.119 ,   15.465 ,  185.259 ]    3.99995  -0.00005           |
+------------------------------------------------------------------------------+
|   2 E = -144.593 dE =  3.562179e-03 dH =  1.152072e-03                       |
+------------------------------------------------------------------------------+
| Calculation Converged in 2 steps                                             |
|                                                                              |
| Fermi Level  = -3.679114 eV                                                  |
+------------------------------------------------------------------------------+
+------------------------------------------------------------------------------+
|                                                                              |
| Equivalent Bulk  [Finished Mon Apr 11 23:23:39 2011]                         |
|                                                                              |
+------------------------------------------------------------------------------+
/home/zxgao/QuantumWise/atk-11.2.0/atkpython/bin/atkpython: line 3: 18596 Segmentation fault      PSEUDOPOTENTIALS_PATH=$EXEC_DIR/../share/pseudopotentials GPAW_SETUP_PATH=$EXEC_DIR/../share/gpaw-setups/ PYTHONHOME=$EXEC_DIR/.. PYTHONPATH= LD_LIBRARY_PATH=$EXEC_DIR/../lib $EXEC_DIR/atkpython_exec $*
Is it a problem of lacking memory? My machine has 24G mems and my structure has 92 atoms in 19-cell system and 96 atoms in 20-cell one, buffer layers and electrodes included. SZ basis is chosen. I have examined the calculation of 19-cell system and found the maximum mem no more than 60%. So I think it is probably not a problem of mem, nor is a problem of my script since it works well with shorter channels. I'm really confused with such problem. Is there any other possible cause?My atk ver is 11.2.0. Do I have to update it? Thank you for your answer!

Offline Anders Blom

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 5574
  • Country: dk
  • Reputation: 96
    • View Profile
    • QuantumATK at Synopsys
Re: Trouble with Segmentation fault
« Reply #1 on: June 20, 2011, 03:30 »
In some sense it seems pretty clear that you are out of memory, if the smaller system works and the bigger not. On the other hand, it's rather unusual that the device calculation would use more memory than the equivalent bulk. But it's hard to say much more without seeing the exact geometry. Are there any metallic/dielectric regions in the system?

Indeed you have a lot of RAM, but perhaps you are running in parallel, with several MPI processes on the same node?

Offline Anders Blom

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 5574
  • Country: dk
  • Reputation: 96
    • View Profile
    • QuantumATK at Synopsys
Re: Trouble with Segmentation fault
« Reply #2 on: June 20, 2011, 03:32 »
Also, you should definitely upgrade, several bugs have been fixed between 11.2.0 and 11.2.3. The same license works for 11.2.3.

The fact that you are using a SZ basis set makes it even more puzzling. Can you share the geometry and the precise way you submit the job?

Offline BlackBarrel

  • Heavy QuantumATK user
  • ***
  • Posts: 28
  • Country: cn
  • Reputation: 0
    • View Profile
Re: Trouble with Segmentation fault
« Reply #3 on: June 21, 2011, 11:18 »
In some sense it seems pretty clear that you are out of memory, if the smaller system works and the bigger not. On the other hand, it's rather unusual that the device calculation would use more memory than the equivalent bulk. But it's hard to say much more without seeing the exact geometry. Are there any metallic/dielectric regions in the system? Indeed you have a lot of RAM, but perhaps you are running in parallel, with several MPI processes on the same node?
Yes, it is a dual-gated system with two metallic and two dielectric regions. MPI is not used. It may be helpful for you to have a look at my script, though it is written just for my own use and thus is probably too chaotic to read.  ;D Besides, I have found that in the manual the default temperature is written as 100K, whereas in fact the default T is 300K. I was really surprised when I found this error. If the default was 100K, I would have to recalculate everything I did in the past... :'(
Code
import numpy

# Constant for adjustment
delta=-0.000006922-0.00001
layer_thickness=1.118640452-0.666359548
y_offset=-7.731953546-0.00001
# Cell repetition
repeat_cell=10
repeat_cell_electrode=2
buffer_cell=2

# Layey_distance including buckling,attention!
layer_distance=30

# Gate Geometry
gate_distance1=gate_distance2=10.
gate_thickness1=gate_thickness2=1.

# Dielectric region: Approximately SiO2 :float
di_constant1=di_constant2=3.9
di_thickness1=di_thickness2=gate_distance1-3.
gate_di_seg1=gate_di_seg2=0.  
##di_layer_seg=gate_distance-gate_di_seg-di_thickness

# Electrode Voltage
e_volt_list=[0.1]

# Gate Voltage
e_gate_list=[-0.2,1.]

# Electric Field Voltage
e_field_list=[1.,2.]

# Numerical and Iteration Parameters
device_numerical=NumericalAccuracyParameters(
    grid_mesh_cutoff= 75 *Hartree,            #Default: HuckelCalculator=10*Hartree, LCAOCalculator=75*Hartree 
    k_point_sampling=(1,300,1),                #default (1,1,1)
    radial_step_size=0.01*Angstrom,           #length > 0.0*Angstrom 
    density_cutoff=1.0e-6,                    #float>0., default:1.0e-6
    interaction_max_range=10.*Angstrom,       #The maximum allowed interaction distance between two orbitals. 
    number_of_reciprocal_points=1024,         #The number of reciprocal points used for evaluating two-center integrals.
    reciprocal_energy_cutoff=1250.*Hartree,   #The energy cutoff in reciprocal space used for evaluating of the two-center integrals. 
    electron_temperature=300*Kelvin           #default:100K??
    )

device_iteration=IterationControlParameters(
    tolerance=4.0e-5,                         #default 4.e-5
    max_steps=500,                            #default 100
    algorithm=PulayMixer,                     #NoMixer | LinearMixer | PulayMixer | AndersonMixer ,for histroy mixing
    damping_factor=0.1,                       #float in (0.,1.]
    number_of_history_steps=10,               #int>0, for history mixing
    start_mixing_after_step=0,                #The total number of steps to wait before the mixing algorithm is used.
    mixing_variable=HamiltonianVariable       #HamiltonianVariable | DensityMatrixVariable 
    )

# filename.nc
filename='silicene_DZP_c'+str(repeat_cell)

cell = [[  0.666359548+layer_distance/2,  7.731953546-y_offset,   -0.000006922-delta],
        [  1.118640452+layer_distance/2,  9.665046454-y_offset,    1.116024993-delta],
        [  0.666359548+layer_distance/2,  9.664953546-y_offset,    3.348047289-delta],
        [  1.118640452+layer_distance/2,  7.732046454-y_offset,    4.464079204-delta]]
temp=cell
i=1
while i<repeat_cell+buffer_cell*2+repeat_cell_electrode*2:
    temp=temp+numpy.add(cell,[0,0,i*6.69611]).tolist()
    i=i+1



###############################################################
# Left electrode
###############################################################

# Set up lattice
vector_a = [layer_distance, 0.0, 0.0]*Angstrom
vector_b = [0.0, 3.866, 0.0]*Angstrom
vector_c = [0.0, 0.0, 6.69611*repeat_cell_electrode]*Angstrom

left_electrode_lattice = UnitCell(vector_a, vector_b, vector_c)

# Define elements
left_electrode_elements = [Silicon]*4*repeat_cell_electrode

# Define coordinates

left_electrode_coordinates = temp[0:4*repeat_cell_electrode]*Angstrom

# Set up configuration
left_electrode = BulkConfiguration(
    bravais_lattice=left_electrode_lattice,
    elements=left_electrode_elements,
    cartesian_coordinates=left_electrode_coordinates
    )

###############################################################
# Right electrode
###############################################################

# Set up lattice
vector_a = [layer_distance, 0.0, 0.0]*Angstrom
vector_b = [0.0, 3.866, 0.0]*Angstrom
vector_c = [0.0, 0.0, 6.69611*repeat_cell_electrode]*Angstrom
right_electrode_lattice = UnitCell(vector_a, vector_b, vector_c)

# Define elements
right_electrode_elements = [Silicon]*4*repeat_cell_electrode

# Define coordinates
right_electrode_coordinates = temp[0:4*repeat_cell_electrode]*Angstrom

# Set up configuration
right_electrode = BulkConfiguration(
    bravais_lattice=right_electrode_lattice,
    elements=right_electrode_elements,
    cartesian_coordinates=right_electrode_coordinates
    )

###############################################################
# Central region
###############################################################

# Set up lattice
vector_a = [layer_distance, 0.0, 0.0]*Angstrom
vector_b = [0.0, 3.866, 0.0]*Angstrom
vector_c = [0.0, 0.0, 6.69611*(repeat_cell+buffer_cell*2+repeat_cell_electrode*2)]*Angstrom
central_region_lattice = UnitCell(vector_a, vector_b, vector_c)

# Define elements
central_region_elements = [Silicon]*4*(repeat_cell+buffer_cell*2+repeat_cell_electrode*2)

# Define coordinates
central_region_coordinates = temp*Angstrom

# Set up configuration
central_region = BulkConfiguration(
    bravais_lattice=central_region_lattice,
    elements=central_region_elements,
    cartesian_coordinates=central_region_coordinates
    )

device_configuration = DeviceConfiguration(
    central_region,
    [left_electrode, right_electrode]
    )

###############################################################
# Define gates
###############################################################
gate1=BoxRegion(
    value=1*Volt,
    xmin=(0.666359548+layer_distance/2-gate_distance1-gate_thickness1)*Angstrom,xmax=(0.666359548+layer_distance/2-gate_distance1)*Angstrom,
    ymin=0*Angstrom,ymax=3.866*Angstrom,
    zmin=(buffer_cell+repeat_cell_electrode)*6.69611*Angstrom,zmax=6.69611*(repeat_cell+buffer_cell+repeat_cell_electrode)*Angstrom
    )

gate2=gate1(
    value=-1*Volt,
    xmin=(1.118640452+layer_distance/2+gate_distance2)*Angstrom,xmax=(1.118640452+layer_distance/2+gate_distance2+gate_thickness2)*Angstrom
    )
e_field=e_field_list[0]
e_gate=e_gate_list[0]
gate_bottom=gate1(value= (e_field*di_thickness1/di_constant1+e_gate/2.)*Volt)
gate_top=gate2(value= (-e_field*di_thickness1/di_constant1+e_gate/2.)*Volt)
device_configuration.setMetallicRegions([gate_bottom,gate_top])

##############################################################
# Define dielectrics
##############################################################
di1=BoxRegion(
    value=di_constant1,
    xmin=(0.666359548+layer_distance/2-gate_distance1+gate_di_seg1)*Angstrom,xmax=(0.666359548+layer_distance/2-gate_distance1+gate_di_seg1+di_thickness1)*Angstrom,
    ymin=0*Angstrom,ymax=3.866*Angstrom,
    zmin=(buffer_cell+repeat_cell_electrode)*6.69611*Angstrom,zmax=6.69611*(repeat_cell+buffer_cell+repeat_cell_electrode)*Angstrom
    )

di2=di1(
    value=di_constant2,
    xmin=(1.118640452+layer_distance/2+gate_distance2-gate_di_seg2-di_thickness2)*Angstrom,xmax=(1.118640452+layer_distance/2+gate_distance2-gate_di_seg2)*Angstrom
    )

device_configuration.setDielectricRegions([di1,di2])

###############################################################
# Calculator
###############################################################



#----------------------------------------
# Basis Set
#----------------------------------------
basis_set = GGABasis.SingleZeta 

#----------------------------------------
# Exchange-Correlation
#----------------------------------------
exchange_correlation = GGA.PBE

#----------------------------------------
# Numerical Accuracy Settings
#----------------------------------------
left_electrode_numerical_accuracy_parameters = NumericalAccuracyParameters(
    k_point_sampling=(1, 300, 300),
    )

right_electrode_numerical_accuracy_parameters = NumericalAccuracyParameters(
    k_point_sampling=(1, 300, 300),
    )

#----------------------------------------
# Electrode Calculators
#----------------------------------------
left_electrode_calculator = LCAOCalculator(
    basis_set=basis_set,
    exchange_correlation=exchange_correlation,
    numerical_accuracy_parameters=left_electrode_numerical_accuracy_parameters,
    )

right_electrode_calculator = LCAOCalculator(
    basis_set=basis_set,
    exchange_correlation=exchange_correlation,
    numerical_accuracy_parameters=right_electrode_numerical_accuracy_parameters,
    )
for e_field in e_field_list:
    for e_gate in e_gate_list:
        e_field_volt=e_field*(di_thickness1/di_constant1+di_thickness2/di_constant2+layer_thickness+gate_distance1+gate_distance2-di_thickness1-di_thickness2)
        gate_bottom=gate1(value= (e_field_volt/2+e_gate/2.)*Volt)
        gate_top=gate2(value= (-e_field_volt/2+e_gate/2.)*Volt)
        device_configuration.setMetallicRegions([gate_bottom,gate_top])
        for e_volt in e_volt_list:
            electrode_volt=(e_volt/2.,-e_volt/2.)*Volt
            #----------------------------------------
            # Device Calculator
            #----------------------------------------
            calculator = DeviceLCAOCalculator(
                basis_set=basis_set,
                exchange_correlation=exchange_correlation,
                electrode_calculators=
                    [left_electrode_calculator, right_electrode_calculator],
                electrode_voltages=electrode_volt,
                numerical_accuracy_parameters=device_numerical
                )
            
            device_configuration.setCalculator(calculator)
            nlprint(device_configuration)
            device_configuration.update()
            nlsave(filename+'_ef'+str(e_field)+'_vg'+str(e_gate)+'_vb'+str(e_volt)+'.nc', device_configuration)
            
            #device_configuration = OptimizeGeometry(
            #        device_configuration,
            #        maximum_forces=0.05*eV/Ang,
            #        constraints=[],
            #        trajectory_filename=None,
            #    )
            #nlsave('silicene_opt.nc', device_configuration)
            #nlprint(device_configuration)
            #
            #total_energy = TotalEnergy(device_configuration)
            #nlsave(filename+'_ef'+str(e_field)+'_vg'+str(e_gate)+'_vb'+str(e_volt)+'.nc', total_energy)
            #nlprint(total_energy)
            
            transmission_spectrum = TransmissionSpectrum(
                configuration=device_configuration,
                energies=numpy.linspace(-0.5,0.5,500)*eV,
                kpoints=MonkhorstPackGrid(1,1000,1),
                energy_zero_parameter=AverageFermiLevel,
                infinitesimal=1e-06*eV,
                self_energy_calculator=KrylovSelfEnergy(),
                )
            nlsave(filename+'_ef'+str(e_field)+'_vg'+str(e_gate)+'_vb'+str(e_volt)+'.nc', transmission_spectrum)
            nlprint(transmission_spectrum)
            #device_density_of_states = DeviceDensityOfStates(
            #    configuration=device_configuration,
            #    energies=numpy.linspace(-0.5,0.5,500)*eV,
            #    kpoints=MonkhorstPackGrid(1,1000),
            #    contributions=All,
            #    energy_zero_parameter=AverageFermiLevel,
            #    infinitesimal=1e-06*eV,
            #    self_energy_calculator=KrylovSelfEnergy(),
            #    )
            #nlsave(filename+'DOS_ef'+str(e_field)+'_vg'+str(e_gate)+'_vb'+str(e_volt)+'.nc', device_density_of_states)
            #nlprint(device_density_of_states)
            nlprint('#Parameters!')
            print 'vt'
            print gate_top.value()
            print 'vb'
            print gate_bottom.value()
            print 'current'
            nlprint(transmission_spectrum.current())
            print filename+'_ef'+str(e_field)+'_vg'+str(e_gate)+'_vb'+str(e_volt)+'.nc'


print '#done'

Offline Forum Administrator

  • Forum Administrator
  • Administrator
  • Heavy QuantumATK user
  • *****
  • Posts: 52
  • Country: dk
  • Reputation: 0
    • View Profile
    • QuantumATK at Synopsys
Re: Trouble with Segmentation fault
« Reply #4 on: June 22, 2011, 04:54 »
First of all it does appear the default temperature is not stated correctly in the manual. Indeed it's 300 K. Sorry for the inconvenience, although for all practical purposes the difference is probably completely negligible, since the temperature only serves to smear the Fermi level a bit.

It does seem we have some problem with metallic and dielectric regions in DFT, and we are now implementing a new multigrid solver for 11.8 which should improve on this situation.

I'm not 100% sure it's a matter of running out of RAM, although it would be helpful for us if you could estimate how much RAM is needed with and without the regions for one of the jobs that did run through.

Offline Nordland

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 812
  • Reputation: 18
    • View Profile
Re: Trouble with Segmentation fault
« Reply #5 on: June 22, 2011, 08:17 »
There is a k-point sampling of (1,300,300). Are you sure that you want this k-point sampling?

Offline BlackBarrel

  • Heavy QuantumATK user
  • ***
  • Posts: 28
  • Country: cn
  • Reputation: 0
    • View Profile
Re: Trouble with Segmentation fault
« Reply #6 on: June 23, 2011, 02:57 »
There is a k-point sampling of (1,300,300). Are you sure that you want this k-point sampling?

Yes, it's the k-point set for the 2D-electrodes. What's wrong with it? Is it improper?

Offline BlackBarrel

  • Heavy QuantumATK user
  • ***
  • Posts: 28
  • Country: cn
  • Reputation: 0
    • View Profile
Re: Trouble with Segmentation fault
« Reply #7 on: June 23, 2011, 03:04 »
First of all it does appear the default temperature is not stated correctly in the manual. Indeed it's 300 K. Sorry for the inconvenience, although for all practical purposes the difference is probably completely negligible, since the temperature only serves to smear the Fermi level a bit.

It does seem we have some problem with metallic and dielectric regions in DFT, and we are now implementing a new multigrid solver for 11.8 which should improve on this situation.

I'm not 100% sure it's a matter of running out of RAM, although it would be helpful for us if you could estimate how much RAM is needed with and without the regions for one of the jobs that did run through.

Thank you! I'll try my script on a larger machine with 48G RAM and estimate the mem cost later. ;)

To my knowledge, the temperature may play an important role in the device current under small bias, e.g. 0.01V, of dual-gated bilayer graphene and other materials with a very small transmission gap. It should affect the on-off ratio to some extent (but I haven't tested it and will do it later as well).