Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
libnrm
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
argo
libnrm
Commits
de4c31fb
Commit
de4c31fb
authored
Feb 12, 2019
by
Florence Monna
Committed by
Swann Perarnau
Feb 12, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add Fortran interface for libnrm
parent
37e1a6ea
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
104 additions
and
3 deletions
+104
-3
configure.ac
configure.ac
+1
-1
libf_nrm.pc.in
libf_nrm.pc.in
+11
-0
src/Makefile.am
src/Makefile.am
+7
-1
src/downstream_api.c
src/downstream_api.c
+20
-1
src/f_downstream_api.c
src/f_downstream_api.c
+48
-0
src/f_nrm.h
src/f_nrm.h
+14
-0
src/nrm.h
src/nrm.h
+3
-0
No files found.
configure.ac
View file @
de4c31fb
...
...
@@ -37,5 +37,5 @@ AM_CONDITIONAL([PMPI_API],[test "x$pmpi" = xtrue])
AC_CONFIG_HEADERS([src/config.h])
AC_CONFIG_FILES([Makefile src/Makefile libnrm.pc])
AC_CONFIG_FILES([Makefile src/Makefile libnrm.pc
libf_nrm.pc
])
AC_OUTPUT
libf_nrm.pc.in
0 → 100644
View file @
de4c31fb
prefix=@prefix@
exec_prefix=@prefix@
libdir=@libdir@
includedir=@includedir@
Name: libf_nrm
Description: Argo Node Resource Manager Client API Fortran wrappers
Version: 0.0.1
Requires: libzmq libnrm
Libs: -L${libdir} -lnrm -lf_nrm
Cflags: -I${includedir}
src/Makefile.am
View file @
de4c31fb
...
...
@@ -2,13 +2,19 @@ AM_CPPFLAGS = @LIBZMQ_CFLAGS@
lib_LTLIBRARIES
=
libnrm.la
lib_LTLIBRARIES
+=
libf-nrm.la
if
PMPI_API
lib_LTLIBRARIES
+=
libnrm-pmpi.la
endif
libnrm_la_SOURCES
=
downstream_api.c nrm.h
libnrm_la_LIBADD
=
@LIBZMQ_LIBS@
libf_nrm_la_SOURCES
=
downstream_api.c f_downstream_api.c nrm.h
libf_nrm_la_LIBADD
=
@LIBZMQ_LIBS@
libnrm_pmpi_la_SOURCES
=
downstream_api.c mpi_api.c nrm.h
libnrm_pmpi_la_LIBADD
=
@LIBZMQ_LIBS@
include_HEADERS
=
nrm.h
include_HEADERS
=
nrm.h
f_nrm.h
src/downstream_api.c
View file @
de4c31fb
...
...
@@ -17,16 +17,34 @@
#include "nrm.h"
struct
nrm_context
*
nrm_ctxt_create
(
void
)
{
struct
nrm_context
*
ctxt
;
ctxt
=
calloc
(
1
,
sizeof
(
struct
nrm_context
));
assert
(
ctxt
!=
NULL
);
return
ctxt
;
}
int
nrm_ctxt_delete
(
struct
nrm_context
*
ctxt
)
{
assert
(
ctxt
!=
NULL
);
free
(
ctxt
);
return
0
;
}
int
nrm_init
(
struct
nrm_context
*
ctxt
,
const
char
*
uuid
)
{
assert
(
ctxt
!=
NULL
);
assert
(
uuid
!=
NULL
);
const
char
*
uri
=
getenv
(
NRM_ENV_URI
);
size_t
buff_size
;
if
(
uri
==
NULL
)
uri
=
NRM_DEFAULT_URI
;
ctxt
->
container_uuid
=
getenv
(
"ARGO_CONTAINER_UUID"
);
assert
(
ctxt
->
container_uuid
!=
NULL
);
ctxt
->
app_uuid
=
(
char
*
)
uuid
;
buff_size
=
strnlen
(
uuid
,
255
)
+
1
;
ctxt
->
app_uuid
=
malloc
(
buff_size
*
sizeof
(
char
));
strncpy
(
ctxt
->
app_uuid
,
uuid
,
buff_size
);
ctxt
->
context
=
zmq_ctx_new
();
ctxt
->
socket
=
zmq_socket
(
ctxt
->
context
,
ZMQ_DEALER
);
zmq_setsockopt
(
ctxt
->
socket
,
ZMQ_IDENTITY
,
ctxt
->
app_uuid
,
strnlen
(
uuid
,
255
));
...
...
@@ -49,6 +67,7 @@ int nrm_fini(struct nrm_context *ctxt)
snprintf
(
buf
,
512
,
NRM_EXIT_FORMAT
,
ctxt
->
app_uuid
);
int
err
=
zmq_send
(
ctxt
->
socket
,
buf
,
strnlen
(
buf
,
512
),
0
);
assert
(
err
>
0
);
free
(
ctxt
->
app_uuid
);
zmq_close
(
ctxt
->
socket
);
zmq_ctx_destroy
(
ctxt
->
context
);
return
0
;
...
...
src/f_downstream_api.c
0 → 100644
View file @
de4c31fb
#include "nrm.h"
#include <stdlib.h>
#include <stdint.h>
int
f_nrm_ctxt_create_
(
uintptr_t
*
ctxt
)
{
*
ctxt
=
nrm_ctxt_create
();
return
0
;
}
int
f_nrm_ctxt_delete_
(
uintptr_t
*
ctxt
)
{
return
nrm_ctxt_delete
(
*
((
struct
nrm_context
**
)
ctxt
));
}
int
f_nrm_init_
(
uintptr_t
*
ctxt
,
char
*
uuid_in
,
int
*
size
)
{
char
*
uuid
=
calloc
(
*
size
+
1
,
sizeof
(
char
));
int
i
,
err
;
for
(
i
=
0
;
i
<
*
size
;
i
++
)
{
uuid
[
i
]
=
uuid_in
[
i
];
if
(
uuid_in
[
i
]
==
' '
)
{
uuid
[
i
]
=
0
;
i
=
*
size
;
}
}
uuid
[
*
size
]
=
0
;
err
=
nrm_init
(
*
((
struct
nrm_context
**
)
ctxt
),
uuid
);
free
(
uuid
);
return
err
;
}
int
f_nrm_fini_
(
uintptr_t
*
ctxt
)
{
return
nrm_fini
(
*
((
struct
nrm_context
**
)
ctxt
));
}
int
f_nrm_send_progress_
(
uintptr_t
*
ctxt
,
unsigned
long
*
progress
)
{
return
nrm_send_progress
(
*
((
struct
nrm_context
**
)
ctxt
),
*
progress
);
}
int
f_nrm_send_phase_context_
(
uintptr_t
*
ctxt
,
unsigned
int
*
cpu
,
unsigned
int
*
aggregation
,
unsigned
long
long
int
*
computeTime
,
unsigned
long
long
int
*
totalTime
)
{
return
nrm_send_phase_context
(
*
((
struct
nrm_context
**
)
ctxt
),
*
cpu
,
*
aggregation
,
*
computeTime
,
*
totalTime
);
}
src/f_nrm.h
0 → 100644
View file @
de4c31fb
integer
NRM_PTR
parameter
(
NRM_PTR
=
8
)
integer
(
kind
=
NRM_PTR
)
f_nrm_ctxt_create
external
f_nrm_ctxt_create
integer
f_nrm_ctxt_delete
external
f_nrm_ctxt_delete
integer
(
kind
=
NRM_PTR
)
f_nrm_init
external
f_nrm_init
integer
f_nrm_fini
external
f_nrm_fini
integer
f_nrm_send_progress
external
f_nrm_send_progress
integer
f_nrm_send_phase_context
external
f_nrm_send_phase_context
src/nrm.h
View file @
de4c31fb
...
...
@@ -36,6 +36,9 @@ struct nrm_context {
#define NRM_PHASE_CONTEXT_FORMAT "{\"api\":\"down_event\",\"type\":\"phase_context\", \"cpu\": %u, \"aggregation\": %u, \"computetime\": %llu, \"totaltime\": %llu, \"application_uuid\": \"%s\"}"
#define NRM_EXIT_FORMAT "{\"api\": \"down_event\", \"type\":\"application_exit\"}"
struct
nrm_context
*
nrm_ctxt_create
(
void
);
int
nrm_ctxt_delete
(
struct
nrm_context
*
);
int
nrm_init
(
struct
nrm_context
*
,
const
char
*
);
int
nrm_fini
(
struct
nrm_context
*
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment