issp-center-dev / HPhi

Quantum Lattice Model Simulator Package
https://www.pasums.issp.u-tokyo.ac.jp/hphi/en/
GNU General Public License v3.0
91 stars 25 forks source link

Interesting bug when trying to run tutorial 1.1 stan1 #169

Open LazaruX512 opened 5 months ago

LazaruX512 commented 5 months ago

Info

HPhi asked me to run this script (↓) with expert mode

root@MyComputerName:/home/HPhi-3.5.2/src# ./HPhi -s stan.in

(HPhi Logo, taken away)

#####  Parallelization Info.  #####

  OpenMP threads : 8
  MPI PEs : 1

######  Input Parameter of Standard Intarface  ######

  Open Standard-Mode Inputfile stan.in

  KEYWORD : l                    | VALUE : 2
  KEYWORD : model                | VALUE : Spin
  KEYWORD : method               | VALUE : FullDiag
  KEYWORD : lattice              | VALUE : chain
  KEYWORD : j                    | VALUE : 0.5
  KEYWORD : 2sz                  | VALUE : 0
  KEYWORD : 2s                   | VALUE : 1

#######  Construct Model  #######

    CDataFileHead = zvo         ######  DEFAULT VALUE IS USED  ######

Sorry, specified combination,
    MODEL : spin
, LATTICE : chain
is unsupported in the STANDARD MODE...
Please use the EXPART MODE, or write a NEW FUNCTION and post us.

BTW, E X P E R T mode, not E X P A R T mode, dude!

root@MyComputerName:/home/HPhi-3.5.2/src# ./HPhi -e stan.in

(HPhi Logo, taken away, again)

#####  Parallelization Info.  #####

  OpenMP threads : 8
  MPI PEs : 1

  Read File 'stan.in'.
Error: Wrong keywords 'L' in stan.in.
Choose Keywords as follows:
CalcMod
ModPara
LocSpin
Trans
CoulombIntra
CoulombInter
Hund
PairHop
Exchange
InterAll
OneBodyG
TwoBodyG
PairLift
Ising
Boost
SingleExcitation
PairExcitation
SpectrumVec
Laser
TEOneBody
TETwoBody
ThreeBodyG
FourBodyG
SixBodyG
Error: Definition files(*.def) are incomplete.

Man! What can I say?

Misc

HPhi version: 3.5.2 Compiler: GCC System: Ubuntu 22.04 LTS (WSL, Windows Subsystem for Linux) from Microsoft Store on Windows 10 Pro 22H2 19045.4529 CPU: i5-10210U @ 1.60GHz 2.11GHz RAM: 16GB 2666MHz on board GPU: Intel UHD Graphics 620, no external GPU SSD: WD SN740 2TiB

k-yoshimi commented 5 months ago

Did you use the sample file in samples/tutorial1.1/stan1.in ? Though I downloaded HPhi v.3.5.2 and executed it using this sample, I cannot reproduce the error. By the way, I think that the UnsupportedSystem function in src/StdFace/StdFace_main.c was called in your system.

static void UnsupportedSystem( char model,//!<[in] char lattice//!<[in] ) { fprintf(stdout, "\nSorry, specified combination, \n"); fprintf(stdout, " MODEL : %s \n", model); fprintf(stdout, " LATTICE : %s, \n", lattice); fprintf(stdout, "is unsupported in the STANDARD MODE...\n"); fprintf(stdout, "Please use the EXPART MODE, or write a NEW FUNCTION and post us.\n"); StdFace_exit(-1); }/static void UnsupportedSystem/

As seen from this message, the error message should be

Sorry, specified combination, MODEL : spin LATTICE : chain, is unsupported in the STANDARD MODE...

However, your message is

Sorry, specified combination, MODEL : spin , LATTICE : chain is unsupported in the STANDARD MODE...

(The comma seems to be located in the front of LATTICE) Did you use your own StdFace solver ?

Finally, thank you for reporting typo "EXPART". We will fix it.

LazaruX512 commented 5 months ago

Did you use the sample file in samples/tutorial1.1/stan1.in ? Though I downloaded HPhi v.3.5.2 and executed it using this sample, I cannot reproduce the error. By the way, I think that the UnsupportedSystem function in src/StdFace/StdFace_main.c was called in your system.

static void UnsupportedSystem( char model,//!<[in] char lattice//!<[in] ) { fprintf(stdout, "\nSorry, specified combination, \n"); fprintf(stdout, " MODEL : %s \n", model); fprintf(stdout, " LATTICE : %s, \n", lattice); fprintf(stdout, "is unsupported in the STANDARD MODE...\n"); fprintf(stdout, "Please use the EXPART MODE, or write a NEW FUNCTION and post us.\n"); StdFace_exit(-1); }/static void UnsupportedSystem/

As seen from this message, the error message should be

Sorry, specified combination, MODEL : spin LATTICE : chain, is unsupported in the STANDARD MODE...

However, your message is

Sorry, specified combination, MODEL : spin , LATTICE : chain is unsupported in the STANDARD MODE...

(The comma seems to be located in the front of LATTICE) Did you use your own StdFace solver ?

Finally, thank you for reporting typo "EXPART". We will fix it.

Exactly, the file from samples folder Wait ... what is StdFace solver? I don't have much experience on coding or Linux-using kinda, I don't even know what is it XD Okay, though still doesn't know much about it, if "StdFace solver" is a config kinda, I haven't changed it then.

BTW, does "UnsupportedSystem" means HPhi won't support WSL? If I remember right, 9 months ago, I successfully compiled & run HPhi on Ubuntu WSL, or rather, is StdFace a new function of HPhi? I don't remember the version of Ubuntu though, might be 18.04 LTS or 20.04 LTS, I'll try if HPhi still works on them

k-yoshimi commented 5 months ago

StdFace is a tool for generating input files for the expert mode of HPhi which is automatically included in HPhi under building procedures. Since you use the original package, you don't mind the version of StdFace.

If the error messages are different regardless of human errors such as copying mistakes, I think it has something to do with the version of gcc. The internal process of HPhi is to first check the type of lattice and then go to the model, but even though the chain is defined in lattice, the check process there does not seem to be functioning properly.

Is it possible to tell us which gcc you are using, along with the version?

k-ido commented 5 months ago

@LazaruX512

Sorry, specified combination, MODEL : spin , LATTICE : chain is unsupported in the STANDARD MODE...

I can reproduce your error message by changing a newline character such as LF and CR in stan1.in. So, the reason why you cannot generate correct inputs of HPhi seems to be the difference of the newline character. Could you execute the following command and then restart HPhi? If you do not use nkf command in your system, please install nkf by using apt command.

nkf -Lu --overwrite stan1.in
HPhi -s stan1.in
LazaruX512 commented 5 months ago

StdFace is a tool for generating input files for the expert mode of HPhi which is automatically included in HPhi under building procedures. Since you use the original package, you don't mind the version of StdFace.

If the error messages are different regardless of human errors such as copying mistakes, I think it has something to do with the version of gcc. The internal process of HPhi is to first check the type of lattice and then go to the model, but even though the chain is defined in lattice, the check process there does not seem to be functioning properly.

Is it possible to tell us which gcc you are using, along with the version?

I don't understand why, when I trying to reproduce this phenomenon (reinstall Ubuntu 22.04 & compile), the HPhi is working fine

I'm now frustrating as you guys now

All those command after I reinstall Ubuntu 22.04 ↓

apt update
apt upgrade
apt installl gcc cmake golang-go gfortran liblapack-dev
cd (HPhi folder)
cmake -DCONFIG=gcc
make
cd src
./HPhi -s stan1.in # already copied from /HPhi_location/samples/tutorial_1.1/stan1.in
k-yoshimi commented 5 months ago

@LazaruX512 As k-ido said, it may be due to the different line break characters. Can you please refer to k-ido's comment, change the line feed code in the input file and see if you get the same error?

LazaruX512 commented 5 months ago

@LazaruX512 As k-ido said, it may be due to the different line break characters. Can you please refer to k-ido's comment, change the line feed code in the input file and see if you get the same error?

Hash of stan1 before & after nkf

nkf -Lu --overwrite stan1.in

↑ This command won't do anything to input file, the hash is same

I don't know why but it's working suddenly

Even strange, gcc hasn't update since March 2024, so, I'm using same gcc these days, but it won't work till now

k-ido commented 5 months ago

@LazaruX512 @k-yoshimi

Sorry, specified combination, MODEL : spin , LATTICE : chain is unsupported in the STANDARD MODE...

This error happens when we use the following command:

nkf -Lw --overwrite stan1.in
HPhi -s stan1.in

nkf -Lw --overwrite stan1.in change the line break character of stan1.in to CRLF, which is suitable for Windows system. We are distributing files with LF, so nkf -Lu --overwrite stan1.in does not change the line break character.

If you did not change the input before this error happens, please ignore my comment because the origin of this phenomenon may not relate to the definition of the line break character of inputs.

When you see this phenomenon again even using the same input file, it would be appreciated if you could tell us how to reproduce your problem.