Skip to content

Commit

Permalink
Fixed errors for MacOSx / Apple
Browse files Browse the repository at this point in the history
  • Loading branch information
hdrake committed Jun 12, 2022
1 parent f61416f commit c7978fa
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
13 changes: 11 additions & 2 deletions affinity/affinity.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,13 @@
**********************************************************************/
#define _GNU_SOURCE

#ifdef MACOS

int get_cpu_affinity(void) { return -1; };
void set_cpu_affinity( int cpu ) {};

#else

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
Expand Down Expand Up @@ -58,7 +65,6 @@ int get_cpu_affinity(void)
return -1;
}

int get_cpu_affinity_(void) { return get_cpu_affinity(); } /* Fortran interface */


/*
Expand Down Expand Up @@ -122,4 +128,7 @@ int set_cpu_affinity(int cpu)
return 0;
}

int set_cpu_affinity_(int *cpu) { return set_cpu_affinity(*cpu); } /* Fortran interface */
#endif

int get_cpu_affinity_(void) { return get_cpu_affinity(); } /* Fortran interface */
void set_cpu_affinity_(int *cpu) { return set_cpu_affinity(*cpu); } /* Fortran interface */
2 changes: 1 addition & 1 deletion mpp/mpp_parameter.F90
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ module mpp_parameter_mod
! combination with the flag parameter defined above to create a unique identifier for
! each Domain+flags combination. Therefore, the value of any flag must not exceed DOMAIN_ID_BASE.
! integer(LONG_KIND), parameter :: DOMAIN_ID_BASE=INT( 2**(4*LONG_KIND),KIND=LONG_KIND )
integer(LONG_KIND), parameter :: DOMAIN_ID_BASE=Z'0000000100000000' ! Workaround for 64bit init problem
integer(LONG_KIND), parameter :: DOMAIN_ID_BASE=INT(Z'0000000100000000') ! Workaround for 64bit init problem
integer, parameter :: NON_BITWISE_EXACT_SUM=0
integer, parameter :: BITWISE_EXACT_SUM=1
integer, parameter :: BITWISE_EFP_SUM=2
Expand Down

1 comment on commit c7978fa

@hdrake
Copy link
Owner Author

@hdrake hdrake commented on c7978fa Jun 12, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't really understand what I've done here, but it works for me...

I loosely followed Gael's comments here: ExeClim/Isca#211

Please sign in to comment.