Skip to content

Conversation

@paullric
Copy link
Contributor

@paullric paullric commented Oct 4, 2021

No description provided.

@paullric paullric requested a review from vijaysm October 4, 2021 23:15
Copy link
Collaborator

@vijaysm vijaysm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed most of the smaller changes. Pending review on the lint algorithm itself and some other changes. Will do another round of reviews soon

mk/config.make Outdated
DEBUG= FALSE
OPT= TRUE
PARALLEL= NONE
PARALLEL= MPIOMP
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will this always be ON by default now ? What happens if MPI is not available locally ? For example, with conda builds, we only use serial GNU compilers. Though on second thought, they only use the autotools route

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will switch back to NONE

}

// Assign start time
gettimeofday(&m_tvStartTime, NULL);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is more portable to use the high_resolution_clock provided with standard C++11.

https://en.cppreference.com/w/cpp/chrono/high_resolution_clock

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can still have your FunctionTimer storing context and details on top - but sys/time.h is tricky to include portably.

AnnounceBanner();

#if !defined(TEMPEST_MPIOMP)
_EXCEPTIONT("TempestRemap was not compiled with MPI: Parallel operation not supported");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If MPI is unavailable, can it still default to running in serial ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I figure if you're running GneerateOverlapMeshParallel it should only work if parallelism is enabled.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure that is fair. I guess if someone wants to verify accuracy or look at scalability etc, they would still run on 1 process with MPI enabled anyway, rather than resorting to a MPI disabled build

/// Return value of lon is in the interval [0.0, 2.0 * M_PI)
/// </summary>
void ToLatLonRad(
double & lat,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this not be in CoordTransforms.h ?

src/OfflineMap.h Outdated
m_iTargetMask = iTargetMask;
void SetTargetMask(const std::vector<int> & iTargetMask) {
m_iTargetMask.Allocate(iTargetMask.size());
memcpy(&(m_iTargetMask[0]), &(iTargetMask[0]), iTargetMask.size() * sizeof(double));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is wrong! mask is an int vector. sizeof(double) should be sizeof(int). Same above for source mask also

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oof good catch

#if defined(OVERLAPMESH_USE_SORTED_MAP)
NodeMap nodemapOverlap;
#endif
#if defined(OVERLAPMESH_USE_UNSORTED_MAP)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't this either or type definition ? If for whatever reason you define both OVERLAPMESH_USE_SORTED_MAP and OVERLAPMESH_USE_UNSORTED_MAP, this will give a compiler error. And it is confusing in general for readability. Probably may be better to use a single macro that you can check with predefined macro int value like below:

#define OVERLAPMESH_USE_SORTED_MAP 0
#define OVERLAPMESH_USE_UNSORTED_MAP 1
#define OVERLAPMESH_NODEMAP OVERLAPMESH_USE_SORTED_MAP

#if OVERLAPMESH_NODEMAP == OVERLAPMESH_USE_SORTED_MAP
// 
#elif OVERLAPMESH_NODEMAP == OVERLAPMESH_USE_UNSORTED_MAP
//
#else
#endif

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants