Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Boz constants not allowed in select case construct #2

Open
ivan-pi opened this issue Jun 16, 2019 · 3 comments
Open

Boz constants not allowed in select case construct #2

ivan-pi opened this issue Jun 16, 2019 · 3 comments
Assignees

Comments

@ivan-pi
Copy link
Owner

ivan-pi commented Jun 16, 2019

The Intel Fortran compiler shows warning when compiling the read_graph and write_graph routines in metis_oo_interface.f90 due to the use of BOZ constants (e.g. b'001', b '101') in the select case construct used to discern different types of graphs.

One solution is to simply convert the Boz constant to integers with the int intrinsic, or simply code their integer values their directly (and put the binary pattern in a comment).

@ivan-pi ivan-pi self-assigned this Jun 16, 2019
@krober10nd
Copy link

krober10nd commented Aug 25, 2021

Yes, running into this one...Could you elaborate more on this please?

One solution is to simply convert the Boz constant to integers with the int intrinsic

@ivan-pi
Copy link
Owner Author

ivan-pi commented Aug 25, 2021

This only matters if you are using the read_graph or write_graph routines which are not thoroughly tested yet. If not, I would recommend simply copying metis_interface.f90 into your project.

Concerning the boz constants, the issue is here in the construct:

        select case(fmt)
        case(b'000')
           ! ...
        case(b'001') ! edge weights
           ! ...
        case(b'010') ! vertex weights
           ! ...
        case(b'100') ! vertex sizes
           ! ...
        case(b'011')
           ! ...
        case(b'110')
           ! ...
        case(b'101')
           ! ...
        case(b'111')
           ! ...
        case default
            write(*,*) '[write_graph] Error occured'
        end select

The boz constants of form b'001' must be replaced with int(b'001'). Or the integers could be coded directly, i.e.

b`000` -> 0
b`001` -> 1
b`010` -> 2
b`011` -> 3
b`100` -> 4
b`101` -> 5
b`110` -> 6
b`111` -> 7

and a comment block added to the code.

The same needs to be done at line 272 in metis_oo_interface.f90.

@krober10nd
Copy link

Thanks! I ended up just trimming this file. I really just need a subset of functions from the interface.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants