File syscComm.h
Last update: 09.03.2026Location: syscComm.h
Classes
Includes
- SystemCouplingParticipant/LibraryType.hpp
- SystemCouplingParticipant/syscCommonTypes.h
- <stddef.h>
graph LR
1["syscComm.h"]
click 1 "syscComm_8h.md#syscComm_8h"
1 --> 2
1 --> 3
1 --> 4
2["SystemCouplingParticipant/LibraryType.hpp"]
3["SystemCouplingParticipant/syscCommonTypes.h"]
4["stddef.h"]
Typedefs
Typedef SyscHostAndPort
Definition: syscComm.h (line 28)
typedef struct SyscHostAndPort SyscHostAndPort
Provide a structure for host and port for remote connections.
Parameters:
- host: remote server host name
- port: remote server port number
Return type: struct SyscHostAndPort
Functions
Function syscCreateRootServer
SyscHostAndPort syscCreateRootServer(const char *host, unsigned short port)
Provide a function to create a remote server for connecting multiple applications.
If it is desired to connect multiple applications using the SCP library, the global root rank must create a remote server for client connections from other processes. This function creates this remote server and returns its host name and port number. Note that only the global root process should call this function.
The returned host and port structure provides the information for other processes to connect to the global root process. The connections are established during the invocation of one of the syscConnect* functions. See the SCP library developer's guide for more details.
Parameters:
- host: Host name for the remote server. If left empty, SCP library will automatically determine the host name and return the value. If the non-empty host name is provided, it will be respected and returned in the host and port structure.
- port: Port number for the remote server. If zero value is provided, SCP library will automatically determine the available port number on which the remote server is listening for incoming connections and return the value. If non-zero value is provided, SCP library will attempt to start the remote server on that port. If the requested port is not available, an error state will be returned.
Returns:
Host and port for the remote server. If any error occurs, an empty structure will be returned (empty host name, port 0).
Parameters:
- const char * host
- unsigned short port
Return type: SyscHostAndPort
Function syscGetMyRank
int syscGetMyRank()
Get the unique rank assigned to this process by the SCP library.
Return type: int
Function syscReduceSumUInt64
uint64_t syscReduceSumUInt64(uint64_t value)
Perform a reduction to get sum of value across all processes, connected by the SCP library.
Parameters:
- uint64_t value
Return type: uint64_t
Function syscReduceMaxDouble
double syscReduceMaxDouble(double value)
Perform a reduction to get max value across all processes, connected by the SCP library.
Parameters:
- double value
Return type: double
Source
/*
* Copyright ANSYS, Inc. Unauthorized use, distribution, or duplication is prohibited.
*/
#pragma once
#include "SystemCouplingParticipant/LibraryType.hpp"
#include "SystemCouplingParticipant/syscCommonTypes.h"
#include <stddef.h>
#ifdef __cplusplus
extern "C" {
#endif
typedef struct SyscHostAndPort {
char host[SYSC_STRING_LENGTH];
unsigned short port;
} SyscHostAndPort;
SyscHostAndPort syscCreateRootServer(const char* host, unsigned short port);
int syscGetMyRank();
uint64_t syscReduceSumUInt64(uint64_t value);
double syscReduceMaxDouble(double value);
#ifdef __cplusplus
}
#endif