experimenting with parallelization

class-solution
Daniel Pozsar 2 months ago
parent 9927641dbf
commit e715aa60f9

@ -2,7 +2,7 @@
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"execution_count": 24,
"metadata": {},
"outputs": [],
"source": [
@ -16,7 +16,7 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": 25,
"metadata": {},
"outputs": [
{
@ -26,13 +26,6 @@
"0.14.3\n",
"1.24.4\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"[Daniels-Air:70184] shmem: mmap: an error occurred while determining whether or not /var/folders/yh/dx7xl94n3g52ts3td8qcxjcc0000gn/T//ompi.Daniels-Air.501/jf.0/3256680448/sm_segment.Daniels-Air.501.c21d0000.0 could be created.\n"
]
}
],
"source": [
@ -65,7 +58,7 @@
},
{
"cell_type": "code",
"execution_count": 33,
"execution_count": 26,
"metadata": {},
"outputs": [
{
@ -76,7 +69,7 @@
" [ 100., 1000., 100.]])"
]
},
"execution_count": 33,
"execution_count": 26,
"metadata": {},
"output_type": "execute_result"
}
@ -90,7 +83,7 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": 53,
"metadata": {},
"outputs": [],
"source": [
@ -131,7 +124,7 @@
"]\n",
"\n",
"# Brilloun zone sampling and Green function contour integral\n",
"kset = 3\n",
"kset = 100\n",
"kdirs = \"xy\"\n",
"ebot = -13\n",
"eset = 300\n",
@ -143,7 +136,54 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": 54,
"metadata": {},
"outputs": [],
"source": [
"import matplotlib.pyplot as plt"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"300\n",
"100\n",
"3\n"
]
}
],
"source": [
"eset_space = np.linspace(0, eset - 1, eset, dtype=int)\n",
"kset_space = np.linspace(0, kset - 1, kset, dtype=int)\n",
"orient_space = np.linspace(\n",
" 0, len(ref_xcf_orientations) - 1, len(ref_xcf_orientations), dtype=int\n",
")\n",
"print(len(eset_space))\n",
"print(len(kset_space))\n",
"print(len(orient_space))"
]
},
{
"cell_type": "code",
"execution_count": 77,
"metadata": {},
"outputs": [],
"source": [
"from itertools import product\n",
"\n",
"combinations = product(eset_space, eset_space, eset_space)\n",
"asd = np.array_split(np.array(list(combinations)), 128)"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"outputs": [
{
@ -151,6 +191,7 @@
"output_type": "stream",
"text": [
"================================================================================================================================================================\n",
"SLURM job ID not found.\n",
"Input file: \n",
"/Users/danielpozsar/Downloads/nojij/Fe3GeTe2/monolayer/soc/lat3_791/Fe3GeTe2.fdf\n",
"Output file: \n",
@ -176,7 +217,7 @@
"Eset: 300\n",
"Esetp: 1000\n",
"================================================================================================================================================================\n",
"Setup done. Elapsed time: 37.226331 s\n",
"Setup done. Elapsed time: 3.275603625 s\n",
"================================================================================================================================================================\n"
]
}
@ -234,38 +275,21 @@
},
{
"cell_type": "code",
"execution_count": 27,
"execution_count": 6,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"4\n",
"[0 0 0 0]\n"
"Hamiltonian and exchange field rotated. Elapsed time: 3.976168875 s\n",
"================================================================================================================================================================\n"
]
}
],
"source": [
"orbs = []\n",
"magnetic_entities = read_grogupy_fdf(\"input.fdf\")[1]\n",
"for mag_ent in magnetic_entities:\n",
" orbs.append(parse_magnetic_entity(dh, **mag_ent))\n",
"\n",
"\n",
"asd = dh.o2a(orbs[6])\n",
"print(len(asd))\n",
"print(asd)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"hh, ss, NO = build_hh_ss(dh)\n",
"\n",
"hh, ss = build_hh_ss(dh)\n",
"NO = dh.no\n",
"\n",
"# symmetrizing Hamiltonian and overlap matrix to make them hermitian\n",
"for i in range(dh.lattice.sc_off.shape[0]):\n",
@ -277,7 +301,7 @@
"\n",
"\n",
"# identifying TRS and TRB parts of the Hamiltonian\n",
"TAUY = np.kron(np.eye(NO), tau_y)\n",
"TAUY = np.kron(np.eye(NO), TAU_Y)\n",
"hTR = np.array([TAUY @ hh[i].conj() @ TAUY for i in range(dh.lattice.nsc.prod())])\n",
"hTRS = (hh + hTR) / 2\n",
"hTRB = (hh - hTR) / 2\n",
@ -312,9 +336,18 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 8,
"metadata": {},
"outputs": [],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Site and pair dictionaries created. Elapsed time: 4.091688166 s\n",
"================================================================================================================================================================\n"
]
}
],
"source": [
"pairs, magnetic_entities = setup_pairs_and_magnetic_entities(\n",
" magnetic_entities, pairs, dh, simulation_parameters\n",
@ -332,9 +365,18 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 10,
"metadata": {},
"outputs": [],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"k set created. Elapsed time: 22.801980041 s\n",
"================================================================================================================================================================\n"
]
}
],
"source": [
"kset = make_kset(\n",
" dirs=simulation_parameters[\"kdirs\"], NUMK=simulation_parameters[\"kset\"]\n",
@ -342,8 +384,6 @@
"wkset = np.ones(len(kset)) / len(kset) # generate weights for k points\n",
"kpcs = np.array_split(kset, size) # split the k points based on MPI size\n",
"\n",
"if tqdm_imported:\n",
" kpcs[root_node] = tqdm(kpcs[root_node], desc=\"k loop\")\n",
"\n",
"if rank == root_node:\n",
" times[\"k_set_time\"] = timer()\n",
@ -353,6 +393,34 @@
" )"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"9"
]
},
"execution_count": 23,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# make energy contour\n",
"# we are working in eV now !\n",
"# and sisl shifts E_F to 0 !\n",
"cont = make_contour(\n",
" emin=simulation_parameters[\"ebot\"],\n",
" enum=simulation_parameters[\"eset\"],\n",
" p=simulation_parameters[\"esetp\"],\n",
")\n",
"eran = cont.ze"
]
},
{
"cell_type": "code",
"execution_count": null,

Loading…
Cancel
Save