Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/arch/common/cc-msvc.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@

CMK_CC="$CHARMBIN/unix2nt_cc"
CMK_SEQ_CC="$CMK_CC"
CMK_CPP_C="$CMK_CC"
CMK_CXX="$CHARMBIN/unix2nt_cc"
CMK_LD="$CMK_CC"
Expand Down
22 changes: 3 additions & 19 deletions src/arch/win/unix2nt_cc
Original file line number Diff line number Diff line change
Expand Up @@ -15,30 +15,15 @@ set -o errexit
# Configurable option: Location of MSDEV
if [[ -z "$VCINSTALLDIR" ]]
then
VCC_DIR='C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC'
VCC_DIR='C:/Program Files/Microsoft Visual Studio/2022/Community/VC'
else
VCC_DIR="$VCINSTALLDIR"
fi
if [[ ! -d "$(cygpath -u "$VCC_DIR")" ]]
if [[ ! -d "$(cygpath.exe -u "$VCC_DIR")" ]]
then
echo "\$VCINSTALLDIR is not set properly: $VCC_DIR"
exit 1
fi
if [[ -n "$WINDOWSSDKDIR" ]]
then
SDK_DIR="$WINDOWSSDKDIR"
elif [[ -n "$WindowsSdkDir" ]]
then
SDK_DIR="$WindowsSdkDir"
else
SDK_DIR='C:/Program Files/Windows Kits/10'
fi
if [[ ! -d "$(cygpath -u "$SDK_DIR")" ]]
then
echo "\$WindowsSdkDir is not set properly: $SDK_DIR"
exit 1
fi

#CL command-line options for -O and -g mode
#only for the environment that has set corresponding environmental variables
CL_CMD='CL.EXE'
Expand Down Expand Up @@ -71,8 +56,7 @@ else
LINK_CMD="$VCC_DIR/BIN/LINK.EXE"
fi
LINK_COMMON=(-nologo -subsystem:console -DYNAMICBASE:NO)
LINK_POST=(ws2_32.lib kernel32.lib user32.lib psapi.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib -MACHINE:X64 -ERRORREPORT:PROMPT)

LINK_POST=(WS2_32.lib WSock32.lib kernel32.lib user32.lib psapi.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib -MACHINE:X64 -ERRORREPORT:PROMPT)
if [[ -z "$LIB" ]]
then
echo "Variables already set!"
Expand Down
15 changes: 9 additions & 6 deletions src/ck-perf/trace-common.C
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@
/*@{*/

#include <sys/stat.h>
#include <sys/types.h>

#if !defined(_WIN64)
#include <sys/types.h>
#endif
#include <ctime> // std::time_t, std::gmtime
#include <chrono> // std::chrono::system_clock

Expand All @@ -32,7 +34,7 @@

// To get hostname
#if defined(_WIN32) || defined(_WIN64)
# include <Winsock2.h>
//# include <Winsock2.h>
#else
# include <unistd.h>
# include <limits.h> // For HOST_NAME_MAX
Expand Down Expand Up @@ -145,7 +147,7 @@ static void traceCommonInit(char **argv)
// Trying to decide if the traceroot path is absolute or not. If it is not
// then create an absolute pathname for it.
if (temproot[0] != PATHSEP) {
temproot2 = GETCWD(NULL,0);
// temproot2 = GETCWD(NULL,0);
root = (char *)malloc(strlen(temproot2)+1+strlen(temproot)+1);
strcpy(root, temproot2);
strcat(root, PATHSEPSTR);
Expand Down Expand Up @@ -259,8 +261,9 @@ void traceWriteSTS(FILE *stsfp,int nUserEvents) {

// Add 1 for null terminator
char hostname[HOST_NAME_MAX + 1];
if(gethostname(hostname, HOST_NAME_MAX + 1) == 0)
fprintf(stsfp, "HOSTNAME \"%s\"\n", hostname);

//if(gethostname(hostname, HOST_NAME_MAX + 1) == 0)
// fprintf(stsfp, "HOSTNAME \"%s\"\n", hostname);

fprintf(stsfp, "COMMANDLINE \"");
int index = 0;
Expand All @@ -277,7 +280,7 @@ void traceWriteSTS(FILE *stsfp,int nUserEvents) {
using std::chrono::system_clock;
const time_t now = system_clock::to_time_t(system_clock::now());
struct tm currentTime;
#if defined(_WIN32) || defined(_WIN64)
#if defined(_WIN32) || defined(_WIN64) && !defined(__CYGWIN__)
gmtime_s(&currentTime, &now);
#else
gmtime_r(&now, &currentTime);
Expand Down
4 changes: 3 additions & 1 deletion src/ck-perf/trace-common.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,11 @@
#define PATHSEP '\\'
#define PATHSEPSTR "\\"
#else
#if !defined(_WIN64)
#include <unistd.h>
#endif
#define CHDIR chdir
#define GETCWD getcwd
//#define GETCWD getcwd
#define PATHSEP '/'
#define PATHSEPSTR "/"
#endif
Expand Down
24 changes: 12 additions & 12 deletions src/conv-core/cpuaffinity.C
Original file line number Diff line number Diff line change
Expand Up @@ -77,14 +77,14 @@ void CmiInitHwlocTopology(void)
depth != HWLOC_TYPE_DEPTH_UNKNOWN ? cmi_hwloc_get_nbobjs_by_depth(legacy_topology, depth) : 1;
}

#if CMK_HAS_SETAFFINITY || defined (_WIN32) || CMK_HAS_BINDPROCESSOR
#if CMK_HAS_SETAFFINITY || defined (_WIN32) || defined(_WIN64) || CMK_HAS_BINDPROCESSOR

#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
#include <errno.h>

#ifdef _WIN32
#if defined(_WIN32) || defined(_WIN64)
#include <windows.h>
#include <winbase.h>
#else
Expand All @@ -105,7 +105,7 @@ void CmiInitHwlocTopology(void)
static int excludecore[MAX_EXCLUDE] = {-1};
static int excludecount = 0;

#ifndef _WIN32
#if !defined(_WIN32) && !defined(_WIN64)
static int affMsgsRecvd = 1; // number of affinity messages received at PE0
static cpu_set_t core_usage; // used to record union of CPUs used by every PE in physical node
static int aff_is_set = 0;
Expand All @@ -131,7 +131,7 @@ static void add_exclude(int core)

static int set_process_affinity(hwloc_cpuset_t cpuset)
{
#ifdef _WIN32
#if defined(_WIN32) || defined (_WIN64)
HANDLE process = GetCurrentProcess();
# define PRINTF_PROCESS "%p"
#else
Expand Down Expand Up @@ -167,7 +167,7 @@ static int set_process_affinity(hwloc_cpuset_t cpuset)
#if CMK_SMP
static int set_thread_affinity(hwloc_cpuset_t cpuset)
{
#ifdef _WIN32
#if defined(_WIN32) || defined(_WIN64)
HANDLE thread = GetCurrentThread();
#else
pthread_t thread = pthread_self();
Expand Down Expand Up @@ -288,7 +288,7 @@ int print_cpu_affinity(void) {

#if CMK_SMP
int print_thread_affinity(void) {
#ifdef _WIN32
#if defined(_WIN32) || defined(_WIN64)
HANDLE thread = GetCurrentThread();
#else
pthread_t thread = pthread_self();
Expand Down Expand Up @@ -323,7 +323,7 @@ int CmiPrintCPUAffinity(void)
#endif
}

#ifndef _WIN32
#if !defined(_WIN32) && !defined(_WIN64)
int get_cpu_affinity(cpu_set_t *cpuset) {
CPU_ZERO(cpuset);
if (sched_getaffinity(0, sizeof(cpuset), cpuset) < 0) {
Expand Down Expand Up @@ -417,7 +417,7 @@ struct rankMsg {

struct affMsg {
char core[CmiMsgHeaderSizeBytes];
#ifndef _WIN32
#if !defined(_WIN32) && !defined(_WIN64)
cpu_set_t affinity;
#endif
};
Expand Down Expand Up @@ -696,7 +696,7 @@ static void cpuPhyNodeAffinityRecvHandler(void *msg)
static int count = 0;

affMsg *m = (affMsg *)msg;
#if !defined(_WIN32) && defined(CPU_OR)
#if !defined(_WIN32) && !defined(_WIN64) && defined(CPU_OR)
CPU_OR(&core_usage, &core_usage, &m->affinity);
affMsgsRecvd++;
#endif
Expand All @@ -706,7 +706,7 @@ static void cpuPhyNodeAffinityRecvHandler(void *msg)
cpuPhyAffCheckDone = true;
}

#if defined(_WIN32)
#if defined(_WIN32) || defined(_WIN64)
/* strtok is thread safe in VC++ */
#define strtok_r(x,y,z) strtok(x,y)
#endif
Expand Down Expand Up @@ -812,7 +812,7 @@ CLINKAGE int getXTNodeID(int mpirank, int nummpiranks);
*/
void CmiCheckAffinity(void)
{
#if !defined(_WIN32) && CMK_SMP && CMK_HAS_PTHREAD_SETAFFINITY && defined(CPU_OR)
#if !defined(_WIN32) && !defined(_WIN64) && CMK_SMP && CMK_HAS_PTHREAD_SETAFFINITY && defined(CPU_OR)

if (!CmiCpuTopologyEnabled()) return; // only works if cpu topology enabled

Expand Down Expand Up @@ -1097,7 +1097,7 @@ void CmiInitCPUAffinity(char **argv)
}

if (CmiMyRank() ==0) {
#ifndef _WIN32
#if !defined(_WIN32) && !defined(_WIN64)
aff_is_set = affinity_flag;
CPU_ZERO(&core_usage);
#endif
Expand Down
5 changes: 5 additions & 0 deletions src/scripts/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,11 @@ endif
-./system_ln ../tmp/conv-mach-opt.mak ../include
if [ -x ./special.sh ] ; then SRCBASE=$(SRCBASE) ./special.sh ; fi
if [ ! -f conv-common.h ] ; then ( touch conv-common.h ) ; fi
# in the special case of reusing netlrts for windows, nuke Makefile.machine to not build charmrun
if case $(CMK_VDIR) in *-win-*) true;; *) false;; esac; then \
rm ../tmp/Makefile.machine ;\
touch ../tmp/Makefile.machine ; \
fi
touch dirs+sources

###############################################################################
Expand Down
Loading