@ -7,26 +7,38 @@
"outputs": [],
"source": [
"# use numpy number of threads one\n",
"# from threadpoolctl import threadpool_info, threadpool_limits\n",
"# print(threadpool_info())\n",
"# from threadpoolctl import threadpool_info, threadpool_limits\n",
"# user_api = threadpool_info()[0][\"user_api\"]\n",
"# threadpool_limits(limits=1, user_api=user_api)"
"# threadpool_limits(limits=1, user_api=user_api)\n",
"# print(threadpool_info())"
]
},
{
"cell_type": "code",
"execution_count": null ,
"execution_count": 2 ,
"metadata": {},
"outputs": [
{
"ename": "ImportError",
"evalue": "attempted relative import with no known parent package",
"output_type": "error",
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mImportError\u001b[0m Traceback (most recent call last)",
"Cell \u001b[0;32mIn[6], line 5\u001b[0m\n\u001b[1;32m 2\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01mtimeit\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m default_timer \u001b[38;5;28;01mas\u001b[39;00m timer\n\u001b[1;32m 4\u001b[0m \u001b[38;5;28;01mimport\u001b[39;00m \u001b[38;5;21;01msisl\u001b[39;00m\n\u001b[0;32m----> 5\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01msrc\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01mgrogupy\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m \u001b[38;5;241m*\u001b[39m\n\u001b[1;32m 6\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01mmpi4py\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m MPI\n\u001b[1;32m 7\u001b[0m \u001b[38;5;28;01mimport\u001b[39;00m \u001b[38;5;21;01mwarnings\u001b[39;00m\n",
"\u001b[0;31mImportError\u001b[0m: attempted relative import with no known parent package"
"name": "stderr",
"output_type": "stream",
"text": [
"info:0: SislInfo: Please install tqdm (pip install tqdm) for better looking progress bars\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"0.14.3\n",
"1.24.4\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"[Daniels-Air:00184] shmem: mmap: an error occurred while determining whether or not /var/folders/yh/dx7xl94n3g52ts3td8qcxjcc0000gn/T//ompi.Daniels-Air.501/jf.0/273678336/sm_segment.Daniels-Air.501.10500000.0 could be created.\n"
]
}
],
@ -60,40 +72,53 @@
},
{
"cell_type": "code",
"execution_count": 3 ,
"execution_count": null ,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"[{'o': array([1., 0., 0.]),\n",
" 'vw': array([[0., 1., 0.],\n",
" [0., 0., 1.]])},\n",
" {'o': array([0., 1., 0.]),\n",
" 'vw': array([[1., 0., 0.],\n",
" [0., 0., 1.]])},\n",
" {'o': array([0., 0., 1.]),\n",
" 'vw': array([[1., 0., 0.],\n",
" [0., 1., 0.]])}]"
]
},
"execution_count": 3,
"metadata": {},
"output_type": "execute_result"
"name": "stdout",
"output_type": "stream",
"text": [
"[{'ai': 0, 'aj': 1, 'Ruc': array([0, 0, 0])}, {'ai': 0, 'aj': 2, 'Ruc': array([0, 0, 0])}, {'ai': 1, 'aj': 2, 'Ruc': array([0, 0, 0])}, {'ai': 0, 'aj': 2, 'Ruc': array([-1, -1, 0])}, {'ai': 1, 'aj': 2, 'Ruc': array([-1, -1, 0])}, {'ai': 0, 'aj': 2, 'Ruc': array([-1, 0, 0])}, {'ai': 1, 'aj': 2, 'Ruc': array([-1, 0, 0])}, {'ai': 1, 'aj': 2, 'Ruc': array([-2, 0, 0])}, {'ai': 1, 'aj': 2, 'Ruc': array([-3, 0, 0])}]\n"
]
}
],
"source": [
"# open fdf input\n",
"fdf = sisl.io.fdfSileSiesta(\"input.fdf\")\n",
"\n",
"fdf_parameters = dict()\n",
"fdf_parameters[\"infile\"] = fdf.get(\"InputFile\")\n",
"fdf_parameters[\"outfile\"] = fdf.get(\"OutputFile\")\n",
"fdf_parameters[\"scf_xcf_orientation\"] = np.array(fdf.get(\"ScfXcfOrientation\"))\n",
"\n",
"rotations = fdf.get(\"XCF_Rotation\")\n",
"my_rot = []\n",
"fdf _rot = []\n",
"for rot in rotations:\n",
" dat = np.array(rot.split(), dtype=float)\n",
" o = dat[:3]\n",
" vw = dat[3:]\n",
" vw = vw.reshape(2, 3)\n",
" my_rot.append(dict(o=o, vw=vw))\n",
"\n",
"my_rot"
" fdf_rot.append(dict(o=o, vw=vw))\n",
"fdf_parameters[\"ref_xcf_orientations\"] = fdf_rot\n",
"\n",
"pairs = fdf.get(\"Pairs\")\n",
"fdf_pairs = []\n",
"for fdf_pair in pairs:\n",
" dat = np.array(fdf_pair.split(), dtype=int)\n",
" my_pair = dict(ai=dat[0], aj=dat[1], Ruc=np.array(dat[2:]))\n",
" fdf_pairs.append(fdf_pair)\n",
"\n",
"pairs = fdf.get(\"Pairs\")\n",
"fdf_magnetic_entities = []\n",
"\n",
"fdf_parameters[\"kset\"] = fdf.get(\"INTEGRAL.Kset\")\n",
"fdf_parameters[\"kdirs\"] = fdf.get(\"INTEGRAL.Kdirs\")\n",
"fdf_parameters[\"ebot\"] = fdf.get(\"INTEGRAL.Ebot\")\n",
"fdf_parameters[\"eset\"] = fdf.get(\"INTEGRAL.Eset\")\n",
"fdf_parameters[\"esetp\"] = fdf.get(\"INTEGRAL.Esetp\")\n",
"fdf_parameters[\"parallel_solver_for_Gk\"] = fdf.get(\"GREEN.ParallelSolver\")\n",
"fdf_parameters[\"padawan_mode\"] = fdf.get(\"PadawanMode\")"
]
},
{