xcoll 0.6.0__py3-none-any.whl → 0.6.2__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of xcoll might be problematic. Click here for more details.
- xcoll/general.py +1 -1
- xcoll/plot.py +1 -1
- {xcoll-0.6.0.dist-info → xcoll-0.6.2.dist-info}/METADATA +5 -4
- xcoll-0.6.2.dist-info/RECORD +61 -0
- {xcoll-0.6.0.dist-info → xcoll-0.6.2.dist-info}/WHEEL +1 -1
- xcoll/scattering_routines/fluka/flukaio/.git +0 -1
- xcoll/scattering_routines/fluka/flukaio/.gitignore +0 -2
- xcoll/scattering_routines/fluka/flukaio/CMakeLists.txt +0 -18
- xcoll/scattering_routines/fluka/flukaio/ComponentMakefile +0 -192
- xcoll/scattering_routines/fluka/flukaio/Makefile +0 -144
- xcoll/scattering_routines/fluka/flukaio/README +0 -26
- xcoll/scattering_routines/fluka/flukaio/doc/Doxyfile +0 -1551
- xcoll/scattering_routines/fluka/flukaio/doc/FlukaIO.asciidoc +0 -1054
- xcoll/scattering_routines/fluka/flukaio/doc/FlukaIO.epub +0 -0
- xcoll/scattering_routines/fluka/flukaio/doc/FlukaIO.html +0 -1607
- xcoll/scattering_routines/fluka/flukaio/doc/FlukaIO.pdf +0 -0
- xcoll/scattering_routines/fluka/flukaio/doc/FlukaIO__1.png +0 -0
- xcoll/scattering_routines/fluka/flukaio/doc/FlukaIO__2.png +0 -0
- xcoll/scattering_routines/fluka/flukaio/doc/FlukaIO__3.png +0 -0
- xcoll/scattering_routines/fluka/flukaio/doc/FlukaIO__4.png +0 -0
- xcoll/scattering_routines/fluka/flukaio/doc/FlukaIO__5.png +0 -0
- xcoll/scattering_routines/fluka/flukaio/doc/FlukaIO__6.png +0 -0
- xcoll/scattering_routines/fluka/flukaio/doc/FlukaIO__7.png +0 -0
- xcoll/scattering_routines/fluka/flukaio/doc/Makefile +0 -8
- xcoll/scattering_routines/fluka/flukaio/doc/docbook.xsl +0 -1690
- xcoll/scattering_routines/fluka/flukaio/include/Connection.h +0 -79
- xcoll/scattering_routines/fluka/flukaio/include/FlukaIO.h +0 -58
- xcoll/scattering_routines/fluka/flukaio/include/FlukaIOServer.h +0 -33
- xcoll/scattering_routines/fluka/flukaio/include/FortranFlukaIO.h +0 -277
- xcoll/scattering_routines/fluka/flukaio/include/Message.h +0 -89
- xcoll/scattering_routines/fluka/flukaio/include/ParticleInfo.h +0 -76
- xcoll/scattering_routines/fluka/flukaio/lib/libFlukaIO64.a +0 -0
- xcoll/scattering_routines/fluka/flukaio/lib/libFlukaIO64.so +0 -0
- xcoll/scattering_routines/fluka/flukaio/samples/ClientTest.c +0 -156
- xcoll/scattering_routines/fluka/flukaio/samples/ServerTest.c +0 -123
- xcoll/scattering_routines/fluka/flukaio/samples/fclient.f +0 -149
- xcoll/scattering_routines/fluka/flukaio/samples/fserver.f +0 -118
- xcoll/scattering_routines/fluka/flukaio/src/Connection.c +0 -264
- xcoll/scattering_routines/fluka/flukaio/src/Connection.d +0 -69
- xcoll/scattering_routines/fluka/flukaio/src/Connection.o +0 -0
- xcoll/scattering_routines/fluka/flukaio/src/FlukaIO.c +0 -211
- xcoll/scattering_routines/fluka/flukaio/src/FlukaIO.d +0 -46
- xcoll/scattering_routines/fluka/flukaio/src/FlukaIO.o +0 -0
- xcoll/scattering_routines/fluka/flukaio/src/FlukaIOHandshake.c +0 -45
- xcoll/scattering_routines/fluka/flukaio/src/FlukaIOHandshake.d +0 -29
- xcoll/scattering_routines/fluka/flukaio/src/FlukaIOHandshake.h +0 -17
- xcoll/scattering_routines/fluka/flukaio/src/FlukaIOHandshake.o +0 -0
- xcoll/scattering_routines/fluka/flukaio/src/FlukaIOServer.c +0 -84
- xcoll/scattering_routines/fluka/flukaio/src/FlukaIOServer.d +0 -70
- xcoll/scattering_routines/fluka/flukaio/src/FlukaIOServer.o +0 -0
- xcoll/scattering_routines/fluka/flukaio/src/FlukaIOServer_private.h +0 -22
- xcoll/scattering_routines/fluka/flukaio/src/FlukaIO_private.h +0 -16
- xcoll/scattering_routines/fluka/flukaio/src/FortranFlukaIO.c +0 -533
- xcoll/scattering_routines/fluka/flukaio/src/FortranFlukaIO.d +0 -40
- xcoll/scattering_routines/fluka/flukaio/src/FortranFlukaIO.o +0 -0
- xcoll/scattering_routines/fluka/flukaio/src/NetIO.c +0 -304
- xcoll/scattering_routines/fluka/flukaio/src/NetIO.d +0 -66
- xcoll/scattering_routines/fluka/flukaio/src/NetIO.h +0 -30
- xcoll/scattering_routines/fluka/flukaio/src/NetIO.o +0 -0
- xcoll/scattering_routines/fluka/flukaio/src/tags +0 -167
- xcoll/scattering_routines/fluka/flukaio/tests/AllTests.cpp +0 -8
- xcoll/scattering_routines/fluka/flukaio/tests/CommonTest.h +0 -10
- xcoll/scattering_routines/fluka/flukaio/tests/ConnectionTest.cpp +0 -99
- xcoll/scattering_routines/fluka/flukaio/tests/FlukaIOServerTest.cpp +0 -104
- xcoll/scattering_routines/fluka/flukaio/tests/FlukaIOTest.cpp +0 -439
- xcoll/scattering_routines/fluka/flukaio/tests/FortranFlukaIOTest.cpp +0 -682
- xcoll/scattering_routines/fluka/flukaio/tests/fakes/FakeConnection.c +0 -19
- xcoll/scattering_routines/fluka/flukaio/tests/fakes/FakeConnection.h +0 -16
- xcoll/scattering_routines/fluka/flukaio/tests/fakes/FakeFlukaIO.c +0 -74
- xcoll/scattering_routines/fluka/flukaio/tests/fakes/FakeFlukaIO.h +0 -50
- xcoll/scattering_routines/fluka/flukaio/tests/fakes/FakeFlukaIOHandshake.c +0 -16
- xcoll/scattering_routines/fluka/flukaio/tests/fakes/FakeFlukaIOHandshake.h +0 -20
- xcoll/scattering_routines/fluka/flukaio/tests/fakes/FakeFlukaIOServer.c +0 -12
- xcoll/scattering_routines/fluka/flukaio/tests/fakes/FakeFlukaIOServer.h +0 -18
- xcoll/scattering_routines/fluka/flukaio/tests/fakes/FakeFortranFlukaIO.h +0 -19
- xcoll/scattering_routines/fluka/flukaio/tests/fakes/FakeNetIO.c +0 -80
- xcoll/scattering_routines/fluka/flukaio/tests/fakes/FakeNetIO.h +0 -35
- xcoll-0.6.0.dist-info/LICENSE +0 -201
- xcoll-0.6.0.dist-info/NOTICE +0 -2
- xcoll-0.6.0.dist-info/RECORD +0 -135
- /LICENSE → /xcoll-0.6.2.dist-info/LICENSE +0 -0
- /NOTICE → /xcoll-0.6.2.dist-info/NOTICE +0 -0
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
#ifndef FLUKAIO_CONNECTION_H__
|
|
2
|
-
#define FLUKAIO_CONNECTION_H__
|
|
3
|
-
|
|
4
|
-
#include <stdlib.h>
|
|
5
|
-
#include <sys/types.h>
|
|
6
|
-
|
|
7
|
-
#include "Message.h"
|
|
8
|
-
|
|
9
|
-
#ifdef __cplusplus
|
|
10
|
-
extern "C" {
|
|
11
|
-
#endif
|
|
12
|
-
|
|
13
|
-
#define IN_BUFFER_LEN 10240
|
|
14
|
-
#define OUT_BUFFER_LEN 10240
|
|
15
|
-
|
|
16
|
-
// These two values are specified in seconds
|
|
17
|
-
#define DEFAULT_READ_TIMEOUT 3000
|
|
18
|
-
#define DEFAULT_WRITE_TIMEOUT 3000
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* Connection information
|
|
22
|
-
*/
|
|
23
|
-
typedef struct _flukaio_connection_t {
|
|
24
|
-
int fd; /**< Socket file descriptor */
|
|
25
|
-
|
|
26
|
-
char in_buffer[IN_BUFFER_LEN]; /**< Input data buffer */
|
|
27
|
-
size_t in_buffer_size; /**< Total size of the buffer (bytes) */
|
|
28
|
-
size_t in_buffer_len; /**< Length of the data in the buffer (bytes) */
|
|
29
|
-
size_t in_buffer_start; /**< Start position of the data in the buffer (bytes) */
|
|
30
|
-
size_t in_buffer_end; /**< End position of the data in the buffer (bytes) */
|
|
31
|
-
|
|
32
|
-
char out_buffer[OUT_BUFFER_LEN]; /**< Output data buffer */
|
|
33
|
-
size_t out_buffer_size; /**< Total size of the buffer (bytes) */
|
|
34
|
-
size_t out_buffer_len; /**< Length of the data in the buffer (bytes) */
|
|
35
|
-
|
|
36
|
-
int read_timeout; /**< Timeout for reading operations (seconds) */
|
|
37
|
-
int write_timeout; /**< Timeout for writing operations (seconds) */
|
|
38
|
-
|
|
39
|
-
int (*connect)(const char *host, int portnum);
|
|
40
|
-
|
|
41
|
-
ssize_t (*read)(int fd, void *buf, size_t n);
|
|
42
|
-
ssize_t (*write)(int fd, const void *buf, size_t len);
|
|
43
|
-
|
|
44
|
-
int (*can_write)(int fd, long timeout_sec, long timeout_usec);
|
|
45
|
-
int (*can_read)(int fd, long timeout_sec, long timeout_usec);
|
|
46
|
-
|
|
47
|
-
int (*set_nonblocking)(int fd);
|
|
48
|
-
int (*set_nodelay)(int fd);
|
|
49
|
-
} flukaio_connection_t;
|
|
50
|
-
|
|
51
|
-
flukaio_connection_t *connection_create(int fd);
|
|
52
|
-
int connection_connect(flukaio_connection_t *conn, const char *host, int port);
|
|
53
|
-
|
|
54
|
-
void connection_destroy(flukaio_connection_t *conn);
|
|
55
|
-
|
|
56
|
-
ssize_t connection_push_message(flukaio_connection_t * conn,
|
|
57
|
-
unsigned char type, const void *data, size_t datalen);
|
|
58
|
-
ssize_t connection_write(flukaio_connection_t *conn);
|
|
59
|
-
ssize_t connection_read(flukaio_connection_t *conn);
|
|
60
|
-
int connection_can_read(flukaio_connection_t *conn);
|
|
61
|
-
int connection_can_write(flukaio_connection_t *conn);
|
|
62
|
-
|
|
63
|
-
ssize_t connection_flush(flukaio_connection_t *conn);
|
|
64
|
-
|
|
65
|
-
int connection_set_read_timeout(flukaio_connection_t *conn, long timeout);
|
|
66
|
-
int connection_set_write_timeout(flukaio_connection_t *conn, long timeout);
|
|
67
|
-
|
|
68
|
-
ssize_t connection_write_message_bin(
|
|
69
|
-
const unsigned char type,
|
|
70
|
-
const void *data, const size_t datalen,
|
|
71
|
-
void *buf, const size_t buflen);
|
|
72
|
-
ssize_t connection_receive_message(flukaio_connection_t *conn, flukaio_message_t *msg);
|
|
73
|
-
ssize_t connection_read_message_from(flukaio_message_t *msg, const void *buffer, size_t buffer_len);
|
|
74
|
-
|
|
75
|
-
#ifdef __cplusplus
|
|
76
|
-
}
|
|
77
|
-
#endif
|
|
78
|
-
|
|
79
|
-
#endif
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
#ifndef FLUKAIO_FLUKAIO_H__
|
|
2
|
-
#define FLUKAIO_FLUKAIO_H__
|
|
3
|
-
|
|
4
|
-
#include <stdlib.h>
|
|
5
|
-
#include <stdint.h>
|
|
6
|
-
|
|
7
|
-
#include "Message.h"
|
|
8
|
-
#include "ParticleInfo.h"
|
|
9
|
-
#include "Connection.h"
|
|
10
|
-
|
|
11
|
-
#define FLUKAIO_MAJOR_VERSION 3
|
|
12
|
-
#define FLUKAIO_MINOR_VERSION 1
|
|
13
|
-
#define FLUKAIO_VERSION FLUKAIO_MAJOR_VERSION "." FLUKAIO_MINOR_VERSION
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* Maximum ratio of output buffer to be full before trying to send data
|
|
17
|
-
* for example with 0.8 the output buffer will be sent when the buffer is full over the
|
|
18
|
-
* 80% of its capacity.
|
|
19
|
-
*
|
|
20
|
-
* Set to 0 to disable caching
|
|
21
|
-
*/
|
|
22
|
-
#define FLUKAIO_OUT_CACHE 0.9
|
|
23
|
-
/** Maximum ratio of input buffer remaining before trying to read fron network.
|
|
24
|
-
* For example with a value of 0.2 it will only try to read from network when the buffer is at
|
|
25
|
-
* 20% or less of its capacity
|
|
26
|
-
*
|
|
27
|
-
* Set to 0 to disable caching
|
|
28
|
-
*/
|
|
29
|
-
#define FLUKAIO_IN_CACHE 0.1
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
#ifdef __cplusplus
|
|
33
|
-
extern "C" {
|
|
34
|
-
#endif
|
|
35
|
-
|
|
36
|
-
ssize_t flukaio_send_particle(flukaio_connection_t *conn, const particle_info_t *part);
|
|
37
|
-
ssize_t flukaio_send_ipt(flukaio_connection_t *conn, uint32_t turn, uint16_t ipt);
|
|
38
|
-
ssize_t flukaio_send_eob(flukaio_connection_t *conn);
|
|
39
|
-
ssize_t flukaio_send_eoc(flukaio_connection_t *conn);
|
|
40
|
-
ssize_t flukaio_send_int(flukaio_connection_t *conn, const int id, const int value);
|
|
41
|
-
ssize_t flukaio_send_double(flukaio_connection_t *conn, const int id, const double value);
|
|
42
|
-
ssize_t flukaio_send_npart(flukaio_connection_t *conn, const uint32_t npart);
|
|
43
|
-
ssize_t flukaio_send_hsk(flukaio_connection_t *conn, uint16_t major, uint16_t minor, uint32_t key);
|
|
44
|
-
|
|
45
|
-
ssize_t flukaio_receive_message(flukaio_connection_t *conn, flukaio_message_t *msg);
|
|
46
|
-
ssize_t flukaio_wait_message(flukaio_connection_t *conn, flukaio_message_t *msg);
|
|
47
|
-
|
|
48
|
-
flukaio_connection_t* flukaio_conn();
|
|
49
|
-
flukaio_connection_t* flukaio_connect(flukaio_connection_t *conn, const char *host, int port);
|
|
50
|
-
void flukaio_disconnect(flukaio_connection_t *conn);
|
|
51
|
-
|
|
52
|
-
extern int (*flukaio_handshake_client)(flukaio_connection_t * conn);
|
|
53
|
-
|
|
54
|
-
#ifdef __cplusplus
|
|
55
|
-
}
|
|
56
|
-
#endif
|
|
57
|
-
|
|
58
|
-
#endif
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
#ifndef FLUKAIO_FLUKAIOSERVER_H__
|
|
2
|
-
#define FLUKAIO_FLUKAIOSERVER_H__
|
|
3
|
-
|
|
4
|
-
#include "Connection.h"
|
|
5
|
-
|
|
6
|
-
#ifdef __cplusplus
|
|
7
|
-
extern "C" {
|
|
8
|
-
#endif
|
|
9
|
-
|
|
10
|
-
typedef struct {
|
|
11
|
-
int port;
|
|
12
|
-
int fd;
|
|
13
|
-
int (*start)(int *port, int *sockfd);
|
|
14
|
-
int (*accept)(int server_sockfd);
|
|
15
|
-
int (*shutdown)(int server_sockfd);
|
|
16
|
-
flukaio_connection_t* (*connection_create)(int);
|
|
17
|
-
} flukaio_server_t;
|
|
18
|
-
|
|
19
|
-
flukaio_server_t* flukaio_server_create();
|
|
20
|
-
int flukaio_server_start(flukaio_server_t* server, unsigned int port);
|
|
21
|
-
flukaio_connection_t *flukaio_server_accept(flukaio_server_t* server);
|
|
22
|
-
int flukaio_server_shutdown(flukaio_server_t* server);
|
|
23
|
-
|
|
24
|
-
int flukaio_server_get_port(flukaio_server_t* server);
|
|
25
|
-
|
|
26
|
-
extern int (*flukaio_handshake_server)(flukaio_connection_t * conn);
|
|
27
|
-
|
|
28
|
-
#ifdef __cplusplus
|
|
29
|
-
}
|
|
30
|
-
#endif
|
|
31
|
-
|
|
32
|
-
#endif
|
|
33
|
-
|
|
@@ -1,277 +0,0 @@
|
|
|
1
|
-
#ifndef FLUKAIO_FORTRANFLUKAIO_H__
|
|
2
|
-
#define FLUKAIO_FORTRANFLUKAIO_H__
|
|
3
|
-
|
|
4
|
-
#include <stdint.h>
|
|
5
|
-
|
|
6
|
-
#ifdef __cplusplus
|
|
7
|
-
extern "C" {
|
|
8
|
-
#endif
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* Initialize FlukaIO **Mandatory**
|
|
12
|
-
*/
|
|
13
|
-
int ntinit_();
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* wait and return number of particles to handle
|
|
17
|
-
* @param cid Connection ID
|
|
18
|
-
* @return number of particles to handle
|
|
19
|
-
*/
|
|
20
|
-
int ntnpart_(const int *cid);
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* wait and return the Brho nominal
|
|
24
|
-
* @param cid Connection ID
|
|
25
|
-
* @return -1 on error 0 on ok
|
|
26
|
-
*/
|
|
27
|
-
int ntbrho_(const int *cid, double *brho);
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* Receive message
|
|
31
|
-
* All parameters are output.
|
|
32
|
-
* @param cid Connection ID
|
|
33
|
-
* @param type Message type as defined in Message.h
|
|
34
|
-
* @param id Particle id
|
|
35
|
-
* @param gen Generation
|
|
36
|
-
* @param wgt Particle statistical weight
|
|
37
|
-
* @param x
|
|
38
|
-
* @param y
|
|
39
|
-
* @param z
|
|
40
|
-
* @param tx
|
|
41
|
-
* @param ty
|
|
42
|
-
* @param tz
|
|
43
|
-
* @param m
|
|
44
|
-
* @param pc
|
|
45
|
-
* @param t
|
|
46
|
-
* @param pdgid
|
|
47
|
-
* @param q
|
|
48
|
-
* @param sx
|
|
49
|
-
* @param sy
|
|
50
|
-
* @param sz
|
|
51
|
-
* @return message size if ok, -1 if error (disconnect, timeout, etc.)
|
|
52
|
-
*/
|
|
53
|
-
int ntrecv_(
|
|
54
|
-
const int *cid,
|
|
55
|
-
uint8_t *type,
|
|
56
|
-
uint32_t *id, uint32_t *gen,
|
|
57
|
-
double *wgt,
|
|
58
|
-
double *x, double *y, double *z,
|
|
59
|
-
double *tx, double *ty, double *tz,
|
|
60
|
-
double *m, double *pc,
|
|
61
|
-
double *t,
|
|
62
|
-
int32_t *pdgid, int16_t *q,
|
|
63
|
-
double *sx, double *sy, double *sz);
|
|
64
|
-
|
|
65
|
-
/**
|
|
66
|
-
* Wait message
|
|
67
|
-
* All params are output. Blocks process until a message is read
|
|
68
|
-
* @param cid Connection ID
|
|
69
|
-
* @param type Message type as defined in Message.h
|
|
70
|
-
* @param id Particle id
|
|
71
|
-
* @param gen Generation
|
|
72
|
-
* @param wgt Particle statistical weight
|
|
73
|
-
* @param x
|
|
74
|
-
* @param y
|
|
75
|
-
* @param z
|
|
76
|
-
* @param tx
|
|
77
|
-
* @param ty
|
|
78
|
-
* @param tz
|
|
79
|
-
* @param m
|
|
80
|
-
* @param pc
|
|
81
|
-
* @param t
|
|
82
|
-
* @param pdgid
|
|
83
|
-
* @param q
|
|
84
|
-
* @param sx
|
|
85
|
-
* @param sy
|
|
86
|
-
* @param sz
|
|
87
|
-
* @return message size if ok, -1 if error (disconnect, timeout, etc.)
|
|
88
|
-
*/
|
|
89
|
-
int ntwait_(
|
|
90
|
-
const int *cid,
|
|
91
|
-
uint8_t *type,
|
|
92
|
-
uint32_t *id, uint32_t *gen,
|
|
93
|
-
double *wgt,
|
|
94
|
-
double *x, double *y, double *z,
|
|
95
|
-
double *tx, double *ty, double *tz,
|
|
96
|
-
double *m, double *pc,
|
|
97
|
-
double *t,
|
|
98
|
-
int32_t *pdgid, int16_t *q,
|
|
99
|
-
double *sx, double *sy, double *sz);
|
|
100
|
-
|
|
101
|
-
/**
|
|
102
|
-
* Send particle
|
|
103
|
-
* @param cid Connection ID
|
|
104
|
-
* @param id Particle if
|
|
105
|
-
* @param wgt Particle statistical weight
|
|
106
|
-
* @param x
|
|
107
|
-
* @param y
|
|
108
|
-
* @param z
|
|
109
|
-
* @param tx
|
|
110
|
-
* @param ty
|
|
111
|
-
* @param tz
|
|
112
|
-
* @param m
|
|
113
|
-
* @param pc
|
|
114
|
-
* @param t
|
|
115
|
-
* @param pdgid
|
|
116
|
-
* @param q
|
|
117
|
-
* @param sx
|
|
118
|
-
* @param sy
|
|
119
|
-
* @param sz
|
|
120
|
-
* @return message size if ok, -1 if error
|
|
121
|
-
*/
|
|
122
|
-
int ntsendp_( const int *cid,
|
|
123
|
-
const uint32_t *id, const uint32_t *gen,
|
|
124
|
-
const double *wgt,
|
|
125
|
-
const double *x, const double *y, const double *z,
|
|
126
|
-
const double *tx, const double *ty, const double *tz,
|
|
127
|
-
const double *m, const double *pc,
|
|
128
|
-
const double *t,
|
|
129
|
-
const int32_t *pdgid, const int16_t *q,
|
|
130
|
-
const double *sx, const double *sy, const double *sz);
|
|
131
|
-
|
|
132
|
-
/**
|
|
133
|
-
* Send particle buffered
|
|
134
|
-
* @param cid Connection ID
|
|
135
|
-
* @param id Particle if
|
|
136
|
-
* @param wgt Particle statistical weight
|
|
137
|
-
* @param x
|
|
138
|
-
* @param y
|
|
139
|
-
* @param z
|
|
140
|
-
* @param tx
|
|
141
|
-
* @param ty
|
|
142
|
-
* @param tz
|
|
143
|
-
* @param aa
|
|
144
|
-
* @param zz
|
|
145
|
-
* @param m
|
|
146
|
-
* @param pc
|
|
147
|
-
* @param t
|
|
148
|
-
* @param pdgid
|
|
149
|
-
* @param q
|
|
150
|
-
* @param sx
|
|
151
|
-
* @param sy
|
|
152
|
-
* @param sz
|
|
153
|
-
* @return message size if ok, -1 if error
|
|
154
|
-
*/
|
|
155
|
-
int ntsendpbuf_(const int *cid,
|
|
156
|
-
const uint32_t *id, const uint32_t *gen,
|
|
157
|
-
const double *wgt,
|
|
158
|
-
const double *x, const double *y, const double *z,
|
|
159
|
-
const double *tx, const double *ty, const double *tz,
|
|
160
|
-
const double *m, const double *pc,
|
|
161
|
-
const double *t,
|
|
162
|
-
const int32_t *pdgid, const int16_t *q,
|
|
163
|
-
const double *sx, const double *sy, const double *sz);
|
|
164
|
-
|
|
165
|
-
/**
|
|
166
|
-
* Send End of Turn
|
|
167
|
-
* @param cid Connection ID
|
|
168
|
-
* @return message size if ok, -1 if error
|
|
169
|
-
*/
|
|
170
|
-
int ntsendeob_(const int *cid);
|
|
171
|
-
|
|
172
|
-
/**
|
|
173
|
-
* Send Insertion Point
|
|
174
|
-
* @param cid Connection ID
|
|
175
|
-
* @param turn Turn number of the current turn
|
|
176
|
-
* @param ipt Insertion Point number
|
|
177
|
-
* @return message size if ok, -1 if error
|
|
178
|
-
*/
|
|
179
|
-
int ntsendipt_(const int *cid, const uint32_t *turn, const uint16_t *ipt);
|
|
180
|
-
|
|
181
|
-
/**
|
|
182
|
-
* Send End of Computation
|
|
183
|
-
* @param cid Connection ID
|
|
184
|
-
* @return message size if ok, -1 if error
|
|
185
|
-
*/
|
|
186
|
-
int ntsendeoc_(const int *cid);
|
|
187
|
-
|
|
188
|
-
/**
|
|
189
|
-
* Send maximum number of particles
|
|
190
|
-
* @param npart number of particles
|
|
191
|
-
* @return message size if ok, -1 if error
|
|
192
|
-
*/
|
|
193
|
-
int ntsendnpart_(const int *cid, const uint32_t *npart);
|
|
194
|
-
|
|
195
|
-
/**
|
|
196
|
-
* Send nominal Brho
|
|
197
|
-
* @param brhono nominal Brho
|
|
198
|
-
* @return message size if ok, -1 if error
|
|
199
|
-
*/
|
|
200
|
-
int ntsendnbrhono_(const int *cid, const double *brhono);
|
|
201
|
-
|
|
202
|
-
int ntbrho_(const int *cid, double *brhono);
|
|
203
|
-
|
|
204
|
-
/**
|
|
205
|
-
* Set read timeout
|
|
206
|
-
* @param cid Connection ID
|
|
207
|
-
* @param seconds
|
|
208
|
-
* @return -1 if error
|
|
209
|
-
*/
|
|
210
|
-
int ntrtimeout_(const int *cid, const int *seconds);
|
|
211
|
-
|
|
212
|
-
/**
|
|
213
|
-
* Set write timeout
|
|
214
|
-
* @param cid Connection ID
|
|
215
|
-
* @param seconds
|
|
216
|
-
* @return -1 if error
|
|
217
|
-
*/
|
|
218
|
-
int ntwtimeout_(const int *cid, const int *seconds);
|
|
219
|
-
|
|
220
|
-
/* ***************************************
|
|
221
|
-
* Server management
|
|
222
|
-
* ***************************************/
|
|
223
|
-
|
|
224
|
-
/**
|
|
225
|
-
* Create a server instance and retunr its identifier
|
|
226
|
-
* @return server id or -1 ir error
|
|
227
|
-
*/
|
|
228
|
-
int ntserver_();
|
|
229
|
-
|
|
230
|
-
/**
|
|
231
|
-
* Start server and listen in port
|
|
232
|
-
* @param port port where to listen, (randomly assigned by system if 0)
|
|
233
|
-
* @return assigned port if ok, -1 if error
|
|
234
|
-
*/
|
|
235
|
-
int ntstart_(const int * serverid, int *port);
|
|
236
|
-
|
|
237
|
-
/**
|
|
238
|
-
* Blocks until incoming connection (as server)
|
|
239
|
-
* @return connection id, -1 if error
|
|
240
|
-
*/
|
|
241
|
-
int ntaccept_(const int *serverid);
|
|
242
|
-
|
|
243
|
-
/**
|
|
244
|
-
* Shutdown server
|
|
245
|
-
* Releases server resources
|
|
246
|
-
* @return 0 if ok, -1 if error
|
|
247
|
-
*/
|
|
248
|
-
int ntshdwn_(const int *serverid);
|
|
249
|
-
|
|
250
|
-
/**
|
|
251
|
-
* Get server Port
|
|
252
|
-
* @return Port number where the server is listening
|
|
253
|
-
*/
|
|
254
|
-
int ntgetport_(const int *serverid);
|
|
255
|
-
|
|
256
|
-
/**
|
|
257
|
-
* Connect to server
|
|
258
|
-
* @param host
|
|
259
|
-
* @param port
|
|
260
|
-
* @return connection id if success, -1 if error
|
|
261
|
-
*/
|
|
262
|
-
int ntconnect_(char *host, int *port, const long hostlen);
|
|
263
|
-
|
|
264
|
-
/**
|
|
265
|
-
* Finalize connection
|
|
266
|
-
* @param cid connection id
|
|
267
|
-
* @return 0 if success, -1 if error
|
|
268
|
-
*/
|
|
269
|
-
int ntend_(const int *cid);
|
|
270
|
-
|
|
271
|
-
char * create_fortran_string(const char *str, const long str_len);
|
|
272
|
-
|
|
273
|
-
#ifdef __cplusplus
|
|
274
|
-
}
|
|
275
|
-
#endif
|
|
276
|
-
|
|
277
|
-
#endif
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
#ifndef FLUKAIO_MESSAGE_H__
|
|
2
|
-
#define FLUKAIO_MESSAGE_H__
|
|
3
|
-
|
|
4
|
-
#include <stdint.h>
|
|
5
|
-
#include <stdlib.h>
|
|
6
|
-
#include "ParticleInfo.h"
|
|
7
|
-
|
|
8
|
-
#ifdef __cplusplus
|
|
9
|
-
extern "C" {
|
|
10
|
-
#endif
|
|
11
|
-
|
|
12
|
-
/** Message type type */
|
|
13
|
-
typedef uint8_t flukaio_message_type_t;
|
|
14
|
-
|
|
15
|
-
#pragma pack(1)
|
|
16
|
-
typedef struct { // Insertion point message
|
|
17
|
-
uint32_t turn;
|
|
18
|
-
uint16_t ipt;
|
|
19
|
-
} flukaio_ipt_data_t;
|
|
20
|
-
|
|
21
|
-
typedef struct { // Handshake
|
|
22
|
-
uint16_t major; // version
|
|
23
|
-
uint16_t minor;
|
|
24
|
-
uint32_t key; // random key
|
|
25
|
-
} flukaio_hsk_data_t;
|
|
26
|
-
|
|
27
|
-
typedef struct { // integer variable passing
|
|
28
|
-
uint16_t id; // variable id
|
|
29
|
-
int32_t value;
|
|
30
|
-
} flukaio_int_data_t;
|
|
31
|
-
|
|
32
|
-
typedef struct { // double variable passing
|
|
33
|
-
uint16_t id; // variable id
|
|
34
|
-
double value;
|
|
35
|
-
} flukaio_dble_data_t;
|
|
36
|
-
#pragma pack()
|
|
37
|
-
|
|
38
|
-
enum flukaio_int_id_e {
|
|
39
|
-
N_NPART = 0x0
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
enum flukaio_dble_id_e {
|
|
43
|
-
N_BRHONO = 0x0
|
|
44
|
-
};
|
|
45
|
-
|
|
46
|
-
// Message lengths
|
|
47
|
-
#define MSG_HEADER_LEN (sizeof(uint16_t)+sizeof(flukaio_message_type_t))
|
|
48
|
-
|
|
49
|
-
/** Message types */
|
|
50
|
-
enum flukaio_message_type_e {
|
|
51
|
-
N_ERR = 0x00,
|
|
52
|
-
N_PART = 0x01,
|
|
53
|
-
N_EOB = 0x02,
|
|
54
|
-
N_END = 0x03,
|
|
55
|
-
N_CONF = 0x04,
|
|
56
|
-
N_IPT = 0x05,
|
|
57
|
-
N_HSK = 0x06,
|
|
58
|
-
N_INT = 0x07,
|
|
59
|
-
N_DBLE = 0x08,
|
|
60
|
-
N_OTHER = 0xff
|
|
61
|
-
};
|
|
62
|
-
|
|
63
|
-
/**
|
|
64
|
-
* Network message
|
|
65
|
-
*
|
|
66
|
-
* With uint16_t size the maximum size for data is 2^16-3 (3 is header length)
|
|
67
|
-
*/
|
|
68
|
-
#pragma pack(1)
|
|
69
|
-
typedef struct {
|
|
70
|
-
uint16_t size; /**< Total size in bytes of the message (including headers) */
|
|
71
|
-
flukaio_message_type_t type; /**< Type of message */
|
|
72
|
-
|
|
73
|
-
// data field, depending on the size, can contain a particle, an ipt or hsk
|
|
74
|
-
union _data {
|
|
75
|
-
particle_info_t particle;
|
|
76
|
-
flukaio_ipt_data_t ipt;
|
|
77
|
-
flukaio_hsk_data_t hsk;
|
|
78
|
-
flukaio_int_data_t varint;
|
|
79
|
-
flukaio_dble_data_t vardouble;
|
|
80
|
-
} data;
|
|
81
|
-
|
|
82
|
-
} flukaio_message_t;
|
|
83
|
-
#pragma pack()
|
|
84
|
-
|
|
85
|
-
#ifdef __cplusplus
|
|
86
|
-
}
|
|
87
|
-
#endif
|
|
88
|
-
|
|
89
|
-
#endif
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
#ifndef FLUKAIO_PARTICLE_INFO_H__
|
|
2
|
-
#define FLUKAIO_PARTICLE_INFO_H__
|
|
3
|
-
|
|
4
|
-
#include <stdint.h>
|
|
5
|
-
|
|
6
|
-
#ifdef __cplusplus
|
|
7
|
-
extern "C" {
|
|
8
|
-
#endif
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* Stores particle data as sent through the network
|
|
12
|
-
* Always using Fluka units
|
|
13
|
-
*
|
|
14
|
-
* Fields:
|
|
15
|
-
*
|
|
16
|
-
* - Particle identification:
|
|
17
|
-
* - id: Particle id
|
|
18
|
-
* - gen: Particle generation
|
|
19
|
-
* - Particle info:
|
|
20
|
-
* - x: Position in x (cm.)
|
|
21
|
-
* - y: Position in y (cm.)
|
|
22
|
-
* - z: Position in z (cm.)
|
|
23
|
-
* - tx: Director cosine in x
|
|
24
|
-
* - ty: Director cosine in y
|
|
25
|
-
* - tz: Director cosine in z
|
|
26
|
-
* - m: Rest mass (GeV/c^2)
|
|
27
|
-
* - p: Momentum (GeV/c)
|
|
28
|
-
* - t: Time
|
|
29
|
-
* - q: Charge
|
|
30
|
-
* - pdgid: PDG id number
|
|
31
|
-
* - sx: x component of the particle spin
|
|
32
|
-
* - sy: y component of the particle spin
|
|
33
|
-
* - sz: z component of the particle spin
|
|
34
|
-
* - Particle metadata:
|
|
35
|
-
* - Weight: statistical weight (goes from 0.0 to 1.0)
|
|
36
|
-
*
|
|
37
|
-
*/
|
|
38
|
-
|
|
39
|
-
#pragma pack(1)
|
|
40
|
-
typedef struct {
|
|
41
|
-
/* Particle identification */
|
|
42
|
-
uint32_t id;
|
|
43
|
-
uint32_t gen;
|
|
44
|
-
|
|
45
|
-
/* Particle attributtes */
|
|
46
|
-
double x;
|
|
47
|
-
double y;
|
|
48
|
-
double z;
|
|
49
|
-
double tx;
|
|
50
|
-
double ty;
|
|
51
|
-
double tz;
|
|
52
|
-
double m;
|
|
53
|
-
double pc;
|
|
54
|
-
double t;
|
|
55
|
-
|
|
56
|
-
/* Particle spin */
|
|
57
|
-
double sx;
|
|
58
|
-
double sy;
|
|
59
|
-
double sz;
|
|
60
|
-
|
|
61
|
-
int32_t pdgid;
|
|
62
|
-
|
|
63
|
-
/* Particle charge */
|
|
64
|
-
int16_t q;
|
|
65
|
-
|
|
66
|
-
/* Particle metadata */
|
|
67
|
-
double weight;
|
|
68
|
-
|
|
69
|
-
} particle_info_t;
|
|
70
|
-
#pragma pack()
|
|
71
|
-
|
|
72
|
-
#ifdef __cplusplus
|
|
73
|
-
}
|
|
74
|
-
#endif
|
|
75
|
-
|
|
76
|
-
#endif
|
|
Binary file
|
|
Binary file
|