This repository has been archived by the owner on Nov 7, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
No point developing completely from scratch - this is the work on mix…
…ing layer
- Loading branch information
1 parent
7c4a3e5
commit 971c3ad
Showing
34 changed files
with
18,991 additions
and
137 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
! FreeIPC - A library to allow Fortran programs that use MPI | ||
! to easily access shared memory within multicore nodes | ||
! Date - 23rd Oct Version 0.0 | ||
! Copyright(C) 2009 Ian Bush | ||
! | ||
! This library is free software; you can redistribute it and/or | ||
! modify it under the terms of the GNU Lesser General Public | ||
! License as published by the Free Software Foundation; either | ||
! version 3.0 of the License, or (at your option) any later version. | ||
! | ||
! This library is distributed in the hope that it will be useful, | ||
! but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
! Lesser General Public License for more details. | ||
! | ||
! You should have received a copy of the GNU Lesser General Public | ||
! License along with this library; if not, write to the Free Software | ||
! Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
! | ||
! | ||
! This library is released under LGPL. The full text of LGPL may be found | ||
! at http://www.gnu.org/licenses/lgpl-3.0.txt | ||
! | ||
! In particular, the terms of the GNU LGPL imply that you CAN use this library with | ||
! proprietary code with some restrictions (you can link, but not use the code directly). | ||
! Please consult the above URL for exact details. | ||
|
||
Type( c_ptr ) :: shmaddr | ||
|
||
! Check things are initialized | ||
If( .Not. Associated( FIPC_ctxt_world%initialized ) ) Then | ||
error = FIPC_not_initialized | ||
Return | ||
End If | ||
|
||
If( Size( n ) < rank ) Then | ||
error = FIPC_insufficient_dims | ||
End If | ||
|
||
Call segment_create( type, rank, Int( n( 1:rank ), c_long ), ctxt, shmaddr, error ) | ||
If( error /= 0 ) Then | ||
Return | ||
End If | ||
|
||
Call c_f_pointer( shmaddr, a, Int( n( 1:rank ), c_long ) ) | ||
|
||
error = FIPC_success | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
! FreeIPC - A library to allow Fortran programs that use MPI | ||
! to easily access shared memory within multicore nodes | ||
! Date - 23rd Oct Version 0.0 | ||
! Copyright(C) 2009 Ian Bush | ||
! | ||
! This library is free software; you can redistribute it and/or | ||
! modify it under the terms of the GNU Lesser General Public | ||
! License as published by the Free Software Foundation; either | ||
! version 3.0 of the License, or (at your option) any later version. | ||
! | ||
! This library is distributed in the hope that it will be useful, | ||
! but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
! Lesser General Public License for more details. | ||
! | ||
! You should have received a copy of the GNU Lesser General Public | ||
! License along with this library; if not, write to the Free Software | ||
! Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
! | ||
! | ||
! This library is released under LGPL. The full text of LGPL may be found | ||
! at http://www.gnu.org/licenses/lgpl-3.0.txt | ||
! | ||
! In particular, the terms of the GNU LGPL imply that you CAN use this library with | ||
! proprietary code with some restrictions (you can link, but not use the code directly). | ||
! Please consult the above URL for exact details. | ||
|
||
Type( FIPC_ctxt ) :: ctxt | ||
|
||
Type( segment_list_type ), Pointer :: p | ||
|
||
! Check things are initialized | ||
If( .Not. Associated( FIPC_ctxt_world%initialized ) ) Then | ||
error = FIPC_not_initialized | ||
Return | ||
End If | ||
|
||
If( .Not. Associated( a ) ) Then | ||
error = FIPC_free_null_pointer | ||
Return | ||
End If | ||
|
||
! First find the segment | ||
! Be careful to only look at segments that could possible be associated | ||
! with this pointer | ||
p => seg_list | ||
Do While( Associated( p ) ) | ||
If( p%data%type == type ) Then | ||
If( Size( p%data%sizes ) == Size( Shape( a ) ) ) Then | ||
If( All( p%data%sizes == Shape( a ) ) ) Then | ||
Call c_f_pointer( p%data%shmaddr, fp, p%data%sizes ) | ||
If( Associated( a, fp ) ) Then | ||
Exit | ||
End If | ||
End If | ||
End If | ||
End If | ||
p => p%next | ||
End Do | ||
|
||
If( .Not. Associated( p ) ) Then | ||
error = FIPC_seg_not_found | ||
Return | ||
End If | ||
|
||
If( debug ) Then | ||
ctxt = p%data%ctxt | ||
End If | ||
|
||
Call segment_free( p%data%shmid, error ) | ||
If( error /= FIPC_success ) Then | ||
Return | ||
End If | ||
|
||
a => Null() | ||
|
||
If( debug ) Then | ||
Call print_seg_list( ctxt ) | ||
End If | ||
|
||
error = FIPC_success | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.